From 5fa0237c834d9c8ab1df084d446643928e0b5bc0 Mon Sep 17 00:00:00 2001 From: Cibil Pankiras Date: Fri, 6 Feb 2026 11:47:00 +0100 Subject: [PATCH 1/4] pinctrl: bcm283x: Fix GPIO pull state register values for BCM2711 BCM2711 has different pull-up/down register values compared to BCM2835 - BCM2835: NONE=0, DOWN=1, UP=2 - BCM2711: NONE=0, UP=1, DOWN=2 This patch fixes the pull state register values for BCM2711. Fixes: 2c39d975f87c ("pinctrl: bcm283x: Add GPIO pull-up/down control for BCM2835 and BCM2711") Signed-off-by: Cibil Pankiras Reviewed-by: Matthias Brugger Reviewed-by: Peter Robinson Tested-by: Peter Robinson --- drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c index 4ecc8bac645..90eee88eb13 100644 --- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c +++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c @@ -30,6 +30,11 @@ struct bcm283x_pinctrl_priv { #define MAX_PINS_PER_BANK 16 +/* pull states for BCM2711 */ +#define BCM2711_PULL_NONE 0 +#define BCM2711_PULL_UP 1 +#define BCM2711_PULL_DOWN 2 + static void bcm2835_gpio_set_func_id(struct udevice *dev, unsigned int gpio, int func) { @@ -93,6 +98,17 @@ static void bcm2711_gpio_set_pull(struct udevice *dev, unsigned int gpio, int pu u32 bit_shift; u32 pull_bits; + if (!device_is_compatible(dev, "brcm,bcm2711-gpio")) + return; + + /* BCM2711's pull values differ from BCM2835 */ + if (pull == BCM2835_PUD_UP) + pull = BCM2711_PULL_UP; + else if (pull == BCM2835_PUD_DOWN) + pull = BCM2711_PULL_DOWN; + else + pull = BCM2711_PULL_NONE; + /* Findout which GPIO_PUP_PDN_CNTRL register to use */ reg_offset = BCM2711_GPPUD_CNTRL_REG0 + BCM2711_PUD_REG_OFFSET(gpio); From 7d5d8400fa5d7e61a5abd131770bc853237baf38 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 9 Feb 2026 12:55:47 +0000 Subject: [PATCH 2/4] rpi: pass the Video Core logs DT parameter through Pass the VC logs DT parameter through to the kernel device tree. This is used by the vclog tool and is a useful debugging tool. Signed-off-by: Peter Robinson Acked-by: Matthias Brugger --- 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 f9b643555dd..7256d66a9a6 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -608,6 +608,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) /* warnings from the firmware (if any) */ copy_property(fdt, fw_fdt, "/chosen", "user-warnings"); + /* firmware logs - used by the vclog utility */ + copy_property(fdt, fw_fdt, "/chosen", "log"); + /* address of the PHY device as provided by the firmware */ copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); From e263f901c10427b6e91d6ab2c43a311e86d59ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Kokosi=C5=84ski?= Date: Mon, 16 Feb 2026 19:44:51 +0100 Subject: [PATCH 3/4] board/raspberrypi: add multi-FDT support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for multiple FDT files per board model. This is done by adding the FDTFILES macro, which initializes two rpi_model struct members: fdtfiles and fdtcount. The new-style revision codes designate LSB bits as board revision; this value is used to choose between provided FDTs. The first element of the fdtfiles list is used should no revision match. Signed-off-by: Filip Kokosiński Reviewed-by: Peter Robinson Tested-by: Peter Robinson --- board/raspberrypi/rpi/rpi.c | 93 +++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 7256d66a9a6..ea887c00be4 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -94,120 +94,125 @@ struct efi_capsule_update_info update_info = { */ struct rpi_model { const char *name; - const char *fdtfile; + const char * const *fdtfiles; + size_t fdtcount; bool has_onboard_eth; }; +#define FDTFILES(...) \ + (const char *[]){ __VA_ARGS__ }, \ + sizeof((const char *[]){ __VA_ARGS__ }) / sizeof(const char *) + static const struct rpi_model rpi_model_unknown = { "Unknown model", - DTB_DIR "bcm283x-rpi-other.dtb", + FDTFILES(DTB_DIR "bcm283x-rpi-other.dtb"), false, }; static const struct rpi_model rpi_models_new_scheme[] = { [0x0] = { "Model A", - DTB_DIR "bcm2835-rpi-a.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a.dtb"), false, }, [0x1] = { "Model B", - DTB_DIR "bcm2835-rpi-b.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b.dtb"), true, }, [0x2] = { "Model A+", - DTB_DIR "bcm2835-rpi-a-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a-plus.dtb"), false, }, [0x3] = { "Model B+", - DTB_DIR "bcm2835-rpi-b-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-plus.dtb"), true, }, [0x4] = { "2 Model B", - DTB_DIR "bcm2836-rpi-2-b.dtb", + FDTFILES(DTB_DIR "bcm2836-rpi-2-b.dtb"), true, }, [0x6] = { "Compute Module", - DTB_DIR "bcm2835-rpi-cm.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-cm.dtb"), false, }, [0x8] = { "3 Model B", - DTB_DIR "bcm2837-rpi-3-b.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-3-b.dtb"), true, }, [0x9] = { "Zero", - DTB_DIR "bcm2835-rpi-zero.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-zero.dtb"), false, }, [0xA] = { "Compute Module 3", - DTB_DIR "bcm2837-rpi-cm3.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-cm3.dtb"), false, }, [0xC] = { "Zero W", - DTB_DIR "bcm2835-rpi-zero-w.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-zero-w.dtb"), false, }, [0xD] = { "3 Model B+", - DTB_DIR "bcm2837-rpi-3-b-plus.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-3-b-plus.dtb"), true, }, [0xE] = { "3 Model A+", - DTB_DIR "bcm2837-rpi-3-a-plus.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-3-a-plus.dtb"), false, }, [0x10] = { "Compute Module 3+", - DTB_DIR "bcm2837-rpi-cm3.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-cm3.dtb"), false, }, [0x11] = { "4 Model B", - DTB_DIR "bcm2711-rpi-4-b.dtb", + FDTFILES(DTB_DIR "bcm2711-rpi-4-b.dtb"), true, }, [0x12] = { "Zero 2 W", - DTB_DIR "bcm2837-rpi-zero-2-w.dtb", + FDTFILES(DTB_DIR "bcm2837-rpi-zero-2-w.dtb"), false, }, [0x13] = { "400", - DTB_DIR "bcm2711-rpi-400.dtb", + FDTFILES(DTB_DIR "bcm2711-rpi-400.dtb"), true, }, [0x14] = { "Compute Module 4", - DTB_DIR "bcm2711-rpi-cm4.dtb", + FDTFILES(DTB_DIR "bcm2711-rpi-cm4.dtb"), true, }, [0x17] = { "5 Model B", - DTB_DIR "bcm2712-rpi-5-b.dtb", + FDTFILES(DTB_DIR "bcm2712-rpi-5-b.dtb"), true, }, [0x18] = { "Compute Module 5", - DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", + FDTFILES(DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb"), true, }, [0x19] = { "500", - DTB_DIR "bcm2712-rpi-500.dtb", + FDTFILES(DTB_DIR "bcm2712-rpi-500.dtb"), true, }, [0x1A] = { "Compute Module 5 Lite", - DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", + FDTFILES(DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb"), true, }, }; @@ -215,87 +220,87 @@ static const struct rpi_model rpi_models_new_scheme[] = { static const struct rpi_model rpi_models_old_scheme[] = { [0x2] = { "Model B", - DTB_DIR "bcm2835-rpi-b.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b.dtb"), true, }, [0x3] = { "Model B", - DTB_DIR "bcm2835-rpi-b.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b.dtb"), true, }, [0x4] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0x5] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0x6] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0x7] = { "Model A", - DTB_DIR "bcm2835-rpi-a.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a.dtb"), false, }, [0x8] = { "Model A", - DTB_DIR "bcm2835-rpi-a.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a.dtb"), false, }, [0x9] = { "Model A", - DTB_DIR "bcm2835-rpi-a.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a.dtb"), false, }, [0xd] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0xe] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0xf] = { "Model B rev2", - DTB_DIR "bcm2835-rpi-b-rev2.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-rev2.dtb"), true, }, [0x10] = { "Model B+", - DTB_DIR "bcm2835-rpi-b-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-plus.dtb"), true, }, [0x11] = { "Compute Module", - DTB_DIR "bcm2835-rpi-cm.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-cm.dtb"), false, }, [0x12] = { "Model A+", - DTB_DIR "bcm2835-rpi-a-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a-plus.dtb"), false, }, [0x13] = { "Model B+", - DTB_DIR "bcm2835-rpi-b-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-b-plus.dtb"), true, }, [0x14] = { "Compute Module", - DTB_DIR "bcm2835-rpi-cm.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-cm.dtb"), false, }, [0x15] = { "Model A+", - DTB_DIR "bcm2835-rpi-a-plus.dtb", + FDTFILES(DTB_DIR "bcm2835-rpi-a-plus.dtb"), false, }, }; @@ -361,11 +366,17 @@ int dram_init_banksize(void) static void set_fdtfile(void) { const char *fdtfile; + int rev = revision & 0x0f; if (env_get("fdtfile")) return; - fdtfile = model->fdtfile; + /* set the first entry as default */ + fdtfile = model->fdtfiles[0]; + + if (rev < model->fdtcount) + fdtfile = model->fdtfiles[rev]; + env_set("fdtfile", fdtfile); } From c15a791972548150d8c0616a53e70dada1d358ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Kokosi=C5=84ski?= Date: Mon, 16 Feb 2026 19:44:52 +0100 Subject: [PATCH 4/4] board/raspberrypi: add bcm2712d0-rpi-5-b for Raspberry Pi 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds an FDT entry for the d0 stepping of the BCM2712 SoC. This entry is used by the v1.1 revision of the board (revision & 0x0f == 1). Signed-off-by: Filip Kokosiński Reviewed-by: Peter Robinson Tested-by: Peter Robinson --- board/raspberrypi/rpi/rpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ea887c00be4..7f69e5b6163 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -197,7 +197,10 @@ static const struct rpi_model rpi_models_new_scheme[] = { }, [0x17] = { "5 Model B", - FDTFILES(DTB_DIR "bcm2712-rpi-5-b.dtb"), + FDTFILES( + [0] = DTB_DIR "bcm2712-rpi-5-b.dtb", + [1] = DTB_DIR "bcm2712d0-rpi-5-b.dtb" + ), true, }, [0x18] = {