From d7bcfc75039e59557e9e96fb605336bffb4d178a Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 25 Nov 2026 13:42:41 +0000 Subject: [PATCH 1/2] ARM: dts: bcm2711/bcm283x: Leave upstream DT files unmodified Move the downstream changes out of the upstream DT files and into downstream ones, so that rebases only have to carry small hooks: - bcm2711-rpi-4-b.dts: an include at the top (bcm2711-rpi-4-b-ds-pre.dtsi, the i2c0 label rename) and at the end (bcm2711-rpi-4-b-ds.dtsi). - bcm2711-rpi-400.dts: an include at the end (bcm2711-rpi-400-ds.dtsi), which recreates led_act deleted by the upstream file. - bcm283x.dtsi, bcm2711.dtsi, bcm2711-rpi.dtsi: overrides moved to bcm270x.dtsi and bcm2711-rpi-ds.dtsi. - bcm2835-common.dtsi, bcm2835-rpi.dtsi: the moves of vc4, firmware and power under /soc are done in bcm270x.dtsi and the new bcm2835-rpi-ds.dtsi. The downstream dtbs keep the same nodes, properties and labels; only node order and phandle values change. The upstream-only dtbs (bcm2835-*, bcm2836-*, bcm2837-*, bcm2711-rpi-cm4-io) now match upstream exactly. Signed-off-by: Dom Cobley --- arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi | 1 + arch/arm/boot/dts/broadcom/bcm270x.dtsi | 32 +++ .../dts/broadcom/bcm2711-rpi-4-b-ds-pre.dtsi | 3 + .../boot/dts/broadcom/bcm2711-rpi-4-b-ds.dtsi | 265 +++++++++++++++++ .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 271 ++---------------- .../boot/dts/broadcom/bcm2711-rpi-400-ds.dtsi | 53 ++++ .../arm/boot/dts/broadcom/bcm2711-rpi-400.dts | 51 +--- .../arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi | 37 +++ arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi | 17 -- arch/arm/boot/dts/broadcom/bcm2711.dtsi | 11 +- .../arm/boot/dts/broadcom/bcm2835-common.dtsi | 7 +- .../arm/boot/dts/broadcom/bcm2835-rpi-ds.dtsi | 38 +++ arch/arm/boot/dts/broadcom/bcm2835-rpi.dtsi | 16 +- arch/arm/boot/dts/broadcom/bcm283x.dtsi | 8 +- 14 files changed, 465 insertions(+), 345 deletions(-) create mode 100644 arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds-pre.dtsi create mode 100644 arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds.dtsi create mode 100644 arch/arm/boot/dts/broadcom/bcm2711-rpi-400-ds.dtsi create mode 100644 arch/arm/boot/dts/broadcom/bcm2835-rpi-ds.dtsi diff --git a/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi index f4aedb5c532b51..719ec3dcab695e 100644 --- a/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi @@ -3,6 +3,7 @@ #define i2c0 i2c0mux #include "bcm2835-rpi.dtsi" #undef i2c0 +#include "bcm2835-rpi-ds.dtsi" #include "bcm270x-rpi.dtsi" / { diff --git a/arch/arm/boot/dts/broadcom/bcm270x.dtsi b/arch/arm/boot/dts/broadcom/bcm270x.dtsi index cd8bc7869cad33..0b012ee7f86580 100644 --- a/arch/arm/boot/dts/broadcom/bcm270x.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm270x.dtsi @@ -1,6 +1,38 @@ /* Downstream bcm283x.dtsi diff */ #include +#ifdef BCM2711 +#include "bcm2835-rpi-ds.dtsi" +#else +/ { + /delete-node/ gpu; + + soc { + vc4: gpu { + compatible = "brcm,bcm2835-vc4"; + }; + }; +}; +#endif + +&dsi0 { + clocks = <&clocks BCM2835_PLLD_DSI0>, + <&clocks BCM2835_CLOCK_DSI0E>, + <&clocks BCM2835_CLOCK_DSI0P>; +}; + +&pwm { + assigned-clock-rates = <50000000>; +}; + +/ { + clocks { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + }; +}; + / { chosen: chosen { // Disable audio by default diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds-pre.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds-pre.dtsi new file mode 100644 index 00000000000000..fb03b3bbcdb5a2 --- /dev/null +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds-pre.dtsi @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-2.0 +#define BCM2711 +#define i2c0 i2c0if diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds.dtsi new file mode 100644 index 00000000000000..af7b2af5a8f81a --- /dev/null +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b-ds.dtsi @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-2.0 +#undef i2c0 + +/delete-node/ &i2c0mux; + +&usb { + /delete-property/ dr_mode; + /delete-property/ g-rx-fifo-size; + /delete-property/ g-np-tx-fifo-size; + /delete-property/ g-tx-fifo-size; +}; + +/* bcm2711-rpi-4-b.dts already provides cam1_reg */ +#define cam1_reg cam1_reg_270x +#include "bcm270x.dtsi" +#undef cam1_reg +/delete-node/ &cam1_reg_270x; + +&expgpio { + gpio-line-names = "BT_ON", + "WL_ON", + "PWR_LED_OFF", + "GLOBAL_RESET", + "VDD_SD_IO_SEL", + "CAM_GPIO", + "SD_PWR_ON", + "SD_OC_N"; +}; + +&phy1 { + brcm,powerdown-enable; +}; + +// ============================================= +// Downstream rpi- changes + +#include "bcm271x-rpi-bt.dtsi" + +/ { + soc { + /delete-node/ pixelvalve@7e807000; + /delete-node/ hdmi@7e902000; + }; +}; + +&phy1 { + /delete-node/ leds; +}; + +#include "bcm2711-rpi-ds.dtsi" +#include "bcm283x-rpi-csi1-2lane.dtsi" +#include "bcm283x-rpi-i2c0mux_0_44.dtsi" + +/ { + /delete-node/ wifi-pwrseq; +}; + +&mmcnr { + pinctrl-names = "default"; + pinctrl-0 = <&sdio_pins>; + bus-width = <4>; + status = "okay"; +}; + +&uart0 { + pinctrl-0 = <&uart0_pins &bt_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-0 = <&uart1_pins>; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; + cs-gpios = <&gpio 8 1>, <&gpio 7 1>; + + spidev0: spidev@0{ + compatible = "spidev"; + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; + spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ + compatible = "spidev"; + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; + spi-max-frequency = <125000000>; + }; +}; + +&gpio { + gpio-line-names = "ID_SDA", + "ID_SCL", + "GPIO2", + "GPIO3", + "GPIO4", + "GPIO5", + "GPIO6", + "GPIO7", + "GPIO8", + "GPIO9", + "GPIO10", + "GPIO11", + "GPIO12", + "GPIO13", + "GPIO14", + "GPIO15", + "GPIO16", + "GPIO17", + "GPIO18", + "GPIO19", + "GPIO20", + "GPIO21", + "GPIO22", + "GPIO23", + "GPIO24", + "GPIO25", + "GPIO26", + "GPIO27", + "RGMII_MDIO", + "RGMIO_MDC", + /* Used by BT module */ + "CTS0", /* 30 */ + "RTS0", + "TXD0", + "RXD0", + /* Used by Wifi */ + "SD1_CLK", + "SD1_CMD", /* 35 */ + "SD1_DATA0", + "SD1_DATA1", + "SD1_DATA2", + "SD1_DATA3", + /* Shared with SPI flash */ + "PWM0_MISO", /* 40 */ + "PWM1_MOSI", + "STATUS_LED_G_CLK", + "SPIFLASH_CE_N", + "SDA0", + "SCL0", /* 45 */ + "RGMII_RXCLK", + "RGMII_RXCTL", + "RGMII_RXD0", + "RGMII_RXD1", + "RGMII_RXD2", /* 50 */ + "RGMII_RXD3", + "RGMII_TXCLK", + "RGMII_TXCTL", + "RGMII_TXD0", + "RGMII_TXD1", /* 55 */ + "RGMII_TXD2", + "RGMII_TXD3"; + + bt_pins: bt_pins { + brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0 + // to fool pinctrl + brcm,function = <0>; + brcm,pull = <2>; + }; + + uart0_pins: uart0_pins { + brcm,pins = <32 33>; + brcm,function = ; + brcm,pull = <0 2>; + }; + + uart1_pins: uart1_pins { + brcm,pins; + brcm,function; + brcm,pull; + }; + + uart1_bt_pins: uart1_bt_pins { + brcm,pins = <32 33 30 31>; + brcm,function = ; /* alt5=UART1 */ + brcm,pull = <0 2 2 0>; + }; +}; + +&i2c0if { + clock-frequency = <100000>; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + clock-frequency = <100000>; +}; + +&i2s { + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; +}; + +// ============================================= +// Board specific stuff here + +&sdhost { + status = "disabled"; +}; + +&phy1 { + led-modes = <0x00 0x08>; /* link/activity link */ +}; + +&gpio { + audio_pins: audio_pins { + brcm,pins = <40 41>; + brcm,function = <4>; + brcm,pull = <0>; + }; +}; + +&led_act { + default-state = "off"; + linux,default-trigger = "mmc0"; +}; + +&led_pwr { + default-state = "off"; +}; + +&pwm1 { + status = "disabled"; +}; + +&vchiq { + pinctrl-names = "default"; + pinctrl-0 = <&audio_pins>; +}; + +&cam1_reg { + gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>; +}; + +cam0_reg: &cam_dummy_reg { +}; + +i2c_csi_dsi0: &i2c0 { +}; + +/ { + __overrides__ { + audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_hdmi=0'}"; + + act_led_gpio = <&led_act>,"gpios:4"; + act_led_activelow = <&led_act>,"gpios:8"; + act_led_trigger = <&led_act>,"linux,default-trigger"; + + pwr_led_gpio = <&led_pwr>,"gpios:4"; + pwr_led_activelow = <&led_pwr>,"gpios:8"; + pwr_led_trigger = <&led_pwr>,"linux,default-trigger"; + + eee = <&phy1>,"eee-broken-1000t!", + <&phy1>,"eee-broken-100tx!"; + eth_led0 = <&phy1>,"led-modes:0"; + eth_led1 = <&phy1>,"led-modes:4"; + eth_max_speed = <&phy1>,"max-speed:0"; + }; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts index d695c2c18191ca..3fb534a184649b 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts @@ -1,19 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; -#define BCM2711 -#define i2c0 i2c0if +#include "bcm2711-rpi-4-b-ds-pre.dtsi" #include "bcm2711.dtsi" #include "bcm2711-rpi.dtsi" -/delete-node/&i2c0mux; #include "bcm283x-rpi-led-deprecated.dtsi" +#include "bcm283x-rpi-usb-peripheral.dtsi" #include "bcm283x-rpi-wifi-bt.dtsi" #include -#undef i2c0 -#include "bcm270x.dtsi" -#define i2c0 i2c0mux -#undef i2c0 - -/delete-node/ &cam1_reg; / { compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; @@ -76,7 +69,7 @@ "VDD_SD_IO_SEL", "CAM_GPIO", /* 5 */ "SD_PWR_ON", - "SD_OC_N"; + ""; }; &gpio { @@ -90,21 +83,21 @@ */ gpio-line-names = "ID_SDA", /* 0 */ "ID_SCL", - "GPIO2", - "GPIO3", - "GPIO4", + "SDA1", + "SCL1", + "GPIO_GCLK", "GPIO5", /* 5 */ "GPIO6", - "GPIO7", - "GPIO8", - "GPIO9", - "GPIO10", /* 10 */ - "GPIO11", + "SPI_CE1_N", + "SPI_CE0_N", + "SPI_MISO", + "SPI_MOSI", /* 10 */ + "SPI_SCLK", "GPIO12", "GPIO13", /* Serial port */ - "GPIO14", - "GPIO15", /* 15 */ + "TXD1", + "RXD1", /* 15 */ "GPIO16", "GPIO17", "GPIO18", @@ -213,7 +206,6 @@ phy1: ethernet-phy@1 { /* No PHY interrupt */ reg = <0x1>; - brcm,powerdown-enable; leds { #address-cells = <1>; @@ -223,7 +215,7 @@ led@0 { reg = <0>; color = ; - function = "lan";//LED_FUNCTION_LAN; + function = LED_FUNCTION_LAN; default-state = "keep"; }; @@ -231,7 +223,7 @@ led@1 { reg = <1>; color = ; - function = "lan";//LED_FUNCTION_LAN; + function = LED_FUNCTION_LAN; default-state = "keep"; }; }; @@ -280,235 +272,4 @@ reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; }; -// ============================================= -// Downstream rpi- changes - -#include "bcm271x-rpi-bt.dtsi" - -/ { - soc { - /delete-node/ pixelvalve@7e807000; - /delete-node/ hdmi@7e902000; - }; -}; - -&phy1 { - /delete-node/ leds; -}; - -#include "bcm2711-rpi-ds.dtsi" -#include "bcm283x-rpi-csi1-2lane.dtsi" -#include "bcm283x-rpi-i2c0mux_0_44.dtsi" - -/ { - /delete-node/ wifi-pwrseq; -}; - -&mmcnr { - pinctrl-names = "default"; - pinctrl-0 = <&sdio_pins>; - bus-width = <4>; - status = "okay"; -}; - -&uart0 { - pinctrl-0 = <&uart0_pins &bt_pins>; - status = "okay"; -}; - -&uart1 { - pinctrl-0 = <&uart1_pins>; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins &spi0_cs_pins>; - cs-gpios = <&gpio 8 1>, <&gpio 7 1>; - - spidev0: spidev@0{ - compatible = "spidev"; - reg = <0>; /* CE0 */ - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <125000000>; - }; - - spidev1: spidev@1{ - compatible = "spidev"; - reg = <1>; /* CE1 */ - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <125000000>; - }; -}; - -&gpio { - gpio-line-names = "ID_SDA", - "ID_SCL", - "GPIO2", - "GPIO3", - "GPIO4", - "GPIO5", - "GPIO6", - "GPIO7", - "GPIO8", - "GPIO9", - "GPIO10", - "GPIO11", - "GPIO12", - "GPIO13", - "GPIO14", - "GPIO15", - "GPIO16", - "GPIO17", - "GPIO18", - "GPIO19", - "GPIO20", - "GPIO21", - "GPIO22", - "GPIO23", - "GPIO24", - "GPIO25", - "GPIO26", - "GPIO27", - "RGMII_MDIO", - "RGMIO_MDC", - /* Used by BT module */ - "CTS0", /* 30 */ - "RTS0", - "TXD0", - "RXD0", - /* Used by Wifi */ - "SD1_CLK", - "SD1_CMD", /* 35 */ - "SD1_DATA0", - "SD1_DATA1", - "SD1_DATA2", - "SD1_DATA3", - /* Shared with SPI flash */ - "PWM0_MISO", /* 40 */ - "PWM1_MOSI", - "STATUS_LED_G_CLK", - "SPIFLASH_CE_N", - "SDA0", - "SCL0", /* 45 */ - "RGMII_RXCLK", - "RGMII_RXCTL", - "RGMII_RXD0", - "RGMII_RXD1", - "RGMII_RXD2", /* 50 */ - "RGMII_RXD3", - "RGMII_TXCLK", - "RGMII_TXCTL", - "RGMII_TXD0", - "RGMII_TXD1", /* 55 */ - "RGMII_TXD2", - "RGMII_TXD3"; - - bt_pins: bt_pins { - brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0 - // to fool pinctrl - brcm,function = <0>; - brcm,pull = <2>; - }; - - uart0_pins: uart0_pins { - brcm,pins = <32 33>; - brcm,function = ; - brcm,pull = <0 2>; - }; - - uart1_pins: uart1_pins { - brcm,pins; - brcm,function; - brcm,pull; - }; - - uart1_bt_pins: uart1_bt_pins { - brcm,pins = <32 33 30 31>; - brcm,function = ; /* alt5=UART1 */ - brcm,pull = <0 2 2 0>; - }; -}; - -&i2c0if { - clock-frequency = <100000>; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - clock-frequency = <100000>; -}; - -&i2s { - pinctrl-names = "default"; - pinctrl-0 = <&i2s_pins>; -}; - -// ============================================= -// Board specific stuff here - -&sdhost { - status = "disabled"; -}; - -&phy1 { - led-modes = <0x00 0x08>; /* link/activity link */ -}; - -&gpio { - audio_pins: audio_pins { - brcm,pins = <40 41>; - brcm,function = <4>; - brcm,pull = <0>; - }; -}; - -&led_act { - default-state = "off"; - linux,default-trigger = "mmc0"; -}; - -&led_pwr { - default-state = "off"; -}; - -&pwm1 { - status = "disabled"; -}; - -&vchiq { - pinctrl-names = "default"; - pinctrl-0 = <&audio_pins>; -}; - -&cam1_reg { - gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>; -}; - -cam0_reg: &cam_dummy_reg { -}; - -i2c_csi_dsi0: &i2c0 { -}; - -/ { - __overrides__ { - audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_hdmi=0'}"; - - act_led_gpio = <&led_act>,"gpios:4"; - act_led_activelow = <&led_act>,"gpios:8"; - act_led_trigger = <&led_act>,"linux,default-trigger"; - - pwr_led_gpio = <&led_pwr>,"gpios:4"; - pwr_led_activelow = <&led_pwr>,"gpios:8"; - pwr_led_trigger = <&led_pwr>,"linux,default-trigger"; - - eee = <&phy1>,"eee-broken-1000t!", - <&phy1>,"eee-broken-100tx!"; - eth_led0 = <&phy1>,"led-modes:0"; - eth_led1 = <&phy1>,"led-modes:4"; - eth_max_speed = <&phy1>,"max-speed:0"; - }; -}; +#include "bcm2711-rpi-4-b-ds.dtsi" diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400-ds.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400-ds.dtsi new file mode 100644 index 00000000000000..d17b6894b54011 --- /dev/null +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400-ds.dtsi @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 + +// ============================================= +// Downstream rpi- changes + +/ { + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&audio_pins { + brcm,pins = <>; + brcm,function = <>; +}; + +// Declare the LED but leave it disabled, in case a user wants to map it +// to a GPIO on the header +&leds { + led_act: led-act { + label = "ACT"; + default-state = "off"; + linux,default-trigger = "mmc0"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + status = "disabled"; + }; +}; + +&led_pwr { + default-state = "off"; +}; + +&cam1_reg { + /delete-property/ gpio; +}; + +cam0_reg: &cam_dummy_reg { +}; + +/ { + __overrides__ { + audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_hdmi=0'}"; + + act_led_gpio = <&led_act>,"gpios:4", + <&led_act>,"status=okay"; + act_led_activelow = <&led_act>,"gpios:8"; + act_led_trigger = <&led_act>,"linux,default-trigger"; + eth_max_speed = <&phy1>,"max-speed:0"; + pwr_led_gpio = <&led_pwr>,"gpios:4"; + pwr_led_activelow = <&led_pwr>,"gpios:8"; + pwr_led_trigger = <&led_pwr>,"linux,default-trigger"; + }; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts index cd0bc647f7fcc0..c459ccae8e5606 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +/dts-v1/; #include "bcm2711-rpi-4-b.dts" / { @@ -36,54 +37,10 @@ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; }; +/delete-node/ &led_act; + &pm { /delete-property/ system-power-controller; }; -// ============================================= -// Downstream rpi- changes - -/ { - chosen { - stdout-path = "serial0:115200n8"; - }; -}; - -&audio_pins { - brcm,pins = <>; - brcm,function = <>; -}; - -// Declare the LED but leave it disabled, in case a user wants to map it -// to a GPIO on the header -&led_act { - default-state = "off"; - gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; - status = "disabled"; -}; - -&led_pwr { - default-state = "off"; -}; - -&cam1_reg { - /delete-property/ gpio; -}; - -cam0_reg: &cam_dummy_reg { -}; - -/ { - __overrides__ { - audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_hdmi=0'}"; - - act_led_gpio = <&led_act>,"gpios:4", - <&led_act>,"status=okay"; - act_led_activelow = <&led_act>,"gpios:8"; - act_led_trigger = <&led_act>,"linux,default-trigger"; - eth_max_speed = <&phy1>,"max-speed:0"; - pwr_led_gpio = <&led_pwr>,"gpios:4"; - pwr_led_activelow = <&led_pwr>,"gpios:8"; - pwr_led_trigger = <&led_pwr>,"linux,default-trigger"; - }; -}; +#include "bcm2711-rpi-400-ds.dtsi" diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi index fae2ecd2466bcb..6b7ae4002faf63 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi @@ -1,6 +1,43 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm270x-rpi.dtsi" +/ { + aliases { + blpubkey = &blpubkey; + }; + + scb-bus@fc000000 { + hevc_dec: codec@7eb10000 { + compatible = "brcm,bcm2711-hevc-dec", "raspberrypi,hevc-dec"; + reg = <0x0 0x7eb00000 0x10000>, /* HEVC */ + <0x0 0x7eb10000 0x1000>; /* INTC */ + reg-names = "hevc", + "intc"; + interrupts = ; + clocks = <&firmware_clocks 11>; + }; + }; +}; + +&rmem { + /* + * RPi4 will copy the binary public key blob (if present) from the bootloader + * into memory for use by the OS. + */ + blpubkey: nvram@1 { + compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x0 0x0 0x0>; + no-map; + status = "disabled"; + }; +}; + +&pwm1 { + assigned-clock-rates = <50000000>; +}; + / { chosen { bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=32"; diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi index 60b75679a4066d..1eb6406449d198 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi @@ -15,7 +15,6 @@ ethernet0 = &genet; pcie0 = &pcie0; blconfig = &blconfig; - blpubkey = &blpubkey; }; i2c0mux: i2c-mux0 { @@ -100,18 +99,6 @@ no-map; status = "disabled"; }; - /* - * RPi4 will copy the binary public key blob (if present) from the bootloader - * into memory for use by the OS. - */ - blpubkey: nvram@1 { - compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x0 0x0 0x0>; - no-map; - status = "disabled"; - }; }; &v3d { @@ -121,7 +108,3 @@ &vchiq { interrupts = ; }; - -&hevc_dec { - clocks = <&firmware_clocks 11>; -}; diff --git a/arch/arm/boot/dts/broadcom/bcm2711.dtsi b/arch/arm/boot/dts/broadcom/bcm2711.dtsi index f5744b911117df..5e3b4bb3939670 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi @@ -277,7 +277,7 @@ reg = <0x7e20c800 0x28>; clocks = <&clocks BCM2835_CLOCK_PWM>; assigned-clocks = <&clocks BCM2835_CLOCK_PWM>; - assigned-clock-rates = <50000000>; + assigned-clock-rates = <10000000>; #pwm-cells = <3>; status = "disabled"; }; @@ -627,15 +627,6 @@ resets = <&pm BCM2835_RESET_V3D>; interrupts = ; }; - - hevc_dec: codec@7eb10000 { - compatible = "brcm,bcm2711-hevc-dec", "raspberrypi,hevc-dec"; - reg = <0x0 0x7eb00000 0x10000>, /* HEVC */ - <0x0 0x7eb10000 0x1000>; /* INTC */ - reg-names = "hevc", - "intc"; - interrupts = ; - }; }; }; diff --git a/arch/arm/boot/dts/broadcom/bcm2835-common.dtsi b/arch/arm/boot/dts/broadcom/bcm2835-common.dtsi index 23d4b9bb62fdc7..39eea8ce10583e 100644 --- a/arch/arm/boot/dts/broadcom/bcm2835-common.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2835-common.dtsi @@ -142,9 +142,10 @@ resets = <&pm BCM2835_RESET_V3D>; }; - vc4: gpu { - compatible = "brcm,bcm2835-vc4"; - }; + }; + + vc4: gpu { + compatible = "brcm,bcm2835-vc4"; }; }; diff --git a/arch/arm/boot/dts/broadcom/bcm2835-rpi-ds.dtsi b/arch/arm/boot/dts/broadcom/bcm2835-rpi-ds.dtsi new file mode 100644 index 00000000000000..421c4be965f47e --- /dev/null +++ b/arch/arm/boot/dts/broadcom/bcm2835-rpi-ds.dtsi @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Downstream bcm2835-rpi.dtsi diff: firmware and power live under /soc */ + +/ { + /delete-node/ firmware; + + soc { + firmware: firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + mboxes = <&mailbox>; + + firmware_clocks: clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <1>; + }; + +#ifdef BCM2711 + expgpio: gpio { + compatible = "raspberrypi,firmware-gpio"; + gpio-controller; + #gpio-cells = <2>; + status = "okay"; + }; + + reset: reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <1>; + }; +#endif + }; + + power: power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <&firmware>; + #power-domain-cells = <1>; + }; + }; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm2835-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2835-rpi.dtsi index e9bf41b9f5c181..46c91468f4c546 100644 --- a/arch/arm/boot/dts/broadcom/bcm2835-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2835-rpi.dtsi @@ -1,8 +1,8 @@ #include / { - soc { - firmware: firmware { + firmware { + firmware: rpi-firmware { compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; mboxes = <&mailbox>; @@ -10,14 +10,16 @@ compatible = "raspberrypi,firmware-clocks"; #clock-cells = <1>; }; - }; - power: power { - compatible = "raspberrypi,bcm2835-power"; - firmware = <&firmware>; - #power-domain-cells = <1>; + power: power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <&firmware>; + #power-domain-cells = <1>; + }; }; + }; + soc { vchiq: mailbox@7e00b840 { compatible = "brcm,bcm2835-vchiq"; reg = <0x7e00b840 0x3c>; diff --git a/arch/arm/boot/dts/broadcom/bcm283x.dtsi b/arch/arm/boot/dts/broadcom/bcm283x.dtsi index 562c4e9d08cc0a..69b0919f1324ab 100644 --- a/arch/arm/boot/dts/broadcom/bcm283x.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm283x.dtsi @@ -363,7 +363,7 @@ #size-cells = <0>; #clock-cells = <1>; - clocks = <&clocks BCM2835_PLLD_DSI0>, + clocks = <&clocks BCM2835_PLLA_DSI0>, <&clocks BCM2835_CLOCK_DSI0E>, <&clocks BCM2835_CLOCK_DSI0P>; clock-names = "phy", "escape", "pixel"; @@ -415,7 +415,7 @@ reg = <0x7e20c000 0x28>; clocks = <&clocks BCM2835_CLOCK_PWM>; assigned-clocks = <&clocks BCM2835_CLOCK_PWM>; - assigned-clock-rates = <50000000>; + assigned-clock-rates = <10000000>; #pwm-cells = <3>; status = "disabled"; }; @@ -502,10 +502,6 @@ }; clocks { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; - /* The oscillator is the root of the clock tree. */ clk_osc: clk-osc { compatible = "fixed-clock"; From ca3738089bfd0ffd3047d58698b7e4cbf10bb37a Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 25 Nov 2026 13:42:42 +0000 Subject: [PATCH 2/2] arm64: dts: bcm2712: Leave upstream Pi 5 DT files unmodified The downstream bcm2712-rpi-5-b.dts replaced the upstream file entirely and deleted bcm2712-rpi-5-b-base.dtsi. Move the downstream content to bcm2712-rpi-5-b-ds.dtsi, restore both upstream files, and hook the downstream file in with an #include and an #if 0 around the upstream body. The resulting dtbs are byte-identical. Signed-off-by: Dom Cobley --- .../dts/broadcom/bcm2712-rpi-5-b-base.dtsi | 296 +++++++ .../boot/dts/broadcom/bcm2712-rpi-5-b-ds.dtsi | 795 +++++++++++++++++ .../boot/dts/broadcom/bcm2712-rpi-5-b.dts | 816 ++---------------- 3 files changed, 1167 insertions(+), 740 deletions(-) create mode 100644 arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi create mode 100644 arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ds.dtsi diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi new file mode 100644 index 00000000000000..e5030da60f9e70 --- /dev/null +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi @@ -0,0 +1,296 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/dts-v1/; + +#include +#include +#include +#include "bcm2712.dtsi" + +/ { + compatible = "raspberrypi,5-model-b", "brcm,bcm2712"; + model = "Raspberry Pi 5"; + + aliases { + serial10 = &uart10; + }; + + chosen: chosen { + stdout-path = "serial10:115200n8"; + }; + + clk_rp1_xosc: clock-50000000 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "rp1-xosc"; + clock-frequency = <50000000>; + }; + + /* Will be filled by the bootloader */ + memory@0 { + device_type = "memory"; + reg = <0 0 0 0x28000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pwr_button_default>; + status = "okay"; + + power_button: power-button { + label = "pwr_button"; + linux,code = ; + gpios = <&gio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <50>; + }; + }; + + firmware { + firmware: rpi-firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + + mboxes = <&mailbox>; + + firmware_clocks: clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <1>; + }; + + reset: reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <1>; + }; + + power: power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <&firmware>; + #power-domain-cells = <1>; + }; + }; + }; + + 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 = <&gio_aon 3 GPIO_ACTIVE_HIGH>; + states = <1800000 1>, + <3300000 0>; + }; + + 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; + gpios = <&gio_aon 4 GPIO_ACTIVE_HIGH>; + }; + + wl_on_reg: wl-on-reg { + compatible = "regulator-fixed"; + regulator-name = "wl-on-regulator"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + pinctrl-0 = <&wl_on_default>; + pinctrl-names = "default"; + gpio = <&gio 28 GPIO_ACTIVE_HIGH>; + startup-delay-us = <150000>; + enable-active-high; + }; +}; + +&ddc0 { + status = "okay"; +}; + +&ddc1 { + status = "okay"; +}; + +&disp_intr { + status = "okay"; +}; + +&pinctrl { + bt_shutdown_default: bt-shutdown-default-state { + function = "gpio"; + pins = "gpio29"; + }; + + emmc_sd_default: emmc-sd-default-state { + pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3"; + bias-pull-up; + }; + + pwr_button_default: pwr-button-default-state { + function = "gpio"; + pins = "gpio20"; + bias-pull-up; + }; + + sdio2_30_default: sdio2-30-default-state { + clk-pins { + function = "sd2"; + pins = "gpio30"; + bias-disable; + }; + cmd-pins { + function = "sd2"; + pins = "gpio31"; + bias-pull-up; + }; + dat-pins { + function = "sd2"; + pins = "gpio32", "gpio33", "gpio34", "gpio35"; + bias-pull-up; + }; + }; + + uarta_24_default: uarta-24-default-state { + rts-pins { + function = "uart0"; + pins = "gpio24"; + bias-disable; + }; + cts-pins { + function = "uart0"; + pins = "gpio25"; + bias-pull-up; + }; + txd-pins { + function = "uart0"; + pins = "gpio26"; + bias-disable; + }; + rxd-pins { + function = "uart0"; + pins = "gpio27"; + bias-pull-up; + }; + }; + + wl_on_default: wl-on-default-state { + function = "gpio"; + pins = "gpio28"; + }; +}; + +&pinctrl_aon { + emmc_aon_cd_default: emmc-aon-cd-default-state { + function = "sd_card_g"; + pins = "aon_gpio5"; + bias-pull-up; + }; +}; + +/* The Debug UART, on Rpi5 it's on JST-SH 1.0mm 3-pin connector + * labeled "UART", i.e. the interface with the system console. + */ +&uart10 { + status = "okay"; +}; + +/* SDIO1 is used to drive the SD card */ +&sdio1 { + pinctrl-0 = <&emmc_sd_default>, <&emmc_aon_cd_default>; + pinctrl-names = "default"; + vqmmc-supply = <&sd_io_1v8_reg>; + vmmc-supply = <&sd_vcc_reg>; + bus-width = <4>; + sd-uhs-sdr50; + sd-uhs-ddr50; + sd-uhs-sdr104; + cd-gpios = <&gio_aon 5 GPIO_ACTIVE_LOW>; +}; + +&sdio2 { + pinctrl-0 = <&sdio2_30_default>; + pinctrl-names = "default"; + bus-width = <4>; + vmmc-supply = <&wl_on_reg>; + sd-uhs-ddr50; + non-removable; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + wifi: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + }; +}; + +/* uarta communicates with the BT module */ +&uarta { + uart-has-rtscts; + pinctrl-0 = <&uarta_24_default &bt_shutdown_default>; + pinctrl-names = "default"; + status = "okay"; + + bluetooth: bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <3000000>; + shutdown-gpios = <&gio 29 GPIO_ACTIVE_HIGH>; + }; +}; + +&usb { + power-domains = <&power RPI_POWER_DOMAIN_USB>; + status = "okay"; +}; + +&hvs { + clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; + clock-names = "core", "disp"; + status = "okay"; +}; + +&hdmi0 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; + status = "okay"; +}; + +&hdmi1 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; + status = "okay"; +}; + +&mop { + status = "okay"; +}; + +&moplet { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&pcie2 { + status = "okay"; +}; + +&pixelvalve0 { + status = "okay"; +}; + +&pixelvalve1 { + status = "okay"; +}; + +&v3d { + clocks = <&firmware_clocks 5>; +}; + +&vc4 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ds.dtsi b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ds.dtsi new file mode 100644 index 00000000000000..0c997b604c1862 --- /dev/null +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ds.dtsi @@ -0,0 +1,795 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +#include +#include +#include +#include +#include +#include + +#include "bcm2712-ds.dtsi" + +/ { + compatible = "raspberrypi,5-model-b", "brcm,bcm2712"; + model = "Raspberry Pi 5"; + + /* Will be filled by the bootloader */ + memory@0 { + device_type = "memory"; + reg = <0 0 0 0x28000000>; + }; + + leds: leds { + compatible = "gpio-leds"; + + led_pwr: led-pwr { + label = "PWR"; + gpios = <&rp1_gpio 44 GPIO_ACTIVE_LOW>; + default-state = "off"; + linux,default-trigger = "none"; + }; + + led_act: led-act { + label = "ACT"; + gpios = <&gio_aon 9 GPIO_ACTIVE_LOW>; + default-state = "off"; + linux,default-trigger = "mmc0"; + }; + }; + + 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 = <&gio_aon 3 GPIO_ACTIVE_HIGH>; + states = <1800000 1>, + <3300000 0>; + }; + + 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; + gpios = <&gio_aon 4 GPIO_ACTIVE_HIGH>; + }; + + wl_on_reg: wl-on-reg { + compatible = "regulator-fixed"; + regulator-name = "wl-on-regulator"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + pinctrl-0 = <&wl_on_pins>; + pinctrl-names = "default"; + + gpio = <&gio 28 GPIO_ACTIVE_HIGH>; + + startup-delay-us = <150000>; + enable-active-high; + }; + + cam1_clk: cam1_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + status = "disabled"; + }; + + cam0_clk: cam0_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + status = "disabled"; + }; + + cam0_reg: cam0_reg { + compatible = "regulator-fixed"; + regulator-name = "cam0_reg"; + enable-active-high; + gpio = <&rp1_gpio 34 0>; // CD0_IO0_MICCLK, to MIPI 0 connector + }; + + cam1_reg: cam1_reg { + compatible = "regulator-fixed"; + regulator-name = "cam1_reg"; + enable-active-high; + gpio = <&rp1_gpio 46 0>; // CD1_IO0_MICCLK, to MIPI 1 connector + }; + + pcie1_3v3: pcie1_3v3 { + compatible = "regulator-fixed"; + regulator-name = "pcie1-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + enable-active-high; + gpio = <&rp1_gpio 28 GPIO_ACTIVE_HIGH>; // PCIE_RP1_WAKE + startup-delay-us = <20000>; + }; + + cam_dummy_reg: cam_dummy_reg { + compatible = "regulator-fixed"; + regulator-name = "cam-dummy-reg"; + }; + + dummy: dummy { + // A target for unwanted overlay fragments + }; + + + // A few extra labels to keep overlays happy + + i2c0if: i2c0if {}; + i2c0mux: i2c0mux {}; +}; + +rp1_target: &pcie2 { + brcm,vdm-qos-map = /bits/ 8 <8 8 8 9 10 10 11 11>; + aspm-no-l0s; + status = "okay"; +}; + +&pcie1 { + brcm,fifo-qos-map = /bits/ 8 <3 3 3 3>; + + /* + * Hack to get linux to probe this pcie after pcie2. + * The pcie-brcmstb driver does not defer probe if + * the regulator is not found yet. This forces pcie1 + * to be probed after pcie2 so that the regulator + * is found. + */ + vpcie3v3-supply = <&pcie1_3v3>; + + pci@0,0 { + device_type = "pci"; + reg = <0 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + vpcie3v3-supply = <&pcie1_3v3>; + }; +}; + +// The system SPI for the bootloader EEPROM +&spi10 { status = "okay"; }; + +#include "rp1.dtsi" + +&rp1 { + // PCIe address space layout: + // 00_00000000-00_00xxxxxx = RP1 peripherals + // 10_00000000-1x_xxxxxxxx = up to 64GB system RAM + + // outbound access aimed at PCIe 0_00xxxxxx -> RP1 c0_40xxxxxx + // This is the RP1 peripheral space + ranges = <0xc0 0x40000000 + 0x02000000 0x00 0x00000000 + 0x00 0x00410000>; + + dma-ranges = + // inbound RP1 1x_xxxxxxxx -> PCIe 1x_xxxxxxxx + <0x10 0x00000000 + 0x43000000 0x10 0x00000000 + 0x10 0x00000000>, + + // inbound RP1 c0_40xxxxxx -> PCIe 00_00xxxxxx + // This allows the RP1 DMA controller to address RP1 hardware + <0xc0 0x40000000 + 0x02000000 0x0 0x00000000 + 0x0 0x00410000>, + + // inbound RP1 0x_xxxxxxxx -> PCIe 1x_xxxxxxxx + <0x00 0x00000000 + 0x02000000 0x10 0x00000000 + 0x10 0x00000000>; +}; + +// Expose RP1 nodes as system nodes with labels + +&rp1_dma { + status = "okay"; +}; + +&rp1_eth { + status = "okay"; + phy-handle = <&phy1>; + phy-reset-gpios = <&rp1_gpio 32 GPIO_ACTIVE_LOW>; + phy-reset-duration = <5>; + + phy1: ethernet-phy@1 { + reg = <0x1>; + brcm,powerdown-enable; + led-modes = <0 8>; + }; +}; + +/* The Debug UART, on Rpi5 it's on JST-SH 1.0mm 3-pin connector + * labeled "UART", i.e. the interface with the system console. + */ +&uart10 { + status = "okay"; +}; + +gpio: &rp1_gpio { + status = "okay"; +}; + +aux: &dummy {}; + +&rp1_usb0 { + pinctrl-0 = <&usb_vbus_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&rp1_usb1 { + status = "okay"; +}; + +#include "bcm2712-rpi.dtsi" + +i2c_csi_dsi0: &i2c6 { // Note: This is for MIPI0 connector only + pinctrl-0 = <&rp1_i2c6_38_39>; + pinctrl-names = "default"; + clock-frequency = <100000>; + symlink = "i2c-6"; +}; + +i2c_csi_dsi1: &i2c4 { // Note: This is for MIPI1 connector only + pinctrl-0 = <&rp1_i2c4_40_41>; + pinctrl-names = "default"; + clock-frequency = <100000>; + symlink = "i2c-4"; +}; + +i2c_csi_dsi: &i2c_csi_dsi1 { }; // An alias for compatibility + +csi0: &rp1_csi0 { }; +csi1: &rp1_csi1 { }; +dsi0: &rp1_dsi0 { }; +dsi1: &rp1_dsi1 { }; +dpi: &rp1_dpi { }; +vec: &rp1_vec { }; +dpi_gpio0: &rp1_dpi_24bit_gpio0 { }; +dpi_gpio1: &rp1_dpi_24bit_gpio2 { }; +dpi_18bit_cpadhi_gpio0: &rp1_dpi_18bit_cpadhi_gpio0 { }; +dpi_18bit_cpadhi_gpio2: &rp1_dpi_18bit_cpadhi_gpio2 { }; +dpi_18bit_gpio0: &rp1_dpi_18bit_gpio0 { }; +dpi_18bit_gpio2: &rp1_dpi_18bit_gpio2 { }; +dpi_16bit_cpadhi_gpio0: &rp1_dpi_16bit_cpadhi_gpio0 { }; +dpi_16bit_cpadhi_gpio2: &rp1_dpi_16bit_cpadhi_gpio2 { }; +dpi_16bit_gpio0: &rp1_dpi_16bit_gpio0 { }; +dpi_16bit_gpio2: &rp1_dpi_16bit_gpio2 { }; + +/* Add the IOMMUs for some RP1 bus masters */ + +&csi0 { + iommus = <&iommu5>; +}; + +&csi1 { + iommus = <&iommu5>; +}; + +&dsi0 { + iommus = <&iommu5>; +}; + +&dsi1 { + iommus = <&iommu5>; +}; + +&dpi { + iommus = <&iommu5>; +}; + +&vec { + iommus = <&iommu5>; +}; + +&ddc0 { + status = "disabled"; +}; + +&ddc1 { + status = "disabled"; +}; + +&hdmi0 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; + status = "disabled"; +}; + +&hdmi1 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; + status = "disabled"; +}; + +&hvs { + clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; + clock-names = "core", "disp"; +}; + +&mop { + status = "disabled"; +}; + +&moplet { + status = "disabled"; +}; + +&pixelvalve0 { + status = "disabled"; +}; + +&pixelvalve1 { + status = "disabled"; +}; + +&disp_intr { + status = "disabled"; +}; + +/* SDIO1 is used to drive the SD card */ +&sdio1 { + pinctrl-0 = <&emmc_sd_pulls>, <&emmc_aon_cd_pins>; + pinctrl-names = "default"; + vqmmc-supply = <&sd_io_1v8_reg>; + vmmc-supply = <&sd_vcc_reg>; + bus-width = <4>; + sd-uhs-sdr50; + sd-uhs-ddr50; + sd-uhs-sdr104; + supports-cqe = <1>; + cd-gpios = <&gio_aon 5 GPIO_ACTIVE_LOW>; + //no-1-8-v; + status = "okay"; +}; + +&pinctrl_aon { + emmc_aon_cd_pins: emmc_aon_cd_pins { + function = "sd_card_g"; + pins = "aon_gpio5"; + bias-pull-up; + }; + + /* Slight hack - only one PWM pin (status LED) is usable */ + aon_pwm_1pin: aon_pwm_1pin { + function = "aon_pwm"; + pins = "aon_gpio9"; + }; +}; + +&pinctrl { + pwr_button_pins: pwr_button_pins { + function = "gpio"; + pins = "gpio20"; + bias-pull-up; + }; + + wl_on_pins: wl_on_pins { + function = "gpio"; + pins = "gpio28"; + }; + + bt_shutdown_pins: bt_shutdown_pins { + function = "gpio"; + pins = "gpio29"; + }; + + emmc_sd_pulls: emmc_sd_pulls { + pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3"; + bias-pull-up; + }; +}; + +/* uarta communicates with the BT module */ +&uarta { + uart-has-rtscts; + auto-flow-control; + status = "okay"; + clock-frequency = <96000000>; + pinctrl-0 = <&uarta_24_pins &bt_shutdown_pins>; + pinctrl-names = "default"; + + bluetooth: bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <3000000>; + shutdown-gpios = <&gio 29 GPIO_ACTIVE_HIGH>; + brcm,power-off-in-suspend; + local-bd-address = [ 00 00 00 00 00 00 ]; + }; +}; + +&i2c10 { + clock-frequency = <400000>; + pinctrl-0 = <&i2c3_m4_agpio0_pins>; + pinctrl-names = "default"; +}; + +/ { + fan: cooling_fan { + status = "disabled"; + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-min-state = <0>; + cooling-max-state = <3>; + cooling-levels = <0 75 125 175 250>; + pwms = <&rp1_pwm1 3 41566 PWM_POLARITY_INVERTED>; + rpm-regmap = <&rp1_pwm1>; + rpm-offset = <0x3c>; + }; + + pwr_button { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&pwr_button_pins>; + status = "okay"; + + pwr_key: pwr { + label = "pwr_button"; + // linux,code = <205>; // KEY_SUSPEND + linux,code = <116>; // KEY_POWER + gpios = <&gio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <50>; // ms + }; + }; +}; + +&usb { + power-domains = <&power RPI_POWER_DOMAIN_USB>; +}; + +/* SDIO2 drives the WLAN interface */ +&sdio2 { + pinctrl-0 = <&sdio2_30_pins>; + pinctrl-names = "default"; + bus-width = <4>; + vmmc-supply = <&wl_on_reg>; + sd-uhs-ddr50; + non-removable; + cap-power-off-card; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + wifi: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + local-mac-address = [00 00 00 00 00 00]; + }; +}; + +&pinctrl { + spi10_gpio2: spi10_gpio2 { + function = "vc_spi0"; + pins = "gpio2", "gpio3", "gpio4"; + bias-disable; + }; + + spi10_cs_gpio1: spi10_cs_gpio1 { + function = "gpio"; + pins = "gpio1"; + bias-pull-up; + }; +}; + +spi10_pins: &spi10_gpio2 {}; +spi10_cs_pins: &spi10_cs_gpio1 {}; + +&spi10 { + pinctrl-names = "default"; + cs-gpios = <&gio 1 1>; + pinctrl-0 = <&spi10_pins &spi10_cs_pins>; + + spidev10: spidev@0 { + compatible = "spidev"; + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; + spi-max-frequency = <20000000>; + status = "okay"; + }; +}; + +// ============================================= +// Board specific stuff here + +&gio_aon { + // Don't use GIO_AON as an interrupt controller because it will + // clash with the firmware monitoring the PMIC interrupt via the VPU. + + /delete-property/ interrupt-controller; + /delete-property/ #interrupt-cells; +}; + +&main_aon_irq { + // Don't use the MAIN_AON_IRQ interrupt controller because it will + // clash with the firmware monitoring the PMIC interrupt via the VPU. + + status = "disabled"; +}; + +&rp1_pwm1 { + status = "disabled"; + pinctrl-0 = <&rp1_pwm1_gpio45>; + pinctrl-names = "default"; +}; + +&thermal_trips { + cpu_tepid: cpu-tepid { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + + cpu_warm: cpu-warm { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + + cpu_hot: cpu-hot { + temperature = <67500>; + hysteresis = <5000>; + type = "active"; + }; + + cpu_vhot: cpu-vhot { + temperature = <75000>; + hysteresis = <5000>; + type = "active"; + }; +}; + +&cooling_maps { + tepid { + trip = <&cpu_tepid>; + cooling-device = <&fan 1 1>; + }; + + warm { + trip = <&cpu_warm>; + cooling-device = <&fan 2 2>; + }; + + hot { + trip = <&cpu_hot>; + cooling-device = <&fan 3 3>; + }; + + vhot { + trip = <&cpu_vhot>; + cooling-device = <&fan 4 4>; + }; + + melt { + trip = <&cpu_crit>; + cooling-device = <&fan 4 4>; + }; +}; + +&gio { + // The GPIOs above 35 are not used on Pi 5, so shrink the upper bank + // to reduce the clutter in gpioinfo/pinctrl + brcm,gpio-bank-widths = <32 4>; + + gpio-line-names = + "-", // GPIO_000 + "2712_BOOT_CS_N", // GPIO_001 + "2712_BOOT_MISO", // GPIO_002 + "2712_BOOT_MOSI", // GPIO_003 + "2712_BOOT_SCLK", // GPIO_004 + "-", // GPIO_005 + "-", // GPIO_006 + "-", // GPIO_007 + "-", // GPIO_008 + "-", // GPIO_009 + "-", // GPIO_010 + "-", // GPIO_011 + "-", // GPIO_012 + "-", // GPIO_013 + "PCIE_SDA", // GPIO_014 + "PCIE_SCL", // GPIO_015 + "-", // GPIO_016 + "-", // GPIO_017 + "-", // GPIO_018 + "-", // GPIO_019 + "PWR_GPIO", // GPIO_020 + "2712_G21_FS", // GPIO_021 + "-", // GPIO_022 + "-", // GPIO_023 + "BT_RTS", // GPIO_024 + "BT_CTS", // GPIO_025 + "BT_TXD", // GPIO_026 + "BT_RXD", // GPIO_027 + "WL_ON", // GPIO_028 + "BT_ON", // GPIO_029 + "WIFI_SDIO_CLK", // GPIO_030 + "WIFI_SDIO_CMD", // GPIO_031 + "WIFI_SDIO_D0", // GPIO_032 + "WIFI_SDIO_D1", // GPIO_033 + "WIFI_SDIO_D2", // GPIO_034 + "WIFI_SDIO_D3"; // GPIO_035 +}; + +&gio_aon { + gpio-line-names = + "RP1_SDA", // AON_GPIO_00 + "RP1_SCL", // AON_GPIO_01 + "RP1_RUN", // AON_GPIO_02 + "SD_IOVDD_SEL", // AON_GPIO_03 + "SD_PWR_ON", // AON_GPIO_04 + "SD_CDET_N", // AON_GPIO_05 + "SD_FLG_N", // AON_GPIO_06 + "-", // AON_GPIO_07 + "2712_WAKE", // AON_GPIO_08 + "2712_STAT_LED", // AON_GPIO_09 + "-", // AON_GPIO_10 + "-", // AON_GPIO_11 + "PMIC_INT", // AON_GPIO_12 + "UART_TX_FS", // AON_GPIO_13 + "UART_RX_FS", // AON_GPIO_14 + "-", // AON_GPIO_15 + "-", // AON_GPIO_16 + + // Pad bank0 out to 32 entries + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + + "HDMI0_SCL", // AON_SGPIO_00 + "HDMI0_SDA", // AON_SGPIO_01 + "HDMI1_SCL", // AON_SGPIO_02 + "HDMI1_SDA", // AON_SGPIO_03 + "PMIC_SCL", // AON_SGPIO_04 + "PMIC_SDA"; // AON_SGPIO_05 + + rp1_run_hog { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "RP1 RUN pin"; + }; +}; + +&rp1_gpio { + gpio-line-names = + "ID_SDA", // GPIO0 + "ID_SCL", // GPIO1 + "GPIO2", // GPIO2 + "GPIO3", // GPIO3 + "GPIO4", // GPIO4 + "GPIO5", // GPIO5 + "GPIO6", // GPIO6 + "GPIO7", // GPIO7 + "GPIO8", // GPIO8 + "GPIO9", // GPIO9 + "GPIO10", // GPIO10 + "GPIO11", // GPIO11 + "GPIO12", // GPIO12 + "GPIO13", // GPIO13 + "GPIO14", // GPIO14 + "GPIO15", // GPIO15 + "GPIO16", // GPIO16 + "GPIO17", // GPIO17 + "GPIO18", // GPIO18 + "GPIO19", // GPIO19 + "GPIO20", // GPIO20 + "GPIO21", // GPIO21 + "GPIO22", // GPIO22 + "GPIO23", // GPIO23 + "GPIO24", // GPIO24 + "GPIO25", // GPIO25 + "GPIO26", // GPIO26 + "GPIO27", // GPIO27 + + "PCIE_RP1_WAKE", // GPIO28 + "FAN_TACH", // GPIO29 + "HOST_SDA", // GPIO30 + "HOST_SCL", // GPIO31 + "ETH_RST_N", // GPIO32 + "-", // GPIO33 + + "CD0_IO0_MICCLK", // GPIO34 + "CD0_IO0_MICDAT0", // GPIO35 + "RP1_PCIE_CLKREQ_N", // GPIO36 + "-", // GPIO37 + "CD0_SDA", // GPIO38 + "CD0_SCL", // GPIO39 + "CD1_SDA", // GPIO40 + "CD1_SCL", // GPIO41 + "USB_VBUS_EN", // GPIO42 + "USB_OC_N", // GPIO43 + "RP1_STAT_LED", // GPIO44 + "FAN_PWM", // GPIO45 + "CD1_IO0_MICCLK", // GPIO46 + "2712_WAKE", // GPIO47 + "CD1_IO1_MICDAT1", // GPIO48 + "EN_MAX_USB_CUR", // GPIO49 + "-", // GPIO50 + "-", // GPIO51 + "-", // GPIO52 + "-"; // GPIO53 + + usb_vbus_pins: usb_vbus_pins { + function = "vbus1"; + pins = "gpio42", "gpio43"; + }; +}; + +/ { + __overrides__ { + sd_cqe = <&sdio1>, "supports-cqe:0"; + }; +}; + +&hvs { + clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; + clock-names = "core", "disp"; +}; + +&hdmi0 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; +}; + +&hdmi1 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; +}; + +&soc { + firmware: firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + #address-cells = <1>; + #size-cells = <1>; + + mboxes = <&mailbox>; + dma-ranges; + + firmware_clocks: clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <1>; + }; + + reset: reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <1>; + }; + }; + + power: power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <&firmware>; + #power-domain-cells = <1>; + }; +}; + +&hvs { + clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; + clock-names = "core", "disp"; +}; + +&hdmi0 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; +}; + +&hdmi1 { + clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; + clock-names = "hdmi", "bvb", "audio", "cec"; +}; + +&pcie1 { + brcm,clkreq-mode = "safe"; +}; + +&pcie2 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts index 3039e385adf703..071c1ab1fd835a 100644 --- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts @@ -10,797 +10,133 @@ /dts-v1/; -#include -#include -#include -#include -#include -#include - -#include "bcm2712-ds.dtsi" +#include "bcm2712-rpi-5-b-ds.dtsi" +#if 0 +#include "bcm2712-rpi-5-b-base.dtsi" / { - compatible = "raspberrypi,5-model-b", "brcm,bcm2712"; - model = "Raspberry Pi 5"; - - /* Will be filled by the bootloader */ - memory@0 { - device_type = "memory"; - reg = <0 0 0 0x28000000>; - }; - - leds: leds { - compatible = "gpio-leds"; - - led_pwr: led-pwr { - label = "PWR"; - gpios = <&rp1_gpio 44 GPIO_ACTIVE_LOW>; - default-state = "off"; - linux,default-trigger = "none"; - }; - - led_act: led-act { - label = "ACT"; - gpios = <&gio_aon 9 GPIO_ACTIVE_LOW>; - default-state = "off"; - linux,default-trigger = "mmc0"; - }; - }; - - 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 = <&gio_aon 3 GPIO_ACTIVE_HIGH>; - states = <1800000 1>, - <3300000 0>; - }; - - 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; - gpios = <&gio_aon 4 GPIO_ACTIVE_HIGH>; - }; - - wl_on_reg: wl-on-reg { - compatible = "regulator-fixed"; - regulator-name = "wl-on-regulator"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - pinctrl-0 = <&wl_on_pins>; - pinctrl-names = "default"; - - gpio = <&gio 28 GPIO_ACTIVE_HIGH>; - - startup-delay-us = <150000>; - enable-active-high; - }; - - cam1_clk: cam1_clk { - compatible = "fixed-clock"; - #clock-cells = <0>; - status = "disabled"; - }; - - cam0_clk: cam0_clk { - compatible = "fixed-clock"; - #clock-cells = <0>; - status = "disabled"; - }; - - cam0_reg: cam0_reg { - compatible = "regulator-fixed"; - regulator-name = "cam0_reg"; - enable-active-high; - gpio = <&rp1_gpio 34 0>; // CD0_IO0_MICCLK, to MIPI 0 connector - }; - - cam1_reg: cam1_reg { - compatible = "regulator-fixed"; - regulator-name = "cam1_reg"; - enable-active-high; - gpio = <&rp1_gpio 46 0>; // CD1_IO0_MICCLK, to MIPI 1 connector - }; - - pcie1_3v3: pcie1_3v3 { - compatible = "regulator-fixed"; - regulator-name = "pcie1-3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - enable-active-high; - gpio = <&rp1_gpio 28 GPIO_ACTIVE_HIGH>; // PCIE_RP1_WAKE - startup-delay-us = <20000>; - }; - - cam_dummy_reg: cam_dummy_reg { - compatible = "regulator-fixed"; - regulator-name = "cam-dummy-reg"; - }; - - dummy: dummy { - // A target for unwanted overlay fragments + aliases { + ethernet0 = &rp1_eth; }; - - - // A few extra labels to keep overlays happy - - i2c0if: i2c0if {}; - i2c0mux: i2c0mux {}; -}; - -rp1_target: &pcie2 { - brcm,vdm-qos-map = /bits/ 8 <8 8 8 9 10 10 11 11>; - aspm-no-l0s; - status = "okay"; }; -&pcie1 { - brcm,fifo-qos-map = /bits/ 8 <3 3 3 3>; - - /* - * Hack to get linux to probe this pcie after pcie2. - * The pcie-brcmstb driver does not defer probe if - * the regulator is not found yet. This forces pcie1 - * to be probed after pcie2 so that the regulator - * is found. - */ - vpcie3v3-supply = <&pcie1_3v3>; - +&pcie2 { pci@0,0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + ranges; + bus-range = <0 1>; device_type = "pci"; - reg = <0 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - ranges; - vpcie3v3-supply = <&pcie1_3v3>; - }; -}; - -// The system SPI for the bootloader EEPROM -&spi10 { status = "okay"; }; - -#include "rp1.dtsi" -&rp1 { - // PCIe address space layout: - // 00_00000000-00_00xxxxxx = RP1 peripherals - // 10_00000000-1x_xxxxxxxx = up to 64GB system RAM + dev@0,0 { + compatible = "pci1de4,1"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + ranges = <0x1 0x0 0x0 0x82010000 0x0 0x0 0x0 0x400000>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <3>; + #size-cells = <2>; - // outbound access aimed at PCIe 0_00xxxxxx -> RP1 c0_40xxxxxx - // This is the RP1 peripheral space - ranges = <0xc0 0x40000000 - 0x02000000 0x00 0x00000000 - 0x00 0x00410000>; - - dma-ranges = - // inbound RP1 1x_xxxxxxxx -> PCIe 1x_xxxxxxxx - <0x10 0x00000000 - 0x43000000 0x10 0x00000000 - 0x10 0x00000000>, - - // inbound RP1 c0_40xxxxxx -> PCIe 00_00xxxxxx - // This allows the RP1 DMA controller to address RP1 hardware - <0xc0 0x40000000 - 0x02000000 0x0 0x00000000 - 0x0 0x00410000>, - - // inbound RP1 0x_xxxxxxxx -> PCIe 1x_xxxxxxxx - <0x00 0x00000000 - 0x02000000 0x10 0x00000000 - 0x10 0x00000000>; -}; - -// Expose RP1 nodes as system nodes with labels - -&rp1_dma { - status = "okay"; + #include "rp1-common.dtsi" + }; + }; }; &rp1_eth { + assigned-clocks = <&rp1_clocks RP1_CLK_ETH_TSU>, + <&rp1_clocks RP1_CLK_ETH>; + assigned-clock-rates = <50000000>, + <125000000>; status = "okay"; + phy-mode = "rgmii-id"; phy-handle = <&phy1>; - phy-reset-gpios = <&rp1_gpio 32 GPIO_ACTIVE_LOW>; - phy-reset-duration = <5>; - phy1: ethernet-phy@1 { + mdio { reg = <0x1>; - brcm,powerdown-enable; - led-modes = <0 8>; - }; -}; - -/* The Debug UART, on Rpi5 it's on JST-SH 1.0mm 3-pin connector - * labeled "UART", i.e. the interface with the system console. - */ -&uart10 { - status = "okay"; -}; - -gpio: &rp1_gpio { - status = "okay"; -}; - -aux: &dummy {}; - -&rp1_usb0 { - pinctrl-0 = <&usb_vbus_pins>; - pinctrl-names = "default"; - status = "okay"; -}; - -&rp1_usb1 { - status = "okay"; -}; - -#include "bcm2712-rpi.dtsi" - -i2c_csi_dsi0: &i2c6 { // Note: This is for MIPI0 connector only - pinctrl-0 = <&rp1_i2c6_38_39>; - pinctrl-names = "default"; - clock-frequency = <100000>; - symlink = "i2c-6"; -}; - -i2c_csi_dsi1: &i2c4 { // Note: This is for MIPI1 connector only - pinctrl-0 = <&rp1_i2c4_40_41>; - pinctrl-names = "default"; - clock-frequency = <100000>; - symlink = "i2c-4"; -}; - -i2c_csi_dsi: &i2c_csi_dsi1 { }; // An alias for compatibility - -csi0: &rp1_csi0 { }; -csi1: &rp1_csi1 { }; -dsi0: &rp1_dsi0 { }; -dsi1: &rp1_dsi1 { }; -dpi: &rp1_dpi { }; -vec: &rp1_vec { }; -dpi_gpio0: &rp1_dpi_24bit_gpio0 { }; -dpi_gpio1: &rp1_dpi_24bit_gpio2 { }; -dpi_18bit_cpadhi_gpio0: &rp1_dpi_18bit_cpadhi_gpio0 { }; -dpi_18bit_cpadhi_gpio2: &rp1_dpi_18bit_cpadhi_gpio2 { }; -dpi_18bit_gpio0: &rp1_dpi_18bit_gpio0 { }; -dpi_18bit_gpio2: &rp1_dpi_18bit_gpio2 { }; -dpi_16bit_cpadhi_gpio0: &rp1_dpi_16bit_cpadhi_gpio0 { }; -dpi_16bit_cpadhi_gpio2: &rp1_dpi_16bit_cpadhi_gpio2 { }; -dpi_16bit_gpio0: &rp1_dpi_16bit_gpio0 { }; -dpi_16bit_gpio2: &rp1_dpi_16bit_gpio2 { }; - -/* Add the IOMMUs for some RP1 bus masters */ - -&csi0 { - iommus = <&iommu5>; -}; - -&csi1 { - iommus = <&iommu5>; -}; - -&dsi0 { - iommus = <&iommu5>; -}; - -&dsi1 { - iommus = <&iommu5>; -}; - -&dpi { - iommus = <&iommu5>; -}; - -&vec { - iommus = <&iommu5>; -}; - -&ddc0 { - status = "disabled"; -}; - -&ddc1 { - status = "disabled"; -}; - -&hdmi0 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; - status = "disabled"; -}; - -&hdmi1 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; - status = "disabled"; -}; - -&hvs { - clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; - clock-names = "core", "disp"; -}; - -&mop { - status = "disabled"; -}; - -&moplet { - status = "disabled"; -}; - -&pixelvalve0 { - status = "disabled"; -}; - -&pixelvalve1 { - status = "disabled"; -}; - -&disp_intr { - status = "disabled"; -}; - -/* SDIO1 is used to drive the SD card */ -&sdio1 { - pinctrl-0 = <&emmc_sd_pulls>, <&emmc_aon_cd_pins>; - pinctrl-names = "default"; - vqmmc-supply = <&sd_io_1v8_reg>; - vmmc-supply = <&sd_vcc_reg>; - bus-width = <4>; - sd-uhs-sdr50; - sd-uhs-ddr50; - sd-uhs-sdr104; - supports-cqe = <1>; - cd-gpios = <&gio_aon 5 GPIO_ACTIVE_LOW>; - //no-1-8-v; - status = "okay"; -}; + reset-gpios = <&rp1_gpio 32 GPIO_ACTIVE_LOW>; + reset-delay-us = <5000>; + #address-cells = <1>; + #size-cells = <0>; -&pinctrl_aon { - emmc_aon_cd_pins: emmc_aon_cd_pins { - function = "sd_card_g"; - pins = "aon_gpio5"; - bias-pull-up; + phy1: ethernet-phy@1 { + reg = <0x1>; + }; }; +}; - /* Slight hack - only one PWM pin (status LED) is usable */ - aon_pwm_1pin: aon_pwm_1pin { - function = "aon_pwm"; - pins = "aon_gpio9"; +&rp1_gpio { + fan_pwm_default_state: fan-pwm-default-state { + function = "pwm1"; + pins = "gpio45"; + bias-pull-down; }; -}; -&pinctrl { - pwr_button_pins: pwr_button_pins { - function = "gpio"; - pins = "gpio20"; - bias-pull-up; + usb_vbus_default_state: usb-vbus-default-state { + function = "vbus1"; + groups = "vbus1"; }; - wl_on_pins: wl_on_pins { - function = "gpio"; - pins = "gpio28"; + rp1_spi0_default_state: rp1-spi0-default-state { + function = "spi0"; + groups = "spi0"; + bias-disable; + drive-strength = <12>; + slew-rate = <1>; }; - bt_shutdown_pins: bt_shutdown_pins { + rp1_spi0_cs_default_state: rp1-spi0-cs-default-state { function = "gpio"; - pins = "gpio29"; + pins = "gpio7", "gpio8"; + bias-pull-up; }; - emmc_sd_pulls: emmc_sd_pulls { - pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3"; + rp1_i2c4_default_state: rp1-i2c4-default-state { + function = "i2c4"; + groups = "i2c4_2"; + drive-strength = <12>; bias-pull-up; }; -}; - -/* uarta communicates with the BT module */ -&uarta { - uart-has-rtscts; - auto-flow-control; - status = "okay"; - clock-frequency = <96000000>; - pinctrl-0 = <&uarta_24_pins &bt_shutdown_pins>; - pinctrl-names = "default"; - bluetooth: bluetooth { - compatible = "brcm,bcm43438-bt"; - max-speed = <3000000>; - shutdown-gpios = <&gio 29 GPIO_ACTIVE_HIGH>; - brcm,power-off-in-suspend; - local-bd-address = [ 00 00 00 00 00 00 ]; + rp1_i2c6_default_state: rp1-i2c6-default-state { + function = "i2c6"; + groups = "i2c6_0"; + drive-strength = <12>; + bias-pull-up; }; }; -&i2c10 { - clock-frequency = <400000>; - pinctrl-0 = <&i2c3_m4_agpio0_pins>; +&rp1_i2c4 { + pinctrl-0 = <&rp1_i2c4_default_state>; pinctrl-names = "default"; }; -/ { - fan: cooling_fan { - status = "disabled"; - compatible = "pwm-fan"; - #cooling-cells = <2>; - cooling-min-state = <0>; - cooling-max-state = <3>; - cooling-levels = <0 75 125 175 250>; - pwms = <&rp1_pwm1 3 41566 PWM_POLARITY_INVERTED>; - rpm-regmap = <&rp1_pwm1>; - rpm-offset = <0x3c>; - }; - - pwr_button { - compatible = "gpio-keys"; - - pinctrl-names = "default"; - pinctrl-0 = <&pwr_button_pins>; - status = "okay"; - - pwr_key: pwr { - label = "pwr_button"; - // linux,code = <205>; // KEY_SUSPEND - linux,code = <116>; // KEY_POWER - gpios = <&gio 20 GPIO_ACTIVE_LOW>; - debounce-interval = <50>; // ms - }; - }; -}; - -&usb { - power-domains = <&power RPI_POWER_DOMAIN_USB>; -}; - -/* SDIO2 drives the WLAN interface */ -&sdio2 { - pinctrl-0 = <&sdio2_30_pins>; +&rp1_i2c6 { + pinctrl-0 = <&rp1_i2c6_default_state>; pinctrl-names = "default"; - bus-width = <4>; - vmmc-supply = <&wl_on_reg>; - sd-uhs-ddr50; - non-removable; - cap-power-off-card; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - wifi: wifi@1 { - reg = <1>; - compatible = "brcm,bcm4329-fmac"; - local-mac-address = [00 00 00 00 00 00]; - }; }; -&pinctrl { - spi10_gpio2: spi10_gpio2 { - function = "vc_spi0"; - pins = "gpio2", "gpio3", "gpio4"; - bias-disable; - }; - - spi10_cs_gpio1: spi10_cs_gpio1 { - function = "gpio"; - pins = "gpio1"; - bias-pull-up; - }; -}; - -spi10_pins: &spi10_gpio2 {}; -spi10_cs_pins: &spi10_cs_gpio1 {}; - -&spi10 { +&rp1_spi0 { + pinctrl-0 = <&rp1_spi0_default_state &rp1_spi0_cs_default_state>; pinctrl-names = "default"; - cs-gpios = <&gio 1 1>; - pinctrl-0 = <&spi10_pins &spi10_cs_pins>; - - spidev10: spidev@0 { - compatible = "spidev"; - reg = <0>; /* CE0 */ - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <20000000>; - status = "okay"; - }; -}; -// ============================================= -// Board specific stuff here - -&gio_aon { - // Don't use GIO_AON as an interrupt controller because it will - // clash with the firmware monitoring the PMIC interrupt via the VPU. - - /delete-property/ interrupt-controller; - /delete-property/ #interrupt-cells; -}; - -&main_aon_irq { - // Don't use the MAIN_AON_IRQ interrupt controller because it will - // clash with the firmware monitoring the PMIC interrupt via the VPU. - - status = "disabled"; + num-cs = <2>; + cs-gpios = <&rp1_gpio 8 GPIO_ACTIVE_LOW &rp1_gpio 7 GPIO_ACTIVE_LOW>; }; &rp1_pwm1 { - status = "disabled"; - pinctrl-0 = <&rp1_pwm1_gpio45>; + pinctrl-0 = <&fan_pwm_default_state>; pinctrl-names = "default"; + status = "okay"; }; -&thermal_trips { - cpu_tepid: cpu-tepid { - temperature = <50000>; - hysteresis = <5000>; - type = "active"; - }; - - cpu_warm: cpu-warm { - temperature = <60000>; - hysteresis = <5000>; - type = "active"; - }; - - cpu_hot: cpu-hot { - temperature = <67500>; - hysteresis = <5000>; - type = "active"; - }; - - cpu_vhot: cpu-vhot { - temperature = <75000>; - hysteresis = <5000>; - type = "active"; - }; -}; - -&cooling_maps { - tepid { - trip = <&cpu_tepid>; - cooling-device = <&fan 1 1>; - }; - - warm { - trip = <&cpu_warm>; - cooling-device = <&fan 2 2>; - }; - - hot { - trip = <&cpu_hot>; - cooling-device = <&fan 3 3>; - }; - - vhot { - trip = <&cpu_vhot>; - cooling-device = <&fan 4 4>; - }; - - melt { - trip = <&cpu_crit>; - cooling-device = <&fan 4 4>; - }; -}; - -&gio { - // The GPIOs above 35 are not used on Pi 5, so shrink the upper bank - // to reduce the clutter in gpioinfo/pinctrl - brcm,gpio-bank-widths = <32 4>; - - gpio-line-names = - "-", // GPIO_000 - "2712_BOOT_CS_N", // GPIO_001 - "2712_BOOT_MISO", // GPIO_002 - "2712_BOOT_MOSI", // GPIO_003 - "2712_BOOT_SCLK", // GPIO_004 - "-", // GPIO_005 - "-", // GPIO_006 - "-", // GPIO_007 - "-", // GPIO_008 - "-", // GPIO_009 - "-", // GPIO_010 - "-", // GPIO_011 - "-", // GPIO_012 - "-", // GPIO_013 - "PCIE_SDA", // GPIO_014 - "PCIE_SCL", // GPIO_015 - "-", // GPIO_016 - "-", // GPIO_017 - "-", // GPIO_018 - "-", // GPIO_019 - "PWR_GPIO", // GPIO_020 - "2712_G21_FS", // GPIO_021 - "-", // GPIO_022 - "-", // GPIO_023 - "BT_RTS", // GPIO_024 - "BT_CTS", // GPIO_025 - "BT_TXD", // GPIO_026 - "BT_RXD", // GPIO_027 - "WL_ON", // GPIO_028 - "BT_ON", // GPIO_029 - "WIFI_SDIO_CLK", // GPIO_030 - "WIFI_SDIO_CMD", // GPIO_031 - "WIFI_SDIO_D0", // GPIO_032 - "WIFI_SDIO_D1", // GPIO_033 - "WIFI_SDIO_D2", // GPIO_034 - "WIFI_SDIO_D3"; // GPIO_035 -}; - -&gio_aon { - gpio-line-names = - "RP1_SDA", // AON_GPIO_00 - "RP1_SCL", // AON_GPIO_01 - "RP1_RUN", // AON_GPIO_02 - "SD_IOVDD_SEL", // AON_GPIO_03 - "SD_PWR_ON", // AON_GPIO_04 - "SD_CDET_N", // AON_GPIO_05 - "SD_FLG_N", // AON_GPIO_06 - "-", // AON_GPIO_07 - "2712_WAKE", // AON_GPIO_08 - "2712_STAT_LED", // AON_GPIO_09 - "-", // AON_GPIO_10 - "-", // AON_GPIO_11 - "PMIC_INT", // AON_GPIO_12 - "UART_TX_FS", // AON_GPIO_13 - "UART_RX_FS", // AON_GPIO_14 - "-", // AON_GPIO_15 - "-", // AON_GPIO_16 - - // Pad bank0 out to 32 entries - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - - "HDMI0_SCL", // AON_SGPIO_00 - "HDMI0_SDA", // AON_SGPIO_01 - "HDMI1_SCL", // AON_SGPIO_02 - "HDMI1_SDA", // AON_SGPIO_03 - "PMIC_SCL", // AON_SGPIO_04 - "PMIC_SDA"; // AON_SGPIO_05 - - rp1_run_hog { - gpio-hog; - gpios = <2 GPIO_ACTIVE_HIGH>; - output-high; - line-name = "RP1 RUN pin"; - }; -}; - -&rp1_gpio { - gpio-line-names = - "ID_SDA", // GPIO0 - "ID_SCL", // GPIO1 - "GPIO2", // GPIO2 - "GPIO3", // GPIO3 - "GPIO4", // GPIO4 - "GPIO5", // GPIO5 - "GPIO6", // GPIO6 - "GPIO7", // GPIO7 - "GPIO8", // GPIO8 - "GPIO9", // GPIO9 - "GPIO10", // GPIO10 - "GPIO11", // GPIO11 - "GPIO12", // GPIO12 - "GPIO13", // GPIO13 - "GPIO14", // GPIO14 - "GPIO15", // GPIO15 - "GPIO16", // GPIO16 - "GPIO17", // GPIO17 - "GPIO18", // GPIO18 - "GPIO19", // GPIO19 - "GPIO20", // GPIO20 - "GPIO21", // GPIO21 - "GPIO22", // GPIO22 - "GPIO23", // GPIO23 - "GPIO24", // GPIO24 - "GPIO25", // GPIO25 - "GPIO26", // GPIO26 - "GPIO27", // GPIO27 - - "PCIE_RP1_WAKE", // GPIO28 - "FAN_TACH", // GPIO29 - "HOST_SDA", // GPIO30 - "HOST_SCL", // GPIO31 - "ETH_RST_N", // GPIO32 - "-", // GPIO33 - - "CD0_IO0_MICCLK", // GPIO34 - "CD0_IO0_MICDAT0", // GPIO35 - "RP1_PCIE_CLKREQ_N", // GPIO36 - "-", // GPIO37 - "CD0_SDA", // GPIO38 - "CD0_SCL", // GPIO39 - "CD1_SDA", // GPIO40 - "CD1_SCL", // GPIO41 - "USB_VBUS_EN", // GPIO42 - "USB_OC_N", // GPIO43 - "RP1_STAT_LED", // GPIO44 - "FAN_PWM", // GPIO45 - "CD1_IO0_MICCLK", // GPIO46 - "2712_WAKE", // GPIO47 - "CD1_IO1_MICDAT1", // GPIO48 - "EN_MAX_USB_CUR", // GPIO49 - "-", // GPIO50 - "-", // GPIO51 - "-", // GPIO52 - "-"; // GPIO53 - - usb_vbus_pins: usb_vbus_pins { - function = "vbus1"; - pins = "gpio42", "gpio43"; - }; -}; - -/ { - __overrides__ { - sd_cqe = <&sdio1>, "supports-cqe:0"; - }; -}; - -&hvs { - clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; - clock-names = "core", "disp"; -}; - -&hdmi0 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; -}; - -&hdmi1 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; -}; - -&soc { - firmware: firmware { - compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; - #address-cells = <1>; - #size-cells = <1>; - - mboxes = <&mailbox>; - dma-ranges; - - firmware_clocks: clocks { - compatible = "raspberrypi,firmware-clocks"; - #clock-cells = <1>; - }; - - reset: reset { - compatible = "raspberrypi,firmware-reset"; - #reset-cells = <1>; - }; - }; - - power: power { - compatible = "raspberrypi,bcm2835-power"; - firmware = <&firmware>; - #power-domain-cells = <1>; - }; -}; - -&hvs { - clocks = <&firmware_clocks 4>, <&firmware_clocks 16>; - clock-names = "core", "disp"; -}; - -&hdmi0 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; -}; - -&hdmi1 { - clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; - clock-names = "hdmi", "bvb", "audio", "cec"; -}; - -&pcie1 { - brcm,clkreq-mode = "safe"; +&rp1_usb0 { + pinctrl-0 = <&usb_vbus_default_state>; + pinctrl-names = "default"; + status = "okay"; }; -&pcie2 { +&rp1_usb1 { status = "okay"; }; +#endif