Skip to content

Commit

Permalink
Merge tag 'tags/bcm2835-dt-next-2021-10-06' into devicetree/next
Browse files Browse the repository at this point in the history
Stefan Wahren adds devicetree support for the Raspbery Pi Compute Module
4 and its IO board

Signed-off-by: Florian Fainelli <[email protected]>
  • Loading branch information
ffainelli committed Oct 8, 2021
2 parents beff77b + 1d71d54 commit 0f937bc
Show file tree
Hide file tree
Showing 16 changed files with 342 additions and 137 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ properties:
items:
- enum:
- raspberrypi,400
- raspberrypi,4-compute-module
- raspberrypi,4-model-b
- const: brcm,bcm2711

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ properties:
interrupts:
maxItems: 1

power-domains:
maxItems: 1

required:
- "#clock-cells"
- compatible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ properties:
dma-names:
const: audio-rx

power-domains:
maxItems: 1

required:
- compatible
- reg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ properties:
interrupts:
maxItems: 1

power-domains:
maxItems: 1

required:
- compatible
- reg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ properties:
interrupts:
maxItems: 1

power-domains:
maxItems: 1

required:
- compatible
- reg
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
bcm2837-rpi-cm3-io3.dtb \
bcm2711-rpi-400.dtb \
bcm2711-rpi-4-b.dtb \
bcm2711-rpi-cm4-io.dtb \
bcm2835-rpi-zero.dtb \
bcm2835-rpi-zero-w.dtb
dtb-$(CONFIG_ARCH_BCM_5301X) += \
Expand Down
38 changes: 9 additions & 29 deletions arch/arm/boot/dts/bcm2711-rpi-4-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "bcm2711.dtsi"
#include "bcm2711-rpi.dtsi"
#include "bcm283x-rpi-usb-peripheral.dtsi"
#include "bcm283x-rpi-wifi-bt.dtsi"

/ {
compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
Expand All @@ -26,11 +27,6 @@
};
};

wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
};

sd_io_1v8_reg: sd_io_1v8_reg {
compatible = "regulator-gpio";
regulator-name = "vdd-sd-io";
Expand All @@ -56,6 +52,10 @@
};
};

&bt {
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
};

&ddc0 {
status = "okay";
};
Expand Down Expand Up @@ -178,23 +178,6 @@
status = "okay";
};

/* SDHCI is used to control the SDIO for wireless */
&sdhci {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&emmc_gpio34>;
bus-width = <4>;
non-removable;
mmc-pwrseq = <&wifi_pwrseq>;
status = "okay";

brcmf: wifi@1 {
reg = <1>;
compatible = "brcm,bcm4329-fmac";
};
};

/* EMMC2 is used to drive the SD card */
&emmc2 {
vqmmc-supply = <&sd_io_1v8_reg>;
Expand Down Expand Up @@ -236,13 +219,6 @@
pinctrl-names = "default";
pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
uart-has-rtscts;
status = "okay";

bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <2000000>;
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
};
};

/* uart1 is mapped to the pin header */
Expand All @@ -259,3 +235,7 @@
&vec {
status = "disabled";
};

&wifi_pwrseq {
reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
};
138 changes: 138 additions & 0 deletions arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "bcm2711-rpi-cm4.dtsi"
#include "bcm283x-rpi-usb-host.dtsi"

/ {
model = "Raspberry Pi Compute Module 4 IO Board";

leds {
led-act {
gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
};

led-pwr {
label = "PWR";
gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
default-state = "keep";
linux,default-trigger = "default-on";
};
};
};

&ddc0 {
status = "okay";
};

&ddc1 {
status = "okay";
};

&gpio {
/*
* Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
* the official GPU firmware DT blob.
*
* Legend:
* "FOO" = GPIO line named "FOO" on the schematic
* "FOO_N" = GPIO line named "FOO" on schematic, active low
*/
gpio-line-names = "ID_SDA",
"ID_SCL",
"SDA1",
"SCL1",
"GPIO_GCLK",
"GPIO5",
"GPIO6",
"SPI_CE1_N",
"SPI_CE0_N",
"SPI_MISO",
"SPI_MOSI",
"SPI_SCLK",
"GPIO12",
"GPIO13",
/* Serial port */
"TXD1",
"RXD1",
"GPIO16",
"GPIO17",
"GPIO18",
"GPIO19",
"GPIO20",
"GPIO21",
"GPIO22",
"GPIO23",
"GPIO24",
"GPIO25",
"GPIO26",
"GPIO27",
"RGMII_MDIO",
"RGMIO_MDC",
/* Used by BT module */
"CTS0",
"RTS0",
"TXD0",
"RXD0",
/* Used by Wifi */
"SD1_CLK",
"SD1_CMD",
"SD1_DATA0",
"SD1_DATA1",
"SD1_DATA2",
"SD1_DATA3",
/* Shared with SPI flash */
"PWM0_MISO",
"PWM1_MOSI",
"STATUS_LED_G_CLK",
"SPIFLASH_CE_N",
"SDA0",
"SCL0",
"RGMII_RXCLK",
"RGMII_RXCTL",
"RGMII_RXD0",
"RGMII_RXD1",
"RGMII_RXD2",
"RGMII_RXD3",
"RGMII_TXCLK",
"RGMII_TXCTL",
"RGMII_TXD0",
"RGMII_TXD1",
"RGMII_TXD2",
"RGMII_TXD3";
};

&hdmi0 {
status = "okay";
};

&hdmi1 {
status = "okay";
};

&genet {
status = "okay";
};

&pixelvalve0 {
status = "okay";
};

&pixelvalve1 {
status = "okay";
};

&pixelvalve2 {
status = "okay";
};

&pixelvalve4 {
status = "okay";
};

&vc4 {
status = "okay";
};

&vec {
status = "disabled";
};
113 changes: 113 additions & 0 deletions arch/arm/boot/dts/bcm2711-rpi-cm4.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "bcm2711.dtsi"
#include "bcm2711-rpi.dtsi"
#include "bcm283x-rpi-wifi-bt.dtsi"

/ {
compatible = "raspberrypi,4-compute-module", "brcm,bcm2711";

chosen {
/* 8250 auxiliary UART instead of pl011 */
stdout-path = "serial1:115200n8";
};

sd_io_1v8_reg: sd_io_1v8_reg {
compatible = "regulator-gpio";
regulator-name = "vdd-sd-io";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
regulator-settling-time-us = <5000>;
gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
states = <1800000 0x1>,
<3300000 0x0>;
status = "okay";
};

sd_vcc_reg: sd_vcc_reg {
compatible = "regulator-fixed";
regulator-name = "vcc-sd";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
enable-active-high;
gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
};
};

&bt {
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
};

/* EMMC2 is used to drive the eMMC */
&emmc2 {
bus-width = <8>;
vqmmc-supply = <&sd_io_1v8_reg>;
vmmc-supply = <&sd_vcc_reg>;
broken-cd;
/* Even the IP block is limited to 100 MHz
* this provides a throughput gain
*/
mmc-hs200-1_8v;
status = "okay";
};

&expgpio {
gpio-line-names = "BT_ON",
"WL_ON",
"PWR_LED_OFF",
"ANT1",
"VDD_SD_IO_SEL",
"CAM_GPIO",
"SD_PWR_ON",
"ANT2";

ant1: ant1-hog {
gpio-hog;
gpios = <3 GPIO_ACTIVE_HIGH>;
/* internal antenna enabled */
output-high;
line-name = "ant1";
};

ant2: ant2-hog {
gpio-hog;
gpios = <7 GPIO_ACTIVE_HIGH>;
/* external antenna disabled */
output-low;
line-name = "ant2";
};
};

&genet {
phy-handle = <&phy1>;
phy-mode = "rgmii-rxid";
status = "okay";
};

&genet_mdio {
phy1: ethernet-phy@0 {
/* No PHY interrupt */
reg = <0x0>;
};
};

/* uart0 communicates with the BT module */
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
uart-has-rtscts;
};

/* uart1 is mapped to the pin header */
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_gpio14>;
status = "okay";
};

&wifi_pwrseq {
reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
};
Loading

0 comments on commit 0f937bc

Please sign in to comment.