ARM: dts: bcm283x-rpi: Move Wifi/BT into separate dtsi
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 7 Aug 2021 11:06:37 +0000 (13:06 +0200)
committerNicolas Saenz Julienne <nsaenz@kernel.org>
Wed, 6 Oct 2021 07:53:18 +0000 (09:53 +0200)
A Wifi/BT chip is quite common for the Raspberry Pi boards. So move those
definitions into a separate dtsi in order to avoid copy & paste. This
change was inspired by a vendor tree patch from Phil Elwell.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1628334401-6577-7-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
arch/arm/boot/dts/bcm2837-rpi-3-b.dts
arch/arm/boot/dts/bcm283x-rpi-wifi-bt.dtsi [new file with mode: 0644]

index f24bdd0870a521bb0412805f8fa0d1a7e3aa474c..f94cac76713a9f10bc464c49a9bab06c3c87b281 100644 (file)
@@ -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";
                };
        };
 
-       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";
        };
 };
 
+&bt {
+       shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
+};
+
 &ddc0 {
        status = "okay";
 };
        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>;
        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 */
 &vec {
        status = "disabled";
 };
+
+&wifi_pwrseq {
+       reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+};
index 33b2b77aa47db3de10e8f85eca14622eef892675..243236bc1e00b96514b4f67ffdbb1ea767b91dd0 100644 (file)
@@ -7,6 +7,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm283x-rpi-usb-otg.dtsi"
+#include "bcm283x-rpi-wifi-bt.dtsi"
 
 / {
        compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
                        gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
                };
        };
+};
 
-       wifi_pwrseq: wifi-pwrseq {
-               compatible = "mmc-pwrseq-simple";
-               reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
-       };
+&bt {
+       shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
 };
 
 &gpio {
 };
 
 &sdhci {
-       #address-cells = <1>;
-       #size-cells = <0>;
-       pinctrl-names = "default";
        pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
-       bus-width = <4>;
-       mmc-pwrseq = <&wifi_pwrseq>;
-       non-removable;
-       status = "okay";
-
-       brcmf: wifi@1 {
-               reg = <1>;
-               compatible = "brcm,bcm4329-fmac";
-       };
 };
 
 &sdhost {
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>;
-       status = "okay";
-
-       bluetooth {
-               compatible = "brcm,bcm43438-bt";
-               max-speed = <2000000>;
-               shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
-       };
 };
 
 &uart1 {
        pinctrl-0 = <&uart1_gpio14>;
        status = "okay";
 };
+
+&wifi_pwrseq {
+       reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
+};
index 77099a7871b03b84fa7e02e690091882e01415c0..d73daf5bff1d694580125bb6b94ca5619172d8d6 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2837.dtsi"
 #include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
+#include "bcm283x-rpi-wifi-bt.dtsi"
 
 / {
        compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
        status = "okay";
 };
 
-/*
- * SDHCI is used to control the SDIO for wireless
- *
- * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven
- * by a single GPIO. We can't give GPIO control to one of the drivers,
- * otherwise the other part would get unexpectedly disturbed.
- */
-&sdhci {
-       #address-cells = <1>;
-       #size-cells = <0>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&emmc_gpio34>;
-       status = "okay";
-       bus-width = <4>;
-       non-removable;
-
-       brcmf: wifi@1 {
-               reg = <1>;
-               compatible = "brcm,bcm4329-fmac";
-       };
-};
-
 /* SDHOST is used to drive the SD card */
 &sdhost {
        pinctrl-names = "default";
        bus-width = <4>;
 };
 
-/* uart0 communicates with the BT module */
+/* uart0 communicates with the BT module
+ *
+ * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven
+ * by a single GPIO. We can't give GPIO control to one of the drivers,
+ * otherwise the other part would get unexpectedly disturbed.
+ */
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
-       status = "okay";
-
-       bluetooth {
-               compatible = "brcm,bcm43438-bt";
-               max-speed = <2000000>;
-       };
 };
 
 /* uart1 is mapped to the pin header */
index 61010266ca9a3b3fad4d23cf7edf59e878bf66d7..e12938baaf12c38890410232f15b7232ae0140ec 100644 (file)
@@ -4,6 +4,7 @@
 #include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-lan7515.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
+#include "bcm283x-rpi-wifi-bt.dtsi"
 
 / {
        compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
                        linux,default-trigger = "default-on";
                };
        };
+};
 
-       wifi_pwrseq: wifi-pwrseq {
-               compatible = "mmc-pwrseq-simple";
-               reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
-       };
+&bt {
+       shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
 };
 
 &firmware {
        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>;
-       status = "okay";
-       bus-width = <4>;
-       non-removable;
-       mmc-pwrseq = <&wifi_pwrseq>;
-
-       brcmf: wifi@1 {
-               reg = <1>;
-               compatible = "brcm,bcm4329-fmac";
-       };
-};
-
 /* SDHOST is used to drive the SD card */
 &sdhost {
        pinctrl-names = "default";
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
-       status = "okay";
-
-       bluetooth {
-               compatible = "brcm,bcm43438-bt";
-               max-speed = <2000000>;
-               shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
-       };
 };
 
 /* uart1 is mapped to the pin header */
        pinctrl-0 = <&uart1_gpio14>;
        status = "okay";
 };
+
+&wifi_pwrseq {
+       reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+};
index dd4a486040971334b12b0e0b81a5ca9f1322da74..42b5383b55d88f9910b48ca76f1c453d07e0e2d3 100644 (file)
@@ -4,6 +4,7 @@
 #include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
+#include "bcm283x-rpi-wifi-bt.dtsi"
 
 / {
        compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
                        gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>;
                };
        };
+};
 
-       wifi_pwrseq: wifi-pwrseq {
-               compatible = "mmc-pwrseq-simple";
-               reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
-       };
+&bt {
+       shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
 };
 
 &firmware {
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>;
-       status = "okay";
-
-       bluetooth {
-               compatible = "brcm,bcm43438-bt";
-               max-speed = <2000000>;
-               shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
-       };
 };
 
 /* uart1 is mapped to the pin header */
        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>;
-       status = "okay";
-       bus-width = <4>;
-       non-removable;
-       mmc-pwrseq = <&wifi_pwrseq>;
-
-       brcmf: wifi@1 {
-               reg = <1>;
-               compatible = "brcm,bcm4329-fmac";
-       };
-};
-
 /* SDHOST is used to drive the SD card */
 &sdhost {
        pinctrl-names = "default";
        status = "okay";
        bus-width = <4>;
 };
+
+&wifi_pwrseq {
+       reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+};
diff --git a/arch/arm/boot/dts/bcm283x-rpi-wifi-bt.dtsi b/arch/arm/boot/dts/bcm283x-rpi-wifi-bt.dtsi
new file mode 100644 (file)
index 0000000..0b64cc1
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/ {
+       wifi_pwrseq: wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+       };
+};
+
+/* 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";
+       };
+};
+
+/* uart0 communicates with the BT module */
+&uart0 {
+       status = "okay";
+
+       bt: bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               max-speed = <2000000>;
+       };
+};