Skip to content

Commit c9f4b25

Browse files
pcercueitsbogend
authored andcommitted
MIPS: DTS: CI20: Enable support for WiFi / Bluetooth
Wire the WiFi/Bluetooth chip properly in the Device Tree. - Provide it with the correct regulators and clocks; - Change the MMC I/O bus to 1.8V which seems to be enough; - Change the MMC I/O bus frequency to 25 MHz as 50 MHz causes errors; - Fix the Bluetooth powerdown GPIO being inverted and add reset GPIO; - Convert host-wakeup-gpios to IRQ. With these changes, the WiFi works properly with the latest firmware provided by linux-firmware. The Bluetooth does not work very well here, as I cannot get my wireless keyboard to pair; but it does detect it, and it does see the key presses when I type the pairing code. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 868b70b commit c9f4b25

1 file changed

Lines changed: 73 additions & 15 deletions

File tree

arch/mips/boot/dts/ingenic/ci20.dts

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,15 @@
9797
gpios = <&gpe 3 GPIO_ACTIVE_LOW>;
9898
};
9999

100-
wlan0_power: fixedregulator-1 {
100+
bt_power: fixedregulator-1 {
101101
compatible = "regulator-fixed";
102102

103-
regulator-name = "wlan0_power";
103+
regulator-name = "bt_power";
104+
regulator-min-microvolt = <3300000>;
105+
regulator-max-microvolt = <3300000>;
106+
regulator-settling-time-us = <1400>;
107+
108+
vin-supply = <&vcc_50>;
104109

105110
gpio = <&gpb 19 0>;
106111
enable-active-high;
@@ -116,6 +121,40 @@
116121
gpio = <&gpf 15 0>;
117122
enable-active-high;
118123
};
124+
125+
wifi_power: fixedregulator-4 {
126+
compatible = "regulator-fixed";
127+
128+
regulator-name = "wifi_power";
129+
130+
/*
131+
* Technically it's 5V, the WiFi chip has its own internal
132+
* regulators; but the MMC/SD subsystem won't accept such a
133+
* value.
134+
*/
135+
regulator-min-microvolt = <3300000>;
136+
regulator-max-microvolt = <3300000>;
137+
regulator-settling-time-us = <150000>;
138+
139+
vin-supply = <&bt_power>;
140+
};
141+
142+
vcc_33v: fixedregulator-5 {
143+
compatible = "regulator-fixed";
144+
145+
regulator-name = "vcc_33v";
146+
regulator-min-microvolt = <3300000>;
147+
regulator-max-microvolt = <3300000>;
148+
regulator-always-on;
149+
};
150+
151+
wifi_pwrseq: pwrseq {
152+
compatible = "mmc-pwrseq-simple";
153+
reset-gpios = <&gpf 7 GPIO_ACTIVE_LOW>;
154+
155+
clocks = <&rtc_dev>;
156+
clock-names = "ext_clock";
157+
};
119158
};
120159

121160
&ext {
@@ -161,24 +200,33 @@
161200
pinctrl-0 = <&pins_mmc0>;
162201

163202
cd-gpios = <&gpf 20 GPIO_ACTIVE_LOW>;
203+
vmmc-supply = <&vcc_33v>;
204+
vqmmc-supply = <&vcc_33v>;
164205
};
165206

166207
&mmc1 {
167208
status = "okay";
168209

169210
bus-width = <4>;
170-
max-frequency = <50000000>;
211+
max-frequency = <25000000>;
212+
mmc-pwrseq = <&wifi_pwrseq>;
213+
vmmc-supply = <&wifi_power>;
214+
vqmmc-supply = <&wifi_io>;
171215
non-removable;
172216

173217
pinctrl-names = "default";
174218
pinctrl-0 = <&pins_mmc1>;
175219

176-
brcmf: wifi@1 {
177-
/* reg = <4>;*/
178-
compatible = "brcm,bcm4330-fmac";
179-
vcc-supply = <&wlan0_power>;
180-
device-wakeup-gpios = <&gpd 9 GPIO_ACTIVE_HIGH>;
181-
shutdown-gpios = <&gpf 7 GPIO_ACTIVE_LOW>;
220+
#address-cells = <1>;
221+
#size-cells = <0>;
222+
223+
wifi@1 {
224+
compatible = "brcm,bcm4329-fmac";
225+
reg = <1>;
226+
227+
interrupt-parent = <&gpd>;
228+
interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
229+
interrupt-names = "host-wake";
182230
};
183231
};
184232

@@ -205,11 +253,20 @@
205253

206254
bluetooth {
207255
compatible = "brcm,bcm4330-bt";
208-
reset-gpios = <&gpf 8 GPIO_ACTIVE_HIGH>;
209-
vcc-supply = <&wlan0_power>;
256+
257+
vbat-supply = <&bt_power>;
258+
vddio-supply = <&wifi_io>;
259+
260+
interrupt-parent = <&gpf>;
261+
interrupts = <6 IRQ_TYPE_EDGE_RISING>;
262+
interrupt-names = "host-wakeup";
263+
264+
clocks = <&rtc_dev>;
265+
clock-names = "lpo";
266+
267+
reset-gpios = <&gpf 8 GPIO_ACTIVE_LOW>;
210268
device-wakeup-gpios = <&gpf 5 GPIO_ACTIVE_HIGH>;
211-
host-wakeup-gpios = <&gpf 6 GPIO_ACTIVE_HIGH>;
212-
shutdown-gpios = <&gpf 4 GPIO_ACTIVE_LOW>;
269+
shutdown-gpios = <&gpf 4 GPIO_ACTIVE_HIGH>;
213270
};
214271
};
215272

@@ -270,8 +327,9 @@
270327
regulator-always-on;
271328
};
272329
wifi_io: LDO6 {
273-
regulator-min-microvolt = <2500000>;
274-
regulator-max-microvolt = <2500000>;
330+
regulator-min-microvolt = <1800000>;
331+
regulator-max-microvolt = <1800000>;
332+
regulator-settling-time-us = <150000>;
275333
inl-supply = <&vcc_33v>;
276334
};
277335
cim_io_28: LDO7 {

0 commit comments

Comments
 (0)