Layerscape Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

Layerscape Knowledge Base

Knowledge Base Articles

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.                                                       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_sdboot.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-19.03  LSDK-19.03   $ cd ls1043ardb If required, make changes to the rcw files. $ make   The compiled PBL binary for SD boot on  LS1043ARDB,  rcw_1600_sdboot.bin , is available at rcw/ls1043ardb/RR_FQPP_1455/ .    See the  rcw/ls1043ardb/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-19.03  LSDK-19.03   $   export  ARCH=arm64 $   export CROSS_COMPILE= aarch64-linux-gnu- $   make  distclean $  make ls1043ardb_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 i f 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-19.03  LSDK-19.03 $ export  ARCH=arm $   export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-ls1043ardb $ 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-19.03  LSDK-19.03 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=ls1043ardb bl2 SPD=opteed BOOT_MODE=sd BL32= <path_to_optee_binary>/ tee.bin pbl RCW= <path_to_rcw_binary> /rcw_1600_sdboot.bin The compiled BL2 images,  bl2.bin and bl2_sd.pbl are available at atf/build/ls1043ardb/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=ls1043ardb bl2  BOOT_MODE=sd pbl RCW= <path_to_rcw_binary>/ rcw_1600_sdboot.bin                  Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=ls1043ardb 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/ls1043ardb/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=ls1043ardb 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   LS1043ARDB  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: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from  NOR bank  0:  => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 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   LS1043ARDB Ethernet and FMC port mapping   for the mapping of Ethernet port names appearing on the chassis front panel w ith 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 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)" + "few sectors for rounding up so that last block is not missed" . So, if you round up by 10 (A hex) sectors, for this example, mmc write command will be:  => mmc write 82000000 8 AB 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. Fo r 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)" + "few sectors for rounding up so that last block is not missed". So, if you round up by 10 (A hex) sectors, for this example, mmc write command will be: =>  mmc write 82000000 800 841 Boot from  SD card :   => cpld  reset sd LS1043ARDB will boot with TF-A. In the boot log, you will see: NOTICE: Fixed DDR on board NOTICE: 2 GB DDR4, 32-bit, CL=11, ECC off NOTICE: BL2: v1.5(release):LSDK-19.03 NOTICE: BL2: Built : 14:59:48, May 28 2019 NOTICE: BL31: v1.5(release):LSDK-19.03 NOTICE: BL31: Built : 15:07:21, May 28 2019 NOTICE: Welcome to LS1043 BL31 Phase U-Boot 2018.09 (May 23 2019 - 14:35:16 +0530) SoC: LS1043AE Rev1.1 (0x87920011) Clock Configuration: CPU0(A53):1600 MHz CPU1(A53):1600 MHz CPU2(A53):1600 MHz CPU3(A53):1600 MHz Bus: 400 MHz DDR: 1600 MT/s FMAN: 500 MHz Reset Configuration Word (RCW): 00000000: 08100010 0a000000 00000000 00000000 00000010: 14550002 80004012 60040000 c1002000 00000020: 00000000 00000000 00000000 00038800 00000030: 00000000 00001100 00000096 00000001 Model: LS1043A RDB Board Board: LS1043ARDB, boot from SD
View full article
In Linux, only one MAC is created by default as a standard kernel Ethernet interface. This interface is named  eth0  by default (or  eth1  if PCI Express network interface card  is  discovered first). The following figure shows the   Etherne t port  (ETH8) that  eth0  (or  eth1 )  corresponds to, on LS1088ARDB.  The following figure shows the   Etherne t port  (DPMAC5) that  eth0  (or  eth1 )  corresponds to, on LS1088ARDB-PB. Only one interface is created by default because in DPAA2, Ethernet ports need not be associated with Linux kernel Ethernet driver instances. For example, Ethernet ports can be assigned as ports on switches or can be allocated to user space. Furthermore, these associations can be made dynamically.  From Linux, you can list the available interfaces using the ifconfig -a command or the  ip link command . For example: $ ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000     link/ether 68:05:ca:36:96:6a brd ff:ff:ff:ff:ff:ff 3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000     link/sit 0.0.0.0 brd 0.0.0.0 4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000     link/ether 6e:01:3f:a2:04:b6 brd ff:ff:ff:ff:ff:ff In this example, Linux eth1 corresponds to Ethernet port DPMAC5 (ETH8) on LS1088ARDB . Create network interfaces Check the network interfaces that are currently available using Layerscape script ls-listni . For example: $ ls-listni dprc.1/dpni.0 (interface: eth1, end point: dpmac.5) The default interface DPNI.0 is configured with a minimal set of resources. For example, it can only receive traffic on GPP0 and its intended uses are network boot and low-bandwidth traffic. For fully-featured DPNI objects, dynamic configuration (explained in upcoming steps) is recommended. Optional - Unbind and destroy existing interface.   $ echo dpni.0 > /sys/bus/fsl-mc/drivers/fsl_dpaa2_eth/unbind $ restool dpni destroy dpni.0 dpni.0 is destroyed The restool utility is a Linux user space command that allows DPAA2 objects to be managed (created, destroyed, and queried for status). Add new network interfaces using Layerscape script ls-addni . For example: $ ls-addni dpmac.3 Created interface: eth1 (object:dpni.0, endpoint: dpmac.3) $ ls-addni dpmac.4 Created interface: eth2 (object:dpni.1, endpoint: dpmac.4)   Check that new interfaces are created using the  ifconfig -a  or   ip link   command . Enable the newly created interfaces using the  ifconfig command For example: ifconfig eth1 192.168.1.23 up ifconfig eth2 192.168.1.24 up Optional - Save current configuration to a Data Path Layout (DPL) file DPL file is used to create DPAA2 entities prior to Linux boot. To save the current configuration to a DPL file, follow the steps below. After creating the custom DPL, you can program it to the boot source (for example, QSPI NOR flash or SD card) so that the configuration is present automatically next time Linux boots. In this case, the existing DPL is replaced with the updated DPL file. Save this custom configuration to a DPL file (.dts format) on the board. $ restool dprc generate-dpl dprc.1 > <my_dpl>.dts Copy the DPL file to the Linux host machine. You can SCP the file from the board to the Linux host machine. Run following command to convert it to the .dtb format. $ dtc -I dts -O dtb <my_dpl>.dts -o <my_dpl>.dtb For steps to program the new DPL file in the QSPI NOR flash or on the SD card, see LS1088ARDB - How to update MC firmware, DPC, and DPL images in QSPI NOR flash or LS1088ARDB/LS1088ARDB-PB - How to update MC firmware, DPC, and DPL images on SD card.
View full article
This how-to topic is applicable for only LSDK 18.09 and older releases. Follow these steps to update the U-Boot binary in QSPI NOR flash.  Prerequisites  Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.0 6 or LSDK 18.09 U- Boot binary . 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 U-Boot binary Clone the  u-boot   repository. $ 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.09  LSDK-18.09   $ export  ARCH=arm64 $ export CROSS_COMPILE= aarch64-linux-gnu- $ make  distclean $ make ls10 46ardb_qspi _defconfig If required, make changes to the   U -Boot   files. $ 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 LSDK 1 8.06 or LSDK 18.09 U-B oot binary.  The compiled U-Boot image, u- boot .bin , is available in the directory  u-boot / . Flashing U-Boot   binary   to   QSPI NOR flash U-Boot 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. 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. See  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 U-Boot image from the TFTP server Program QSPI NOR flash1 :  =>  sf probe 0:1 Flash U-Boot image: => tftp 0xa0000000 u-boot.bin => print   filesize filesize=ae84a Program U-Boot image to QSPI NOR flash:  =>  sf erase 0x1 00000 +$ fil esize  && sf write 0xa0000000 0x1 00000 $ filesize Address 0x100000  is the location of U-Boot in QSPI NOR flash.   Refer Flash layout for boot flow with PPA – LSDK 18.09 and older releases  for  t he 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. 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   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 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:3 System Volume Information/ 714826 u-boot.bin 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, see LS1046ARDB - How to update composite firmware image in QSPI NOR flash. Program QSPI NOR flash1 :  => sf probe 0:1 Load U-Boot image from the storage device. => load mmc <device:partition> a0000000 <image name> => print filesize For example: => load mmc 0:3 a0000000 u-boot.bin 714826 bytes read in 52 ms (13.1 MiB/s) => print filesize filesize=ae84a Or => load usb <device:partition> a0000000 <image name> => print filesize Or => load scsi <device:partition> a0000000 <image name> => print filesize Program U-Boot image to QSPI NOR flash:  =>   sf erase 0x1 00000 +$ fil esize  && sf write 0xa0000000 0x1 00000 $ filesize Address 0x100000  is the location of U-Boot 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
This how-to topic is applicable only for LSDK 18.09 and older releases.  For LSDK 18.12 and newer releases, refer LS1088ARDB-PB - How to deploy TF-A binaries in QSPI NOR flash. Follow these steps to update the PBL /RCW  binary 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.   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 ls1088ardb If required, make changes to the rcw  files. $ make The default  PBL binary for QSPI NOR flash on  LS1088ARDB/ LS1088ARDB-PB,   rcw_1600_qspi.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. Flashing PBL   binary   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 example: 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 PBL binary can be loaded to LS1088ARDB/LS1088ARDB-PB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from a 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 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  0x a 0000000  < pbl   binary > =>   print   filesize filesize=b4 => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize   Address 0x0 is the location of PBL in QSPI NOR flash.   For  t he complete flash memory layout for the PPA boot flow, r efer Flash layout for old boot flow with PPA . 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 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 Program QSPI NOR flash1 :  => sf probe 0:1 Load PBL image from the storage device. => load mmc 0:2 a0000000 <image name> => print filesize For example: => load mmc 0:2 a0000000 rcw_1600_qspi.bin =>   print   filesize filesize=b4 Or => load usb 0:2 a0000000 <image name> => print filesize Or => load scsi 0:2 a0000000 <image name> => print filesize Program ima ge 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 old boot flow with PPA  for  t he complete flash memory layout for the PPA boot flow . 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.
View full article
This how-to topic is applicable only for LSDK 18.09 and older releases.  For LSDK 18.12 and newer releases, refer LS1088ARDB-PB - How to deploy TF-A binaries in QSPI NOR flash. Follow these steps to update the U-Boot binary in QSPI NOR flash.  Prerequisites  Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.0 6 or LSDK 18.09 U- Boot binary . 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.   Compiling U-Boot binary Clone the  u-boot   repository  compile the U-Boot binary  for QSPI boot. $ 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.09  LSDK-18.09   $ export  ARCH=arm64 $ export CROSS_COMPILE= aarch64-linux-gnu- $ make  distclean Run either of following depending on the board you are using:  For LS1088ARDB: $ make ls1088 ardb_qspi _defconfig For LS1088ARDB-PB: make ls1088ardb_pb_qspi_defconfig If required, make changes to the U -Boot files. $ 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 LSDK 1 8.06 or LSDK 18.09 U-B oot binary.  The compiled U-Boot image, u- boot .bin , is available at u-boot / . Flashing U-Boot   binary   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 the QSPI , SW1[1:8] + SW2[1] = 0011_0001_X Boot from QSPI NOR flash0 : => qixis_reset For example: 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 U-Boot image can be loaded to LS1088ARDB/LS1088ARDB-PB 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 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. See LS1088ARDB/LS1088RDB-PB Ethernet port mapping for the mapping of Ethernet port names appearing on  the chassis front panel w ith 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 U-Boot image: => tftp 0xa0000000 u-boot.bin => print  filesize filesize=aa4b4 Program U-Boot image to QSPI NOR flash:  =>  sf erase 0x1 00000 +$ fil esize  && sf write 0xa0000000 0x1 00000 $ filesize.  Address 0x100000 is the location of U-Boot in QSPI NOR flash.  For the complete flash memory layout for the PPA boot flow, r efer   Flash layout for old boot flow with PPA . 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 U-Boot image from the storage device => load mmc 0:2 a0000000 <image name> => print filesize For example: => load mmc 0:2 a0000000 u-boot.bin => print filesize filesize=aaa34 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 0x1 00000 +$ fil esize  && sf write 0xa0000000 0x1 00000 $ filesize   Address 0x100000 is the location of U-Boot in QSPI NOR flash.  For the complete flash memory layout for the PPA boot flow, r efer   Flash layout for old boot flow with PPA .  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.
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.                       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 NOR boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_nor BL2 binary: Platform initialization binary RCW binary for NOR 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_nor. pbl   and   fip.bin)  on the NOR flash. Compile PBL binary from RCW source file Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries ( bl2_nor. pbl   and   fip.bin)  for NOR boot Program TF-A binaries to the NOR flash Step 1: Compile PBL binary  from RCW source file You need to compile the rcw_1600.bin  binary to build the bl2_nor.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-19.03  LSDK-19.03   $ cd ls1043ardb If required, make changes to the rcw files. $ make   The compiled PBL binary for NOR boot on  LS1043ARDB,  rcw_1600.bin , is available at rcw/ls1043ardb/RR_FQPP_1455/ .    See the  rcw/ls1043ardb/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-19.03  LSDK-19.03   $   export  ARCH=arm64 $   export CROSS_COMPILE= aarch64-linux-gnu- $   make  distclean $  make ls1043ardb_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 i f 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-19.03  LSDK-19.03 $ export  ARCH=arm $   export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-ls1043ardb $ 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 NOR boot Clone the atf repository and compile the TF-A binaries,  bl2_nor. 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-19.03  LSDK-19.03 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=ls1043ardb bl2 SPD=opteed BOOT_MODE=nor BL32= <path_to_optee_binary>/ tee.bin pbl RCW= <path_to_rcw_binary> /rcw_1600.bin The compiled BL2 images,  bl2.bin and bl2_nor.pbl are available at atf/build/ls1043ardb/release/ . For any update in the BL2 source code or RCW binary, the  bl2_nor.pbl  binary needs to be recompiled. To compile the BL2 binary without OPTEE: $  make PLAT=ls1043ardb bl2  BOOT_MODE=nor pbl RCW= <path_to_rcw_binary>/ rcw_1600.bin                  Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=ls1043ardb 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/ls1043ardb/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=ls1043ardb fip BOOT_MODE=nor 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 NOR flash Boot   LS1043ARDB  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: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from  NOR bank  0:  => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 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   LS1043ARDB Ethernet and FMC port mapping   for the mapping of Ethernet port names appearing on the chassis front panel w ith 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 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_nor.pbl  in NOR bank 4. => tftp 82000000 bl2_nor.pbl => erase 64000000 +$filesize;cp.b 82000000 64000000 $filesize Flash fip.bin  in NOR bank 4. => tftp 82000000 fip.bin =>  erase 64100000 +$filesize;cp.b 82000000 64100000 $filesize Boot from NOR  bank 4 :   => cpld  reset altbank LS1043ARDB will boot with TF-A. In the boot log, you will see: NOTICE: 2 GB DDR4, 32-bit, CL=11, ECC off NOTICE: BL2: v1.5(release):LSDK-19.03 NOTICE: BL2: Built : 14:43:06, Jun 12 2019 NOTICE: BL31: v1.5(release):LSDK-19.03 NOTICE: BL31: Built : 14:44:16, Jun 12 2019 NOTICE: Welcome to LS1043 BL31 Phase U-Boot 2018.09 (May 23 2019 - 14:35:16 +0530) SoC: LS1043AE Rev1.1 (0x87920011) Clock Configuration: CPU0(A53):1600 MHz CPU1(A53):1600 MHz CPU2(A53):1600 MHz CPU3(A53):1600 MHz Bus: 400 MHz DDR: 1600 MT/s FMAN: 500 MHz Reset Configuration Word (RCW): 00000000: 08100010 0a000000 00000000 00000000 00000010: 14550002 80004012 e0025000 c1002000 00000020: 00000000 00000000 00000000 00038800 00000030: 00000000 00001101 00000096 00000001 Model: LS1043A RDB Board Board: LS1043ARDB, boot from vBank 4 .......
View full article
This how-to topic is applicable only to LSDK 18.09 and older releases. For LSDK 18.12 and newer releases, refer Deploying TF-A binaries in Layerscape Software Development Kit <version> Documentation. Follow these steps to update U-Boot binary on the SD card.  Prerequisites  Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.06 or LSDK 18.09 U-Boot binary .   Compiling U-Boot binary Clone the  u-boot   repository. $ 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.09  LSDK-18.09   $  export  ARCH=arm64 $  export CROSS_COMPILE= aarch64-linux-gnu- $  make  distclean $ make ls1046ardb_sdcard_defconfig If required, make changes to the U-Boot files. $ 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 LSDK 18.06 or LSDK 18.09 U-Boot binary.         The compiled U-Boot image, u-boot-with-spl-pbl.bin , is available at   u-boot / . You need to use  u-boot-with-spl-pbl.bin because f or SD boot, ls104x devices use different way for bootloader from ls1088/ls2088/lx2160 devices. SD card start block number for U-Boot binary Image  SD card start block number U-Boot PBL binary 0x00008 = 8 Refer the Flash layout for boot flow with PPA – LSDK 18.09 and older releases for a complete listing of the SD card start block numbers for all LSDK firmware images. Programming U-Boot binary to SD card Plug the SD card into the Linux host . Run the following command on the Linux host: $ sudo dd if=u-boot-with-spl-pbl.bin of=/dev/sdX bs=512 seek=8 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0.              Remove the SD card from the Linux host machine. Plug the SD card into LS1046ARDB and boot the board to Ubuntu using the SD card. You can boot the board using the SD card either by: setting the switches: SW3[1:8] =   01001110   and   SW5 [1:8] = 00100000 , or boot switching to SD card:   => cpld reset sd In boot log, you’ll see: Board: LS1046ARDB, boot from SD If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_ tiny.itb  stored on the SD card.
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images in QSPI NOR flash. In LS2088ARDB, Boot option switching between parallel NOR boot and QSPI NOR boot cannot be performed using commands. Boot option switching can be done by adjusting DIP switch settings and jumper settings on the Reference Design Board. For details, see  Layerscape Software Development Kit User Guide . 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 QSPI NOR flash Boot   LS2088ARDB  from QSPI. Ensure that the switches and jumpers are set to boot the board from QSPI.  For booting from   QSPI: SW5[1:8] = 1111 1111 SW3[1:8] = 0011 0001 SW4[1:8] = 0011 1111 SW6[1:8] = 1111 1111 SW7[1:8] = 0100 1010 SW9[1:8] = 0100 0100 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).  J8 = 1-2 for QSPI boot, via onboard QSPI flash J8 = 2-3 for QSPI boot, via QSPI emulator J14 = 2-3, for QSPI boot For LS2088ARDB, in boot log, you'll see: Board: LS2088AE Rev1.1-RDB, Board Arch: V0, Board version: A, boot from vBank: 0 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 mappingfor 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  QSPI NOR flash : => sf probe 0:0 => tftp  0x a 0000000 mc_10.18.0_ls2088a.itb =>  print filesize =>  sf erase 0x00A00000 +$filesize && sf write 0x a 0000000   0x00A00000 $filesize Address 0x00A00000   is the location of MC firmware in QSPI NOR flash.  Refer Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Flash DPL image to  QSPI NOR flash : => sf probe 0:0 =>   tftp 0x a 0000000   dpl-eth.0x2A_0x41.dtb =>   print filesize  => sf erase 0x00D00000  +$filesize && sf write 0x a 0000000 0x00D00000 $filesize Address 0x00D00000   is the location of DPL image in alternate NOR bank.  Refer   Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Flash DPC image to  QSPI NOR flash : => sf probe 0:0 => tftp 0x a 0000000   dpc.0x2A_0x41.dtb => print filesize   =>  sf erase  0x00E00000  +$filesize && sf write 0x a 0000000 0x00E00000 $filesize Address 0x00E00000   is the location of DPC image in alternate NOR bank.  Refer   Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Reset from QSPI NOR flash:  => reset 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 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 QSPI NOR flash 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 flash. For steps to update composite firmware image in QSPI NOR flash, 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_addrmc_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_addrmc_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_addrmc_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: Program QSPI NOR flash: => sf probe 0:0 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 QSPI NOR flash: => sf erase   0x00A00000   +$filesize && sf write   0x80000000   0x00A00000   $filesize Address 0x00A00000   is the location of MC firmware in QSPI NOR flash.  Refer   Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Program QSPI NOR flash: => sf probe 0:0 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 QSPI NOR flash:   =>  sf erase  0x00D00000  +$filesize && sf write 0x80000000 0x00D00000 $filesize Address 0x00D00000   is the location of DPL image in QSPI NOR flash.  Refer   Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Flash DPL image: Flash DPC image: Program QSPI NOR flash: => sf probe 0:0 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 QSPI NOR flash:  =>  sf erase  0x00E00000  +$filesize && sf write 0x80000000 0x00E00000 $filesize Address 0x00E00000   is the location of DPC image in QSPI NOR flash.  Refer   Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Reset and boot from QSPI NOR flash:  => reset 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 DPAA1 FMan ucode image in QSPI NOR flash.  cpld reset boots the board from QSPI NOR flash0 and cpld reset altbank  boots the board from the 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 DPAA1 FMan ucode image Clone the  qoriq-fm-ucode   repository. $  git clone https://github.com/NXP/qoriq-fm-ucode.git $   cd qoriq-fm-ucode $   git checkout  LSDK-<LSDK version> .  For example,  $  git checkout  LSDK-18.12 The prebuilt FMan ucode images,  fsl_fman_ucode_ls1046_r1.0_<microcode version>.bin , are at  qoriq-fm-ucode/.   In the binary file,   ls1046_r1.0   refers to the LS1046A silicon revision 1.0. See   qoriq-fm-ucode/readme   for a description of the ucode version numbers. Programming FMan ucode image to QSPI NOR flash FMan ucode 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 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. See 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 FMan ucode image from the TFTP server Program QSPI NOR flash1:  =>  sf probe 0:1 Flash the  FMan ucode image : => tftp 0x80000000 <path to FMan ucode>/fsl_fman_ucode_ls1046_r1.0_<ucode version>.bin => print filesize filesize=7f5c Program the  FMan ucode image to QSPI NOR flash:  => sf erase 0x900000 +$filesize && sf write 0x80000000 0x900000 $filesize Address  0x900000  is the location of the  FMan ucode   image in QSPI NOR flash.   Refer Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Boot from QSPI NOR flash1 and press Enter to stop the autoboot: => cpld reset altbank In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 4 You can check the following code line in the boot log to confirm that the  DPAA1 FMan ucode image in QSPI NOR flash is updated. Fman1: Uploading microcode version 106.4.18 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.  =>   cpld reset altbank Ubuntu 18.04.1 LTS localhost ttyS0 localhost login: root Password: Last login: Sun Jan 28 16:05:12 UTC 2018 on ttyS0 Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.9.105 aarch64) * Documentation:   https://help.ubuntu.com * Management:   https://landscape.canonical.com * Support:   https://ubuntu.com/advantage 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) 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 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:3 System Volume Information/ 32604 fsl_fman_ucode_ls1046_r1.0_106_4_18.bin 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, see   LS1046ARDB - How to update composite firmware image in QSPI NOR flash. Program QSPI NOR flash1:  => sf probe 0:1 Load FMan ucode  image from the storage device. => load mmc   <device:partition>  8 0000000 <image name> => print filesize For example: => load mmc 0:3 80000000  fsl_fman_ucode_ls1046_r1.0_106_4_18.bin 32604 bytes read in 18 ms (1.7 MiB/s) => print filesize filesize=7f5c Or => load usb   <device:partition>  8 0000000 <image name> => print filesize Or => load scsi   <device:partition>  8 0000000 <image name> => print filesize Program the FMan ucode image to QSPI NOR flash:  =>   sf erase 0x900000 +$filesize && sf write 0x80000000 0x900000 $filesize Address    0x900000  is the location of the  FMan ucode   image   in QSPI NOR flash.   Refer Flash layout for new boot flow with TF-A  for  t he complete flash memory layout. Boot from QSPI NOR flash1 and press Enter to stop the autoboot: =>   cpld reset altbank In boot log, you’ll see: Board: LS1046ARDB, boot from QSPI vBank 4 You can check the following code line in the boot log to confirm that the  DPAA1 FMan ucode image in QSPI NOR flash is updated. Fman1: Uploading microcode version 106.4.18 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.  =>   cpld reset altbank Ubuntu 18.04.1 LTS localhost ttyS0 localhost login: root Password: Last login: Sun Jan 28 16:05:12 UTC 2018 on ttyS0 Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.9.105 aarch64) * Documentation:   https://help.ubuntu.com * Management:   https://landscape.canonical.com * Support:   https://ubuntu.com/advantage 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
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.                       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 NAND boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_nand BL2 binary: Platform initialization binary RCW binary for NAND 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_nand. pbl   and   fip.bin)  on the NAND flash. Compile PBL binary from RCW source file Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries ( bl2_nand. pbl   and   fip.bin ) for NAND boot Program TF-A binaries to the NAND flash Step 1: Compile PBL binary  from RCW source file You need to compile the rcw_1600_nandboot.bin  binary to build the bl2_nand.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-19.03  LSDK-19.03   $ cd ls1043ardb If required, make changes to the rcw files. $ make   The compiled PBL binary for NAND boot on  LS1043ARDB,  rcw_1600_nandboot.bin , is available at rcw/ls1043ardb/RR_FQPP_1455/ .    See the  rcw/ls1043ardb/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-19.03  LSDK-19.03   $   export  ARCH=arm64 $   export CROSS_COMPILE= aarch64-linux-gnu- $   make  distclean $  make ls1043ardb_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 i f 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-19.03  LSDK-19.03 $ export  ARCH=arm $   export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-ls1043ardb $ 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 NAND boot Clone the atf repository and compile the TF-A binaries,  bl2_nand. 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-19.03  LSDK-19.03 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=ls1043ardb bl2 SPD=opteed BOOT_MODE=nand BL32= <path_to_optee_binary>/ tee.bin pbl RCW= <path_to_rcw_binary> /rcw_1600_nandboot.bin The compiled BL2 images,  bl2.bin and bl2_nand.pbl are available at atf/build/ls1043ardb/release/ . For any update in the BL2 source code or RCW binary, the  bl2_nand.pbl  binary needs to be recompiled. To compile the BL2 binary without OPTEE: $  make PLAT=ls1043ardb bl2  BOOT_MODE=nand pbl RCW= <path_to_rcw_binary>/ rcw_1600_nandboot.bin                  Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=ls1043ardb 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/ls1043ardb/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=ls1043ardb fip BOOT_MODE=nand 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 NAND flash Boot   LS1043ARDB  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: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from  NOR bank  0:  => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 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   LS1043ARDB Ethernet and FMC port mapping   for the mapping of Ethernet port names appearing on the chassis front panel w ith 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 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_nand.pbl : => tftp 82000000 bl2_nand.pbl => nand erase 0x0 $filesize;nand write 0x82000000 0x0 $filesize ; Flash fip.bin : => tftp 82000000 fip.bin =>  nand erase 0x100000 $filesize ;nand write 0x82000000 0x100000 $filesize ; Boot from  NAND flash :   => cpld  reset nand LS1043ARDB will boot with TF-A. In the boot log, you will see: Fixed DDR on board NOTICE: 2 GB DDR4, 32-bit, CL=11, ECC off NOTICE: BL2: v1.5(release):LSDK-19.03 NOTICE: BL2: Built : 14:46:39, Jun 13 2019 NOTICE: BL31: v1.5(release):LSDK-19.03 NOTICE: BL31: Built : 14:52:37, Jun 13 2019 NOTICE: Welcome to LS1043 BL31 Phase U-Boot 2018.09 (Jun 13 2019 - 12:27:15 +0530) SoC: LS1043AE Rev1.1 (0x87920011) Clock Configuration: CPU0(A53):1600 MHz CPU1(A53):1600 MHz CPU2(A53):1600 MHz CPU3(A53):1600 MHz Bus: 400 MHz DDR: 1600 MT/s FMAN: 500 MHz Reset Configuration Word (RCW): 00000000: 08100010 0a000000 00000000 00000000 00000010: 14550002 80004012 e0106000 c1002000 00000020: 00000000 00000000 00000000 00038800 00000030: 00000000 00001100 00000096 00000001 Model: LS1043A RDB Board Board: LS1043ARDB, boot from NAND
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images on the SD card.    Compiling  MC firmware Clone the qoriq-mc-binary   repository. $  git clone https://github.com/NXP/qoriq-mc-binary.git $   cd qoriq-mc-binary/ls1088a/ $ git checkout LSDK-<LSDK version> . For example,  $ git checkout  LSDK-18.09 The prebuilt MC firmware image,   mc_10.10.0_ls1088a_20180814.itb , is available at  qoriq-mc-binary/ls1088a/ . Note that the exact name of the MC firmware image may vary depending on the release version used.                  Compiling 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 LSDK-<LSDK version> . For example,  $ git checkout LSDK-18.09 If required, make changes to the DPC and DPL files. $  make -C config/ The compiled   dpc.0x1D-0x0D.dtb and  dpl-eth.0x1D_0x0D.dtb  images are  available at  /mc-utils/config/ls1088a/RDB/ . Note that the exact name of the DPL and DPC images may vary depending on the release version used.             SD card start block number for MC, DPL, and DPC images Image  SD card start block number DPAA2 MC firmware 0x05000 = 20480 DPAA2 DPL  0x06800 = 26624 DPAA2 DPC 0x07000 = 28672 Refer th e   Layerscape Software Development Kit <version> Documentation  for  complete listing of the SD card start block numbers for all LSDK firmware images.     Programming MC, DPC, and DPL images to SD card Plug the SD card into the Linux host . Run the following commands on the Linux host: To update MC firmware: $  sudo dd if=mc_10.10.0_ls1088a_20180814.itb of=/dev/ sdX  bs=512 seek=20480 conv=fsync To update DPL image: $  sudo dd if= dpl-eth.0x1D_0x0D.dtb of=/dev/ sdX  bs=512 seek=26624 conv=fsync To update DPC image: $  sudo dd if= dpc.0x1D-0x0D.dtb of=/dev/ sdX  bs=512 seek=28672 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX , where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically  mmcblk0.    Remove the SD card from the Linux host machine. On the LS1088ARDB/LS1088ARDB-PB, ensure that the switches are set to boot the board from the SD card.  For booting from SD card, SW1[1:8] + SW2[1] = 0010_0000_0   Plug the SD card into the board and boot the board to Ubuntu. If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_ tiny.itb  stored on the SD card.
View full article
Follow these steps to update the Linux kernel image and device tree on the SD card.  Compiling Linux kernel images and device tree On Linux host, clone the repository with Linux kernel image and device tree: $  git clone  https://source.codeaurora.org/external/qoriq/qoriq-components/linux $ cd linux $ git checkout -b <new branch> <start point> For example, $  git checkout -b LSDK-19.06-V4.14 LSDK-19.06-V4.14 where LSDK-19.06-V4.14 refers to a tag in the format  LSDK-<LSDK version>-V<kernel version> $   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig lsdk.config If you want to make changes to the device tree, open and edit arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts $   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- The binary kernel image Image  and compressed kernel image Image.gz  are in arch/arm64/boot/ . The device tree blob fsl-ls1043a-rdb.dtb  is in arch/arm64/boot/dts/freescale/ . Copying the compiled kernel images and device tree to the SD card Plug the SD card into the Linux host machine. Mount the SD card partition that contains Linux kernel images and device tree. sudo mkdir <mount_location> sudo mount /dev/sdX <mount_location> Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0. Replace Image , Image.gz , and  fsl-ls1043a-rdb.dtb  on the SD card with the new files compiled in the steps above. sudo cp /linux/arch/arm64/boot/Image /linux/arch/arm64/boot/Image.gz /linux/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dtb <mount_location> sudo umount /dev/sdX Plug the SD card into LS1043ARDB  and boot the board to Ubuntu using the SD card.  If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_tiny.itb   stored on the SD card. You can confirm that Linux kernel and device tree is updated on the SD card by running this command and checking the timestamp. root@localhost:~# uname -a Linux localhost 4.14.104 #2 SMP PREEMPT Wed Aug 21 17:14:01 IST 2019 aarch64 aarch64 aarch64 GNU/Linux
View full article
Please note that the LSDK memory layout for TF-A boot flow explained in this topic is only applicable for  LSDK 18.12 and newer releases.  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. When the board boots from NOR flash, the NOR bank from which the board boots is considered as the "current bank" and the other bank is considered as the "alternate bank". For example, if LS1043ARDB boots from NOR bank 4, to update an image on NOR bank 0, you need to use the "alternate bank" address range,0x64000000 - 0x64F00000. Firmware Definition MaxSize Flash Offset (QSPI/NAND flash) Absolute address  (NOR bank 0 on LS1043ARDB, LS1021ATWR) Absolute address  ( NOR bank 4 LS1043ARDB, LS1021ATWR) Absolute address (NOR bank 0   on   LS2088ARDB ) Absolute address ( NOR bank 4  on  LS2088ARDB) SD Start Block No. RCW + PBI + BL2 (bl2.pbl) 1 MiB 0x00000000 0x60000000 0x64000000 0x580000000 0x584000000 0x00008 ATF FIP Image (fip.bin) BL31 + BL32 + BL33 4 MiB 0x00100000 0x60100000 0x64100000 0x580100000 0x584100000 0x00800 Boot firmware environment 1 MiB 0x00500000 0x60500000 0x64500000 0x580500000 0x584500000 0x02800 Secure boot headers 2 MiB 0x00600000 0x60600000 0x64600000 0x580600000 0x584600000 0x03000 Secure header or DDR PHY FW 512 KiB 0x00800000 0x60800000 0x64800000 0x580800000 0x584800000 0x04000 Fuse provisioning header 512 KiB 0x00880000 0x60880000 0x64880000 0x580880000 0x584880000 0x04400 DPAA1 FMAN ucode 256 KiB 0x00900000 0x60900000 0x64900000 0x580900000 0x584900000 0x04800 QE/uQE firmware 256 KiB 0x00940000 0x60940000 0x64940000 0x580940000 0x584940000 0x04A00 Ethernet PHY firmware 256 KiB 0x00980000 0x60980000 0x64980000 0x580980000 0x584980000 0x04C00 Script for flashing image 256 KiB 0x009C0000 0x609C0000 0x649C0000 0x5809C0000 0x5849C0000 0x04E00 DPAA2-MC or PFE firmware 3 MiB 0x00A00000 0x60A00000 0x64A00000 0x580A00000 0x584A00000 0x05000 DPAA2 DPL 1 MiB 0x00D00000 0x60D00000 0x64D00000 0x580D00000 0x584D00000 0x06800 DPAA2 DPC 1 MiB 0x00E00000 0x60E00000 0x64E00000 0x580E00000 0x584E00000 0x07000 Device tree(needed by uefi) 1 MiB 0x00F00000 0x60F00000 0x64F00000 0x580F00000 0x584F00000 0x07800 Kernel lsdk_linux.itb 16 MiB 0x01000000 NA NA NA NA 0x08000 Ramdisk rfs 32 MiB 0x02000000 NA NA NA NA 0x10000 The following figures highlight the changes in the flash layout for previous boot flow (with PPA) and flash layout for TF-A boot flow. Flash layout for previous 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 QSPI NOR flash boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_qspi.pbl BL2 binary: Platform initialization binary RCW binary for QSPI NOR flash 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_qspi. pbl   and   fip.bin)  in QSPI NOR flash. Compile PBL binary from RCW source file Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries   ( bl2_qspi. pbl  and  fip.bin)  for QSPI NOR flash Program TF-A binaries to QSPI NOR flash Step 1: Compile PBL binary  from RCW source file   You need to compile the  rcw_1600_qspi.bin  binary to build the   bl2_qspi.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 QSPI NOR flash on  LS1088ARDB-PB, rcw_1600_qspi.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 LSDK 18.12 U-Boot binary.  The compiled U-Boot image,  u-boot .bin , is available at   u-boot / . Step 3: [Optional]  Compile OP-TEE 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 i f 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 QSPI NOR flash Clone the  atf  repository and compile the TF-A binaries,  bl2_qspi. 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=qspi pbl RCW= <path_to_rcw_binary>/ rcw_1600_qspi.bin The compiled BL2 binaries,  bl2.bin and bl2_qspi.pbl are available at atf/build/ls1088ardb/release/ . For any update in the BL2 source code or RCW binary, the  bl2_qspi.pbl  binary needs to be recompiled. To compile the BL2 binary without OPTEE: make PLAT=ls1088ardb bl2 BOOT_MODE=qspi pbl RCW=<path_to_rcw_binary>/rcw_1600_qspi.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 QSPI NOR flash 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 w ith 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 . Program QSPI NOR flash1:  => sf probe 0:1 Flash bl2_qspi.pbl : =>  tftp  0x a 0000000 bl2_qspi.pbl =>  sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize   Flash fip.bin : => tftp 0xa0000000 fip.bin =>  sf erase 0x1 00000 +$ fil esize  && sf write 0xa0000000 0x1 00000 $ filesize Boot from  QSPI NOR flash1 :   => qixis_reset altbank 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 : 16:23:18, Feb 8 2019 NOTICE: BL31: v1.5(release):LSDK-18.12 NOTICE: BL31: Built : 16:25:08, Feb 8 2019 NOTICE: Welcome to LS1088 BL31 Phase For steps to deploy TF-A binaries on SD card, see LS1088ARDB-PB - How to deploy TF-A binaries on SD card
View full article
Follow these steps to update DPAA2 MC firmware and DPC images in QSPI flash, if you are booting LS1088ARDB from the QSPI flash memory.  qixis_reset  boots the board from QSPI flash0 (aka bank0) and qixis_reset altbank  boots the board from QSPI flash1 (aka bank4). “sf probe 0:1” means that the alternate bank will be written to. So if you boot from flash0, then enter sf probe 0:1, the commands that follow will program flash1. Prerequisites Linux machine. It is recommended to install Ubuntu 18.04 on the Linux machine. Obtaining  MC firmware Download the prebuilt  MC firmware image from the git repository: https://github.com/NXP/qoriq-mc-binary/tree/integration/ls1088a Obtaining DPC image Clone  mc-utils repository and compile the DPC image. git clone https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils cd mc-utils/ git checkout LSDK-18.09 make -C config/ The compiled dpc.0x1D-0x0D.dtb is available at  /mc-utils/config/ls1088a/RDB/ . Flash MC firmware image on LS1088ARDB QSPI flash In U-Boot, boot from flash0, program flash1:  
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.                                                        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 NOR boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_nor.pbl BL2 binary: Platform initialization binary RCW binary for NOR 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_nor. pbl   and   fip.bin)  on the NOR flash. Compile RCW binary Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries ( bl2_nor. pbl   and   fip.bin)  for NOR boot Program TF-A binaries to the NOR flash Step 1: Compile RCW binary   You need to compile the rcw_1800.bin  binary to build the bl2_nor.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-19.09  LSDK-19.09   $ cd ls2088ardb If required, make changes to the rcw files. $ make The compiled PBL binary for NOR boot on  LS2088ARDB,  rcw_1800.bin , is available at rcw /ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41 See the  rcw/ls2088ardb/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 $  g it checkout  -b <new branch name>  LSDK-<LSDK version> .   For example,   $  g it checkout  -b LSDK-19.09  LSDK-19.09 $   export  ARCH=arm64 $ export CROSS_COMPILE= aarch64-linux-gnu- $ make  distclean $  make ls2088ardb_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 and onwards 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 i f 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-19.09  LSDK-19.09 $ export  ARCH=arm $   export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-ls2088ardb $ 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 NOR boot Clone the atf repository and compile the TF-A binaries,  bl2_nor. 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-19.09  LSDK-19.09 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=ls2088ardb bl2 SPD=opteed BOOT_MODE=nor BL32= <path_to_optee_binary>/ tee.bin pbl RCW= <path_to_rcw_binary> /rcw_1800.bin The compiled BL2 images,  bl2.bin and bl2_nor.pbl are available at atf/build/ls2088ardb/release/ . For any update in the BL2 source code or RCW binary, the  bl2_nor.pbl  binary needs to be recompiled. To compile the BL2 binary without OPTEE: $  make PLAT=ls2088ardb bl2  BOOT_MODE=nor pbl RCW= <path_to_rcw_binary>/ rcw_1800.bin                      Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=ls2088ardb 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/ls2088ardb/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=ls2088ardb fip BOOT_MODE=nor 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 NOR flash Boot   LS2088ARDB  from NOR flash. Ensure that the switches and jumpers are set to boot the board from NOR bank 0.  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 TF-A binaries can be loaded to 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 w ith 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 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_nor.pbl  to NOR bank 4 (after booting from NOR bank 0). => tftp 82000000 bl2_nor.pbl => erase 0x584000000 +$filesize;cp.b 82000000 0x584000000 $filesize Flash fip.bin  to NOR bank 4  ( after booting   from NOR bank 0). => tftp 82000000 fip.bin => erase 0x584100000 +$filesize;cp.b 82000000 0x584100000 $filesize Boot from NOR  bank 4 :   => qixis_ reset altbank LS2088ARDB will boot with TF-A. In the boot log, you will see: NOTICE: UDIMM 18ASF1G72AZ-2G3B1 NOTICE: 16 GB DDR4, 64-bit, CL=13, ECC on, 256B, CS0+CS1 NOTICE: UDIMM 18ASF1G72AZ-2G3B1 NOTICE: 4 GB DDR4, 32-bit, CL=11, ECC on, CS0+CS1 NOTICE: BL2: v1.5(release):LSDK-19.09 NOTICE: BL2: Built : 16:04:08, Nov 4 2019 NOTICE: BL31: v1.5(release):LSDK-19.09 NOTICE: BL31: Built : 16:40:39, Nov 4 2019 NOTICE: Welcome to LS2088 BL31 Phase U-Boot 2019.04 (Nov 04 2019 - 15:57:49 +0530) SoC: LS2088AE Rev1.1 (0x87090011) Clock Configuration: CPU0(A72):1800 MHz CPU1(A72):1800 MHz CPU2(A72):1800 MHz CPU3(A72):1800 MHz CPU4(A72):1800 MHz CPU5(A72):1800 MHz CPU6(A72):1800 MHz CPU7(A72):1800 MHz Bus: 700 MHz DDR: 1866.667 MT/s DP-DDR: 1600 MT/s Reset Configuration Word (RCW): 00000000: 483038b8 48480048 00000000 00000000 00000010: 00000000 00000000 00a00000 00000000 00000020: 01e01180 00002581 00000000 00000000 00000030: 00400c0b 00000000 00000000 00000000 00000040: 00000000 00000000 00000000 00000000 00000050: 00000000 00000000 00000000 00000000 00000060: 00000000 00000000 00027000 00000000 00000070: 412a0000 00040000 Model: Freescale Layerscape 2080a RDB Board Board: LS2088AE Rev1.1-RDB, Board Arch: V1, Board version: F, boot from vBank: 4 ....... 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 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 bl2_nor.pbl 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 bl2_nor.pbl 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 bl2_nor.pbl 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.    Load bl2_nor.pbl image from the storage device => load mmc 0:2 0xa0000000 <image name> => print filesize For example: => load mmc 0:2 0xa0000000 bl2_nor.pbl => print filesize filesize=14379 Or => load usb 0:2 0xa0000000 <image name> => print filesize Or => load scsi 0:2 0xa0000000 <image name> => print filesize Program bl2_nor.pbl to NOR bank 4 ( after booting   from NOR bank 0) :  =>  erase  0x584000000  +$filesize;cp.b 0xa0000000 0x584000000  $filesize Load   fip. bin   image from the storage device => load mmc 0:2 0xa0000000 <image name> => print filesize For example: => load mmc 0:2 0xa0000000 fip.bin => print filesize filesize=131510 Or => load usb 0:2 0xa0000000 <image name> => print filesize Or => load scsi 0:2 0xa0000000 <image name> => print filesize Program fip.bin  to NOR   bank 4 ( after booting   from NOR bank 0) :  => erase 0x584100000 +$filesize;cp.b 0xa0000000 0x584100000 $filesize Boot from NOR bank 4:  => qixis_ reset altbank LS2088ARDB will boot with TF-A.
View full article
Follow these steps to update the Linux kernel image and device tree on the SD card.  Compiling Linux kernel images and device tree On the Linux host, clone the repository with Linux kernel image and device tree: $  git clone  https://source.codeaurora.org/external/qoriq/qoriq-components/linux $ cd linux $ git checkout -b <new branch> <start point> For example, $ git checkout -b LSDK-18.09-V4.14 LSDK-18.09-V4.14 where  LSDK-18.09-V4.14  refers to a tag in the format  LSDK-<LSDK version>-V<kernel version> $   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig lsdk.config If you want to make changes to device tree, open and edit arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts $   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- The binary kernel image Image  and compressed kernel image Image.gz  are in arch/arm64/boot/ . The device tree blob fsl-ls1046a-rdb.dtb  is in arch/arm64/boot/dts/freescale/ . Copying the compiled kernel images and device tree to SD card Plug the SD card into the Linux host machine. List the disks that are accessible to the computer:  $ cat /proc/partitions Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen.  The SDHC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced.  If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0. Mount the SD card partition that contains Linux kernel images and device tree: $ sudo mount /dev/sdX   <mount_location> Replace   Image ,   Im age.gz , and  fsl-ls1046a-rdb.dtb  on the SD card with the new files compiled in the steps above. sudo cp linux/arch/arm64/boot/Image linux/arch/arm64/boot/Image.gz linux/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dtb <mount_location> sudo umount /dev/sdX Plug the SD card into   LS1046ARDB   and boot the board to Ubuntu using the SD card:  => cpld reset sd In boot log, you’ll see: Board: LS1046ARDB, boot from SD If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_ tiny.itb   stored on the SD card.
View full article
This how-to topic is applicable only to LSDK 18.09 and older releases. For LSDK 18.12 and newer releases, refer LS1088ARDB-PB - How to deploy TF-A binaries on SD card. Follow these steps to update U-Boot binary on the SD card.  Prerequisites  Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.06 or LSDK 18.09 U-Boot binary .   Compiling U-Boot binary Clone the  u-boot   repository. $  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.09  LSDK-18.09   $ export  ARCH=arm64 $ export CROSS_COMPILE= aarch64-linux-gnu- $ make  distclean Execute appropriate defconfig file: For LS1088ARDB: $ make ls1088ardb_sdcard_qspi_defconfig For LS1088ARDB-PB: $ make ls1088ardb_pb_sdcard_qspi_defconfig If required, make changes to the U-Boot files. $ 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 LSDK 18.06 or LSDK 18.09 U-Boot binary.  The compiled U-Boot image,  u-boot-with-spl .bin , is available at   u-boot / . SD card start block number for U-Boot binary Image  SD card start block number U-Boot binary 0x00800 = 2048 Refer th e Flash layout for boot flow with PPA – LSDK 18.09 and older releases for a  complete listing of the SD card start block numbers for all LSDK firmware images.      Programming U-Boot binary to SD card Plug the SD card into the Linux host . Run the following command on the Linux host: $ sudo dd if=u-boot-with-spl.bin of=/dev/sdX bs=512 seek=2048 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0.    Remove the SD card from the Linux host machine. On the LS1088ARDB/LS1088ARDB-PB, ensure that the switches are set to boot the board from SD card.  For booting from SD card, SW1[1:8] + SW2[1] = 0010_0000_0   Plug the SD card into the board and boot the board to Ubuntu. If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_ tiny.itb  stored on the SD card.
View full article
Follow these steps to update the DPAA1 FMan ucode image on the SD card.  Obtaining DPAA1 FMan ucode image Clone the  qoriq-fm-ucode   repository. $  git clone https://github.com/NXP/qoriq-fm-ucode.git $   cd qoriq-fm-ucode $   git checkout  LSDK-<LSDK version> .  For example,  $  git checkout LSDK-19.06 The prebuilt FMan ucode images, fsl_fman_ucode_ls1043_r1.1 _<microcode version>.bin , are at  qoriq-fm-ucode/. In the binary file, ls1043_r1.1  refers to the LS1043A silicon revision 1.1. See qoriq-fm-ucode/readme for a description of the ucode version numbers. SD card start block number for DPAA1 FMan ucode image Image  SD card start block number DPAA1 FMan ucode image 0x04800 = 18432 Refer Flash layout for new boot flow with TF-A for  complete listing of the SD card start block numbers for all LSDK firmware images. Programming DPAA1 FMan ucode image to SD card Option 1: Load image on SD card plugged into Linux host via dd command Plug the SD card into the Linux host . Run the following command on the Linux host: $ sudo dd if= fsl_fman_ucode_ls1043_r1.1_<ucode version>.bin  of=/dev/sdX bs=512 seek=18432 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0.                                                   Remove the SD card from the Linux host machine. Plug the SD card into LS1043ARDB and boot the board to Ubuntu using the SD card. You can boot the board using the SD card either by: setting the switches:  SW3[1:8] = 10110011 , SW4 [1:8] =00100000 ,  SW5 [1:8] = 00100010 , or boot switching to SD card  => cpld reset sd In boot log, you’ll see: Board: LS1043ARDB, boot from SD You can check the following code line in the boot log to confirm that the  DPAA1 FMan ucode image on the SD card is updated. Fman1: Uploading microcode version 106.4.18 If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from  lsdk_linux_arm64_tiny.itb  stored on the SD card. Option 2: Load image on SD card plugged into board from the TFTP server Boot   LS1043ARDB  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: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from  NOR bank  0:  => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 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   LS1043ARDB Ethernet and FMC port mapping   for the mapping of Ethernet port names appearing on the chassis front panel w ith 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 FMan ucode image from the TFTP server Flash the  FMan ucode image :  => tftp 0xa0000000 fsl_fman_ucode_ls1043_r1.1_<ucode version>.bin Program the  FMan ucode   image to SD card:  =>  mmc write 0xa0000000 0x04800 <blk_cnt> Address  0x04800   is the SD card block number for the  FMan ucode   image.    ReferFlash layout for new boot flow with TF-A  for  t he complete flash memory layout. 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   FMan ucode  from the TFTP server, if the bytes transferred is 37560 (92b8 hex), then  blk_cnt   is calculated as "37560 /512 = 73 (49 hex)" + "few sectors for rounding up so that last block is not missed" .   So, if you round up by 5 (5 hex) sectors, for this example, mmc write command will be:  =>  mmc write 0xa0000000 0x04800 4E You can boot the board using the SD card either by: setting the switches:  SW3[1:8] = 10110011 ,   SW4 [1:8] =00100000   ,  SW5 [1:8] = 00100010 , or boot switching to SD card  => cpld reset sd In boot log, you’ll see: Board: LS1043ARDB, boot from SD You can check the following code line in the boot log to confirm that the  DPAA1 FMan ucode image on the SD card is updated. Fman1: Uploading microcode version 106.4.18 If U-Boot does not find LSDK on the SD card, it will boot   TinyDistro from  lsdk_linux_arm64_tiny.itb  stored on the SD card.
View full article
Follow these steps to update the  composite firmware image 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. Obtaining composite firmware image   LSDK includes pre-built firmware images for QSPI NOR flash. The LSDK composite firmware includes RCW+PBI, U-Boot/UEFI, PPA, boot loader environment variables, DPAA1 FMan ucode, QE/uQE firmware, Ethernet PHY firmware, device tree, and lsdk_linux_<arch>.itb images. Refer Flash layout for new boot flow with TF-A  for  t he complete flash memory layout of the images.   On a Linux host machine, download composite firmware image for QSPI boot from nxp.com.     $ wget  http://www.nxp.com/lgfiles/sdk/lsdk <LSDK version> /firmware_ <RDB_name>_uboot_qspiboot.img     For example:   $ wget http://www.nxp.com/lgfiles/sdk/lsdk1812/firmware_ls1046ardb_uboot_qspiboot.img   Flashing composite firmware   images   to   QSPI NOR flash Composite   firmware   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 LS1046RDB from QSPI NOR flash. Ensure that the switches are set to boot the board from QSPI NOR flash.  For booting from   QSPI flash ,  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 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 composite firmware image from the TFTP server Program QSPI NOR flash1:  => sf probe 0:1 Flash composite firmware image: => tftp a0000000 firmware_ls1046ardb_uboot_qspiboot.img =>  print  filesize filesize=2351db0 Program composite firmware image to QSPI NOR flash:   =>  sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize   Address 0x0  is the location of the  composite firmware  image in QSPI NOR flash.   Refer Flash layout for new boot flow with TF-A  for  t he 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. Option 2: Load image from partition on mass storage device (SD, USB, or SATA) Boot LS1046RDB from QSPI NOR flash. Ensure that the switches are set to boot the board from QSPI NOR flash.  For booting from   QSPI flash ,  SW5[1:8] = 00100010 Boot from  QSPI NOR  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 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: => load mmc 0:2 a0000000 firmware_ls1046ardb_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 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. Program image to QSPI NOR flash:  =>   sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize Address    0x0  is the location of the composite firmware image in QSPI NOR flash.   Refer Flash layout for new boot flow with TF-A  for  t he 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