From 9b6d4c94765a3bfb433bf0360b5e67afbb0000fb3f6da95754489d6cda4d043c Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Tue, 19 Nov 2019 07:40:02 +0000 Subject: [PATCH] Accepting request 749423 from hardware:boot:staging - Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2019.10 * Patch added to fix boo#1145646: 0013-arm-arm11-allow-unaligned-memory-ac.patch - Build bootable u-boot.itb for u-boot-rock-pi-4-rk3399 - Constrain multibuild expansion in linked/branched/copied packages. OBS-URL: https://build.opensuse.org/request/show/749423 OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=58 --- ...-arm-arm11-allow-unaligned-memory-ac.patch | 64 +++++++++++++++++++ _multibuild | 2 +- u-boot.changes | 17 +++++ u-boot.spec | 29 ++++++++- 4 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 0013-arm-arm11-allow-unaligned-memory-ac.patch diff --git a/0013-arm-arm11-allow-unaligned-memory-ac.patch b/0013-arm-arm11-allow-unaligned-memory-ac.patch new file mode 100644 index 0000000..c02341c --- /dev/null +++ b/0013-arm-arm11-allow-unaligned-memory-ac.patch @@ -0,0 +1,64 @@ +From 50ae76602cfb1079a3062a18c1767dce525985f0 Mon Sep 17 00:00:00 2001 +From: Heinrich Schuchardt +Date: Tue, 19 Nov 2019 04:02:10 +0100 +Subject: [PATCH] arm: arm11: allow unaligned memory access + +The UEFI spec mandates that unaligned memory access should be enabled if +supported by the CPU architecture. + +This patch implements the function unaligned_access() to set the enable +unaligned data support flag and to clear the aligned flag in the system +control register (SCTLR). It is called when UEFI related commands like +bootefi are invoked. + +Reported-by: Cristian Ciocaltea +Signed-off-by: Heinrich Schuchardt +--- + arch/arm/cpu/arm11/Makefile | 4 ++++ + arch/arm/cpu/arm11/sctlr.S | 25 +++++++++++++++++++++++++ + 2 files changed, 29 insertions(+) + create mode 100644 arch/arm/cpu/arm11/sctlr.S + +diff --git a/arch/arm/cpu/arm11/Makefile b/arch/arm/cpu/arm11/Makefile +index 5d721fce12..5dfa01ae8d 100644 +--- a/arch/arm/cpu/arm11/Makefile ++++ b/arch/arm/cpu/arm11/Makefile +@@ -4,3 +4,7 @@ + # Wolfgang Denk, DENX Software Engineering, wd@denx.de. + + obj-y = cpu.o ++ ++ifneq ($(CONFIG_SPL_BUILD),y) ++obj-$(CONFIG_EFI_LOADER) += sctlr.o ++endif +diff --git a/arch/arm/cpu/arm11/sctlr.S b/arch/arm/cpu/arm11/sctlr.S +new file mode 100644 +index 0000000000..74a7fc4a25 +--- /dev/null ++++ b/arch/arm/cpu/arm11/sctlr.S +@@ -0,0 +1,25 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Routines to access the system control register ++ * ++ * Copyright (c) 2019 Heinrich Schuchardt ++ */ ++ ++#include ++ ++/* ++ * void allow_unaligned(void) - allow unaligned access ++ * ++ * This routine sets the enable unaligned data support flag and clears the ++ * aligned flag in the system control register. ++ * After calling this routine unaligned access does no longer leads to a ++ * data abort or undefined behavior but is handled by the CPU. ++ * For details see the "ARM Architecture Reference Manual" for ARMv6. ++ */ ++ENTRY(allow_unaligned) ++ mrc p15, 0, r0, c1, c0, 0 @ load system control register ++ orr r0, r0, #1 << 22 @ set unaligned data support flag ++ bic r0, r0, #2 @ clear aligned flag ++ mcr p15, 0, r0, c1, c0, 0 @ write system control register ++ bx lr @ return ++ENDPROC(allow_unaligned) diff --git a/_multibuild b/_multibuild index 14b43c3..ac2866e 100644 --- a/_multibuild +++ b/_multibuild @@ -23,7 +23,6 @@ evb-rk3399 firefly-rk3288 firefly-rk3399 - rock-pi-4-rk3399 geekbox highbank hikey @@ -65,6 +64,7 @@ qemu-ppce500 qemu-riscv64 qemu-riscv64smode + rock-pi-4-rk3399 rock64-rk3328 rock960-rk3399 rpi diff --git a/u-boot.changes b/u-boot.changes index 5be091e..7951ff7 100644 --- a/u-boot.changes +++ b/u-boot.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Nov 19 07:34:54 UTC 2019 - Guillaume GARDET + +- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2019.10 +* Patch added to fix boo#1145646: + 0013-arm-arm11-allow-unaligned-memory-ac.patch + +------------------------------------------------------------------- +Tue Nov 12 17:32:31 UTC 2019 - Matwey Kornilov + +- Build bootable u-boot.itb for u-boot-rock-pi-4-rk3399 + +------------------------------------------------------------------- +Mon Oct 28 14:33:55 UTC 2019 - Torsten Duwe + +- Constrain multibuild expansion in linked/branched/copied packages. + ------------------------------------------------------------------- Sat Oct 26 16:24:56 UTC 2019 - Matwey Kornilov diff --git a/u-boot.spec b/u-boot.spec index f6d02ad..ce93e0e 100644 --- a/u-boot.spec +++ b/u-boot.spec @@ -23,6 +23,26 @@ %bcond_with uboot_atf %bcond_with uboot_atf_pine64 +%if "%_project" == "hardware:boot" || "%_project" == "hardware:boot:staging" || "%_project" == "openSUSE:Factory:ARM" + +# 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 + +%else +%if "%target" == "tools" || "%target" == "" +# At least build the tools. +%else +BuildRequires: %prjconf_multibuild_selection +%endif +%endif + %define mvebu_spl 0 %define x_loader 0 %define rockchip_spl 0 @@ -76,6 +96,8 @@ %define is_rk3399 1 %define is_armv8 1 %define rockchip_idb 1 +%define rockchip_spl 1 +%define rkimages $() %endif %if "%target" == "puma-rk3399" || "%target" == "rock960-rk3399" %define is_rk3399 1 @@ -200,6 +222,7 @@ 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 +Patch0013: 0013-arm-arm11-allow-unaligned-memory-ac.patch # Patches: end BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: pkgconfig(sdl) @@ -225,7 +248,7 @@ BuildRequires: flex BuildRequires: libopenssl-devel BuildRequires: python-devel %if %{with uboot_atf} -%if "%{name}" == "u-boot-rock64-rk3328" || "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock960-rk3399" +%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" # make_fit_atf.py BuildRequires: python-pyelftools %endif @@ -345,7 +368,7 @@ export BL31=/usr/share/arm-trusted-firmware-sun50ih6/bl31.bin %if "%{name}" == "u-boot-rock64-rk3328" cp /usr/share/arm-trusted-firmware-rk3328/bl31.elf . %endif -%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" +%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399" || "%{name}" == "u-boot-rock-pi-4-rk3399" cp /usr/share/arm-trusted-firmware-rk3399/bl31.elf . %endif %endif @@ -360,7 +383,7 @@ echo "Tweaking text base for TF-A." echo "CONFIG_SYS_TEXT_BASE=0x11000000" >> .config %endif make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" \ -%if ("%{name}" == "u-boot-rock64-rk3328" || "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399") && %{with uboot_atf} +%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} all u-boot.itb %else all