mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] ARM: dts: rpi4: add DTs for CM4 and Rpi 400
Date: Thu, 14 Dec 2023 16:18:04 +0100	[thread overview]
Message-ID: <20231214151805.1657124-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20231214151805.1657124-1-a.fatoum@pengutronix.de>

CM4 is quite different from the Rpi4, so we should really not use the
same DT for both. Rpi 400 is nearly the same, but has a different MDIO
clock, so let's ship a different DT for that as well. They are
compressed anyway and the FAT partition should be big enough to handle a
few extra tens of kilobytes.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/boards/raspberry-pi/lowlevel.c |  8 ++++++--
 arch/arm/dts/Makefile                   |  2 +-
 arch/arm/dts/bcm2711-rpi-4.dts          | 15 +++------------
 arch/arm/dts/bcm2711-rpi-400.dts        |  4 ++++
 arch/arm/dts/bcm2711-rpi-cm4-io.dts     |  4 ++++
 arch/arm/dts/bcm2711-rpi.dtsi           | 13 +++++++++++++
 6 files changed, 31 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/dts/bcm2711-rpi-400.dts
 create mode 100644 arch/arm/dts/bcm2711-rpi-cm4-io.dts
 create mode 100644 arch/arm/dts/bcm2711-rpi.dtsi

diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
index f8078dba677c..a1e195d81151 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.c
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -71,6 +71,8 @@ extern char __dtb_z_bcm2836_rpi_2_start[];
 extern char __dtb_z_bcm2837_rpi_3_start[];
 extern char __dtb_z_bcm2837_rpi_cm3_start[];
 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[];
 
 RPI_ENTRY_FUNCTION(start_raspberry_pi1, SZ_128M, fdt)
 {
@@ -132,9 +134,11 @@ static void *rpi_get_board_fdt(int rev)
 		return DT_IF_ENABLED(__dtb_z_bcm2837_rpi_cm3_start, CONFIG_MACH_RPI_CM3);
 
 	case BCM2711_BOARD_REV_4_B:
-	case BCM2711_BOARD_REV_400:
-	case BCM2711_BOARD_REV_CM4:
 		return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_4_start, CONFIG_MACH_RPI4);
+	case BCM2711_BOARD_REV_400:
+		return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_400_start, CONFIG_MACH_RPI4);
+	case BCM2711_BOARD_REV_CM4:
+		return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_cm4_io_start, CONFIG_MACH_RPI4);
 	}
 
 	return NULL;
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 4d837b13411c..04af3bd64687 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -123,7 +123,7 @@ lwl-$(CONFIG_MACH_RPI) += bcm2835-rpi.dtb.o
 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
+lwl-$(CONFIG_MACH_RPI4) += bcm2711-rpi-4.dtb.o bcm2711-rpi-400.dtb.o bcm2711-rpi-cm4-io.dtb.o
 lwl-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
 lwl-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o imx6qp-sabresd.dtb.o
 lwl-$(CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB) += imx6sx-sdb.dtb.o
diff --git a/arch/arm/dts/bcm2711-rpi-4.dts b/arch/arm/dts/bcm2711-rpi-4.dts
index de748e2fc65b..6d46dd3b839c 100644
--- a/arch/arm/dts/bcm2711-rpi-4.dts
+++ b/arch/arm/dts/bcm2711-rpi-4.dts
@@ -1,13 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+
 #include <arm64/broadcom/bcm2711-rpi-4-b.dts>
-
-&{/memory@0} {
-	reg = <0x0 0x0 0x0>;
-};
-
-&uart1 {
-	/* VPU core clock is reported at 200MHz, but needs to be 500Mhz
-	 * for ns16550 driver to set correct baudrate. Until that's
-	 * figured out, hardcode clock frequency to the expected value
-	 */
-	clock-frequency = <500000000>;
-};
+#include "bcm2711-rpi.dtsi"
diff --git a/arch/arm/dts/bcm2711-rpi-400.dts b/arch/arm/dts/bcm2711-rpi-400.dts
new file mode 100644
index 000000000000..fb9cccb2b914
--- /dev/null
+++ b/arch/arm/dts/bcm2711-rpi-400.dts
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <arm64/broadcom/bcm2711-rpi-400.dts>
+#include "bcm2711-rpi.dtsi"
diff --git a/arch/arm/dts/bcm2711-rpi-cm4-io.dts b/arch/arm/dts/bcm2711-rpi-cm4-io.dts
new file mode 100644
index 000000000000..115491e7a638
--- /dev/null
+++ b/arch/arm/dts/bcm2711-rpi-cm4-io.dts
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <arm64/broadcom/bcm2711-rpi-cm4-io.dts>
+#include "bcm2711-rpi.dtsi"
diff --git a/arch/arm/dts/bcm2711-rpi.dtsi b/arch/arm/dts/bcm2711-rpi.dtsi
new file mode 100644
index 000000000000..cb2952ccac85
--- /dev/null
+++ b/arch/arm/dts/bcm2711-rpi.dtsi
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+
+&{/memory@0} {
+	reg = <0x0 0x0 0x0>;
+};
+
+&uart1 {
+	/* VPU core clock is reported at 200MHz, but needs to be 500Mhz
+	 * for ns16550 driver to set correct baudrate. Until that's
+	 * figured out, hardcode clock frequency to the expected value
+	 */
+	clock-frequency = <500000000>;
+};
-- 
2.39.2




  reply	other threads:[~2023-12-14 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 15:18 [PATCH 1/3] ARM: dts: rpi4: drop disabling of SDHCI node used for WiFi Ahmad Fatoum
2023-12-14 15:18 ` Ahmad Fatoum [this message]
2023-12-14 15:18 ` [PATCH 3/3] ARM: rpi: look for env in mmc0 as well Ahmad Fatoum
2023-12-15 11:06 ` [PATCH 1/3] ARM: dts: rpi4: drop disabling of SDHCI node used for WiFi Sascha Hauer

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=20231214151805.1657124-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --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