Generate u-boot.img that contains all necessary binaries.
[platform/adaptation/rpi3/arm-trusted-firmware-rpi3.git] / packaging / arm-trusted-firmware.spec
1 %define buildplat rpi3
2 %define builddbg  1
3 %if %{builddbg} == 1
4 %define buildtype debug
5 %define compile_flags BUILD_STRING="" LOG_LEVEL=40 DEBUG=1 V=0 CRASH_REPORTING=1 SPD=opteed
6 %else
7 %define buildtype release
8 %define compile_flags BUILD_STRING="" LOG_LEVEL=20 DEBUG=0 V=0 CRASH_REPORTING=1 SPD=opteed
9 %endif
10
11 Name: atf-rpi3
12 Summary: Trusted firmware for Embedded boards based on ARM processor
13 Version: 2017.05
14 Release: 0
15 Group: Security/test
16 License: BSD 3-Clause
17 ExclusiveArch: aarch64
18 URL: https://github.com/linaro-swg/arm-trusted-firmware.git
19 Source0: %{name}-%{version}.tar.bz2
20
21 BuildRequires: git
22 BuildRequires: optee-os
23 BuildRequires: u-boot-rpi3
24 BuildRequires: u-boot-tools
25
26 Provides: optee.bin
27
28 %description
29 Trusted firmware for Embedded boards based on ARM processor
30
31 %prep
32 %setup -q -n optee-os
33
34 %build
35
36 # Build image
37 export CFLAGS="-O0 -gdwarf-2"
38 make %{?_smp_mflags}  BL32=/boot/tee.bin %{compile_flags} PLAT=%{buildplat} all
39
40 dd if=/dev/zero of=scratch bs=1c count=131072
41 cat build/%{buildplat}/%{buildtype}/bl31.bin scratch > bl31.tmp
42 dd if=bl31.tmp of=bl31.head bs=1c count=131072
43 cat bl31.head /boot/tee-pager.bin > optee.bin
44
45 rm scratch bl31.tmp bl31.head
46
47 cp /boot/spl/bcm2837-rpi-3-b.dtb .
48 cp /boot/spl/fit_spl_atf.its .
49 cp /boot/spl/u-boot-nodtb.bin .
50 cp %{_bindir}/mkimage .
51
52 %install
53 mkimage -E -f  fit_spl_atf.its u-boot.img
54 mkdir -p %{buildroot}/boot/
55 install u-boot.img %{buildroot}/boot/
56
57 %clean
58
59 %files
60 %defattr(-,root,root,-)
61 /boot/u-boot.img