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