Accepting request 749423 from hardware👢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
This commit is contained in:
Guillaume GARDET 2019-11-19 07:40:02 +00:00 committed by Git OBS Bridge
parent d201b3f039
commit 9b6d4c9476
4 changed files with 108 additions and 4 deletions

View File

@ -0,0 +1,64 @@
From 50ae76602cfb1079a3062a18c1767dce525985f0 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
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 <cristian.ciocaltea@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
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 <linux/linkage.h>
+
+/*
+ * 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)

View File

@ -23,7 +23,6 @@
<flavor>evb-rk3399</flavor>
<flavor>firefly-rk3288</flavor>
<flavor>firefly-rk3399</flavor>
<flavor>rock-pi-4-rk3399</flavor>
<flavor>geekbox</flavor>
<flavor>highbank</flavor>
<flavor>hikey</flavor>
@ -65,6 +64,7 @@
<flavor>qemu-ppce500</flavor>
<flavor>qemu-riscv64</flavor>
<flavor>qemu-riscv64smode</flavor>
<flavor>rock-pi-4-rk3399</flavor>
<flavor>rock64-rk3328</flavor>
<flavor>rock960-rk3399</flavor>
<flavor>rpi</flavor>

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Tue Nov 19 07:34:54 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- 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 <matwey.kornilov@gmail.com>
- Build bootable u-boot.itb for u-boot-rock-pi-4-rk3399
-------------------------------------------------------------------
Mon Oct 28 14:33:55 UTC 2019 - Torsten Duwe <duwe@suse.com>
- Constrain multibuild expansion in linked/branched/copied packages.
-------------------------------------------------------------------
Sat Oct 26 16:24:56 UTC 2019 - Matwey Kornilov <matwey.kornilov@gmail.com>

View File

@ -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