summaryrefslogtreecommitdiffstats
path: root/external/meta-updater-raspberrypi/recipes-bsp/u-boot
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-updater-raspberrypi/recipes-bsp/u-boot')
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch42
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch13
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch24
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg2
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg2
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config1
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg1
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend10
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend9
-rw-r--r--external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend35
10 files changed, 62 insertions, 77 deletions
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch
deleted file mode 100644
index 394f0ee6..00000000
--- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From c849889cce23b41df45cfa4efd9fde8eb682195f Mon Sep 17 00:00:00 2001
-From: Laurent Bonnans <laurent.bonnans@here.com>
-Date: Wed, 5 Jun 2019 18:12:21 +0200
-Subject: [PATCH] Enable FIT and bootcount on RPi3
-
----
- configs/rpi_3_32b_defconfig | 6 ++++++
- configs/rpi_3_defconfig | 6 ++++++
- 2 files changed, 12 insertions(+)
-
-diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
-index 9e142cae63..d5d32a202d 100644
---- a/configs/rpi_3_32b_defconfig
-+++ b/configs/rpi_3_32b_defconfig
-@@ -39,3 +39,9 @@ CONFIG_SYS_WHITE_ON_BLACK=y
- CONFIG_CONSOLE_SCROLL_LINES=10
- CONFIG_PHYS_TO_BUS=y
- CONFIG_OF_LIBFDT_OVERLAY=y
-+
-+CONFIG_FIT=y
-+CONFIG_FIT_VERBOSE=y
-+
-+CONFIG_BOOTCOUNT_LIMIT=y
-+CONFIG_BOOTCOUNT_ENV=y
-diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
-index f46e504497..80fb70119e 100644
---- a/configs/rpi_3_defconfig
-+++ b/configs/rpi_3_defconfig
-@@ -39,3 +39,9 @@ CONFIG_SYS_WHITE_ON_BLACK=y
- CONFIG_CONSOLE_SCROLL_LINES=10
- CONFIG_PHYS_TO_BUS=y
- CONFIG_OF_LIBFDT_OVERLAY=y
-+
-+CONFIG_FIT=y
-+CONFIG_FIT_VERBOSE=y
-+
-+CONFIG_BOOTCOUNT_LIMIT=y
-+CONFIG_BOOTCOUNT_ENV=y
---
-2.20.1
-
-
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch
index 1a6940e0..90ecefd2 100644
--- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch
@@ -1,4 +1,4 @@
-From a4a9b71ac4900fee8081c85c630d55e20b233a81 Mon Sep 17 00:00:00 2001
+From c7d936ae239e9609d95537746600e42892f3dcfb Mon Sep 17 00:00:00 2001
From: Laurent Bonnans <laurent.bonnans@here.com>
Date: Wed, 5 Jun 2019 19:22:01 +0200
Subject: [PATCH] Increase rpi BOOTM_LEN
@@ -8,17 +8,14 @@ Subject: [PATCH] Increase rpi BOOTM_LEN
1 file changed, 1 insertion(+)
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
-index a97550b732..4ce9b2f99e 100644
+index 77d2d5458a..dd60042200 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
-@@ -56,6 +56,7 @@
+@@ -54,6 +54,7 @@
#define CONFIG_SYS_MEMTEST_START 0x00100000
#define CONFIG_SYS_MEMTEST_END 0x00200000
#define CONFIG_LOADADDR 0x00200000
+#define CONFIG_SYS_BOOTM_LEN SZ_64M
- /* Devices */
- /* GPIO */
---
-2.20.1
-
+ #ifdef CONFIG_ARM64
+ #define CONFIG_SYS_BOOTM_LEN SZ_64M
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch
index 44774c0e..73f6e2d9 100644
--- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch
@@ -1,8 +1,7 @@
-From 86cc911aaa958fedf2ea9cb04b4af17f5357815d Mon Sep 17 00:00:00 2001
+From fb48900977dbbfc6f921822abc6728b6075efc4f Mon Sep 17 00:00:00 2001
From: Anton Gerasimov <anton.gerasimov@here.com>
Date: Fri, 1 Feb 2019 14:39:48 +0100
-Subject: [PATCH] board: raspberrypi: add serial and revision to the device
- tree
+Subject: [PATCH] board: raspberrypi: add serial and revision to device tree
Raspberry Pi bootloader adds this node to fdt, but if u-boot script
doesn't reuse the tree provided by it, this information is lost.
@@ -10,31 +9,33 @@ doesn't reuse the tree provided by it, this information is lost.
Revision and serial are displayed in /proc/cpuinfo after boot.
Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com>
+Signed-off-by: Patrick Vacek <patrick.vacek@here.com>
+
---
board/raspberrypi/rpi/rpi.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
-index 35f5939552..114178397e 100644
+index e367ba3092..d70e07f0a6 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
-@@ -241,6 +241,8 @@ static uint32_t rev_scheme;
+@@ -252,6 +252,8 @@ static uint32_t rev_scheme;
static uint32_t rev_type;
static const struct rpi_model *model;
+uint64_t serial;
+
- #ifdef CONFIG_ARM64
- static struct mm_region bcm2837_mem_map[] = {
- {
+ int dram_init(void)
+ {
+ ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1);
@@ -384,8 +386,8 @@ static void set_serial_number(void)
return;
}
-- snprintf(serial_string, sizeof(serial_string), "%016" PRIx64,
+- snprintf(serial_string, sizeof(serial_string), "%016llx",
- msg->get_board_serial.body.resp.serial);
+ serial = msg->get_board_serial.body.resp.serial;
-+ snprintf(serial_string, sizeof(serial_string), "%016" PRIx64, serial);
++ snprintf(serial_string, sizeof(serial_string), "%016llx", serial);
env_set("serial#", serial_string);
}
@@ -77,6 +78,3 @@ index 35f5939552..114178397e 100644
#ifdef CONFIG_EFI_LOADER
/* Reserve the spin table */
efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0);
---
-2.17.1
-
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg
new file mode 100644
index 00000000..9fc35894
--- /dev/null
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg
@@ -0,0 +1,2 @@
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg
new file mode 100644
index 00000000..79639520
--- /dev/null
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg
@@ -0,0 +1,2 @@
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config
new file mode 100644
index 00000000..79204290
--- /dev/null
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config
@@ -0,0 +1 @@
+/mnt/bootpart/uboot.env 0x0000 0x4000
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg
new file mode 100644
index 00000000..230ef286
--- /dev/null
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg
@@ -0,0 +1 @@
+CONFIG_ARCH_FIXUP_FDT_MEMORY=y
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend
new file mode 100644
index 00000000..af8a7445
--- /dev/null
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append_rpi = " \
+ file://fw_env.config \
+ "
+
+do_install_append_rpi () {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend
deleted file mode 100644
index 77649653..00000000
--- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-
-do_install_append () {
-
- cat >${D}${sysconfdir}/fw_env.config <<EOF
-
-/mnt/bootpart/uboot.env 0x0000 0x4000
-
-EOF
-}
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
index 32812600..5032e217 100644
--- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1,7 +1,32 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI_append = " \
- file://0001-Enable-FIT-and-bootcount-on-RPi3.patch \
- file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch \
- file://0001-Increase-rpi-BOOTM_LEN.patch \
- "
+SRC_URI_append_rpi = " \
+ file://0001-Increase-rpi-BOOTM_LEN.patch \
+ file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch \
+ file://fit.cfg \
+ file://bootcount.cfg \
+ "
+
+SRC_URI_append_raspberrypi4 = " \
+ file://rpi4-fixup-mem.cfg \
+ "
+
+# build u-boot image suitable for use with qemu
+# we need to masquerade a kernel uImage, due to qemu limitations
+# (see https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg05094.html)
+# thus, we cannot use u-boot default rule for u-boot.img which sets a correct
+# "u-boot" as image type
+
+DEPENDS_append_rpi = " u-boot-mkimage-native"
+
+UBOOT_LOAD_ADDR = "0x8000"
+UBOOT_LOAD_ADDR_raspberrypi3-64 = "0x80000"
+UBOOT_LOAD_ADDR_raspberrypi4-64 = "0x80000"
+
+do_compile_append_rpi() {
+ uboot-mkimage -A arm -T kernel -C none -O linux -a ${UBOOT_LOAD_ADDR} -e ${UBOOT_LOAD_ADDR} -d ${B}/u-boot.bin ${B}/u-boot-qemu.img
+}
+
+do_deploy_append_rpi() {
+ install -m 644 ${B}/u-boot-qemu.img ${DEPLOYDIR}/u-boot-qemu.img
+}