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

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

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

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

Follow these steps to update the Linux kernel image and device tree for LX2160ARDB on an SD card. 

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

STEP 1: Compiling Linux kernel images and device tree

  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

  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/.

STEP2: Copying the compiled kernel images and device tree to the SD card

 

  1. Plug the SD card into the Linux host machine.
  2. sudo fdisk -l to list the disks that are accessible to the computer.
  3. Mount the SD card partition that contains Linux kernel images and device tree.
    1. sudo mkdir <mount_location>
    2. sudo mount /dev/sdX <mount_location>

    For example:

    $ sudo mkdir /carddata

    $ sudo mount /dev/mmcblk0p2 /carddata

     

    NOTE:

    • Use the command cat /proc/partitions to see the list of devices, their partitions along with their sizes to make sure that the correct device and partition name have been chosen.
    • The eMMC storage drive in the Linux PC is detected as /dev/sdX, where X is a letter such as a, b, c. Make sure to choose the correct device name, because data on this device will be replaced.
    • If your Linux host machine supports read/write SD card directly without an extra SD card reader device, the device name of SD card is typically mmcblk0.
    • In general, the Linux kernel images and device tree are stored in the second partition of the SD device (mmcblk0p2). For detail on storage layout on SD/eMMC/USB/SATA for LSDK images deployment, refer to section "LSDK memory layout and Userland" in

      Layerscape Software Development Kit User Guide.

  4. Replace Image, Image.gz, and fsl-lx2160a-rdb.dtb on the SD card with the new files compiled in the steps above.

    $ sudo cp /linux/arch/arm64/boot/Image /linux/arch/arm64/boot/Image.gz /linux/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dtb <mount_location>

    For example: $sudo cp /linux/arch/arm64/boot/Image /linux/arch/arm64/boot/Image.gz /linux/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dtb /carddata
  5. Unmount the card. For example: sudo umount /dev/mmcblk0p2
  6. Plug the SD card into LX2160ARDB and boot the board.
    • At U-Boot, run the following command to boot the board to LSDK distro using the SD card.

=> run bootcmd_mmc0

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

%3CLINGO-SUB%20id%3D%22lingo-sub-1135002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELX2160ARDB%20-%20How%20to%20update%20Linux%20kernel%20and%20device%20tree%20on%20SD%20card%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1135002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFollow%20these%20steps%20to%26nbsp%3Bupdate%20the%20Linux%20kernel%20image%20and%20device%20tree%20for%20LX2160ARDB%20on%20an%20SD%20card.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENOTE%3C%2FSTRONG%3E%3A%20Below%20steps%20are%20valid%20for%20both%20LX2160ARDB%20Rev%201.0%20and%20Rev%202.0%20revisions.%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1413546864%22%20id%3D%22toc-hId--500095122%22%3E%3CSTRONG%3ESTEP%201%3A%20Compiling%20Linux%20kernel%20images%20and%20device%20tree%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3EOn%20Linux%20host%2C%20clone%20the%20repository%20with%20Linux%20kernel%20image%20and%20device%20tree%3A%0A%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3E%24%26nbsp%3Bgit%20clone%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsource.codeaurora.org%2Fexternal%2Fqoriq%2Fqoriq-components%2Flinux%24%20cd%20linux%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fsource.codeaurora.org%2Fexternal%2Fqoriq%2Fqoriq-components%2Flinux%3C%2FA%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%24%20cd%20linux%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%24%20git%20checkout%20-b%20%3CNEW%20branch%3D%22%22%3E%20%3CSTART%20point%3D%22%22%3E%3C%2FSTART%3E%3C%2FNEW%3E%3C%2FFONT%3E%3C%2FSPAN%3E%0A%3CUL%3E%0A%3CLI%3E%0A%3CP%3E%3CSPAN%3EFor%20example%2C%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%20%3CSPAN%3E%24%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Egit%20checkout%20-b%20%3CSPAN%3ELSDK-20.04-V5.4%20LSDK-%3C%2FSPAN%3E%3CSPAN%3E20.04-V5.4%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CSPAN%3Ewhere%3C%2FSPAN%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3ELSDK-20.04-V5.4%3C%2FSPAN%3E%3C%2FFONT%3E%20%3CSPAN%3Erefers%20to%20a%20tag%20in%20the%20format%26nbsp%3B%3C%2FSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3ELSDK-%3CLSDK%20version%3D%22%22%3E-V%3CKERNEL%20version%3D%22%22%3E%3C%2FKERNEL%3E%3C%2FLSDK%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Emake%20ARCH%3Darm64%20CROSS_COMPILE%3Daarch64-linux-gnu-%20defconfig%20lsdk.config%3C%2FFONT%3E%3C%2FSPAN%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20want%20to%20make%20changes%20to%20the%20device%20tree%2C%20open%20and%20edit%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Earch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-lx2160a-rdb.dts%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3Emake%20ARCH%3Darm64%20CROSS_COMPILE%3Daarch64-linux-gnu-%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%3EThe%20binary%20kernel%20image%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3EImage%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3Eand%20compressed%20kernel%20image%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%20%3CSPAN%3EImage.gz%3C%2FSPAN%3E%26nbsp%3B%3C%2FFONT%3Eare%20in%3C%2FSPAN%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Earch%2Farm64%2Fboot%2F%3C%2FSPAN%3E%3C%2FFONT%3E.%3C%2FSPAN%3E%3CSPAN%3E%3CBR%20%2F%3EThe%20device%20tree%20blob%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Efsl-lx2160a-rdb%3C%2FSPAN%3E%3CSPAN%3E%3CSPAN%3E.dtb%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3Eis%20in%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Earch%2Farm64%2Fboot%2Fdts%2Ffreescale%2F%3C%2FSPAN%3E%3C%2FFONT%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1073965969%22%20id%3D%22toc-hId-1987417711%22%3E%3CSTRONG%3ESTEP2%3A%20Copying%20the%20compiled%20kernel%20images%20and%20device%20tree%20to%20the%20SD%20card%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3COL%3E%0A%3CLI%3EPlug%20the%20SD%20card%20into%20the%20Linux%20host%20machine.%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Esudo%20fdisk%20-l%20%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3Eto%20list%20the%20disks%20that%20are%20accessible%20to%20the%20computer%3C%2FSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EMount%20the%20SD%20card%20partition%20that%20contains%20Linux%20kernel%20images%20and%20device%20tree.%0A%3COL%3E%0A%3CLI%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Esudo%20mkdir%20%3CMOUNT_LOCATION%3E%3C%2FMOUNT_LOCATION%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Esudo%20mount%20%2Fdev%2FsdX%20%3CSPAN%3E%3CMOUNT_LOCATION%3E%3C%2FMOUNT_LOCATION%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-90px%22%20style%3D%22padding-left%20%3A%2090px%3B%22%20style%3D%22padding-left%20%3A%2090px%3B%22%3EFor%20example%3A%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-90px%22%20style%3D%22padding-left%20%3A%2090px%3B%22%20style%3D%22padding-left%20%3A%2090px%3B%22%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%24%26nbsp%3Bsudo%20mkdir%20%2Fcarddata%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-90px%22%20style%3D%22padding-left%20%3A%2090px%3B%22%20style%3D%22padding-left%20%3A%2090px%3B%22%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%24%26nbsp%3Bsudo%20mount%20%2Fdev%2Fmmcblk0p2%20%2Fcarddata%3C%2FFONT%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%3E%0A%3CP%20class%3D%22lia-indent-padding-left-90px%22%20style%3D%22padding-left%20%3A%2090px%3B%22%20style%3D%22padding-left%20%3A%2090px%3B%22%3E%3CU%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUse%20the%20command%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Ecat%20%2Fproc%2Fpartitions%3C%2FFONT%3E%20to%20see%26nbsp%3Bthe%20list%20of%20devices%2C%20their%20partitions%26nbsp%3Balong%20with%20their%26nbsp%3Bsizes%20to%20make%20sure%20that%20the%20correct%20device%20and%20partition%20name%20have%20been%20chosen.%3C%2FLI%3E%0A%3CLI%3EThe%20eMMC%20storage%20drive%20in%20the%20Linux%20PC%20is%20detected%20as%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%2Fdev%2FsdX%3C%2FFONT%3E%2C%20where%20X%20is%20a%20letter%20such%20as%20a%2C%20b%2C%20c.%20Make%20sure%20to%20choose%20the%20correct%20device%20name%2C%20because%20data%20on%20this%20device%20will%20be%20replaced.%3C%2FLI%3E%0A%3CLI%3EIf%20your%20Linux%20host%20machine%20supports%20read%2Fwrite%20SD%20card%20directly%20without%20an%20extra%20SD%20card%20reader%20device%2C%20the%20device%20name%20of%20SD%20card%20is%20typically%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Emmcblk0%3C%2FFONT%3E.%3C%2FLI%3E%0A%3CLI%3EIn%20general%2C%20the%20Linux%20kernel%20images%20and%20device%20tree%26nbsp%3Bare%20stored%20in%20the%26nbsp%3Bsecond%20partition%20of%20the%20SD%20device%20(%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Emmcblk0p2%3C%2FFONT%3E).%26nbsp%3BFor%20detail%20on%20storage%20layout%20on%20SD%2FeMMC%2FUSB%2FSATA%20for%20LSDK%20images%20deployment%2C%20refer%20to%20section%20%22LSDK%20memory%20layout%20and%20Userland%22%20in%0A%3CP%20align%3D%22LEFT%22%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fsoftware%2Fembedded-software%2Flinux-software-and-development-tools%2Flayerscape-software-development-kit%3ALAYERSCAPE-SDK%3F%26amp%3Btab%3DDocumentation_Tab%26amp%3Blinkline%3DUsers-Guide%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ELayerscape%20Software%20Development%20Kit%20User%20Guide%3C%2FA%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3EReplace%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3EImage%3C%2FSPAN%3E%3C%2FFONT%3E%2C%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3EImage.gz%3C%2FSPAN%3E%3C%2FFONT%3E%2C%20and%26nbsp%3B%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Efsl-lx2160a-rdb.dtb%3C%2FSPAN%3E%3C%2FFONT%3E%26nbsp%3Bon%20the%20SD%20card%20with%20the%20new%26nbsp%3Bfiles%20compiled%20in%20the%20steps%20above.%0A%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3E%24%20sudo%20cp%20%2Flinux%2Farch%2Farm64%2Fboot%2FImage%20%2Flinux%2Farch%2Farm64%2Fboot%2FImage.gz%20%2Flinux%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-lx2160a-rdb.dtb%20%3CSPAN%3E%3CMOUNT_LOCATION%3E%3C%2FMOUNT_LOCATION%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0AFor%20example%3A%26nbsp%3B%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3E%3CSPAN%3E%24sudo%20cp%20%2Flinux%2Farch%2Farm64%2Fboot%2FImage%20%2Flinux%2Farch%2Farm64%2Fboot%2FImage.gz%20%2Flinux%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Ffsl-lx2160a-rdb.dtb%20%2Fcarddata%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3EUnmount%20the%20card.%20For%20example%3A%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Esudo%20umount%20%2Fdev%2Fmmcblk0p2%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3EPlug%20the%20SD%20card%20into%20%3CSPAN%3ELX2160ARDB%20%3C%2FSPAN%3Eand%20boot%20the%20board.%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3EAt%20U-Boot%2C%20run%20the%20following%20command%20to%20boot%20the%20board%20to%20LSDK%20distro%20using%20the%20SD%20card.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FOL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-90px%22%20style%3D%22padding-left%20%3A%2090px%3B%22%20style%3D%22padding-left%20%3A%2090px%3B%22%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3D%26gt%3B%20run%20bootcmd_mmc0%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20U-Boot%20does%20not%20find%20LSDK%20on%20the%20SD%20card%2C%20it%20will%20boot%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%3CSPAN%3ETinyDistro%20from%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CSPAN%3Elsdk_linux_arm64_%20tiny.itb%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3CSPAN%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26nbsp%3B%3C%2FFONT%3Estored%26nbsp%3Bon%20the%20SD%20card.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎10-21-2020 11:28 PM
Updated by: