LX2160ARDB- BSP firmware error message when put on system

cancel
Showing results for 
Search instead for 
Did you mean: 

LX2160ARDB- BSP firmware error message when put on system

Jump to solution
1,009 Views
tbell
Contributor I

Hello, new to using NXP (and BSP in general), and could use some assistance.

I am trying to boot the LX2160ARDB from an SD card and it is unable to start Linux.

I see the below error message before being returned to the u-boot console (error in bold):

Hit any key to stop autoboot:  0
Device: FSL_SDHC
Manufacturer ID: 27
OEM: 5048
Name: SD08G
Bus Speed: 50000000
Mode : SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

MMC read: dev # 0, block # 26624, count 2048 ... 2048 blocks read: OK
fsl-mc: Deploying data path layout ..ERROR (MC is not booted)

From what I can tell, u-boot starts and returns a console, but there's an error being reported about the firmware FIT file. Below is a snippet of the u-boot print log of the boot sequence (error in bold).

DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id

MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read: OK

MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK
Wrong FIT format: no description
fsl-mc: ERR: Bad firmware image (bad FIT header)

I'm following instructions from this pdf: "Layerscape LX2160A BSP v0.5.pdf" (Chapter 4 LX2160A BSP User Guide), and building with flexbuild (lsdk version 18.12). I'm using self-built firmware, but grabbing firmware from this url results in the same problem, so I must just not be executing a step properly or something.

wget http://www.nxp.com/lgfiles/sdk/lx2160a_bsp05/firmware_lx2160ardb_uboot_sdboot.img

Attached is a text file containing the build output from flex-builder for building the firmware image, using "flex-installer" to bind it to an SD card, and the full serial output from booting from SD card.

Any help would be appreciated, thanks!

For convenience, commands being run to build the SD card:

$ flex-builder -i mkrfs -a arm64 -r centos:tiny -m lx2160ardb

 $ flex-builder -i mkfw -a arm64 -m lx2160ardb -b sd

$ wget http://www.nxp.com/lgfiles/sdk/lx2160a_bsp05/bootpartition_LS_arm64_lts_4.14.tgz

$ flex-installer -f build/images/firmware_lx2160ardb_uboot_sdboot.img -b bootpartition_LS_arm64_lts_4.14.tgz -r build/rfs/rootfs_centos_7.6.1810_LS_arm64/ -d /dev/sde

1 Solution
547 Views
ufedor
NXP TechSupport
NXP TechSupport

It turns out that not enough space was allocated in the 'mcinitcmd' environment variable. Also, this is hard coded this so you can't fix and do a 'saveenv'.

The culprit is the count size of the 'mmc read command' and location of DPC. I'm attaching a header file where another issue had the same problem and made a fix.

If you want to do it from the command line, modify the 'mcinitcmd' environment variable then 'run mcinitcmd'. I also have a 'pboot' cmd that does persist with 'saveenv'.

### default fix
=> setenv mcinitcmd 'mmc read 0x80000000 0x5000 0x900;mmc read 0x80200000 0x7000 0x800;env exists secureboot && mmc read 0x80700000 0x3800 0x10 && mmc read 0x80740000 0x3A00 0x10 && esbc_validate 0x80700000 && esbc_validate 0x80740000 ;fsl_mc start mc 0x80000000 0x80200000'
=> run mcinitcmd (to get MC running)
=> boot (to boot to TinyDistro - limited networking)

### Workaround with 'run pboot'
=> pri pboot
pboot=run runmc && run sd_bootcmd
=> pri runmc
runmc=mmc read 0x81000000 0x5000 0x2800 && mmc read 0x80000000 0x7000 0x800 && mmc read 0x80400000 0x6800 0x800 && fsl_mc start mc 0x81000000 0x80000000 && fsl_mc apply dpl 0x80400000
=> pri sd_bootcmd
sd_bootcmd=echo Trying load from sd card..;mmcinfo; mmc read $load_addr $kernel_addr_sd $kernel_size_sd ;env exists secureboot && mmc read $kernelheader_addr_r $kernelhdr_addr_sd $kernelhdr_size_sd && esbc_validate ${kernelheader_addr_r};bootm $load_addr#$BOARD
=>

It is possible to rebuild the firmware images (including the U-Boot) with the attached header file.
After that the issue will be resolved automatically without manually running these U-Boot commands.

View solution in original post

3 Replies
547 Views
daniel_klauer
Contributor I

With LX2160ARDB Yocto, it looks like I ran into the same problem when booting from SD card. The DPL blob is put at 0x80d00000 by default, but then overwritten by kernel which is put at 0x80080000 (default for the FIT image produced by Yocto). Then DPL blob is invalid when u-boot tries to apply it right before starting the kernel ("fsl_mc lazyapply dpl").

For now changing the DPL address in u-boot config seemed to fix that problem: (patch should apply on top of the LSDK-19.06 tag in the qoriq-components/u-boot repository)

diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index e18c8dfd57..d5056b07c7 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -279,11 +279,11 @@ int select_i2c_ch_pca9547_sec(unsigned char ch);
 
 #define SD_BOOTCOMMAND      \
   "env exists mcinitcmd && mmcinfo; "  \
-  "mmc read 0x80d00000 0x6800 0x800; "  \
+  "mmc read 0xb0000000 0x6800 0x800; "  \
   "env exists mcinitcmd && env exists secureboot " \
   " && mmc read 0x80780000 0x3C00 0x20 "  \
   "&& esbc_validate 0x80780000;env exists mcinitcmd " \
-  "&& fsl_mc lazyapply dpl 0x80d00000;"  \
+  "&& fsl_mc lazyapply dpl 0xb0000000;"  \
   "run distro_bootcmd;run sd_bootcmd;"  \
   "env exists secureboot && esbc_halt;"
 
0 Kudos
548 Views
ufedor
NXP TechSupport
NXP TechSupport

It turns out that not enough space was allocated in the 'mcinitcmd' environment variable. Also, this is hard coded this so you can't fix and do a 'saveenv'.

The culprit is the count size of the 'mmc read command' and location of DPC. I'm attaching a header file where another issue had the same problem and made a fix.

If you want to do it from the command line, modify the 'mcinitcmd' environment variable then 'run mcinitcmd'. I also have a 'pboot' cmd that does persist with 'saveenv'.

### default fix
=> setenv mcinitcmd 'mmc read 0x80000000 0x5000 0x900;mmc read 0x80200000 0x7000 0x800;env exists secureboot && mmc read 0x80700000 0x3800 0x10 && mmc read 0x80740000 0x3A00 0x10 && esbc_validate 0x80700000 && esbc_validate 0x80740000 ;fsl_mc start mc 0x80000000 0x80200000'
=> run mcinitcmd (to get MC running)
=> boot (to boot to TinyDistro - limited networking)

### Workaround with 'run pboot'
=> pri pboot
pboot=run runmc && run sd_bootcmd
=> pri runmc
runmc=mmc read 0x81000000 0x5000 0x2800 && mmc read 0x80000000 0x7000 0x800 && mmc read 0x80400000 0x6800 0x800 && fsl_mc start mc 0x81000000 0x80000000 && fsl_mc apply dpl 0x80400000
=> pri sd_bootcmd
sd_bootcmd=echo Trying load from sd card..;mmcinfo; mmc read $load_addr $kernel_addr_sd $kernel_size_sd ;env exists secureboot && mmc read $kernelheader_addr_r $kernelhdr_addr_sd $kernelhdr_size_sd && esbc_validate ${kernelheader_addr_r};bootm $load_addr#$BOARD
=>

It is possible to rebuild the firmware images (including the U-Boot) with the attached header file.
After that the issue will be resolved automatically without manually running these U-Boot commands.

View solution in original post

547 Views
tbell
Contributor I

I've tested replacing the lx2160a_common.h file and it booted from the SD card without the present issue.

Thanks for your help!

0 Kudos