--- /dev/null
+--- hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/acs/acs_entry.S.orig 2021-03-29 03:39:35.000000000 +0200
++++ hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/acs/acs_entry.S 2021-11-28 02:02:25.014983869 +0100
+@@ -7,5 +7,5 @@
+ #ifdef CONFIG_MDUMP_COMPRESS
+ .word __ramdump_data
+ #else
+- .word 0x0
+-#endif
+\ No newline at end of file
++ .quad 0x0
++#endif
--- /dev/null
+--- hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile.orig 2021-11-21 15:35:31.551670174 +0100
++++ hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile 2021-11-21 15:38:26.863510869 +0100
+@@ -6,7 +6,8 @@
+ include $(buildtree)/.config
+
+ # Select ARMv7-m bare-metal toolchain
+-CROSS_COMPILE=arm-none-eabi-
++ARM_CROSS_COMPILE=arm-none-eabi-
++override CROSS_COMPILE=$(ARM_CROSS_COMPILE)
+ ASM=$(CROSS_COMPILE)as
+ CC=$(CROSS_COMPILE)gcc
+ CPP=$(CROSS_COMPILE)cpp
--- /dev/null
+--- hardkernel-uboot-odroid/include/linux/compiler-gcc.h.orig 2021-03-29 03:39:35.000000000 +0200
++++ hardkernel-uboot-odroid/include/linux/compiler-gcc.h 2021-11-21 15:25:04.044889807 +0100
+@@ -111,7 +111,11 @@
+ #define __gcc_header(x) #x
+ #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
+ #define gcc_header(x) _gcc_header(x)
++#if __GNUC__ >= 4
++#include gcc_header(4)
++#else
+ #include gcc_header(__GNUC__)
++#endif
+
+ #if !defined(__noclone)
+ #define __noclone /* not needed */
--- /dev/null
+--- hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/scp_task/uart.c.orig 2021-11-21 15:42:14.755011547 +0100
++++ hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/scp_task/uart.c 2021-11-21 15:42:26.868250049 +0100
+@@ -20,7 +20,6 @@
+ */
+
+ #include "registers.h"
+-#include <stdint.h>
+ #include "task_apis.h"
+
+ /* #define P_AO_UART_WFIFO (0xc81004c0) */
--- /dev/null
+--- hardkernel-uboot-odroid/fip/Makefile.orig 2021-03-29 03:39:35.000000000 +0200
++++ hardkernel-uboot-odroid/fip/Makefile 2021-11-21 17:32:49.696089392 +0100
+@@ -13,6 +13,7 @@
+ AML_USER_KEY := $(srctree)/$(BOARDDIR)/aml-user-key.sig
+ FIP_BL32_PROCESS =
+ DDR_FW_NAME := aml_ddr.fw
++UBOOT_PAYLOAD := $(buildtree)/u-boot.bin
+
+ ifeq ($(CONFIG_AML_BL33_COMPRESS_ENABLE),y)
+ BL33_COMPRESS_FLAG := --compress lz4
+@@ -71,7 +72,7 @@
+
+ FIP_ARGS := --bl30 $(buildtree)/fip/bl30_new.bin \
+ --bl31 $(buildsrc)/fip/$(SOC)/bl31.$(BL3X_SUFFIX) \
+- --bl33 $(buildtree)/u-boot.bin
++ --bl33 $(UBOOT_PAYLOAD)
+
+ $(buildtree)/fip/fip.bin: FORCE
+ $(Q)echo Building $@...
+@@ -122,7 +123,7 @@
+ --input $(buildsrc)/fip/$(SOC)/bl32.$(BL3X_SUFFIX) \
+ --output $(buildtree)/fip/bl32.$(BL3X_SUFFIX).enc))
+ $(call encrypt_step, --bl3sig --type bl33 $(V3_PROCESS_FLAG) $(BL33_COMPRESS_FLAG) \
+- --input $(buildtree)/u-boot.bin \
++ --input $(UBOOT_PAYLOAD) \
+ --output $(buildtree)/fip/bl33.bin.enc)
+ endif
+ $(call encrypt_step, --bl2sig \
--- /dev/null
+--- hardkernel-uboot-odroid/Makefile.orig 2021-03-29 03:39:35.000000000 +0200
++++ hardkernel-uboot-odroid/Makefile 2021-11-21 15:31:27.980593091 +0100
+@@ -589,7 +589,6 @@
+ KBUILD_CPPFLAGS += $(KCPPFLAGS)
+ KBUILD_AFLAGS += $(KAFLAGS)
+ KBUILD_CFLAGS += $(KCFLAGS)
+-KBUILD_CFLAGS += -Werror
+
+ # Use UBOOTINCLUDE when you must reference the include/ directory.
+ # Needed to be compatible with the O= option
+--- hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/acs/Makefile.orig 2021-11-21 15:33:42.835979314 +0100
++++ hardkernel-uboot-odroid/arch/arm/cpu/armv8/g12b/firmware/acs/Makefile 2021-11-21 15:33:54.685870737 +0100
+@@ -180,7 +180,7 @@
+ -mgeneral-regs-only -D__ASSEMBLY__ \
+ ${DEFINES} ${INCLUDES}
+ CFLAGS += -nostdinc -pedantic -ffreestanding -Wall \
+- -Werror -mgeneral-regs-only -std=c99 -c -Os \
++ -mgeneral-regs-only -std=c99 -c -Os \
+ ${DEFINES} ${INCLUDES} $(VPATH_LIST:%=-I%)
+ CFLAGS += -ffunction-sections -fdata-sections
+ ASFLAGS += ${FIRMWARE_CPPFLAGS}
--- /dev/null
+--- hardkernel-uboot-odroid/fip/Makefile.orig 2021-11-21 17:41:53.590511510 +0100
++++ hardkernel-uboot-odroid/fip/Makefile 2021-11-22 11:19:57.287486043 +0100
+@@ -67,7 +67,7 @@
+ endef
+
+ define encrypt_step
+- $(Q)$(buildsrc)/fip/$(SOC)/aml_encrypt_$(SOC) $1
++ $(Q)$(X86_64_STATIC_WRAPPER) $(buildsrc)/fip/$(SOC)/aml_encrypt_$(SOC) $1
+ endef
+
+ FIP_ARGS := --bl30 $(buildtree)/fip/bl30_new.bin \
+--- hardkernel-uboot-odroid/fip/Makefile.orig 2021-03-29 03:39:35.000000000 +0200
++++ hardkernel-uboot-odroid/fip/Makefile 2021-11-21 17:27:36.244548072 +0100
+@@ -97,8 +97,8 @@
+ $(eval FIP_BL32_PROCESS := --bl32 $(buildsrc)/fip/$(SOC)/bl32.$(BL3X_SUFFIX).enc)
+ endif
+ endif
+- $(Q)$(buildsrc)/fip/fip_create $(FIP_ARGS) $@
+- $(Q)$(buildsrc)/fip/fip_create --dump $@
++ $(Q)$(X86_64_DYNAMIC_WRAPPER) $(buildsrc)/fip/fip_create $(FIP_ARGS) $@
++ $(Q)$(X86_64_DYNAMIC_WRAPPER) $(buildsrc)/fip/fip_create --dump $@
+
+ # build final bootloader
+ $(Q)cat $(buildtree)/fip/bl2_new.bin $(buildtree)/fip/fip.bin > $(buildtree)/fip/boot_new.bin
Group: Applications/System
Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}.tar.bz2
# Source0-md5: f1392080facf59dd2c34096a5fd95d4c
+Source1: https://github.com/hardkernel/u-boot/archive/travis/odroidc4-189/odroid-189.tar.gz
+# Source1-md5: dd117b6180ad5c9abb3303b31e57e7b4
Patch0: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
Patch1: %{name}-pbp_usb_hang.patch
Patch2: rk3399-emmc.patch
+Patch3: hardkernel-uboot-gcc5.patch
+Patch4: hardkernel-uboot-werror.patch
+Patch5: hardkernel-uboot-arm_cross.patch
+Patch6: hardkernel-uboot-no_stdint.patch
+Patch7: hardkernel-uboot-x86_64_bin.patch
+Patch8: hardkernel-uboot-acs.patch
+Patch9: hardkernel-uboot-uboot_payload.patch
URL: https://www.denx.de/wiki/U-Boot
-%ifarch aarch64
-BuildRequires: arm-trusted-firmware-armv8
-%endif
BuildRequires: bison
BuildRequires: dtc
BuildRequires: flex
BuildRequires: openssl-devel
BuildRequires: rpmbuild(macros) >= 2.007
+%ifarch aarch64
+BuildRequires: arm-trusted-firmware-armv8
+BuildRequires: box64
+BuildRequires: crossarm-gcc
+BuildRequires: qemu-user
+BuildConflicts: libfdt-devel
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define common_configs tools-only
%define arch_configs rpi_2
%endif
%ifarch aarch64
-%define arch_configs pinebook-pro-rk3399
+%define arch_configs odroid-n2 pinebook-pro-rk3399
%endif
%define configs %{common_configs} %{?arch_configs}
bootloader dla wielu różnych architektur komputerów, w tym PPC, ARM,
AVR32, MIPS, x86, 68k, Nios i MicroBlaze.
+%package image-odroid-n2
+Summary: U-Boot firmware images for Odroid N2/N2+
+Summary(pl.UTF-8): Obrazy firmware'u U-Boot dla urządzeń Odroid N2/N2+
+Group: Applications/System
+
+%description image-odroid-n2
+U-Boot firmware images for Odroid N2/N2+.
+
+%description image-odroid-n2 -l pl.UTF-8
+Obrazy firmware'u U-Boot dla urządzeń Odroid N2/N2+.
+
%package image-pinebook-pro
Summary: U-Boot firmware images for Pinebook Pro
Summary(pl.UTF-8): Obrazy firmware'u U-Boot dla urządzeń Pinebook Pro
%ifarch aarch64
%patch1 -p1
%patch2 -p1
+install -d build/hardkernel-uboot-odroid
+tar xf %{SOURCE1} -C build/hardkernel-uboot-odroid
+mv build/hardkernel-uboot-odroid/u-boot*/* build/hardkernel-uboot-odroid
+cd build/hardkernel-uboot-odroid
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+cd ../..
%endif
%build
V=1 \
O=build/$config
done
+%ifarch aarch64
+cd build/hardkernel-uboot-odroid
+%{__make} odroidn2_defconfig \
+ V=1
+%{__make} \
+ CROSS_COMPILE= \
+ ARM_CROSS_COMPILE=arm-linux-gnueabi- \
+ UBOOT_PAYLOAD=$(pwd)/../odroid-n2/u-boot.bin \
+ X86_64_DYNAMIC_WRAPPER=/usr/bin/box64 \
+ X86_64_STATIC_WRAPPER=/usr/bin/qemu-x86_64 \
+ V=1
+cd ../..
+%endif
%install
rm -rf $RPM_BUILD_ROOT
elif echo ' %rk3399_configs ' | grep -q " $config "; then
install -d $RPM_BUILD_ROOT%{imagedir}/$config
cp -p build/$config/{idbloader.img,u-boot.itb} $RPM_BUILD_ROOT%{imagedir}/$config
+ elif [ $config = "odroid-n2" ]; then
+ install -d $RPM_BUILD_ROOT%{imagedir}/$config
+ cp -p build/hardkernel-uboot-odroid/sd_fuse/u-boot.bin $RPM_BUILD_ROOT%{imagedir}/$config
else
install -d $RPM_BUILD_ROOT%{imagedir}/$config
cp -p build/$config/u-boot.bin $RPM_BUILD_ROOT%{imagedir}/$config
%dir %{imagedir}
%ifarch aarch64
+%files image-odroid-n2
+%defattr(644,root,root,755)
+%{imagedir}/odroid-n2
+
%files image-pinebook-pro
%defattr(644,root,root,755)
%{imagedir}/pinebook-pro-rk3399