imx8-mek: add imx8-mek target

This is the official NXP imx8 evaluation board used as preview for nmhw23
target.

Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
Andrejs Cainikovs 2019-05-10 12:52:43 +02:00 committed by Ramon Moesching
parent 168c584c96
commit aa546d3312
6 changed files with 98 additions and 12 deletions

View File

@ -0,0 +1 @@
WKS_FILE_sota = "sdimage-sota-mek.wks"

View File

@ -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"

View File

@ -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
}

View File

@ -65,20 +65,20 @@ UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
do_compile () { do_compile () {
if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then 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 sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk
fi fi
unset LDFLAGS unset LDFLAGS
unset CFLAGS unset CFLAGS
unset CPPFLAGS 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" ] if [ "x${UBOOT_CONFIG}" != "x" ]
then then
for config in ${UBOOT_MACHINE}; do for config in ${UBOOT_MACHINE}; do

View File

@ -49,6 +49,8 @@ do_install_append(){
cp Module.symvers ${STAGING_KERNEL_BUILDDIR}/ cp Module.symvers ${STAGING_KERNEL_BUILDDIR}/
} }
# NRHW18
do_install_append_armada-385-nrhw18() { do_install_append_armada-385-nrhw18() {
ln -s ${KERNEL_DTB_LINK_NAME}.dtb ${D}/${KERNEL_IMAGEDEST}/armada-385-nbhw18-prod4.dtb 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-prod4.dtb ${D}/${KERNEL_IMAGEDEST}/am335x-nbhw16-prod4.dtb
ln -s am335x-nrhw16-prod5.dtb ${D}/${KERNEL_IMAGEDEST}/am335x-nbhw16-prod5.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}"

5
wic/sdimage-sota-mek.wks Normal file
View File

@ -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