Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing support for imx8ulp #1101

Merged
merged 8 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KERNEL_META_REPO ?= "git://github.com/foundriesio/lmp-kernel-cache.git"
KERNEL_META_REPO_PROTOCOL ?= "https"
KERNEL_META_BRANCH ?= "linux-v5.15.y"
KERNEL_META_COMMIT ?= "605b27fffc287977ce7b481ce4fc4f77e9f63bbe"
KERNEL_META_COMMIT ?= "d1d97152bd5e02683e417b62d4868fb2f85bbe6d"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inherit deploy nopackages
INITRAMFS_IMAGE = "fsl-image-mfgtool-initramfs"
DEPENDS = "${INITRAMFS_IMAGE}"

UUU_RELEASE = "1.4.243"
UUU_RELEASE = "1.5.21"
MFGTOOL_FLASH_IMAGE ?= "lmp-base-console-image"

SRC_URI = " \
Expand All @@ -20,9 +20,9 @@ SRC_URI = " \
file://full_image.uuu.in \
"

SRC_URI[Linux.sha256sum] = "dfb2a6dca337ebd59675ea5ce7f1bce6724e3b901bcb455126d4bf9bdfa2e585"
SRC_URI[Mac.sha256sum] = "399efa4bc7e3eb452fefe89ef5e2e453b516ea716658a963a890c430ad81a471"
SRC_URI[Windows.sha256sum] = "f3f178e7be161c7dc058dbcd35c8cfa1516981e7c4f915fe0256ae4cda7f101e"
SRC_URI[Linux.sha256sum] = "84fccb00eec7b73ceee11feee34ca2d992d9860df1e91ad29fef891a50541119"
SRC_URI[Mac.sha256sum] = "7fd4d37c3e3c7a30b4ddc2965d06265301dd644c87a546276cdfc3e2223da14b"
SRC_URI[Windows.sha256sum] = "31d0d473e9184f229b99d8c77ea0c3d345c03c68b1568e794820e9df6c553f47"

S = "${WORKDIR}"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
From 0343108a32bef19383ecc80fac9fc4fec7dc7fb9 Mon Sep 17 00:00:00 2001
From: Ricardo Salveti <[email protected]>
Date: Tue, 4 Apr 2023 23:14:59 -0300
Subject: [PATCH] iMX8ULP: add SPL-only build

Upstream-Status: Inappropriate [lmp specific]

Signed-off-by: Ricardo Salveti <[email protected]>
---
iMX8ULP/soc.mak | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/iMX8ULP/soc.mak b/iMX8ULP/soc.mak
index a2f984e..5c579c5 100644
--- a/iMX8ULP/soc.mak
+++ b/iMX8ULP/soc.mak
@@ -39,6 +39,10 @@ u-boot-hash.bin: u-boot.bin
./$(MKIMG) -commit > head.hash
@cat u-boot.bin head.hash > u-boot-hash.bin

+# use this to trigger re-combining u-boot-spl.bin u-boot-spl.dtb
+u-boot-spl-combine:
+ @cat u-boot-spl-nodtb.bin u-boot-spl.dtb > u-boot-spl.bin
+
u-boot-atf.bin: u-boot-hash.bin bl31.bin
@cp bl31.bin u-boot-atf.bin
@dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128
@@ -74,6 +78,9 @@ flash_dualboot: $(MKIMG) u-boot-spl.bin u-boot-atf-container.img
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt;

+flash_dualboot_spl: $(MKIMG) u-boot-spl-combine
+ ./$(MKIMG) -soc ULP -c -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
+
flash_dualboot_flexspi: $(MKIMG) u-boot-spl.bin u-boot-atf-container.img
./$(MKIMG) -soc ULP -dev flexspi -c -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
@@ -98,6 +105,9 @@ flash_singleboot: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl.bin u-boot-atf-c
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt;

+flash_singleboot_spl: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl-combine
+ ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
+
flash_singleboot_flexspi: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl.bin u-boot-atf-container.img
./$(MKIMG) -soc ULP -dev flexspi -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
@@ -106,6 +116,9 @@ flash_singleboot_flexspi: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl.bin u-bo
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt;
./$(QSPI_PACKER) $(QSPI_HEADER)

+flash_singleboot_spl_m33: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) $(MCU_IMG) u-boot-spl-combine
+ ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
+
flash_singleboot_m33: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) u-boot-spl.bin
./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
cp flash.bin boot-spl-container.img
--
2.34.1

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
DEPENDS:remove = "optee-os"
DEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'virtual/optee-os', '', d)}"

M33_DEFAULT_IMAGE:mx8ulp-nxp-bsp = "imx8ulp_m33_TCM_power_mode_switch.bin"

SRC_URI:append:mx8m-nxp-bsp = " \
file://0002-iMX8M-add-SPL-only-build.patch \
file://0003-iMX8M-add-support-for-packing-HDMI-fw-in-SPL-only-bo.patch \
Expand All @@ -14,6 +16,9 @@ SRC_URI:append:mx8m-nxp-bsp = " \
SRC_URI:append:mx8qm-nxp-bsp = " \
file://0001-iMX8QM-add-SPL-only-build.patch \
"
SRC_URI:append:mx8ulp-nxp-bsp = " \
file://0001-iMX8ULP-add-SPL-only-build.patch \
"

do_compile[depends] = " \
virtual/bootloader:do_deploy \
Expand All @@ -22,56 +27,50 @@ do_compile[depends] = " \
${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'virtual/optee-os:do_deploy', '', d)} \
"

do_compile:prepend:mx8ulp-nxp-bsp() {
if [ -f ${DEPLOY_DIR_IMAGE}/${M33_DEFAULT_IMAGE} ]; then
cp ${DEPLOY_DIR_IMAGE}/${M33_DEFAULT_IMAGE} ${BOOT_STAGING}/m33_image.bin
fi
}

do_compile:prepend:mx8-nxp-bsp() {
for target in ${IMXBOOT_TARGETS}; do
if [ "${target}" = "flash_evk_spl" ] || [ "${target}" = "flash_evk_spl_ddr4" ]; then
# copy u-boot-spl-nodtb instead of u-boot-spl.bin as we need to have
# spl and its dtb separate (dt-spl.dtb will contain public hash of
# used to check the signature of u-boot fit-image)
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-spl-nodtb.bin-${MACHINE}-${UBOOT_CONFIG} \
${BOOT_STAGING}/u-boot-spl-nodtb.bin
cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}.dtb ${BOOT_STAGING}/u-boot-spl.dtb
if [ -e "${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin" ]; then
cp ${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin ${BOOT_STAGING}/signed_hdmi_imx8m.bin
fi
fi
done
# copy u-boot-spl-nodtb instead of u-boot-spl.bin as we need to have
# spl and its dtb separate (dt-spl.dtb will contain public hash of
# used to check the signature of u-boot fit-image)
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-spl-nodtb.bin-${MACHINE}-${UBOOT_CONFIG} \
${BOOT_STAGING}/u-boot-spl-nodtb.bin
cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}.dtb ${BOOT_STAGING}/u-boot-spl.dtb
if [ -e "${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin" ]; then
cp ${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin ${BOOT_STAGING}/signed_hdmi_imx8m.bin
fi
}

do_compile:append() {
for target in ${IMXBOOT_TARGETS}; do
if [ "${target}" = "flash_evk_spl" ] || [ "${target}" = "flash_evk_spl_ddr4" ]; then
if [ -e "${BOOT_STAGING}/flash.bin-nohdmi" ]; then
cp ${BOOT_STAGING}/flash.bin-nohdmi ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi
fi
if [ -e "${BOOT_STAGING}/flash.bin-nohdmi" ]; then
cp ${BOOT_STAGING}/flash.bin-nohdmi ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi
fi
done
}

do_install:append() {
for target in ${IMXBOOT_TARGETS}; do
if [ "${target}" = "flash_evk_spl" ] || [ "${target}" = "flash_evk_spl_ddr4" ]; then
if [ -e "${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi" ]; then
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${D}/boot/
fi
if [ -e "${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi" ]; then
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${D}/boot/
fi
done
}

do_deploy:append() {
for target in ${IMXBOOT_TARGETS}; do
if [ "${target}" = "flash_evk_spl" ] || [ "${target}" = "flash_evk_spl_ddr4" ]; then
# Also create imx-boot link with the machine name
if [ ! -e "${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}" ]; then
ln -sf ${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}
fi
if [ -e "${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi" ]; then
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${DEPLOYDIR}
ln -sf ${BOOT_CONFIG_MACHINE}-${target}-nohdmi \
${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-nohdmi
ln -sf ${BOOT_CONFIG_MACHINE}-${target}-nohdmi \
${DEPLOYDIR}/${BOOT_NAME}-nohdmi
fi
# Also create imx-boot link with the machine name
if [ ! -e "${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}" ]; then
ln -sf ${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}
fi
if [ -e "${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi" ]; then
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${DEPLOYDIR}
ln -sf ${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-nohdmi
ln -sf ${BOOT_CONFIG_MACHINE}-${target}-nohdmi ${DEPLOYDIR}/${BOOT_NAME}-nohdmi
fi
done
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2022 NXP
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "i.MX M33 core demo images"
SECTION = "BSP"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://COPYING;md5=5a0bf11f745e68024f37b4724a5364fe"

inherit deploy fsl-eula-unpack

SOC ?= "INVALID"
SOC:mx8ulp-nxp-bsp = "imx8ulp"
SOC:mx93-nxp-bsp = "imx93"

MCORE_TYPE = "m33"

SRC_URI = "${FSL_MIRROR}/${SOC}-${MCORE_TYPE}-demo-${PV}.bin;name=${SOC};fsl-eula=true"

S = "${WORKDIR}/${SOC}-${MCORE_TYPE}-demo-${PV}"

SRC_URI[imx8ulp.md5sum] = "7a4c8e667749d429f57a64cefc096d0e"
SRC_URI[imx8ulp.sha256sum] = "40d6184e50e5dfad78973ccf4da9fdd221737558b5ed8963167b6fd81e6752c4"

SRC_URI[imx93.md5sum] = "b63358a6ed6f2b95c8196c54140b4a23"
SRC_URI[imx93.sha256sum] = "e87cd109bf4a20c5f28ea9e927d300f59386c0e2edeef95e2e3496882101469f"

PACKAGE_ARCH = "${MACHINE_SOCARCH}"

do_configure[noexec] = "1"
do_compile[noexec] = "1"

do_install () {
install -d ${D}${nonarch_base_libdir}/firmware
install -m 0644 ${S}/*.elf ${D}${nonarch_base_libdir}/firmware
}

do_deploy () {
install -m 0644 ${S}/*.bin ${DEPLOYDIR}/
}

addtask deploy after do_install

FILES:${PN} = "${nonarch_base_libdir}/firmware"

INSANE_SKIP:${PN} = "arch"

COMPATIBLE_MACHINE = "(mx8ulp-nxp-bsp|mx93-nxp-bsp)"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/mnt/boot/uboot.env 0x0000 0x4000
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0

# boot partition
/dev/mmcblk0p1 /mnt/boot vfat noatime,sync 0 0