File project.diff of Package u-boot
--- _multibuild.orig
+++ _multibuild
@@ -28,6 +28,8 @@
<flavor>highbank</flavor>
<flavor>hikey</flavor>
<flavor>hyundaia7hd</flavor>
+ <flavor>imx8mm_evk</flavor>
+ <flavor>imx8mn_evk</flavor>
<flavor>jetson-tk1</flavor>
<flavor>khadas-vim</flavor>
<flavor>khadas-vim2</flavor>
--- u-boot.changes.orig
+++ u-boot.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Oct 29 21:04:00 UTC 2024 - Z. Wieback <zwieback66@yahoo.com>
+
+- Enable imx8mm and imx8mn evk boards
+
+-------------------------------------------------------------------
Tue Oct 22 09:33:57 UTC 2024 - Jianfeng Liu <liujianfeng1994@gmail.com>
- Add support for orangepi-3b-rk3566
--- u-boot.spec.orig
+++ u-boot.spec
@@ -18,6 +18,8 @@
#
+%bcond_with atf_optee
+
%define target @BUILD_FLAVOR@
%define mvebu_spl 0
%define x_loader 0
@@ -191,6 +193,17 @@
%if "%target" == "qemu-ppce500"
%define is_ppc 1
%endif
+%if "%target" == "imx8mm_evk"
+%define shared_uboot 1
+%define is_armv8 1
+%define is_imx8 1
+%define imx8_flavor mm
+%elif "%target" == "imx8mn_evk"
+%define shared_uboot 1
+%define is_armv8 1
+%define is_imx8 1
+%define imx8_flavor mn
+%endif
# archive_version differs from version for RC version only
%define archive_version 2024.10
%if "%{target}" == ""
@@ -273,7 +286,9 @@ BuildRequires: pkgconfig(uuid)
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: swig
+%if !0%{?shared_uboot}
Conflicts: u-boot-loader
+%endif
Provides: u-boot-loader
%if "%_project" == "hardware:boot" || "%_project" == "hardware:boot:staging" || "%_project" == "openSUSE:Factory" || "%_project" == "openSUSE:Factory:ARM" || "%_project" == "openSUSE:Factory:PowerPC" || "%_project" == "openSUSE:Factory:RISCV" || "%_project" == "openSUSE:Leap:15.2" || "%_project" == "openSUSE:Leap:15.2:ARM" || "%_project" == "openSUSE:Leap:15.2:PowerPC"
# A complete multibuild-flavoured package is only built in above projects.
@@ -326,6 +341,10 @@ BuildRequires: arm-trusted-firmware-sun
%if 0%{?is_h616}
BuildRequires: arm-trusted-firmware-sun50i_h616
%endif
+%if 0%{?is_imx8}
+BuildRequires: arm-trusted-firmware-imx8%{?imx8_flavor}
+BuildRequires: firmware-imx
+%endif
%if "%target" == "tools" || "%target" == "avnetultra96rev1" || "%target" == "clearfog" || "%target" == "mvebudb-88f3720" || "%target" == "mvebudbarmada8k" || "%target" == "mvebudbarmada8k3" || "%target" == "mvebuespressobin-88f3720" || "%target" == "mvebumcbin-88f8040" || "%target" == "turrisomnia"
# Fixes ld: cannot find -ltinfo: No such file or directory
BuildRequires: ncurses-devel
@@ -453,15 +472,30 @@ cp %{S:5} ./atf-bl31
cp %{S:6} ./rockchip-tpl
%endif
-%if %{is_zynq}
+%if 0%{?is_imx8}
+rm -f lpddr4_*.bin
+ln -s /usr/lib/firmware/imx/ddr/synopsys/lpddr4_*.bin .
+export BL31="%{_datadir}/arm-trusted-firmware-imx8%{?imx8_flavor}/bl31.bin"
+%if %{with atf_optee}
+export TEE="%{_prefix}/lib/optee/%{target}/tee-raw.bin"
+cat >> configs/"$confname" <<EOF
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+CONFIG_OPTEE_TA_AVB=y
+CONFIG_OPTEE_TA_SCP03=y
+CONFIG_OPTEE_SERVICE_DISCOVERY=y
+CONFIG_CHIMP_OPTEE=y
+EOF
+%endif
+confname="%{?target}_defconfig"
+echo CONFIG_CMD_GPT=y >> configs/"$confname"
+%elif %{is_zynq}
confname="xilinx_zynq_virt_defconfig"
-%else
-%if %{is_zynqmp}
+%elif %{is_zynqmp}
confname="xilinx_zynqmp_virt_defconfig"
%else
confname=$(ls configs | perl -ne '$l=lc; $l=~ s,_,,g; $l eq "%{target}defconfig\n" && print;')
%endif
-%endif
%if "%target" == "avnetultra96rev1"
export DEVICE_TREE=avnet-ultra96-rev1
@@ -474,8 +508,10 @@ export DEVICE_TREE=zynq-zturn-v5
%endif
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="%{optflags}" $confname
+%if !0%{?is_imx8}
echo "Attempting to enable fdt apply command (.dtbo) support."
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
+%endif
%if "%target" == "rpi3"
echo "Tweaking text base for TF-A."
echo "CONFIG_SYS_TEXT_BASE=0x11000000" >> .config
@@ -517,9 +553,12 @@ install -D -m 0644 doc/mkimage.1 %{build
%else
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
-%define uboot_dir /boot
-%if 0%{?is_rpi}
+%if 0%{?shared_uboot}
+%define uboot_dir %{_prefix}/lib/u-boot
+%elif 0%{?is_rpi}
%define uboot_dir /boot/vc
+%else
+%define uboot_dir /boot
%endif
%if "%{name}" == "u-boot-qemu-ppce500"
%define uboot_dir %{_datadir}/qemu
@@ -535,6 +574,8 @@ done
for f in u-boot u-boot.bin u-boot.dtb u-boot-dtb.bin; do
install -D -m 0644 $f %{buildroot}%{uboot_dir}/$f
done
+%elif 0%{?is_imx8}
+install -D -m 0644 flash.bin %{buildroot}%{uboot_dir}/flash-%{target}.bin
%else
install -D -m 0644 u-boot%{binext} %{buildroot}%{uboot_dir}/u-boot%{binext}
%if 0%{?rockchip_spl}
@@ -642,6 +683,9 @@ fi
%{_mandir}/man1/mkimage.1.gz
%else
%doc README
+%if 0%{?shared_uboot}
+%dir %{uboot_dir}
+%endif
%{uboot_dir}/*
%files doc