From 632c1e3a66efe949ed0978f80d2aebccd0b17c93 Mon Sep 17 00:00:00 2001 From: Eric Lee Date: Mon, 13 Dec 2021 11:44:53 +0800 Subject: [PATCH] Yocto Gatesgarth meta layer support for SMARC-iMX8MQ, Initial Release --- conf/layer.conf | 8 +- conf/machine/include/smarc-common.inc | 1 + conf/machine/smarcimx8mq2g.conf | 111 +++++++++++++++++++++ conf/machine/smarcimx8mq4g.conf | 111 +++++++++++++++++++++ recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend | 4 +- .../imx-vpu-hantro-vc_1.3.0.bbappend | 1 - recipes-bsp/u-boot/u-boot-smarcimx8mq_2020.04.bb | 57 +++++++++++ recipes-core/base-files/base-files_%.bbappend | 15 +++ recipes-core/udev/udev-rules-imx.bbappend | 12 +++ recipes-kernel/linux/linux-smarcimx8mq_5.10.bb | 87 ++++++++++++++++ scripts/emb_mk_yocto_sdcard/README.txt | 2 +- .../emb_mk_yocto_sdcard/emb-create-yocto-emmc.sh | 23 +++-- .../emb_mk_yocto_sdcard/emb-create-yocto-sdcard.sh | 21 +++- scripts/emb_mk_yocto_sdcard/uEnv.txt | 10 +- scripts/emb_mk_yocto_sdcard/uEnv_emmc.txt | 14 +-- 15 files changed, 443 insertions(+), 34 deletions(-) create mode 100644 conf/machine/smarcimx8mq2g.conf create mode 100644 conf/machine/smarcimx8mq4g.conf delete mode 100644 recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.3.0.bbappend create mode 100644 recipes-bsp/u-boot/u-boot-smarcimx8mq_2020.04.bb create mode 100644 recipes-kernel/linux/linux-smarcimx8mq_5.10.bb diff --git a/conf/layer.conf b/conf/layer.conf index 5682ace..555462f 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -5,10 +5,10 @@ BBPATH .= ":${LAYERDIR}" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "smarcimx8mp" -BBFILE_PATTERN_smarcimx8mp := "^${LAYERDIR}/" -BBFILE_PRIORITY_smarcimx8mp = "12" -LAYERSERIES_COMPAT_smarcimx8mp = "warrior zeus gatesgarth" +BBFILE_COLLECTIONS += "smarcimx8mq" +BBFILE_PATTERN_smarcimx8mq := "^${LAYERDIR}/" +BBFILE_PRIORITY_smarcimx8mq = "13" +LAYERSERIES_COMPAT_smarcimx8mq = "warrior zeus gatesgarth" # Define new EULAs and add them to the list defined in meta-freescale. # See fsl-eula-unpack.bbclass. diff --git a/conf/machine/include/smarc-common.inc b/conf/machine/include/smarc-common.inc index e1e4145..28b4a21 100644 --- a/conf/machine/include/smarc-common.inc +++ b/conf/machine/include/smarc-common.inc @@ -24,6 +24,7 @@ MACHINE_EXTRA_RRECOMMENDS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'n # MCore Demo apps to /lib/firmware MACHINE_EXTRA_RRECOMMENDS_append_mx8mp = " imx-m7-demos" +MACHINE_EXTRA_RRECOMMENDS_append_mx8mq = " imx-m4-demos" MACHINE_GSTREAMER_1_0_PLUGIN_mx8 ?= "imx-gst1.0-plugin" diff --git a/conf/machine/smarcimx8mq2g.conf b/conf/machine/smarcimx8mq2g.conf new file mode 100644 index 0000000..d3f1d3f --- /dev/null +++ b/conf/machine/smarcimx8mq2g.conf @@ -0,0 +1,111 @@ +#@TYPE: Machine +#@NAME: EMBEDIAN SMARC-iMX8MQ CPU Module with 2GB LPDDR4 +#@SOC: i.MX8MQ +#@DESCRIPTION: Machine configuration for Embedian SMARC-iMX8MQ +#@MAINTAINER: Eric Lee + +MACHINEOVERRIDES =. "mx8:mx8m:mx8mq:" + +require conf/machine/include/imx-base.inc +require conf/machine/include/tune-cortexa53.inc +require conf/machine/include/smarc-common.inc + +MACHINE_FEATURES += " usbgadget vfat ext2 alsa serial pci wifi bluetooth nxp8997" + +IMAGE_FEATURES += "package-management" + +# Embedian BSP default providers +PREFERRED_PROVIDER_virtual/kernel_smarcimx8mq2g ?= "linux-smarcimx8mq" +PREFERRED_VERSION_linux-smarcimx8mq2g_smarcimx8mq2g = "5.10" + +KERNEL_DEVICETREE = " \ + embedian/imx8mq-smarc.dtb \ + embedian/imx8mq-smarc-dcss-lvds.dtb \ + embedian/imx8mq-smarc-lcdif-lvds.dtb \ + embedian/imx8mq-smarc-hdmi.dtb \ + embedian/imx8mq-smarc-dp.dtb \ + embedian/imx8mq-smarc-dual-display.dtb \ + embedian/imx8mq-smarc-m4.dtb \ + embedian/imx8mq-smarc-m4-dcss-lvds.dtb \ + embedian/imx8mq-smarc-m4-lcdif-lvds.dtb \ + embedian/imx8mq-smarc-m4-hdmi.dtb \ + embedian/imx8mq-smarc-m4-dp.dtb \ + embedian/imx8mq-smarc-m4-dual-display.dtb \ +" + +MACHINE_FEATURES_remove_smarcimx8mq2g = "qca6174" +MACHINE_FEATURES_append_smarcimx8mq2g = " bcm43455 bcm4356 bcm4359 nxp8997" +WKS_FILE_DEPENDS_append_smarcimx8mq2g = " imx-m4-demos" +IMAGE_BOOT_FILES += " imx8mq_m4_TCM_hello_world.bin \ + imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \ + imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin \ +" + +PREFERRED_PROVIDER_u-boot_smarcimx8mq2g = "u-boot-smarcimx8mq" +PREFERRED_PROVIDER_virtual/bootloader_smarcimx8mq2g = "u-boot-smarcimx8mq" + +UBOOT_CONFIG ??= "sd" +UBOOT_CONFIG[sd] = "smarcimx8mq_2g_ser3_defconfig,sdcard" +SPL_BINARY = "spl/u-boot-spl.bin" + +# Set DDR FIRMWARE +DDR_FIRMWARE_NAME = "lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_2d_imem.bin lpddr4_pmu_train_2d_dmem.bin" + +# Set u-boot DTB +UBOOT_DTB_NAME = "imx8mq-smarc.dtb" + +# Set imx-mkimage boot target +IMXBOOT_TARGETS = "flash_evk flash_evk_no_hdmi flash_dp_evk" + +# Set Serial console +SERIAL_CONSOLES = "115200;ttymxc0" + +IMAGE_BOOTLOADER = "imx-boot" + +LOADADDR = "" +UBOOT_SUFFIX = "bin" +UBOOT_MAKE_TARGET = "" +IMX_BOOT_SEEK = "33" + +OPTEE_BIN_EXT = "8mq" + +MACHINE_EXTRA_RDEPENDS += " \ + imx-boot \ + packagegroup-tools-bluetooth \ + pm-utils \ + kmod \ + hdparm \ + gptfdisk \ + lftp \ + vim \ + ntp \ + boost \ + nodejs \ + networkmanager \ + imx-gpu-viv \ + android-tools \ + " + +# eIQ Machine Learning. Note that many of the features require Qt 5. Disable +# this when you build image without QT 5. +IMAGE_INSTALL_append = " \ + packagegroup-imx-ml \ + firmware-imx-sdma \ + firmware-imx-regulatory \ + fsl-rc-local \ + " +#IMAGE_INSTALL_append = " \ +# firmware-imx-sdma \ +# firmware-imx-regulatory \ +# fsl-rc-local \ +# " + +#TOOLCHAIN_TARGET_TASK_append += " tensorflow-lite-staticdev tensorflow-lite-dev armnn-dev onnxruntimedev" + +IMAGE_FSTYPES = "tar.bz2" + +# Ship all kernel modules by default +MACHINE_EXTRA_RRECOMMENDS = "kernel-modules" + +# Add additional firmware +MACHINE_FIRMWARE_append = " linux-firmware-ath10k" diff --git a/conf/machine/smarcimx8mq4g.conf b/conf/machine/smarcimx8mq4g.conf new file mode 100644 index 0000000..5649b88 --- /dev/null +++ b/conf/machine/smarcimx8mq4g.conf @@ -0,0 +1,111 @@ +#@TYPE: Machine +#@NAME: EMBEDIAN SMARC-iMX8MQ CPU Module with 4GB LPDDR4 +#@SOC: i.MX8MQ +#@DESCRIPTION: Machine configuration for Embedian SMARC-iMX8MQ +#@MAINTAINER: Eric Lee + +MACHINEOVERRIDES =. "mx8:mx8m:mx8mq:" + +require conf/machine/include/imx-base.inc +require conf/machine/include/tune-cortexa53.inc +require conf/machine/include/smarc-common.inc + +MACHINE_FEATURES += " usbgadget vfat ext2 alsa serial pci wifi bluetooth nxp8997" + +IMAGE_FEATURES += "package-management" + +# Embedian BSP default providers +PREFERRED_PROVIDER_virtual/kernel_smarcimx8mq4g ?= "linux-smarcimx8mq" +PREFERRED_VERSION_linux-smarcimx8mq4g_smarcimx8mq4g = "5.10" + +KERNEL_DEVICETREE = " \ + embedian/imx8mq-smarc.dtb \ + embedian/imx8mq-smarc-dcss-lvds.dtb \ + embedian/imx8mq-smarc-lcdif-lvds.dtb \ + embedian/imx8mq-smarc-hdmi.dtb \ + embedian/imx8mq-smarc-dp.dtb \ + embedian/imx8mq-smarc-dual-display.dtb \ + embedian/imx8mq-smarc-m4.dtb \ + embedian/imx8mq-smarc-m4-dcss-lvds.dtb \ + embedian/imx8mq-smarc-m4-lcdif-lvds.dtb \ + embedian/imx8mq-smarc-m4-hdmi.dtb \ + embedian/imx8mq-smarc-m4-dp.dtb \ + embedian/imx8mq-smarc-m4-dual-display.dtb \ +" + +MACHINE_FEATURES_remove_smarcimx8mq4g = "qca6174" +MACHINE_FEATURES_append_smarcimx8mq4g = " bcm43455 bcm4356 bcm4359 nxp8997" +WKS_FILE_DEPENDS_append_smarcimx8mq4g = " imx-m4-demos" +IMAGE_BOOT_FILES += " imx8mq_m4_TCM_hello_world.bin \ + imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \ + imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin \ +" + +PREFERRED_PROVIDER_u-boot_smarcimx8mq4g = "u-boot-smarcimx8mq" +PREFERRED_PROVIDER_virtual/bootloader_smarcimx8mq4g = "u-boot-smarcimx8mq" + +UBOOT_CONFIG ??= "sd" +UBOOT_CONFIG[sd] = "smarcimx8mq_4g_ser3_defconfig,sdcard" +SPL_BINARY = "spl/u-boot-spl.bin" + +# Set DDR FIRMWARE +DDR_FIRMWARE_NAME = "lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_2d_imem.bin lpddr4_pmu_train_2d_dmem.bin" + +# Set u-boot DTB +UBOOT_DTB_NAME = "imx8mq-smarc.dtb" + +# Set imx-mkimage boot target +IMXBOOT_TARGETS = "flash_evk flash_evk_no_hdmi flash_dp_evk" + +# Set Serial console +SERIAL_CONSOLES = "115200;ttymxc0" + +IMAGE_BOOTLOADER = "imx-boot" + +LOADADDR = "" +UBOOT_SUFFIX = "bin" +UBOOT_MAKE_TARGET = "" +IMX_BOOT_SEEK = "33" + +OPTEE_BIN_EXT = "8mq" + +MACHINE_EXTRA_RDEPENDS += " \ + imx-boot \ + packagegroup-tools-bluetooth \ + pm-utils \ + kmod \ + hdparm \ + gptfdisk \ + lftp \ + vim \ + ntp \ + boost \ + nodejs \ + networkmanager \ + imx-gpu-viv \ + android-tools \ + " + +# eIQ Machine Learning. Note that many of the features require Qt 5. Disable +# this when you build image without QT 5. +IMAGE_INSTALL_append = " \ + packagegroup-imx-ml \ + firmware-imx-sdma \ + firmware-imx-regulatory \ + fsl-rc-local \ + " +#IMAGE_INSTALL_append = " \ +# firmware-imx-sdma \ +# firmware-imx-regulatory \ +# fsl-rc-local \ +# " + +#TOOLCHAIN_TARGET_TASK_append += " tensorflow-lite-staticdev tensorflow-lite-dev armnn-dev onnxruntimedev" + +IMAGE_FSTYPES = "tar.bz2" + +# Ship all kernel modules by default +MACHINE_EXTRA_RRECOMMENDS = "kernel-modules" + +# Add additional firmware +MACHINE_FIRMWARE_append = " linux-firmware-ath10k" diff --git a/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend b/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend index 5bbb0a3..9da17c4 100644 --- a/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend +++ b/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend @@ -1,7 +1,7 @@ # Workaround to fix do_compile() failure due to missing imx8mp-smarc.dtb do_compile_prepend() { echo "Copying DTB" - if [ -f ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/imx8mp-smarc.dtb ]; then - cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/imx8mp-smarc.dtb ${S}/iMX8M/imx8mp-evk.dtb + if [ -f ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/imx8mq-smarc.dtb ]; then + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/imx8mq-smarc.dtb ${S}/iMX8M/imx8mq-evk.dtb fi } diff --git a/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.3.0.bbappend b/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.3.0.bbappend deleted file mode 100644 index 77c8f76..0000000 --- a/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.3.0.bbappend +++ /dev/null @@ -1 +0,0 @@ -COMPATIBLE_MACHINE = "(imx8mp)" diff --git a/recipes-bsp/u-boot/u-boot-smarcimx8mq_2020.04.bb b/recipes-bsp/u-boot/u-boot-smarcimx8mq_2020.04.bb new file mode 100644 index 0000000..cae0d67 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-smarcimx8mq_2020.04.bb @@ -0,0 +1,57 @@ +# Copyright (C) 2013-2016 Freescale Semiconductor +# Copyright 2017-2021 NXP + +DESCRIPTION = "i.MX U-Boot suppporting i.MX reference boards." +require recipes-bsp/u-boot/u-boot-common.inc +require recipes-bsp/u-boot/u-boot.inc +inherit pythonnative + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PROVIDES += "u-boot" +DEPENDS_append = " dtc-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +UBOOT_SRC ?= "${EMB_UBOOT_MIRROR};protocol=ssh" +SRCBRANCH = "smarc_8mq_lf_v2020.04" +SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}" +SRCREV = "312ec620f3557f27301ec51dec03d4c4154d161e" + +S = "${WORKDIR}/git" + +inherit fsl-u-boot-localversion + +LOCALVERSION ?= "-5.10.9-1.0.0" + +BOOT_TOOLS = "imx-boot-tools" + +do_deploy_append_mx8m () { + # Deploy u-boot-nodtb.bin and fsl-imx8mq-XX.dtb, to be packaged in boot binary by imx-boot + if [ -n "${UBOOT_CONFIG}" ] + then + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ] + then + install -d ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${type} + fi + done + unset j + done + unset i + fi + +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(mx6|mx7|mx8)" + +UBOOT_NAME_mx6 = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" +UBOOT_NAME_mx7 = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" +UBOOT_NAME_mx8 = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index e398334..8ac55b1 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -1,5 +1,13 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI_append_smarcimx8mq2g = " \ + file://embedian-hdmi-audio.conf \ +" + +SRC_URI_append_smarcimx8mq4g = " \ + file://embedian-hdmi-audio.conf \ +" + SRC_URI_append_smarcimx8mp4g = " \ file://embedian-hdmi-audio.conf \ " @@ -7,6 +15,13 @@ SRC_URI_append_smarcimx8mp4g = " \ SRC_URI_append_smarcimx8mp6g = " \ file://embedian-hdmi-audio.conf \ " +do_install_append_smarcimx8mq2g() { + install -m 0644 ${WORKDIR}/embedian-hdmi-audio.conf ${D}${sysconfdir}/modprobe.d +} + +do_install_append_smarcimx8mq4g() { + install -m 0644 ${WORKDIR}/embedian-hdmi-audio.conf ${D}${sysconfdir}/modprobe.d +} do_install_append_smarcimx8mp4g() { install -m 0644 ${WORKDIR}/embedian-hdmi-audio.conf ${D}${sysconfdir}/modprobe.d diff --git a/recipes-core/udev/udev-rules-imx.bbappend b/recipes-core/udev/udev-rules-imx.bbappend index 106960a..c0e963f 100644 --- a/recipes-core/udev/udev-rules-imx.bbappend +++ b/recipes-core/udev/udev-rules-imx.bbappend @@ -1,8 +1,20 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI_append_smarcimx8mq2g = " file://usb-power.rules" +SRC_URI_append_smarcimx8mq4g = " file://usb-power.rules" SRC_URI_append_smarcimx8mp4g = " file://usb-power.rules" SRC_URI_append_smarcimx8mp6g = " file://usb-power.rules" +do_install_append_smarcimx8mq2g () { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/usb-power.rules ${D}${sysconfdir}/udev/rules.d/ +} + +do_install_append_smarcimx8mq4g () { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/usb-power.rules ${D}${sysconfdir}/udev/rules.d/ +} + do_install_append_smarcimx8mp4g () { install -d ${D}${sysconfdir}/udev/rules.d install -m 0644 ${WORKDIR}/usb-power.rules ${D}${sysconfdir}/udev/rules.d/ diff --git a/recipes-kernel/linux/linux-smarcimx8mq_5.10.bb b/recipes-kernel/linux/linux-smarcimx8mq_5.10.bb new file mode 100644 index 0000000..ae7988b --- /dev/null +++ b/recipes-kernel/linux/linux-smarcimx8mq_5.10.bb @@ -0,0 +1,87 @@ +# Copyright (C) 2013-2016 Freescale Semiconductor +# Copyright 2017-2021 NXP +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Linux Kernel provided and supported by NXP" +DESCRIPTION = "Linux Kernel provided and supported by NXP with focus on \ +i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU and IPU." + +require recipes-kernel/linux/linux-imx.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + +DEPENDS += "lzop-native bc-native" + +SRCBRANCH = "smarc_8mq_lf-5.10.y" +LOCALVERSION = "-1.0.0" +KERNEL_DEFCONFIG = "${S}/arch/arm64/configs/smarcimx8mq_defconfig" + +KERNEL_SRC ?= "git@git.embedian.com:developer/smarc-fsl-linux-kernel.git;protocol=git" +SRC_URI = "${EMB_KERNEL_MIRROR};protocol=ssh;branch=${SRCBRANCH}" +SRCREV = "a2b178e1baa15b60f1547421ef6753a76b7059e4" + +LINUX_VERSION = "5.10.9" + +FILES_${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo " + +KERNEL_CONFIG_COMMAND = "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} olddefconfig" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +DEFAULT_PREFERENCE = "1" + +DO_CONFIG_V7_COPY = "no" +DO_CONFIG_V7_COPY_mx6 = "yes" +DO_CONFIG_V7_COPY_mx7 = "yes" +DO_CONFIG_V7_COPY_mx8 = "no" + +# Add setting for LF Mainline build +IMX_KERNEL_CONFIG_AARCH32 = "imx_v7_defconfig" +IMX_KERNEL_CONFIG_AARCH64 = "smarcimx8mq_defconfig" +KBUILD_DEFCONFIG ?= "" +KBUILD_DEFCONFIG_mx6= "${IMX_KERNEL_CONFIG_AARCH32}" +KBUILD_DEFCONFIG_mx7= "${IMX_KERNEL_CONFIG_AARCH32}" +KBUILD_DEFCONFIG_mx8= "${IMX_KERNEL_CONFIG_AARCH64}" + + +# Use a verbatim copy of the defconfig from the linux-imx repo. +# IMPORTANT: This task effectively disables kernel config fragments +# since the config fragments applied in do_kernel_configme are replaced. +addtask copy_defconfig after do_kernel_configme before do_preconfigure +do_copy_defconfig () { + install -d ${B} + if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then + # copy latest IMX_KERNEL_CONFIG_AARCH32 to use for mx6, mx6ul and mx7 + mkdir -p ${B} + cp ${S}/arch/arm/configs/${IMX_KERNEL_CONFIG_AARCH32} ${B}/.config + else + # copy latest IMX_KERNEL_CONFIG_AARCH64 to use for mx8 + mkdir -p ${B} + cp ${S}/arch/arm64/configs/${IMX_KERNEL_CONFIG_AARCH64} ${B}/.config + fi +} + +DELTA_KERNEL_DEFCONFIG ?= "" +#DELTA_KERNEL_DEFCONFIG_mx8 = "imx.config" + +do_merge_delta_config[dirs] = "${B}" +do_merge_delta_config[depends] += " \ + flex-native:do_populate_sysroot \ + bison-native:do_populate_sysroot \ +" +do_merge_delta_config() { + for deltacfg in ${DELTA_KERNEL_DEFCONFIG}; do + if [ -f ${S}/arch/${ARCH}/configs/${deltacfg} ]; then + ${KERNEL_CONFIG_COMMAND} + oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} ${deltacfg} + elif [ -f "${WORKDIR}/${deltacfg}" ]; then + ${S}/scripts/kconfig/merge_config.sh -m .config ${WORKDIR}/${deltacfg} + elif [ -f "${deltacfg}" ]; then + ${S}/scripts/kconfig/merge_config.sh -m .config ${deltacfg} + fi + done + cp .config ${WORKDIR}/defconfig +} +addtask merge_delta_config before do_preconfigure after do_copy_defconfig + +COMPATIBLE_MACHINE = "(mx6|mx7|mx8)" diff --git a/scripts/emb_mk_yocto_sdcard/README.txt b/scripts/emb_mk_yocto_sdcard/README.txt index 23e6d2e..f886818 100644 --- a/scripts/emb_mk_yocto_sdcard/README.txt +++ b/scripts/emb_mk_yocto_sdcard/README.txt @@ -11,7 +11,7 @@ Before running this script you need to bitbake fsl-image-gui. Usage: -sudo MACHINE= ./emb-create-yocto-sdcard.sh [options] /dev/sdX +sudo MACHINE= ./emb-create-yocto-sdcard.sh [options] /dev/sdX (Change /dev/sdX to your device name) options: diff --git a/scripts/emb_mk_yocto_sdcard/emb-create-yocto-emmc.sh b/scripts/emb_mk_yocto_sdcard/emb-create-yocto-emmc.sh index 428f5ca..edf1215 100755 --- a/scripts/emb_mk_yocto_sdcard/emb-create-yocto-emmc.sh +++ b/scripts/emb_mk_yocto_sdcard/emb-create-yocto-emmc.sh @@ -30,14 +30,15 @@ BOOTDIR=/boot check_board() { - if grep -q "i.MX8MP" /sys/devices/soc0/soc_id; then - BOARD=smarc-imx8mp - DTB_PREFIX=imx8mp-smarc - BLOCK=mmcblk2 - - if [[ $DISPLAY != "-lvds" && $DISPLAY != "-hdmi" && \ - $DISPLAY != "-edp" && $DISPLAY != "" ]]; then - red_bold_echo "ERROR: invalid display, should be lvds, hdmi, dual-display or empty" + if grep -q "i.MX8MQ" /sys/devices/soc0/soc_id; then + BOARD=smarc-imx8mq + DTB_PREFIX=imx8mq-smarc + BLOCK=mmcblk0 + + if [[ $DISPLAY != "-dcss-lvds" && $DISPLAY != "-hdmi" && \ + $DISPLAY != "-lcdif-lvds" && $DISPLAY != "-dp" && \ + $DISPLAY != "-dual-display" && $DISPLAY != "" ]]; then + red_bold_echo "ERROR: invalid display, should be dcss-lvds, hdmi, lcdif-lvds, dual-display or empty" exit 1 fi else @@ -149,7 +150,7 @@ install_kernel_to_emmc() mount /dev/${BLOCK}${PART}${BOOTPART} ${MOUNTDIR} mkdir -p ${MOUNTDIR}/dtbs/ cp -v ${IMGS_PATH}/${KERNEL_IMAGE} ${MOUNTDIR} - cp -v ${IMGS_PATH}/${DTB_PREFIX}${DISPLAY}.dtb ${MOUNTDIR}/dtbs/imx8mp-smarc.dtb + cp -v ${IMGS_PATH}/${DTB_PREFIX}${DISPLAY}.dtb ${MOUNTDIR}/dtbs/imx8mq-smarc.dtb cp -v ${IMGS_PATH}/uEnv.txt ${MOUNTDIR} echo @@ -198,7 +199,7 @@ start_udev() usage() { echo - echo "This script installs Yocto Rootfs on the SMARC-iMX8MP's internal eMMC storage device" + echo "This script installs Yocto Rootfs on the SMARC-iMX8MQ's internal eMMC storage device" echo echo " Usage: $(basename $0)