Layerscape Knowledge Base

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

Layerscape Knowledge Base

Labels

Discussions

Sort by:
Follow these steps to update the composite firmware image in QSPI NOR flash. qixis_reset boots the board from QSPI NOR flash0 and qixis_reset altbank boots the board from QSPI NOR flash1. sf probe 0:1 means that the alternate bank will be written to. So, if the board boots from QSPI NOR flash0 and sf probe 0:1 is entered at the U-Boot prompt, the commands that follow will program QSPI NOR flash1. Obtaining composite firmware image  LSDK includes pre-built firmware images for QSPI NOR flash. The LSDK composite firmware includes RCW+PBI, boot loader firmware, DPAA1 FMan ucode, QE/uQE firmware, Ethernet PHY firmware, DPAA2 MC firmware, DPAA2 DPL, DPAA2 DPC, device tree, and lsdk_linux_<arch>.itb images. Refer the Layerscape Software Development Kit <version> Documention for the complete flash memory layout of the images.  On a Linux host machine, download composite firmware image from nxp.com.    $ wget http://www.nxp.com/lgfiles/sdk/lsdk<lsdk_version>/firmware_<RDB_name>_uboot_qspiboot.img  For example: For LS1088ARDB:  $ wget http://www.nxp.com/lgfiles/sdk/lsdk1809/firmware_ls1088ardb_uboot_qspiboot.img  For LS1088ARDB-PB:  $ wget https://www.nxp.com/lgfiles/sdk/lsdk1809/firmware_ls1088ardb_pb_uboot_qspiboot.img Flashing composite firmware images to QSPI NOR flash Boot LS1088ARDB/LS1088ARDB-PB from QSPI. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI , SW1[1:8] + SW2[1] = 0011_0001_X Boot from QSPI NOR flash0: => qixis_reset For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:0 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:0 Composite firmware image can be loaded to the LS1088ARDB/LS1088ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from the TFTP server   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC1@xgmii, DPMAC2@xgmii, DPMAC3@qsgmii, DPMAC4@qsgmii, DPMAC5@qsgmii, DPMAC6@qsgmii, DPMAC7@qsgmii, DPMAC8@qsgmii, DPMAC9@qsgmii, DPMAC10@qsgmii Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LS1088ARDB/LS1088RDB-PB Ethernet port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@qsgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@qsgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@qsgmii device host 192.168.1.1 is alive   Load U-Boot image from the TFTP server Program QSPI NOR flash1: => sf probe 0:1 Flash LS1088ARDB or LS1088ARDB-PB composite firmware image: For LS1088ARDB: => tftp 0xa0000000 firmware_ls1088ardb_uboot_qspiboot.img => print filesize filesize=2351db0 For LS1088ARDB-PB: => tftp 0xa0000000 firmware_ls1088ardb_pb_uboot_qspiboot.img => print filesize filesize=2351db0 Program composite firmware image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Boot from QSPI NOR flash1: => qixis_reset altbank For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:1 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:1 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash. Option 2: Load image from partition on mass storage device (SD, USB, or SATA) Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on storage device => ls mmc <device:partition> For example: => ls mmc 0:2 Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 Program QSPI NOR flash1: => sf probe 0:1 Load composite firmware image from the storage device => load mmc 0:2 a0000000 <image name> => print filesize For example, for LS1088ARDB: => load mmc 0:2 a0000000 firmware_ls1088ardb_uboot_qspiboot.img => print filesize filesize=235bd40 For example, for LS1088ARDB-PB: => load mmc 0:2 a0000000 firmware_ls1088ardb_pb_uboot_qspiboot.img => print filesize filesize=2351db0 Or => load usb 0:2 a0000000 <image name> => print filesize Or => load scsi 0:2 a0000000 <image name> => print filesize Program image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Boot from QSPI NOR flash1: => qixis_reset altbank In boot log, you’ll see: For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:1 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:1 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash.
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images in NOR flash. qixis_reset boots the board from NOR bank 0 and qixis_reset altbank boots the board from NOR bank 4. Obtaining MC firmware Clone the qoriq-mc-binary repository. $ git clone https://github.com/NXP/qoriq-mc-binary.git $ cd qoriq-mc-binary/ls2088a/ $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-19.09 LSDK-19.09 The prebuilt MC firmware image, mc_10.18.0_ls2088a.itb, is available at /qoriq-mc-binary/ls2088a/. Note that the name of the MC firmware image may vary depending on the release version used.  Obtaining DPC and DPL images Clone the mc-utils repository and compile the DPC and DPL images. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils $ cd mc-utils $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-19.09 LSDK-19.09 If required, make changes to the DPC and DPL files. $ make -C config/ The compiled dpc.0x2A_0x41.dtb and  dpl-eth.0x2A_0x41.dtb images are available at /mc-utils/config/ls2088a/RDB/. Note that the name of the DPC and DPL images may vary depending on the release version used.  Flashing MC firmware, DPC, and DPL images to NOR flash Boot LS2088ARDB from NOR flash. Ensure that the switches are set to boot the board from NOR bank 0. For booting from NOR bank 0, switch settings are as follows:         SW5[1:8] = 1111 1111      SW3[1:8] = 0001 0010      SW4[1:8] = 1111 1111      SW6[1:8] = 1111 1111      SW7[1:8] = 0100 0010      SW9[1:8] = 0100 0000      SW8[1:8] = 0111 1111     In addition to the above switch settings, make sure the following jumper settings are correct (for RDB Rev E and later) J14 = 1-2, for NOR boot Boot from NOR bank 0: => qixis_reset   For LS2088ARDB, in boot log, you'll see: Board: LS2088AE Rev1.1-RDB, Board Arch: V1, Board version: F, boot from vBank: 0 The images can be loaded to the LS2088ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from the TFTP server Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC1@xgmii, DPMAC2@xgmii, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@xgmii, DPMAC6@xgmii, DPMAC7@xgmii, DPMAC8@xgmii    Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1>    Set ethact and ethprime as the Ethernet interface connected to the TFTP server. See LS2088ARDB Ethernet port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux.                                                                       => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC1@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC1@xgmii    Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp    Save the settings. => saveenv    Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC1@xgmii device host 192.168.1.1 is alive Load images from a TFTP server Flash MC firmware to NOR bank 4 (after booting from NOR bank 0): => tftp 0x80000000 mc_10.18.0_ls2088a.itb => print filesize => erase 0x584A00000 +$filesize;cp.b 80000000 0x584A00000 $filesize Address 0x584A0000 is the location of MC firmware in alternate NOR bank. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image to NOR bank 4 (after booting from NOR bank 0): => tftp 0x80000000 dpl-eth.0x2A_0x41.dtb => print filesize  => erase 0x584D00000 +$filesize;cp.b 80000000 0x584D00000 $filesize Address 0x584D00000 is the location of DPL image in alternate NOR bank. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPC image to NOR bank 4 (after booting from NOR bank 0): => tftp 0x80000000 dpc.0x2A_0x41.dtb => print filesize  => erase 0x584E00000 +$filesize;cp.b 80000000 0x584E00000 $filesize Address 0x584E00000 is the location of DPC image in alternate NOR bank. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from NOR bank 4: => qixis_reset altbank Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored in NOR flash. Option 2: Load images from partition on mass storage device (SD, USB, or SATA) Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on the storage device => ls mmc <device:partition> For example: => ls mmc 0:2 Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 If the ls command fails to run, check that U-Boot in NOR bank 0 supports the command by typing ls at the U-Boot prompt: => ls ls - Lists files in a directory (default) Usage: ls <interface> [<dev[:part]> [directory]] - Lists files in directory [directory] of partition [part] on device type [interface] and instance [dev]. If U-Boot does not support this command, then update the composite firmware image in NOR bank 0. For steps to update composite firmware image in NOR bank, see Layerscape Software Development Kit User Guide . Use the following command if the SD card is formatted/created using LSDK flex-installer command: => load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: => load mmc 0:2 $load_addr mc_10.18.0_ls2088a.itb Use the following command if the SD card is formatted/created on a Windows PC: => fatload <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: => fatload mmc 0:2 $load_addr mc_10.18.0_ls2088a.itb Use the following command if the SD card is formatted/created on a Linux PC: => ext2load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: =>ext2load mmc 0:2 $load_addr mc_10.18.0_ls2088a.itb Also note that LSDK flex-installer command puts the images on the IInd partition, so 0:2 is used in the load command. If the SD card is formatted on Windows PC or Linux PC for single partition only, then 0 should be used instead of 0:2 in the fatload/ext2load command. Flash MC firmware: Load MC firmware image from the storage device => load mmc 0:2 80000000 <mc firmware> For example: => load mmc 0:2 80000000 mc_10.18.0_ls2088a.itb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program MC firmware image to NOR bank 4 (after booting from NOR bank 0): => erase 0x584A00000 +$filesize;cp.b 80000000 0x584A00000 $filesize  Address 0x584A00000 is the location of MC firmware in alternate NOR bank.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image: Load DPL image from the storage device => load mmc 0:2 80000000 <dpl image> For example: => load mmc 0:2 80000000 dpl-eth.0x2A_0x41.dtb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program DPL image to NOR bank 4 (after booting from NOR bank 0): => erase 0x584D00000 +$filesize;cp.b 80000000 0x584D00000 $filesize Address 0x584D00000 is the location of DPL image in alternate NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPC image: Load DPC image from the storage device => load mmc 0:2 80000000 <dpc image> For example: => load mmc 0:2 80000000 dpc.0x2A_0x41.dtb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program DPC image to NOR bank 4 (after booting from NOR bank 0): => erase 0x584E00000 +$filesize;cp.b 80000000 0x584E00000 $filesize Address 0x584E00000 is the location of DPC image in alternate NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from NOR bank 4: => qixis_reset altbank Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored in NOR flash.
View full article
The table below shows the mapping of the Ethernet port names appearing on the front panel of the LS1046ARDB chassis with the port names in U-Boot, tinyDistro, and NXP LSDK userland.  Port name on chassis Port name in U-Boot Port name in Linux (tinyDistro) Port name in Linux (LSDK userland) RGMII1 FM1@DTSEC3 eth0 fm1-mac3 RGMII2 FM1@DTSEC4 eth1 fm1-mac4 SGMII1 FM1@DTSEC5 eth2 fm1-mac5 SGMII2 FM1@DTSEC6 eth3 fm1-mac6 10G Copper FM1@TGEC1 eth4 fm1-mac9 10G SEP+ FM1@TGEC2 eth5 fm1-mac10
View full article
This how-to topic is applicable for only LSDK 18.09 and older releases. Follow these steps to update the PBL/RCW binary in QSPI NOR flash.  cpld reset boots the board from QSPI NOR flash0 and cpld reset altbank boots the board from QSPI NOR flash1. sf probe 0:1 means that the alternate bank will be written to. So, if the board boots from QSPI NOR flash0 and sf probe 0:1 is entered at the U-Boot prompt, the commands that follow will program QSPI NOR flash1.   Compiling PBL binary from RCW source file (optional) If user already has a PBL binary this step can be skipped.   Clone the rcw  repository and compile the PBL binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/rcw $ cd rcw $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-18.09 LSDK-18.09  $ cd ls1046ardb If required, make changes to the rcw files. $ make The default PBL binary for LS1046ARDB is RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin.swapped By default the QSPI controller on LS1046A reads/writes in 64-bit big endian (BE) mode. This makes it necessary to use a byte swapped PBL binary image, e.g., rcw_1800_qspiboot.bin.swapped. The last PBI command in rcw_1800_qspiboot.bin.swapped is a write to the QPSI_MCR register that changes the endianness of the QSPI controller to 64-bit little endian (LE). With this change, subsequent accesses will be made in little endian format. See the rcw/ls1046ardb/README file for an explanation of the naming convention for the directories that contain the RCW source and binary files. Flashing PBL binary to QSPI NOR flash PBL image can be loaded to LS1046ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from the TFTP server Boot LS1046ARDB from QSPI NOR flash. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI, SW5[1:8] = 00100010 Boot from QSPI NOR flash0: => cpld reset In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 0 Set up Ethernet connection When the board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5, FM1@DTSEC6, FM1@TGEC1, FM1@TGEC2 Set server IP to the IP of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. Refer LS1046ARDB Ethernet port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime FM1@DTSEC4 => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact FM1@DTSEC4 Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command. Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using FM1@DTSEC4 device host 192.168.1.1 is alive Load PBL binary from the TFTP server Program QSPI NOR flash1: => sf probe 0:1 TFTP PBL binary from the server to the DDR and write image to QSPI NOR flash1: => tftp 0xa0000000 <pbl binary> => print filesize filesize=128 => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Address 0x0 is the location of PBL in the QSPI NOR flash.  Refer Flash layout for boot flow with PPA – LSDK 18.09 and older releases for the complete flash memory layout. Boot from QSPI NOR flash1: => cpld reset altbank In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 4 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in the QSPI NOR flash. Option 2: Load image from partition on mass storage device (SD, USB, or SATA) Boot LS1046ARDB from QSPI NOR flash. Ensure that the switches are set to boot the board from QSPI. For booting from the QSPI flash, SW5[1:8] = 00100010 Boot from flash0: => cpld reset In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 0 Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on the storage device. => ls mmc <device:partition> For example: => ls mmc 0:3 System Volume Information/ 168 rcw_1800_qspiboot.bin.swapped 1 file(s), 1 dir(s) Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 If the ls command fails to run, check that U-Boot in QSPI NOR flash0 supports the command by typing ls at the U-Boot prompt: => ls ls - lists files in a directory (default) Usage: ls <interface> [<dev[:part]> [directory]] - Lists files in directory [directory] of partition [part] on device type [interface] and instance [dev]. If U-Boot does not support this command, then update the composite firmware image in QSPI NOR flash0. For steps to update composite firmware image in QSPI NOR flash, refer LS1046ARDB - How to update composite firmware image in QSPI NOR flash. Program QSPI NOR flash1: => sf probe 0:1 Load PBL image from the storage device. => load mmc <device:partition> a0000000 <image name> => print filesize For example: => load mmc 0:3 a0000000 rcw_1800_qspiboot.bin.swapped 168 bytes read in 13 ms (11.7 KiB/s) => print filesize filesize=a8 Or => load usb <device:partition> a0000000 <image name> => print filesize Or => load scsi <device:partition> a0000000 <image name> => print filesize Program image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize Address 0x0 is the location of PBL binary in QSPI NOR flash.  Refer Flash layout for boot flow with PPA – LSDK 18.09 and older releases for the complete flash memory layout. Boot from QSPI NOR flash1: => cpld reset altbank In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 4 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash.
View full article
Please note that the LSDK memory layout for PPA boot flow explained in this topic is only applicable for LSDK 18.09 and older releases. For LSDK 18.12 and newer releases, refer Flash layout for new boot flow with TF-A. The following table shows the memory layout of various firmware stored in NOR/NAND/QSPI flash device or SD card on all QorIQ Reference Design Boards. Firmware Definition MaxSize NOR/NAND/QSPI Flash Offset SD Start Block No. RCW + PBI 1 MB 0x00000000 0x00008 Boot firmware (U-Boot or UEFI) 2 MB 0x00100000 0x00800 Boot firmware environment 1 MB 0x00300000 0x01800 PPA firmware 2 MB 0x00400000 0x02000 Secure boot headers 3 MB 0x00600000 0x03000 DPAA1 FMAN ucode 256 KB 0x00900000 0x04800 QE/uQE firmware 256 KB 0x00940000 0x04A00 Ethernet PHY firmware 256 KB 0x00980000 0x04C00 DPAA2-MC or PFE firmware 3 MB 0x00A00000 0x05000 DPAA2 DPL 1 MB 0x00D00000 0x06800 DPAA2 DPC 1 MB 0x00E00000 0x07000 Device tree(needed by uefi) 1 MB 0x00F00000 0x07800 Kernel lsdk_linux_<arch>.itb 16 MB 0x01000000 0x08000 Ramdisk rfs 32 MB 0x02000000 0x10000 The following figures highlight the changes in the flash layout for boot flow with PPA and flash layout for new TF-A boot flow. Flash layout for boot flow with PPA   Changed flash layout for TF-A boot flow
View full article
Trusted Firmware for Cortex-A (TF-A) is an implementation of EL3 secure firmware. TF-A replaces PPA in secure firmware role. Please note the steps listed in this topic can only be performed with LSDK 18.12 and newer releases.  Also the TF-A boot flow is applicable only for LS1088ARDB-PB. LS1088ARDB is not supported LSDK 18.12 release onwards. To migrate to the TF-A boot flow from the previous boot flow (with PPA), you need to compile the TF-A binaries, bl2_<boot_mode>.pbl and fip.bin, and flash these binaries on the specific boot medium on the board. For SD boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_sd.pbl BL2 binary: Platform initialization binary RCW binary for SD boot  fip.bin BL31: Secure runtime firmware BL32: Trusted OS, for example, OPTEE (optional) BL33: U-Boot/UEFI image Follow these steps to compile and deploy TF-A  binaries (bl2_sd.pbl and fip.bin) on the SD card. Compile PBL binary from RCW source file Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries (bl2_sd.pbl and fip.bin) for SD boot Program TF-A binaries to the SD card Step 1: Compile PBL binary from RCW source file You need to compile the rcw_1600_sd.bin binary to build the bl2_sd.pbl binary. Clone the  rcw repository and compile the PBL binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/rcw $ cd rcw $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-18.12 LSDK-18.12  $ cd ls1088ardb If required, make changes to the rcw files. $ make   The compiled PBL binary for SD boot on LS1088ARDB-PB, rcw_1600_sd.bin, is available at rcw/ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/.   See the rcw/ls1088ardb/README file for an explanation of the naming convention for the directories that contain the RCW source and binary files. Step 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. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot.git $ cd u-boot $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-18.12 LSDK-18.12  $ export ARCH=arm $ export CROSS_COMPILE=aarch64-linux-gnu- $ make distclean $ make ls1088ardb_tfa_defconfig $ make If the make command shows the error "*** Your GCC is older than 6.0 and is not supported", ensure that you are using Ubuntu 18.04 64-bit version for building the LSDK 18.12 U-Boot binary.  The compiled U-Boot binary, u-boot.bin, is available at u-boot/. Step 3: [Optional] Compile OPTEE binary  You need to compile the tee.bin binary to build fip.bin with OPTEE. However, OPTEE is optional, you can skip the procedure to compile OPTEE if you want to build the FIP binary without OPTEE. Clone the optee_os repository and build the OPTEE binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/optee_os $ cd optee_os $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-18.12 LSDK-18.12 $ export ARCH=arm $ export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-ls1088ardb $ aarch64-linux-gnu-objcopy -v -O binary out/arm-plat-ls/core/tee.elf out/arm-plat-ls/core/tee.bin The compiled OPTEE image, tee.bin, is available at optee_os/out/arm-plat-ls/core/. Step 4: Compile TF-A binaries for SD boot Clone the atf repository and compile the TF-A binaries, bl2_sd.pbl and fip.bin. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/atf $ cd atf $  git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-18.12 LSDK-18.12 $ export ARCH=arm $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=ls1088ardb bl2 SPD=opteed BOOT_MODE=sd pbl RCW=<path_to_rcw_binary>/rcw_1600_sd.bin The compiled BL2 images, bl2.bin and bl2_sd.pbl are available at atf/build/ls1088ardb/release/. For any update in the BL2 source code or RCW binary, the bl2_sd.pbl binary needs to be recompiled. To compile the BL2 binary without OPTEE: $ make PLAT=ls1088ardb bl2 BOOT_MODE=sd pbl RCW=<path_to_rcw_binary>/rcw_1600_sd.bin Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=ls1088ardb fip BL33=<path_to_u-boot_binary>/u-boot.bin SPD=opteed BL32=<path_to_optee_binary>/tee.bin The compiled BL31 and FIP binaries, bl31.bin, fip.bin, are available at atf/build/ls1088ardb/release/. For any update in the BL31, BL32, or BL33 binaries, the fip.bin binary needs to be recompiled. To compile the FIP binary without OPTEE and without trusted board boot: $ make PLAT=ls1088ardb fip BOOT_MODE=sd BL33=<path_to_u-boot_binary>/u-boot.bin To compile the FIP binary with trusted board boot, refer the read me at <atf repository>/plat/nxp/README.TRUSTED_BOOT Step 5: Program TF-A binaries to SD card Boot LS1088ARDB-PB from QSPI. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI , SW1[1:8] + SW2[1] = 0011_0001_X Boot from QSPI NOR flash0: => qixis_reset For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:0 Please ensure that you are using LS1088ARDB-PB to flash the TF-A binaries, as LS1088ARDB is not supported LSDK 18.12 release onwards.   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC1@xgmii, DPMAC2@xgmii, DPMAC3@qsgmii, DPMAC4@qsgmii, DPMAC5@qsgmii, DPMAC6@qsgmii, DPMAC7@qsgmii, DPMAC8@qsgmii, DPMAC9@qsgmii, DPMAC10@qsgmii Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the Ethernet interface connected to the TFTP server. See LS1088ARDB/LS1088RDB-PB Ethernet port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@qsgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@qsgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@qsgmii device host 192.168.1.1 is alive   Load TF-A binaries from the TFTP server For details about the flash image layout for TF-A binaries, refer LSDK memory layout for TF-A boot flow. Flash bl2_sd.pbl: => tftp 82000000 bl2_sd.pbl => mmc write 82000000 8 <blk_cnt> Here, blk_cnt refers to number of blocks in SD card that need to be written as per the file size. For example, when you load bl2_sd.pbl from the TFTP server, if the bytes transferred is 82809 (14379 hex), then blk_cnt is calculated as 82809/512 = 161 (A1 hex). For this example, mmc write command will be: => mmc write 82000000 8 A1 Flash fip.bin: => tftp 82000000 fip.bin => mmc write 82000000 800 <blk_cnt> Here, blk_cnt refers to number of blocks in SD card that need to be written as per the file size. For example, when you load fip.bin from the TFTP server, if the bytes transferred is 1077157 (106fa5 hex), then blk_cnt is calculated as 1077157/512 = 2103 (837 hex). For this example, mmc write command will be: => mmc write 82000000 800 837 Boot from SD card: => qixis_reset sd LS1088ARDB-PB will boot with TF-A. In the boot log, you will see: NOTICE: UDIMM 18ASF1G72AZ-2G6B1 NOTICE: 8 GB DDR4, 64-bit, CL=15, ECC on, CS0+CS1 NOTICE: BL2: v1.5(release):LSDK-18.12 NOTICE: BL2: Built : 11:57:03, Dec 23 2018 NOTICE: BL31: v1.5(release):LSDK-18.12 NOTICE: BL31: Built : 15:21:44, Feb 11 2019 NOTICE: Welcome to LS1088 BL31 Phase For steps to deploy TF-A binaries in QSPI NOR flash, see LS1088ARDB-PB - How to deploy TF-A binaries in QSPI NOR flash
View full article