ARM: dts: add minimal device tree for compute model 3
Subsystems (4)
PATCH 1/1 ARM: dts: add minimal device tree for compute model 3
From: Martin Sperl <[email protected]>
Add a minimal working device tree for the compute model 3 for both arm and arm64.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm2837-rpi-cm3.dts | 38 ++++++++++++++++++++++++ arch/arm64/boot/dts/broadcom/Makefile | 1 + arch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dts | 2 ++ 4 files changed, 42 insertions(+) create mode 100644 arch/arm/boot/dts/bcm2837-rpi-cm3.dts create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dts
arch/arm/boot/dts/Makefile +1 -0
@@ -75,6 +75,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ bcm2835-rpi-a-plus.dtb \ bcm2836-rpi-2-b.dtb \ bcm2837-rpi-3-b.dtb \ + bcm2837-rpi-cm3.dtb \ bcm2835-rpi-zero.dtb \ bcm2835-rpi-zero-w.dtb dtb-$(CONFIG_ARCH_BCM_5301X) += \
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +38 -0
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2837.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-usb-host.dtsi" + +/ { + compatible = "raspberrypi,3-compute-model", "brcm,bcm2837"; + model = "Raspberry Pi Compute Module 3"; + + memory { + reg = <0 0x40000000>; + }; + + leds { + act { + gpios = <&gpio 47 0>; + }; + }; +}; + +&hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; + +/* SDHOST is used to drive the SD card */ +&sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; + status = "okay"; + bus-width = <4>; +};
arch/arm64/boot/dts/broadcom/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb +dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-cm3.dtb dts-dirs += northstar2 dts-dirs += stingray
arch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dts new file +2 -0
@@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "arm/bcm2837-rpi-cm3.dts"
Signature · 1 line
2.11.0
PATCH 1/1 ARM: dts: add minimal device tree for compute model 3
Hi Martin,
thanks for working on this.
Quoted 7 lines
kernel at martin.sperl.org hat am 24. November 2017 um 13:18 geschrieben:
From: Martin Sperl <[email protected]>
Add a minimal working device tree for the compute model 3 for both arm and arm64.
i think it's worth to provide more context:
The Raspberry Compute Module 3 is a SoM which contains a BCM2837 processor, 1 GB RAM and a 4 GB eMMC. There is also a carrier board which is called Compute Module IO Board V3.
Datasheet:
https://www.raspberrypi.org/documentation/hardware/computemodule/RPI-CM-DATASHEET-V1_0.pdf
Quoted 16 lines
Signed-off-by Martin Sperl <[email protected]>--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm2837-rpi-cm3.dts | 38 ++++++++++++++++++++++++ arch/arm64/boot/dts/broadcom/Makefile | 1 + arch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dts | 2 ++ 4 files changed, 42 insertions(+) create mode 100644 arch/arm/boot/dts/bcm2837-rpi-cm3.dts create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dtsarch/arm/boot/dts/Makefile +0
-0
arch/arm/boot/dts/Makefile dtb-$(CONFIG_ARCH_BCM2835) += \ · line 78
Quoted 4 lines
arch/arm/boot/dts/Makefile +1
-0@@ -75,6 +75,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ bcm2835-rpi-a-plus.dtb \ bcm2836-rpi-2-b.dtb \ bcm2837-rpi-3-b.dtb \ + bcm2837-rpi-cm3.dtb \
Since we need always 2 boards (SoM + carrier), i like to see two separate DT files. A DTSI file for the SoM (describe RAM, eMMC) and a DTS file for the carrier board (please look at arm/boot/dts/imx6ul-tx6ul.dtsi and arm/boot/dts/imx6ul-tx6ul-mainboard.dts as an example).
Suggested include hierarchy:
bcm2837.dtsi
bcm2837-rpi-cm3.dtsi
bcm2837-rpi-cm3-io3.dtsQuoted 9 lines
arch/arm/boot/dts/Makefile +0
-0bcm2835-rpi-zero.dtb \ bcm2835-rpi-zero-w.dtb dtb-$(CONFIG_ARCH_BCM_5301X) += \arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +0
-0
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 8
Quoted 8 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +8
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2837.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-usb-host.dtsi" + +/ { + compatible = "raspberrypi,3-compute-model", "brcm,bcm2837";
s/compute-model/compute-module/
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 9
Quoted 1 line
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +1
-0+ model = "Raspberry Pi Compute Module 3";
Raspberry Pi Compute Module 3 on a IO board V3
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 17
Quoted 8 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +8
-0+ + memory { + reg = <0 0x40000000>; + }; + + leds { + act { + gpios = <&gpio 47 0>;
Please use GPIO_ACTIVE_HIGH here
Quoted 5 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +5
-0+ }; + }; +}; + +&hdmi {
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 32
Quoted 10 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +10
-0+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; + +/* SDHOST is used to drive the SD card */
Since this is an eMMC please drop this misleading comment.
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 37
Quoted 5 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +5
-0+&sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; + status = "okay"; + bus-width = <4>;
non-removable;
Quoted 28 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +1
-0+};arch/arm64/boot/dts/broadcom/Makefile +1
-0@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb +dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-cm3.dtb dts-dirs += northstar2 dts-dirs += stingrayarch/arm64/boot/dts/broadcom/bcm2837-rpi-cm3.dts new file +2
-0@@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "arm/bcm2837-rpi-cm3.dts"Signature · 7 lines
2.11.0 _______________________________________________ linux-rpi-kernel mailing list linux-rpi-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 ARM: dts: add minimal device tree for compute model 3
Hi Martin,
Quoted 14 lines
kernel at martin.sperl.org hat am 25. November 2017 um 08:32 geschrieben:
Quoted 9 lines · Stefan Wahren
Since we need always 2 boards (SoM + carrier), i like to see two separate DT files. A DTSI file for the SoM (describe RAM, eMMC) and a DTS file for the carrier board (please look at
arm/boot/dts/imx6ul-tx6ul.dtsiandarm/boot/dts/imx6ul-tx6ul-mainboard.dtsas an example).Suggested include hierarchy:
bcm2837.dtsi
bcm2837-rpi-cm3.dtsibcm2837-rpi-cm3-io3.dts
Quoted 5 lines
I shall give it a try.
But it would require possibly 2 versions of the cm-module:
* the one including emmc
* the one exposing the sd-card ports/pins (CM3-Lite)
I don't have those modules. In case it's possible to create a DTSI which applies for both of them then i prefer this. In theory there are two extremes:
1) Create a DTS for all Compute Modules (like the Raspberry Pi foundation)
2) Create DTS/DTSI files for all possible combinations
I think none of them are practical. In case 1 3rd party vendors would start to copy the DTS file and case 2 is hard to maintain. So we need to try something in the middle by starting with a DTSI file which applies to all CM3 (including the Lite) and a DTS which applies to all Raspberry Pi IO Boards and include the CM3 DTSI.
Quoted 2 lines
But then I could go as far as including the ?classic? CM V1 as well...
Yeah, that's the idea.
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
bcm2835-rpi-zero.dtb \ bcm2835-rpi-zero-w.dtbdtb-$(CONFIG_ARCH_BCM_5301X) += \
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +2
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/;
Quoted 8 lines
Quoted 8 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 8
Quoted 6 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +6
-0+#include "bcm2837.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-usb-host.dtsi" + +/ { + compatible = "raspberrypi,3-compute-model", "brcm,bcm2837";s/compute-model/compute-module/
Btw i forgot to mention this needs to be documented here [1] in a separate patch.
Quoted 7 lines
Quoted 5 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 9
Quoted 2 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +1
-0+ model = "Raspberry Pi Compute Module 3";Raspberry Pi Compute Module 3 on a IO board V3
That is not necessarily true - I am running the CM3 on a IO-board v1 so that one is compatible?
AFAIK this combination is not recommend, because the old IO board doesn't provide enough power for all use cases. But that's not the point about my comment. We need to describe the combination.
How about "Raspberry Pi Compute Module 3 on a IO board" and "bcm2837-rpi-cm3-io.dts" ?
Quoted 17 lines
Quoted 6 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 32
Quoted 3 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +1
-0+/* SDHOST is used to drive the SD card */Since this is an eMMC please drop this misleading comment.
for a CM3-Lite it is exposing sd card pins
Quoted 7 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts line 37
Quoted 5 lines
arch/arm/boot/dts/bcm2837-rpi-cm3.dts new file +5
-0+&sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; + status = "okay"; + bus-width = <4>;non-removable;
Quoted 1 line
See comment about Lite...
Okay, i'm fine without it but then we need a comment that the upcoming DTSI should apply to CM3 and CM3-Lite. Also the commit log should mention the CM3-Lite so everybody understand it.
Please wait a little bit before sending your second version to give the others some time for comments.
Thanks
Stefan
Quoted 3 lines
Martin
PATCH 1/1 ARM: dts: add minimal device tree for compute model 3
In reply to kernel at martin.sperl.orgHi Martin,
Quoted 8 lines
kernel at martin.sperl.org hat am 24. November 2017 um 13:18 geschrieben:
From: Martin Sperl <[email protected]>
Add a minimal working device tree for the compute model 3 for both arm and arm64.
just a note before you send a V2. Recently i looked at the CM datasheet (revision 1.0) and noticed on the block diagram (page 8) that the CM3 eMMC I/O voltage is fixed at 1.8 Volt (doesn't apply to CM3 lite). Providing a fixed regulator for vmmc/vqmmc-supply [1] would give the MMC core the chance to figure out the right voltage.
[1] - http://elixir.free-electrons.com/linux/latest/source/Documentation/devicetree/bindings/mmc/mmc.txt