Layerscape Knowledge Base

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

Layerscape Knowledge Base

Discussions

Sort by:
PCI-Express introduction PCIe Device Type And Topology PCIe system architecture          2.1 Transaction Layer          2.2 Data link layer          2.3 Physical Layer Interrupts Mechanism PCIe enumeration and resource assignment
View full article
Follow these steps to update the Linux kernel image and device tree on the SD card.  Compiling Linux kernel images and device tree On Linux host, clone the repository with Linux kernel image and device tree: $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/linux $ cd linux $ git checkout -b <new branch> <start point> For example, $ git checkout -b LSDK-18.09-V4.14 LSDK-18.09-V4.14 where LSDK-18.09-V4.14 refers to a tag in the format LSDK-<LSDK version>-V<kernel version> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig lsdk.config If you want to make changes to the device tree, open and edit arch/arm64/boot/dts/freescale/fsl-ls1088a-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-ls1088a-rdb.dtb is in arch/arm64/boot/dts/freescale/. Copying the compiled kernel images and device tree to the SD card Plug the SD card into the Linux host machine. 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> Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0. Replace Image, Image.gz, and fsl-ls1088a-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-ls1088a-rdb.dtb <mount_location> sudo umount /dev/sdX Plug the SD card into LS1088ARDB/LS1088ARDB-PB and boot the board to Ubuntu using the SD card. If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored on the SD card.
View full article
This topic explains steps to compile and execute Hello World program (in C) on a Layerscape board. Similarly, you can execute other custom applications on your board. Create a Hello World program in C.  Copy this file (.c) on a Ubuntu machine (using WinSCP). Run the following command to convert the .c file into a binary file. $ aarch64-linux-gnu-gcc <.c file> -o <binary file> For example: $ aarch64-linux-gnu-gcc Hello_World.c -o Hello_World Note: You can use this command in the same directory in which .c file is present or provide path of this file. Connect to the board console on which you want to execute the custom application via terminal and boot the board with LITB. Note: It is suggested to boot the board with Tiny Linux for executing custom application.  => tftp 0xa0000000 lsdk2004_yocto_tiny_LS_arm64.itb Using e1000#0 device TFTP from server 192.168.3.1; our IP address is 192.168.3.142 Filename 'lsdk2004_yocto_tiny_LS_arm64.itb'. Load address: 0xa0000000 Loading: ################################################################# ################################################################# ##################################################### 4.3 MiB/s done Bytes transferred = 37030212 (2350944 hex) => bootm 0xa0000000#lx2160ardb ## Loading kernel from FIT Image at a0000000 ... Using 'lx2160ardb' configuration Trying 'kernel' kernel subimage Description: ARM64 Kernel Created: 2021-02-03 6:01:29 UTC Type: Kernel Image Compression: gzip compressed Data Start: 0xa00000d0 Data Size: 14086432 Bytes = 13.4 MiB When Tiny Linux boots, enable Ethernet to download the HelloWorld program on the board. To see the available networks. root@TinyLinux:~# ifconfig -a eth0 Link encap:Ethernet HWaddr 68:05:ca:2b:2c:ca BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:114 Memory:90460c0000-90460e0000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) sit0 Link encap:UNSPEC HWaddr 00-00-00-00-31-00-6C-6F-00-00-00-00-00-00-00-00 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Enable the Ethernet connection. # ifconfig <eth interface> <IP address> netmask <netmask> up For example: root@TinyLinux:~# ifconfig eth0 192.168.3.121 netmask 255.255.255.0 up Set the gateway IP and ping the server to test the connection. # route add default gw <gateway IP> # ping <server IP> For example: root@TinyLinux:~# route add default gw 192.168.3.1 root@TinyLinux:~# ping 192.168.3.1 PING 192.168.3.1 (192.168.3.1): 56 data bytes 64 bytes from 192.168.3.1: seq=0 ttl=64 time=0.479 ms 64 bytes from 192.168.3.1: seq=1 ttl=64 time=0.204 ms Download the HelloWorld binary file on your board. For example: root@TinyLinux:~# scp user@192.168.3.1:/tftpboot/LX2160ARDB/HelloWorld . Execute the HelloWorld application. root@TinyLinux:~# ./HelloWorld Hello, World!    
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
Follow these steps to update the DPAA1 FMan ucode image on the SD card.  Obtaining DPAA1 FMan ucode image Clone the qoriq-fm-ucode repository. $ git clone https://github.com/NXP/qoriq-fm-ucode.git $ cd qoriq-fm-ucode $ git checkout LSDK-<LSDK version>. For example, $ git checkout LSDK-19.06 The prebuilt FMan ucode images, fsl_fman_ucode_ls1043_r1.1_<microcode version>.bin, are at qoriq-fm-ucode/. In the binary file, ls1043_r1.1 refers to the LS1043A silicon revision 1.1. See qoriq-fm-ucode/readme for a description of the ucode version numbers. SD card start block number for DPAA1 FMan ucode image Image  SD card start block number DPAA1 FMan ucode image 0x04800 = 18432 Refer Flash layout for new boot flow with TF-A for complete listing of the SD card start block numbers for all LSDK firmware images. Programming DPAA1 FMan ucode image to SD card Option 1: Load image on SD card plugged into Linux host via dd command Plug the SD card into the Linux host. Run the following command on the Linux host: $ sudo dd if=fsl_fman_ucode_ls1043_r1.1_<ucode version>.bin of=/dev/sdX bs=512 seek=18432 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0.                                                   Remove the SD card from the Linux host machine. Plug the SD card into LS1043ARDB and boot the board to Ubuntu using the SD card. You can boot the board using the SD card either by: setting the switches: SW3[1:8] = 10110011, SW4 [1:8] =00100000 , SW5 [1:8] = 00100010, or boot switching to SD card => cpld reset sd In boot log, you’ll see: Board: LS1043ARDB, boot from SD You can check the following code line in the boot log to confirm that the DPAA1 FMan ucode image on the SD card is updated. Fman1: Uploading microcode version 106.4.18 If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored on the SD card. Option 2: Load image on SD card plugged into board from the TFTP server Boot LS1043ARDB from NOR flash. Ensure that the switches are set to boot the board from NOR bank 0. For booting from NOR bank 0, switch settings are as follows: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from NOR bank 0: => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the Ethernet interface connected to the TFTP server. See LS1043ARDB Ethernet and FMC port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux.                        => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime FM1@DTSEC4 => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact FM1@DTSEC4 Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using FM1@DTSEC4 device host 192.168.1.1 is alive Load FMan ucode image from the TFTP server Flash the FMan ucode image: => tftp 0xa0000000 fsl_fman_ucode_ls1043_r1.1_<ucode version>.bin Program the FMan ucode image to SD card: => mmc write 0xa0000000 0x04800 <blk_cnt> Address  0x04800 is the SD card block number for the FMan ucode image.  ReferFlash layout for new boot flow with TF-A for the complete flash memory layout. Here, blk_cnt refers to number of blocks in SD card that need to be written as per the file size. For example, when you load FMan ucode from the TFTP server, if the bytes transferred is 37560 (92b8 hex), then blk_cnt is calculated as "37560/512 = 73 (49 hex)" + "few sectors for rounding up so that last block is not missed". So, if you round up by 5 (5 hex) sectors, for this example, mmc write command will be: => mmc write 0xa0000000 0x04800 4E You can boot the board using the SD card either by: setting the switches: SW3[1:8] = 10110011, SW4 [1:8] =00100000 , SW5 [1:8] = 00100010, or boot switching to SD card => cpld reset sd In boot log, you’ll see: Board: LS1043ARDB, boot from SD You can check the following code line in the boot log to confirm that the DPAA1 FMan ucode image on the SD card is updated. Fman1: Uploading microcode version 106.4.18 If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored on the SD card.
View full article
This how-to topic is applicable only to LSDK 18.09 and older releases. For LSDK 18.12 and newer releases, refer LS1088ARDB-PB - How to deploy TF-A binaries on SD card. Follow these steps to update U-Boot binary on the SD card.  Prerequisites  Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.06 or LSDK 18.09 U-Boot binary.   Compiling U-Boot binary Clone the u-boot repository. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot.git $ cd u-boot $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-18.09 LSDK-18.09  $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-linux-gnu- $ make distclean Execute appropriate defconfig file: For LS1088ARDB: $ make ls1088ardb_sdcard_qspi_defconfig For LS1088ARDB-PB: $ make ls1088ardb_pb_sdcard_qspi_defconfig If required, make changes to the U-Boot files. $ make If the make command shows the error "*** Your GCC is older than 6.0 and is not supported", ensure that you are using Ubuntu 18.04 64-bit version for building LSDK 18.06 or LSDK 18.09 U-Boot binary.  The compiled U-Boot image, u-boot-with-spl.bin, is available at u-boot/. SD card start block number for U-Boot binary Image  SD card start block number U-Boot binary 0x00800 = 2048 Refer 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.bin of=/dev/sdX bs=512 seek=2048 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/ sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically mmcblk0.    Remove the SD card from the Linux host machine. On the LS1088ARDB/LS1088ARDB-PB, ensure that the switches are set to boot the board from SD card.  For booting from SD card, SW1[1:8] + SW2[1] = 0010_0000_0  Plug the SD card into the board and boot the board to Ubuntu. If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored on the SD card.
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images on the SD card.    Compiling MC firmware Clone the qoriq-mc-binary repository. $ git clone https://github.com/NXP/qoriq-mc-binary.git $ cd qoriq-mc-binary/ls1088a/ $ git checkout LSDK-<LSDK version>. For example, $ git checkout LSDK-18.09 The prebuilt MC firmware image, mc_10.10.0_ls1088a_20180814.itb, is available at qoriq-mc-binary/ls1088a/. Note that the exact name of the MC firmware image may vary depending on the release version used.                  Compiling DPC and DPL images Clone the mc-utils repository and compile the DPC and DPL images. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils $ cd mc-utils/ $ git checkout LSDK-<LSDK version>. For example, $ git checkout LSDK-18.09 If required, make changes to the DPC and DPL files. $ make -C config/ The compiled dpc.0x1D-0x0D.dtb and dpl-eth.0x1D_0x0D.dtb images are available at /mc-utils/config/ls1088a/RDB/. Note that the exact name of the DPL and DPC images may vary depending on the release version used.             SD card start block number for MC, DPL, and DPC images Image  SD card start block number DPAA2 MC firmware 0x05000 = 20480 DPAA2 DPL  0x06800 = 26624 DPAA2 DPC 0x07000 = 28672 Refer the Layerscape Software Development Kit <version> Documentation for complete listing of the SD card start block numbers for all LSDK firmware images.    Programming MC, DPC, and DPL images to SD card Plug the SD card into the Linux host. Run the following commands on the Linux host: To update MC firmware: $ sudo dd if=mc_10.10.0_ls1088a_20180814.itb of=/dev/sdX bs=512 seek=20480 conv=fsync To update DPL image: $ sudo dd if=dpl-eth.0x1D_0x0D.dtb of=/dev/sdX bs=512 seek=26624 conv=fsync To update DPC image: $ sudo dd if=dpc.0x1D-0x0D.dtb of=/dev/sdX bs=512 seek=28672 conv=fsync Use the command cat /proc/partitions to see a list of devices and their sizes to make sure that the correct device names have been chosen. The SDHC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced. If your Linux host machine supports read/write SDHC card directly without an extra SDHC card reader device, the device name of SDHC card is typically  mmcblk0.   Remove the SD card from the Linux host machine. On the LS1088ARDB/LS1088ARDB-PB, ensure that the switches are set to boot the board from the SD card.  For booting from SD card, SW1[1:8] + SW2[1] = 0010_0000_0  Plug the SD card into the board and boot the board to Ubuntu. If U-Boot does not find LSDK on the SD card, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored on the SD card.
View full article
Follow these steps to update the DPAA2 MC firmware, DPC, and DPL images in QSPI NOR flash. In LS2088ARDB, Boot option switching between parallel NOR boot and QSPI NOR boot cannot be performed using commands. Boot option switching can be done by adjusting DIP switch settings and jumper settings on the Reference Design Board. For details, see Layerscape Software Development Kit User Guide. Obtaining MC firmware Clone the qoriq-mc-binary repository. $ git clone https://github.com/NXP/qoriq-mc-binary.git $ cd qoriq-mc-binary/ls2088a/ $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-19.09 LSDK-19.09 The prebuilt MC firmware image, mc_10.18.0_ls2088a.itb, is available at /qoriq-mc-binary/ls2088a/. Note that the name of the MC firmware image may vary depending on the release version used.  Obtaining DPC and DPL images Clone the mc-utils repository and compile the DPC and DPL images. $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils $ cd mc-utils $ git checkout -b <new branch name> <LSDK tag>. For example, $ git checkout -b LSDK-19.09 LSDK-19.09 If required, make changes to the DPC and DPL files. $ make -C config/ The compiled dpc.0x2A_0x41.dtb and  dpl-eth.0x2A_0x41.dtb images are available at /mc-utils/config/ls2088a/RDB/. Note that the name of the DPC and DPL images may vary depending on the release version used.  Flashing MC firmware, DPC, and DPL images to QSPI NOR flash Boot LS2088ARDB from QSPI. Ensure that the switches and jumpers are set to boot the board from QSPI. For booting from QSPI: SW5[1:8] = 1111 1111 SW3[1:8] = 0011 0001 SW4[1:8] = 0011 1111 SW6[1:8] = 1111 1111 SW7[1:8] = 0100 1010 SW9[1:8] = 0100 0100 SW8[1:8] = 0111 1111 In addition to the above switch settings, make sure the following jumper settings are correct (for RDB Rev E and later).  J8 = 1-2 for QSPI boot, via onboard QSPI flash J8 = 2-3 for QSPI boot, via QSPI emulator J14 = 2-3, for QSPI boot For LS2088ARDB, in boot log, you'll see: Board: LS2088AE Rev1.1-RDB, Board Arch: V0, Board version: A, boot from vBank: 0 Option 1: Load image from the TFTP server Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC1@xgmii, DPMAC2@xgmii, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@xgmii, DPMAC6@xgmii, DPMAC7@xgmii, DPMAC8@xgmii    Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1>    Set ethact and ethprime as the Ethernet interface connected to the TFTP server. See LS2088ARDB Ethernet port mappingfor the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC1@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC1@xgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC1@xgmii device host 192.168.1.1 is alive Load images from a TFTP server Flash MC firmware to QSPI NOR flash: => sf probe 0:0 => tftp 0xa0000000 mc_10.18.0_ls2088a.itb => print filesize => sf erase 0x00A00000 +$filesize && sf write 0xa0000000 0x00A00000 $filesize Address 0x00A00000 is the location of MC firmware in QSPI NOR flash. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image to QSPI NOR flash: => sf probe 0:0 => tftp 0xa0000000 dpl-eth.0x2A_0x41.dtb => print filesize  => sf erase 0x00D00000 +$filesize && sf write 0xa0000000 0x00D00000 $filesize Address 0x00D00000 is the location of DPL image in alternate NOR bank. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPC image to QSPI NOR flash: => sf probe 0:0 => tftp 0xa0000000 dpc.0x2A_0x41.dtb => print filesize  => sf erase 0x00E00000 +$filesize && sf write 0xa0000000 0x00E00000 $filesize Address 0x00E00000 is the location of DPC image in alternate NOR bank. Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Reset from QSPI NOR flash: => reset Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored in QSPI NOR flash. Option 2: Load images from partition on mass storage device (SD, USB, or SATA) Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on the storage device => ls mmc <device:partition> For example: => ls mmc 0:2 Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 If the ls command fails to run, check that U-Boot in QSPI NOR flash supports the command by typing ls at the U-Boot prompt: => ls ls - Lists files in a directory (default) Usage: ls <interface> [<dev[:part]> [directory]] - Lists files in directory [directory] of partition [part] on device type [interface] and instance [dev]. If U-Boot does not support this command, then update the composite firmware image in QSPI NOR flash. For steps to update composite firmware image in QSPI NOR flash, see Layerscape Software Development Kit User Guide . Use the following command if the SD card is formatted/created using LSDK flex-installer command: => load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: =>load mmc 0:2 $load_addrmc_10.18.0_ls2088a.itb Use the following command if the SD card is formatted/created on a Windows PC: => fatload <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: =>fatload mmc 0:2 $load_addrmc_10.18.0_ls2088a.itb Use the following command if the SD card is formatted/created on a Linux PC: => ext2load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]] For example: =>ext2load mmc 0:2 $load_addrmc_10.18.0_ls2088a.itb Also note that LSDK flex-installer command puts the images on the IInd partition, so 0:2 is used in the load command. If the SD card is formatted on Windows PC or Linux PC for single partition only, then 0 should be used instead of 0:2 in the fatload/ext2load command. Flash MC firmware: Program QSPI NOR flash: => sf probe 0:0 Load MC firmware image from the storage device => load mmc 0:2 80000000 <mc firmware> For example: => load mmc 0:2 80000000 mc_10.18.0_ls2088a.itb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program MC firmware image to QSPI NOR flash: => sf erase 0x00A00000 +$filesize && sf write 0x80000000 0x00A00000 $filesize Address 0x00A00000 is the location of MC firmware in QSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Program QSPI NOR flash: => sf probe 0:0 Load DPL image from the storage device => load mmc 0:2 80000000 <dpl image> For example: => load mmc 0:2 80000000 dpl-eth.0x2A_0x41.dtb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program DPL image to QSPI NOR flash: => sf erase 0x00D00000 +$filesize && sf write 0x80000000 0x00D00000 $filesize Address 0x00D00000 is the location of DPL image in QSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Flash DPL image: Flash DPC image: Program QSPI NOR flash: => sf probe 0:0 Load DPC image from the storage device => load mmc 0:2 80000000 <dpc image> For example: => load mmc 0:2 80000000 dpc.0x2A_0x41.dtb => print filesize Or => load usb 0:2 80000000 <image name> => print filesize Or => load scsi 0:2 80000000 <image name> => print filesize Program DPC image to QSPI NOR flash: => sf erase 0x00E00000 +$filesize && sf write 0x80000000 0x00E00000 $filesize Address 0x00E00000 is the location of DPC image in QSPI NOR flash.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Reset and boot from QSPI NOR flash: => reset Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_tiny.itb stored in QSPI NOR flash.
View full article
Follow these steps to update the composite firmware image in QSPI NOR flash. qixis_reset boots the board from QSPI NOR flash0 and qixis_reset altbank boots the board from QSPI NOR flash1. sf probe 0:1 means that the alternate bank will be written to. So, if the board boots from QSPI NOR flash0 and sf probe 0:1 is entered at the U-Boot prompt, the commands that follow will program QSPI NOR flash1. Obtaining composite firmware image  LSDK includes pre-built firmware images for QSPI NOR flash. The LSDK composite firmware includes RCW+PBI, boot loader firmware, DPAA1 FMan ucode, QE/uQE firmware, Ethernet PHY firmware, DPAA2 MC firmware, DPAA2 DPL, DPAA2 DPC, device tree, and lsdk_linux_<arch>.itb images. Refer the Layerscape Software Development Kit <version> Documention for the complete flash memory layout of the images.  On a Linux host machine, download composite firmware image from nxp.com.    $ wget http://www.nxp.com/lgfiles/sdk/lsdk<lsdk_version>/firmware_<RDB_name>_uboot_qspiboot.img  For example: For LS1088ARDB:  $ wget http://www.nxp.com/lgfiles/sdk/lsdk1809/firmware_ls1088ardb_uboot_qspiboot.img  For LS1088ARDB-PB:  $ wget https://www.nxp.com/lgfiles/sdk/lsdk1809/firmware_ls1088ardb_pb_uboot_qspiboot.img Flashing composite firmware images to QSPI NOR flash Boot LS1088ARDB/LS1088ARDB-PB from QSPI. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI , SW1[1:8] + SW2[1] = 0011_0001_X Boot from QSPI NOR flash0: => qixis_reset For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:0 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:0 Composite firmware image can be loaded to the LS1088ARDB/LS1088ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from the TFTP server   Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. DPMAC1@xgmii, DPMAC2@xgmii, DPMAC3@qsgmii, DPMAC4@qsgmii, DPMAC5@qsgmii, DPMAC6@qsgmii, DPMAC7@qsgmii, DPMAC8@qsgmii, DPMAC9@qsgmii, DPMAC10@qsgmii Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LS1088ARDB/LS1088RDB-PB Ethernet port mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@qsgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@qsgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@qsgmii device host 192.168.1.1 is alive   Load U-Boot image from the TFTP server Program QSPI NOR flash1: => sf probe 0:1 Flash LS1088ARDB or LS1088ARDB-PB composite firmware image: For LS1088ARDB: => tftp 0xa0000000 firmware_ls1088ardb_uboot_qspiboot.img => print filesize filesize=2351db0 For LS1088ARDB-PB: => tftp 0xa0000000 firmware_ls1088ardb_pb_uboot_qspiboot.img => print filesize filesize=2351db0 Program composite firmware image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Boot from QSPI NOR flash1: => qixis_reset altbank For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:1 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:1 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash. Option 2: Load image from partition on mass storage device (SD, USB, or SATA) Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on storage device => ls mmc <device:partition> For example: => ls mmc 0:2 Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 Program QSPI NOR flash1: => sf probe 0:1 Load composite firmware image from the storage device => load mmc 0:2 a0000000 <image name> => print filesize For example, for LS1088ARDB: => load mmc 0:2 a0000000 firmware_ls1088ardb_uboot_qspiboot.img => print filesize filesize=235bd40 For example, for LS1088ARDB-PB: => load mmc 0:2 a0000000 firmware_ls1088ardb_pb_uboot_qspiboot.img => print filesize filesize=2351db0 Or => load usb 0:2 a0000000 <image name> => print filesize Or => load scsi 0:2 a0000000 <image name> => print filesize Program image to QSPI NOR flash: => sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize  Boot from QSPI NOR flash1: => qixis_reset altbank In boot log, you’ll see: For LS1088ARDB, in boot log, you’ll see: Board: LS1088A-RDB, Board Arch: V1, Board version: C, boot from QSPI:1 For LS1088ARDB-PB, in boot log, you'll see: Board: LS1088ARDB-PB, Board Arch: V1, Board version: A, boot from QSPI:1 Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash.
View full article
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
This document introduces basic concept of Power Management, LS1028 RCW configuration to enable GPIO, Linux Kernel source and device tree modification to support GPIO wakeup, Kernel configuration to enable sleep feature and GPIO wakeup driver, export GPIO pin and enable interrupt, Order system to sleep and trigger GPIO interrupt to wake up the system.
View full article
To boot a Layerscape board with an empty DPL file: Create an empty DPL file, content.dts. For example: /dts-v1/; / { dpl-version = <0x0000000a>; containers { dprc@1 { compatible = "fsl,dprc"; parent = "none"; options = "DPRC_CFG_OPT_SPAWN_ALLOWED", "DPRC_CFG_OPT_ALLOC_ALLOWED", "DPRC_CFG_OPT_IRQ_CFG_ALLOWED"; objects { obj_set@dpmcp { type = "dpmcp"; ids = <0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd>; }; }; }; }; objects { dpmcp@1 { compatible = "fsl,dpmcp"; }; dpmcp@2 { compatible = "fsl,dpmcp"; }; dpmcp@3 { compatible = "fsl,dpmcp"; }; dpmcp@4 { compatible = "fsl,dpmcp"; }; dpmcp@5 { compatible = "fsl,dpmcp"; }; dpmcp@6 { compatible = "fsl,dpmcp"; }; dpmcp@7 { compatible = "fsl,dpmcp"; }; dpmcp@8 { compatible = "fsl,dpmcp"; }; dpmcp@9 { compatible = "fsl,dpmcp"; }; dpmcp@10 { compatible = "fsl,dpmcp"; }; dpmcp@11 { compatible = "fsl,dpmcp"; }; dpmcp@12 { compatible = "fsl,dpmcp"; }; dpmcp@13 { compatible = "fsl,dpmcp"; }; dpmcp@14 { compatible = "fsl,dpmcp"; }; dpmcp@15 { compatible = "fsl,dpmcp"; }; dpmcp@16 { compatible = "fsl,dpmcp"; }; dpmcp@17 { compatible = "fsl,dpmcp"; }; dpmcp@18 { compatible = "fsl,dpmcp"; }; dpmcp@19 { compatible = "fsl,dpmcp"; }; }; }; ​ Note: There is no network object capable of receiving Ethernet frames in the DPL file. You can create more dpmcps if the number of objects that will be created dynamically is high. Generate the DPL file using content.dts. dtc -I dts -O dtb -o dpl.dtb content.dts​ Flash the DPL file, dpl.dtb to the alternate bank.  tftp 0x80000000 dpl.dtb; i2c mw 66 50 20;sf probe; sf erase 0x00D00000 +$filesize && sf write 0x80000000 0x00D00000 $filesize​ Boot the board. After the board boots, create a dpmac. (Make sure you create a DPMAC that is valid based on the selected SERDES protocol configured by the RCW). restool dpmac create --mac-id=3​ Probe the dpmac driver. restool dprc assign dprc.1 --object=dpmac.3 --plugged=1​ Create a network interface. ls-addni dpmac.3​ Save contents as content_new.dts. restool dprc generate-dpl dprc.1 > content_new.dts​    
View full article
On successful probing of the DSA Felix switch, each available front panel switch port should have a network device interface attached with the swpX name format. The ip link show command uses the swpX@enoY name format to also indicate the associated master Ethernet interface for the DSA switch port, which corresponds to an internal ENETC interface, usually the eno2 (Port2) for the LS1028A SoC. LS1028 Interface naming in Linux Single port mode Bridge mode
View full article
Follow these steps to update the DPAA1 FMan ucode image in NOR flash.  cpld reset boots the board from NOR bank 0 and cpld reset altbank boots the board from the NOR bank  4.  0x64000000 is the location of RCW in the alternate NOR bank, that is NOR bank 4.  0x60000000 is the location of RCW in the NOR bank 0.   Obtaining DPAA1 FMan ucode image Clone the qoriq-fm-ucode repository. $ git clone https://github.com/NXP/qoriq-fm-ucode.git $ cd qoriq-fm-ucode $ git checkout LSDK-<LSDK version>. For example, $ git checkout LSDK-19.06 The prebuilt FMan ucode images, fsl_fman_ucode_ls1043_r1.1_<microcode version>.bin, are at qoriq-fm-ucode/. In the binary file, ls1043_r1.1 refers to the LS1043A silicon revision 1.1. See qoriq-fm-ucode/readme for a description of the ucode version numbers. Programming FMan ucode image to NOR flash FMan ucode image can be loaded to LS1043ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA). Option 1: Load image from the TFTP server Boot LS1043ARDB from NOR flash. Ensure that the switches are set to boot the board from NOR bank 0. For booting from NOR bank 0, switch settings are as follows: SW3[1:8] = 10110011 SW4[1:8] = 00010010 SW5[1:8] = 10100010 Boot from NOR bank 0: => cpld reset For LS1043ARDB, in boot log, you'll see: Board: LS1043ARDB, boot from vBank 0 Set up Ethernet connection When board boots up, U-Boot prints a list of enabled Ethernet interfaces. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5 Set server IP address to the IP address of the host machine on which you have configured the TFTP server.  => setenv serverip <ipaddress1> Set ethact and ethprime as the Ethernet interface connected to the TFTP server. See LS1043ARDB Ethernet and FMC port mapping for the mapping of Ethernet port names appearing on the chassis front panel 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 <ipaddress> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using FM1@DTSEC4 device host 192.168.1.1 is alive Load FMan ucode image from the TFTP server Load FMan ucode image in DDR memory: => tftp a0000000 <path to FMan ucode>/fsl_fman_ucode_ls1043_r1.1_<ucode version>.bin Program the FMan ucode image to NOR bank 4: => erase 64900000 +$filesize && cp.b a0000000 64900000 $filesize Address  0x64900000 is the location of the FMan ucode image in NOR bank 4.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from NOR bank 4 and press Enter to stop the autoboot: => cpld reset altbank In boot log, you’ll see: Board: LS1043ARDB, boot from vBank 4 You can check the following code line in the boot log to confirm that the DPAA1 FMan ucode image in NOR bank 4 is updated. Fman1: Uploading microcode version 106.4.18 Ensure that SD card, USB flash drive, or SCSI hard disk installed with NXP LSDK userland is plugged into the board to boot the board to the LSDK userland.  => cpld reset altbank NXP LSDK 1906 main localhost login: root [ OK ] Stopped Serial Getty on ttyS0. [ OK ] Started Serial Getty on ttyS0. NXP LSDK 1906 main localhost login: root Password: Last login: Fri Feb 22 04:29:12 UTC 2019 on ttyS0 Welcome to NXP LSDK 1906 main (GNU/Linux 4.19.46 aarch64) * Support: https://www.nxp.com/lsdk * Documentation: https://lsdk.github.io/document * Licensing: https://lsdk.github.io/eula root@localhost:~# Option 2: Load image from partition on mass storage device (SD, USB, or SATA) 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 Select mass storage device to use. => mmc rescan => mmc info Or => usb start => usb info Or => scsi scan => scsi info Optional – List files on storage device => ls mmc <device:partition> For example: => ls mmc 0:3 System Volume Information/ 32604 fsl_fman_ucode_ls1043_r1.1_106_4_18.bin 1 file(s), 1 dir(s) Or => ls usb <device:partition> For example: => ls usb 0:1 Or => ls scsi <device:partition> For example: => ls scsi 0:2 If the ls command fails to run, check that U-Boot in NOR bank 0 supports the command by typing ls at the U-Boot prompt: => ls ls - lists files in a directory (default) Usage: ls <interface> [<dev[:part]> [directory]] - Lists files in directory [directory] of partition [part] on device type [interface] and instance [dev]. If U-Boot does not support this command, then update the composite firmware image in NOR bank 0. For steps to update composite firmware image in NOR flash, see Layerscape Software Development Kit User Guide. Load FMan ucode image from the storage device. => load mmc <device:partition> 80000000 <image name> => print filesize For example: => load mmc 0:3 80000000 fsl_fman_ucode_ls1043_r1.1_106_4_18.bin 32604 bytes read in 18 ms (1.8 MiB/s) => print filesize filesize=7f5c Or => load usb <device:partition> 80000000 <image name> => print filesize Or => load scsi <device:partition> 80000000 <image name> => print filesize Program the FMan ucode image to NOR bank 4: => erase 64900000 +$filesize && cp.b 80000000 64900000 $filesize Address  0x64900000 is the location of the FMan ucode image in NOR bank 4.  Refer Flash layout for new boot flow with TF-A for the complete flash memory layout. Boot from NOR bank 4 and press Enter to stop the autoboot: => cpld reset altbank In boot log, you’ll see: Board: LS1043ARDB, boot from vBank 4 You can check the following code line in the boot log to confirm that the DPAA1 FMan ucode image in NOR bank 4 is updated. Fman1: Uploading microcode version 106.4.18 Ensure that SD card, USB flash drive, or SCSI hard disk installed with NXP LSDK userland is plugged into the board to boot the board to the LSDK userland.  => cpld reset altbank NXP LSDK 1906 main localhost login: root [ OK ] Stopped Serial Getty on ttyS0. [ OK ] Started Serial Getty on ttyS0. NXP LSDK 1906 main localhost login: root Password: Last login: Fri Feb 22 04:29:12 UTC 2019 on ttyS0 Welcome to NXP LSDK 1906 main (GNU/Linux 4.19.46 aarch64) * Support: https://www.nxp.com/lsdk * Documentation: https://lsdk.github.io/document * Licensing: https://lsdk.github.io/eula root@localhost:~#
View full article
This topic shows steps to customize LITB by using a different kernel image instead of the existing kernel image. Browse to the FlexBuild installation directory. Modify the kernel image in linux_arm64_LS.its. $ vi configs/linux/linux_arm64_LS.its Save the changes done in the file. Generate LITB using flex-builder. $ source setup.env $ flex-builder -i mkitb -r <distro_type>:<distro_scale> -a <arch> For example: $ source setup.env $ flex-builder -i mkitb -r ubuntu:main -a arm64 INSTRUCTION: mkitb DISTRO TYPE: ubuntu DISTRO SCALE: main .... .... /home/flexbuild_lsdk2004/build/images/lsdk2004_ubuntu_main_LS_arm64.itb [Done]   Note: To create .itb file directly from .its file, run this command: mkimage -f <xyz.its> <xyz.itb> Connect to the board console via terminal and run following commands at U-boot to boot the board with customized LITB. => ping $serverip Using e1000#0 device host 192.168.3.1 is alive => Using e1000#0 device host 192.168.3.1 is alive => tftp 0xa0000000 lsdk2004_ubuntu_main_LS_arm64.itb Using e1000#0 device TFTP from server 192.168.3.1; our IP address is 192.168.3.49 Filename 'lsdk2004_ubuntu_main_LS_arm64.itb'. Load address: 0xa0000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# #################################### 9.8 MiB/s done Bytes transferred = 683506200 (28bd7a18 hex) => bootm 0xa0000000#lx2160ardb ## Loading kernel from FIT Image at a0000000 ... Using 'lx2160ardb' configuration Trying 'kernel' kernel subimage Description: ARM64 Kernel Created: 2021-02-03 6:01:29 UTC Type: Kernel Image Compression: gzip compressed Data Start: 0xa00000d0 Data Size: 14086432 Bytes = 13.4 MiB   Check timestamp in boot log to ensure that the board is booted with the updated kernel image in the customized LITB.   Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083] [ 0.000000] Linux version 5.4.3 (test@Ubuntu-18) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP PREEMPT Wed Feb 3 00:04:09 IST 2021 [ 0.000000] Machine model: NXP Layerscape LX2160ARDB [ 0.000000] earlycon: pl11 at MMIO32 0x00000000021c0000 (options '') [ 0.000000] printk: bootconsole [pl11] enabled [ 0.000000] efi: Getting EFI parameters from FDT:  
View full article
The attached patch is to support DDR3L in LS1043A. The SDK version is Linux-LS1043A-SDK-V0.5-SOURCE-20151223-yocto.iso. Not SDK2.0. The DDR3L part number is two Winbond W632GU6KB(16M x 8 banks x 16 bits DDR3L SDRAM).
View full article
  Note: MCFBA{L/H} that is used to dump the MC log buffer is valid only after the following command is executed: fsl_mc start mc  ${mc_addr} ${dpc_addr} Run the above command first, then MCFBA contents will be valid. To display the MC log buffer in U-Boot for debug purpose, when MC console is not available: Determine the MC firmware base. At the U-Boot prompt, perform md at 0x8340020 (this is MCFBA{L/H}) => md 0x8340020 10 08340020: e0000006 00000027 00060000 00000000 ....'........... 08340030: 00000000 00000000 00000000 00000000 ................ 08340040: 00000000 00000000 00000000 00000000 ................ 08340050: 00000000 00000000 00000000 00000000 ................ The value at 08340024 is the MCFBAH address. In this case, it is 00000027. The value at 08340020 is the MCFBAL address. In this case, it is e0000000. So you can build the MCFBA base address as:  0x27e0000000. Run the following command to start the MC if it is not booted already. run mcinitcmd Dump the log buffer structure at offset 0x01000000 into the MC firmware base 0x27e1000000 (as per the example). md 27e1000000 27e1000000: 4d430100 00000000 01400000 00300000 ..CM......@...0. 27e1000010: 000000b1 00000000 00000000 00000000 ................ 27e1000020: 00000000 00000000 00000000 00000000 ................ 27e1000030: 00000000 00000000 00000000 00000000 ................ 4d430100 = magic number, 400000 = log buffer offset, 00300000 = log buffer length Dump the content of the log buffer. md 27e1400000   The output size can be increased by specifying the number of objects.  md 27e1400000 <num> For example: md 27e1400000 20 In case that the log buffer has more information, you can extend the output of md by replacing 20 with a greater value.          
View full article
boot loader requirements to boot Kernel ARM64 Virtual Memory Layout ARM64 IRQ Vectors Setup FDT Mapping ARM64 Kernel booting process        5.1 Prior to start_kernel              5.1.1__create_page_tables              5.1.2 __cpu_setup              5.1.3 __primary_switch       5.2 Start_kernel             5.2.1 Start_kernel -> setup_arch                     5.2.1.1 Start_kernel -> setup_arch -> setup_machine_fdt                     5.2.1.2 Start_kernel -> setup_arch -> paging_init / bootmem_init                     5.2.1.3 Start_kernel -> setup_arch -> psci_init             5.2.2 Start_kernel -> Rest_init                      5.2.2.1 Start_kernel -> Rest_init -> kernel_init
View full article
DPDK(Data Plane Development Kit) provides a simple, complete framework for fast packet processing in data plane applications. This IPsec security gateway application demonstrates the implementation of a security gateway using DPDK cryptodev framework with crypto protocol offloading support. This document introduces DPDK IPsec gateway application architecture, DPAA2 SEC driver and ipsec-secgw application implementation for crypto protocol offloading, running ipsec-secgw application on LS2088ARDB.
View full article