diff mbox series

[U-Boot] pico-imx7: Disable video support

Message ID 20190323135307.29439-1-festevam@gmail.com
State Rejected
Delegated to: Stefano Babic
Headers show
Series [U-Boot] pico-imx7: Disable video support | expand

Commit Message

Fabio Estevam March 23, 2019, 1:53 p.m. UTC
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.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 configs/pico-hobbit-imx7d_defconfig | 1 -
 configs/pico-pi-imx7d_defconfig     | 1 -
 2 files changed, 2 deletions(-)

Comments

Joris OFFOUGA March 23, 2019, 10:16 p.m. UTC | #1
Le sam. 23 mars 2019 à 14:53, Fabio Estevam <festevam@gmail.com> a écrit :

> 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.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  configs/pico-hobbit-imx7d_defconfig | 1 -
>  configs/pico-pi-imx7d_defconfig     | 1 -
>  2 files changed, 2 deletions(-)
>
> diff --git a/configs/pico-hobbit-imx7d_defconfig
> b/configs/pico-hobbit-imx7d_defconfig
> index f58d5171ba..cb4a6bf0bb 100644
> --- a/configs/pico-hobbit-imx7d_defconfig
> +++ b/configs/pico-hobbit-imx7d_defconfig
> @@ -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
> diff --git a/configs/pico-pi-imx7d_defconfig
> b/configs/pico-pi-imx7d_defconfig
> index c8ac2ffd5f..8e48ba71be 100644
> --- a/configs/pico-pi-imx7d_defconfig
> +++ b/configs/pico-pi-imx7d_defconfig
> @@ -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
> --
> 2.17.1
>

Tested-by: Joris Offouga <offougajoris@gmail.com>

>
Michael Nazzareno Trimarchi March 23, 2019, 10:18 p.m. UTC | #2
Hi



On Sat., 23 Mar. 2019, 11:16 pm Joris OFFOUGA, <offougajoris@gmail.com>
wrote:

> Le sam. 23 mars 2019 à 14:53, Fabio Estevam <festevam@gmail.com> a écrit :
>
> > 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)
> >
>

Are you sure about memory calibration?

Michael

> > 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.
> >
> > Signed-off-by: Fabio Estevam <festevam@gmail.com>
> > ---
> >  configs/pico-hobbit-imx7d_defconfig | 1 -
> >  configs/pico-pi-imx7d_defconfig     | 1 -
> >  2 files changed, 2 deletions(-)
> >
> > diff --git a/configs/pico-hobbit-imx7d_defconfig
> > b/configs/pico-hobbit-imx7d_defconfig
> > index f58d5171ba..cb4a6bf0bb 100644
> > --- a/configs/pico-hobbit-imx7d_defconfig
> > +++ b/configs/pico-hobbit-imx7d_defconfig
> > @@ -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
> > diff --git a/configs/pico-pi-imx7d_defconfig
> > b/configs/pico-pi-imx7d_defconfig
> > index c8ac2ffd5f..8e48ba71be 100644
> > --- a/configs/pico-pi-imx7d_defconfig
> > +++ b/configs/pico-pi-imx7d_defconfig
> > @@ -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
> > --
> > 2.17.1
> >
>
> Tested-by: Joris Offouga <offougajoris@gmail.com>
>
> >
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>
Fabio Estevam March 25, 2019, 3:25 p.m. UTC | #3
Hi Michael,

On Sat, Mar 23, 2019 at 7:19 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:

> 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.
Michael Nazzareno Trimarchi March 25, 2019, 4:29 p.m. UTC | #4
Hi

On Mon, Mar 25, 2019 at 4:25 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Sat, Mar 23, 2019 at 7:19 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>
> > 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
Fabio Estevam March 25, 2019, 4:37 p.m. UTC | #5
Hi Michael,

On Mon, Mar 25, 2019 at 1:29 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:

> 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?
Michael Nazzareno Trimarchi March 25, 2019, 4:38 p.m. UTC | #6
Hi

On Mon, Mar 25, 2019 at 5:37 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Mon, Mar 25, 2019 at 1:29 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>
> > 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?

diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c
index 3779c5d3bd..cdf3b25850 100644
--- a/board/engicam/common/spl.c
+++ b/board/engicam/common/spl.c
@@ -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);
diff --git a/configs/imx6ull_isiot_nand_defconfig
b/configs/imx6ull_isiot_nand_defconfig
index 815e41576c..d749e3c58c 100644
--- a/configs/imx6ull_isiot_nand_defconfig
+++ b/configs/imx6ull_isiot_nand_defconfig
@@ -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
Fabio Estevam March 25, 2019, 4:48 p.m. UTC | #7
Hi Michael,

On Mon, Mar 25, 2019 at 1:38 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:

> +       /* 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.
Michael Nazzareno Trimarchi March 25, 2019, 4:51 p.m. UTC | #8
Hi

On Mon, Mar 25, 2019 at 5:48 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Mon, Mar 25, 2019 at 1:38 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>
> > +       /* 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
Fabio Estevam March 25, 2019, 4:56 p.m. UTC | #9
Hi Michael,

On Mon, Mar 25, 2019 at 1:51 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:

> 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)
Michael Nazzareno Trimarchi March 25, 2019, 5 p.m. UTC | #10
Hi

On Mon, Mar 25, 2019 at 5:56 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Mon, Mar 25, 2019 at 1:51 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>
> > 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)

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
Fabio Estevam March 25, 2019, 10:12 p.m. UTC | #11
Hi Michael,

On Mon, Mar 25, 2019 at 1:56 PM Fabio Estevam <festevam@gmail.com> wrote:

> 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:

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c
b/board/technexion/pico-imx7d/pico-imx7d.c
index 767d13dfe5..ba1c6f9740 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -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.
Michael Nazzareno Trimarchi March 26, 2019, 8:21 a.m. UTC | #12
Hi

On Mon, Mar 25, 2019 at 11:12 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Mon, Mar 25, 2019 at 1:56 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> > 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:
>
> diff --git a/board/technexion/pico-imx7d/pico-imx7d.c
> b/board/technexion/pico-imx7d/pico-imx7d.c
> index 767d13dfe5..ba1c6f9740 100644
> --- a/board/technexion/pico-imx7d/pico-imx7d.c
> +++ b/board/technexion/pico-imx7d/pico-imx7d.c
> @@ -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.

Maybe you drain to much power ;)

Michael
Fabio Estevam March 26, 2019, 5:58 p.m. UTC | #13
Hi Michael,

On Tue, Mar 26, 2019 at 5:21 AM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:

> > 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
diff mbox series

Patch

diff --git a/configs/pico-hobbit-imx7d_defconfig b/configs/pico-hobbit-imx7d_defconfig
index f58d5171ba..cb4a6bf0bb 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -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
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index c8ac2ffd5f..8e48ba71be 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -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