From accf76c4316f71cc0b83e51988b4dca3f3cff947 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 9 Nov 2020 16:09:23 +0900 Subject: [PATCH] packaging: u-boot-c4: Add u-boot-c4 spec file Add u-boot-c4 spec file. Change-Id: I7452d64821cad3ff32c87233fe7c08b825988641 Signed-off-by: Jaehoon Chung --- packaging/u-boot-c4.spec | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 packaging/u-boot-c4.spec diff --git a/packaging/u-boot-c4.spec b/packaging/u-boot-c4.spec new file mode 100644 index 0000000..d6a8e50 --- /dev/null +++ b/packaging/u-boot-c4.spec @@ -0,0 +1,94 @@ +Name: u-boot-c4 +Version: 2020.10 +Release: 0 +Summary: Das U-Boot - Tizen bootloader +Group: System/Kernel +License: GPL-2.0+ +ExclusiveArch: aarch64 +URL: http://git.denx.de/u-boot.git +Source0: u-boot-%{version}.tar.bz2 +Source1001: u_boot_amlogic.manifest + +BuildRequires: gcc >= 6.0 +BuildRequires: flex +BuildRequires: bison + +%description +u-boot - Tizen bootloader for Embedded boards based on ARM processor + +%prep +%setup -q -n u-boot-%{version} + +%build +%{?asan:/usr/bin/gcc-unforce-options} +cp %{SOURCE1001} . + +## 1. ODROID-c4 Build ## +make mrproper + +# 1-1. Build dtc +make HOSTCC="gcc $RPM_OPT_FLAGS" -C tools/dtc + +# 1-2. Set configuration +make odroid-c4_defconfig + +# 1-3. Build tools +make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true tools + +make HOSTCC="gcc $RPM_OPT_FLAGS" envtools + +# 1-4. Build u-boot +export PATH="$PATH:tools:tools/dtc/" +make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'` + +# 1-5. Encryption +chmod +x ./fip/aml_encrypt_g12a +./fip/aml_encrypt_g12a --bl3sig --input u-boot.bin --compress lz4 \ + --output fip/c4/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 +./fip/aml_encrypt_g12a --bootmk \ + --output u-boot-c4.bin \ + --bl2 fip/c4/bl2.n.bin.sig \ + --bl30 fip/c4/bl30_new.bin.enc \ + --bl31 fip/c4/bl31.img.enc \ + --bl33 fip/c4/bl33.bin.enc \ + --ddrfw1 fip/c4/ddr4_1d.fw \ + --ddrfw2 fip/c4/ddr4_2d.fw \ + --ddrfw3 fip/c4/ddr3_1d.fw \ + --ddrfw4 fip/c4/piei.fw \ + --ddrfw5 fip/c4/lpddr4_1d.fw \ + --ddrfw6 fip/c4/lpddr4_2d.fw \ + --ddrfw7 fip/c4/diag_lpddr4.fw \ + --ddrfw8 fip/c4/aml_ddr.fw \ + --level v3 + +# 1-6. Generate params.bin +cp `find ./env -name "built-in.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 params.bin default_envs.txt +rm copy_env_common.o default_envs.txt + +# 1-7. Build Boot script +mkimage -A arm64 -T script -C none -n "Tizen ODROID-c4 u-boot helper" -d ./board/amlogic/odroid-n2/tizen-boot-odroid-c4-64b.scr ./boot.scr.uimg + + +%install +rm -rf %{buildroot} + +# 1-8. u-boot installation +mkdir -p %{buildroot}/boot/odroid-c4 +mkdir -p %{buildroot}/var/tmp/u-boot-amlogic +install -d %{buildroot}/var/tmp/u-boot-amlogic +install -m 755 u-boot-c4.bin %{buildroot}/var/tmp/u-boot-amlogic +install -m 755 params.bin %{buildroot}/boot/odroid-c4 +install -m 755 boot.scr.uimg %{buildroot}/boot/odroid-c4 + +%clean + +%files +%manifest u_boot_amlogic.manifest +%defattr(-,root,root,-) +/var/tmp/u-boot-amlogic +/boot/odroid-c4/params.bin +/boot/odroid-c4/boot.scr.uimg -- 2.7.4