IMX8MQ + DSI host controller support at U-boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MQ + DSI host controller support at U-boot

60,198 Views
jemish_1990
Contributor IV

Hi All,

We are working product based on IMX8MQ (MIMX8MQ6DVAJZAA) processor. 

  • We have LCD working fine at kernel level.  In our system LCD is driven by eLCDIF controller via MIPI DSI controller.
  • Now we want to make LCD working u-boot level. But unfortunately I see that till now NXP hasn't provide DSI host controller support at U-boot.
  • Is there any limitation for that ?
  • I have already started development for it. But not able to read/write any DSI host controller registers at u-boot level.
  • Can anyone provide me minimum clock configuration at u-boot level so atleast I can read/write DSI host controller registers.
  • Any suggestion or hint in this regard will appreciated.

Thanks,

Jemish

0 Kudos
Reply
26 Replies

57,889 Views
sd05
Contributor III

Also taking the above approach i have some clk_enable, clk_get_rate and clk_set_rate apis which i enable by adding the CONFIG_CLK and CONFIG_IMX_CLK but after that the board is getting reboot

so I have explicitly enabled the mipi dsi and lcdif clock from board file

 

0 Kudos
Reply

57,867 Views
jemish_1990
Contributor IV

Hi,

I am attaching unofficial patch shared by NXP which has been verified on RM67191. By taking reference of this commit we managed to make uboot logo work on our unit. Hope it will help!!

Thanks,

Jemish

57,363 Views
sd05
Contributor III

Hello @jemish_1990 

I want to display the bmp images after we get uboot CLI prompt using bmp display. I have managed to initialise panel and all the register values are set to proper everything goes alright still I am not able to get display.

There is no doubt on init sequence as it is working in kernel. Using all pixel on command of ST7703 we are able to get the all pixel on.

Still what we write on frame buffer is not updated on panel and bmp command is also not working. Getting something like this in logs on giving bmp display. 

u-boot=> bmp d $splashimage video_bmp_display() hdr_size=40, bmp_bpix=24 video_bmp_display() Display-bmp: 800 x 480 with 16777216 colours, display 1 please guide what is getting wrong.

Can you give any pointer regarding this issue?

Thanks in advance!

0 Kudos
Reply

57,824 Views
sd05
Contributor III

Hello @jemish_1990 and @nxp 

having a few question:

1. Which version of u-boot you were using?

2. And are there other changes that you did to get the display in uboot other that in patch? if you can also share if any that will be really helpful..

3. we are working on imx8mm based processor so do you see any challenge in this and a st7703 based panel

4. What do you think which are the changes we need to do considering that we are using imx8mm

====================================================================

We really need urgent help on this as we already had missed the deadline for the task and not getting any proper reference for the same other than the one you shared so that will be very helpful if you can guide us with this.

thanks!

0 Kudos
Reply

57,804 Views
jemish_1990
Contributor IV

Hi,

  1. We are using U-boot version "U-Boot SPL 2018.03"
  2. Our display is 1280x800 and it also included LVDS to MIPI converter chip so for that I need to add correct power sequence via GPIO, driver for converter chip and did some changes related to eLCDIF clock value. I didn't add those changes in commit I provided as it will create confusion rather than helping you.
  3. I have no idea what is difference between IMX8MQ vs IMX8MM processor. So for that you need to map this code do relevant changes if requires.

Good luck!

Thanks,

Jemish

0 Kudos
Reply

54,428 Views
pyh0603
Contributor III

Hello @jemish_1990 

I have already implemented LCD logo display in Uboot in image android_p9.0.0_1.0.0-ga_image_8mqevk.tar.gz, but it uses Uboot version 2018.03, while I am currently using Uboot version 2021.04 in image android_p11.0.0_2.6.0. There is a significant difference between the two uboot versions.

Is there a patch for version uboot.2021.04 available?

Looking forward to your reply

 

0 Kudos
Reply

54,417 Views
jemish_1990
Contributor IV

Hi @pyh0603 

Unfortunately we don't have patch for Uboot version 2021.04 .

 

Thanks,

Jemish

0 Kudos
Reply

57,854 Views
sd05
Contributor III

Thanks @jemish_1990

Tags (1)
0 Kudos
Reply

57,903 Views
sd05
Contributor III

Hello @jemish_1990 and The NXP community

We are working on a product based on IMX8MM processor.

I am also facing the same issue and similar requirement (we need to show the battery status at u-boot on LCD )

I tried to port the driver taking reference of kernel but unable to read/write from panel through driver.
I followed following steps:

Step-1 Added the dsi_host user class which is not in present u-boot version( U-Boot 2019.04-lf-5.4.y_v2019.04_var01+gbf77d94114)

https://elixir.bootlin.com/u-boot/latest/source/drivers/video/dsi-host-uclass.c#L37

https://elixir.bootlin.com/u-boot/latest/C/ident/UCLASS_DSI_HOST

Step-2 Added the MIPI DSI host controller driver
https://elixir.bootlin.com/u-boot/latest/source/drivers/video/dw_mipi_dsi.c#L846

Step-3 Added the mipi_display.c that contains a set of dsi helpers function

https://elixir.bootlin.com/u-boot/latest/source/drivers/video/mipi_dsi.c

Step-4 Added the panel driver taking reference of the following
https://elixir.bootlin.com/u-boot/latest/source/drivers/video/raydium-rm68200.c

Step-5 We added videobridge that can connect/bind the dsi-host controller and the panel driver

https://elixir.bootlin.com/u-boot/latest/source/drivers/video/stm32/stm32_dsi.c#L509

Step-6 added Lcdif support taking some reference from this

https://elixir.bootlin.com/u-boot/latest/source/drivers/video/stm32/stm32_ltdc.c#L469

Step-7 done changes in dtsi taking this reference dtsi

https://elixir.bootlin.com/u-boot/latest/source/arch/arm/dts/stm32f769-disco-u-boot.dtsi#L80

Step-8 Tried to probe UCLASS_VIDEO from board file using the uboot_probe_all

After all this getting timeout while reading from register @jemish_1990  were you able to get the logo on the LCD please share your knowledge with us.

Thanks in advance!

 

0 Kudos
Reply

58,612 Views
Dio_HUI
Contributor I

Hi Jemish:

Our products also use IMx8MQ, and we hope to display the LOGO in the Uboot stage. Do you currently solve the output function of IMx8MQ in the Uboot stage?

 

Thanks,

Dio

0 Kudos
Reply

58,685 Views
jemish_1990
Contributor IV

Hi All,

Any update on this?

Thanks,

Jemish

0 Kudos
Reply

58,685 Views
joanxie
NXP TechSupport
NXP TechSupport

yes, uboot don't configure lcd panel, why do you need configure this in the uboot level? you can refer to the board file in the uboot, maybe you can add your panel in the uboot file, I don't test this

imx8mq_evk.c\imx8mq_evk\freescale\board - uboot-imx - i.MX U-Boot 

0 Kudos
Reply

58,684 Views
jemish_1990
Contributor IV

Hi Joan,

>> 

maybe you can add your panel in the uboot file, I don't test this

imx8mq_evk.c\imx8mq_evk\freescale\board - uboot-imx - i.MX U-Boot   <<

It's not that simple that we will add structure for panel in existing board file and it will work. As I said in our system LCD is driven by eLCDIF controller via MIPI DSI controller. We must need to add DSI host controller support at uboot level. 

Do you any suggestion for that?

Thanks,

Jemish

0 Kudos
Reply

58,684 Views
joanxie
NXP TechSupport
NXP TechSupport

imx8M use LCDIF, maybe you can refer to the link as below, but this link is for IPU, you couldn't apply them directly, but you can refer to it

https://community.nxp.com/docs/DOC-98109 

0 Kudos
Reply

58,684 Views
jemish_1990
Contributor IV

Hi Joan,

I already have the patch you suggested but it won't help as it is for IPU.

Let's make my question simple. Can you provide me DSI clock/power initialization sequence at U-boot so atleast I can read/write DSI registers.

Thanks,

Jemish

0 Kudos
Reply

58,684 Views
joanxie
NXP TechSupport
NXP TechSupport

yes, imx8mq uses lcdif, this patch is for IPU, just for reference, we don't have specific source code for imx8mq, for mipi dsi init, you can refer to the dts file:

fsl-imx8mq.dtsi\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel 

if you need keep the logo in the kernel, when kernel load lcdif driver, try to keep the lcdif settings, like clock from changing

0 Kudos
Reply

58,684 Views
jemish_1990
Contributor IV
Hi Joan,
Yes I checked but we are already using this device tree file in kernel. And by taking reference of that device tree I started development of DSI host controller on u-boot level. But we need clear initialization sequence because kernel clock architecture  and u-boot clock architecture are different in terms of implementation.
As we have section of  LCDIF clock in uboot:
File :  arch/arm/mach-imx/imx8m/clock_imx8mq.c
void mxs_set_lcdclk(u32 base_addr, u32 freq)
{
        /*
         * LCDIF_PIXEL_CLK: select 800MHz root clock,
         * select pre divider 8, output is 100 MHz
         */
        clock_set_target_val(LCDIF_PIXEL_CLK_ROOT, CLK_ROOT_ON |
                             CLK_ROOT_SOURCE_SEL(4) |
                             CLK_ROOT_PRE_DIV(CLK_ROOT_PRE_DIV8));
}
It will be good if NXP can provide similar code for DSI host controller. I have already tried as per my understanding but it didn't help.
Thanks,
Jemish
0 Kudos
Reply

58,685 Views
joanxie
NXP TechSupport
NXP TechSupport

you can find clock file in the driver:

clk\drivers - linux-imx - i.MX Linux kernel 

you also can refer to the document about how to calculate dsi clock

https://community.nxp.com/docs/DOC-345307 

0 Kudos
Reply

58,685 Views
jemish_1990
Contributor IV

Hi Joan,

I have all the clock values and I printed those clock values in kernel.

But still I am missing something critical and that's why I need help of NXP to provide me clock/power initialization of DSI at u-boot level.

Thanks,

Jemish

0 Kudos
Reply

58,685 Views
jemish_1990
Contributor IV

Hi All,

Any update on this? May I know why NXP has not added support of DSI host on u-boot yet?

Thanks,

Jemish

0 Kudos
Reply