diff --git a/classes/sota_imx8-mek.bbclass b/classes/sota_imx8-mek.bbclass new file mode 100644 index 0000000..f0072e9 --- /dev/null +++ b/classes/sota_imx8-mek.bbclass @@ -0,0 +1 @@ +WKS_FILE_sota = "sdimage-sota-mek.wks" diff --git a/conf/machine/imx8-mek.conf b/conf/machine/imx8-mek.conf new file mode 100644 index 0000000..f0b223e --- /dev/null +++ b/conf/machine/imx8-mek.conf @@ -0,0 +1,28 @@ +#@TYPE: Machine +#@NAME: NXP MEK Board +#@DESCRIPTION: Machine configuration for the mek evalboard + +require conf/machine/include/arm/arch-arm64.inc + +IMAGE_FSTYPES += "tar.gz cpio cpio.gz.u-boot" +IMAGE_CLASSES += "image_types" + +MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" + +KERNEL_DEFCONFIG = "" +KERNEL_DEVICETREE = "freescale/fsl-imx8qxp-mek.dtb freescale/fsl-imx8qxp-mek-dom0.dtb" + +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 = "imx8qxp_mek_defconfig" +IMAGE_BOOT_FILES = "flash.bin" + +PREFERRED_PROVIDER_virtual/kernel = "linux-netmodule" +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-imx8-mek" diff --git a/recipes-bsp/u-boot/u-boot-imx8-mek_git.bb b/recipes-bsp/u-boot/u-boot-imx8-mek_git.bb new file mode 100644 index 0000000..de25e18 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-imx8-mek_git.bb @@ -0,0 +1,36 @@ +require u-boot-nm.inc + +DEPENDS += "bc-native coreutils-native dtc-native" + +# Force machine configuration for this recipe +UBOOT_MACHINE = "imx8qxp_mek_defconfig" + +# Be aware github/netmodule git +SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot;protocol=ssh;user=gitea;branch=develop/nmhw22-bringup" + +# 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 = "v2019.04pre+git${SRCPV}" + +UBOOT_BINARY = "flash.bin" +UBOOT_MAKE_TARGET = "flash.bin" + +do_compile() { + export ATF_LOAD_ADDR=0x80000000 + export BL33_LOAD_ADDR=0x80020000 + oe_runmake ${UBOOT_MACHINE} + # TODO: move this to U-Boot defconfig + echo "CONFIG_CMD_EXT2=y" >> ${B}/.config + echo "CONFIG_CMD_EXT4=y" >> ${B}/.config + echo "CONFIG_CMD_EXT4_WRITE=y" >> ${B}/.config + oe_runmake ${UBOOT_MAKE_TARGET} + dd if=${S}/u-boot.itb of=${S}/flash.bin bs=512 seek=528 +} + +do_deploy_append() { + cp ${S}/flash.bin ${DEPLOYDIR}/flash.bin +} diff --git a/recipes-bsp/u-boot/u-boot-nm.inc b/recipes-bsp/u-boot/u-boot-nm.inc index e688d99..1e0ecc0 100644 --- a/recipes-bsp/u-boot/u-boot-nm.inc +++ b/recipes-bsp/u-boot/u-boot-nm.inc @@ -65,20 +65,20 @@ UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" do_compile () { - if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then - sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk - fi + if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then + sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk + fi - unset LDFLAGS - unset CFLAGS - unset CPPFLAGS + unset LDFLAGS + unset CFLAGS + unset CPPFLAGS + + if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] + then + echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion + echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion + fi - if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] - then - echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion - echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion - fi - if [ "x${UBOOT_CONFIG}" != "x" ] then for config in ${UBOOT_MACHINE}; do diff --git a/recipes-kernel/linux/linux-netmodule_git.bb b/recipes-kernel/linux/linux-netmodule_git.bb index 9334066..44f2c75 100755 --- a/recipes-kernel/linux/linux-netmodule_git.bb +++ b/recipes-kernel/linux/linux-netmodule_git.bb @@ -49,6 +49,8 @@ do_install_append(){ cp Module.symvers ${STAGING_KERNEL_BUILDDIR}/ } +# NRHW18 + do_install_append_armada-385-nrhw18() { ln -s ${KERNEL_DTB_LINK_NAME}.dtb ${D}/${KERNEL_IMAGEDEST}/armada-385-nbhw18-prod4.dtb } @@ -60,4 +62,18 @@ do_install_append_am335x-nrhw16() { ln -s am335x-nrhw16-prod4.dtb ${D}/${KERNEL_IMAGEDEST}/am335x-nbhw16-prod4.dtb ln -s am335x-nrhw16-prod5.dtb ${D}/${KERNEL_IMAGEDEST}/am335x-nbhw16-prod5.dtb } +# MEK + +do_configure_prepend_imx8-mek() { + install -d ${B} + mkdir -p ${B} + cp ${S}/arch/arm64/configs/defconfig ${B}/.config + echo "CONFIG_BLK_DEV_RAM=y" >> ${B}/.config + echo "CONFIG_BLK_DEV_RAM_COUNT=1" >> ${B}/.config + echo "CONFIG_BLK_DEV_RAM_SIZE=131072" >> ${B}/.config + echo "CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024" >> ${B}/.config + echo "CONFIG_INITRAMFS_COMPRESSION_GZIP=y" >> ${B}/.config +} +EXTRA_OEMAKE_append_imx8-mek = " ARCH=arm64" +KERNEL_EXTRA_ARGS_append_imx8-mek += "LOADADDR=${UBOOT_ENTRYPOINT}" diff --git a/wic/sdimage-sota-mek.wks b/wic/sdimage-sota-mek.wks new file mode 100644 index 0000000..d9d4acf --- /dev/null +++ b/wic/sdimage-sota-mek.wks @@ -0,0 +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 / --source otaimage --ondisk mmcblk --fstype=ext4 --align 4096