Skip to contentSkip to conversation

pico-imx7: Disable video support

PATCH New Fabio Estevam 3 participants 14 messages Mar 23, 2019 – Mar 26, 2019 Arm i.MX and Layerscape

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 pico-imx7: Disable video support

Since commit 9e3c0174da842 ("pico-imx7d: Add LCD support") loading U-Boot via USB download mode causes the following hang:

SDP: initialize...
SDP: handle requests...
Downloading file of size 527088 to 0x877fffc0... done Jumping to header at 0x877fffc0
Header Tag is not an IMX image

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

When booting from eMMC such hang does not happen and currently we don't have a proper fix for this. Also, this hang in USB download mode only happens with the older version of the board that has 512MB of memory.

As a temporary workaround, remove video support so that users do not have a negative experience in case they brick their board and want to recover from USB.

We can re-add video support later when a proper fix is in place.

---
 configs/pico-hobbit-imx7d_defconfig | 1 -
 configs/pico-pi-imx7d_defconfig     | 1 -
 2 files changed, 2 deletions(-)
configs/pico-hobbit-imx7d_defconfig +0 -1
index f58d5171ba..cb4a6bf0bb 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
configs/pico-pi-imx7d_defconfig +0 -1
index c8ac2ffd5f..8e48ba71be 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 pico-imx7: Disable video support

Quoted 60 lines · Fabio Estevam

Since commit 9e3c0174da842 ("pico-imx7d: Add LCD support") loading U-Boot via USB download mode causes the following hang:

SDP: initialize...
SDP: handle requests...
Downloading file of size 527088 to 0x877fffc0... done Jumping to header at 0x877fffc0
Header Tag is not an IMX image

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

When booting from eMMC such hang does not happen and currently we don't have a proper fix for this. Also, this hang in USB download mode only happens with the older version of the board that has 512MB of memory.

As a temporary workaround, remove video support so that users do not have a negative experience in case they brick their board and want to recover from USB.

We can re-add video support later when a proper fix is in place.

---
 configs/pico-hobbit-imx7d_defconfig | 1 -
 configs/pico-pi-imx7d_defconfig     | 1 -
 2 files changed, 2 deletions(-)
configs/pico-hobbit-imx7d_defconfig +0 -1
index f58d5171ba..cb4a6bf0bb 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
configs/pico-pi-imx7d_defconfig +0 -2
index c8ac2ffd5f..8e48ba71be 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
--
Quoted 2 lines

2.17.1

Quoted 1 line
#2 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 20 lines · Joris OFFOUGA,
Quoted 18 lines · Fabio Estevam

Since commit 9e3c0174da842 ("pico-imx7d: Add LCD support") loading U-Boot via USB download mode causes the following hang:

SDP: initialize...
SDP: handle requests...
Downloading file of size 527088 to 0x877fffc0... done Jumping to header at 0x877fffc0
Header Tag is not an IMX image

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB
Quoted 3 lines
Quoted 2 lines

(Hangs here)

Are you sure about memory calibration?

Michael

Quoted 51 lines
Quoted 40 lines

When booting from eMMC such hang does not happen and currently we don't have a proper fix for this. Also, this hang in USB download mode only happens with the older version of the board that has 512MB of memory.

As a temporary workaround, remove video support so that users do not have a negative experience in case they brick their board and want to recover from USB.

We can re-add video support later when a proper fix is in place.

---
 configs/pico-hobbit-imx7d_defconfig | 1 -
 configs/pico-pi-imx7d_defconfig     | 1 -
 2 files changed, 2 deletions(-)
configs/pico-hobbit-imx7d_defconfig +0 -1
index f58d5171ba..cb4a6bf0bb 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
configs/pico-pi-imx7d_defconfig +0 -2
index c8ac2ffd5f..8e48ba71be 100644
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT=y
--
Quoted 2 lines

2.17.1

Quoted 1 line

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

author reviewer
#3 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi Michael,

Quoted 1 line · Michael Nazzareno Trimarchi

Are you sure about memory calibration?

I couldn't spot an issue with regards to memory initialization.

The interesting thing is that the hang does not happen when booting from eMMC. I can only see it when booting via USB download mode.

#4 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 6 lines · Fabio Estevam

Hi Michael,

On Sat, Mar 23, 2019 at 7:19 PM Michael Nazzareno Trimarchi <[email protected]> wrote:

Quoted 6 lines
Quoted 1 line

Are you sure about memory calibration?

I couldn't spot an issue with regards to memory initialization.

The interesting thing is that the hang does not happen when booting from eMMC. I can only see it when booting via USB download mode.

Can you use ddr calibration instead of fixed value? Does this happen before migration to DT

Michael

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author reviewer
#5 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi Michael,

Quoted 2 lines · Michael Nazzareno Trimarchi

Can you use ddr calibration instead of fixed value? Does this happen before migration to DT

Yes, this happens before migration to DM.

I am not sure how I can use DDR calibration instead of fixed value. Would you have some example?

#6 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 6 lines · Fabio Estevam

Hi Michael,

On Mon, Mar 25, 2019 at 1:29 PM Michael Nazzareno Trimarchi <[email protected]> wrote:

Quoted 7 lines
Quoted 2 lines

Can you use ddr calibration instead of fixed value? Does this happen before migration to DT

Yes, this happens before migration to DM.

I am not sure how I can use DDR calibration instead of fixed value. Would you have some example?

board/engicam/common/spl.c +7 -0
index 3779c5d3bd..cdf3b25850 100644
@@ -22,6 +22,8 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/video.h>
 
+#include <asm/arch/mx6-ddr.h>
+
 #define UART_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |             \
         PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \
         PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
@@ -402,6 +404,11 @@ static void spl_dram_init(void)
 #elif CONFIG_MX6UL || CONFIG_MX6ULL
        mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
        mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
+
+       /* Perform DDR DRAM calibration */
+       udelay(100);
+       mmdc_do_write_level_calibration(&ddr_sysinfo);
+       mmdc_do_dqs_calibration(&ddr_sysinfo);
 #endif
 
        udelay(100);
(quoted diff) +0 -0

b/configs/imx6ull_isiot_nand_defconfig
index 815e41576c..d749e3c58c 100644

configs/imx6ull_isiot_nand_defconfig +1 -0
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
+CONFIG_MX6_DDRCAL=y
 CONFIG_SYS_TEXT_BASE=0x87800000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author reviewer
#7 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi Michael,

board/engicam/common/spl.c static void spl_dram_init(void) · line 411

Quoted 4 lines · Michael Nazzareno Trimarchi
board/engicam/common/spl.c +4 -0
+       /* Perform DDR DRAM calibration */
+       udelay(100);
+       mmdc_do_write_level_calibration(&ddr_sysinfo);
+       mmdc_do_dqs_calibration(&ddr_sysinfo);

Thanks for the suggestion, but this is i.MX6 specific.

i.MX7 has a different DDR controller IP and such functions do not exist there.

#8 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 6 lines · Fabio Estevam

Hi Michael,

On Mon, Mar 25, 2019 at 1:38 PM Michael Nazzareno Trimarchi <[email protected]> wrote:

Quoted 8 lines

board/engicam/common/spl.c static void spl_dram_init(void) · line 411

Quoted 4 lines
board/engicam/common/spl.c +4 -0
+       /* Perform DDR DRAM calibration */
+       udelay(100);
+       mmdc_do_write_level_calibration(&ddr_sysinfo);
+       mmdc_do_dqs_calibration(&ddr_sysinfo);

Thanks for the suggestion, but this is i.MX6 specific.

i.MX7 has a different DDR controller IP and such functions do not exist there.

Let me summarize ;). Do you have any reset from the tool? does it sends everything
using usb? Does SPL log appear and the stop?

Michael

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author reviewer
#9 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi Michael,

Quoted 3 lines · Michael Nazzareno Trimarchi

Let me summarize ;). Do you have any reset from the tool? does it sends everything
using usb? Does SPL log appear and the stop?

Here is the way to send SPL and u-boot.img via imx usb loader:

$ sudo ./imx_usb SPL

Then we get in the terminal:

SDP: initialize...
SDP: handle requests...

$ sudo ./imx_usb u-boot.img

Then the boot completes:

Downloading file of size 527088 to 0x877fffc0... done Jumping to header at 0x877fffc0
Header Tag is not an IMX image

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

#10 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 29 lines · Fabio Estevam

Hi Michael,

Quoted 3 lines · Michael Nazzareno Trimarchi

Let me summarize ;). Do you have any reset from the tool? does it sends everything
using usb? Does SPL log appear and the stop?

Here is the way to send SPL and u-boot.img via imx usb loader:

$ sudo ./imx_usb SPL

Then we get in the terminal:

SDP: initialize...
SDP: handle requests...

$ sudo ./imx_usb u-boot.img

Then the boot completes:

Downloading file of size 527088 to 0x877fffc0... done Jumping to header at 0x877fffc0
Header Tag is not an IMX image

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

Quoted 8 lines
CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

Check if you go out from here
static int reserve_video(void)
{

#ifdef CONFIG_DM_VIDEO
        ulong addr;
        int ret;

        addr = gd->relocaddr;
        ret = video_reserve(&addr);
        if (ret)
                return ret;
        gd->relocaddr = addr;
#elif defined(CONFIG_LCD)
#  ifdef CONFIG_FB_ADDR
        gd->fb_base = CONFIG_FB_ADDR;
#  else
        /* reserve memory for LCD display (always full pages) */
        gd->relocaddr = lcd_setmem(gd->relocaddr);
        gd->fb_base = gd->relocaddr;
#  endif /* CONFIG_FB_ADDR */
#elif defined(CONFIG_VIDEO) && \
                (!defined(CONFIG_PPC)) && \
                !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
                !defined(CONFIG_M68K)
        /* reserve memory for video display (always full pages) */
        gd->relocaddr = video_setmem(gd->relocaddr);
        gd->fb_base = gd->relocaddr;

#endif

        return 0;
}

Michael

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author reviewer
#11 lore raw

PATCH 1/1 pico-imx7: Disable video support

In reply to Fabio Estevam

Hi Michael,

Quoted 10 lines · Fabio Estevam

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

It seems this hangs is related to the GPIO that enables the LCD.

If I change the code like this:

(quoted diff) +0 -0

b/board/technexion/pico-imx7d/pico-imx7d.c
index 767d13dfe5..ba1c6f9740 100644

board/technexion/pico-imx7d/pico-imx7d.c +1 -1
@@ -294,7 +294,7 @@ void setup_lcd(void)
        /* Set Brightness to high */
        gpio_direction_output(IMX_GPIO_NR(1, 11) , 1);
        /* Set LCD enable to high */
-       gpio_direction_output(IMX_GPIO_NR(1, 6) , 1);
+       gpio_direction_output(IMX_GPIO_NR(1, 6) , 0);
 }
 #endif
 

Then I can load U-Boot via USB without problem.

However, in order to turn on the LCD we need to turn on GPIO1_6.

If I do this from the U-Boot prompt:

=> gpio set 6

Then the board hangs.

Not sure why setting GPIO1_6 is causing the board to hang.

#12 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi

Quoted 38 lines · Fabio Estevam

Hi Michael,

Quoted 10 lines · Fabio Estevam

U-Boot 2019.04-rc4-00047-gcfb3e102c4 (Mar 23 2019 - 10:45:10 -0300)

CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 40C
Reset cause: POR
Board: i.MX7D PICOSOM
I2C:   ready
DRAM:  512 MiB

(Hangs here)

It seems this hangs is related to the GPIO that enables the LCD.

If I change the code like this:

board/technexion/pico-imx7d/pico-imx7d.c +1 -1
index 767d13dfe5..ba1c6f9740 100644
@@ -294,7 +294,7 @@ void setup_lcd(void)
        /* Set Brightness to high */
        gpio_direction_output(IMX_GPIO_NR(1, 11) , 1);
        /* Set LCD enable to high */
-       gpio_direction_output(IMX_GPIO_NR(1, 6) , 1);
+       gpio_direction_output(IMX_GPIO_NR(1, 6) , 0);
 }
 #endif
 

Then I can load U-Boot via USB without problem.

However, in order to turn on the LCD we need to turn on GPIO1_6.

Quoted 7 lines

If I do this from the U-Boot prompt:

=> gpio set 6

Then the board hangs.

Not sure why setting GPIO1_6 is causing the board to hang.

Maybe you drain to much power ;)

Michael

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author reviewer
#13 lore raw

PATCH 1/1 pico-imx7: Disable video support

Hi Michael,

Quoted 3 lines · Michael Nazzareno Trimarchi
Quoted 1 line

Not sure why setting GPIO1_6 is causing the board to hang.

Maybe you drain to much power ;)

Yes, that was the issue. This issue can be avoided by powering the board via an externally powered USB hub.

The new baseboard revision B1 seems to drain less power and the issue does not happen there.

Let's discard this patch then and leave the LCD support as is.

Thanks