mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Tomaz Solc <tomaz.solc@tablix.org>
To: barebox@lists.infradead.org
Cc: Tomaz Solc <tomaz.solc@tablix.org>
Subject: [PATCH 7/7] ARM: rpi: Add device tree for Compute Module 3.
Date: Thu, 14 Feb 2019 14:24:29 +0100	[thread overview]
Message-ID: <20190214132429.7463-8-tomaz.solc@tablix.org> (raw)
In-Reply-To: <20190214132429.7463-1-tomaz.solc@tablix.org>

Compute Module needs "no-sd" property on the MMC interface otherwise
mci-bcm2835 hangs on SD card probe.

The switch to uart0 introduced in ab76f9d0 doesn't currently work on Compute
Module.
---
 arch/arm/boards/raspberry-pi/lowlevel.c | 10 ++++++++++
 arch/arm/dts/Makefile                   |  1 +
 arch/arm/dts/bcm2837-rpi-cm3.dts        | 26 ++++++++++++++++++++++++++
 arch/arm/mach-bcm283x/Kconfig           |  6 ++++++
 images/Makefile.bcm283x                 |  6 +++++-
 5 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/bcm2837-rpi-cm3.dts

diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
index 34c935092..1a3d39421 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.c
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -33,3 +33,13 @@ ENTRY_FUNCTION(start_raspberry_pi3, r0, r1, r2)
 
 	barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_512M, fdt);
 }
+
+extern char __dtb_bcm2837_rpi_cm3_start[];
+ENTRY_FUNCTION(start_raspberry_pi_cm3, r0, r1, r2)
+{
+	void *fdt = __dtb_bcm2837_rpi_cm3_start + get_runtime_offset();
+
+	arm_cpu_lowlevel_init();
+
+	barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_512M, fdt);
+}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 3cdee1ffb..82595f9b7 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -75,6 +75,7 @@ pbl-dtb-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o
 pbl-dtb-$(CONFIG_MACH_RPI) += bcm2835-rpi.dtb.o
 pbl-dtb-$(CONFIG_MACH_RPI2) += bcm2836-rpi-2.dtb.o
 pbl-dtb-$(CONFIG_MACH_RPI3) += bcm2837-rpi-3.dtb.o
+pbl-dtb-$(CONFIG_MACH_RPI_CM3) += bcm2837-rpi-cm3.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o
 pbl-dtb-$(CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB) += imx6sx-sdb.dtb.o
diff --git a/arch/arm/dts/bcm2837-rpi-cm3.dts b/arch/arm/dts/bcm2837-rpi-cm3.dts
new file mode 100644
index 000000000..636db9a1e
--- /dev/null
+++ b/arch/arm/dts/bcm2837-rpi-cm3.dts
@@ -0,0 +1,26 @@
+#include <arm64/broadcom/bcm2837-rpi-3-b.dts>
+
+/ {
+	chosen {
+		stdout-path = &uart0;
+	};
+
+	memory {
+		reg = <0x0 0x0>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+	/delete-node/ bluetooth;
+};
+
+&sdhci {
+	pinctrl-0 = <&emmc_gpio48>;
+	no-sd;
+	/delete-node/ wifi@1;
+};
+
+&sdhost {
+	status = "disabled";
+};
diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index af2f88c47..bb5f75dc9 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -25,6 +25,12 @@ config MACH_RPI3
 	select MACH_RPI_COMMON
 	select ARM_SECURE_MONITOR
 
+config MACH_RPI_CM3
+	bool "RaspberryPi Compute Module 3 (BCM2837/CORTEX-A53)"
+	select CPU_V7
+	select MACH_RPI_COMMON
+	select ARM_SECURE_MONITOR
+
 endmenu
 
 config MACH_RPI_DEBUG_UART_BASE
diff --git a/images/Makefile.bcm283x b/images/Makefile.bcm283x
index 9199f153d..2189f266e 100644
--- a/images/Makefile.bcm283x
+++ b/images/Makefile.bcm283x
@@ -12,4 +12,8 @@ image-$(CONFIG_MACH_RPI2) += barebox-raspberry-pi-2.img
 
 pblb-$(CONFIG_MACH_RPI3) += start_raspberry_pi3
 FILE_barebox-raspberry-pi-3.img = start_raspberry_pi3.pblb
-image-$(CONFIG_MACH_RPI3) += barebox-raspberry-pi-3.img
\ No newline at end of file
+image-$(CONFIG_MACH_RPI3) += barebox-raspberry-pi-3.img
+
+pblb-$(CONFIG_MACH_RPI_CM3) += start_raspberry_pi_cm3
+FILE_barebox-raspberry-pi-cm3.img = start_raspberry_pi_cm3.pblb
+image-$(CONFIG_MACH_RPI_CM3) += barebox-raspberry-pi-cm3.img
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-02-14 13:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 13:24 [PATCH 0/7] Fixing MMC access on Raspberry Pi CM3 Tomaz Solc
2019-02-14 13:24 ` [PATCH 1/7] ARM: rpi: switch emmc from sdhost to sdhci Tomaz Solc
2019-02-14 13:24 ` [PATCH 2/7] Kconfig: add pin controllers submenu Tomaz Solc
2019-02-14 13:24 ` [PATCH 3/7] pinctrl: bcm2835: move existing code from gpio Tomaz Solc
2019-02-14 13:24 ` [PATCH 4/7] pinctrl: bcm2835: register the pin controller Tomaz Solc
2019-02-14 13:24 ` [PATCH 5/7] mci: move after pinctrl in link order Tomaz Solc
2019-02-14 23:34   ` Andrey Smirnov
2019-02-18  8:42   ` Sascha Hauer
2019-02-18  9:54     ` Tomaž Šolc
2019-02-14 13:24 ` [PATCH 6/7] mci: bcm2835: parse other device tree properties Tomaz Solc
2019-02-14 13:24 ` Tomaz Solc [this message]
2019-02-14 14:15   ` [PATCH 7/7] ARM: rpi: Add device tree for Compute Module 3 Roland Hieber

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=20190214132429.7463-8-tomaz.solc@tablix.org \
    --to=tomaz.solc@tablix.org \
    --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