Layerscape Knowledge Base

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

Layerscape Knowledge Base

Discussions

Sort by:
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-342787 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-342651 
View full article
  The below steps are used to update composite firmware image in FlexSPI NOR flash and SD/eMMC card using an SD card. Load composite firmware image on SD card Option 1: Using HxD editor on Windows system Option 2: Using Linux system Program updated composite firmware in SD card Program updated composite firmware in FlexSPI NOR flash (DEV#0 and DEV#1) Program updated composite firmware in eMMC card NOTE: Examples shown below use the LX2160ARDB Rev 2 image names. The same examples are applicable for LX2160ARDB Rev 1 also by replacing the Rev 2 image name with the corresponding Rev 1 image name. Step 1: Load composite firmware image in SD card Option 1: Using HxD editor on Windows system The below steps describe how to use an HxD editor on a Windows machine to program firmware image on SD card without partitioning the card. NOTE: Use the following link to download the HxD editor for Windows: https://mh-nexus.de/en/hxd/. Download composite firmware image on Windows machine using the following links: For LX2160ARDB Rev1: For SD boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_sdboot.img For FlexSPI boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_xspiboot.img For eMMC boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_emmcboot.img For LX2160ARDB Rev 2: For SD boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_sdboot.img For FlexSPI boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_xspiboot.img For eMMC boot: https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_emmcboot.img Format SD card. Open HxD editor and run as administrator. Open firmware_lx2160ardb_rev2_uboot_sdboot.img binary file in HxD editor. Copy the binary file (CTRL + A and CTRL + C). Plug the SD card either directly into the slot available on your Windows machine or using a memory card adapter/reader. Open disk (SHIFT + CTRL +D). Open disk NOTE: Uncheck the 'Open as Readonly' option while opening the disk. Go to SD block (or sector) 8 (0x1000). HxD Editor - Sector 8 Paste the copied binary image content (CTRL + B). Make sure to copy the image at SD block no. 8. Save the content. Repeat above steps to load firmware_lx2160ardb_rev2_uboot_xspiboot.img and firmware_lx2160ardb_rev2_uboot_emmcboot.img binary image in SD card. For example: Load firmware_lx2160ardb_rev2_uboot_xspiboot.img image in SD card at block no. 150500 and firmware_lx2160ardb_rev2_uboot_emmcboot.img image in SD card at block no. 300500. NOTE: Make sure that you load these images in SD blocks so that the images do not get overwrite. Eject the SD card. Option 2: Using Linux system Download composite firmware image on Linux machine using the following links: For LX2160ARDB Rev1: For SD boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_sdboot.img For FlexSPI boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_xspiboot.img For eMMC boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_uboot_emmcboot.img For LX2160ARDB Rev 2: For SD boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_sdboot.img For FlexSPI boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_xspiboot.img For eMMC boot: $ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware_lx2160ardb_rev2_uboot_emmcboot.img Format SD card (optional, required if the card already has some data so to ensure that images have been loaded to card without conflicting with the existing data). Load composite firmware image to SD card. For SD boot: dd if=firmware_lx2160ardb_rev2_uboot_sdboot.img of=/dev/sdb bs=512 seek=8 For FlexSPI boot: dd if=firmware_lx2160ardb_rev2_uboot_xspiboot.img of=/dev/sdb bs=512 seek=150500 For eMMC boot: dd if=firmware_lx2160ardb_rev2_uboot_emmcboot.img of=/dev/sdb bs=512 seek=300500 Eject the SD card. Step 2: Program updated composite firmware in SD card NOTE: Since the updated composite firmware is now available at required block (SD start block no. 😎 in SD card, therefore, you can boot the board using SD card using following steps. Insert the SD card in SD slot of LX2160ARDB. Set switch settings to boot from SD card : SW1[1:4] = 1000  Restart the board. The board boots from updated composite firmware (SD boot) image loaded in the SD card. The U-Boot log displays: Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from SD Step 3: Program updated composite firmware in FlexSPI NOR flash (DEV#0 and DEV#1) Insert the SD card in SD slot of LX2160ARDB. Set switch settings to boot from SD card=> SW1[1:4] = 1000 Restart the board and stop at U-Boot prompt. Load firmware_lx2160ardb_rev2_uboot_xspiboot.img at 0xa0000000 (DDR address) using the following command: => mmc read 0xa0000000 <start_block_number> <block_count> where, <start_block_number> - start block number in SD card where you have loaded the firmware. For example, if you have loaded firmware at SD card block 150500, start_block_number in hex is 24be4 <block_count> - number of blocks in SD card that needs to be read as per the file size. It is calculated as ‘file size /512’ + ‘few sectors for rounding up so that last block is not missed’. If firmware file size is 52158124 (31bdeac hex), block_count is 52158124/512 = 101871 (18DEF hex) + 10 (A hex) = 101881 (18DF9 hex). For example: => mmc read 0xa0000000 24be4 18DF9 Program default FlexSPI NOR flash: =>sf probe 0:0 =>sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex> For example: => sf update 0xa0000000 0x0 31BDEAC    Program alternate FlexSPI NOR flash: => sf probe 0:1 => sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex>  Restart the board to boot from FlexSPI NOR flash 0 (DEV#0). Switch settings to boot from DEV#0: SW1[1:8] = 1111 1000 The U-Boot log shows the following message: Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0 Restart the board to boot from FlexSPI NOR flash 1 (DEV#1) as well. Switch settings to boot from DEV#1 SW1[1:4] = 1111 1001  The U-Boot log shows the following message: Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#1 Step 4: Program updated composite firmware in eMMC card Insert the SD card in SD slot of LX2160ARDB. Set switch settings to boot from SD card: SW1[1:4] = 1000 Restart the board and stop at U-Boot prompt. Load firmware_lx2160ardb_rev2_uboot_emmcboot.img at 0xa0000000 (DDR address) using the following command: => mmc dev 0; mmc read 0xa0000000 <start_block_number> <block_count> where, <start_block_number> - start block number in SD card where you have loaded the firmware. For example, if you have loaded firmware at SD card block 300500, start_block_number in hex is 495D4 <block_count> - number of blocks in SD card that needs to be read as per the file size. It is calculated as ‘file size /512’ + ‘few sectors for rounding up so that last block is not missed’. If firmware file size is 52158124 (31bdeac hex), block_count is 52158124/512 = 101871 (18DEF hex) + 10 (A hex) = 101881 (18DF9 hex). For example: => mmc read 0xa000000 495D4 18DF9 Program eMMC card. => mmc dev 1; mmc write 0xa0000000 8 18DF9 Restart the board to boot from eMMC. Set switch settings to boot from eMMC card. SW1[1:8] = 1001 1000 The U-Boot log shows the following message: Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from eMMC
View full article
Follow these steps to update the Linux kernel image and device tree on the eMMC card. NOTE: Below steps are valid for both LX2160ARDB Rev 1.0 and Rev 2.0 revisions. 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-20.04-V5.4 LSDK-20.04-V5.4 where LSDK-20.04-V5.4 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-lx2160a-rdb.dts  You can make changes in the Linux kernel source code also if required. $ 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-lx2160a-rdb.dtb is in arch/arm64/boot/dts/freescale/. Copying the compiled kernel images and device tree to the eMMC card   Step1: Copy the kernel images and device tree from Linux host machine Ensure the eMMC card available on the reference board. Check DIP switch settings for the desired boot type. Power on the board and let the board boot to LSDK distro prompt. In case LSDK image is not deployed on the storage device on the board, execute the following command under U-Boot prompt to boot the board to TinyDistro. For FlexSPI NOR boot: => run xspi_bootcmd For SD/eMMC boot: => run sd_bootcmd Log in to LSDK distro as root/root or TinyDistro as “root”. Bring up a network interface with Linux host. Dynamic IP address assignment: # udhcpc -i <port name in Tiny/LSDKDistro> Static IP address assignment: # ifconfig <port name in Tiny/LSDKDistro> <IP address> netmask <netmask address> up For example: # ifconfig enp1s0 192.168.2.120 netmask 255.255.255.0 up  Copy the Kernel, Kernel.gz images and device tree blob fsl-lx2160a-rdb.dtb from host machine. # mkdir <destination folder> # scp <user>@<ipaddress>:<file path>/<filename> <destination folder> For example: # mkdir /kernelfiles # scp user1@192.168.2.1:/tftpboot/Image.gz /kernelfiles   Step2: Copy the kernel image and device tree to the eMMC card sudo fdisk -l to list the disks that are accessible on board. Mount the eMMC card partition that contains Linux kernel images and device tree. NOTE: Use the command cat /proc/partitions to see the list of devices, their partitions along with their sizes to make sure that the correct device and partition name have been chosen. The eMMC 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 eMMC card directly without an extra eMMC card reader device, the device name of eMMC card is typically mmcblk1. In general, the Linux kernel images and device tree are stored in the second partition of the eMMC device (mmcblk1p2). For detail on storage layout on SD/eMMC/USB/SATA for LSDK images deployment, refer to section "LSDK memory layout and Userland" in Layerscape Software Development Kit User Guide. # sudo mkdir <mount_folder> # sudo mount /dev/sdX <mount_folder>  For example: # sudo mkdir /carddata # sudo mount /dev/mmcblk1p2 /carddata Replace Image, Image.gz, and fsl-lx2160a-rdb.dtb on the eMMC card with the new files copied in <destination folder> in the steps above. # sudo cp <destination folder>/Image <destination folder>/Image.gz <destination folder>/fsl-lx2160a-rdb.dtb <mount_location> For example: # sudo cp /kernelfiles/Image /kernelfiles/Image.gz /kernelfiles/fsl-lx2160a-rdb.dtb /carddata Unmount the card. for example: # sudo umount /dev/mmc1blk1p2 Reboot the board. At U-Boot prompt, run the following command to boot the board to LSDK distro using eMMC card. => run bootcmd_mmc1 If U-Boot does not find LSDK on the eMMC card, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored on the eMMC card.    
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. Note: 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/eMMC boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_sd.pbl/bl2_emmc.pbl BL2 binary: Platform initialization binary RCW binary for SD/emmc 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/bl2_emmc.pbl and fip.bin) on the SD/eMMC card. Compile RCW binary Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries (bl2_sd.pbl/bl2_emmc.pbl and fip.bin) for SD/eMMC boot Program TF-A binaries to the SD/eMMC card Step 1: Compile RCW binary You need to compile the RCW binary to build the bl2_sd.pbl/bl2_emmc.pbl binary. Clone the  rcw repository and compile the RCW 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-20.04 LSDK-20.04 Compile RCW for Rev 1 or Rev 2 board. For LX2160ARDB Rev1: $ cd lx2160ardb For LX2160ARDB Rev2: $ cd lx2160ardb_rev2 If required, make changes to the rcw files. $ make The compiled RCW binary for SD/eMMC boot on LX2160ARDB for core frequency 2000 MHz, platform frequency 700 MHz and DDR memory data rate 2900 MT/s, with serdes1 = 19 serdes2 = 5 serdes3 = 2, rcw_2000_700_2900_19_5_2.bin is available at: rcw/lx2160ardb/XGGFF_PP_HHHH_RR_19_5_2 (For LX2160ARDB Rev 1) rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2 (For LX2160ARDB Rev 2) Note: See the rcw/lx2160ardb/README or rcw/lx2160ardb_rev2/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-20.04 LSDK-20.04  $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- $ make distclean $ make lx2160ardb_tfa_defconfig $ make Note: 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 above U-Boot binary.             The compiled U-Boot binary, u-boot.bin, is available at u-boot/. Step 3: [Optional] Compile OPTEE binary  You need to compile the tee.bin binary to build fip.bin with OPTEE. However, OPTEE is optional, you can skip the procedure to compile OPTEE if you want to build the FIP binary without OPTEE. Clone the optee_os repository and build the OPTEE binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/optee_os $ cd optee_os $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-20.04 LSDK-20.04 $ export ARCH=arm $ export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-lx2160ardb $ 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/eMMC boot Clone the atf repository and compile the TF-A binaries, bl2_sd.pbl/bl2_emmc.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-20.04 LSDK-20.04 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. For SD boot: $ make PLAT=lx2160ardb bl2 SPD=opteed BOOT_MODE=sd BL32=<path_to_optee_binary>/tee.bin pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin For eMMC boot: $ make PLAT=lx2160ardb bl2 SPD=opteed BOOT_MODE=emmc BL32=<path_to_optee_binary>/tee.bin pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin   The compiled BL2 images, bl2.bin and bl2_sd.pbl/bl2_emmc.pbl are available at atf/build/lx2160ardb/release/. For any update in the BL2 source code or RCW binary, the bl2_sd.pbl/bl2_emmc.pbl binary needs to be recompiled.   To compile the BL2 binary without OPTEE: For SD boot: $ make PLAT=lx2160ardb bl2 BOOT_MODE=sd pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin    For emmc boot: $ make PLAT=lx2160ardb bl2 BOOT_MODE=emmc pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin  Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=lx2160ardb 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/lx2160ardb/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: For SD boot: $ make PLAT=lx2160ardb fip BOOT_MODE=sd BL33=<path_to_u-boot_binary>/u-boot.bin   For eMMC boot: $ make PLAT=lx2160ardb fip BOOT_MODE=emmc 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_BOO Step 5: Program TF-A binaries to SD/eMMC card Boot LX2160ARDB from FlexSPI. Ensure that the switches are set to boot the board from FlexSPI. For booting from FlexSPI: SW1[1:8] = 1111 100X [X is 0 for FlexSPI NOR flash0 and X is 1 for FlexSPI NOR flash1] SW2[1:8] = 0000 0110 SW3[1:8] = 1111 1100 SW4[1:8] = 1011 1000 Boot from FlexSPI NOR flash0: => qixis_reset For LX2160ARDB Rev 1, in boot log, you'll see: Board: LX2160ACE Rev1.0-RDB, Board version: B, boot from FlexSPI DEV#0 For LX2160ARDB Rev 2, in boot log, you'll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii [PRIME], DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id, e1000#0 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. Note: See LX2160ARDB 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@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@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> => setenv gatewayIP <gateway IP> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.1.1 is alive Load TF-A binaries for SD boot from the TFTP server Note: 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 dev 0; 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 103353 (193b9 hex), then blk_cnt is calculated as "103353/512 = 201 (C9 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 D3 Flash fip.bin: => tftp 82000000 fip.bin => mmc dev 0;  mmc write 82000000 800 <blk_cnt> Here, blk_cnt refers to number of blocks in SD card that need to be written as per the file size. For example, when you load fip.bin from the TFTP server, if the bytes transferred is 1178967 (11fd57 hex), then blk_cnt is calculated as "1178967/512 = 2302 (8FE 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 908 Boot from SD card: => qixis_reset sd LX2160ARDB will boot with TF-A. In the boot log, you will see: => NOTICE: BL2: v1.5(release):LSDK-20.04 NOTICE: BL2: Built : 22:01:10, Aug 20 2020 NOTICE: UDIMM 18ADF2G72AZ-3G2E1 NOTICE: DDR4 UDIMM with 2-rank 64-bit bus (x8) NOTICE: 32 GB DDR4, 64-bit, CL=22, ECC on, 256B, CS0+CS1 NOTICE: BL2: Booting BL31 NOTICE: BL31: v1.5(release):LSDK-20.04 NOTICE: BL31: Built : 22:02:07, Aug 20 2020 NOTICE: Welc U-Boot 2019.10 (Aug 14 2020 - 17:43:28 +0530) SoC: LX2160ACE Rev2.0 (0x87360020) Clock Configuration: CPU0(A72):2000 MHz CPU1(A72):2000 MHz CPU2(A72):2000 MHz CPU3(A72):2000 MHz CPU4(A72):2000 MHz CPU5(A72):2000 MHz CPU6(A72):2000 MHz CPU7(A72):2000 MHz CPU8(A72):2000 MHz CPU9(A72):2000 MHz CPU10(A72):2000 MHz CPU11(A72):2000 MHz CPU12(A72):2000 MHz CPU13(A72):2000 MHz CPU14(A72):2000 MHz CPU15(A72):2000 MHz Bus: 700 MHz DDR: 2900 MT/s Reset Configuration Word (RCW): 00000000: 50777738 24500050 00000000 00000000 00000010: 00000000 0c010000 00000000 00000000 00000020: 02e001a0 00002580 00000000 00000096 00000030: 00000000 00000000 00000000 00000000 00000040: 00000000 00000000 00000000 00000000 00000050: 00000000 00000000 00000000 00000000 00000060: 00000000 00000000 00027000 00000000 00000070: 08b30010 00150020 Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from SD Load TF-A binaries for eMMC boot from the TFTP server Note: For details about the flash image layout for TF-A binaries, refer LSDK memory layout for TF-A boot flow. Flash bl2_emmc.pbl: => tftp 82000000 bl2_emmc.pbl => mmc dev 1; 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_emmc.pbl from the TFTP server, if the bytes transferred is 103353 (193b9 hex), then blk_cnt is calculated as "103353/512 = 201 (C9 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 D3 Flash fip.bin: => tftp 82000000 fip.bin => mmc dev 1; mmc write 82000000 800 <blk_cnt> Here, blk_cnt refers to number of blocks in SD card that need to be written as per the file size. For example, when you load fip.bin from the TFTP server, if the bytes transferred is 1178967 (11fd57 hex), then blk_cnt is calculated as "1178967/512 = 2302 (8FE 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 908 Boot from eMMC card: => qixis_reset emmc LX2160ARDB will boot with TF-A. In the boot log, you will see:   => NOTICE: BL2: v1.5(release):LSDK-20.04 NOTICE: BL2: Built : 22:01:10, Aug 20 2020 NOTICE: UDIMM 18ADF2G72AZ-3G2E1 NOTICE: DDR4 UDIMM with 2-rank 64-bit bus (x8) NOTICE: 32 GB DDR4, 64-bit, CL=22, ECC on, 256B, CS0+CS1 NOTICE: BL2: Booting BL31 NOTICE: BL31: v1.5(release):LSDK-20.04 NOTICE: BL31: Built : 22:02:07, Aug 20 2020 NOTICE: Welc U-Boot 2019.10 (Aug 14 2020 - 17:43:28 +0530) SoC: LX2160ACE Rev2.0 (0x87360020) Clock Configuration: CPU0(A72):2000 MHz CPU1(A72):2000 MHz CPU2(A72):2000 MHz CPU3(A72):2000 MHz CPU4(A72):2000 MHz CPU5(A72):2000 MHz CPU6(A72):2000 MHz CPU7(A72):2000 MHz CPU8(A72):2000 MHz CPU9(A72):2000 MHz CPU10(A72):2000 MHz CPU11(A72):2000 MHz CPU12(A72):2000 MHz CPU13(A72):2000 MHz CPU14(A72):2000 MHz CPU15(A72):2000 MHz Bus: 700 MHz DDR: 2900 MT/s Reset Configuration Word (RCW): 00000000: 50777738 24500050 00000000 00000000 00000010: 00000000 0c010000 00000000 00000000 00000020: 02e001a0 00002580 00000000 00000096 00000030: 00000000 00000000 00000000 00000000 00000040: 00000000 00000000 00000000 00000000 00000050: 00000000 00000000 00000000 00000000 00000060: 00000000 00000000 00027000 00000000 00000070: 08b30010 00150020 Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from eMMC  
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images for the LX2160ARDB on the SD/eMMC card.  Below steps are valid for both LX2160ARDB Rev 1.0 and Rev 2.0 revisions. Compiling MC firmware Clone the qoriq-mc-binary repository. $ git clone https://github.com/NXP/qoriq-mc-binary.git $ cd qoriq-mc-binary/lx2160a/ $ git checkout LSDK-<LSDK version>. For example, $ git checkout LSDK-20.04 The prebuilt MC firmware image, mc_10.20.4_lx2160a.itb, is available at qoriq-mc-binary/lx2160a/. Note: The exact name of the MC firmware image may vary depending on the LSDK 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-20.04 If required, make changes to the DPC and DPL files. $ make -C config/ The compiled dpc-usxgmii.dtb and dpl-eth.19.dtb images are available at /mc-utils/config/lx2160a/RDB/. Note: The exact name of the DPL and DPC images may vary depending on the LSDK release version used.             SD/eMMC card start block number for MC, DPL, and DPC images Image  SD/eMMC card start block number DPAA2 MC firmware 0x05000 = 20480 DPAA2 DPL  0x06800 = 26624 DPAA2 DPC 0x07000 = 28672   Refer the LSDK firmware and SD card start block number for complete listing of the SD card start block numbers for all LSDK firmware images.    Programming MC, DPC, and DPL images to SD/eMMC card Boot LX2160ARDB from FlexSPI. Ensure that the switches are set to boot the board from FlexSPI. SW1[1:8] = 1111 1000 SW2[1:8] = 0000 0110 SW3[1:8] = 1111 1100 SW4[1:8] = 1011 1000 Boot from FlexSPI NOR flash0: => qixis_reset For example: For LX2160ARDB, in U-Boot log, you’ll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id    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. NOTE: See LX2160ARDB 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@xgmii  => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@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 DPMAC3@xgmii device host 192.168.2.1 is alive  Load images from TFTP server Flash MC firmware (mc_10.20.4_lx2160a.itb): => tftp 82000000 mc_10.20.4_lx2160a.itb  Flash MC firmware to SD card: => mmc dev 0; mmc write 8200000 5000 <blk_cnt>  Flash MC firmware to eMMC card: => mmc dev 1; mmc write 8200000 5000 <blk_cnt> Here, blk_cnt refers to number of blocks in SD/eMMC card that need to be written as per the file size. For example, when you load mc_10.20.4_lx2160a.itb from the TFTP server, if the bytes transferred is 1092272 (10aab0 hex), then blk_cnt is calculated as "1092272 /512 = 2133 (855 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 5000 85F Flash DPAA2 DPL image. => tftp 82000000 dpl-eth.19.dtb Flash DPL image to SD card: => mmc dev 0; mmc write 8200000 6800 <blk_cnt>    Flash DPL image to eMMC card: => mmc dev 1; mmc write 8200000 6800 <blk_cnt> Here, blk_cnt refers to number of blocks in SD/eMMC card that need to be written as per the file size. For example, when you load dpl-eth.19.dtb from the TFTP server, if the bytes transferred is 4583 (11e7 hex), then blk_cnt is calculated as "4583/512 = 8 (8 hex)" + "few sectors for rounding up so that last block is not missed". So, if you round up by 18 (12 hex) sectors, for this example, mmc write command will be:  => mmc write 82000000 6800 12 Flash DPAA2 DPC image.    => tftp 82000000 dpc-usxgmii.dtb  Flash DPC image to SD card: => mmc dev 0; mmc write 8200000 7000 <blk_cnt> Flash DPC image to eMMC card: => mmc dev 1; mmc write 8200000 7000 <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 dpc-usxgmii.dtb from the TFTP server, if the bytes transferred is 736 (2e0 hex), then blk_cnt is calculated as "736/512 = 1 (1 hex)" + "few sectors for rounding up so that last block is not missed". So, if you round up by 11 (B hex) sectors, for this example, mmc write command will be:  => mmc write 82000000 7000 B Boot the board. Boot from SD card: => qixis_reset sd Boot from eMMC card: => qixis_reset emmc LX2160ARDB will boot with updated MC firmware and DPC and DPL images. In the U-Boot log, you will see:   Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from SD ... ... fsl-mc: Booting Management Complex ... SUCCESS fsl-mc: Management Complex booted (version: 10.20.4, boot status: 0x1) Hit any key to stop autoboot:  0 =>   OR   Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from eMMC ... ... fsl-mc: Booting Management Complex ... SUCCESS fsl-mc: Management Complex booted (version: 10.20.4, boot status: 0x1) Hit any key to stop autoboot:  0 =>
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images in FlexSPI NOR flash of LX2160ARDB. NOTE: Below steps are valid for both LX2160ARDB Rev 1.0 and Rev 2.0 revisions. NOTE: qixis_reset boots the board from FlexSPI NOR flash0 and qixis_reset altbank boots the board from FlexSPI NOR flash1. NOTE: sf probe 0:1 means that the alternate bank will be written to. So, if the board boots from FlexSPI NOR flash0 and sf probe 0:1 is entered at the U-Boot prompt, the commands that follow will program FlexSPI NOR flash1. Obtaining MC firmware Clone the qoriq-mc-binary repository. $ git clone https://github.com/NXP/qoriq-mc-binary.git $ cd qoriq-mc-binary/lx2160a/ $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-20.04 LSDK-20.04 The prebuilt MC firmware image, mc_10.20.4_lx2160a.itb, is available at /qoriq-mc-binary/lx2160a/. NOTE: The name of the MC firmware image may vary depending on the LSDK 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-20.04 LSDK-20.04 If required, make changes to the DPC and DPL files. $ make -C config/ The compiled dpc-usxgmii.dtb and dpl-eth.19.dtb images are available at /mc-utils/config/lx2160a/RDB/. NOTE: The name of the DPC and DPL images may vary depending on the LSDK release version used.  Flashing MC firmware, DPC, and DPL images to FlexSPI NOR flash Boot LX2160ARDB from FlexSPI. Ensure that the switches are set to boot the board from FlexSPI. SW1[1:8] = 1111 1000 SW2[1:8] = 0000 0110 SW3[1:8] = 1111 1100 SW4[1:8] = 1011 1000 Boot from FlexSPI NOR flash0: => qixis_reset For example: For LX2160ARDB, in U-Boot log, you’ll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0   The images can be loaded to the LX2160ARB 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. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id  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 LX2160ARDB 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@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@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 DPMAC3@xgmii device host 192.168.2.1 is alive   Load images from a TFTP server to FlexSPI NOR flash1 NOTE: Ensure that the board boots from FlexSPI NOR flash1 before programming updated MC firmware and DPL and DPC images to FlexSPI NOR flash1. If board fails to boot successfully from FlexSPI NOR flash1, you can program composite firmware image to FlexSPI NOR flash1 by following the steps available in section "LSDK Quick Start Guide or LX2160ARDB" in LSDK User Guide. Program FlexSPI NOR flash1: sf probe 0:1 Flash MC firmware: => tftp 0x80000000 mc_10.20.4_lx2160a.itb => print filesize => sf erase 0xa00000 +$filesize && sf write 0x80000000 0xa00000 $filesize Address 0xa00000 is the location of MC firmware in FlexSPI NOR flash. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPC image: => tftp 0x80000000 dpc-usxgmii.dtb => print filesize  => sf erase 0xe00000 +$filesize && sf write 0x80000000 0xe00000 $filesize Address 0xe00000 is the location of DPC image in FlexSPI NOR flash. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image: => tftp 0x80000000 dpl-eth.19.dtb => print filesize  => sf erase 0xd00000 +$filesize && sf write 0x80000000 0xd00000 $filesize Address 0xd00000 is the location of DPL image in FlexSPI NOR flash. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from QSPI NOR flash1: => qixis_reset altbank In U-Boot log, you’ll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#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 FlexSPI 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 Program QSPI NOR flash1: => sf probe 0:1 Flash MC firmware: Load MC firmware image from the storage device => load mmc 0:2 80000000 <mc firmware> For example: => load mmc 0:2 80000000 mc_10.20.4_lx2160a.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 FlexSPI NOR flash: => sf erase 0xa00000 +$filesize && sf write 0x80000000 0xa00000 $filesize  Address 0xa00000 is the location of MC firmware in FlexSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image: Load DPL image from the storage device => load mmc 0:2 80000000 <dpl image> For example: => load mmc 0:2 80000000 dpl-eth.19.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 FlexSPI NOR flash: => sf erase 0xd00000 +$filesize && sf write 0x80000000 0xd00000 $filesize  Address 0xd00000 is the location of DPL image in FlexSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout.   Flash DPC image: Load DPC image from the storage device => load mmc 0:2 80000000 <dpc image> For example: => load mmc 0:2 80000000 dpc-usxgmii.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 FlexSPI NOR flash: => sf erase 0xe00000 +$filesize && sf write 0x80000000 0xe00000 $filesize Address 0xe00000 is the location of DPC image in FlexSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from FlexSPI NOR flash1: => qixis_reset altbank In U-Boot log, you’ll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#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 FlexSPI 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. Note: 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 FlexSPI NOR flash boot, you need to compile the following TF-A binaries. TF-A binary name Components bl2_flexspi_nor.pbl BL2 binary: Platform initialization binary RCW binary for FlexSPI 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_flexspi_nor.pbl and fip.bin) in FlexSPI NOR flash. Compile PBL binary from RCW source file Compile U-Boot binary [Optional] Compile OPTEE binary  Compile TF-A binaries (bl2_flexspi_nor.pbl and fip.bin) for FlexSPI NOR flash Program TF-A binaries to FlexSPI NOR flash Step 1: Compile RCW binary  You need to compile the RCW binary to build the bl2_flexspi_nor.pbl binary. Clone the  rcw  repository and compile the RCW 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-20.04 LSDK-20.04  Compile the RCW binary for Rev 1 or Rev 2 board. For LX2160ARDB Rev 1: $ cd lx2160ardb For LX2160ARDB Rev 2: $ cd lx2160ardb_rev2 If required, make changes to the rcw files. $ make   The compiled PBL binary for FlexSPI NOR flash on LX2160ARDB for core frequency 2000 MHz, platform frequency 700 MHz and DDR memory data rate 2900 MT/s, with serdes1 = 19 serdes2 = 5 serdes3 = 2, rcw_2000_700_2900_19_5_2.bin is available at: rcw/lx2160ardb/XGGFF_PP_HHHH_RR_19_5_2 (For LX2160ARDB Rev 1) rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2 (For LX2160ARDB Rev 2) Note: See the rcw/lx2160ardb/README or rcw/lx2160ardb_rev2/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-20.04 LSDK-20.04  $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- $ make distclean $ make lx2160ardb_tfa_defconfig $ make Note: 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 and above 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 if you want to build the FIP binary without OPTEE. Clone the optee_os repository and build the OPTEE binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/optee_os $ cd optee_os $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-20.04 LSDK-20.04 $ export ARCH=arm $ export CROSS_COMPILE=aarch64-linux-gnu- $ make CFG_ARM64_core=y PLATFORM=ls-lx2160ardb $ 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 FlexSPI NOR flash Clone the atf repository and compile the TF-A binaries, bl2_flexspi_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-20.04 LSDK-20.04 $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- Build BL2 binary with OPTEE. $ make PLAT=lx2160ardb bl2 SPD=opteed BOOT_MODE=flexspi_nor BL32=<path_to_optee_binary>/tee.bin pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin   The compiled BL2 binaries, bl2.bin and bl2_flexspi_nor.pbl are available at atf/build/lx2160ardb/release/. For any update in the BL2 source code or RCW binary, the bl2_flexspi_nor.pbl binary needs to be recompiled.   To compile the BL2 binary without OPTEE: make PLAT=lx2160ardb bl2 BOOT_MODE=flexspi_nor pbl RCW=<path_to_rcw_binary>/rcw_2000_700_2900_19_5_2.bin Build FIP binary with OPTEE and without trusted board boot. $ make PLAT=lx2160ardb 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/lx2160ardb/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=lx2160ardb fip BOOT_MODE=flexspi_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 FlexSPI NOR flash Boot LX2160ARDB from FlexSPI. Ensure that the switches are set to boot the board from FlexSPI. For booting from FlexSPI: SW1[1:8] = 1111 100X [X is 0 for FlexSPI NOR flash0 and X is 1 for FlexSPI NOR flash1] SW2[1:8] = 0000 0110 SW3[1:8] = 1111 1100 SW4[1:8] = 1011 1000 Boot from FlexSPI NOR flash0: => qixis_reset   For LX2160ARDB Rev 1, in boot log, you'll see: Board: LX2160ACE Rev1.0-RDB, Board version: B, boot from FlexSPI DEV#0   For LX2160ARDB Rev 2, in boot log, you'll see: Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii [PRIME], DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id, e1000#0  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. Note: SeeLX2160ARDB 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@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@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>   => setenv gatewayIP <gateway IP> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.1.1 is alive Load TF-A binaries from the TFTP server Note: For details about the flash image layout for TF-A binaries, refer LSDK memory layout for TF-A boot flow. Program FlexSPI NOR flash1: => sf probe 0:1 Flash bl2_flexspi_nor.pbl: => tftp 0xa0000000 bl2_flexspi_nor.pbl => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Flash fip.bin: => tftp 0xa0000000 fip.bin => sf erase 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize Boot from FlexSPI NOR flash1: => qixis_reset altbank LX2160ARDB will boot with TF-A. In the boot log, you will see: => NOTICE: BL2: v1.5(release):LSDK-20.04 NOTICE: BL2: Built : 22:01:10, Aug 20 2020 NOTICE: UDIMM 18ADF2G72AZ-3G2E1 NOTICE: DDR4 UDIMM with 2-rank 64-bit bus (x8) NOTICE: 32 GB DDR4, 64-bit, CL=22, ECC on, 256B, CS0+CS1 NOTICE: BL2: Booting BL31 NOTICE: BL31: v1.5(release):LSDK-20.04 NOTICE: BL31: Built : 22:02:07, Aug 20 2020 NOTICE: Welc U-Boot 2019.10 (Aug 14 2020 - 17:43:28 +0530) SoC: LX2160ACE Rev2.0 (0x87360020) Clock Configuration: CPU0(A72):2000 MHz CPU1(A72):2000 MHz CPU2(A72):2000 MHz CPU3(A72):2000 MHz CPU4(A72):2000 MHz CPU5(A72):2000 MHz CPU6(A72):2000 MHz CPU7(A72):2000 MHz CPU8(A72):2000 MHz CPU9(A72):2000 MHz CPU10(A72):2000 MHz CPU11(A72):2000 MHz CPU12(A72):2000 MHz CPU13(A72):2000 MHz CPU14(A72):2000 MHz CPU15(A72):2000 MHz Bus: 700 MHz DDR: 2900 MT/s Reset Configuration Word (RCW): 00000000: 50777738 24500050 00000000 00000000 00000010: 00000000 0c010000 00000000 00000000 00000020: 02e001a0 00002580 00000000 00000096 00000030: 00000000 00000000 00000000 00000000 00000040: 00000000 00000000 00000000 00000000 00000050: 00000000 00000000 00000000 00000000 00000060: 00000000 00000000 00027000 00000000 00000070: 08b30010 00150020 Model: NXP Layerscape LX2160ARDB Board Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#1      
View full article
Follow these steps to update the Linux kernel image and device tree for LX2160ARDB on an SD card.  NOTE: Below steps are valid for both LX2160ARDB Rev 1.0 and Rev 2.0 revisions. STEP 1: 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-20.04-V5.4 LSDK-20.04-V5.4 where LSDK-20.04-V5.4 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-lx2160a-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-lx2160a-rdb.dtb is in arch/arm64/boot/dts/freescale/. STEP2: Copying the compiled kernel images and device tree to the SD card   Plug the SD card into the Linux host machine. sudo fdisk -l to list the disks that are accessible to the computer. Mount the SD card partition that contains Linux kernel images and device tree. sudo mkdir <mount_location> sudo mount /dev/sdX <mount_location> For example: $ sudo mkdir /carddata $ sudo mount /dev/mmcblk0p2 /carddata   NOTE: Use the command cat /proc/partitions to see the list of devices, their partitions along with their sizes to make sure that the correct device and partition name have been chosen. The eMMC 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 SD card directly without an extra SD card reader device, the device name of SD card is typically mmcblk0. In general, the Linux kernel images and device tree are stored in the second partition of the SD device (mmcblk0p2). For detail on storage layout on SD/eMMC/USB/SATA for LSDK images deployment, refer to section "LSDK memory layout and Userland" in Layerscape Software Development Kit User Guide. Replace Image, Image.gz, and fsl-lx2160a-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-lx2160a-rdb.dtb <mount_location> For example: $sudo cp /linux/arch/arm64/boot/Image /linux/arch/arm64/boot/Image.gz /linux/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dtb /carddata Unmount the card. For example: sudo umount /dev/mmcblk0p2 Plug the SD card into LX2160ARDB and boot the board. At U-Boot, run the following command to boot the board to LSDK distro using the SD card. => run bootcmd_mmc0 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
In the U-Boot log, the names of the Ethernet interfaces are printed in the format <name>@<interface type>, for example, DPMAC3@xgmii. DPMAC is a DPAA2 object that identifies the physical interface.    Interface name is not fixed in LX2160ARDB, depending upon which interface is active, name will be assigned  in TinyDistro as well as in Ubuntu distribution. Interface names can be checked using ls-listni command. root@TinyDistro:~# ls-listni dprc.1/dpni.1 (interface: eth0, end point: dpmac.2) dprc.1/dpni.0 (interface: eth1, end point: dpmac.17)   For details regarding creation of a DPAA2 network interface (DPNI) in Linux, see "LSDK Quick Start Guide for LX2160ARDB -> Bringing up DPAA2 network interfaces" in Layerscape Software Development Kit User Guide.   The table below shows the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux for LX2160ARDB.    Port name on chassis Port name in U-Boot Port name in Linux (tinyDistro) Port name in Linux (Ubuntu userland) Description 40G MAC2 DPMAC2@xlaui4 Interface name will be ethn, for example eth0, eth1. Eth0: If PCIe is connected, else it is any connected DPAA2 interface. PCIe: enp1s0   DPAA: ethx 40G MAC2 QSFP+ port 10G MAC3 DPMAC3@xgmii 10G MAC3 USXGMII port 10G MAC4 DPMAC4@xgmii 10G MAC4 USXGMII port 25G MAC5 DPMAC5@25g-aui 25G MAC5 SFP port 25G MAC6 DPMAC6@25g-aui 25G MAC6 SFP port 1G MAC17 DPMAC17@rgmii-id 1G MAC17 RGMII port 1G MAC18 DPMAC18@rgmii-id 1G MAC18 RGMII port  
View full article
On LS2085 platform, the basic networking product performs autonomous IP forwarding and IPSEC on the AIOP, data path functions run mostly independent of the GPP software and only involve GPP when necessary. NADK(Network Acceleration Development Kit) is a complete user space development kit for networking applications. This IPSEC application is implemented in Linux user space using NADK framework, this application learns the Linux configuration through the netlink event notification and sends the configuration to AIOP DP using the respective NF APIs. The application invokes NF APIs to send configuration details to IPsec data path on the AIOP. 1. Overview and Architecture of the AIOP-NADK Based IPSEC Application 2. NADK Based GPP Listener Program Design 2.1 NADK APIs Introduction Used in the Application 2.2 Packet Processing in Multiple Threads Mode NADK Application 2.3 IPSEC XFRM Events monitored by the Listener 3. IPSEC Application communicates with AIOP through NF APIs 3.1 IPSEC provided features implemented at AIOP 3.2 IPSEC NF APIs Used to Configure AIOP 3.3 The process of add SPD policy in the IPSEC Application 4. Setup Networking Environment to Verify the IPSEC application
View full article
EdgeScale solution provides a secure mechanism for developers to leverage cloud-computing frameworks for their applications, it helps users easily connect IoT things, manage devices and deploy container based applications. Please refer to the following Layerscape products in the cloud computing system. The user could access cloud service from https://portal.edgescale.org. EdgeScale client is a set of software agents running on device side which connects to the cloud services. This document introduces EdgeScale supported major features as registering user account, secure device enrolment, provisioning/connecting the EdgeSacle end devices, generate EdgeScale client images in LSDK, OTA firmware update (LS1043 or LS1046), running EdgeScale demo applications and dynamic deployment of container-based applications.
View full article
In the U-Boot log, the names of the Ethernet interfaces are printed in the format <name>@<interface type>, for example, DPMAC2@xgmii. DPMAC is a DPAA2 object that identifies the physical interface.  For Linux, in TinyDistro as well as in Ubuntu distribution, by default, only one MAC is enabled as a standard Kernel Ethernet Interface. This interface is named eth0 by default (or eth1 if PCI Express network interface card is discovered first). For details regarding creation of a DPAA2 network interface (DPNI) in Linux, see "LSDK Quick Start Guide for LS2088ARDB -> Bringing up DPAA2 network interfaces" in Layerscape Software Development Kit User Guide. The table below shows the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux for LS2088ARDB.  In Linux, the mapping of Ethernet port names is not strict. The port names are mapped based on the order in which the Ethernet interfaces are created. As an example, consider a DPL file which defines only one DPMAC object, DPMAC3. When Linux starts, if a net device is created using DPMAC3, it will be labeled eth1 (assuming PCIe interface is eth0). Port name on chassis Port name in U-Boot Port name in Linux (tinyDistro and Ubuntu userland) Description ETH0  DPMAC5@xgmii eth0 by default (or eth1 if PCI Express network interface card is discovered first) XFI copper interface ETH1 DPMAC6@xgmii not enabled by default XFI copper interface ETH2 DPMAC7@xgmii not enabled by default XFI copper interface ETH3 DPMAC8@xgmii not enabled by default XFI copper interface ETH4 DPMAC1@xgmii not enabled by default XFI copper interface ETH5 DPMAC2@xgmii not enabled by default XFI copper interface ETH6 DPMAC3@xgmii not enabled by default XFI copper interface ETH7 DPMAC4@xgmii not enabled by default XFI copper interface
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 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 if you want to build the FIP binary without OPTEE. Clone the optee_os repository and build the OPTEE binary.  $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/optee_os $ cd optee_os $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-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 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 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. For example, when you load fip.bin from the TFTP server, if the bytes transferred is 1077157 (106fa5 hex), then blk_cnt is calculated as "1077157/512 = 2103 (837 hex)" + "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
Getting RCW image: Getting UEFI image:                              Getting PPA image: Getting Linux kernel and DTB, and Root FS images: - Download Image , fsl-ls1043a-uefi-rdb.dtb and fsl-image-core-ls1043ardb.ext2.gz . - Copy Image and fsl-image-core-ls1043ardb.ext2.gz to the TFTP server directory. Getting GRUB2 image for AARCH64 and sample GRUB configuration: - Download grub image from this location. - Download sample grub configuration from here . Placing GRUB image on FAT formatted SD card: Install FAT32 file system on SD card - Use the DISKPART utililty on windows command prompt to format a SD card with FAT32 file system. Use the following snapshot for reference - Copy grubaa64.efi and ls1043a-grub.cfg to the SD card. Booting to UEFI prompt on LS1043a RDB Board: Boot to u-boot prompt from NOR flash bank 0 on LS1043a RDB.  Setup serial port connection on host machine, to capture logs from the target LS1043a RDB board.. Reset the board to boot u-boot on bank 0, assuming that there is a valid u-boot image flashed on the primary bank 0. Copy Images to NOR flash alternate bank using u-boot commands sete uefi 'tftp 80000000 LS1043ARDB_EFI.fd; erase 0x64400000 0x644FFFFF ; cp.b 80000000 0x64400000 $filesize' sete rcw 'tftp 80000000 rcw_uefi_1500.bin; erase 0x64000000 0x640FFFFF ; cp.b 80000000 0x64000000 $filesize' sete ppa 'tftp 80000000 ppa.itb; erase 0x64500000 0x645FFFFF ; cp.b 80000000 0x64500000 $filesize' sete dtb 'tftp 80000000 fsl-ls1043a-uefi-rdb.dtb; erase 0x65B00000 0x65BFFFFF; cp.b 80000000 65B00000 $filesize' run uefi run ppa run rcw run dtb Note: The host machine is assumed to be having tftp server running, with the relevant files in place. The rcw, uefi, dtb and ppa images can also be found at compass link shared above. Note: Make sure SD card is inserted into the SD card slot on the board. Reset RDB to boot from NOR flash bank 4 => cpld reset altbank You should get UEFI boot prompt, as shown in the image below. Enter 2 to load Shell. On the Shell prompt run the following commands Shell> FS0:   Shell> ls You should see a list of the grub executable and configurations files present on SD card. Booting Linux via PXE on LS1043a RDB: Note: atftpd or tftpd-hpa, is required as tftp server for PXE boot to work. tftpd is not supported.  Load grub by entering the name of the grub executable. Shell> grubaa64.efi On the grub prompt, setup the server and client IPs for TFTP transfer. grub> set net_default_server=<server_ip> grub> net_add_addr eno0 efinet0 <client_ip> Load the grub configuration. grub> configfile (hd3,msdos1)/ls1043a-grub.cfg Grub menu is listed. Choose the entry for liinux boot. See the snapshot below for reference. Linux boot should start in around 7-8 minutes. Data transfer speed is around 100 KB/s.
View full article
Recently some customers are porting SDK 2.0 u-boot for LS1021ATWR to their custom boards. They intended to use GPIO lines to turn on/off LEDs for diagnostics and other various purposes. However GPIO driver is not supported in SDK 2.0 u-boot for LS102xa platform. The attached patch is used to add GPIO driver on LS1021ATWR platform based on SDK 2.0 u-boot code. Please use it in SDK 2.0 as the following: $ source ./fsl-setup-env -m ls1021atwr $ bitbake u-boot -c cleansstate $ bitbake u-boot -c patch Go to the folder build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/u-boot-qoriq/2016.01+fslgit-r0/git, apply the attached patch $ patch -p1<0001-ls1021xa-gpio.patch Go back to build_ls1021atwr folder to rebuild u-boot $ bitbake u-boot
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.06 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 ls1046ardb_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.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 0x100000 +$filesize && sf write 0xa0000000 0x100000 $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. 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 0x100000 +$filesize && sf write 0xa0000000 0x100000 $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
The Layerscape LS1028A industrial applications processor includes a TSN-enabled Ethernet switch and Ethernet controllers to support converged IT and OT networks. Two powerful 64-bit ARM v8 cores support real-time processing for industrial control, as well as virtual machines for edge computing in the IoT. The integrated GPU and LCD controller enable Human Machine Interface (HMI) systems with next-generation interfaces. Integrated Trust Architecture with crytographic offload provide a trusted platform with encrypted communications for secure applications and services. Product Page Reference Design KEY ELEMENTS Dual 64-bit ARM v8 processors for real-time processing Full virtualization support for IoT edge computing TSN-enabled switch for industrial TSN bridge applications TSN-enabled Ethernet controllers for TSN endpoint applications Support Human Machine Interface applications with integrated GPU and LCD controller Trust architecture provides root of trust as a basis for trusted applications and services The LS1028A will be a part of the NXP 15-year product longevity program TARGET APPLICATIONS Factory Automation Process Automation Programmable Logic Controller Motion Controller Industrial IoT gateway Human Machine Interface (HMI)
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 0xa0000000 <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 the complete flash memory layout for the PPA boot flow, refer 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 image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize Address 0x0 is the location of PBL binary in QSPI NOR flash.  Refer Flash layout for old boot flow with PPA for the 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