From aa1634ec212b89284d1f1e3cb12fcbee2a93e955 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Tue, 15 Dec 2020 15:02:39 +0000 Subject: [PATCH] sysutils/u-boot-rpi-arm64: Add new port This u-boot is intended to boot on all 64bits variants of the RPI boards like the RPI2v1.1, RPI3* and RPI* Suggested by: karels --- sysutils/Makefile | 1 + sysutils/u-boot-rpi-arm64/Makefile | 18 ++++++++++++++++++ .../files/patch-lib_efi__loader_efi__console.c | 13 +++++++++++++ .../u-boot-rpi-arm64/files/rpi_arm64_fragment | 2 ++ sysutils/u-boot-rpi-arm64/pkg-descr | 6 ++++++ 5 files changed, 40 insertions(+) create mode 100644 sysutils/u-boot-rpi-arm64/Makefile create mode 100644 sysutils/u-boot-rpi-arm64/files/patch-lib_efi__loader_efi__console.c create mode 100644 sysutils/u-boot-rpi-arm64/files/rpi_arm64_fragment create mode 100644 sysutils/u-boot-rpi-arm64/pkg-descr diff --git a/sysutils/Makefile b/sysutils/Makefile index 89e306580eb9..0e466eac664b 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1404,6 +1404,7 @@ SUBDIR += u-boot-rpi3 SUBDIR += u-boot-rpi3-32 SUBDIR += u-boot-rpi4 + SUBDIR += u-boot-rpi-arm64 SUBDIR += u-boot-sinovoip-bpi-m3 SUBDIR += u-boot-sopine SUBDIR += u-boot-sopine-spi diff --git a/sysutils/u-boot-rpi-arm64/Makefile b/sysutils/u-boot-rpi-arm64/Makefile new file mode 100644 index 000000000000..e9a3e339fea6 --- /dev/null +++ b/sysutils/u-boot-rpi-arm64/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +MASTERDIR= ${.CURDIR}/../u-boot-master + +EXTRA_PATCHES= ${.CURDIR}/files/ +PATCHFILES+= 939129/raw + +MODEL= rpi-arm64 +BOARD_CONFIG= rpi_arm64_defconfig +FAMILY= rpi +UBOOT_ARCH= aarch64 + +DEPENDS= ${LOCALBASE}/share/rpi-firmware/bootcode.bin:sysutils/rpi-firmware + +CONFIG_FRAGMENT= ${.CURDIR}/files/rpi_arm64_fragment +FRAGMENT_NAME= rpi_arm64_fragment + +.include "${MASTERDIR}/Makefile" diff --git a/sysutils/u-boot-rpi-arm64/files/patch-lib_efi__loader_efi__console.c b/sysutils/u-boot-rpi-arm64/files/patch-lib_efi__loader_efi__console.c new file mode 100644 index 000000000000..4065ae9ccb48 --- /dev/null +++ b/sysutils/u-boot-rpi-arm64/files/patch-lib_efi__loader_efi__console.c @@ -0,0 +1,13 @@ +--- lib/efi_loader/efi_console.c.orig 2018-03-13 12:02:19 UTC ++++ lib/efi_loader/efi_console.c +@@ -547,8 +547,8 @@ int efi_console_register(void) + printf("ERROR: Failed to register console event\n"); + return r; + } +- /* 5000 ns cycle is sufficient for 2 MBaud */ +- r = efi_set_timer(console_timer_event, EFI_TIMER_PERIODIC, 50); ++ /* 100 ms */ ++ r = efi_set_timer(console_timer_event, EFI_TIMER_PERIODIC, 100*1000*10); + if (r != EFI_SUCCESS) + printf("ERROR: Failed to set console timer\n"); + return r; diff --git a/sysutils/u-boot-rpi-arm64/files/rpi_arm64_fragment b/sysutils/u-boot-rpi-arm64/files/rpi_arm64_fragment new file mode 100644 index 000000000000..7a61bd18844a --- /dev/null +++ b/sysutils/u-boot-rpi-arm64/files/rpi_arm64_fragment @@ -0,0 +1,2 @@ +CONFIG_ENV_FAT_DEVICE_AND_PART="1:1" +CONFIG_RPI_EFI_NR_SPIN_PAGES=2 diff --git a/sysutils/u-boot-rpi-arm64/pkg-descr b/sysutils/u-boot-rpi-arm64/pkg-descr new file mode 100644 index 000000000000..cd2c04d0ef87 --- /dev/null +++ b/sysutils/u-boot-rpi-arm64/pkg-descr @@ -0,0 +1,6 @@ +U-Boot loader and related files for the 64 bit variants of the RPI + +This u-boot config is made to be bootable on any 64bits RPI like the RPI2v1.1 +RPI3 and RPI4. + +For general information about U-Boot see WWW: https://www.denx.de/wiki/U-Boot