i.MX8M Mini Hangs at ATF when booting from USB
Tim Harvey
tharvey at gateworks.com
Wed Feb 2 17:27:38 CET 2022
On Wed, Feb 2, 2022 at 3:36 AM Adam Ford <aford173 at gmail.com> wrote:
>
> On Mon, Jan 31, 2022 at 2:48 PM Adam Ford <aford173 at gmail.com> wrote:
> >
> > On Mon, Jan 31, 2022 at 2:45 PM Michael Nazzareno Trimarchi
> > <michael at amarulasolutions.com> wrote:
> > >
> > > Hi
> > >
> > > On Mon, Jan 31, 2022 at 9:34 PM Adam Ford <aford173 at gmail.com> wrote:
> > > >
> > > > On Mon, Jan 31, 2022 at 2:25 PM Michael Nazzareno Trimarchi
> > > > <michael at amarulasolutions.com> wrote:
> > > > >
> > > > > HI Adam
> > > > >
> > > > > On Mon, Jan 31, 2022 at 9:21 PM Adam Ford <aford173 at gmail.com> wrote:
> > > > > >
> > > > > > I have a situation where the same Flash.bin file can boot an MMC card,
> > > > > > but hang when booting over USB.
> > > > > >
> > > > > > In both cases, I can see the FIT file is loaded, and the various items
> > > > > > are identified and placed in their respective folders memory
> > > > > > locations. The only difference I can see is that when jumping to
> > > > > > 0x920000 (ATF), the USB booting hangs and ATF doesn't appear to
> > > > > > execute. Is there some special command that I need to issue to unlock
> > > > > > this memory to execute from it when booting from USB? I am calling
> > > > > > enable_tzc380 from SPL, and I read the first 100 bytes and last 100
> > > > > > bytes and compared it to my bl31.bin file, and it appears to match, so
> > > > > > I know I can read from it.
> > > > > >
> > > > > > U-Boot SPL 2022.01-00836-g3cc200c91a-dirty (Jan 30 2022 - 07:31:51 -0600)
> > > > > > No pmic
> > > > > > WDT: Not starting watchdog at 30280000
> > > > > > Trying to boot from USB SDP
> > > > > > USB EHCI 1.00
> > > > > > SDP: initialize...
> > > > > > SDP: handle requests...
> > > > > > Downloading file of size 832080 to 0x40400000... done
> > > > > > Jumping to header at 0x40400000
> > > > > > Header Tag is not an IMX image
> > > > > > Found header at 0x40417c00
> > > > > > firmware: 'uboot'
> > > > > > External data: dst=40200000, offset=3000, size=9ddd8
> > > > > > fdt: 'fdt-1'
> > > > > > External data: dst=4029de00, offset=aaea0, size=87b0
> > > > > > loadables: 'atf'
> > > > > > External data: dst=920000, offset=a0dd8, size=a0c6
> > > > > > image entry point: 0x920000
> > > > > >
> > > > >
> > > > > Check if the uart used on atf and uboot are mapping correctly (but
> > > > > this should because you can boot from sdcard)
> > > >
> > > > As far as i can tell, I have not done any differently in the serial
> > > > from the NXP downstream.
> > > >
> > > > > ENV_IS_EVERYWHERE in configs file. It's no PMIC a problem when you jump in atf?
> > > >
> > > > I have experimented with and without ENV_IS_EVERYWHERE, but that only
> > > > seemed to help my imx8m Nano when jumping from ATF -> U-Boot. As for
> > > > my Mini, the jump from SPL->ATF seems to be the issue.
> > > >
> > > > What might the PMIC have to do with the ATF? From what I can tell,
> > > > the PMIC is pre-configured and the default voltages appear to boot the
> > >
> > > I have only seen this. I don't say that is connected. If the voltage
> > > are ok and you don't need
> > > to program it I don't see the problem
> > >
> > > > MMC. i had to disable the PMIC driver in order to make room for the
> > > > USB code. I have a few lines of code in my board's spl.c file to
> > > > setup a few registers based on NXP's original 8MM design and reference
> > > > software.
> > >
> > > Can you enable debug on the atf side?
> >
> > I can try that.
>
> + CC Tim Harvey
> + CC Frieder
>
> After working with Tim, he sent me some patches that he was testing
> with a combination of work himself and Frieder, I was able to get USB
> booting with non-DM USB in SPL. For now I think I prefer the non-DM
> version since SPL is so tight, I needed to strip out some stuff (like
> the PMIC) which I'd like to keep.
>
> Thanks for the suggestions. Hopefully between the three of us, we can
> get something ready to push upstream.
>
To give some numbers to the SPL size issue here is what I've found:
- lpddr4 dram config structs are about 3K each (I know I have 3 of
them currently in my IMX8MM board support)
- lpddr4 training blobs are about 51K but they get placed following
the SPL and padded to 87K; this is a pretty big waste. Perhaps there
is some way we can easily get rid of the padding
- SPL_DM_USB/SPL_USB_HOST/SPL_USB_GADGET is 34K but with non-dm-usb
support (the patches Adam is referring to) its 17K so the cost of
SPL_DM_USB is 17K
I know for imx8mm-venice I am down to having only a few KB left and
will probably need it for future dram configs.
The blocker to getting non-dm-spl-usb support for IMX8M appears to be
the base addresses and instead of adding more of them to imx-regs.h we
need to get them from DT via of_platdata which nobody has had time to
dig into yet.
Best Regards,
Tim
More information about the U-Boot
mailing list