From 2e1a48e6d7e8746d4751c78adcf74c1e7bcbf735 Mon Sep 17 00:00:00 2001 From: suyuan168 <175338101@qq.com> Date: Wed, 8 Jun 2022 15:55:29 +0800 Subject: [PATCH] Update 950-0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch --- ...0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch | 590 +++++++++++++++--- 1 file changed, 515 insertions(+), 75 deletions(-) diff --git a/root/target/linux/bcm27xx/patches-5.4/950-0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch b/root/target/linux/bcm27xx/patches-5.4/950-0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch index 6c79351f..ed5dfc46 100755 --- a/root/target/linux/bcm27xx/patches-5.4/950-0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch +++ b/root/target/linux/bcm27xx/patches-5.4/950-0785-ARM-dts-Add-bcm2711-rpi-cm4.dts.patch @@ -8,9 +8,9 @@ Add initial DTS file for Compute Module 4. Signed-off-by: Phil Elwell --- arch/arm/boot/dts/Makefile | 3 +- - arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 586 ++++++++++++++++++++++++++ + arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 486 ++++++++++++++++++++++++++ arch/arm/boot/dts/overlays/README | 6 + - 3 files changed, 594 insertions(+), 1 deletion(-) + 3 files changed, 492 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm2711-rpi-cm4.dts --- a/arch/arm/boot/dts/Makefile @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell alpine-db.dtb --- /dev/null +++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -@@ -0,0 +1,536 @@ +@@ -0,0 +1,486 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2711.dtsi" @@ -49,7 +49,9 @@ Signed-off-by: Phil Elwell + }; + + aliases { ++ emmc2bus = &emmc2bus; + ethernet0 = &genet; ++ pcie0 = &pcie0; + }; + + leds { @@ -60,6 +62,8 @@ Signed-off-by: Phil Elwell + pwr { + label = "PWR"; + gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ default-state = "keep"; ++ linux,default-trigger = "default-on"; + }; + }; + @@ -173,50 +177,11 @@ Signed-off-by: Phil Elwell + interrupts = ; +}; + -+&vc4 { -+ status = "okay"; -+}; -+ -+&pixelvalve0 { -+ status = "okay"; -+}; -+ -+&pixelvalve1 { -+ status = "okay"; -+}; -+ -+&pixelvalve2 { -+ status = "okay"; -+}; -+ -+&pixelvalve3 { -+ status = "okay"; -+}; -+ -+&pixelvalve4 { -+ status = "okay"; -+}; -+ -+&hdmi0 { -+ status = "okay"; -+}; -+ -+&ddc0 { -+ status = "okay"; -+}; -+ -+&hdmi1 { -+ status = "okay"; -+}; -+ -+&ddc1 { -+ status = "okay"; -+}; -+ +// ============================================= +// Downstream rpi- changes + +#include "bcm270x.dtsi" ++#include "bcm271x-rpi-bt.dtsi" + +/ { + soc { @@ -226,14 +191,13 @@ Signed-off-by: Phil Elwell +}; + +#include "bcm2711-rpi.dtsi" -+#include "bcm283x-rpi-csi1-2lane.dtsi" ++#include "bcm283x-rpi-csi0-2lane.dtsi" ++#include "bcm283x-rpi-csi1-4lane.dtsi" +#include "bcm283x-rpi-i2c0mux_0_44.dtsi" + -+/delete-node/ &emmc2; -+ +/ { + chosen { -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; ++ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; + }; + + aliases { @@ -247,34 +211,16 @@ Signed-off-by: Phil Elwell + i2c4 = &i2c4; + i2c5 = &i2c5; + i2c6 = &i2c6; -+ /delete-property/ ethernet; + /delete-property/ intc; -+ pcie0 = &pcie0; -+ emmc2bus = &emmc2bus; -+ }; -+ -+ emmc2bus: emmc2bus { -+ compatible = "simple-bus"; -+ #address-cells = <2>; -+ #size-cells = <1>; -+ -+ ranges = <0x0 0x7e000000 0x0 0xfe000000 0x01800000>; -+ dma-ranges = <0x0 0xc0000000 0x0 0x00000000 0x40000000>; -+ -+ emmc2: emmc2@7e340000 { -+ compatible = "brcm,bcm2711-emmc2"; -+ status = "okay"; -+ interrupts = ; -+ clocks = <&clocks BCM2711_CLOCK_EMMC2>; -+ reg = <0x0 0x7e340000 0x100>; -+ vqmmc-supply = <&sd_io_1v8_reg>; -+ broken-cd; -+ }; + }; + + /delete-node/ wifi-pwrseq; +}; + ++&pcie0 { ++ brcm,enable-l1ss; ++}; ++ +&mmcnr { + pinctrl-names = "default"; + pinctrl-0 = <&sdio_pins>; @@ -285,8 +231,6 @@ Signed-off-by: Phil Elwell +&uart0 { + pinctrl-0 = <&uart0_pins &bt_pins>; + status = "okay"; -+ -+ /delete-node/ bluetooth; +}; + +&uart1 { @@ -374,6 +318,10 @@ Signed-off-by: Phil Elwell + clock-frequency = <100000>; +}; + ++&firmwarekms { ++ compatible = "raspberrypi,rpi-firmware-kms-2711"; ++}; ++ +// ============================================= +// Board specific stuff here + @@ -385,10 +333,10 @@ Signed-off-by: Phil Elwell + regulator-max-microvolt = <3300000>; + regulator-boot-on; + enable-active-high; -+ + }; +}; + ++ +&sdhost { + status = "disabled"; +}; @@ -404,8 +352,8 @@ Signed-off-by: Phil Elwell + +&gpio { + audio_pins: audio_pins { -+ brcm,pins = <40 41>; -+ brcm,function = <4>; ++ brcm,pins = <>; ++ brcm,function = <>; + }; +}; + @@ -425,7 +373,7 @@ Signed-off-by: Phil Elwell + wlan2g { + label = "wlan2g"; + gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; -+ }; ++ };6 + + wlan5g { + label = "wlan5g"; @@ -505,6 +453,7 @@ Signed-off-by: Phil Elwell +&audio { + pinctrl-names = "default"; + pinctrl-0 = <&audio_pins>; ++ brcm,disable-headphones = <1>; +}; + +&vc4 { @@ -560,6 +509,497 @@ Signed-off-by: Phil Elwell + eth_led0 = <&phy1>,"led-modes:0"; + eth_led1 = <&phy1>,"led-modes:4"; + ++ sd_poll_once = <&emmc2>, "non-removable?"; ++ spi_dma4 = <&spi0>, "dmas:0=", <&dma40>, ++ <&spi0>, "dmas:8=", <&dma40>; ++ }; ++}; +diff -Naur linux-5.4.194/scripts/dtc/include-prefixes/arm/bcm2711-rpi-cm4.dts linux-5.4.1942/scripts/dtc/include-prefixes/arm/bcm2711-rpi-cm4.dts +--- linux-5.4.194/scripts/dtc/include-prefixes/arm/bcm2711-rpi-cm4.dts 1970-01-01 08:00:00.000000000 +0800 ++++ linux-5.4.1942/scripts/dtc/include-prefixes/arm/bcm2711-rpi-cm4.dts 2022-06-08 15:31:59.330572000 +0800 +@@ -0,0 +1,486 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/dts-v1/; ++#include "bcm2711.dtsi" ++#include "bcm2835-rpi.dtsi" ++ ++/ { ++ compatible = "raspberrypi,4-compute-module", "brcm,bcm2711"; ++ model = "openmptcprouter5G_M4"; ++ ++ chosen { ++ /* 8250 auxiliary UART instead of pl011 */ ++ stdout-path = "serial1:115200n8"; ++ }; ++ ++ /* Will be filled by the bootloader */ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0 0 0>; ++ }; ++ ++ aliases { ++ emmc2bus = &emmc2bus; ++ ethernet0 = &genet; ++ pcie0 = &pcie0; ++ }; ++ ++ leds { ++ act { ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ pwr { ++ label = "PWR"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ default-state = "keep"; ++ linux,default-trigger = "default-on"; ++ }; ++ }; ++ ++ 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"; ++ 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"; ++ }; ++}; ++ ++&firmware { ++ expgpio: gpio { ++ compatible = "raspberrypi,firmware-gpio"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ gpio-line-names = "BT_ON", ++ "WL_ON", ++ "PWR_LED_OFF", ++ "VDD_SD_IO_SEL", ++ "CAM_GPIO", ++ "SD_PWR_ON", ++ "ANT2"; ++ status = "okay"; ++ ++ ant2: ant2 { ++ gpio-hog; ++ gpios = <7 GPIO_ACTIVE_HIGH>; ++ output-low; ++ }; ++ }; ++}; ++ ++&pwm1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; ++ 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>; ++ broken-cd; ++ status = "okay"; ++}; ++ ++&genet { ++ phy-handle = <&phy1>; ++ phy-mode = "rgmii-rxid"; ++ status = "okay"; ++}; ++ ++&genet_mdio { ++ phy1: ethernet-phy@1 { ++ /* No PHY interrupt */ ++ reg = <0x1>; ++ }; ++}; ++ ++/* uart0 communicates with the BT module */ ++&uart0 { ++ 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 */ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_gpio14>; ++ status = "okay"; ++}; ++ ++&vchiq { ++ interrupts = ; ++}; ++ ++// ============================================= ++// Downstream rpi- changes ++ ++#include "bcm270x.dtsi" ++#include "bcm271x-rpi-bt.dtsi" ++ ++/ { ++ soc { ++ /delete-node/ pixelvalve@7e807000; ++ /delete-node/ hdmi@7e902000; ++ }; ++}; ++ ++#include "bcm2711-rpi.dtsi" ++#include "bcm283x-rpi-csi0-2lane.dtsi" ++#include "bcm283x-rpi-csi1-4lane.dtsi" ++#include "bcm283x-rpi-i2c0mux_0_44.dtsi" ++ ++/ { ++ chosen { ++ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ }; ++ ++ aliases { ++ serial0 = &uart1; ++ serial1 = &uart0; ++ mmc0 = &emmc2; ++ mmc1 = &mmcnr; ++ mmc2 = &sdhost; ++ /delete-property/ i2c2; ++ i2c3 = &i2c3; ++ i2c4 = &i2c4; ++ i2c5 = &i2c5; ++ i2c6 = &i2c6; ++ /delete-property/ intc; ++ }; ++ ++ /delete-node/ wifi-pwrseq; ++}; ++ ++&pcie0 { ++ brcm,enable-l1ss; ++}; ++ ++&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>; ++}; ++ ++&gpio { ++ spi0_cs_pins: spi0_cs_pins { ++ brcm,pins = <8 7>; ++ brcm,function = ; ++ }; ++ ++ spi3_pins: spi3_pins { ++ brcm,pins = <1 2>; ++ brcm,function = ; ++ }; ++ ++ spi4_pins: spi4_pins { ++ brcm,pins = <5 7>; ++ brcm,function = ; ++ }; ++ ++ spi4_cs_pins: spi4_cs_pins { ++ brcm,pins = <4 25>; ++ brcm,function = ; ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c4_pins: i2c4 { ++ brcm,pins = <8>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ sdio_pins: sdio_pins { ++ brcm,pins = <34 35 36 37 38 39>; ++ brcm,function = ; // alt3 = SD1 ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ 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; ++ }; ++ ++ uart2_pins: uart2_pins { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart3_pins: uart3_pins { ++ brcm,pins = <4 5>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart4_pins: uart4_pins { ++ brcm,pins = <8>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++}; ++ ++&i2c0if { ++ clock-frequency = <100000>; ++}; ++ ++&firmwarekms { ++ compatible = "raspberrypi,rpi-firmware-kms-2711"; ++}; ++ ++// ============================================= ++// Board specific stuff here ++ ++/ { ++ 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; ++ }; ++}; ++ ++ ++&sdhost { ++ status = "disabled"; ++}; ++ ++&emmc2 { ++ vmmc-supply = <&sd_vcc_reg>; ++ bus-width = <8>; ++}; ++ ++&phy1 { ++ led-modes = <0x00 0x08>; /* link/activity link */ ++}; ++ ++&gpio { ++ audio_pins: audio_pins { ++ brcm,pins = <>; ++ brcm,function = <>; ++ }; ++}; ++ ++&leds { ++ act_led: act { ++ label = "led0"; ++ linux,default-trigger = "mmc0"; ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ pwr_led: pwr { ++ label = "led1"; ++ linux,default-trigger = "default-on"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan2g { ++ label = "wlan2g"; ++ gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; ++ };6 ++ ++ wlan5g { ++ label = "wlan5g"; ++ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "wan"; ++ gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g1 { ++ label = "5g1"; ++ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g2 { ++ label = "5g2"; ++ gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g3 { ++ label = "5g3"; ++ gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g4 { ++ label = "5g4"; ++ gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g5 { ++ label = "5g5"; ++ gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5g6 { ++ label = "5g6"; ++ gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr1 { ++ label = "5gpwr1"; ++ gpios = <&gpio 26 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr2 { ++ label = "5gpwr2"; ++ gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr3 { ++ label = "5gpwr3"; ++ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr4 { ++ label = "5gpwr4"; ++ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr5 { ++ label = "5gpwr5"; ++ gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ 5gpwr6 { ++ label = "5gpwr6"; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&pwm1 { ++ status = "disabled"; ++}; ++ ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++ brcm,disable-headphones = <1>; ++}; ++ ++&vc4 { ++ status = "disabled"; ++}; ++ ++&pixelvalve0 { ++ status = "disabled"; ++}; ++ ++&pixelvalve1 { ++ status = "disabled"; ++}; ++ ++&pixelvalve2 { ++ status = "disabled"; ++}; ++ ++&pixelvalve3 { ++ status = "disabled"; ++}; ++ ++&pixelvalve4 { ++ status = "disabled"; ++}; ++ ++&hdmi0 { ++ status = "disabled"; ++}; ++ ++&ddc0 { ++ status = "disabled"; ++}; ++ ++&hdmi1 { ++ status = "disabled"; ++}; ++ ++&ddc1 { ++ status = "disabled"; ++}; ++ ++/ { ++ __overrides__ { ++ act_led_gpio = <&act_led>,"gpios:4"; ++ act_led_activelow = <&act_led>,"gpios:8"; ++ act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ pwr_led_gpio = <&pwr_led>,"gpios:4"; ++ pwr_led_activelow = <&pwr_led>,"gpios:8"; ++ pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; ++ ++ eth_led0 = <&phy1>,"led-modes:0"; ++ eth_led1 = <&phy1>,"led-modes:4"; ++ ++ sd_poll_once = <&emmc2>, "non-removable?"; + spi_dma4 = <&spi0>, "dmas:0=", <&dma40>, + <&spi0>, "dmas:8=", <&dma40>; + };