From 985f3b8e3d87eb4c901d6bd3345606161d92b633 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 18 Jul 2020 23:32:19 +0200 Subject: [PATCH] Bump RPi 64-bit to U-Boot 2020.07 release to fix RPi 4 8GB boot (#740) (#775) Unfortunately builds for 32-bit seem to lead to freezes. Conservatively only update to 2020.07 for 64-bit builds. Co-authored-by: Malcolm Lashley Co-authored-by: Malcolm Lashley --- buildroot-external/configs/rpi4_64_defconfig | 2 +- ...01-CMD-read-string-from-fileinto-env.patch | 0 ...01-CMD-read-string-from-fileinto-env.patch | 96 +++++++++++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) rename buildroot-external/patches/uboot/{ => 2020.01}/0001-CMD-read-string-from-fileinto-env.patch (100%) create mode 100644 buildroot-external/patches/uboot/2020.07/0001-CMD-read-string-from-fileinto-env.patch diff --git a/buildroot-external/configs/rpi4_64_defconfig b/buildroot-external/configs/rpi4_64_defconfig index abf065d77..0c3dfc336 100644 --- a/buildroot-external/configs/rpi4_64_defconfig +++ b/buildroot-external/configs/rpi4_64_defconfig @@ -87,7 +87,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rpi_4" BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/bootloader/uboot.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/uboot.config" BR2_TARGET_UBOOT_BOOT_SCRIPT=y diff --git a/buildroot-external/patches/uboot/0001-CMD-read-string-from-fileinto-env.patch b/buildroot-external/patches/uboot/2020.01/0001-CMD-read-string-from-fileinto-env.patch similarity index 100% rename from buildroot-external/patches/uboot/0001-CMD-read-string-from-fileinto-env.patch rename to buildroot-external/patches/uboot/2020.01/0001-CMD-read-string-from-fileinto-env.patch diff --git a/buildroot-external/patches/uboot/2020.07/0001-CMD-read-string-from-fileinto-env.patch b/buildroot-external/patches/uboot/2020.07/0001-CMD-read-string-from-fileinto-env.patch new file mode 100644 index 000000000..aeb261acf --- /dev/null +++ b/buildroot-external/patches/uboot/2020.07/0001-CMD-read-string-from-fileinto-env.patch @@ -0,0 +1,96 @@ +From 040a141f84f2f84bf8be18f85b4cdb34bf066df0 Mon Sep 17 00:00:00 2001 +Message-Id: <040a141f84f2f84bf8be18f85b4cdb34bf066df0.1595086593.git.stefan@agner.ch> +From: Pascal Vizeli +Date: Sun, 5 Aug 2018 20:43:03 +0000 +Subject: [PATCH 1/1] CMD: read string from fileinto env + +Signed-off-by: Pascal Vizeli +--- + cmd/Kconfig | 5 +++++ + cmd/Makefile | 1 + + cmd/fileenv.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 51 insertions(+) + create mode 100644 cmd/fileenv.c + +diff --git a/cmd/Kconfig b/cmd/Kconfig +index 192b3b262f..b44cd64215 100644 +--- a/cmd/Kconfig ++++ b/cmd/Kconfig +@@ -1388,6 +1388,11 @@ config CMD_SETEXPR + Also supports loading the value at a memory location into a variable. + If CONFIG_REGEX is enabled, setexpr also supports a gsub function. + ++config CMD_FILEENV ++ bool "fileenv" ++ help ++ Read a file into memory and store it to env. ++ + endmenu + + menu "Android support commands" +diff --git a/cmd/Makefile b/cmd/Makefile +index 974ad48b0a..287887e97f 100644 +--- a/cmd/Makefile ++++ b/cmd/Makefile +@@ -128,6 +128,7 @@ obj-$(CONFIG_CMD_SF) += sf.o + obj-$(CONFIG_CMD_SCSI) += scsi.o disk.o + obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o + obj-$(CONFIG_CMD_SETEXPR) += setexpr.o ++obj-$(CONFIG_CMD_FILEENV) += fileenv.o + obj-$(CONFIG_CMD_SPI) += spi.o + obj-$(CONFIG_CMD_STRINGS) += strings.o + obj-$(CONFIG_CMD_SMC) += smccc.o +diff --git a/cmd/fileenv.c b/cmd/fileenv.c +new file mode 100644 +index 0000000000..af24d22d0e +--- /dev/null ++++ b/cmd/fileenv.c +@@ -0,0 +1,45 @@ ++#include ++#include ++#include ++#include ++ ++static char *fs_argv[5]; ++ ++int do_fileenv(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) ++{ ++ if (argc < 6) ++ return CMD_RET_USAGE; ++ ++ fs_argv[0] = "fatload"; ++ fs_argv[1] = argv[1]; ++ fs_argv[2] = argv[2]; ++ fs_argv[3] = argv[3]; ++ fs_argv[4] = argv[4]; ++ ++ if (do_fat_fsload(cmdtp, 0, 5, fs_argv) != 0) ++ return 1; ++ ++ char *addr = (char *)simple_strtoul(argv[3], NULL, 16); ++ size_t size = env_get_hex("filesize", 0); ++ ++ // Prepare string ++ addr[size] = 0x00; ++ char *s = addr; ++ while(*s != 0x00) { ++ if (isprint(*s)) { ++ s++; ++ } ++ else { ++ *s = 0x00; ++ } ++ } ++ ++ return env_set(argv[5], addr); ++} ++ ++U_BOOT_CMD( ++ fileenv, 6, 0, do_fileenv, ++ "Read file and store it into env.", ++ " \n" ++ " - Read file from fat32 and store it as env." ++); +-- +2.27.0 +