#global candidate rc0 # Binaries not used in standard manner so debuginfo is useless %global debug_package %{nil} Name: uboot-images-mvebu Version: 2022.10 Release: 1%{?candidate:.%{candidate}}%{?dist} Summary: ARM Trusted Firmware License: BSD URL: http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+Bootloader Source0: https://github.com/ARM-software/arm-trusted-firmware/archive/v2.7.tar.gz Source1: https://gitlab.nic.cz/turris/mox-boot-builder/-/archive/v2022.06.11/mox-boot-builder-v2022.06.11.tar.bz2 # next two sources are made by running make-git-snapshot-A3700.sh Source2: mv-ddr-marvell-20220922.tar.xz Source3: A3700-utils-marvell-20220922.tar.xz Source4: aarch64-mvebu Source5: make-git-snapshot-A3700.sh # At the moment we're only building on aarch64 ExclusiveArch: aarch64 BuildRequires: dtc BuildRequires: gcc gcc-c++ # This is needed for rk3399 which while aarch64 has an onboard Cortex-M0 base PMU BuildRequires: gcc-arm-linux-gnu BuildRequires: uboot-images-armv8 BuildRequires: cryptopp-devel BuildRequires: openssl-devel BuildRequires: git Requires: uboot-images-armv8 %description ARM Trusted firmware is a reference implementation of secure world software for ARMv8-A including Exception Level 3 (EL3) software. It provides a number of standard ARM interfaces like Power State Coordination (PSCI), Trusted Board Boot Requirements (TBBR) and Secure Monitor. Note: the contents of this package are generally just consumed by bootloaders such as u-boot. As such the binaries aren't of general interest to users. %ifarch aarch64 %package -n uboot-images-mvebu-armv8 Summary: u-boot images for mvebu platforms BuildArch: noarch %description -n uboot-images-mvebu-armv8 u-boot flash images for various marvell ARMv8-A SoCs. %endif %prep %setup -q -c -T -a 0 -a 1 -a 2 -a 3 cp %SOURCE4 . %build %undefine _auto_set_build_flags %ifarch aarch64 BASE_PATH=$(pwd) make -C mox-boot-builder-v2022.06.11 %{_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_CM3=arm-linux-gnu- wtmi_app.bin for soc in $(cat %{_arch}-mvebu) do board=$(echo $soc|sed -e 's|S.||' ) echo $board DDR=$(echo $soc|sed -e 's|^.*S||') echo $DDR make -C arm-trusted-firmware-2.7 %{_smp_mflags} CROSS_CM3=arm-linux-gnu- CC="gcc $RPM_OPT_FLAGS" \ USE_COHERENT_MEM=0 PLAT=a3700 \ CLOCKSPRESET=CPU_1000_DDR_800 DDR_TOPOLOGY=$DDR \ MV_DDR_PATH=$BASE_PATH/mv-ddr-marvell-20220922/ \ WTP=$BASE_PATH/A3700-utils-marvell-20220922/ \ CRYPTOPP_INCDIR=%{_includedir}/cryptopp/ CRYPTOPP_LIBDIR=%{_libdir} \ BL33=/usr/share/uboot/mvebu_espressobin-88f3720/u-boot.bin \ WTMI_IMG=$BASE_PATH/mox-boot-builder-v2022.06.11/wtmi_app.bin FIP_ALIGN=0x100 \ mrvl_flash mrvl_uart mkdir $board mv arm-trusted-firmware-2.7/build/a3700/release/flash-image.bin $board mv arm-trusted-firmware-2.7/build/a3700/release/uart-images.tgz.bin $board rm -rf arm-trusted-firmware-2.7/build/ done %endif %install mkdir -p %{buildroot}%{_datadir}/uboot/ %ifarch aarch64 for soc in $(cat %{_arch}-mvebu) do export board=$(echo $soc|sed -e 's|S.||') echo $board mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/ for file in flash-image.bin uart-images.tgz.bin do if [ -f $(echo $board)/$(echo $file) ]; then install -p -m 0644 $(echo $board)/$(echo $file) /%{buildroot}%{_datadir}/uboot/$(echo $board)/ fi done done %endif %ifarch aarch64 %files -n uboot-images-mvebu-armv8 %{_datadir}/uboot/* %endif %changelog * Fri Sep 23 2022 Dennis Gilmore - 2022.10-1 - initial build