diff --git a/conf/layer.conf b/conf/layer.conf index 0c447c0..79498db 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -5,6 +5,7 @@ BBPATH .= ":${LAYERDIR}" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" + BBFILE_COLLECTIONS += "netmodule-bsp" BBFILE_PATTERN_netmodule-bsp = "^${LAYERDIR}/" BBFILE_PRIORITY_netmodule-bsp = "10" diff --git a/conf/machine/include/utilities.inc b/conf/machine/include/utilities.inc new file mode 100644 index 0000000..164d77f --- /dev/null +++ b/conf/machine/include/utilities.inc @@ -0,0 +1,17 @@ +### Machine definition file utilities + +def make_dtb_boot_files(d): + # Generate IMAGE_BOOT_FILES entries for device tree files listed in + # KERNEL_DEVICETREE. + # Use only the basename for dtb files: + alldtbs = d.getVar('KERNEL_DEVICETREE') + + def transform(dtb): + if not (dtb.endswith('dtb') or dtb.endswith('dtbo')): + # eg: whatever/bcm2708-rpi-b.dtb has: + # DEPLOYDIR file: bcm2708-rpi-b.dtb + # destination: bcm2708-rpi-b.dtb + bb.error("KERNEL_DEVICETREE entry %s is not a .dtb or .dtbo file." % (dtb) ) + return os.path.basename(dtb) + + return ' '.join([transform(dtb) for dtb in alldtbs.split() if dtb]) diff --git a/recipes-bsp/imx8/conf/bblayers.conf.sample b/recipes-bsp/imx8/conf/bblayers.conf.sample new file mode 100644 index 0000000..2a86c91 --- /dev/null +++ b/recipes-bsp/imx8/conf/bblayers.conf.sample @@ -0,0 +1,27 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "7" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +YOCTOROOT = "${@os.path.abspath(os.path.join("${TOPDIR}", os.pardir))}" + +BBLAYERS ?= " \ + ${YOCTOROOT}/meta \ + ${YOCTOROOT}/meta-poky \ + ${YOCTOROOT}/meta-yocto-bsp \ + ${YOCTOROOT}/meta-netmodule-bsp \ + ${YOCTOROOT}/meta-netmodule-bsp/recipes-bsp/imx8 \ + ${YOCTOROOT}/meta-netmodule-distro \ + ${YOCTOROOT}/meta-openembedded/meta-python \ + ${YOCTOROOT}/meta-openembedded/meta-oe \ + ${YOCTOROOT}/meta-openembedded/meta-networking \ + ${YOCTOROOT}/meta-openembedded/meta-filesystems \ + ${YOCTOROOT}/meta-updater \ + ${YOCTOROOT}/meta-freescale\ + " +BBLAYERS_NON_REMOVABLE ?= " \ + ${YOCTOROOT}/meta \ + ${YOCTOROOT}/meta-yocto \ + " diff --git a/recipes-bsp/imx8/conf/layer.conf b/recipes-bsp/imx8/conf/layer.conf new file mode 100644 index 0000000..8a53f3f --- /dev/null +++ b/recipes-bsp/imx8/conf/layer.conf @@ -0,0 +1,22 @@ +# Layer configuration for meta-imx8bsp layer +# Copyright 2012 Intel Corporation + +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have various recipe-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/*/*.bb ${LAYERDIR}/*/*.bbappend" + +BBFILE_COLLECTIONS += "imx8bsp" +BBFILE_PATTERN_imx8bsp := "^${LAYERDIR}/" +BBFILE_PRIORITY_imx8bsp = "11" + +# This should only be incremented on significant changes that will +# cause compatibility issues with other layers +LAYERVERSION_imx8bsp = "1" + +LAYERDEPENDS_imx8bsp = "core freescale-layer" + +LAYERSERIES_COMPAT_imx8bsp = "warrior" + +LICENSE_PATH += "${LAYERDIR}/licenses" diff --git a/recipes-bsp/imx8/conf/local.conf.sample b/recipes-bsp/imx8/conf/local.conf.sample new file mode 100644 index 0000000..0b3cdad --- /dev/null +++ b/recipes-bsp/imx8/conf/local.conf.sample @@ -0,0 +1,52 @@ +BB_NUMBER_THREADS ?= "4" +PARALLEL_MAKE ?= "-j 4" +PACKAGE_CLASSES ?= "package_rpm" +USER_CLASSES ?= "buildstats image-mklibs image-prelink" +PATCHRESOLVE = "noop" +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K \ + ABORT,/tmp,10M,1K" +ASSUME_PROVIDED += "libsdl-native" +CONF_VERSION = "1" +IMAGE_FEATURES_append = " debug-tweaks" + +INHERIT += "rm_work" + +ERROR_QA_remove += "version-going-backwards" +WARN_QA_append += "version-going-backwards" + +INHERIT += "buildhistory" +BUILDHISTORY_COMMIT = "1" +BUILDHISTORY_COMMIT_AUTHOR = "Mr Jenkins " + +# Mirror GIT repo in download folders +BB_GENERATE_MIRROR_TARBALLS = "1" + +# Add licences file to the rootfs +COPY_LIC_MANIFEST = "1" +COPY_LIC_DIRS = "1" +LICENSE_CREATE_PACKAGE = "1" + +INHERIT += "buildstats-summary" + +YOCTOROOT = "${@os.path.abspath(os.path.join("${TOPDIR}", os.pardir))}" + +SSTATE_DIR ?= "${HOME}/yocto-share/sstate-cache" +DL_DIR ?= "${HOME}/yocto-share/downloads" +BUILDHISTORY_DIR = "${HOME}/yocto-share/buildhistory" + +TMPDIR = "${YOCTOROOT}/shared-build/tmp" +ACCEPT_FSL_EULA = "1" + + +### Environment variables needed to build +#MACHINE = "am335x-nmhw21" +#DISTRO = "netmodule-linux" / "netmodule-linux-ostree" +#OSTREE_BRANCHNAME = "${MACHINE}-vcu" +#OSTREE_OSNAME = "hancock-os" diff --git a/conf/machine/imx8-nmhw23.conf b/recipes-bsp/imx8/conf/machine/imx8-nmhw23.conf similarity index 56% rename from conf/machine/imx8-nmhw23.conf rename to recipes-bsp/imx8/conf/machine/imx8-nmhw23.conf index 2d7e951..dcefac2 100644 --- a/conf/machine/imx8-nmhw23.conf +++ b/recipes-bsp/imx8/conf/machine/imx8-nmhw23.conf @@ -2,8 +2,11 @@ #@NAME: NetModule HW 23 #@DESCRIPTION: Machine configuration for the nmhw23 mainboard +require conf/machine/include/imx-base.inc require conf/machine/include/arm/arch-arm64.inc +MACHINEOVERRIDES =. "mx8:mx8x:mx8qxp:" + IMAGE_FSTYPES += "tar.gz cpio cpio.gz.u-boot" IMAGE_CLASSES += "image_types" @@ -16,13 +19,19 @@ SOTA_MACHINE = "${MACHINE}" KERNEL_CLASSES_append = " kernel-fitimage" -KERNEL_IMAGETYPE = "Image" -KERNEL_IMAGETYPES = "fitImage Image" -KERNEL_IMAGETYPE_sota = "fitImage" -KERNEL_IMAGETYPES_sota = "fitImage" -UBOOT_ENTRYPOINT ?= "0x80020000" -UBOOT_MACHINE = "imx8_nmhw23_defconfig" +KERNEL_IMAGETYPE = "fitImage" +KERNEL_IMAGETYPE_aarch64 = "fitImage" +KERNEL_ALT_IMAGETYPE = "Image" +UBOOT_ENTRYPOINT = "0x80280000" +#UBOOT_MACHINE = "imx8_nmhw23_defconfig" IMAGE_BOOT_FILES = "flash.bin" PREFERRED_PROVIDER_virtual/kernel = "linux-netmodule" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-imx8-nmhw23" +#PREFERRED_PROVIDER_virtual/bootloader = "u-boot-imx" + +UBOOT_MAKE_TARGET = "" +#UBOOT_MAKE_TARGET = "u-boot.bin" +UBOOT_SUFFIX = "bin" +UBOOT_CONFIG ??= "flash" +UBOOT_CONFIG[flash] = "imx8_nmhw23_defconfig" diff --git a/recipes-bsp/imx8/firmware-imx/firmware-imx-8.1.inc b/recipes-bsp/imx8/firmware-imx/firmware-imx-8.1.inc new file mode 100644 index 0000000..ad0f7fe --- /dev/null +++ b/recipes-bsp/imx8/firmware-imx/firmware-imx-8.1.inc @@ -0,0 +1,22 @@ +# Copyright (C) 2012-2016 Freescale Semiconductor +# Copyright 2017-2018 NXP +# Copyright (C) 2018 O.S. Systems Software LTDA. +SECTION = "base" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=80c0478f4339af024519b3723023fe28" + +SRCBRANCH ?= "master" +SRC_URI = " \ + ${FSL_MIRROR}/firmware-imx-${PV}.bin;fsl-eula=true \ +" + +#SRC_URI[md5sum] = "0967aa59b3fd8d80fcb98146a9aac91b" +#SRC_URI[sha256sum] = "910fbf866f61185adfd60c1704b2da41030cb175901d06e40402b49f9240bdee" + +SRC_URI[md5sum] = "ff7e208761379890261b62f477b441ed" +SRC_URI[sha256sum] = "d6a1d8dc3ce8f2e928bc6b58c7d583126abfd14d8ab61a2d8ebd760a898b5195" + + +S = "${WORKDIR}/firmware-imx-${PV}" + +inherit fsl-eula-unpack diff --git a/recipes-bsp/imx8/firmware-imx/firmware-imx-8x_8.1.bb b/recipes-bsp/imx8/firmware-imx/firmware-imx-8x_8.1.bb new file mode 100644 index 0000000..85d394a --- /dev/null +++ b/recipes-bsp/imx8/firmware-imx/firmware-imx-8x_8.1.bb @@ -0,0 +1,20 @@ +# Copyright 2018 NXP +SUMMARY = "Freescale i.MX firmware for 8X family" +DESCRIPTION = "Freescale i.MX firmware for 8X family" + +require firmware-imx-${PV}.inc + +inherit deploy + +do_install[noexec] = "1" + +do_deploy() { + # SECO + install -m 0644 ${S}/firmware/seco/mx8qx-ahab-container.img ${DEPLOYDIR} +} + +addtask deploy after do_install before do_build + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" + +COMPATIBLE_MACHINE = "(mx8x)" diff --git a/recipes-bsp/imx8/imx-atf/imx-atf/0001-Allow-BUILD_STRING-to-be-set-in-.revision-file.patch b/recipes-bsp/imx8/imx-atf/imx-atf/0001-Allow-BUILD_STRING-to-be-set-in-.revision-file.patch new file mode 100644 index 0000000..be74778 --- /dev/null +++ b/recipes-bsp/imx8/imx-atf/imx-atf/0001-Allow-BUILD_STRING-to-be-set-in-.revision-file.patch @@ -0,0 +1,29 @@ +From 4123893a8a4d93362a0a36f72134f75436fee457 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Thu, 18 Oct 2018 18:03:46 -0500 +Subject: [PATCH] Allow BUILD_STRING to be set in .revision file. + +Upstream-Status: Pending + +Signed-off-by: Tom Hochstein +--- + Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Makefile b/Makefile +index 57c4a90..ec49397 100644 +--- a/Makefile ++++ b/Makefile +@@ -97,6 +97,9 @@ endif + + # Default build string (git branch and commit) + ifeq (${BUILD_STRING},) ++ BUILD_STRING := $(shell cat .revision 2> /dev/null) ++endif ++ifeq (${BUILD_STRING},) + BUILD_STRING := $(shell git describe --long --always --dirty --tags 2> /dev/null) + endif + VERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${BUILD_STRING} +-- +2.7.4 + diff --git a/recipes-bsp/imx8/imx-atf/imx-atf_1.5.0.bb b/recipes-bsp/imx8/imx-atf/imx-atf_1.5.0.bb new file mode 100644 index 0000000..6408298 --- /dev/null +++ b/recipes-bsp/imx8/imx-atf/imx-atf_1.5.0.bb @@ -0,0 +1,47 @@ +# Copyright 2017-2018 NXP + +DESCRIPTION = "i.MX ARM Trusted Firmware" +SECTION = "BSP" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9" + +PV = "1.5.0+git${SRCPV}" + +SRCBRANCH = "imx_4.14.98_2.0.0_ga" +SRC_URI = "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https;branch=${SRCBRANCH} \ + file://0001-Allow-BUILD_STRING-to-be-set-in-.revision-file.patch \ +" +SRCREV ?= "${AUTOREV}" + +S = "${WORKDIR}/git" + +inherit deploy + +BOOT_TOOLS = "imx-boot-tools" + +PLATFORM ?= "INVALID" +PLATFORM_mx8qm = "imx8qm" +PLATFORM_mx8qxp = "imx8qx" +PLATFORM_mx8mq = "imx8mq" +PLATFORM_mx8mm = "imx8mm" + +EXTRA_OEMAKE += " \ + CROSS_COMPILE="${TARGET_PREFIX}" \ + PLAT=imx8qx \ +" + +do_compile() { + # Clear LDFLAGS to avoid the option -Wl recognize issue + unset LDFLAGS + oe_runmake bl31 +} + +do_install[noexec] = "1" + +do_deploy() { + install -Dm 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}p.bin +} +addtask deploy after do_compile + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" +COMPATIBLE_MACHINE = "(mx8)" diff --git a/recipes-bsp/imx8/imx-mkimage/imx-boot_0.2.bb b/recipes-bsp/imx8/imx-mkimage/imx-boot_0.2.bb new file mode 100644 index 0000000..2bb0c2f --- /dev/null +++ b/recipes-bsp/imx8/imx-mkimage/imx-boot_0.2.bb @@ -0,0 +1,179 @@ +# Copyright 2017-2018 NXP + +require imx-mkimage_git.inc + +DESCRIPTION = "Generate Boot Loader for i.MX 8 device" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +SECTION = "BSP" + +IMX_EXTRA_FIRMWARE = "firmware-imx-8 imx-sc-firmware" +IMX_EXTRA_FIRMWARE_mx8m = "firmware-imx-8m" +IMX_EXTRA_FIRMWARE_mx8x = "firmware-imx-8x imx-sc-firmware" +DEPENDS += " \ + u-boot \ + firmware-imx \ + ${IMX_EXTRA_FIRMWARE} \ + imx-atf \ +" +DEPENDS_append_mx8m = " dtc-native" +BOOT_NAME = "imx-boot" +PROVIDES = "${BOOT_NAME}" + +inherit deploy +# Add CFLAGS with native INCDIR & LIBDIR for imx-mkimage build +CFLAGS = "-O2 -Wall -std=c99 -I ${STAGING_INCDIR_NATIVE} -L ${STAGING_LIBDIR_NATIVE}" + +# This package aggregates output deployed by other packages, +# so set the appropriate dependencies +do_compile[depends] += " \ + virtual/bootloader:do_deploy \ + ${@' '.join('%s:do_deploy' % r for r in '${IMX_EXTRA_FIRMWARE}'.split() )} \ + imx-atf:do_deploy \ +" + +SC_FIRMWARE_NAME ?= "scfw_tcm_cfw.bin" + +ATF_MACHINE_NAME ?= "bl31-imx8qm.bin" +ATF_MACHINE_NAME_mx8qm = "bl31-imx8qm.bin" +ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qxp.bin" +ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin" +ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin" +ATF_MACHINE_NAME_append = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', '-optee', '', d)}" + +DCD_NAME ?= "imx8qm_dcd.cfg.tmp" +DCD_NAME_mx8qm = "imx8qm_dcd.cfg.tmp" +DCD_NAME_mx8qxp = "imx8qx_dcd.cfg.tmp" + +UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" +BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin" + +TOOLS_NAME ?= "mkimage_imx8" + +SOC_TARGET ?= "INVALID" +SOC_TARGET_mx8qm = "iMX8QM" +SOC_TARGET_mx8qxp = "iMX8QX" +SOC_TARGET_mx8mq = "iMX8M" +SOC_TARGET_mx8mm = "iMX8MM" + +IMXBOOT_TARGETS ?= \ + "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \ + bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ + 'flash flash_dcd', d), d)}" +IMXBOOT_TARGETS_mx8qxp = \ + "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \ + bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ + 'flash', d), d)}" +IMXBOOT_TARGETS_mx8qxpa0 = \ + "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi_a0', \ + bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand_a0', \ + 'flash_a0 flash_dcd_a0', d), d)}" + +BOOT_STAGING = "${S}/${SOC_TARGET}" +BOOT_STAGING_mx8mm = "${S}/iMX8M" + +SOC_FAMILY = "INVALID" +SOC_FAMILY_mx8 = "mx8" +SOC_FAMILY_mx8m = "mx8m" +SOC_FAMILY_mx8x = "mx8x" + +compile_mx8m() { + bbnote 8MQ/8MM boot binary build + for ddr_firmware in ${DDR_FIRMWARE_NAME}; do + bbnote "Copy ddr_firmware: ${ddr_firmware} from ${DEPLOY_DIR_IMAGE} -> ${BOOT_STAGING} " + cp ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${BOOT_STAGING} + done + cp ${DEPLOY_DIR_IMAGE}/signed_*_imx8m.bin ${BOOT_STAGING} + cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} ${BOOT_STAGING}/u-boot-spl.bin + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} ${BOOT_STAGING} + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-nodtb.bin ${BOOT_STAGING} + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/mkimage_uboot ${BOOT_STAGING} + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin + cp ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${BOOT_STAGING}/u-boot.bin +} +compile_mx8() { + bbnote 8QM boot binary build + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME} ${BOOT_STAGING}/scfw_tcm.bin + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin + cp ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${BOOT_STAGING}/u-boot.bin + cp ${DEPLOY_DIR_IMAGE}/mx8qm-ahab-container.img ${BOOT_STAGING} +} +compile_mx8x() { + bbnote 8QX boot binary build + cp ${DEPLOY_DIR_IMAGE}/mx8qx-ahab-container.img ${BOOT_STAGING} + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME} ${BOOT_STAGING}/scfw_tcm.bin + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin + cp ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${BOOT_STAGING}/u-boot.bin +} +do_compile() { + compile_${SOC_FAMILY} + # mkimage for i.MX8 + for target in ${IMXBOOT_TARGETS}; do + bbnote "building ${SOC_TARGET} - ${target}" + make SOC=${SOC_TARGET} ${target} + if [ -e "${BOOT_STAGING}/flash.bin" ]; then + cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE}-${target} + dd if=${BOOT_STAGING}/flash.bin of=${S}/${BOOT_CONFIG_MACHINE}-${target}.sd bs=1k seek=32 conv=fsync + fi + done +} + +do_install () { + install -d ${D}/boot + for target in ${IMXBOOT_TARGETS}; do + install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${D}/boot/ + install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}.sd ${D}/boot/ + done +} + +deploy_mx8m() { + install -d ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} ${DEPLOYDIR}/${BOOT_TOOLS} + for ddr_firmware in ${DDR_FIRMWARE_NAME}; do + install -m 0644 ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${DEPLOYDIR}/${BOOT_TOOLS} + done + install -m 0644 ${DEPLOY_DIR_IMAGE}/signed_hdmi*.bin ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0755 ${BOOT_STAGING}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0755 ${BOOT_STAGING}/mkimage_fit_atf.sh ${DEPLOYDIR}/${BOOT_TOOLS} +} +deploy_mx8() { + install -d ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0644 ${BOOT_STAGING}/${DCD_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0644 ${BOOT_STAGING}/mx8qm-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} +} +deploy_mx8x() { + install -d ${DEPLOYDIR}/${BOOT_TOOLS} + if [ "${MACHINE}" = "imx8qxpa0mek" ]; then + install -m 0644 ${BOOT_STAGING}/${DCD_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + fi + install -m 0644 ${BOOT_STAGING}/mx8qx-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} +} +do_deploy() { + deploy_${SOC_FAMILY} + # copy the tool mkimage to deploy path and sc fw, dcd and uboot + install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + # copy makefile (soc.mak) for reference + install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS} + # copy the generated boot image to deploy path + for target in ${IMXBOOT_TARGETS}; do + # Use first "target" as IMAGE_IMXBOOT_TARGET + if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then + IMAGE_IMXBOOT_TARGET="$target" + echo "Set boot target as $IMAGE_IMXBOOT_TARGET" + fi + install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR} + install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}.sd ${DEPLOYDIR} + done + cd ${DEPLOYDIR} + ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_NAME} + ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET}.sd ${BOOT_NAME}.sd + cd - +} +addtask deploy before do_build after do_compile + +PACKAGE_ARCH = "${MACHINE_ARCH}" +FILES_${PN} = "/boot" + +COMPATIBLE_MACHINE = "(mx8)" diff --git a/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.bb b/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.bb new file mode 100644 index 0000000..5304ebf --- /dev/null +++ b/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.bb @@ -0,0 +1,35 @@ +# Copyright (C) 2016 Freescale Semiconductor +# Copyright 2017-2018 NXP + +require imx-mkimage_git.inc + +DESCRIPTION = "i.MX make image" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +SECTION = "BSP" + +inherit native deploy + +CFLAGS = "-O2 -Wall -std=c99 -I ${STAGING_INCDIR} -L ${STAGING_LIBDIR}" + +do_compile () { + cd ${S} + oe_runmake clean + oe_runmake bin + oe_runmake -C iMX8M -f soc.mak mkimage_imx8 + oe_runmake -C iMX8QM -f soc.mak imx8qm_dcd.cfg.tmp + oe_runmake -C iMX8QX -f soc.mak imx8qx_dcd.cfg.tmp +} + +do_install () { + cd ${S} + install -d ${D}${bindir} + install -m 0755 iMX8M/mkimage_imx8 ${D}${bindir}/mkimage_imx8m + install -m 0755 mkimage_imx8 ${D}${bindir}/mkimage_imx8 +} + +do_deploy () { + install -m 0644 ${S}/iMX8QM/imx8qm_dcd.cfg.tmp ${DEPLOYDIR} + install -m 0644 ${S}/iMX8QX/imx8qx_dcd.cfg.tmp ${DEPLOYDIR} +} +addtask deploy before do_build after do_install diff --git a/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.inc b/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.inc new file mode 100644 index 0000000..15ab4cb --- /dev/null +++ b/recipes-bsp/imx8/imx-mkimage/imx-mkimage_git.inc @@ -0,0 +1,12 @@ +# Copyright 2017-2018 NXP + +DEPENDS = "zlib-native openssl-native" + + +SRCBRANCH = "imx_4.14.98_2.0.0_ga" +SRC_URI = "git://source.codeaurora.org/external/imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH}" +SRCREV ?= "${AUTOREV}" +S = "${WORKDIR}/git" + +BOOT_TOOLS = "imx-boot-tools" +SYSROOT_DIRS += "/boot" diff --git a/recipes-bsp/imx8/imx-sc-firmware/files/README b/recipes-bsp/imx8/imx-sc-firmware/files/README new file mode 100644 index 0000000..cbce7fd --- /dev/null +++ b/recipes-bsp/imx8/imx-sc-firmware/files/README @@ -0,0 +1,2 @@ +Custom build +TODO: Integrade https://git.netmodule.intranet/hancock/imx8-scfw as a recipe diff --git a/recipes-bsp/imx8/imx-sc-firmware/files/scfw_tcm_cfw.bin b/recipes-bsp/imx8/imx-sc-firmware/files/scfw_tcm_cfw.bin new file mode 100755 index 0000000..6b85ac6 Binary files /dev/null and b/recipes-bsp/imx8/imx-sc-firmware/files/scfw_tcm_cfw.bin differ diff --git a/recipes-bsp/imx8/imx-sc-firmware/imx-sc-firmware_0.9.bb b/recipes-bsp/imx8/imx-sc-firmware/imx-sc-firmware_0.9.bb new file mode 100644 index 0000000..0f5cc0a --- /dev/null +++ b/recipes-bsp/imx8/imx-sc-firmware/imx-sc-firmware_0.9.bb @@ -0,0 +1,42 @@ +# Copyright (C) 2016 Freescale Semiconductor +# Copyright 2017-2018 NXP + +DESCRIPTION = "i.MX System Controller Firmware" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db" +SECTION = "BSP" + +inherit fsl-eula-unpack deploy + +SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true" + +SRC_URI[md5sum] = "3246a44a242b68fae601561a80d5925c" +SRC_URI[sha256sum] = "00024e0dd332b402df03b62eac9a515fabc903568d0ad7f30fabc7c98b494f15" + +SC_FIRMWARE_NAME_mx8qxp = "scfw_tcm_cfw.bin" +symlink_name = "scfw_tcm.bin" +SRC_URI += "file://scfw_tcm_cfw.bin" +SC_FIRMWARE_NAME = "scfw_tcm_cfw.bin" + +do_configure_prepend() { + cp ${WORKDIR}/scfw_tcm_cfw.bin ${B} +} + + +BOOT_TOOLS = "imx-boot-tools" + +do_compile[noexec] = "1" + +do_install[noexec] = "1" + +do_deploy() { + install -Dm 0644 ${S}/${SC_FIRMWARE_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME} + ln -sf ${SC_FIRMWARE_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/${symlink_name} +} +addtask deploy after do_install + +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +COMPATIBLE_MACHINE = "(mx8qm|mx8qxp)" diff --git a/recipes-bsp/imx8/imx-uuc/imx-uuc_git.bb b/recipes-bsp/imx8/imx-uuc/imx-uuc_git.bb new file mode 100644 index 0000000..ddc55db --- /dev/null +++ b/recipes-bsp/imx8/imx-uuc/imx-uuc_git.bb @@ -0,0 +1,20 @@ +# Copyright (C) 2016 Freescale Semiconductor + +SUMMARY = "A Daemon wait for Freescale/NXP mfgtools host's command" +SECTION = "base" +DEPENDS = "dosfstools-native" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +inherit autotools-brokensep + +PV = "0.5.1+git${SRCPV}" + +SRC_URI = "git://github.com/NXPmicro/imx-uuc.git;protocol=https" +SRCREV = "e3fbdfef978abd150d9ea71c4d174daded9c8d33" + +S = "${WORKDIR}/git" + +FILES_${PN} += "/linuxrc /fat" + +COMPATIBLE_MACHINE = "(imx)" diff --git a/recipes-bsp/imx8/u-boot/u-boot-imx8-nmhw23_git.bb b/recipes-bsp/imx8/u-boot/u-boot-imx8-nmhw23_git.bb new file mode 100644 index 0000000..3a4c7f2 --- /dev/null +++ b/recipes-bsp/imx8/u-boot/u-boot-imx8-nmhw23_git.bb @@ -0,0 +1,55 @@ +# Copyright (C) 2013-2016 Freescale Semiconductor +# Copyright 2018 (C) O.S. Systems Software LTDA. +# Copyright 2017-2019 NXP + +DESCRIPTION = "i.MX U-Boot suppporting i.MX reference boards." +require recipes-bsp/u-boot/u-boot.inc + +PROVIDES += "u-boot" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot;protocol=ssh;user=gitea;branch=2018.03/imx/imx8-nmhw23;destsuffix=git" +SRCREV ?= "${AUTOREV}" + +S = "${WORKDIR}/git" + + +inherit fsl-u-boot-localversion + +LOCALVERSION ?= "-${SRCBRANCH}" + +BOOT_TOOLS = "imx-boot-tools" + +do_configure_prepend() { + if [ ! -d ${S}/board/netmodule/common ]; then + mkdir -p ${S}/board/netmodule/ + ln -s ${S}/board/freescale/common ${S}/board/netmodule/common + fi +} + +do_deploy_append_mx8m() { + # Deploy the mkimage, u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary + 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}/tools/mkimage ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot + install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin + fi + done + unset j + done + unset i + fi +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(mx6|mx7|mx8)" diff --git a/recipes-bsp/u-boot/u-boot-imx8-nmhw23_git.bb b/recipes-bsp/u-boot/u-boot-imx8-nmhw23_git.bb deleted file mode 100644 index 0fc318e..0000000 --- a/recipes-bsp/u-boot/u-boot-imx8-nmhw23_git.bb +++ /dev/null @@ -1,28 +0,0 @@ -require u-boot-nm.inc - -DEPENDS += "bc-native coreutils-native dtc-native" - -# Force machine configuration for this recipe -UBOOT_MACHINE = "imx8_nmhw23_defconfig" - -# Be aware github/netmodule git -SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot;protocol=ssh;user=gitea;branch=2018.03/imx/imx8-nmhw23" - -# License -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e" - -# Should be updated when a new U-Boot Version is available -SRCREV ?= "${AUTOREV}" -PV = "v2018.03+git${SRCPV}" - -UBOOT_BINARY = "flash.bin" - -do_compile() { - sh ${B}build-imx8-nmhw23.sh -} - -do_deploy_append() { - cp ${S}/flash.bin ${DEPLOYDIR}/flash.bin - cp ${S}/flash.sd ${DEPLOYDIR}/flash.sd -} diff --git a/recipes-kernel/linux/linux-netmodule_git.bb b/recipes-kernel/linux/linux-netmodule_git.bb old mode 100755 new mode 100644 index 27a3531..437ae52 --- a/recipes-kernel/linux/linux-netmodule_git.bb +++ b/recipes-kernel/linux/linux-netmodule_git.bb @@ -11,6 +11,11 @@ SRC_URI = "git://git.netmodule.intranet/yoctoproject/linux-netmodule.git;protoco SRCREV ?= "${AUTOREV}" PV ?= "4.19.46-${SRCPV}" +SRC_URI_imx8-nmhw23 = "git://git.netmodule.intranet/yoctoproject/linux-netmodule.git;protocol=ssh;user=gitea;branch=4.14/develop/nmhw23" +SRCREV_imx8-nmhw23 ?= "${AUTOREV}" +PV_imx8-nmhw23 ?= "4.14.78-${SRCPV}" +LIC_FILES_CHKSUM_imx8-nmhw23 = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + PR = "r0" S = "${WORKDIR}/git" diff --git a/wic/sdimage-sota-nmhw23.wks b/wic/sdimage-sota-nmhw23.wks index d9d4acf..9132342 100644 --- a/wic/sdimage-sota-nmhw23.wks +++ b/wic/sdimage-sota-nmhw23.wks @@ -1,5 +1,5 @@ # short-description: Create OTA-enabled SD card image # long-description: Creates a partitioned SD card image with OSTree -part u-boot --source rawcopy --sourceparams="file=flash.bin" --ondisk mmcblk --no-table --align 32 +part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align 32 part / --source otaimage --ondisk mmcblk --fstype=ext4 --align 4096