From 71aaf3886c5dd98b04cb9c6abe40850090a09fde Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Fri, 9 Aug 2019 19:44:40 +0300 Subject: u-boot_2019.07.bbappend: Apply patch for AGL SOTA Recently we have updated u-boot to version 2019.07 to support Raspberry Pi 4 in AGL based on Yocto release Thud. Therefore a new version of the patch from meta-updater-raspberrypi branch warrior has to be applied to successfully build U-Boot when feature agl-sota is enabled. Bug-AGL: SPEC-2729 Signed-off-by: Leon Anavi Change-Id: Ie72cc9b81ff6e041cfe6edb26f383b7e0d43d8f9 --- ...dd-serial-and-revision-to-the-dev-2019.07.patch | 82 ++++++++++++++++++++++ .../recipes-bsp/u-boot/u-boot_2019.07.bbappend | 6 ++ 2 files changed, 88 insertions(+) create mode 100644 meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch new file mode 100644 index 000000000..964cdb7a2 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch @@ -0,0 +1,82 @@ +From 86cc911aaa958fedf2ea9cb04b4af17f5357815d Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Fri, 1 Feb 2019 14:39:48 +0100 +Subject: [PATCH] board: raspberrypi: add serial and revision to the 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. + +Revision and serial are displayed in /proc/cpuinfo after boot. + +Signed-off-by: Anton Gerasimov +--- + 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 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -241,6 +241,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[] = { + { +@@ -384,8 +386,8 @@ static void set_serial_number(void) + return; + } + +- 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), "%016llx", serial); + env_set("serial#", serial_string); + } + +@@ -478,6 +480,29 @@ void *board_fdt_blob_setup(void) + return (void *)fw_dtb_pointer; + } + ++static int ft_add_revision_info(void *blob) { ++ int off; ++ int ret; ++ ++ off = fdt_subnode_offset(blob, 0, "system"); ++ ++ if (off < 0) { ++ off = fdt_add_subnode(blob, 0, "system"); ++ if (off < 0) ++ return -1; ++ } ++ ++ ret = fdt_setprop_u64(blob, off, "linux,serial", serial); ++ if (ret < 0) ++ return -1; ++ ++ ret = fdt_setprop_u32(blob, off, "linux,revision", revision); ++ if (ret < 0) ++ return -1; ++ ++ return 0; ++} ++ + int ft_board_setup(void *blob, bd_t *bd) + { + /* +@@ -487,6 +512,8 @@ int ft_board_setup(void *blob, bd_t *bd) + */ + lcd_dt_simplefb_add_node(blob); + ++ ft_add_revision_info(blob); ++ + #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/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend index 6dfcc2ce6..03e7dc849 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend @@ -1,4 +1,10 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + SRC_URI_raspberrypi4 = "git://github.com/balena-os/u-boot;branch=ag/rpi4" SRCREV_raspberrypi4 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f" SRC_URI_raspberrypi4-64 = "git://github.com/balena-os/u-boot;branch=ag/rpi4" SRCREV_raspberrypi4-64 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f" + +# Update the patch for u-boot 2019.07 +SRC_URI_remove_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch" +SRC_URI_append_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch" -- cgit 1.2.3-korg