mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Pierre-Olivier Huard <pierre-olivier.huard@rtone.fr>
To: barebox@lists.infradead.org
Cc: sebastien.bourdelin@rtone.fr, a.fatoum@pengutronix.de,
	oss-contrib@rtone.fr,
	Pierre-Olivier Huard <pierre-olivier.huard@rtone.fr>
Subject: [PATCH 1/1] ARM: dts: rpi4: add DT for CM4S
Date: Thu, 15 Feb 2024 13:01:09 +0100	[thread overview]
Message-ID: <20240215120109.23242-1-pierre-olivier.huard@rtone.fr> (raw)

CM4S is close to the CM4, and thus is herited from it, with some
minor changes:

* The uart1 node (mini UART) does not need the clock to be forced to
  500MHz.
* The compatible field needs to be updated to match the CM4S

There is still an issue with the dwc2 driver in timeout.

Boot log:
Board: Raspberry Pi Compute Module 4S IO Board
deep-probe: supported due to raspberrypi,4-compute-module-s
bcm2835_mci fe300000.mmc@7e300000.of: registered as mci0
WARNING: dwc2 fe980000.usb@7e980000.of: dwc2_core_reset: Timeout! Waiting for Core Soft Reset
ERROR: dwc2 fe980000.usb@7e980000.of: probe failed: Connection timed out
bcm2835_mci fe340000.mmc@7e340000.of: registered as mci1
malloc space: 0x1f17ca80 -> 0x3e2f94ff (size 497.5 MiB)
no /dev/disk0.0 or /dev/mmc0.0. using default env
no '/hat' node found in vc fdt
environment load /dev/env0: No such file or directory
Maybe you have to create the partition.

Hit any to stop autoboot:    3

Signed-off-by: Pierre-Olivier Huard <pierre-olivier.huard@rtone.fr>
---
 arch/arm/boards/raspberry-pi/lowlevel.c |  3 +++
 arch/arm/dts/Makefile                   |  2 +-
 arch/arm/dts/bcm2711-rpi-cm4s-io.dts    | 20 ++++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/bcm2711-rpi-cm4s-io.dts

diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
index a1e195d811..b3727d930f 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.c
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -73,6 +73,7 @@ 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[];
+extern char __dtb_z_bcm2711_rpi_cm4s_io_start[];
 
 RPI_ENTRY_FUNCTION(start_raspberry_pi1, SZ_128M, fdt)
 {
@@ -139,6 +140,8 @@ static void *rpi_get_board_fdt(int rev)
 		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);
+	case BCM2711_BOARD_REV_CM4_S:
+		return DT_IF_ENABLED(__dtb_z_bcm2711_rpi_cm4s_io_start, CONFIG_MACH_RPI4);
 	}
 
 	return NULL;
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 04af3bd646..506716d806 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 bcm2711-rpi-400.dtb.o bcm2711-rpi-cm4-io.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_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-cm4s-io.dts b/arch/arm/dts/bcm2711-rpi-cm4s-io.dts
new file mode 100644
index 0000000000..8302523e47
--- /dev/null
+++ b/arch/arm/dts/bcm2711-rpi-cm4s-io.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include "bcm2711-rpi-cm4-io.dts"
+
+&{/memory@0} {
+	reg = <0x0 0x0 0x0>;
+};
+
+/ {
+	compatible = "raspberrypi,4-compute-module-s", "brcm,bcm2711";
+	model = "Raspberry Pi Compute Module 4S IO Board";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&uart1 {
+	/delete-property/ clock-frequency;
+};
-- 
2.43.0




             reply	other threads:[~2024-02-15 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 12:01 Pierre-Olivier Huard [this message]
2024-02-16 12:01 ` 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=20240215120109.23242-1-pierre-olivier.huard@rtone.fr \
    --to=pierre-olivier.huard@rtone.fr \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=oss-contrib@rtone.fr \
    --cc=sebastien.bourdelin@rtone.fr \
    /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