From ad923ea232ca60c999b9cc94faccc3b14c2fe3e0 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 26 Dec 2023 10:28:15 +0800
Subject: [PATCH] Update meta-igkboard to add igkboard-imx6ull support

---
 yocto/meta-igkboard/recipes-kernel/linux/linux-imx_%.bbappend |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/yocto/meta-igkboard/recipes-kernel/linux/linux-imx_%.bbappend b/yocto/meta-igkboard/recipes-kernel/linux/linux-imx_%.bbappend
index baa4abe..df6ddf9 100644
--- a/yocto/meta-igkboard/recipes-kernel/linux/linux-imx_%.bbappend
+++ b/yocto/meta-igkboard/recipes-kernel/linux/linux-imx_%.bbappend
@@ -5,8 +5,36 @@
 PATCHTOOL = "patch"
 
 KERNEL_DANGLING_FEATURES_WARN_ONLY="1"
+KERNEL_DTC_FLAGS = "-@"
+KERNEL_DTOVERLAY ?= ""
 
 do_copy_defconfig:append() {
-    cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${WORKDIR}/defconfig
-    cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${B}/.config
+	if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then
+        cp ${S}/arch/arm/configs/${MACHINE}_defconfig ${WORKDIR}/defconfig
+        cp ${S}/arch/arm/configs/${MACHINE}_defconfig ${B}/.config
+    else
+        cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${WORKDIR}/defconfig
+        cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${B}/.config
+    fi
+}
+
+do_compile:append() {
+    if [ -n "${KERNEL_DTC_FLAGS}" ]; then
+        export DTC_FLAGS="${KERNEL_DTC_FLAGS}"
+    fi
+
+    for dtbf in ${KERNEL_DTOVERLAY}; do
+        dtb=`normalize_dtb "$dtbf"`
+        oe_runmake $dtb CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
+    done
+}
+
+do_deploy:append(){
+    install -d ${DEPLOYDIR}/overlays
+
+	if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then
+        cp ${B}/arch/arm/boot/dts/${MACHINE}/*.dtbo ${DEPLOYDIR}/overlays
+#    else
+#        cp ${B}/arch/arm64/boot/dts/${MACHINE}/*.dtbo ${DEPLOYDIR}/overlays
+    fi
 }

--
Gitblit v1.9.1