How to use UART2 instead of UART1 on LS1043ARDB/LS1046ARDB.
1. Compile PBL binary from RCW source file
2. Compile U-Boot binary
3. Compile TF-A binaries (bl2_.pbl and fip.bin)
4. Program TF-A binaries on specific boot mode
1-COMPILE PBL BINARY FROM RCW SOURCE FILE
You have to create a new directory to compile the binaries that you need to create a
TF-A binary
You need to compile the rcw_<boot_mode>.bin binary to build the
bl2_<boot_mode>.pbl binary.
Clone the rcw repository and compile the PBL binary.
1. $ git clone https://github.com/nxp-qoriq/rcw
2. $ cd rcw
3. $ cd ls1043ardb
4. $ make
Inside the directory called “RR_FQPP_1455” you can see some binaries with
the next nomenclature:
rcw_<freq>.bin
Where “freq” is the frequency in MHz of the processor, the values of the frequency
are 1200MHz, 1400MHz, 1500MHz, and 1600MHz
2-COMPILE U-BOOT BINARY
You need to compile the u-boot.bin binary to build the fip.bin binary.
Clone the U-boot repository and compile the U-Boot binary for TF-A
1. $ git clone https://github.com/nxp-qoriq/u-boot
2. $ cd u-boot
3. $ git checkout -b LSDK-21.08 LSDK-21.08
4. $ export ARCH=arm64
5. $ export CROSS_COMPILE=aarch64-linux-gnu-
6. $ make distclean
7. $ nano configs/ls1043ardb_tfa_defconfig
7.1 change the bootargs "console=ttyS0,115200" for "console=ttyS1,115200"
7.2 add "CONFIG_CONS_INDEX=2
7. $ make ls1043ardb_tfa_defconfig
8. $ make
3 Compile TF-A binaries (bl2_.pbl and fip.bin)
1. $ git clone https://github.com/nxp-qoriq/atf
2. $ cd atf
3. $ git checkout -b LSDK-21.08 LSDK-21.08
4. $ export ARCH=arm64
5. $ export CROSS_COMPILE=aarch64-linux-gnu-
6. $ nano plat/nxp/common/include/default/ch_3_2/soc_default_base_addr.h
6.1 Change the line "#define NXP_UART_ADDR 0x021C0000" for "#define NXP_UART_ADDR 0x021D0000"
6.2 Change the line "#define NXP_UART1_ADDR 0x021D0000" for "#define NXP_UART_ADDR 0x021C0000"
7. $ nano plat/nxp/common/include/default/ch_2/soc_default_base_addr.h
7.1 Change the line "#define NXP_UART_ADDR 0x021C0500" for "#define NXP_UART_ADDR 0x021C0600"
7.2 Change the line "#define NXP_UART1_ADDR 0x021C0600" for "#define NXP_UART_ADDR 0x021C0500"
The compiled BL2 binaries, bl2.bin and bl2_<boot mode>.pbl are available at
atf/build/ls1043ardb/release/.
NOTE: For any update in the BL2 source code or RCW binary, the bl2_<boot
mode>.pbl binary needs to be recompiled
3.1 HOW TO COMPILE BL2 BINARY
To compile the BL2 binary without OPTEE:
make PLAT=<platform> bl2 BOOT_MODE=<boot_mode> pbl
RCW=<path_to_rcw_binary>/<rcw_binary_for_specific_boot_mode>
To LS1043ARDB for SD boot:
make PLAT=ls1043ardb bl2 BOOT_MODE=sd pbl
RCW=<path_to_rcw_binary>/<rcw_freq.bin>
To LS1043ARDB for NOR boot:
make PLAT=ls1043ardb bl2 BOOT_MODE=nor pbl
RCW=<path_to_rcw_binary>/<rcw_freq.bin>
To LS1043ARDB for NAND boot:
make PLAT=ls1043ardb bl2 BOOT_MODE=nand pbl
RCW=<path_to_rcw_binary>/<rcw_freq.bin>
3.2 HOW TO COMPILE FIP BINARY
To compile the FIP binary without OPTEE and trusted board boot:
$make PLAT=<platform> fip BL33=<path_to_u-boot_binary>/u-boot.bin
For LS1043ARDB:
$make PLAT=ls1043ardb fip BL33=<path_to_u-boot_binary>/u-boot.bin
The compiled BL31 and FIP binaries ( bl31.bin, fip.bin ) are available at
atf/build/ls1043ardb/release/. For any update in the BL31, BL32, or BL33 binaries,
the fip.bin binary needs to be recompiled.
4 Program TF-A binaries on specific boot mode
For that step you can use a tftp server, but it is easier with a USB formatted on
FAT32.
You have to put the files “ bl2_<boot_mode>.pbl” and “fip.bin” in the usb and follow
the steps to your boot mode.
4.1 Program TF-A binaries on IFC NOR flash
For LS1043A, the steps to program TF-A binaries on IFC NOR flash are as follows:
1. Boot the board from the default bank.
2. Under U-boot prompt:
=> usb start
3. Flash bl2_nor.pbl:
=> fatload usb 0:1 $load_addr bl2_nor.pbl
a. Alternate bank:
=> protect off 64000000 +$filesize && erase 64000000 +$filesize &&
cp.b $load_addr 64000000 $filesize
b. Current bank:
=> protect off 60000000 +$filesize && erase 60000000 +$filesize &&
cp.b $load_addr 60000000 $filesize
4. Flash fip.bin:
=> fatload usb 0:1 $load_addr fip.bin
a. Alternate bank:
=> protect off 64100000 +$filesize && erase 64100000 +$filesize &&
cp.b $load_addr 64100000 $filesize
b. Current bank:
=> protect off 60100000 +$filesize && erase 60100000 +$filesize &&
cp.b $load_addr 60100000 $filesize
5. Reset your board:
a. Alternate bank:
cpld reset altbank
b. Current bank:
cpld reset
4.2 Program TF-A binaries on NAND flash
1. Boot the board from the default bank.
2. Under U-boot prompt:
=> usb start
3. Flash bl2_nand.pbl to NAND flash:
=> fatload usb 0:1 $load_addr bl2_nand.pbl
=> nand erase 0x0 $filesize;nand write $load_addr 0x0 $filesize;
4. Flash fip_uboot.bin to NAND flash:
=> fatload usb 0:1 $load_addr fip.bin
=> nand erase 0x100000 $filesize;nand write $load_addr 0x100000 $filesize;
5. Reset your board:
=> cpld reset nand
4.3 Program TF-A binaries on SD card
To program TF-A binaries on an SD card, follow these steps:
1. Boot the board from the default bank.
2. Under U-boot prompt:
=> usb start
3. Flash bl2_sd.pbl to SD card:
=> fatload usb 0:1 $load_addr bl2_sd.pbl
=> mmc write $ load_addr 8 A1
4. Flash fip.bin to SD card:
=> fatload usb 0:1 $load_addr bl2_sd.pbl
=> mmc write $load_addr 800 A1
5. Reset your board:
=> cpld reset sd
Now the console should be out from UART2 port of the board.