update to U-Boot 2019.07

Sinovoip_BPI_M2_Plus target was renamed to bananapi_m2_plus_h3
am335x_boneblack target replaced by am335x_evm
build rockpro64-rk3399 target as a few people have hardware (untested)

Add back flushing/disabling caches for armv7 efi which was removed in
2019.04 and later and is required to load kernels on i.MX 6.
The UEFI specification states that non-architectural caches
(not controlled by cp15 operations) should be disabled during boot time
services.  On i.MX 6 there is a PL310 L2 cache which U-Boot leaves on,
which breaks loading kernels even after we disable all the cp15
controlled caches in bootarm.efi.
This commit is contained in:
jsg 2019-07-28 06:57:19 +00:00
parent fb394ba1d1
commit bdfeccf961
10 changed files with 66 additions and 95 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.53 2019/07/12 20:49:53 sthen Exp $
# $OpenBSD: Makefile,v 1.54 2019/07/28 06:57:19 jsg Exp $
BROKEN-sparc64= Error: the specified option is not accepted in ISB at operand 1 -- isb sy
@ -6,8 +6,7 @@ FLAVORS= aarch64 arm
FLAVOR?= arm
COMMENT= U-Boot firmware
VERSION= 2019.01
REVISION= 5
VERSION= 2019.07
DISTNAME= u-boot-${VERSION}
PKGNAME= u-boot-${FLAVOR}-${VERSION:S/-//}
FULLPKGNAME= ${PKGNAME}
@ -69,11 +68,11 @@ BOARDS=\
mvebu_espressobin-88f3720 \
mvebu_mcbin-88f8040 \
qemu_arm64 \
rockpro64-rk3399 \
rpi_3
.elif "${FLAVOR}" == "arm"
OMAP=\
omap4_panda \
am335x_boneblack \
am335x_evm
SUNXI64=
SUNXI=\
@ -85,6 +84,7 @@ SUNXI=\
A20-OLinuXino_MICRO \
Bananapi \
Bananapi_m2m \
bananapi_m2_plus_h3 \
bananapi_m2_zero \
Bananapro \
CHIP \
@ -106,8 +106,7 @@ SUNXI=\
orangepi_pc_plus \
orangepi_plus \
orangepi_plus2e \
orangepi_zero \
Sinovoip_BPI_M2_Plus
orangepi_zero
IMX=\
cm_fx6 \
mx6cuboxi \
@ -142,6 +141,7 @@ FILES=\
u-boot-with-spl.bin \
u-boot.itb \
idbspl.img \
idbloader.img \
spl/sunxi-spl.bin \
pre-build:
@ -161,15 +161,14 @@ do-build:
-f ${MAKE_FILE} ${ALL_TARGET}
.if "${BOARD}" == "tinker-rk3288"
cd ${WRKSRC}/build/${BOARD} && \
tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin \
u-boot-with-spl.bin && \
cat u-boot-dtb.bin >> u-boot-with-spl.bin
tools/mkimage -n rk3288 -T rksd -d tpl/u-boot-tpl.bin \
idbloader.img && \
cat spl/u-boot-spl-dtb.bin >> idbloader.img
.endif
.if "${BOARD}" == "firefly-rk3399"
.if "${BOARD}" == "firefly-rk3399" || "${BOARD}" == "rockpro64-rk3399"
cd ${WRKSRC}/build/${BOARD} && \
ln -s ${RK3399_BL31} bl31.elf && \
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
O="build/${BOARD}" \
${SETENV} ${MAKE_ENV} BL31=${RK3399_BL31} ${MAKE_PROGRAM} \
${MAKE_FLAGS} O="build/${BOARD}" \
-f ${MAKE_FILE} u-boot.itb && \
tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
.endif

View File

@ -1,2 +1,2 @@
SHA256 (u-boot-2019.01.tar.bz2) = UL1+WkZquCiRTQgNX2pDI0W1AOj7oa07e2HpXmDVHCI=
SIZE (u-boot-2019.01.tar.bz2) = 13366005
SHA256 (u-boot-2019.07.tar.bz2) = v/T6d+jaF1IcAwykxblHoFbBsb5NPm7oY3AguNUCUdA=
SIZE (u-boot-2019.07.tar.bz2) = 13939667

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-arch_arm_dts_rk3399-firefly_dts,v 1.1 2019/01/17 20:41:47 kettenis Exp $
Index: arch/arm/dts/rk3399-firefly.dts
--- arch/arm/dts/rk3399-firefly.dts.orig
+++ arch/arm/dts/rk3399-firefly.dts
@@ -15,7 +15,7 @@
chosen {
stdout-path = &uart2;
- u-boot,spl-boot-order = &sdhci, &sdmmc;
+ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
};
backlight: backlight {

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-configs_firefly-rk3399_defconfig,v 1.1 2019/01/17 20:41:47 kettenis Exp $
$OpenBSD: patch-configs_firefly-rk3399_defconfig,v 1.2 2019/07/28 06:57:20 jsg Exp $
Index: configs/firefly-rk3399_defconfig
--- configs/firefly-rk3399_defconfig.orig
+++ configs/firefly-rk3399_defconfig
@@ -58,7 +58,7 @@ CONFIG_REGULATOR_RK8XX=y
@@ -42,7 +42,7 @@ CONFIG_PMIC_RK8XX=y
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_RK8XX=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_RAM=y
CONFIG_SPL_RAM=y
-CONFIG_BAUDRATE=1500000
+CONFIG_BAUDRATE=115200
CONFIG_DEBUG_UART_SHIFT=2

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-configs_rockpro64-rk3399_defconfig,v 1.1 2019/07/28 06:57:20 jsg Exp $
Index: configs/rockpro64-rk3399_defconfig
--- configs/rockpro64-rk3399_defconfig.orig
+++ configs/rockpro64-rk3399_defconfig
@@ -41,7 +41,7 @@ CONFIG_PMIC_RK8XX=y
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_RK8XX=y
CONFIG_PWM_ROCKCHIP=y
-CONFIG_BAUDRATE=1500000
+CONFIG_BAUDRATE=115200
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYSRESET=y
CONFIG_USB=y

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-include_efi_h,v 1.1 2019/04/09 22:32:48 patrick Exp $
Use 1ULL to make sure that when EFI_PAGE_MASK is used to mask
bits on 64-bit integers on 32-bit platforms it is 64-bit wide.
Index: include/efi.h
--- include/efi.h.orig
+++ include/efi.h
@@ -190,7 +190,7 @@ enum efi_mem_type {
#define EFI_MEM_DESC_VERSION 1
#define EFI_PAGE_SHIFT 12
-#define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT)
+#define EFI_PAGE_SIZE (1ULL << EFI_PAGE_SHIFT)
#define EFI_PAGE_MASK (EFI_PAGE_SIZE - 1)
struct efi_mem_desc {

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-lib_efi_loader_efi_boottime_c,v 1.5 2019/07/28 06:57:20 jsg Exp $
f69d63fae281ba98c3d063097cf4e95d17f3754d in 2019.04 and later stopped
flushing/disabling caches on armv7 which is required to load
OpenBSD/armv7 kernels on at least i.MX 6.
Index: lib/efi_loader/efi_boottime.c
--- lib/efi_loader/efi_boottime.c.orig
+++ lib/efi_loader/efi_boottime.c
@@ -2875,8 +2875,6 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image
if (ret != EFI_SUCCESS)
return EFI_EXIT(EFI_INVALID_PARAMETER);
- efi_is_direct_boot = false;
-
image_obj->exit_data_size = exit_data_size;
image_obj->exit_data = exit_data;

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-lib_efi_loader_efi_memory_c,v 1.3 2019/04/09 22:32:48 patrick Exp $
efi_allocate_pages() expects a (uint64_t *) pointer to pass the
address of the assigned memory. If we pass the address of a pointer
here, an illegal memory access occurs on 32bit systems. This patch
will be part of U-Boot 2019.04.
Index: lib/efi_loader/efi_memory.c
--- lib/efi_loader/efi_memory.c.orig
+++ lib/efi_loader/efi_memory.c
@@ -440,6 +440,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn
efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
{
efi_status_t r;
+ u64 addr;
struct efi_pool_allocation *alloc;
u64 num_pages = efi_size_in_pages(size +
sizeof(struct efi_pool_allocation));
@@ -453,9 +454,9 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uint
}
r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, pool_type, num_pages,
- (uint64_t *)&alloc);
-
+ &addr);
if (r == EFI_SUCCESS) {
+ alloc = (struct efi_pool_allocation *)(uintptr_t)addr;
alloc->num_pages = num_pages;
*buffer = alloc->data;
}

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PFRAG.aarch64,v 1.10 2019/02/07 20:50:19 phessler Exp $
@comment $OpenBSD: PFRAG.aarch64,v 1.11 2019/07/28 06:57:20 jsg Exp $
@pkgpath sysutils/u-boot-pinebook
share/u-boot/
share/u-boot/a64-olinuxino/
@ -86,6 +86,12 @@ share/u-boot/pinebook/u-boot.itb
share/u-boot/qemu_arm64/
share/u-boot/qemu_arm64/u-boot
share/u-boot/qemu_arm64/u-boot.bin
share/u-boot/rockpro64-rk3399/
share/u-boot/rockpro64-rk3399/idbspl.img
share/u-boot/rockpro64-rk3399/u-boot
share/u-boot/rockpro64-rk3399/u-boot.bin
share/u-boot/rockpro64-rk3399/u-boot.img
share/u-boot/rockpro64-rk3399/u-boot.itb
share/u-boot/rpi_3/
share/u-boot/rpi_3/u-boot
share/u-boot/rpi_3/u-boot.bin

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PFRAG.arm,v 1.17 2019/01/20 11:51:02 jsg Exp $
@comment $OpenBSD: PFRAG.arm,v 1.18 2019/07/28 06:57:20 jsg Exp $
@pkgpath sysutils/u-boot,
share/u-boot/
share/u-boot/A10-OLinuXino-Lime/
@ -19,13 +19,13 @@ share/u-boot/A20-OLinuXino-Lime/u-boot
share/u-boot/A20-OLinuXino-Lime/u-boot-sunxi-with-spl.bin
share/u-boot/A20-OLinuXino-Lime/u-boot.bin
share/u-boot/A20-OLinuXino-Lime/u-boot.img
share/u-boot/A20-OLinuXino-Lime2/
share/u-boot/A20-OLinuXino-Lime2-eMMC/
share/u-boot/A20-OLinuXino-Lime2-eMMC/sunxi-spl.bin
share/u-boot/A20-OLinuXino-Lime2-eMMC/u-boot
share/u-boot/A20-OLinuXino-Lime2-eMMC/u-boot-sunxi-with-spl.bin
share/u-boot/A20-OLinuXino-Lime2-eMMC/u-boot.bin
share/u-boot/A20-OLinuXino-Lime2-eMMC/u-boot.img
share/u-boot/A20-OLinuXino-Lime2/
share/u-boot/A20-OLinuXino-Lime2/sunxi-spl.bin
share/u-boot/A20-OLinuXino-Lime2/u-boot
share/u-boot/A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin
@ -121,22 +121,17 @@ share/u-boot/Orangepi_mini/u-boot
share/u-boot/Orangepi_mini/u-boot-sunxi-with-spl.bin
share/u-boot/Orangepi_mini/u-boot.bin
share/u-boot/Orangepi_mini/u-boot.img
share/u-boot/Sinovoip_BPI_M2_Plus/
share/u-boot/Sinovoip_BPI_M2_Plus/sunxi-spl.bin
share/u-boot/Sinovoip_BPI_M2_Plus/u-boot
share/u-boot/Sinovoip_BPI_M2_Plus/u-boot-sunxi-with-spl.bin
share/u-boot/Sinovoip_BPI_M2_Plus/u-boot.bin
share/u-boot/Sinovoip_BPI_M2_Plus/u-boot.img
share/u-boot/am335x_boneblack/
share/u-boot/am335x_boneblack/MLO
share/u-boot/am335x_boneblack/u-boot
share/u-boot/am335x_boneblack/u-boot.bin
share/u-boot/am335x_boneblack/u-boot.img
share/u-boot/am335x_evm/
share/u-boot/am335x_evm/MLO
share/u-boot/am335x_evm/u-boot
share/u-boot/am335x_evm/u-boot.bin
share/u-boot/am335x_evm/u-boot.img
share/u-boot/bananapi_m2_plus_h3/
share/u-boot/bananapi_m2_plus_h3/sunxi-spl.bin
share/u-boot/bananapi_m2_plus_h3/u-boot
share/u-boot/bananapi_m2_plus_h3/u-boot-sunxi-with-spl.bin
share/u-boot/bananapi_m2_plus_h3/u-boot.bin
share/u-boot/bananapi_m2_plus_h3/u-boot.img
share/u-boot/bananapi_m2_zero/
share/u-boot/bananapi_m2_zero/sunxi-spl.bin
share/u-boot/bananapi_m2_zero/u-boot
@ -240,8 +235,8 @@ share/u-boot/rpi_3_32b/
share/u-boot/rpi_3_32b/u-boot
share/u-boot/rpi_3_32b/u-boot.bin
share/u-boot/tinker-rk3288/
share/u-boot/tinker-rk3288/idbloader.img
share/u-boot/tinker-rk3288/u-boot
share/u-boot/tinker-rk3288/u-boot-with-spl.bin
share/u-boot/tinker-rk3288/u-boot.bin
share/u-boot/tinker-rk3288/u-boot.img
share/u-boot/turris_omnia/