2012-07-24 16:16:40 +02:00
|
|
|
#
|
|
|
|
# spec file for package u-boot
|
|
|
|
#
|
2019-11-20 09:10:56 +01:00
|
|
|
# Copyright (c) 2019 SUSE LLC
|
2012-08-07 08:24:10 +02:00
|
|
|
# Copyright (c) 2010 Texas Instruments Inc by Nishanth Menon
|
|
|
|
# Copyright (c) 2007-2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
2012-07-24 16:16:40 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-01-15 13:38:26 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-07-24 16:16:40 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%define target @BUILD_FLAVOR@
|
2015-08-10 09:16:06 +02:00
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%bcond_with uboot_atf
|
|
|
|
%bcond_with uboot_atf_pine64
|
|
|
|
|
2019-11-20 09:10:56 +01:00
|
|
|
%if "%_project" == "hardware:boot" || "%_project" == "hardware:boot:staging" || "%_project" == "openSUSE:Factory" || "%_project" == "openSUSE:Factory:ARM" || "%_project" == "openSUSE:Factory:PowerPC" || "%_project" == "openSUSE:Factory:RISCV"
|
2019-11-19 08:40:02 +01:00
|
|
|
|
|
|
|
# A complete multibuild-flavoured package is only built in above projects.
|
|
|
|
# In order to build a defined subset in forked projects, add the
|
|
|
|
# following to the respective project config (without the "#|"):
|
|
|
|
|
|
|
|
#|Macros:
|
|
|
|
#|%prjconf_multibuild_selection patch
|
|
|
|
#|:Macros
|
|
|
|
#|BuildFlags: onlybuild:u-boot:my-flavor1 onlybuild:u-boot:my-flavor2
|
|
|
|
#|BuildFlags: onlybuild:u-boot:my-flavor3 onlybuild:u-boot:my-flavor4
|
|
|
|
|
2019-11-20 09:10:56 +01:00
|
|
|
# If you opt to use onlybuild: to select U-Boot flavours and also
|
|
|
|
# have additional packages in that project, these need to be listed, too:
|
|
|
|
|
|
|
|
#|BuildFlags: onlybuild:package onlybuild:otherpackage onlybuild:thirdpackage
|
|
|
|
|
|
|
|
# Any packages not included in that list will neither build in that project
|
|
|
|
# nor in subprojects!
|
|
|
|
|
|
|
|
# It is still possible to enable the full multiboot set plus eventual
|
|
|
|
# additional packages by adding the Macros: [...] :Macros section and
|
|
|
|
# omitting the "onlybuild:"-lines.
|
|
|
|
|
2019-11-19 08:40:02 +01:00
|
|
|
%else
|
|
|
|
%if "%target" == "tools" || "%target" == ""
|
|
|
|
# At least build the tools.
|
|
|
|
%else
|
|
|
|
BuildRequires: %prjconf_multibuild_selection
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%define mvebu_spl 0
|
|
|
|
%define x_loader 0
|
|
|
|
%define rockchip_spl 0
|
2019-11-06 12:14:14 +01:00
|
|
|
%define rockchip_idb 0
|
2019-10-08 20:46:35 +02:00
|
|
|
%define sunxi_spl 0
|
|
|
|
%define arndale_spl 0
|
|
|
|
%define origen_spl 0
|
|
|
|
%define imx6_spl 0
|
|
|
|
%define socfpga_spl 0
|
|
|
|
|
|
|
|
%define binext .bin
|
|
|
|
|
|
|
|
%define is_armv6 0
|
|
|
|
%define is_armv7 0
|
|
|
|
%define is_armv8 0
|
|
|
|
%define is_ppc 0
|
|
|
|
%define is_riscv64 0
|
|
|
|
%define tools_only 0
|
|
|
|
|
2019-10-09 10:21:12 +02:00
|
|
|
%if "%target" == "rpi" || "%target" == "rpi2" || "%target" == "rpi3" || "%target" == "rpi4"
|
2019-10-08 20:46:35 +02:00
|
|
|
%define is_rpi 1
|
|
|
|
%if "%target" == "rpi"
|
|
|
|
%define is_armv6 1
|
|
|
|
%endif
|
|
|
|
%if "%target" == "rpi2"
|
|
|
|
%define is_armv7 1
|
|
|
|
%endif
|
2019-10-09 10:21:12 +02:00
|
|
|
%if "%target" == "rpi3" || "%target" == "rpi4"
|
2019-10-08 20:46:35 +02:00
|
|
|
%define is_armv8 1
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "firefly-rk3288" || "%target" == "tinker-rk3288"
|
|
|
|
%define is_armv7 1
|
|
|
|
%define rockchip_spl 1
|
|
|
|
%define soc_name "rk3288"
|
|
|
|
%if "%target" == "firefly-rk3288"
|
|
|
|
%define rkimages rksd rkimage
|
|
|
|
%else
|
|
|
|
%define rkimages rksd
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if "%target" == "rock64-rk3328"
|
|
|
|
%define is_rk3328 1
|
2019-11-06 12:14:14 +01:00
|
|
|
%define is_armv8 1
|
|
|
|
%define rockchip_idb 1
|
2019-10-08 20:46:35 +02:00
|
|
|
%define rockchip_spl 1
|
2019-11-06 12:14:14 +01:00
|
|
|
%define rkimages $()
|
|
|
|
%endif
|
|
|
|
%if "%target" == "evb-rk3399" || "%target" == "firefly-rk3399" || "%target" == "rock-pi-4-rk3399"
|
|
|
|
%define is_rk3399 1
|
|
|
|
%define is_armv8 1
|
|
|
|
%define rockchip_idb 1
|
2019-11-19 08:40:02 +01:00
|
|
|
%define rockchip_spl 1
|
|
|
|
%define rkimages $()
|
2019-10-08 20:46:35 +02:00
|
|
|
%endif
|
2019-11-06 12:14:14 +01:00
|
|
|
%if "%target" == "puma-rk3399" || "%target" == "rock960-rk3399"
|
2019-10-08 20:46:35 +02:00
|
|
|
%define is_rk3399 1
|
|
|
|
%define is_armv8 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "bananapim64" || "%target" == "nanopia64" || "%target" == "pine64plus" || "%target" == "pinebook"
|
|
|
|
%define is_a64 1
|
|
|
|
%define is_armv8 1
|
|
|
|
%define sunxi_spl 1
|
|
|
|
%define binext .itb
|
|
|
|
%endif
|
|
|
|
%if "%target" == "orangepipc2"
|
|
|
|
%define is_h5 1
|
|
|
|
%define is_armv8 1
|
|
|
|
%define sunxi_spl 1
|
|
|
|
%define binext .itb
|
|
|
|
%endif
|
|
|
|
%if "%target" == "pineh64"
|
|
|
|
%define is_h6 1
|
|
|
|
%define is_armv8 1
|
|
|
|
%define sunxi_spl 1
|
|
|
|
%define binext .itb
|
|
|
|
%endif
|
|
|
|
%if "%target" == "bananapi" || "%target" == "cubieboard" || "%target" == "cubieboard2" || "%target" == "cubietruck" || "%target" == "melea1000" || "%target" == "a10-olinuxino-lime" || "%target" == "a13-olinuxino" || "%target" == "a13-olinuxinom" || "%target" == "a20-olinuxino-lime" || "%target" == "a20-olinuxino-lime2" || "%target" == "a20-olinuxinomicro" || "%target" == "nanopineo" || "%target" == "orangepipc" || "%target" == "hyundaia7hd" || "%target" == "lamobor1" || "%target" == "bananapim2plush3"
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .img
|
|
|
|
%define sunxi_spl 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "clearfog" || "%target" == "turrisomnia"
|
|
|
|
%define mvebu_spl 1
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .img
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "mx53loco" || "%target" == "mx6qsabrelite"
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .imx
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "mx6cuboxi" || "%target" == "udoo" || "%target" == "udooneo"
|
|
|
|
%define imx6_spl 1
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .img
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "omap3beagle" || "%target" == "omap4panda" || "%target" == "am335xevm" || "%target" == "pcm051rev3"
|
|
|
|
%define x_loader 1
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .img
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "colibrit20" || "%target" == "am57xxevm"
|
|
|
|
%define is_armv7 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "arndale"
|
|
|
|
%define is_armv7 1
|
|
|
|
%define arndale_spl 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "dragonboard410c" || "%target" == "dragonboard820c"
|
|
|
|
%define is_armv8 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "geekbox" || "%target" == "hikey" || "%target" == "khadas-vim" || "%target" == "khadas-vim2" || "%target" == "libretech-ac" || "%target" == "libretech-cc" || "%target" == "ls1012afrdmqspi" || "%target" == "mvebudb-88f3720" || "%target" == "mvebudbarmada8k" || "%target" == "mvebuespressobin-88f3720" || "%target" == "mvebumcbin-88f8040" || "%target" == "odroid-c2" || "%target" == "p2371-2180" || "%target" == "p2771-0000-500" || "%target" == "poplar"
|
|
|
|
%define is_armv8 1
|
|
|
|
%endif
|
|
|
|
|
2019-10-09 09:07:17 +02:00
|
|
|
%if "%target" == "avnetultra96rev1" || "%target" == "xilinxzynqmpgeneric" || "%target" == "xilinxzynqmpzcu102rev10"
|
2019-10-08 20:46:35 +02:00
|
|
|
%define is_armv8 1
|
|
|
|
%define binext .elf
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "highbank" || "%target" == "jetson-tk1" || "%target" == "merriia80optimus" || "%target" == "nanopineoair" || "%target" == "odroid" || "%target" == "odroid-xu3" || "%target" == "paz00" || "%target" == "snow" || "%target" == "socfpgade0nanosoc" || "%target" == "spring"
|
|
|
|
%define is_armv7 1
|
|
|
|
%endif
|
|
|
|
|
2019-10-09 09:07:17 +02:00
|
|
|
%if "%target" == "zynqzturn"
|
|
|
|
%define is_armv7 1
|
|
|
|
%define binext .img
|
|
|
|
%endif
|
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%if "%target" == "qemu-riscv64" || "%target" == "qemu-riscv64smode" || "%target" == "sifivefu540"
|
|
|
|
%define is_riscv64 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%target" == "qemu-ppce500"
|
|
|
|
%define is_ppc 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# archive_version differs from version for RC version only
|
2019-10-09 09:41:11 +02:00
|
|
|
%define archive_version 2019.10
|
2019-10-08 20:46:35 +02:00
|
|
|
|
2019-10-23 13:30:55 +02:00
|
|
|
%if "%target" == "tools" || "%target" == ""
|
2012-07-24 16:16:40 +02:00
|
|
|
Name: u-boot
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
Name: u-boot-%target
|
|
|
|
%endif
|
2019-10-09 09:41:11 +02:00
|
|
|
Version: 2019.10
|
2012-07-24 16:16:40 +02:00
|
|
|
Release: 0
|
2019-10-08 20:46:35 +02:00
|
|
|
Summary: The U-Boot firmware for the %target platform
|
2018-04-09 11:18:07 +02:00
|
|
|
License: GPL-2.0-only
|
2012-07-24 16:16:40 +02:00
|
|
|
Group: System/Boot
|
2019-11-20 09:10:56 +01:00
|
|
|
URL: http://www.denx.de/wiki/U-Boot
|
2015-08-10 09:16:06 +02:00
|
|
|
Source: ftp://ftp.denx.de/pub/u-boot/u-boot-%{archive_version}.tar.bz2
|
2017-05-09 18:04:45 +02:00
|
|
|
Source1: ftp://ftp.denx.de/pub/u-boot/u-boot-%{archive_version}.tar.bz2.sig
|
2019-10-08 20:46:35 +02:00
|
|
|
Source2: arndale-bl1.img
|
|
|
|
Source300: u-boot-rpmlintrc
|
2019-10-23 18:48:02 +02:00
|
|
|
Source900: update_git.sh
|
2019-10-08 20:46:35 +02:00
|
|
|
# Patches: start
|
2018-07-18 15:39:52 +02:00
|
|
|
Patch0001: 0001-XXX-openSUSE-XXX-Prepend-partition-.patch
|
2018-05-15 11:14:56 +02:00
|
|
|
Patch0002: 0002-Revert-Revert-omap3-Use-raw-SPL-by-.patch
|
|
|
|
Patch0003: 0003-rpi-Use-firmware-provided-device-tr.patch
|
|
|
|
Patch0004: 0004-Temp-workaround-for-Chromebook-snow.patch
|
|
|
|
Patch0005: 0005-zynqmp-Add-generic-target.patch
|
2018-07-12 17:14:04 +02:00
|
|
|
Patch0006: 0006-tools-zynqmpbif-Add-support-for-loa.patch
|
2019-01-31 09:22:00 +01:00
|
|
|
Patch0007: 0007-boo-1123170-Remove-ubifs-support-fr.patch
|
2019-03-18 17:53:16 +01:00
|
|
|
Patch0008: 0008-zynqmp-generic-fix-compilation.patch
|
2019-10-09 09:41:11 +02:00
|
|
|
Patch0009: 0009-libfdt-fdt_address_cells-and-fdt_si.patch
|
|
|
|
Patch0010: 0010-libfdt-return-correct-value-if-size.patch
|
|
|
|
Patch0011: 0011-libfdt-Allow-size-cells-of-0.patch
|
|
|
|
Patch0012: 0012-dm-Fix-default-address-cells-return.patch
|
2019-11-19 08:40:02 +01:00
|
|
|
Patch0013: 0013-arm-arm11-allow-unaligned-memory-ac.patch
|
2019-10-08 20:46:35 +02:00
|
|
|
# Patches: end
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: pkgconfig(sdl)
|
|
|
|
%if 0%{?is_rk3328} && %{with uboot_atf}
|
|
|
|
BuildRequires: arm-trusted-firmware-rk3328
|
|
|
|
%endif
|
|
|
|
%if 0%{?is_rk3399} && %{with uboot_atf}
|
|
|
|
BuildRequires: arm-trusted-firmware-rk3399
|
|
|
|
|
|
|
|
%endif
|
|
|
|
%if (0%{?is_a64} || 0%{?is_h5}) && %{with uboot_atf}
|
|
|
|
BuildRequires: arm-trusted-firmware-sun50ia64
|
|
|
|
%endif
|
|
|
|
%if 0%{?is_h6} && %{with uboot_atf}
|
|
|
|
BuildRequires: arm-trusted-firmware-sun50ih6
|
|
|
|
%endif
|
|
|
|
BuildRequires: bc
|
2018-07-12 17:14:04 +02:00
|
|
|
BuildRequires: bison
|
2019-10-08 20:46:35 +02:00
|
|
|
# Arndale board needs DTC >= 1.4
|
|
|
|
BuildRequires: dtc >= 1.4.0
|
2018-07-12 17:14:04 +02:00
|
|
|
BuildRequires: flex
|
2019-10-08 20:46:35 +02:00
|
|
|
# u-boot-clearfog (tools/kwbimage.c) needs openssl to build
|
2014-09-08 21:29:09 +02:00
|
|
|
BuildRequires: libopenssl-devel
|
2019-10-08 20:46:35 +02:00
|
|
|
BuildRequires: python-devel
|
|
|
|
%if %{with uboot_atf}
|
2019-11-19 08:40:02 +01:00
|
|
|
%if "%{name}" == "u-boot-rock64-rk3328" || "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock960-rk3399" || "${name}" == "u-boot-rock-pi-4-rk3399"
|
2019-10-08 20:46:35 +02:00
|
|
|
# make_fit_atf.py
|
|
|
|
BuildRequires: python-pyelftools
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
BuildRequires: swig
|
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
# Owns /usr/share/qemu directory
|
|
|
|
BuildRequires: qemu
|
|
|
|
Provides: qemu-ppc:%{_datadir}/qemu/u-boot.e500
|
|
|
|
%endif
|
|
|
|
%if 0%{?is_rpi}
|
|
|
|
# Owns /boot/vc directory
|
|
|
|
BuildRequires: raspberrypi-firmware
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-zynqmp"
|
|
|
|
BuildRequires: zynqmp-dts
|
|
|
|
%endif
|
|
|
|
%if 0%{?is_rpi}
|
|
|
|
# For mountpoint
|
|
|
|
Requires(post): util-linux
|
|
|
|
%endif
|
|
|
|
Provides: u-boot-loader
|
|
|
|
Conflicts: otherproviders(u-boot-loader)
|
|
|
|
%if %x_loader == 1
|
|
|
|
Obsoletes: x-loader-%target
|
|
|
|
Provides: x-loader-%target
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-am335xevm"
|
|
|
|
# http://git.denx.de/?p=u-boot.git;a=commit;h=8fa7f65dd02c176ee6021eaf40114560b8954ba2
|
|
|
|
Obsoletes: am335x_boneblack
|
|
|
|
Provides: am335x_boneblack
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-bananapim2plush3"
|
|
|
|
# http://git.denx.de/?p=u-boot.git;a=commit;h=268ae6548779ccd8ba38ce39d43f41be7e0bc133
|
|
|
|
Obsoletes: Sinovoip_BPI_M2_Plus
|
|
|
|
Provides: Sinovoip_BPI_M2_Plus
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{target}" == ""
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%else
|
|
|
|
%if "%{target}" == "tools"
|
|
|
|
%define tools_only 1
|
|
|
|
%else
|
|
|
|
%if %is_armv8
|
|
|
|
ExclusiveArch: aarch64
|
|
|
|
%else
|
|
|
|
%if %is_armv7
|
|
|
|
ExclusiveArch: armv7l armv7hl
|
|
|
|
%else
|
|
|
|
%if %is_armv6
|
|
|
|
ExclusiveArch: armv6l armv6hl
|
|
|
|
%else
|
|
|
|
%if %is_ppc
|
|
|
|
ExclusiveArch: ppc
|
|
|
|
%else
|
|
|
|
%if %is_riscv64
|
|
|
|
ExclusiveArch: riscv64
|
|
|
|
%else
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
2012-07-24 16:16:40 +02:00
|
|
|
|
|
|
|
%description
|
2012-08-07 08:24:10 +02:00
|
|
|
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
|
2019-10-08 20:46:35 +02:00
|
|
|
This package contains the firmware for the %target platform.
|
2012-08-07 08:24:10 +02:00
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%if %tools_only
|
2012-08-07 08:24:10 +02:00
|
|
|
|
|
|
|
%package tools
|
2016-05-10 09:27:03 +02:00
|
|
|
Summary: Tools for the U-Boot Firmware
|
2012-08-07 08:24:10 +02:00
|
|
|
Group: System/Boot
|
|
|
|
|
|
|
|
%description tools
|
|
|
|
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
|
|
|
|
This package contains:
|
2016-05-10 09:27:03 +02:00
|
|
|
mkimage- a tool that creates kernel bootable images for U-Boot.
|
2012-07-24 16:16:40 +02:00
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation for the U-Boot Firmware
|
|
|
|
Group: Documentation/Other
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
|
|
|
|
This package contains documentation for U-Boot firmware.
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2012-07-24 16:16:40 +02:00
|
|
|
%prep
|
2015-08-10 09:16:06 +02:00
|
|
|
%setup -q -n u-boot-%{archive_version}
|
2019-10-08 20:46:35 +02:00
|
|
|
%autopatch -p1
|
2012-07-24 16:16:40 +02:00
|
|
|
|
|
|
|
%build
|
2019-10-08 20:46:35 +02:00
|
|
|
%if %tools_only
|
2014-09-08 21:29:09 +02:00
|
|
|
# needed for include/config/auto.conf
|
|
|
|
make defconfig
|
2018-07-12 17:14:04 +02:00
|
|
|
make syncconfig
|
2018-06-07 08:57:52 +02:00
|
|
|
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" tools-only
|
2012-07-24 16:16:40 +02:00
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/u-boot.changes | tail -n 1 | cut -d- -f1 )" +%s)
|
|
|
|
%if 0%{?is_a64} || 0%{?is_h5}
|
|
|
|
export BL31=/usr/share/arm-trusted-firmware-sun50ia64/bl31.bin
|
|
|
|
%endif
|
|
|
|
%if 0%{?is_h6}
|
|
|
|
export BL31=/usr/share/arm-trusted-firmware-sun50ih6/bl31.bin
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with uboot_atf}
|
|
|
|
%if "%{name}" == "u-boot-rock64-rk3328"
|
|
|
|
cp /usr/share/arm-trusted-firmware-rk3328/bl31.elf .
|
|
|
|
%endif
|
2019-11-19 08:40:02 +01:00
|
|
|
%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock-pi-4-rk3399"
|
2019-10-08 20:46:35 +02:00
|
|
|
cp /usr/share/arm-trusted-firmware-rk3399/bl31.elf .
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
confname=$(ls configs | perl -ne '$l=lc; $l=~ s,_,,g; $l eq "%{target}defconfig\n" && print;')
|
|
|
|
|
|
|
|
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" $confname
|
|
|
|
echo "Attempting to enable fdt apply command (.dtbo) support."
|
|
|
|
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
|
|
|
|
%if "%target" == "rpi3"
|
|
|
|
echo "Tweaking text base for TF-A."
|
|
|
|
echo "CONFIG_SYS_TEXT_BASE=0x11000000" >> .config
|
|
|
|
%endif
|
|
|
|
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" \
|
2019-11-19 08:40:02 +01:00
|
|
|
%if ("%{name}" == "u-boot-rock64-rk3328" || "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock-pi-4-rk3399") && %{with uboot_atf}
|
2019-10-08 20:46:35 +02:00
|
|
|
all u-boot.itb
|
|
|
|
%else
|
|
|
|
all
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch aarch64
|
|
|
|
%if %sunxi_spl == 1
|
|
|
|
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{name}" == "u-boot-snow" || "%{name}" == "u-boot-spring"
|
|
|
|
# Chromebook ARM (snow) and HP Chromebook 11 (spring) need a uImage format
|
|
|
|
export TEXT_START=$(awk '$NF == "_start" { printf "0x"$1 }' System.map)
|
|
|
|
./tools/mkimage -A arm -O linux -T kernel -C none -a $TEXT_START -e $TEXT_START -n uboot -d u-boot-dtb.bin u-boot.img
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %rockchip_spl == 1
|
|
|
|
for t in %{rkimages}; do
|
|
|
|
./tools/mkimage -n %soc_name -d spl/u-boot-spl.bin -T $t u-boot-spl.$t || exit 1
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2012-07-24 16:16:40 +02:00
|
|
|
%install
|
2019-10-08 20:46:35 +02:00
|
|
|
%if %tools_only
|
2012-08-07 08:24:10 +02:00
|
|
|
install -D -m 0755 tools/mkimage %{buildroot}%{_bindir}/mkimage
|
|
|
|
install -D -m 0644 doc/mkimage.1 %{buildroot}%{_mandir}/man1/mkimage.1
|
2012-07-24 16:16:40 +02:00
|
|
|
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/u-boot.changes | tail -n 1 | cut -d- -f1 )" +%s)
|
|
|
|
export NO_BRP_STRIP_DEBUG=true
|
|
|
|
export NO_DEBUGINFO_STRIP_DEBUG=true
|
|
|
|
%define uboot_dir /boot
|
|
|
|
%if 0%{?is_rpi}
|
|
|
|
%define uboot_dir /boot/vc
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
%define uboot_dir %{_datadir}/qemu
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-jetson-tk1"
|
|
|
|
# tegra-uboot-flasher needs several intermediate files, under their original name.
|
|
|
|
for f in u-boot u-boot.dtb u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin spl/u-boot-spl; do
|
|
|
|
install -D -m 0644 $f %{buildroot}%{uboot_dir}/$f
|
|
|
|
done
|
|
|
|
%else
|
|
|
|
%if "%{name}" == "u-boot-p2371-2180"
|
|
|
|
# Jetson TX1 Driver Pack flash.sh needs several intermediate files, under their original name.
|
|
|
|
for f in u-boot u-boot.bin u-boot.dtb u-boot-dtb.bin; do
|
|
|
|
install -D -m 0644 $f %{buildroot}%{uboot_dir}/$f
|
|
|
|
done
|
|
|
|
%else
|
|
|
|
install -D -m 0644 u-boot%{binext} %{buildroot}%{uboot_dir}/u-boot%{binext}
|
2019-11-06 12:14:14 +01:00
|
|
|
%if ("%{name}" == "u-boot-rock64-rk3328" || "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock-pi-4-rk3399") && %{with uboot_atf}
|
2019-10-08 20:46:35 +02:00
|
|
|
install -D -m 0644 u-boot.itb %{buildroot}%{uboot_dir}/u-boot.itb
|
|
|
|
%endif
|
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
mv %{buildroot}%{uboot_dir}/u-boot%{binext} %{buildroot}%{uboot_dir}/u-boot.e500
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if %x_loader == 1
|
|
|
|
install -D -m 0644 MLO %{buildroot}%{uboot_dir}/MLO
|
|
|
|
%endif
|
|
|
|
%if %origen_spl == 1
|
|
|
|
install -D -m 0644 spl/origen-spl.bin %{buildroot}%{uboot_dir}/origen-spl.bin
|
|
|
|
%endif
|
|
|
|
%if %arndale_spl == 1
|
|
|
|
install -D -m 0644 spl/arndale-spl.bin %{buildroot}%{uboot_dir}/arndale-spl.bin
|
|
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{uboot_dir}/arndale-bl1.img
|
|
|
|
%endif
|
|
|
|
%if %mvebu_spl == 1
|
|
|
|
install -D -m 0644 u-boot-spl.kwb %{buildroot}%{uboot_dir}/u-boot-spl.kwb
|
|
|
|
%endif
|
|
|
|
%if %rockchip_spl == 1
|
|
|
|
install -D -m 0644 spl/u-boot-spl.bin %{buildroot}%{uboot_dir}/u-boot-spl.bin
|
|
|
|
for t in %{rkimages}; do
|
|
|
|
install -D -m 0644 u-boot-spl.$t %{buildroot}%{uboot_dir}/u-boot-spl.$t
|
|
|
|
done
|
|
|
|
%endif
|
2019-11-06 12:14:14 +01:00
|
|
|
%if %rockchip_idb == 1
|
|
|
|
install -D -m 0644 idbloader.img %{buildroot}%{uboot_dir}/idbloader.img
|
|
|
|
%endif
|
2019-10-08 20:46:35 +02:00
|
|
|
%if %sunxi_spl == 1
|
|
|
|
install -D -m 0644 spl/sunxi-spl.bin %{buildroot}%{uboot_dir}/sunxi-spl.bin
|
|
|
|
install -D -m 0644 u-boot-sunxi-with-spl.bin %{buildroot}%{uboot_dir}/u-boot-sunxi-with-spl.bin
|
|
|
|
%endif
|
|
|
|
%if %imx6_spl == 1
|
|
|
|
install -D -m 0644 SPL %{buildroot}%{uboot_dir}/imx6-spl.bin
|
|
|
|
%endif
|
|
|
|
%if %socfpga_spl == 1
|
|
|
|
install -D -m 0644 u-boot-with-spl.sfp %{buildroot}%{uboot_dir}/u-boot-with-spl.sfp
|
|
|
|
%endif
|
2019-10-09 09:07:17 +02:00
|
|
|
%if "%{name}" == "u-boot-zynqzturn"
|
|
|
|
install -D -m 0644 spl/boot.bin %{buildroot}%{uboot_dir}/boot.bin
|
|
|
|
%endif
|
2019-10-08 20:46:35 +02:00
|
|
|
%if "%{name}" == "u-boot-rpi3"
|
|
|
|
echo -e "# Boot in AArch64 mode\narm_control=0x200" > %{buildroot}%{uboot_dir}/ubootconfig.txt
|
|
|
|
echo -e "\nkernel_address=0x11000000" >> %{buildroot}%{uboot_dir}/ubootconfig.txt
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?is_rpi}
|
|
|
|
%post
|
|
|
|
# On the Raspberry Pi we chain-load u-boot.bin from bootcode.bin via config.txt.
|
|
|
|
# It needs to be on the first FAT partition, wherever we mounted it.
|
|
|
|
# a) Unmounted, then do nothing.
|
|
|
|
# b) Mounted as /boot/vc, then they're in the right place already.
|
|
|
|
# c) Mounted as /boot/efi, with /boot/vc as symlink, then nothing to be done.
|
|
|
|
# d) Mounted as /boot/efi, with /boot/vc a directory, then copy files over.
|
|
|
|
if mountpoint -q /boot/efi; then
|
|
|
|
if ! [[ "$(readlink -f /boot/efi)" -ef "$(readlink -f %{uboot_dir})" ]]; then
|
|
|
|
[ -f %{uboot_dir}/ubootconfig.txt ] && cp %{uboot_dir}/ubootconfig.txt /boot/efi
|
|
|
|
cp %{uboot_dir}/u-boot%{binext} /boot/efi/
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %tools_only
|
2012-08-07 08:24:10 +02:00
|
|
|
%files tools
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
%files
|
|
|
|
%endif
|
2012-08-07 08:24:10 +02:00
|
|
|
%defattr(-,root,root)
|
2018-06-07 08:57:52 +02:00
|
|
|
%license Licenses/gpl-2.0.txt
|
2019-10-08 20:46:35 +02:00
|
|
|
%if %tools_only
|
2012-08-07 08:24:10 +02:00
|
|
|
%{_bindir}/mkimage
|
|
|
|
%{_mandir}/man1/mkimage.1.gz
|
2019-10-08 20:46:35 +02:00
|
|
|
%else
|
|
|
|
%doc README
|
|
|
|
%{uboot_dir}/*
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
# Generic documents
|
|
|
|
%doc doc/README.JFFS2 doc/README.JFFS2_NAND doc/README.commands
|
|
|
|
%doc doc/README.autoboot doc/README.commands doc/README.console doc/README.dns
|
|
|
|
%doc doc/README.hwconfig doc/README.nand doc/README.NetConsole doc/README.serial_multi
|
|
|
|
%doc doc/README.SNTP doc/README.standalone doc/README.update doc/README.usb
|
|
|
|
%doc doc/README.video doc/README.VLAN doc/README.silent doc/README.POST
|
|
|
|
# Copy some useful kermit scripts as well
|
|
|
|
%doc tools/kermit/dot.kermrc tools/kermit/flash_param tools/kermit/send_cmd tools/kermit/send_image
|
|
|
|
# Now any h/w dependent Documentation
|
|
|
|
%endif
|
2012-07-24 16:16:40 +02:00
|
|
|
|
|
|
|
%changelog
|