LX2160ARDB - How to update Linux kernel and device tree on eMMC card

Showing results for 
Search instead for 
Did you mean: 

LX2160ARDB - How to update Linux kernel and device tree on eMMC card

LX2160ARDB - How to update Linux kernel and device tree on eMMC card

Follow these steps to update the Linux kernel image and device tree on the eMMC card.

NOTE: Below steps are valid for both LX2160ARDB Rev 1.0 and Rev 2.0 revisions.

Compiling Linux kernel images and device tree


  1. On Linux host, clone the repository with Linux kernel image and device tree:

    $git clone https://source.codeaurora.org/external/qoriq/qoriq-components/linux

  2. $ cd Linux
  3. $ git checkout -b <new branch> <start point>
    • For example, $ git checkout -b LSDK-20.04-V5.4 LSDK-20.04-V5.4

    where LSDK-20.04-V5.4 refers to a tag in the format LSDK-<LSDK version>- V<kernel version>

  4. $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig lsdk.config

    If you want to make changes to the device tree, open and edit arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts

     You can make changes in the Linux kernel source code also if required.

  5. $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

The binary kernel image Image and compressed kernel image Image.gz are in arch/arm64/boot/.

The device tree blob fsl-lx2160a-rdb.dtb is in arch/arm64/boot/dts/freescale/.

Copying the compiled kernel images and device tree to the eMMC card


Step1: Copy the kernel images and device tree from Linux host machine

  1. Ensure the eMMC card available on the reference board.
  2. Check DIP switch settings for the desired boot type.
  3. Power on the board and let the board boot to LSDK distro prompt.
    • In case LSDK image is not deployed on the storage device on the board, execute the following command under U-Boot prompt to boot the board to TinyDistro.
      • For FlexSPI NOR boot: => run xspi_bootcmd
      • For SD/eMMC boot: => run sd_bootcmd
  4. Log in to LSDK distro as root/root or TinyDistro as “root”.
  5. Bring up a network interface with Linux host.
    • Dynamic IP address assignment: # udhcpc -i <port name in Tiny/LSDKDistro>

    • Static IP address assignment:

      # ifconfig <port name in Tiny/LSDKDistro> <IP address> netmask <netmask address> up

      For example: # ifconfig enp1s0 netmask up

  6.  Copy the Kernel, Kernel.gz images and device tree blob fsl-lx2160a-rdb.dtb from host machine.

# mkdir <destination folder>

# scp <user>@<ipaddress>:<file path>/<filename> <destination folder>

For example:

# mkdir /kernelfiles

# scp user1@ /kernelfiles


Step2: Copy the kernel image and device tree to the eMMC card

  1. sudo fdisk -l to list the disks that are accessible on board.
  2. Mount the eMMC card partition that contains Linux kernel images and device tree.
    • NOTE:
    • Use the command cat /proc/partitions to see the list of devices, their partitions along with their sizes to make sure that the correct device and partition name have been chosen.

    • The eMMC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced.

    • If your Linux host machine supports read/write eMMC card directly without an extra eMMC card reader device, the device name of eMMC card is typically mmcblk1.

    • In general, the Linux kernel images and device tree are stored in the second partition of the eMMC device (mmcblk1p2). For detail on storage layout on SD/eMMC/USB/SATA for LSDK images deployment, refer to section "LSDK memory layout and Userland" in

      Layerscape Software Development Kit User Guide.

    # sudo mkdir <mount_folder>

    # sudo mount /dev/sdX <mount_folder> 

    For example:

    # sudo mkdir /carddata

    # sudo mount /dev/mmcblk1p2 /carddata

  3. Replace Image, Image.gz, and fsl-lx2160a-rdb.dtb on the eMMC card with the new files copied in <destination folder> in the steps above.

    # sudo cp <destination folder>/Image <destination folder>/Image.gz <destination folder>/fsl-lx2160a-rdb.dtb <mount_location>

    For example: # sudo cp /kernelfiles/Image /kernelfiles/Image.gz /kernelfiles/fsl-lx2160a-rdb.dtb /carddata
  4. Unmount the card. for example: # sudo umount /dev/mmc1blk1p2
  5. Reboot the board. At U-Boot prompt, run the following command to boot the board to LSDK distro using eMMC card.

=> run bootcmd_mmc1

If U-Boot does not find LSDK on the eMMC card, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored on the eMMC card.



Version history
Revision #:
10 of 10
Last update:
‎10-21-2020 11:41 PM
Updated by: