Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: bcm283x-rpi: Move Wifi/BT into separate dtsi

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>

authored by

Stefan Wahren and committed by
Nicolas Saenz Julienne
ec852496 82f811bd

+74 -137
+9 -29
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
··· 3 3 #include "bcm2711.dtsi" 4 4 #include "bcm2711-rpi.dtsi" 5 5 #include "bcm283x-rpi-usb-peripheral.dtsi" 6 + #include "bcm283x-rpi-wifi-bt.dtsi" 6 7 7 8 / { 8 9 compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; ··· 25 24 default-state = "keep"; 26 25 linux,default-trigger = "default-on"; 27 26 }; 28 - }; 29 - 30 - wifi_pwrseq: wifi-pwrseq { 31 - compatible = "mmc-pwrseq-simple"; 32 - reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 33 27 }; 34 28 35 29 sd_io_1v8_reg: sd_io_1v8_reg { ··· 50 54 enable-active-high; 51 55 gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; 52 56 }; 57 + }; 58 + 59 + &bt { 60 + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 53 61 }; 54 62 55 63 &ddc0 { ··· 178 178 status = "okay"; 179 179 }; 180 180 181 - /* SDHCI is used to control the SDIO for wireless */ 182 - &sdhci { 183 - #address-cells = <1>; 184 - #size-cells = <0>; 185 - pinctrl-names = "default"; 186 - pinctrl-0 = <&emmc_gpio34>; 187 - bus-width = <4>; 188 - non-removable; 189 - mmc-pwrseq = <&wifi_pwrseq>; 190 - status = "okay"; 191 - 192 - brcmf: wifi@1 { 193 - reg = <1>; 194 - compatible = "brcm,bcm4329-fmac"; 195 - }; 196 - }; 197 - 198 181 /* EMMC2 is used to drive the SD card */ 199 182 &emmc2 { 200 183 vqmmc-supply = <&sd_io_1v8_reg>; ··· 219 236 pinctrl-names = "default"; 220 237 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; 221 238 uart-has-rtscts; 222 - status = "okay"; 223 - 224 - bluetooth { 225 - compatible = "brcm,bcm43438-bt"; 226 - max-speed = <2000000>; 227 - shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 228 - }; 229 239 }; 230 240 231 241 /* uart1 is mapped to the pin header */ ··· 234 258 235 259 &vec { 236 260 status = "disabled"; 261 + }; 262 + 263 + &wifi_pwrseq { 264 + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 237 265 };
+8 -23
arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
··· 7 7 #include "bcm2835.dtsi" 8 8 #include "bcm2835-rpi.dtsi" 9 9 #include "bcm283x-rpi-usb-otg.dtsi" 10 + #include "bcm283x-rpi-wifi-bt.dtsi" 10 11 11 12 / { 12 13 compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; ··· 28 27 gpios = <&gpio 47 GPIO_ACTIVE_LOW>; 29 28 }; 30 29 }; 30 + }; 31 31 32 - wifi_pwrseq: wifi-pwrseq { 33 - compatible = "mmc-pwrseq-simple"; 34 - reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>; 35 - }; 32 + &bt { 33 + shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; 36 34 }; 37 35 38 36 &gpio { ··· 110 110 }; 111 111 112 112 &sdhci { 113 - #address-cells = <1>; 114 - #size-cells = <0>; 115 - pinctrl-names = "default"; 116 113 pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>; 117 - bus-width = <4>; 118 - mmc-pwrseq = <&wifi_pwrseq>; 119 - non-removable; 120 - status = "okay"; 121 - 122 - brcmf: wifi@1 { 123 - reg = <1>; 124 - compatible = "brcm,bcm4329-fmac"; 125 - }; 126 114 }; 127 115 128 116 &sdhost { ··· 123 135 &uart0 { 124 136 pinctrl-names = "default"; 125 137 pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>; 126 - status = "okay"; 127 - 128 - bluetooth { 129 - compatible = "brcm,bcm43438-bt"; 130 - max-speed = <2000000>; 131 - shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; 132 - }; 133 138 }; 134 139 135 140 &uart1 { 136 141 pinctrl-names = "default"; 137 142 pinctrl-0 = <&uart1_gpio14>; 138 143 status = "okay"; 144 + }; 145 + 146 + &wifi_pwrseq { 147 + reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>; 139 148 };
+7 -29
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
··· 3 3 #include "bcm2837.dtsi" 4 4 #include "bcm2836-rpi.dtsi" 5 5 #include "bcm283x-rpi-usb-host.dtsi" 6 + #include "bcm283x-rpi-wifi-bt.dtsi" 6 7 7 8 / { 8 9 compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837"; ··· 131 130 status = "okay"; 132 131 }; 133 132 134 - /* 135 - * SDHCI is used to control the SDIO for wireless 136 - * 137 - * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven 138 - * by a single GPIO. We can't give GPIO control to one of the drivers, 139 - * otherwise the other part would get unexpectedly disturbed. 140 - */ 141 - &sdhci { 142 - #address-cells = <1>; 143 - #size-cells = <0>; 144 - pinctrl-names = "default"; 145 - pinctrl-0 = <&emmc_gpio34>; 146 - status = "okay"; 147 - bus-width = <4>; 148 - non-removable; 149 - 150 - brcmf: wifi@1 { 151 - reg = <1>; 152 - compatible = "brcm,bcm4329-fmac"; 153 - }; 154 - }; 155 - 156 133 /* SDHOST is used to drive the SD card */ 157 134 &sdhost { 158 135 pinctrl-names = "default"; ··· 139 160 bus-width = <4>; 140 161 }; 141 162 142 - /* uart0 communicates with the BT module */ 163 + /* uart0 communicates with the BT module 164 + * 165 + * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven 166 + * by a single GPIO. We can't give GPIO control to one of the drivers, 167 + * otherwise the other part would get unexpectedly disturbed. 168 + */ 143 169 &uart0 { 144 170 pinctrl-names = "default"; 145 171 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>; 146 - status = "okay"; 147 - 148 - bluetooth { 149 - compatible = "brcm,bcm43438-bt"; 150 - max-speed = <2000000>; 151 - }; 152 172 }; 153 173 154 174 /* uart1 is mapped to the pin header */
+8 -28
arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
··· 4 4 #include "bcm2836-rpi.dtsi" 5 5 #include "bcm283x-rpi-lan7515.dtsi" 6 6 #include "bcm283x-rpi-usb-host.dtsi" 7 + #include "bcm283x-rpi-wifi-bt.dtsi" 7 8 8 9 / { 9 10 compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837"; ··· 32 31 linux,default-trigger = "default-on"; 33 32 }; 34 33 }; 34 + }; 35 35 36 - wifi_pwrseq: wifi-pwrseq { 37 - compatible = "mmc-pwrseq-simple"; 38 - reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 39 - }; 36 + &bt { 37 + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 40 38 }; 41 39 42 40 &firmware { ··· 137 137 status = "okay"; 138 138 }; 139 139 140 - /* SDHCI is used to control the SDIO for wireless */ 141 - &sdhci { 142 - #address-cells = <1>; 143 - #size-cells = <0>; 144 - pinctrl-names = "default"; 145 - pinctrl-0 = <&emmc_gpio34>; 146 - status = "okay"; 147 - bus-width = <4>; 148 - non-removable; 149 - mmc-pwrseq = <&wifi_pwrseq>; 150 - 151 - brcmf: wifi@1 { 152 - reg = <1>; 153 - compatible = "brcm,bcm4329-fmac"; 154 - }; 155 - }; 156 - 157 140 /* SDHOST is used to drive the SD card */ 158 141 &sdhost { 159 142 pinctrl-names = "default"; ··· 149 166 &uart0 { 150 167 pinctrl-names = "default"; 151 168 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>; 152 - status = "okay"; 153 - 154 - bluetooth { 155 - compatible = "brcm,bcm43438-bt"; 156 - max-speed = <2000000>; 157 - shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 158 - }; 159 169 }; 160 170 161 171 /* uart1 is mapped to the pin header */ ··· 156 180 pinctrl-names = "default"; 157 181 pinctrl-0 = <&uart1_gpio14>; 158 182 status = "okay"; 183 + }; 184 + 185 + &wifi_pwrseq { 186 + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 159 187 };
+8 -28
arch/arm/boot/dts/bcm2837-rpi-3-b.dts
··· 4 4 #include "bcm2836-rpi.dtsi" 5 5 #include "bcm283x-rpi-smsc9514.dtsi" 6 6 #include "bcm283x-rpi-usb-host.dtsi" 7 + #include "bcm283x-rpi-wifi-bt.dtsi" 7 8 8 9 / { 9 10 compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; ··· 25 24 gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>; 26 25 }; 27 26 }; 27 + }; 28 28 29 - wifi_pwrseq: wifi-pwrseq { 30 - compatible = "mmc-pwrseq-simple"; 31 - reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 32 - }; 29 + &bt { 30 + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 33 31 }; 34 32 35 33 &firmware { ··· 134 134 &uart0 { 135 135 pinctrl-names = "default"; 136 136 pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>; 137 - status = "okay"; 138 - 139 - bluetooth { 140 - compatible = "brcm,bcm43438-bt"; 141 - max-speed = <2000000>; 142 - shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 143 - }; 144 137 }; 145 138 146 139 /* uart1 is mapped to the pin header */ ··· 143 150 status = "okay"; 144 151 }; 145 152 146 - /* SDHCI is used to control the SDIO for wireless */ 147 - &sdhci { 148 - #address-cells = <1>; 149 - #size-cells = <0>; 150 - pinctrl-names = "default"; 151 - pinctrl-0 = <&emmc_gpio34>; 152 - status = "okay"; 153 - bus-width = <4>; 154 - non-removable; 155 - mmc-pwrseq = <&wifi_pwrseq>; 156 - 157 - brcmf: wifi@1 { 158 - reg = <1>; 159 - compatible = "brcm,bcm4329-fmac"; 160 - }; 161 - }; 162 - 163 153 /* SDHOST is used to drive the SD card */ 164 154 &sdhost { 165 155 pinctrl-names = "default"; 166 156 pinctrl-0 = <&sdhost_gpio48>; 167 157 status = "okay"; 168 158 bus-width = <4>; 159 + }; 160 + 161 + &wifi_pwrseq { 162 + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 169 163 };
+34
arch/arm/boot/dts/bcm283x-rpi-wifi-bt.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + / { 4 + wifi_pwrseq: wifi-pwrseq { 5 + compatible = "mmc-pwrseq-simple"; 6 + }; 7 + }; 8 + 9 + /* SDHCI is used to control the SDIO for wireless */ 10 + &sdhci { 11 + #address-cells = <1>; 12 + #size-cells = <0>; 13 + pinctrl-names = "default"; 14 + pinctrl-0 = <&emmc_gpio34>; 15 + bus-width = <4>; 16 + non-removable; 17 + mmc-pwrseq = <&wifi_pwrseq>; 18 + status = "okay"; 19 + 20 + brcmf: wifi@1 { 21 + reg = <1>; 22 + compatible = "brcm,bcm4329-fmac"; 23 + }; 24 + }; 25 + 26 + /* uart0 communicates with the BT module */ 27 + &uart0 { 28 + status = "okay"; 29 + 30 + bt: bluetooth { 31 + compatible = "brcm,bcm43438-bt"; 32 + max-speed = <2000000>; 33 + }; 34 + };