2015-10-08 08:25:53 +02:00
|
|
|
#
|
|
|
|
# spec file for package u-boot-spring
|
|
|
|
#
|
2019-01-15 13:38:26 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2015-10-08 08:25:53 +02:00
|
|
|
# Copyright (c) 2010 Texas Instruments Inc by Nishanth Menon
|
|
|
|
# Copyright (c) 2007-2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
|
|
|
#
|
|
|
|
# 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/
|
2015-10-08 08:25:53 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2018-06-07 08:57:52 +02:00
|
|
|
%bcond_with uboot_atf
|
2018-05-15 11:14:56 +02:00
|
|
|
%bcond_with uboot_atf_pine64
|
|
|
|
|
2016-05-10 09:27:03 +02:00
|
|
|
%define mvebu_spl 0
|
2015-10-08 08:25:53 +02:00
|
|
|
%define x_loader 0
|
2016-04-07 13:32:23 +02:00
|
|
|
%define rockchip_spl 0
|
2015-10-08 08:25:53 +02:00
|
|
|
%define sunxi_spl 0
|
|
|
|
%define arndale_spl 0
|
2016-05-10 09:27:03 +02:00
|
|
|
%define origen_spl 0
|
2017-02-14 00:42:17 +01:00
|
|
|
%define imx6_spl 0
|
2017-01-09 11:54:59 +01:00
|
|
|
%define socfpga_spl 0
|
2015-10-08 08:25:53 +02:00
|
|
|
|
2018-06-07 08:57:52 +02:00
|
|
|
%if "spring" == "rpi" || "spring" == "rpi2" || "spring" == "rpi3"
|
2017-04-20 20:53:21 +02:00
|
|
|
%define is_rpi 1
|
|
|
|
%endif
|
2019-01-15 13:38:26 +01:00
|
|
|
%if "spring" == "evb-rk3399" || "spring" == "firefly-rk3399" || "spring" == "puma-rk3399" || "spring" == "rock960-rk3399"
|
2018-06-07 08:57:52 +02:00
|
|
|
%define is_rk3399 1
|
|
|
|
%endif
|
2019-01-15 13:38:26 +01:00
|
|
|
%if "spring" == "bananapim64" || "spring" == "nanopia64" || "spring" == "pine64plus" || "spring" == "pinebook"
|
2018-11-15 18:08:45 +01:00
|
|
|
%define is_a64 1
|
|
|
|
%endif
|
|
|
|
%if "spring" == "orangepipc2"
|
|
|
|
%define is_h5 1
|
|
|
|
%endif
|
|
|
|
%if "spring" == "pineh64"
|
|
|
|
%define is_h6 1
|
|
|
|
%endif
|
2017-04-20 20:53:21 +02:00
|
|
|
|
2015-10-08 08:25:53 +02:00
|
|
|
# archive_version differs from version for RC version only
|
2019-01-15 13:38:26 +01:00
|
|
|
%define archive_version 2019.01
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
Name: u-boot-spring
|
2019-01-15 13:38:26 +01:00
|
|
|
Version: 2019.01
|
2015-10-08 08:25:53 +02:00
|
|
|
Release: 0
|
2016-05-10 09:27:03 +02:00
|
|
|
Summary: The U-Boot firmware for the spring platform
|
2018-04-09 11:18:07 +02:00
|
|
|
License: GPL-2.0-only
|
2015-10-08 08:25:53 +02:00
|
|
|
Group: System/Boot
|
|
|
|
Url: http://www.denx.de/wiki/U-Boot
|
|
|
|
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
|
2015-10-08 08:25:53 +02:00
|
|
|
Source2: arndale-bl1.img
|
2016-07-01 10:00:13 +02:00
|
|
|
Source3: update_git.sh
|
2015-10-08 08:25:53 +02:00
|
|
|
Source300: u-boot-rpmlintrc
|
2018-07-18 15:39:52 +02:00
|
|
|
Patch0001: 0001-XXX-openSUSE-XXX-Prepend-partition-.patch
|
2017-02-14 00:42:17 +01:00
|
|
|
Patch0002: 0002-Revert-Revert-omap3-Use-raw-SPL-by-.patch
|
2018-05-15 11:14:56 +02:00
|
|
|
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
|
2015-10-08 08:25:53 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2018-06-07 08:57:52 +02:00
|
|
|
%if 0%{?is_rk3399} && %{with uboot_atf}
|
|
|
|
BuildRequires: arm-trusted-firmware-rk3399
|
|
|
|
%endif
|
2018-11-15 18:08:45 +01:00
|
|
|
%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
|
2015-10-08 08:25:53 +02:00
|
|
|
BuildRequires: bc
|
2018-07-12 17:14:04 +02:00
|
|
|
BuildRequires: bison
|
2017-08-30 16:21:38 +02:00
|
|
|
# Arndale board needs DTC >= 1.4
|
2015-10-08 08:25:53 +02:00
|
|
|
BuildRequires: dtc >= 1.4.0
|
2018-07-12 17:14:04 +02:00
|
|
|
BuildRequires: flex
|
2017-04-20 20:53:21 +02:00
|
|
|
# u-boot-clearfog (tools/kwbimage.c) needs openssl to build
|
|
|
|
BuildRequires: libopenssl-devel
|
2017-08-30 16:21:38 +02:00
|
|
|
BuildRequires: python-devel
|
2018-06-07 08:57:52 +02:00
|
|
|
%if %{with uboot_atf}
|
|
|
|
%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399"
|
|
|
|
# make_fit_atf.py
|
|
|
|
BuildRequires: python-pyelftools
|
|
|
|
%endif
|
|
|
|
%endif
|
2017-08-30 16:21:38 +02:00
|
|
|
BuildRequires: swig
|
2016-02-17 10:26:12 +01:00
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
# Owns /usr/share/qemu directory
|
|
|
|
BuildRequires: qemu
|
|
|
|
Provides: qemu-ppc:%{_datadir}/qemu/u-boot.e500
|
|
|
|
%endif
|
2018-06-07 08:57:52 +02:00
|
|
|
%if 0%{?is_rpi}
|
|
|
|
# Owns /boot/vc directory
|
|
|
|
BuildRequires: raspberrypi-firmware
|
|
|
|
%endif
|
2018-05-15 11:14:56 +02:00
|
|
|
%if "%{name}" == "u-boot-zynqmp"
|
|
|
|
BuildRequires: zynqmp-dts
|
|
|
|
%endif
|
2017-04-20 20:53:21 +02:00
|
|
|
%if 0%{?is_rpi}
|
2016-09-05 21:24:33 +02:00
|
|
|
# For mountpoint
|
|
|
|
Requires(post): util-linux
|
2016-02-09 16:49:43 +01:00
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
Provides: u-boot-loader
|
|
|
|
Conflicts: otherproviders(u-boot-loader)
|
|
|
|
%if %x_loader == 1
|
|
|
|
Obsoletes: x-loader-spring
|
|
|
|
Provides: x-loader-spring
|
|
|
|
%endif
|
|
|
|
ExclusiveArch: armv7l armv7hl
|
|
|
|
|
|
|
|
%description
|
|
|
|
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
|
2016-05-10 09:27:03 +02:00
|
|
|
This package contains the firmware for the spring platform.
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%package doc
|
2016-05-10 09:27:03 +02:00
|
|
|
Summary: Documentation for the U-Boot Firmware
|
2015-10-08 08:25:53 +02:00
|
|
|
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.
|
2016-05-10 09:27:03 +02:00
|
|
|
This package contains documentation for U-Boot firmware.
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n u-boot-%{archive_version}
|
2016-07-01 10:00:13 +02:00
|
|
|
%patch0001 -p1
|
|
|
|
%patch0002 -p1
|
2017-08-30 16:21:38 +02:00
|
|
|
%patch0003 -p1
|
2017-10-05 11:58:22 +02:00
|
|
|
%patch0004 -p1
|
2018-03-15 19:03:58 +01:00
|
|
|
%patch0005 -p1
|
|
|
|
%patch0006 -p1
|
2019-01-31 09:22:00 +01:00
|
|
|
%patch0007 -p1
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%build
|
2017-02-14 00:42:17 +01:00
|
|
|
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%s)
|
2018-11-18 20:13:29 +01:00
|
|
|
%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
|
2017-10-24 22:23:41 +02:00
|
|
|
%endif
|
|
|
|
|
2018-06-07 08:57:52 +02:00
|
|
|
%if %{with uboot_atf}
|
|
|
|
%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399"
|
|
|
|
cp /usr/share/arm-trusted-firmware-rk3399/bl31.elf .
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2017-05-09 18:04:45 +02:00
|
|
|
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" spring_defconfig
|
2017-04-20 20:53:21 +02:00
|
|
|
echo "Attempting to enable fdt apply command (.dtbo) support."
|
|
|
|
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
|
2018-06-07 08:57:52 +02:00
|
|
|
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" \
|
|
|
|
%if ("%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399") && %{with uboot_atf}
|
|
|
|
all u-boot.itb
|
|
|
|
%else
|
|
|
|
all
|
|
|
|
%endif
|
2017-04-20 20:53:21 +02:00
|
|
|
|
2017-10-24 22:23:41 +02:00
|
|
|
%ifarch aarch64
|
|
|
|
%if %sunxi_spl == 1
|
|
|
|
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2015-10-08 08:25:53 +02:00
|
|
|
%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
|
2017-04-20 20:53:21 +02:00
|
|
|
|
2016-04-07 13:32:23 +02:00
|
|
|
%if %rockchip_spl == 1
|
|
|
|
for t in ; do
|
2016-10-20 23:08:26 +02:00
|
|
|
./tools/mkimage -n -d spl/u-boot-spl.bin -T $t u-boot-spl.$t
|
2016-04-07 13:32:23 +02:00
|
|
|
done
|
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%install
|
2017-02-14 00:42:17 +01:00
|
|
|
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%s)
|
2015-12-24 12:16:47 +01:00
|
|
|
export NO_BRP_STRIP_DEBUG=true
|
|
|
|
export NO_DEBUGINFO_STRIP_DEBUG=true
|
|
|
|
%define uboot_dir /boot
|
2017-04-20 20:53:21 +02:00
|
|
|
%if 0%{?is_rpi}
|
2015-12-24 12:16:47 +01:00
|
|
|
%define uboot_dir /boot/vc
|
|
|
|
%endif
|
2016-02-17 10:26:12 +01:00
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
%define uboot_dir %{_datadir}/qemu
|
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
%if "%{name}" == "u-boot-jetson-tk1"
|
|
|
|
# tegra-uboot-flasher needs several intermediate files, under their original name.
|
2016-04-07 13:32:23 +02:00
|
|
|
for f in u-boot u-boot.dtb u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin spl/u-boot-spl; do
|
2017-10-24 22:23:41 +02:00
|
|
|
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
|
2015-10-08 08:25:53 +02:00
|
|
|
done
|
|
|
|
%else
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 u-boot.img %{buildroot}%{uboot_dir}/u-boot.img
|
2018-06-07 08:57:52 +02:00
|
|
|
%if ("%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399") && %{with uboot_atf}
|
|
|
|
install -D -m 0644 u-boot.itb %{buildroot}%{uboot_dir}/u-boot.itb
|
|
|
|
%endif
|
2016-02-17 10:26:12 +01:00
|
|
|
%if "%{name}" == "u-boot-qemu-ppce500"
|
|
|
|
mv %{buildroot}%{uboot_dir}/u-boot.img %{buildroot}%{uboot_dir}/u-boot.e500
|
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
%endif
|
2017-10-24 22:23:41 +02:00
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
%if %x_loader == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 MLO %{buildroot}%{uboot_dir}/MLO
|
2015-10-08 08:25:53 +02:00
|
|
|
%endif
|
|
|
|
%if %origen_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 spl/origen-spl.bin %{buildroot}%{uboot_dir}/origen-spl.bin
|
2015-10-08 08:25:53 +02:00
|
|
|
%endif
|
|
|
|
%if %arndale_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
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
|
2015-10-08 08:25:53 +02:00
|
|
|
%endif
|
2016-05-10 09:27:03 +02:00
|
|
|
%if %mvebu_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 u-boot-spl.kwb %{buildroot}%{uboot_dir}/u-boot-spl.kwb
|
2016-05-10 09:27:03 +02:00
|
|
|
%endif
|
2016-04-07 13:32:23 +02:00
|
|
|
%if %rockchip_spl == 1
|
2016-10-20 23:08:26 +02:00
|
|
|
install -D -m 0644 spl/u-boot-spl.bin %{buildroot}%{uboot_dir}/u-boot-spl.bin
|
2016-04-07 13:32:23 +02:00
|
|
|
for t in ; do
|
|
|
|
install -D -m 0644 u-boot-spl.$t %{buildroot}%{uboot_dir}/u-boot-spl.$t
|
|
|
|
done
|
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
%if %sunxi_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
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
|
2016-02-09 16:49:43 +01:00
|
|
|
%endif
|
2017-02-14 00:42:17 +01:00
|
|
|
%if %imx6_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 SPL %{buildroot}%{uboot_dir}/imx6-spl.bin
|
2017-02-14 00:42:17 +01:00
|
|
|
%endif
|
2017-01-09 11:54:59 +01:00
|
|
|
%if %socfpga_spl == 1
|
2017-10-24 22:23:41 +02:00
|
|
|
install -D -m 0644 u-boot-with-spl.sfp %{buildroot}%{uboot_dir}/u-boot-with-spl.sfp
|
2017-01-09 11:54:59 +01:00
|
|
|
%endif
|
2018-06-07 08:57:52 +02:00
|
|
|
%if "%{name}" == "u-boot-rpi3"
|
|
|
|
echo -e "# Boot in AArch64 mode\narm_control=0x200" > %{buildroot}%{uboot_dir}/ubootconfig.txt
|
|
|
|
%endif
|
2015-10-08 08:25:53 +02:00
|
|
|
|
2017-04-20 20:53:21 +02:00
|
|
|
%if 0%{?is_rpi}
|
2016-09-05 21:24:33 +02:00
|
|
|
%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
|
2018-06-07 08:57:52 +02:00
|
|
|
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.img /boot/efi/
|
|
|
|
fi
|
2016-09-05 21:24:33 +02:00
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
2015-10-08 08:25:53 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-06-07 08:57:52 +02:00
|
|
|
%license Licenses/gpl-2.0.txt
|
|
|
|
%doc README
|
2016-02-09 16:49:43 +01:00
|
|
|
%{uboot_dir}/*
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%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
|
2016-02-26 22:18:42 +01:00
|
|
|
%doc doc/README.video doc/README.VLAN doc/README.silent doc/README.POST
|
2015-10-08 08:25:53 +02:00
|
|
|
# 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
|
2017-01-09 11:54:59 +01:00
|
|
|
%doc doc/README.ARM-memory-map
|
2015-10-08 08:25:53 +02:00
|
|
|
|
|
|
|
%changelog
|