AnsweredAssumed Answered

LS1043ARGW SD TFA boot problem

Question asked by hakjun oh on May 25, 2020
Latest reply on Jun 18, 2020 by hakjun oh

I have LS1043ARGW custom boards and LS1043ARDB-PD boards. I am trying to boot from an sd card.

And I need OP-TEE, so I have to boot with TFA. However, there is a problem that the boot does not work. So I built it as tfa, not SECURE_tfa. Of course the ASK binary works fine.

 

1. u-boot (Needed for building atf)

I made u-boot patch file with reference to RGW u-boot. And patched to u-boot LSDK-20.04.

Then I set to ls1043argw_tfa_config and built.

 

2. atf

atf LSDK-20.04 was built using the following options:

PLAT=ls1043ardb

BOOT_MODE=sd

RCW=(ls1043ardb-sdboot-rcw.bin) <- attached file

BL33=u-boot.bin

FIPTOOL=tools/fiptool/fiptool

CREATE_PBL=/plat/nxp/tools/create_pbl

BYTE_SWAP=/plat/nxp/tools/byte_swap

DEBUG=1

 

3. write to sd card

bl2_sd.pbl and fip.bin generated by building atf were written to the sd card.

Write to SD

dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=10

dd if=bl2_sd.pbl of=/dev/mmcblk0 bs=512 seek=8
dd if=fip.bin of=/dev/mmcblk0 bs=512 seek=2048

 

4. boot

When booting this sd card from RDB

RDB boot log

INFO: RCW BOOT SRC is SD/EMMC
INFO: RCW BOOT SRC is SD/EMMC
INFO: Card detected successfully
INFO: init done:
INFO: time base 30 ms
NOTICE: Fixed DDR on board
INFO: Time after parsing SPD 4 ms
INFO: Time before programming controller 8 ms

 

NOTICE: 2 GB DDR4, 32-bit, CL=11, ECC off
INFO: Time used by DDR driver 18 ms
NOTICE: BL2: v1.5(debug):LSDK-20.04
NOTICE: BL2: Built : 07:46:25, May 7 2020
INFO: CALL: bl2_arch_setup
INFO: CALL: bl2_plat_preload_setup
INFO: Configuring TZASC-380
INFO: CALL: bl2_load_images
INFO: BL2: Doing platform setup
INFO: BL2: Loading image id 3
INFO: sd-mmc read done.
INFO: sd-mmc read done.

 

U-Boot 2019.10 (May 07 2020 - 07:46:23 +0100)

 

SoC: LS1043AE Rev1.1 (0x87920011)
Clock Configuration:
CPU0(A53):1600 MHz CPU1(A53):1600 MHz CPU2(A53):1600 MHz
CPU3(A53):1600 MHz
Bus: 300 MHz DDR: 1600 MT/s FMAN: 600 MHz
Reset Configuration Word (RCW):
00000000: 06100010 0c000000 00000000 00000000
00000010: 14550002 80004002 60106000 c1002000
00000020: 00000000 00000000 00000000 01030940
00000030: 00000000 00003004 00000096 00000001
Model: LS1043A RGW Board
Board: LS1043ARGW, boot from SD
Invalid setting
SERDES Reference Clocks:
SD1_CLK1 = 156.25MHZ, SD1_CLK2 = 100.00MHZ
DRAM: 1.9 GiB (DDR4, 32-bit, CL=11, ECC off)
Using SERDES1 Protocol: 5205 (0x1455)
SEC0: RNG instantiated
Flash: 128 MiB
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

 

EEPROM: NXID v1
In: serial
Out: serial
Err: serial
Net:
MMC read: dev # 0, block # 18432, count 128 ...
Fman1: Data at 00000000f7a38f60 is not a firmware
PCIe0: pcie@3400000 disabled
PCIe1: pcie@3500000 Root Complex: no link
PCIe2: pcie@3600000 Root Complex: no link
No ethernet found.
Hit any key to stop autoboot: 0

 

but when booting from RGW

RGW boot log

?NFO: RCW BOOT SRC is SD/EMMC
INFO: RCW BOOT SRC is SD/EMMC
INFO: Card detected successfully
INFO: init done:
INFO: time base 30 ms
NOTICE: Fixed DDR on board
INFO: Time after parsing SPD 5 ms
INFO: Time before programming controller 8 ms

 

NOTICE: 2 GB DDR4, 32-bit, CL=11, ECC off
INFO: Time used by DDR driver 18 ms
NOTICE: BL2: v1.5(debug):LSDK-20.04
NOTICE: BL2: Built : 08:27:14, Apr 22 2020
INFO: Configuring TZASC-380
INFO: BL2: Doing platform setup
INFO: BL2: Loading image id 3
INFO: sd-mmc read done.
WARNING: Firmware Image Package header check failed.
WARNING: Failed to obtain reference to image id=3 (-2)
ERROR: BL2: Failed to load image (-2)
Authentication failure

 

I have looked at the operation problems of eSDHC, but confirmed that it works in 1bit little-endian mode on the source.
As a result of several boot checks, the ATF confirmed that the FIP header value was read from 0x10_0000.
In the case of RDB, the FIP header read the value of 0x10_0000 correctly, but it was confirmed that RGW reads the value of 0x10_0008.

 

I have not yet figured out what is causing this issue.

Please help me.

 

best regards.

Outcomes