ARM: dts: rockchip: Add WiFi/BT for RockPI N8/N10

Message ID 20200706140336.45031-1-jagan@amarulasolutions.com
State New
Headers show
Series
  • ARM: dts: rockchip: Add WiFi/BT for RockPI N8/N10
Related show

Commit Message

Jagan Teki July 6, 2020, 2:03 p.m. UTC
This patch adds support to enable WiFi/BT for
N10 and N8 combinations SBCs.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 arch/arm/boot/dts/rk3288-vmarc-som.dtsi       | 44 +++++++++++++++++++
 .../dts/rockchip-radxa-dalang-carrier.dtsi    | 40 +++++++++++++++++
 .../dts/rockchip/rk3399pro-vmarc-som.dtsi     | 39 ++++++++++++++++
 3 files changed, 123 insertions(+)

Patch

diff --git a/arch/arm/boot/dts/rk3288-vmarc-som.dtsi b/arch/arm/boot/dts/rk3288-vmarc-som.dtsi
index dca426c978de..6d8958e893ab 100644
--- a/arch/arm/boot/dts/rk3288-vmarc-som.dtsi
+++ b/arch/arm/boot/dts/rk3288-vmarc-som.dtsi
@@ -20,6 +20,17 @@  vccio_flash: vccio-flash-regulator {
 	};
 };
 
+&brcmbt {
+	device-wakeup-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;	/* BT_WAKE */
+	host-wakeup-gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;	/* BT_HOST_WAKE */
+	shutdown-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;	/* BT_RST */
+};
+
+&brcmwifi {
+	interrupt-parent = <&gpio4>;
+	interrupts = <RK_PD6 GPIO_ACTIVE_HIGH>;
+};
+
 &emmc {
 	bus-width = <8>;
 	cap-mmc-highspeed;
@@ -43,6 +54,11 @@  &hdmi {
 	pinctrl-0 = <&hdmi_cec_c0>;
 };
 
+&hym8563 {
+	interrupt-parent = <&gpio5>;
+	interrupts = <RK_PC3 IRQ_TYPE_LEVEL_LOW>;
+};
+
 &i2c0 {
 	clock-frequency = <400000>;
 	status = "okay";
@@ -240,6 +256,20 @@  &io_domains {
 };
 
 &pinctrl {
+	bt {
+		bt_wake: bt-wake {
+			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake: bt-host-wake {
+			rockchip,pins = <4 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_rst: bt-rst {
+			rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
 		drive-strength = <8>;
 	};
@@ -284,6 +314,20 @@  usb0_en_oc: usb0-en-oc {
 			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
+
+	wifi {
+		wifi_reg_on: wifi-reg-on {
+			rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		wifi_host_wake: wifi-host-wake {
+			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+&sdio_pwrseq {
+	reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;	/* WIFI_REG_ON */
 };
 
 &usbphy {
diff --git a/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi b/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi
index 679d5e99e563..419cebf3b67c 100644
--- a/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi
+++ b/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi
@@ -15,6 +15,14 @@  clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&hym8563>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_reg_on>;
+	};
+
 	vcc12v_dcin: vcc12v-dcin-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc12v_dcin";
@@ -114,6 +122,30 @@  &pwm2 {
 	status = "okay";
 };
 
+&sdio0 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	bus-width = <4>;
+	clock-frequency = <50000000>;
+	cap-sdio-irq;
+	cap-sd-highspeed;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+	sd-uhs-sdr104;
+	status = "okay";
+
+	brcmwifi: wifi@1 {
+		compatible = "brcm,bcm4329-fmac";
+		reg = <1>;
+		interrupt-names = "host-wake";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_host_wake>;
+	};
+};
+
 &sdmmc {
 	bus-width = <4>;
 	cap-mmc-highspeed;
@@ -129,6 +161,14 @@  &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_xfer &uart0_cts>;
 	status = "okay";
+
+	brcmbt: bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&hym8563>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_wake &bt_host_wake &bt_rst>;
+	};
 };
 
 &uart2 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
index e9a0dfacf33b..be67ba04469a 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
@@ -28,6 +28,17 @@  vcc3v3_pcie: vcc-pcie-regulator {
 	};
 };
 
+&brcmbt {
+	device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;	/* BT_WAKE */
+	host-wakeup-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;	/* BT_HOST_WAKE */
+	shutdown-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;	/* BT_RST */
+};
+
+&brcmwifi {
+	interrupt-parent = <&gpio0>;
+	interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+};
+
 &cpu_l0 {
 	cpu-supply = <&vdd_cpu_l>;
 };
@@ -313,6 +324,20 @@  &pcie0 {
 };
 
 &pinctrl {
+	bt {
+		bt_wake: bt-wake {
+			rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake: bt-host-wake {
+			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_rst: bt-rst {
+			rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	hym8563 {
 		hym8563_int: hym8563-int {
 			rockchip,pins = <4 RK_PD6 0 &pcfg_pull_up>;
@@ -342,6 +367,16 @@  usb0_en_oc: usb0-en-oc {
 			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
+
+	wifi {
+		wifi_reg_on: wifi-reg-on {
+			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		wifi_host_wake: wifi-host-wake {
+			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &pmu_io_domains {
@@ -357,6 +392,10 @@  &sdhci {
 	status = "okay";
 };
 
+&sdio_pwrseq {
+	reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;	/* WIFI_REG_ON */
+};
+
 &sdmmc {
 	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
 	max-frequency = <150000000>;