Layerscape Knowledge Base

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

Layerscape Knowledge Base

Labels

Discussions

Sort by:
How to use UART2 instead of UART1 on LS1043ARDB/LS1046ARDB.   1. Compile PBL binary from RCW source file 2. Compile U-Boot binary 3. Compile TF-A binaries (bl2_.pbl and fip.bin) 4. Program TF-A binaries on specific boot mode     1-COMPILE PBL BINARY FROM RCW SOURCE FILE   You have to create a new directory to compile the binaries that you need to create a TF-A binary You need to compile the rcw_<boot_mode>.bin binary to build the bl2_<boot_mode>.pbl binary.   Clone the rcw repository and compile the PBL binary.   1. $ git clone https://github.com/nxp-qoriq/rcw 2. $ cd rcw 3. $ cd ls1043ardb 4. $ make   Inside the directory called “RR_FQPP_1455” you can see some binaries with the next nomenclature: rcw_<freq>.bin Where “freq” is the frequency in MHz of the processor, the values of the frequency are 1200MHz, 1400MHz, 1500MHz, and 1600MHz   2-COMPILE U-BOOT BINARY You need to compile the u-boot.bin binary to build the fip.bin binary. Clone the U-boot repository and compile the U-Boot binary for TF-A   1. $ git clone https://github.com/nxp-qoriq/u-boot 2. $ cd u-boot 3. $ git checkout -b LSDK-21.08 LSDK-21.08 4. $ export ARCH=arm64 5. $ export CROSS_COMPILE=aarch64-linux-gnu- 6. $ make distclean 7. $ nano configs/ls1043ardb_tfa_defconfig 7.1 change the bootargs "console=ttyS0,115200" for "console=ttyS1,115200" 7.2 add "CONFIG_CONS_INDEX=2 7. $ make ls1043ardb_tfa_defconfig 8. $ make   3 Compile TF-A binaries (bl2_.pbl and fip.bin) 1. $ git clone https://github.com/nxp-qoriq/atf 2. $ cd atf 3. $ git checkout -b LSDK-21.08 LSDK-21.08 4. $ export ARCH=arm64 5. $ export CROSS_COMPILE=aarch64-linux-gnu- 6. $ nano plat/nxp/common/include/default/ch_3_2/soc_default_base_addr.h 6.1 Change the line "#define NXP_UART_ADDR 0x021C0000" for "#define NXP_UART_ADDR 0x021D0000" 6.2 Change the line "#define NXP_UART1_ADDR 0x021D0000" for "#define NXP_UART_ADDR 0x021C0000" 7. $ nano plat/nxp/common/include/default/ch_2/soc_default_base_addr.h 7.1 Change the line "#define NXP_UART_ADDR 0x021C0500" for "#define NXP_UART_ADDR 0x021C0600" 7.2 Change the line "#define NXP_UART1_ADDR 0x021C0600" for "#define NXP_UART_ADDR 0x021C0500"   The compiled BL2 binaries, bl2.bin and bl2_<boot mode>.pbl are available at atf/build/ls1043ardb/release/. NOTE: For any update in the BL2 source code or RCW binary, the bl2_<boot mode>.pbl binary needs to be recompiled   3.1 HOW TO COMPILE BL2 BINARY To compile the BL2 binary without OPTEE: make PLAT=<platform> bl2 BOOT_MODE=<boot_mode> pbl RCW=<path_to_rcw_binary>/<rcw_binary_for_specific_boot_mode> To LS1043ARDB for SD boot: make PLAT=ls1043ardb bl2 BOOT_MODE=sd pbl RCW=<path_to_rcw_binary>/<rcw_freq.bin> To LS1043ARDB for NOR boot: make PLAT=ls1043ardb bl2 BOOT_MODE=nor pbl RCW=<path_to_rcw_binary>/<rcw_freq.bin> To LS1043ARDB for NAND boot: make PLAT=ls1043ardb bl2 BOOT_MODE=nand pbl RCW=<path_to_rcw_binary>/<rcw_freq.bin>   3.2 HOW TO COMPILE FIP BINARY   To compile the FIP binary without OPTEE and trusted board boot: $make PLAT=<platform> fip BL33=<path_to_u-boot_binary>/u-boot.bin   For LS1043ARDB: $make PLAT=ls1043ardb fip BL33=<path_to_u-boot_binary>/u-boot.bin   The compiled BL31 and FIP binaries ( bl31.bin, fip.bin ) are available at atf/build/ls1043ardb/release/. For any update in the BL31, BL32, or BL33 binaries, the fip.bin binary needs to be recompiled.   4 Program TF-A binaries on specific boot mode For that step you can use a tftp server, but it is easier with a USB formatted on FAT32.   You have to put the files “ bl2_<boot_mode>.pbl” and “fip.bin” in the usb and follow the steps to your boot mode.   4.1 Program TF-A binaries on IFC NOR flash For LS1043A, the steps to program TF-A binaries on IFC NOR flash are as follows:   1. Boot the board from the default bank. 2. Under U-boot prompt: => usb start 3. Flash bl2_nor.pbl: => fatload usb 0:1 $load_addr bl2_nor.pbl a. Alternate bank: => protect off 64000000 +$filesize && erase 64000000 +$filesize && cp.b $load_addr 64000000 $filesize b. Current bank: => protect off 60000000 +$filesize && erase 60000000 +$filesize && cp.b $load_addr 60000000 $filesize 4. Flash fip.bin: => fatload usb 0:1 $load_addr fip.bin a. Alternate bank: => protect off 64100000 +$filesize && erase 64100000 +$filesize && cp.b $load_addr 64100000 $filesize b. Current bank: => protect off 60100000 +$filesize && erase 60100000 +$filesize && cp.b $load_addr 60100000 $filesize 5. Reset your board: a. Alternate bank: cpld reset altbank b. Current bank: cpld reset   4.2 Program TF-A binaries on NAND flash   1. Boot the board from the default bank. 2. Under U-boot prompt: => usb start 3. Flash bl2_nand.pbl to NAND flash: => fatload usb 0:1 $load_addr bl2_nand.pbl => nand erase 0x0 $filesize;nand write $load_addr 0x0 $filesize; 4. Flash fip_uboot.bin to NAND flash: => fatload usb 0:1 $load_addr fip.bin => nand erase 0x100000 $filesize;nand write $load_addr 0x100000 $filesize; 5. Reset your board: => cpld reset nand   4.3 Program TF-A binaries on SD card   To program TF-A binaries on an SD card, follow these steps:   1. Boot the board from the default bank. 2. Under U-boot prompt: => usb start 3. Flash bl2_sd.pbl to SD card: => fatload usb 0:1 $load_addr bl2_sd.pbl => mmc write $ load_addr 8 A1 4. Flash fip.bin to SD card: => fatload usb 0:1 $load_addr bl2_sd.pbl => mmc write $load_addr 800 A1 5. Reset your board: => cpld reset sd Now the console should be out from UART2 port of the board.  
View full article
Quick start to recover a ATF in a damaged storage device. In this case, a blanked LS1012AFRWY QSPI, which is the only BL2 and FIP storage device on board, is restored using CW TAP, CW 4NET and Flex-Installer. Download firmware using flex-installer   nxplayerscape@nxp-global-cas:~/Downloads/josephs-downloads/Flex-Installer-LDP$ flex-installer -i download -f firmware_ls1012afrwy_qspi.boot Please specify correct '-m <machine>' Valid machine name: ls1012ardb ls1012afrwy ls1021atwr ls1028ardb ls1043ardb ls1046ardb ls1046afrwy ls1088ardb_pb ls2088ardb lx2160ardb_rev2 lx2162aqds  imx6qpsabresd imx6qsabresd imx6sllevk imx7ulpevk imx8mmevk imx8mnevk imx8mpevk imx8mqevk imx8qmmek imx8qxpmek imx8ulpevk  nxplayerscape@nxp-global-cas:~/Downloads/josephs-downloads/Flex-Installer-LDP$ flex-installer -i download -f firmware_ls1012afrwy_qspi.boot -m ls1012afrwy    Downloading http://www.nxp.com/lgfiles/sdk/sdk2110/firmware_ls1012afrwy_qspi.boot ...   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 -rw-rw-r-- 1 nxplayerscape nxplayerscape 0 abr  6 13:27 firmware_ls1012afrwy_qspi.boot    Downloading http://www.nxp.com/lgfiles/sdk/sdk2110/boot_LS_arm64_lts_5.10.tgz ...   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100  342M  100  342M    0     0  5695k      0  0:01:01  0:01:01 --:--:-- 5752k    Downloading http://www.nxp.com/lgfiles/sdk/sdk2110/rootfs_sdk2110_ubuntu_main_arm64.tgz ...   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100  809M  100  809M    0     0  5641k      0  0:02:26  0:02:26 --:--:-- 3109k Downloaded distro images [Done] nxplayerscape@nxp-global-cas:~/Downloads/josephs-downloads/Flex-Installer-LDP$ flex-installer -i download -f firmware_ls1012afrwy_qspiboot.img Please specify correct '-m <machine>' Valid machine name: ls1012ardb ls1012afrwy ls1021atwr ls1028ardb ls1043ardb ls1046ardb ls1046afrwy ls1088ardb_pb ls2088ardb lx2160ardb_rev2 lx2162aqds  imx6qpsabresd imx6qsabresd imx6sllevk imx7ulpevk imx8mmevk imx8mnevk imx8mpevk imx8mqevk imx8qmmek imx8qxpmek imx8ulpevk  nxplayerscape@nxp-global-cas:~/Downloads/josephs-downloads/Flex-Installer-LDP$ flex-installer -i download -f firmware_ls1012afrwy_qspiboot.img -m ls1012afrwy    Downloading http://www.nxp.com/lgfiles/sdk/sdk2110/firmware_ls1012afrwy_qspiboot.img ...   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100 1617k    0 1617k    0     0  1529k      0 --:--:--  0:00:01 --:--:-- 1529k -rw-rw-r-- 1 nxplayerscape nxplayerscape 1656690 oct 25  2021 firmware_ls1012afrwy_qspiboot.img boot_LS_arm64_lts_5.10.tgz already exists rootfs_sdk2110_ubuntu_main_arm64.tgz already exists Downloaded distro images [Done] Create a PBL project   Note: Need to create a custom board connection based on: How to create a CWTAP to LS Series Processors JTAG-Link. Try to dump 16 MB of memory.   Look for downloaded firmware   Flash it to qspi using flash programmer.   Press the reset button on LS1012AFRWY. Doesn't need to disconnect CWTAP.   Hope this helps when no storage device has a valid binary to get to U-boot, when a board is running U-Boot or Tiny Distro, it can update any SW easily. Ask any questions you may have. Best regards, Joseph
View full article
Introduction.   CodeWarrior TAP combined with a host debugger provide control and visibility into your target embedded system through a debugging process. Main tasks to test a Reference Design Board with are: Flash an storage device for userspace debugging and recovering a board. RCW and PBL configuration. DDR and SerDes configuration. DDR and SerDes validation. U-Boot and Kernel debug For all of them and every activity involving real hardware, a link is needed nevertheless is a very straightforward process that is going to be crawled in this document.   Hardware List.   CodeWarrior TAP USB cable. USB A-Mini-B. CodeWarrior TAP TIP CWH-CTP-CTX10-YE. COP connector. CodeWarrior TAP Base Unit. CWH-CTP-BASE-HE. Host computer. Processor: Windows® OS: Intel® Pentium® 4 processor, 2 GHz or faster, Intel® Xeon™, Intel® Core™, AMD Athlon™ 64, AMD Opteron™, or later Linux® OS: 1.8 GHz Intel® Pentium® class processor (or better). 64-bit host OS required. Operating System: Microsoft® Windows 7 64-bit Microsoft® Windows 10 64-bit RHEL 7.8, 8.2 64-bit CentOS 7.8, 8.2 64-bit Ubuntu 16.04 64-bit Ubuntu 18.04 64-bit Ubuntu 20.04 64-bit Fedora 31 64-bit Mint 19.3 64-bit Memory. At least 2 GB of RAM At least 3 GB of free disk space NXP Reference Board featuring. LS2088A. LS1012A. LS1043A. LS1088A. LS1046A.   Power-up set-up.   Connect debugger and target's end to each other, while both of them are powered off. Connect TAP TIP multipin connector to TAP multipin socket pushing them.     Ribbon cable red side has to be on TIP pin 1 side and Target COP pin 1 side, look for CPU/Processor silkscreen and pin 1 label. See below examples.            Note that CPU JTAG silkscreen label is in the red box, but also may be visible the 1 label. Power up CWTAP. The most efficient way to set up CWTAP is using USB cable, due to can be both powered and communicated with just one cable. Connect USB to Host PC and wait for TX LED to go green blinking.     If communication is directly to host, considerate that you'll be joined into a private network and you will not have internet access. Power up Target. Connect target to DC supply and turn on power switch and press reset button (needed for boards which don't have a power switch). Create a connection in CodeWarrior.   Open CodeWarrior previously previously set up and with a workspace selected. Make sure that Target Connections window is visible, if not, look for it in Window > Show view > Other.   Every target connection desired has to be based on CW predefined board connections. Predefined connections are processor oriented and have a default configuration, you cannot and should not override this values, e.g., MAC field for TAP probe, you should duplicate and then customize it. Click on the reference board that you have, then duplicate, name new target and save.     Double click or click edit to enter TAP MAC value. Settings are initialized based on the duplicated board, it's recommended to just update MAC. Click on look for probes, select the one that matches your MAC and save.     Save. Serial number field is updated and you are notified of unsaved changes, is the asterisk at the left of your duplicate name, save (ctrl + s) and you may close the connection data is done now.     Open a project or create a new one. I created a new project to simply read RCW inside NOR Flash Bank 0 of LS1043ARDB following the below process.         Then, open Connections View to test the new connection based on custom connection data created before. Click on recheck connection button (green play button) and connection status should change from no-link (connection button right side) to connection working.     Diagnose connection.   Go to Target Connections view and click diagnose connection, Connection Diagnostics view should be popped up and log different tests to ensure that there is a target connection and SOC modules are accessible.     At this point, the connection is made and is already tested, but in this document, RCW will also be dumped into our project just to work ourselves with the connection already made. Under Component Inspector view go to Import tab, select Import From Target and click Read from target.     Results are display in text box as: RCWSR registers were successfully read from the target and imported! RCWSR1:0x08100010 RCWSR2:0x0A000000 RCWSR3:0x00000000 RCWSR4:0x00000000 RCWSR5:0x14550002 RCWSR6:0x80004012 RCWSR7:0xE0025000 RCWSR8:0xC1002000 RCWSR9:0x00000000 RCWSR10:0x00000000 RCWSR11:0x00000000 RCWSR12:0x00038800 RCWSR13:0x00000000 RCWSR14:0x00001101 RCWSR15:0x00000096 RCWSR16:0x00000001 That should save a connection to a CWTAP to reuse with that same MAC intended to a any RDB that features the selected processor. Later on you can recover LS Series processors, flash, configure or validate a board. Please ask any question you may have. Best regards, Joseph
View full article
How to bring up a card when the flash is blank, or the image is corrupted. How to boot cards from various boot mode when changed the RCW as requirements. This documentation will use LS1046ARDB as new board to realize the functions (all target board in the document is LS1046ARDB). Content Bring up LS1046A with CodeWarrior TAP Boot up from the SD card Compile PBL binary from RCW source file Compile the PBL binary into firmware Program the firmware into the target board (LS1046ARDB) Boot up from the QSPI Compile firmware from RCW source file Program the firmware into the target board (LS1046ARDB) Boot up from the eMMC Enable the on board eMMC Compile firmware from RCW source file Program the firmware into the target board (LS1046ARDB)
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-344564 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-344236 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343865 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343717 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343572 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343516     
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343225 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-342787 
View full article
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-342651 
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
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 Ethernet port (ETH8) that eth0 (or eth1) corresponds to, on LS1088ARDB.  The following figure shows the Ethernet 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.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
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
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.06 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 ls1088ardb_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 18.06 or LSDK 18.09 U-Boot 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 with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@qsgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@qsgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command. Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@qsgmii device host 192.168.1.1 is alive Load U-Boot image from the TFTP server Program QSPI NOR flash1: => sf probe 0:1 Flash U-Boot image: => tftp 0xa0000000 u-boot.bin => print filesize filesize=aa4b4 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. 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 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 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize  Address 0x100000 is the location of U-Boot 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.
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 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 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 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_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 for 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