what's the differences between GoldVIP's ATF and bsp32's ATF

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

what's the differences between GoldVIP's ATF and bsp32's ATF

3,474 Views
nevc
Contributor I

1.  follow the GoldVIP 1.1.0 User Manual,  Deploy GoldVIP SD-card image,  Deploy images to Flash,  configure the DIP switches for NOR Flash Boot mode (set SW4.7 to OFF) and then power on the board, all run well.

2. follow the S32G2_LinuxBSP32.0_User_Manual, manually build the uboot get arm-trusted-firmware
fip.s32.

cd arm-trusted-firmware
make CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- \
ARCH=aarch64 PLAT=<plat> BL33=<path-to-u-boot-s32.bin>

3.  Deploy manually build fip.s32 to the sdcard. 

sudo dd if=<path/to/fip.s32> of=/dev/<sdcard_dev> skip=512 seek=512 \
iflag=skip_bytes oflag=seek_bytes conv=fsync,notrunc

4. Insert SD card on RGB2 board,power on. There is an error.

Bootloader started
Load application id 0 fragment id 0 of size 458752 from 0x101240 flash address, time: 2.406 milliseconds
Load application id 1 fragment id 0 of size 2097152 from 0x300000 flash address, time: 10.877 milliseconds
NOTICE: Reset status: Power-On Reset
NOTICE: BL2: v2.5(release):bsp32.0-2.5-dirty
NOTICE: BL2: Built : 16:14:01, Mar 18 2022
Error: Instruction at BL33_DTB(0xffa99000) is 0x65762c6d, which is not the expected 0xedfe0dd0!
ERROR: BL2: Failure in post image load handling (-22)

 

My question is: is there any differences between GoldVIP's ATF and bsp32's ATF.

How can I get the GoldVIP's ATF (uboot).

 

 

Tags (1)
0 Kudos
13 Replies

3,445 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello nevc,

 

You need check with your FAE, according to your BSP is the BSP32, but normal BSP don't include the ATF, So you need to check with your FAE.

 

Regards

0 Kudos

3,461 Views
nxf45013
NXP Employee
NXP Employee

Hi, 

There are a few differences: (GoldVIP ATF has a different alignment plus the u-boot variables are added). See this patch: https://source.codeaurora.org/external/autobsps32/goldvip/meta-gvip/tree/recipes-bsp/arm-trusted-fir... 

However, it doesn't really make sense to re-compile the ATF for GoldVIP, as it's already present in the RAW SD Card partition and in the FAT32 partition of the SD card.  

See here (fip.s32-sdcard).

nxf45013_1-1656935852551.png

Vlad

 

0 Kudos

3,427 Views
nevc
Contributor I

Thank you very much, it really works.

I followed you instruction, updated the arm-trusted-firmware and u-boot as the patches said. 
ATF patch:0001-align-fip-to-64B.patch\files\arm-trusted-firmware\recipes-bsp - goldvip/meta-gvip - NXP S32G Ve...

u-boot patch:files\u-boot\recipes-bsp - goldvip/meta-gvip - NXP S32G Vehicle Integration Platform (GoldVIP) Yocto...

Power on the RDB2 board, booted from Nor flash mode, there is another error:

Bootloader started
Load application id 0 fragment id 0 of size 458752 from 0x101240 flash address, time: 2.406 milliseconds
Load application id 1 fragment id 0 of size 2097152 from 0x300000 flash address, time: 10.877 milliseconds
NOTICE: Reset status: Power-On Reset
NOTICE: BL2: v2.5(release):bsp32.0-2.5-dirty
NOTICE: BL2: Built : 16:14:01, Mar 18 2022
NOTICE: BL2: Booting BL31


U-Boot 2020.04-dirty (Jul 05 2022 - 13:37:07 +0800)

CPU: NXP S32G274A rev. 2.1.0
Model: NXP S32G274A-RDB2
DRAM: 3.5 GiB
MMC: FSL_SDHC: 0
Loading Environment from MMC... OK
Using external clock for PCIe0, CRNS
Configuring PCIe0 as RootComplex(x2)
Using external clock for PCIe1, CRNS
Frequency 125Mhz configured for PCIe1
Configuring PCIe1 as SGMII(x2) [XPCS0 2.5G, XPCS1 OFF]
PCIe0: Failed to get link up
Pcie0: LINK_DBG_1: 0x00000000, LINK_DBG_2: 0x00000800 (expected 0x000000d1)
DEBUG_R0: 0x00341600, DEBUG_R1: 0x08200000
PCI: Failed autoconfig bar 20
PCI: Failed autoconfig bar 24
PCIe1: Not configuring PCIe, PHY not configured
In: serial@401C8000
Out: serial@401C8000
Err: serial@401C8000
Board revision: RDB2/GLDBOX Revision D
Net: EQOS phy: rgmii @ 1

Warning: eth_eqos (eth0) using random MAC address - 3a:41:22:29:2b:87
eth0: eth_eqos PFE: emac0: sgmii emac1: none emac2: rgmii
Structure length mismatch: found 0 required 176

Warning: eth_pfeng using MAC address from ROM
, eth1: eth_pfeng
Hit any key to stop autoboot: 0
899 bytes read in 14 ms (62.5 KiB/s)
## Executing script at 80200000
1048688 bytes read in 75 ms (13.3 MiB/s)
14856200 bytes read in 659 ms (21.5 MiB/s)
43476 bytes read in 16 ms (2.6 MiB/s)
## Flattened Device Tree blob at 81600000
Booting using the fdt blob at 0x81600000
Using Device Tree in place at 0000000081600000, end 000000008160efff
DT: Enabling PFE
DT: Enabling PFE_EMAC_0
DT: pfe0 set to 00:01:be:be:ef:11
DT: Disabling PFE_EMAC_1
DT: Enabling PFE_EMAC_2
DT: pfe2 set to 00:01:be:be:ef:33

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 00000004 -
- Xen must be entered in NS EL2 mode -
- Please update the bootloader -
- Boot failed -

 

But when I power on the board, booted from SD card mode, the serial port has no output. Why ?

 

I want to port GoldVIP on our designed board, there are some changes have to be made in u-boot, So I need to know how to get the original GoldVIP ATF.

Please help me, thanks a million.

0 Kudos

3,424 Views
nxf45013
NXP Employee
NXP Employee

Hi, nevc, 

U-boot needs to be aware that it's booting XEN. This is missing from your U-boot (contained in ATF) configuration. 

Here's how you can enable it: https://source.codeaurora.org/external/autobsps32/meta-alb/tree/recipes-bsp/u-boot/u-boot-s32/build/... 

In order to streamline the process, I would advise you to use the yocto environment from meta-gvip.

Vlad

0 Kudos

3,420 Views
nevc
Contributor I

Hi, 

Thanks again for your reply.

I added the CONFIG_XEN_SUPPORT=y on file s32g274ardb2_defconfig; then rebuild uboot and AFT.

Set the board booted from Nor Flash mode, the log is same:

log.png

 

Set the board booted from SD card mode, the serial port has no output.This is really confusing to me.

 

I'm not familiar with yocto, I'll try to use yocto to build the project.

Thanks again.

 

0 Kudos

3,417 Views
nxf45013
NXP Employee
NXP Employee

Hi, 

Did you also update the flash region where ATF resides? 

Vlad

0 Kudos

3,413 Views
nevc
Contributor I

Hi,

1. Update my build fip.s32 on SD card FAT32 partition /boot_s32g27; rename it to fip.s32-sdcard

2. Set the board booted from Nor Flash,  stop in u-boot console when prompted, and run the command: run write_atf

3. Repower on the board:

log2.png

 

0 Kudos

3,408 Views
nxf45013
NXP Employee
NXP Employee

Hi, 

Let me explain a bit the boot process for GoldVIP (A53-ATF related process). 

1. The M7 bootloader boots BL2 from ATF (first bootloader) from QSPI

2. BL2 boots BL31, BL32 (if applicable), BL33 (u-boot) from SD. 

You need to have the same FIP image both in SD card and in the QSPI flash. I understand this seems redundant, but otherwise, we couldn't accommodate standalone SD and QSPI-based boot.  

Try to keep in sync the FIP image on the QSPI with the one on the SD card. It should work. 
Vlad

3,384 Views
nevc
Contributor I

Hi,

I've deployed my build FIP image to QSPI  Flash and SD card,  the same FIP image. But it doesn't work.

log3.png

I'd like to write down how to get my manually build  FIP image:

1. Get uboot  and ATF source code from git.

2. Update uboot patches as this link said:files\u-boot\recipes-bsp - goldvip/meta-gvip - NXP S32G Vehicle Integration Platform (GoldVIP) Yocto...

Update s32g274ardb2_defconfig file with CONFIG_XEN_SUPPORT=y

then manually build, get the u-boot-s32.bin file.

3. Update ATF patch as this link said: files\arm-trusted-firmware\recipes-bsp - goldvip/meta-gvip - NXP S32G Vehicle Integration Platform (...

then use this command to get fip.s32 file:

cd arm-trusted-firmware
make
CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- \
ARCH=aarch64 PLAT=<plat> BL33=<path-to-u-boot-s32.bin>

4. Deploy manually build fip.s32 to SD card and QSPI Flash.

5. Set the board boot from QSPI Flash,  the log is as the picture show.

6. Set the board boot from SD card, no output from the serial port.

 

There must be something else I have to do to get the same fip.s32-sdcard as the GoldVIP.

When use the GoldVIP's fip.s32-sdcard file, no matter boot from QSPI or SD card, all work well.

0 Kudos

3,368 Views
nxf45013
NXP Employee
NXP Employee

Hi, Nevc, 

Can you please confirm that you have the same file in the SD RAW partition and QSPI? 
The GoldVIP image does this setting by default, so I'm mostly worried about this setting. 

Vlad

0 Kudos

3,363 Views
nevc
Contributor I

Hi, nxf45013,

I'm really appreciate your reply, it means a lot to me. 

I'm pretty much sure that  the SD RAW partition and QSPI Flash have the same file.

Deploy fip.s32 to SD card, use following command:

sudo dd if=<path/to/fip.s32> of=/dev/<sdcard_dev> skip=512 seek=512 \
iflag=skip_bytes oflag=seek_bytes conv=fsync,notrunc

 

Deploy fip.s32 to QSPI flash as following:

boot from QSPI flash, stop in u-boot console when prompted, run write_atf
(Of course I've updated my build fip.s32 to SD card boot partition)

I've uploaded my build fip.s32 file as an attachment, may you use it on your board to test if it works.

Thanks a million, i really mean it.

0 Kudos

3,349 Views
nxf45013
NXP Employee
NXP Employee

Hi, 

The format of the file looks fine. It seems that BL2 and BL31 run fine. Could you please also share the contents of boot_info.c? 

Also, is u-boot set to boot from SD card? 

Vlad

0 Kudos

3,331 Views
nevc
Contributor I

Hi,

"Also, is u-boot set to boot from SD card? "

Do you mean where does bootloader get the u-boot? from SD card or QSPI Flash ?

I didn't change anything about bootloader, so bootloader get ATF(u-boot) form QSPI  Flash at address 0x00100000.

 

0 Kudos