From b98d9999c544afda343e2dc5a9472b6370122ca9 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 9 Jul 2019 08:43:56 +0900 Subject: [PATCH] packaging: rpi3: separate rpi3 spec file for 32bit Separate rpi3 spec file for 32bit. QB system can't parse the macro like %ifarch and %define. This patch is for building aarch64 architecture on QB system. Change-Id: Ia81bd81bf439feea2baf2de7dfeed8840a7ff683 Signed-off-by: Jaehoon Chung --- packaging/u-boot-rpi3-32b.spec | 97 ++++++++++++++++++++++++++++++++++ packaging/u-boot-rpi3.spec | 28 ++-------- 2 files changed, 101 insertions(+), 24 deletions(-) create mode 100644 packaging/u-boot-rpi3-32b.spec diff --git a/packaging/u-boot-rpi3-32b.spec b/packaging/u-boot-rpi3-32b.spec new file mode 100644 index 0000000000..c68dc0dac2 --- /dev/null +++ b/packaging/u-boot-rpi3-32b.spec @@ -0,0 +1,97 @@ +Name: u-boot-rpi3-32b +Version: 2017.03 +Release: 0 +Summary: Das U-Boot - Tizen bootloader +Group: System/Kernel +License: GPL-2.0+ +ExclusiveArch: %{arm} +URL: http://git.denx.de/u-boot.git +Source0: u-boot-%{version}.tar.bz2 +Source1001: u_boot_rpi3.manifest + +BuildRequires: gcc >= 4.8 +BuildRequires: flex +BuildRequires: bison + +%description +u-boot - Tizen bootloader for RPI3 boards based + +%package -n u-boot-tools +Summary: Companion tools for Das U-Boot bootloader +Group: System/Kernel +Provides: dtc + +%description -n u-boot-tools +This package includes the mkimage program, which allows generation of U-Boot +images in various formats, and the fw_printenv and fw_setenv programs to read +and modify U-Boot's environment. + + +%prep +%setup -q -n u-boot-%{version} + +%build +%{?asan:/usr/bin/gcc-unforce-options} +cp %{SOURCE1001} . + +CONFIG=rpi_3_32b_defconfig + +make mrproper + +# Build dtc +make HOSTCC="gcc $RPM_OPT_FLAGS" -C tools/dtc + +# Set configuration +make $CONFIG + +# Build tools +make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true tools + +make HOSTCC="gcc $RPM_OPT_FLAGS" env + +# Build u-boot +export PATH="$PATH:tools:tools/dtc/" +make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'` + +# Generate params.bin +cp `find ./common -name "env_common.o"` copy_env_common.o +objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"` +tr '\0' '\n' < copy_env_common.o > default_envs.txt +mkenvimage -s 16384 -o uboot.env default_envs.txt +rm copy_env_common.o default_envs.txt + +# Build boot.scr +mkimage -A arm -T script -C none -n "Tizen RPI3 u-boot helper" -d ./board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr ./boot.scr.uimg + +%install +rm -rf %{buildroot} + +# Tools installation +mkdir -p %{buildroot}%{_bindir} +install -p -m 0755 tools/mkimage %{buildroot}%{_bindir} +install -p -m 0755 tools/env/fw_printenv %{buildroot}%{_bindir} +install -p -m 0755 tools/dtc/dtc %{buildroot}%{_bindir} +( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv ) + +# u-boot installation +mkdir -p %{buildroot}/boot +install -m 755 u-boot.bin %{buildroot}/boot/ +install -m 755 uboot.env %{buildroot}/boot/ +install -m 755 boot.scr.uimg %{buildroot}/boot/ + +%clean + +%files +%manifest u_boot_rpi3.manifest +%defattr(-,root,root,-) +/boot/u-boot.bin +/boot/uboot.env +/boot/boot.scr.uimg + +%files -n u-boot-tools +%manifest u_boot_rpi3.manifest +%defattr(-,root,root,-) +%{_bindir}/mkimage +%{_bindir}/fw_printenv +%{_bindir}/fw_setenv +%{_bindir}/dtc diff --git a/packaging/u-boot-rpi3.spec b/packaging/u-boot-rpi3.spec index 30c63c0d00..1084d05ed4 100644 --- a/packaging/u-boot-rpi3.spec +++ b/packaging/u-boot-rpi3.spec @@ -1,20 +1,10 @@ -%ifarch aarch64 -%define config_name rpi_3_defconfig -%define target rpi3 -%define buildarch arm64 -%else -%define config_name rpi_3_32b_defconfig -%define target rpi3-32b -%define buildarch arm -%endif - -Name: u-boot-%{target} +Name: u-boot-rpi3 Version: 2017.03 Release: 0 Summary: Das U-Boot - Tizen bootloader Group: System/Kernel License: GPL-2.0+ -ExclusiveArch: %{arm} aarch64 +ExclusiveArch: aarch64 URL: http://git.denx.de/u-boot.git Source0: u-boot-%{version}.tar.bz2 Source1001: u_boot_rpi3.manifest @@ -57,7 +47,7 @@ and modify U-Boot's environment. %{?asan:/usr/bin/gcc-unforce-options} cp %{SOURCE1001} . -CONFIG=%{config_name} +CONFIG=rpi_3_defconfig make mrproper @@ -76,12 +66,10 @@ make HOSTCC="gcc $RPM_OPT_FLAGS" env export PATH="$PATH:tools:tools/dtc/" make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'` -%ifarch aarch64 # Build u-boot-spl as board/raspberrypi/rpi/head.S -o head.o objcopy -O binary head.o head.bin cat head.bin spl/u-boot-spl.bin > u-boot-spl.bin -%endif # Generate params.bin cp `find ./common -name "env_common.o"` copy_env_common.o @@ -91,7 +79,7 @@ mkenvimage -s 16384 -o uboot.env default_envs.txt rm copy_env_common.o default_envs.txt # Build boot.scr -mkimage -A %{buildarch} -T script -C none -n "Tizen RPI3 u-boot helper" -d ./board/raspberrypi/rpi/tizen-boot-%{target}.scr ./boot.scr.uimg +mkimage -A arm64 -T script -C none -n "Tizen RPI3 u-boot helper" -d ./board/raspberrypi/rpi/tizen-boot-rpi3.scr ./boot.scr.uimg %install rm -rf %{buildroot} @@ -104,20 +92,14 @@ install -p -m 0755 tools/dtc/dtc %{buildroot}%{_bindir} ( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv ) # u-boot installation -%ifarch aarch64 mkdir -p %{buildroot}/boot/spl -%else -mkdir -p %{buildroot}/boot -%endif install -m 755 u-boot.bin %{buildroot}/boot/ install -m 755 uboot.env %{buildroot}/boot/ install -m 755 boot.scr.uimg %{buildroot}/boot/ -%ifarch aarch64 install -m 755 u-boot-spl.bin %{buildroot}/boot/ install -m 755 u-boot-nodtb.bin %{buildroot}/boot/spl/ install -m 755 board/raspberrypi/rpi/fit_spl_atf.its %{buildroot}/boot/spl/ install -m 755 arch/arm/dts/bcm2837-rpi-3-b.dtb %{buildroot}/boot/spl/ -%endif %clean @@ -127,12 +109,10 @@ install -m 755 arch/arm/dts/bcm2837-rpi-3-b.dtb %{buildroot}/boot/spl/ /boot/u-boot.bin /boot/uboot.env /boot/boot.scr.uimg -%ifarch aarch64 /boot/u-boot-spl.bin /boot/spl/u-boot-nodtb.bin /boot/spl/fit_spl_atf.its /boot/spl/bcm2837-rpi-3-b.dtb -%endif %files -n u-boot-tools %manifest u_boot_rpi3.manifest -- 2.34.1