How to fix FRDM-IMx93 Linux Kernel BSP

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

How to fix FRDM-IMx93 Linux Kernel BSP

How to fix FRDM-IMx93 Linux Kernel BSP

This guide provides step-by-step instructions for setting up and applying necessary patches to the Linux kernel for the FRDM-IMX93 development board. The process involves cloning the required repositories, applying patches, and preparing the kernel for customization and compilation.

 

Prerequisites

Required Software:

  • A Linux-based operating system (Ubuntu/Debian recommended).

  • Git installed (sudo apt install git).

  • Yocto dependencies:
    $ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file locales libacl1
    ​

 

Hardware:

  • FRDM-IMX93 Board
  • Sufficient storage space

 

1. Downloading the Repository

Start by downloading the necessary tools and repository. If the ~/bin folder does not already exist, create it:

$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH

 

2. Compile the Yocto SDK:

$: mkdir Yocto_SDK
$: cd Yocto_SDK
$: repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-scarthgap -m imx-6.6.36-2.1.0.xml
$: repo sync

$: MACHINE=imx93evk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland
$: bitbake imx-image-full -c populate_sdk

 

Run the generated .sh file to install the SDK:

sudo ./fsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93evk-toolchain-6.6-scarthgap.sh

 

The final .sh file is located in:

bld-xwayland/tmp/deploy/sdk/

 

3. Creating the Working Directory

First, create a dedicated directory for the kernel setup and navigate into it:

$ mkdir FRDM-IMX93-Kernel 
$ cd  FRDM-IMX93-Kernel

 

4. Cloning the Kernel patches

Retrieve the necessary kernel patches from the NXP repository:

$ git clone https://github.com/nxp-imx-support/meta-imx-frdm.git -b lf-6.6.36-2.1.0

 

5. Cloning the Kernel Repository (linux-imx repository)

Clone the kernel source of Yocto SDK that you built earlier:

$ git clone https://github.com/nxp-imx/linux-imx.git -b lf-6.6.36-2.1.0

6. Applying Kernel Patches

Apply the necessary patches to the kernel:

$ cd linux-imx/

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0001-gpio-pca953x-fix-pca953x_irq_bus_sync_unlock-race.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0002-arm64-dts-add-i.MX93-11x11-FRDM-basic-support.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0003-arm64-dts-add-imx93-11x11-frdm-mt9m114-dts.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0004-Add-DSI-Panel-for-imx93.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0005-Add-CTP-support-for-waveshare-panel.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0006-arm64-dts-add-imx93-11x11-frdm-tianma-wvga-panel-dts.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0007-arm64-dts-add-imx93-11x11-frdm-aud-hat-dts.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0008-arm64-dts-add-button-support.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0009-arm64-dts-add-imx93-11x11-frdm-ov5640-dts.patch

$ cd linux-imx/

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0010-arm64-dts-add-imx93-11x11-frdm-ld.dts-for-lpm.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0011-arm64-dts-add-pwm-function-of-the-LED.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0012-arm64-dts-add-imx93-11x11-frdm-8mic.dts.patch

$ git apply ../meta-imx-frdm/meta-imx-bsp/recipes-kernel/linux/linux-imx/0013-arm64-dts-add-imx93-11x11-frdm-lpuart.dts.patch

 

7. Customizing the Device Tree

Device trees can be modified or created based on your hardware setup.

 

Device Tree Locations:

arch/arm64/boot/dts/freescale/

 

If you create a new device tree, add it to the respective Makefile:

arch/arm64/boot/dts/freescale/Makefile

 

8. Setting Up the Cross-Compilation Environment

To prepare for kernel compilation, source the environment setup script. Assuming the Yocto SDK is installed in /opt, run:

 

EXAMPLE:

$ source /opt/fsl-imx-xwayland/6.6-scarthgap/environment-setup-armv8a-poky-linux

 

9. Configuring the Kernel

Make configuration adjustments as needed in the file:

arch/arm64/configs/imx_v8_defconfig

Use the appropriate configuration command:

$: make imx_v8_defconfig

 

10. Compiling Device Trees Only

To compile only the device tree files, run:

$: make dtbs

 

11. Compiling the Kernel

Finally, compile the kernel image using:

$ make -j $(nproc) 

 

The resulting kernel image will be located in:

arch/arm64/boot/

 

References:

IMX YOCTO PROJECT USERS GUIDE

IMX LINUX USERS GUIDE 

IMX REFERENCE MANUAL 

%3CLINGO-SUB%20id%3D%22lingo-sub-2035251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20fix%20FRDM-IMx93%20Linux%20Kernel%20BSP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2035251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CP%3EThis%20guide%20provides%20step-by-step%20instructions%20for%20setting%20up%20and%20applying%20necessary%20patches%20to%20the%20Linux%20kernel%20for%20the%20FRDM-IMX93%20development%20board.%20The%20process%20involves%20cloning%20the%20required%20repositories%2C%20applying%20patches%2C%20and%20preparing%20the%20kernel%20for%20customization%20and%20compilation.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EPrerequisites%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ERequired%20Software%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EA%20Linux-based%20operating%20system%20(Ubuntu%2FDebian%20recommended).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EGit%20installed%20(sudo%20apt%20install%20git).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EYocto%20dependencies%3A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20sudo%20apt%20install%20gawk%20wget%20git%20diffstat%20unzip%20texinfo%20gcc%20build-essential%20chrpath%20socat%20cpio%20python3%20python3-pip%20python3-pexpect%20xz-utils%20debianutils%20iputils-ping%20python3-git%20python3-jinja2%20python3-subunit%20zstd%20liblz4-tool%20file%20locales%20libacl1%0A%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EHardware%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFRDM-IMX93%20Board%3C%2FLI%3E%0A%3CLI%3ESufficient%20storage%20space%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E1.%20Downloading%20the%20Repository%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EStart%20by%20downloading%20the%20necessary%20tools%20and%20repository.%20If%20the%20~%2Fbin%20folder%20does%20not%20already%20exist%2C%20create%20it%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20mkdir%20~%2Fbin%20(this%20step%20may%20not%20be%20needed%20if%20the%20bin%20folder%20already%20exists)%0A%24%20curl%20https%3A%2F%2Fstorage.googleapis.com%2Fgit-repo-downloads%2Frepo%20%26gt%3B%20~%2Fbin%2Frepo%0A%24%20chmod%20a%2Bx%20~%2Fbin%2Frepo%0A%24%20export%20PATH%3D~%2Fbin%3A%24PATH%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E2.%20Compile%20the%20Yocto%20SDK%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%3A%20mkdir%20Yocto_SDK%0A%24%3A%20cd%20Yocto_SDK%0A%24%3A%20repo%20init%20-u%20https%3A%2F%2Fgithub.com%2Fnxp-imx%2Fimx-manifest%20-b%20imx-linux-scarthgap%20-m%20imx-6.6.36-2.1.0.xml%0A%24%3A%20repo%20sync%0A%0A%24%3A%20MACHINE%3Dimx93evk%20DISTRO%3Dfsl-imx-xwayland%20source%20.%2Fimx-setup-release.sh%20-b%20bld-xwayland%0A%24%3A%20bitbake%20imx-image-full%20-c%20populate_sdk%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERun%20the%20generated%20%3CSTRONG%3E.sh%3C%2FSTRONG%3E%20file%20to%20install%20the%20SDK%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Esudo%20.%2Ffsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93evk-toolchain-6.6-scarthgap.sh%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20final%20.sh%20file%20is%20located%20in%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ebld-xwayland%2Ftmp%2Fdeploy%2Fsdk%2F%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E3.%20Creating%20the%20Working%20Directory%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EFirst%2C%20create%20a%20dedicated%20directory%20for%20the%20kernel%20setup%20and%20navigate%20into%20it%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20mkdir%20FRDM-IMX93-Kernel%20%0A%24%20cd%20%20FRDM-IMX93-Kernel%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E4.%20Cloning%20the%20Kernel%20patches%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ERetrieve%20the%20necessary%20kernel%20patches%20from%20the%20NXP%20repository%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20git%20clone%20https%3A%2F%2Fgithub.com%2Fnxp-imx-support%2Fmeta-imx-frdm.git%20-b%20lf-6.6.36-2.1.0%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E5.%20Cloning%20the%20Kernel%20Repository%20(%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Elinux-imx%20repository%3C%2FA%3E)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EClone%20the%20kernel%20source%20of%20Yocto%20SDK%20that%20you%20built%20earlier%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20git%20clone%20https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx.git%20-b%20lf-6.6.36-2.1.0%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E6.%20Applying%20Kernel%20Patches%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EApply%20the%20necessary%20patches%20to%20the%20kernel%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20cd%20linux-imx%2F%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0001-gpio-pca953x-fix-pca953x_irq_bus_sync_unlock-race.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0002-arm64-dts-add-i.MX93-11x11-FRDM-basic-support.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0003-arm64-dts-add-imx93-11x11-frdm-mt9m114-dts.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0004-Add-DSI-Panel-for-imx93.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0005-Add-CTP-support-for-waveshare-panel.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0006-arm64-dts-add-imx93-11x11-frdm-tianma-wvga-panel-dts.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0007-arm64-dts-add-imx93-11x11-frdm-aud-hat-dts.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0008-arm64-dts-add-button-support.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0009-arm64-dts-add-imx93-11x11-frdm-ov5640-dts.patch%0A%0A%24%20cd%20linux-imx%2F%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0010-arm64-dts-add-imx93-11x11-frdm-ld.dts-for-lpm.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0011-arm64-dts-add-pwm-function-of-the-LED.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0012-arm64-dts-add-imx93-11x11-frdm-8mic.dts.patch%0A%0A%24%20git%20apply%20..%2Fmeta-imx-frdm%2Fmeta-imx-bsp%2Frecipes-kernel%2Flinux%2Flinux-imx%2F0013-arm64-dts-add-imx93-11x11-frdm-lpuart.dts.patch%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E7.%20Customizing%20the%20Device%20Tree%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EDevice%20trees%20can%20be%20modified%20or%20created%20based%20on%20your%20hardware%20setup.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EDevice%20Tree%20Locations%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Earch%2Farm64%2Fboot%2Fdts%2Ffreescale%2F%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIf%20you%20create%20a%20new%20device%20tree%2C%20add%20it%20to%20the%20respective%20%3CSTRONG%3EMakefile%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Earch%2Farm64%2Fboot%2Fdts%2Ffreescale%2FMakefile%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E8.%20Setting%20Up%20the%20Cross-Compilation%20Environment%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ETo%20prepare%20for%20kernel%20compilation%2C%20source%20the%20environment%20setup%20script.%20Assuming%20the%20Yocto%20SDK%20is%20installed%20in%20%2Fopt%2C%20run%3A%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EEXAMPLE%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20source%20%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fenvironment-setup-armv8a-poky-linux%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E9.%20Configuring%20the%20Kernel%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EMake%20configuration%20adjustments%20as%20needed%20in%20the%20file%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Earch%2Farm64%2Fconfigs%2Fimx_v8_defconfig%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EUse%20the%20appropriate%20configuration%20command%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%3A%20make%20imx_v8_defconfig%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E10.%20Compiling%20Device%20Trees%20Only%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ETo%20compile%20only%20the%20device%20tree%20files%2C%20run%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%3A%20make%20dtbs%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E11.%20Compiling%20the%20Kernel%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EFinally%2C%20compile%20the%20kernel%20image%20using%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20make%20-j%20%24(nproc)%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20resulting%20kernel%20image%20will%20be%20located%20in%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Earch%2Farm64%2Fboot%2F%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EReferences%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fuser-guide%2FIMX_YOCTO_PROJECT_USERS_GUIDE.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EIMX%20YOCTO%20PROJECT%20USERS%20GUIDE%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fuser-guide%2FIMX_LINUX_USERS_GUIDE.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EIMX%20LINUX%20USERS%20GUIDE%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX_REFERENCE_MANUAL.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EIMX%20REFERENCE%20MANUAL%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FLINGO-BODY%3E
100% helpful (1/1)
Version history
Last update:
‎02-07-2025 09:07 AM
Updated by: