From 27e0160320c13168ab5d703c5ec4bec87a6d2700 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 29 Dec 2024 14:46:05 +0000 Subject: [PATCH 1/4] rpi: Add identifiers for the new RPi 5 series The Raspberry Pi foundation have released the Raspberry Pi 500, CM5 an CM5 lite devices so add the assoicated revision identifers so we can detect them. Signed-off-by: Peter Robinson Acked-by: Matthias Brugger --- board/raspberrypi/rpi/rpi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index aa39afa338a..4d546892842 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = { DTB_DIR "bcm2712-rpi-5-b.dtb", true, }, + [0x18] = { + "Compute Module 5", + DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", + true, + }, + [0x19] = { + "500", + DTB_DIR "bcm2712-rpi-500.dtb", + true, + }, + [0x1A] = { + "Compute Module 5 Lite", + DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", + true, + }, }; static const struct rpi_model rpi_models_old_scheme[] = { From 2d75c46be99c15fa186436c149b87ee97e0b8f44 Mon Sep 17 00:00:00 2001 From: Martin Stolpe Date: Wed, 23 Oct 2024 15:09:20 +0200 Subject: [PATCH 2/4] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled. Signed-off-by: Martin Stolpe Acked-by: Matthias Brugger Signed-off-by: Peter Robinson --- board/raspberrypi/rpi/rpi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 4d546892842..fe6153b388b 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -604,11 +604,13 @@ int ft_board_setup(void *blob, struct bd_info *bd) update_fdt_from_fw(blob, (void *)fw_dtb_pointer); - node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); - if (node < 0) - fdt_simplefb_add_node(blob); - else - fdt_simplefb_enable_and_mem_rsv(blob); + if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) { + node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); + if (node < 0) + fdt_simplefb_add_node(blob); + else + fdt_simplefb_enable_and_mem_rsv(blob); + } #ifdef CONFIG_EFI_LOADER /* Reserve the spin table */ From fc7a3110184a3ca4c227675b20d3a4887210e36c Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Wed, 12 Feb 2025 12:39:01 +0100 Subject: [PATCH 3/4] Raspberry Pi: Keep warnings from firmware in DT, if any The /chosen/user-warnings property is created by the RPi firmware if there are warnings to report, keep it to make debugging easier. For example, if the firmware config.txt contains "dtoverlay=error-example" and that example references an undefined symbol "&nosuchdev" the warning can be read after boot: $ cat /proc/device-tree/chosen/user-warnings dterror: can't find symbol 'nosuchdev' Failed to resolve overlay 'error-example' Signed-off-by: Fiona Klute Reviewed-by: Matthias Brugger Signed-off-by: Peter Robinson --- board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index fe6153b388b..43efb0dbc1d 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -594,6 +594,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) /* kernel address randomisation seed as provided by the firmware */ copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed"); + /* warnings from the firmware (if any) */ + copy_property(fdt, fw_fdt, "/chosen", "user-warnings"); + /* address of the PHY device as provided by the firmware */ copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); } From e042d7593a0b7544259fd2d22240e78d18912746 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Wed, 12 Feb 2025 12:39:02 +0100 Subject: [PATCH 4/4] Raspberry Pi: Copy Bluetooth device address in DT The firmware sets local-bd-address, copy it when loading a new DT. Signed-off-by: Fiona Klute Signed-off-by: Peter Robinson --- board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 43efb0dbc1d..70d3c35499b 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -599,6 +599,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) /* address of the PHY device as provided by the firmware */ copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); + + /* Bluetooth device address as provided by the firmware */ + copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", "local-bd-address"); } int ft_board_setup(void *blob, struct bd_info *bd)