From: Andrei Lalaev <andrey.lalaev@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrei Lalaev <andrey.lalaev@gmail.com>
Subject: [PATCH RFC 2/6] ARM: rpi: add Raspberry Pi 5 support
Date: Tue, 01 Sep 2026 17:12:57 +0200 [thread overview]
Message-ID: <20260901-add-rpi5-support-v1-2-129784fe06fa@gmail.com> (raw)
In-Reply-To: <20260901-add-rpi5-support-v1-0-129784fe06fa@gmail.com>
Initial support of RPI 5 that should be enough to boot Linux.
All peripherals behind RP1 chip are not supported yet.
Tested peripherals:
- PL011 debug UART
- SD-Card
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
---
arch/arm/boards/raspberry-pi/lowlevel.c | 3 +++
arch/arm/boards/raspberry-pi/rpi-common.c | 11 +++++++++++
arch/arm/configs/rpi_v8a_defconfig | 1 +
arch/arm/dts/Makefile | 1 +
arch/arm/dts/bcm2712-rpi-5.dts | 4 ++++
arch/arm/dts/bcm2712-rpi.dtsi | 5 +++++
arch/arm/include/asm/system_info.h | 3 +++
arch/arm/mach-bcm283x/Kconfig | 6 ++++++
arch/arm/mach-bcm283x/core.c | 4 +++-
include/mach/bcm283x/mbox.h | 1 +
10 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
index b3727d930ff7..8d2150f9bbd8 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.c
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -74,6 +74,7 @@ extern char __dtb_z_bcm2711_rpi_4_start[];
extern char __dtb_z_bcm2711_rpi_400_start[];
extern char __dtb_z_bcm2711_rpi_cm4_io_start[];
extern char __dtb_z_bcm2711_rpi_cm4s_io_start[];
+extern char __dtb_z_bcm2712_rpi_5_start[];
RPI_ENTRY_FUNCTION(start_raspberry_pi1, SZ_128M, fdt)
{
@@ -142,6 +143,8 @@ static void *rpi_get_board_fdt(int rev)
return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_cm4_io_start, CONFIG_MACH_RPI4);
case BCM2711_BOARD_REV_CM4_S:
return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_cm4s_io_start, CONFIG_MACH_RPI4);
+ case BCM2712_BOARD_REV_5:
+ return DT_IF_ENABLED(__dtb_z_bcm2712_rpi_5_start, CONFIG_MACH_RPI5);
}
return NULL;
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 754772da460f..fe0b11efad68 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -175,6 +175,7 @@ static int rpi_mem_init(void)
if (!of_machine_is_compatible("brcm,bcm2837") &&
!of_machine_is_compatible("brcm,bcm2835") &&
!of_machine_is_compatible("brcm,bcm2711") &&
+ !of_machine_is_compatible("brcm,bcm2712") &&
!of_machine_is_compatible("brcm,bcm2836"))
return 0;
@@ -732,6 +733,13 @@ static const struct rpi_machine_data rpi_4_ids[] = {
},
};
+static const struct rpi_machine_data rpi_5_ids[] = {
+ {
+ .hw_id = BCM2712_BOARD_REV_5,
+ }, {
+ .hw_id = U8_MAX
+ },
+};
static const struct of_device_id rpi_of_match[] = {
/* BCM2835 based Boards */
{ .compatible = "raspberrypi,model-a", .data = rpi_1_ids },
@@ -762,6 +770,9 @@ static const struct of_device_id rpi_of_match[] = {
{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
+ /* BCM2712 based Boards */
+ { .compatible = "raspberrypi,5-model-b", .data = rpi_5_ids },
+
{ /* sentinel */ },
};
BAREBOX_DEEP_PROBE_ENABLE(rpi_of_match);
diff --git a/arch/arm/configs/rpi_v8a_defconfig b/arch/arm/configs/rpi_v8a_defconfig
index 90899218b192..7c95b4b2f313 100644
--- a/arch/arm/configs/rpi_v8a_defconfig
+++ b/arch/arm/configs/rpi_v8a_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARCH_BCM283X=y
CONFIG_MACH_RPI3=y
CONFIG_MACH_RPI_CM3=y
CONFIG_MACH_RPI4=y
+CONFIG_MACH_RPI5=y
CONFIG_64BIT=y
CONFIG_IMAGE_COMPRESSION_NONE=y
CONFIG_NAME="rpi_v8a_defconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 64f46064b735..56e022286182 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -146,6 +146,7 @@ lwl-$(CONFIG_MACH_RPI2) += bcm2836-rpi-2.dtb.o
lwl-$(CONFIG_MACH_RPI3) += bcm2837-rpi-3.dtb.o
lwl-$(CONFIG_MACH_RPI_CM3) += bcm2837-rpi-cm3.dtb.o
lwl-$(CONFIG_MACH_RPI4) += bcm2711-rpi-4.dtb.o bcm2711-rpi-400.dtb.o bcm2711-rpi-cm4-io.dtb.o bcm2711-rpi-cm4s-io.dtb.o
+lwl-$(CONFIG_MACH_RPI5) += bcm2712-rpi-5.dtb.o
lwl-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o imx6q-sabrelite-qemu.dtb.o
lwl-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o imx6qp-sabresd.dtb.o imx6dl-sabresd.dtb.o
lwl-$(CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB) += imx6sx-sdb.dtb.o
diff --git a/arch/arm/dts/bcm2712-rpi-5.dts b/arch/arm/dts/bcm2712-rpi-5.dts
new file mode 100644
index 000000000000..c9754555993a
--- /dev/null
+++ b/arch/arm/dts/bcm2712-rpi-5.dts
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <arm64/broadcom/bcm2712-rpi-5-b.dts>
+#include "bcm2712-rpi.dtsi"
diff --git a/arch/arm/dts/bcm2712-rpi.dtsi b/arch/arm/dts/bcm2712-rpi.dtsi
new file mode 100644
index 000000000000..9ca671d8df7b
--- /dev/null
+++ b/arch/arm/dts/bcm2712-rpi.dtsi
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/ {
+ barebox,deep-probe;
+};
diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
index 5a84fde75b9f..aa13a8531a05 100644
--- a/arch/arm/include/asm/system_info.h
+++ b/arch/arm/include/asm/system_info.h
@@ -50,6 +50,9 @@
#define CPU_IS_CORTEX_A72 0x410fd080
#define CPU_IS_CORTEX_A72_MASK 0xff0ffff0
+#define CPU_IS_CORTEX_A76 0x410fd0b0
+#define CPU_IS_CORTEX_A76_MASK 0xff0ffff0
+
#define CPU_IS_PXA250 0x69052100
#define CPU_IS_PXA250_MASK 0xfffff7f0
diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index ca9061572b06..78dfa9dd87ce 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -47,6 +47,12 @@ config MACH_RPI4
select MACH_RPI_AARCH_32_64
select MACH_RPI_COMMON
+config MACH_RPI5
+ bool "RaspberryPi 5 (BCM2712/CORTEX-A76)"
+ depends on 64BIT
+ select CPU_V8
+ select MACH_RPI_COMMON
+
endmenu
endif
diff --git a/arch/arm/mach-bcm283x/core.c b/arch/arm/mach-bcm283x/core.c
index 1091ad0b5664..6c6aa5726a25 100644
--- a/arch/arm/mach-bcm283x/core.c
+++ b/arch/arm/mach-bcm283x/core.c
@@ -13,7 +13,7 @@ void __iomem *bcm2835_get_mmio_base_by_cpuid(void)
pr_debug("ARM CPUID: %08x\n", cpuid);
}
- /* We know ARM1167, Cortex A-7, A-53 and A-72 CPUID mask is identical */
+ /* We know ARM1167, Cortex A-7, A-53, A-72, A-76 CPUID mask is identical */
switch(cpuid & CPU_IS_ARM1176_MASK) {
case CPU_IS_ARM1176: /* bcm2835 */
return IOMEM(0x20000000);
@@ -22,6 +22,8 @@ void __iomem *bcm2835_get_mmio_base_by_cpuid(void)
return IOMEM(0x3f000000);
case CPU_IS_CORTEX_A72: /* bcm2711 */
return IOMEM(0xfe000000);
+ case CPU_IS_CORTEX_A76: /* bcm2712 */
+ return IOMEM(0x107c008000UL);
}
pr_err("Couldn't determine rpi by CPUID %08x\n", cpuid);
diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
index fc51b6597560..0f3cd9c8211f 100644
--- a/include/mach/bcm283x/mbox.h
+++ b/include/mach/bcm283x/mbox.h
@@ -178,6 +178,7 @@ struct bcm2835_mbox_tag_hdr {
#define BCM2711_BOARD_REV_400 0x13
#define BCM2711_BOARD_REV_CM4 0x14
#define BCM2711_BOARD_REV_CM4_S 0x15
+#define BCM2712_BOARD_REV_5 0x17
struct bcm2835_mbox_tag_get_board_rev {
struct bcm2835_mbox_tag_hdr tag_hdr;
--
2.55.0
next prev parent reply other threads:[~2026-09-01 15:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 15:12 [RFC PATCH 0/6] Add Raspberry Pi 5 initial support Andrei Lalaev
2026-09-01 15:12 ` [PATCH RFC 1/6] mci: add driver for Broadcom SDHCI Andrei Lalaev
2026-09-01 15:12 ` Andrei Lalaev [this message]
2026-09-01 15:12 ` [PATCH RFC 3/6] Documentation: bcm283x: add Raspberry Pi 5 support Andrei Lalaev
2026-09-01 15:12 ` [PATCH RFC 4/6] arm: dts: bcm2712-rpi: specify clock frequency for uart Andrei Lalaev
2026-09-01 15:13 ` [PATCH RFC 5/6] arm: dts: bcm2712-rpi: disable wifi SDIO Andrei Lalaev
2026-09-01 15:13 ` [PATCH RFC 6/6] bcm283x: debug_ll: add Raspberry Pi 5 UART support Andrei Lalaev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901-add-rpi5-support-v1-2-129784fe06fa@gmail.com \
--to=andrey.lalaev@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox