hitmoon / rpms / kernel

Forked from rpms/kernel 4 years ago
Clone
6ac5b0
From a5a4bc14914faf219336d71c71595975b8112ff7 Mon Sep 17 00:00:00 2001
6ac5b0
From: Chen-Yu Tsai <wens@csie.org>
6ac5b0
Date: Wed, 9 Jan 2019 23:02:54 +0800
6ac5b0
Subject: ARM: dts: sun8i: r40: Add pinmux setting for CLK_OUT_A
6ac5b0
6ac5b0
CLK_OUT_A, an external clock output function driven from the clock
6ac5b0
control unit, on the R40 is sometimes used to provide a low rate low
6ac5b0
power clock to a WiFi or Bluetooth controller.
6ac5b0
6ac5b0
This patch adds a pinmux setting for it.
6ac5b0
6ac5b0
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
6ac5b0
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
6ac5b0
---
6ac5b0
 arch/arm/boot/dts/sun8i-r40.dtsi | 5 +++++
6ac5b0
 1 file changed, 5 insertions(+)
6ac5b0
6ac5b0
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
index f1fcfa0bdce0..06b685869f52 100644
6ac5b0
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
@@ -342,6 +342,11 @@
6ac5b0
 			#interrupt-cells = <3>;
6ac5b0
 			#gpio-cells = <3>;
6ac5b0
 
6ac5b0
+			clk_out_a_pin: clk-out-a-pin {
6ac5b0
+				pins = "PI12";
6ac5b0
+				function = "clk_out_a";
6ac5b0
+			};
6ac5b0
+
6ac5b0
 			gmac_rgmii_pins: gmac-rgmii-pins {
6ac5b0
 				pins = "PA0", "PA1", "PA2", "PA3",
6ac5b0
 				       "PA4", "PA5", "PA6", "PA7",
6ac5b0
-- 
6ac5b0
cgit 1.2-0.3.lf.el7
6ac5b0
6ac5b0
From 26e9ffeb2c04f0f577d0179e7eca8e1d54f9e050 Mon Sep 17 00:00:00 2001
6ac5b0
From: Chen-Yu Tsai <wens@csie.org>
6ac5b0
Date: Wed, 9 Jan 2019 23:02:53 +0800
6ac5b0
Subject: ARM: dts: sun8i: r40: Add pinmux settings for UART3 on PG pingroup
6ac5b0
6ac5b0
UART3 on the PG pingroup on the R40 SoC is commonly used to connect the
6ac5b0
bluetooth controller in a WiFi+Bluetooth combo chip, with the WiFi bits
6ac5b0
also on the PG pingroup.
6ac5b0
6ac5b0
This patch adds two device nodes for UART3 on PG pingroup, one for the
6ac5b0
RX/TX pins, and one for the RTS/CTS pins. Consumers can reference either
6ac5b0
just the RX/TX pinmux setting or both, depending on the application.
6ac5b0
6ac5b0
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
6ac5b0
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
6ac5b0
---
6ac5b0
 arch/arm/boot/dts/sun8i-r40.dtsi | 10 ++++++++++
6ac5b0
 1 file changed, 10 insertions(+)
6ac5b0
6ac5b0
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
index 89762dbefe42..f1fcfa0bdce0 100644
6ac5b0
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
@@ -389,6 +389,16 @@
6ac5b0
 				pins = "PB22", "PB23";
6ac5b0
 				function = "uart0";
6ac5b0
 			};
6ac5b0
+
6ac5b0
+			uart3_pg_pins: uart3-pg-pins {
6ac5b0
+				pins = "PG6", "PG7";
6ac5b0
+				function = "uart3";
6ac5b0
+			};
6ac5b0
+
6ac5b0
+			uart3_rts_cts_pg_pins: uart3-rts-cts-pg-pins {
6ac5b0
+				pins = "PG8", "PG9";
6ac5b0
+				function = "uart3";
6ac5b0
+			};
6ac5b0
 		};
6ac5b0
 
6ac5b0
 		wdt: watchdog@1c20c90 {
6ac5b0
-- 
6ac5b0
cgit 1.2-0.3.lf.el7
6ac5b0
6ac5b0
From 75d64e8bf5c1582853515adc7e6f734852d5d5c7 Mon Sep 17 00:00:00 2001
6ac5b0
From: Chen-Yu Tsai <wens@csie.org>
6ac5b0
Date: Mon, 3 Dec 2018 22:58:23 +0800
6ac5b0
Subject: ARM: dts: sun8i: r40: Add clock accuracy for external oscillators
6ac5b0
6ac5b0
The R40 datasheet specifies a tolerance range for the external
6ac5b0
oscillators used. Add them to the device tree as the clock accuracy.
6ac5b0
6ac5b0
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6ac5b0
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
6ac5b0
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
6ac5b0
---
6ac5b0
 arch/arm/boot/dts/sun8i-r40.dtsi | 2 ++
6ac5b0
 1 file changed, 2 insertions(+)
6ac5b0
6ac5b0
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
index 6f4c9ca5a3ee..a8917f8b1c80 100644
6ac5b0
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
6ac5b0
@@ -61,6 +61,7 @@
6ac5b0
 			#clock-cells = <0>;
6ac5b0
 			compatible = "fixed-clock";
6ac5b0
 			clock-frequency = <24000000>;
6ac5b0
+			clock-accuracy = <50000>;
6ac5b0
 			clock-output-names = "osc24M";
6ac5b0
 		};
6ac5b0
 
6ac5b0
@@ -68,6 +69,7 @@
6ac5b0
 			#clock-cells = <0>;
6ac5b0
 			compatible = "fixed-clock";
6ac5b0
 			clock-frequency = <32768>;
6ac5b0
+			clock-accuracy = <20000>;
6ac5b0
 			clock-output-names = "osc32k";
6ac5b0
 		};
6ac5b0
 	};
6ac5b0
-- 
6ac5b0
cgit 1.2-0.3.lf.el7
6ac5b0
917372
From c41ca64d075020e2d5daecb7f48da6af0ba5b512 Mon Sep 17 00:00:00 2001
917372
From: Tuomas Tynkkynen <tuomas@tuxera.com>
917372
Date: Wed, 8 Aug 2018 02:25:53 +0300
917372
Subject: ARM: dts: sunxi: Don't use cd-inverted in sun8i-r40-bananapi-m2-ultra
917372
917372
Another user of cd-inverted seems to have crept in. Switch it away from
917372
cd-inverted to be consistent with other sunxi boards.
917372
917372
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
917372
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
917372
---
917372
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 3 +--
917372
 1 file changed, 1 insertion(+), 2 deletions(-)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
index c39b9169ea64..a891a387e8f1 100644
917372
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
@@ -159,8 +159,7 @@
917372
 &mmc0 {
917372
 	vmmc-supply = <&reg_dcdc1>;
917372
 	bus-width = <4>;
917372
-	cd-gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */
917372
-	cd-inverted;
917372
+	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
917372
 	status = "okay";
917372
 };
917372
 
917372
-- 
917372
cgit 1.2-0.3.lf.el7
917372
917372
From e5c6e693be831c1bba9b4f8f1da597fb5514deca Mon Sep 17 00:00:00 2001
917372
From: Chen-Yu Tsai <wens@csie.org>
917372
Date: Wed, 9 Jan 2019 23:02:55 +0800
917372
Subject: ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix WiFi regulator
917372
 definitions
917372
917372
The design of the Bananapi M2 Ultra has both DLDO1 and DLDO2 regulators
917372
provide power to the WiFi+BT module, which is based on the Broadcom
917372
BCM43438 or BCM43430 chip. Each regulator output from the PMIC can supply
917372
up to 200 mA. The datasheet of the chip suggests a maximum power draw of
917372
up to 360 mA when transmitting, thus requiring two outputs from the PMIC
917372
to handle the load. However the device tree only references one of them,
917372
leaving the other unused and possibly turned off.
917372
917372
This patch marks both as always-on, since we don't have a proper binding
917372
to specify two regulators as "bound together". The name and constraints
917372
of DLDO2 are also added.
917372
917372
Fixes: da7ac948fa93 ("ARM: dts: sun8i: Add board dts file for Banana Pi M2
917372
		      Ultra")
917372
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
917372
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
917372
---
917372
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 15 +++++++++++++++
917372
 1 file changed, 15 insertions(+)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
index 438b7b44dab3..1a6794e63b90 100644
917372
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
917372
@@ -250,12 +250,27 @@
917372
 	regulator-name = "vcc-wifi-io";
917372
 };
917372
 
917372
+/*
917372
+ * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
917372
+ * time, with the two being in sync, to be able to meet maximum power
917372
+ * consumption during transmits. Since this is not really supported
917372
+ * right now, just use the two as always on, and we will fix it later.
917372
+ */
917372
+
917372
 &reg_dldo2 {
917372
+	regulator-always-on;
917372
 	regulator-min-microvolt = <3300000>;
917372
 	regulator-max-microvolt = <3300000>;
917372
 	regulator-name = "vcc-wifi";
917372
 };
917372
 
917372
+&reg_dldo3 {
917372
+	regulator-always-on;
917372
+	regulator-min-microvolt = <3300000>;
917372
+	regulator-max-microvolt = <3300000>;
917372
+	regulator-name = "vcc-wifi-2";
917372
+};
917372
+
917372
 &reg_dldo4 {
917372
 	regulator-min-microvolt = <2500000>;
917372
 	regulator-max-microvolt = <2500000>;
917372
-- 
917372
cgit 1.2-0.3.lf.el7
917372
ec7f54
From 1e5f1db4ccd8348a21da55bff82f4263000879ef Mon Sep 17 00:00:00 2001
ec7f54
From: Chen-Yu Tsai <wens@csie.org>
ec7f54
Date: Wed, 9 Jan 2019 23:02:56 +0800
ec7f54
Subject: ARM: dts: sun8i: r40: bananapi-m2-ultra: Add Bluetooth device node
ec7f54
ec7f54
The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
ec7f54
identifies as BCM43430, while the Bluetooth side identifies as BCM43438.
ec7f54
ec7f54
The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
ec7f54
as the WiFi side, due to being the same chip and package, DLDO1 and
ec7f54
DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
ec7f54
I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
ec7f54
the LPO low power clock at 32.768 kHz.
ec7f54
ec7f54
This patch enables Bluetooth on this board, and also adds the missing
ec7f54
LPO clock on the WiFi side. There is also a PCM connection for
ec7f54
Bluetooth, but this is not covered here.
ec7f54
ec7f54
The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
ec7f54
PI12. This can be represented in multiple ways. This patch puts the
ec7f54
pinctrl property in the pin controller node. This is due to limitations
ec7f54
in Linux, where pinmux settings, even the same one, can not be shared
ec7f54
by multiple devices. Thus we cannot put it in both the WiFi and
ec7f54
Bluetooth device nodes. Putting it the CCU node is another option, but
ec7f54
Linux's CCU driver does not handle pinctrl. Also the pin controller is
ec7f54
guaranteed to be initialized after the CCU, when clocks are available.
ec7f54
And any other devices that use muxed pins are guaranteed to be
ec7f54
initialized after the pin controller. Thus having the CLK_OUT_A pinmux
ec7f54
reference be in the pin controller node is a good choice without having
ec7f54
to deal with implementation issues.
ec7f54
ec7f54
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
ec7f54
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
ec7f54
---
ec7f54
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 26 +++++++++++++++++++++++
ec7f54
 1 file changed, 26 insertions(+)
ec7f54
ec7f54
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
index 1a6794e63b90..c488aaacbd68 100644
ec7f54
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
@@ -102,6 +102,8 @@
ec7f54
 	wifi_pwrseq: wifi_pwrseq {
ec7f54
 		compatible = "mmc-pwrseq-simple";
ec7f54
 		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
ec7f54
+		clocks = <&ccu CLK_OUTA>;
ec7f54
+		clock-names = "ext_clock";
ec7f54
 	};
ec7f54
 };
ec7f54
 
ec7f54
@@ -196,6 +198,11 @@
ec7f54
 	status = "okay";
ec7f54
 };
ec7f54
 
ec7f54
+&pio {
ec7f54
+	pinctrl-names = "default";
ec7f54
+	pinctrl-0 = <&clk_out_a_pin>;
ec7f54
+};
ec7f54
+
ec7f54
 &reg_aldo2 {
ec7f54
 	regulator-always-on;
ec7f54
 	regulator-min-microvolt = <2500000>;
ec7f54
@@ -293,6 +300,25 @@
ec7f54
 	status = "okay";
ec7f54
 };
ec7f54
 
ec7f54
+&uart3 {
ec7f54
+	pinctrl-names = "default";
ec7f54
+	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
ec7f54
+	uart-has-rtscts;
ec7f54
+	status = "okay";
ec7f54
+
ec7f54
+	bluetooth {
ec7f54
+		compatible = "brcm,bcm43438-bt";
ec7f54
+		clocks = <&ccu CLK_OUTA>;
ec7f54
+		clock-names = "lpo";
ec7f54
+		vbat-supply = <&reg_dldo2>;
ec7f54
+		vddio-supply = <&reg_dldo1>;
ec7f54
+		device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
ec7f54
+		/* TODO host wake line connected to PMIC GPIO pins */
ec7f54
+		shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
ec7f54
+		max-speed = <1500000>;
ec7f54
+	};
ec7f54
+};
ec7f54
+
ec7f54
 &usbphy {
ec7f54
 	usb1_vbus-supply = <&reg_vcc5v0>;
ec7f54
 	usb2_vbus-supply = <&reg_vcc5v0>;
ec7f54
-- 
ec7f54
cgit 1.2-0.3.lf.el7
ec7f54
ec7f54
From 0e363c61307062cd18c48e889b419fb37afb1c31 Mon Sep 17 00:00:00 2001
ec7f54
From: Pablo Greco <pgreco@centosproject.org>
ec7f54
Date: Tue, 16 Apr 2019 18:23:45 -0300
ec7f54
Subject: [PATCH v5 1/7] ARM: dts: sun8i: r40: bananapi-m2-ultra: Add GPIO
ec7f54
 pin-bank regulator supplies
ec7f54
ec7f54
The bananapi-m2-ultra has the PMIC providing voltage to all the pin-bank
ec7f54
supply rails from its various regulator outputs, tie them to the pio
ec7f54
node.
ec7f54
ec7f54
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
ec7f54
---
ec7f54
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 6 ++++++
ec7f54
 1 file changed, 6 insertions(+)
ec7f54
ec7f54
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
index c488aaa..699579d 100644
ec7f54
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
ec7f54
@@ -201,6 +201,12 @@
ec7f54
 &pio {
ec7f54
 	pinctrl-names = "default";
ec7f54
 	pinctrl-0 = <&clk_out_a_pin>;
ec7f54
+	vcc-pa-supply = <&reg_aldo2>;
ec7f54
+	vcc-pc-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pd-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pe-supply = <&reg_eldo1>;
ec7f54
+	vcc-pf-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pg-supply = <&reg_dldo1>;
ec7f54
 };
ec7f54
 
ec7f54
 &reg_aldo2 {
ec7f54
-- 
ec7f54
1.8.3.1
ec7f54
917372
From 933ea7e9d143cee0c8c3bdc274afa69c91d91d61 Mon Sep 17 00:00:00 2001
917372
From: Pablo Greco <pgreco@centosproject.org>
917372
Date: Wed, 10 Apr 2019 18:59:25 -0300
917372
Subject: [PATCH v2 1/6] ARM: dts: sun8i: v40: bananapi-m2-berry: Sort device
917372
 node dereferences.
917372
917372
The device node dereferences are out of order, sort them.
917372
917372
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
917372
---
917372
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 36 +++++++++++------------
917372
 1 file changed, 18 insertions(+), 18 deletions(-)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
index bf97f62..f05cabd 100644
917372
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
@@ -105,6 +105,24 @@
917372
 
917372
 #include "axp22x.dtsi"
917372
 
917372
+&mmc0 {
917372
+	vmmc-supply = <&reg_dcdc1>;
917372
+	bus-width = <4>;
917372
+	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
917372
+	status = "okay";
917372
+};
917372
+
917372
+&mmc1 {
917372
+	pinctrl-names = "default";
917372
+	pinctrl-0 = <&mmc1_pg_pins>;
917372
+	vmmc-supply = <&reg_dldo2>;
917372
+	vqmmc-supply = <&reg_dldo1>;
917372
+	mmc-pwrseq = <&wifi_pwrseq>;
917372
+	bus-width = <4>;
917372
+	non-removable;
917372
+	status = "okay";
917372
+};
917372
+
917372
 &reg_aldo3 {
917372
 	regulator-always-on;
917372
 	regulator-min-microvolt = <2700000>;
917372
@@ -152,24 +170,6 @@
917372
 	regulator-name = "vcc-wifi";
917372
 };
917372
 
917372
-&mmc0 {
917372
-	vmmc-supply = <&reg_dcdc1>;
917372
-	bus-width = <4>;
917372
-	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
917372
-	status = "okay";
917372
-};
917372
-
917372
-&mmc1 {
917372
-	pinctrl-names = "default";
917372
-	pinctrl-0 = <&mmc1_pg_pins>;
917372
-	vmmc-supply = <&reg_dldo2>;
917372
-	vqmmc-supply = <&reg_dldo1>;
917372
-	mmc-pwrseq = <&wifi_pwrseq>;
917372
-	bus-width = <4>;
917372
-	non-removable;
917372
-	status = "okay";
917372
-};
917372
-
917372
 &uart0 {
917372
 	pinctrl-names = "default";
917372
 	pinctrl-0 = <&uart0_pb_pins>;
917372
-- 
917372
1.8.3.1
917372
ec7f54
From 8aaf8c380ea622a324de435fef9acc0491c98854 Mon Sep 17 00:00:00 2001
ec7f54
From: Pablo Greco <pgreco@centosproject.org>
ec7f54
Date: Wed, 17 Apr 2019 19:34:25 -0300
ec7f54
Subject: [PATCH v6 1/5] ARM: dts: sun8i: v40: bananapi-m2-berry: Add GPIO
ec7f54
 pin-bank regulator supplies
ec7f54
ec7f54
The bananapi-m2-berry has the PMIC providing voltage to all the pin-bank
ec7f54
supply rails from its various regulator outputs, tie them to the pio
ec7f54
node.
ec7f54
ec7f54
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
ec7f54
---
ec7f54
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 15 +++++++++++++++
ec7f54
 1 file changed, 15 insertions(+)
ec7f54
ec7f54
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
index f05cabd..27297f4 100644
ec7f54
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
@@ -123,6 +123,21 @@
ec7f54
 	status = "okay";
ec7f54
 };
ec7f54
 
ec7f54
+&pio {
ec7f54
+	vcc-pa-supply = <&reg_aldo2>;
ec7f54
+	vcc-pc-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pd-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pe-supply = <&reg_eldo1>;
ec7f54
+	vcc-pf-supply = <&reg_dcdc1>;
ec7f54
+	vcc-pg-supply = <&reg_dldo1>;
ec7f54
+};
ec7f54
+
ec7f54
+&reg_aldo2 {
ec7f54
+	regulator-min-microvolt = <2500000>;
ec7f54
+	regulator-max-microvolt = <2500000>;
ec7f54
+	regulator-name = "vcc-pa";
ec7f54
+};
ec7f54
+
ec7f54
 &reg_aldo3 {
ec7f54
 	regulator-always-on;
ec7f54
 	regulator-min-microvolt = <2700000>;
ec7f54
-- 
ec7f54
1.8.3.1
ec7f54
ec7f54
From 8f708af45073e971ac75a43863382ece8bb4ce79 Mon Sep 17 00:00:00 2001
917372
From: Pablo Greco <pgreco@centosproject.org>
917372
Date: Thu, 11 Apr 2019 13:58:49 -0300
ec7f54
Subject: [PATCH v6 2/5] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable GMAC
917372
 ethernet controller
917372
917372
Just like the Bananapi M2 Ultra, the Bananapi M2 Berry has a Realtek
917372
RTL8211E RGMII PHY tied to the GMAC.
917372
The PMIC's DC1SW output provides power for the PHY, while the ALDO2
917372
output provides I/O voltages on both sides.
917372
917372
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
917372
---
ec7f54
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 23 +++++++++++++++++++++++
ec7f54
 1 file changed, 23 insertions(+)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
index 27297f4..0dfde58 100644
917372
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
@@ -50,6 +50,7 @@
917372
 	compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
917372
 
917372
 	aliases {
917372
+		ethernet0 = &gmac;
917372
 		serial0 = &uart;;
917372
 	};
917372
 
917372
@@ -92,6 +93,22 @@
917372
 	status = "okay";
917372
 };
917372
 
917372
+&gmac {
917372
+	pinctrl-names = "default";
917372
+	pinctrl-0 = <&gmac_rgmii_pins>;
917372
+	phy-handle = <&phy1>;
917372
+	phy-mode = "rgmii";
917372
+	phy-supply = <&reg_dc1sw>;
917372
+	status = "okay";
917372
+};
917372
+
917372
+&gmac_mdio {
917372
+	phy1: ethernet-phy@1 {
917372
+		compatible = "ethernet-phy-ieee802.3-c22";
917372
+		reg = <1>;
917372
+	};
917372
+};
917372
+
917372
 &i2c0 {
917372
 	status = "okay";
917372
 
ec7f54
@@ -145,6 +162,12 @@
917372
 	regulator-name = "avcc";
917372
 };
917372
 
917372
+&reg_dc1sw {
917372
+	regulator-min-microvolt = <3000000>;
917372
+	regulator-max-microvolt = <3000000>;
917372
+	regulator-name = "vcc-gmac-phy";
917372
+};
917372
+
917372
 &reg_dcdc1 {
917372
 	regulator-always-on;
917372
 	regulator-min-microvolt = <3000000>;
917372
-- 
917372
1.8.3.1
917372
ec7f54
From 1d4425d5ee921a8ec63000b9544b5098a80c94fe Mon Sep 17 00:00:00 2001
917372
From: Pablo Greco <pgreco@centosproject.org>
917372
Date: Thu, 11 Apr 2019 14:00:05 -0300
ec7f54
Subject: [PATCH v6 3/5] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable HDMI
917372
 output
917372
917372
This patch adds the hdmi nodes to the Bananapi M2 Berry, the same way it
917372
was done to the Bananapi M2 Ultra
917372
917372
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
917372
---
917372
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 29 +++++++++++++++++++++++
917372
 1 file changed, 29 insertions(+)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
index 0dfde58..1f4f51f9 100644
917372
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
@@ -58,6 +58,17 @@
917372
 		stdout-path = "serial0:115200n8";
917372
 	};
917372
 
917372
+	connector {
917372
+		compatible = "hdmi-connector";
917372
+		type = "a";
917372
+
917372
+		port {
917372
+			hdmi_con_in: endpoint {
917372
+				remote-endpoint = <&hdmi_out_con>;
917372
+			};
917372
+		};
917372
+	};
917372
+
917372
 	leds {
917372
 		compatible = "gpio-leds";
917372
 
917372
@@ -88,6 +99,10 @@
917372
 	};
917372
 };
917372
 
917372
+&de {
917372
+	status = "okay";
917372
+};
917372
+
917372
 &ehci1 {
917372
 	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
917372
 	status = "okay";
917372
@@ -109,6 +124,16 @@
917372
 	};
917372
 };
917372
 
917372
+&hdmi {
917372
+	status = "okay";
917372
+};
917372
+
917372
+&hdmi_out {
917372
+	hdmi_out_con: endpoint {
917372
+		remote-endpoint = <&hdmi_con_in>;
917372
+	};
917372
+};
917372
+
917372
 &i2c0 {
917372
 	status = "okay";
917372
 
ec7f54
@@ -208,6 +233,10 @@
917372
 	regulator-name = "vcc-wifi";
917372
 };
917372
 
917372
+&tcon_tv0 {
917372
+	status = "okay";
917372
+};
917372
+
917372
 &uart0 {
917372
 	pinctrl-names = "default";
917372
 	pinctrl-0 = <&uart0_pb_pins>;
917372
-- 
917372
1.8.3.1
917372
ec7f54
From 6191156685f9b94b87a370d82e642671104f504c Mon Sep 17 00:00:00 2001
917372
From: Pablo Greco <pgreco@centosproject.org>
917372
Date: Thu, 11 Apr 2019 14:03:54 -0300
ec7f54
Subject: [PATCH v6 4/5] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable AHCI
917372
917372
Just like the Bananapi M2 Ultra, enable the ahci controller and
917372
the two regulators needed to activate it.
917372
ec7f54
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
917372
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
917372
---
917372
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 18 ++++++++++++++++++
917372
 1 file changed, 18 insertions(+)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
index 1f4f51f9..461683c 100644
917372
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
@@ -99,6 +99,12 @@
917372
 	};
917372
 };
917372
 
917372
+&ahci {
917372
+	ahci-supply = <&reg_dldo4>;
917372
+	phy-supply = <&reg_eldo3>;
917372
+	status = "okay";
917372
+};
917372
+
917372
 &de {
917372
 	status = "okay";
917372
 };
ec7f54
@@ -233,6 +239,18 @@
917372
 	regulator-name = "vcc-wifi";
917372
 };
917372
 
917372
+&reg_dldo4 {
917372
+	regulator-min-microvolt = <2500000>;
917372
+	regulator-max-microvolt = <2500000>;
917372
+	regulator-name = "vdd2v5-sata";
917372
+};
917372
+
917372
+&reg_eldo3 {
917372
+	regulator-min-microvolt = <1200000>;
917372
+	regulator-max-microvolt = <1200000>;
917372
+	regulator-name = "vdd1v2-sata";
917372
+};
917372
+
917372
 &tcon_tv0 {
917372
 	status = "okay";
917372
 };
917372
-- 
917372
1.8.3.1
917372
ec7f54
From c8fbe63299222c29c721816939a8bb12eb77c2ac Mon Sep 17 00:00:00 2001
917372
From: Pablo Greco <pgreco@centosproject.org>
ec7f54
Date: Thu, 11 Apr 2019 14:05:06 -0300
ec7f54
Subject: [PATCH v6 5/5] ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth
ec7f54
 device node
ec7f54
ec7f54
The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
ec7f54
identifies as BCM43430, while the Bluetooth side identifies as BCM43438.
ec7f54
ec7f54
The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
ec7f54
as the WiFi side, due to being the same chip and package, DLDO1 and
ec7f54
DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
ec7f54
I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
ec7f54
the LPO low power clock at 32.768 kHz.
ec7f54
ec7f54
This patch enables Bluetooth on this board, and also adds the missing
ec7f54
LPO clock on the WiFi side. There is also a PCM connection for
ec7f54
Bluetooth, but this is not covered here.
ec7f54
ec7f54
The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
ec7f54
PI12. This can be represented in multiple ways. This patch puts the
ec7f54
pinctrl property in the pin controller node. This is due to limitations
ec7f54
in Linux, where pinmux settings, even the same one, can not be shared
ec7f54
by multiple devices. Thus we cannot put it in both the WiFi and
ec7f54
Bluetooth device nodes. Putting it the CCU node is another option, but
ec7f54
Linux's CCU driver does not handle pinctrl. Also the pin controller is
ec7f54
guaranteed to be initialized after the CCU, when clocks are available.
ec7f54
And any other devices that use muxed pins are guaranteed to be
ec7f54
initialized after the pin controller. Thus having the CLK_OUT_A pinmux
ec7f54
reference be in the pin controller node is a good choice without having
ec7f54
to deal with implementation issues.
917372
917372
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
917372
---
ec7f54
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 38 +++++++++++++++++++++++
ec7f54
 1 file changed, 38 insertions(+)
917372
917372
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
index 461683c..15c22b0 100644
917372
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
917372
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
ec7f54
@@ -96,6 +96,8 @@
ec7f54
 	wifi_pwrseq: wifi_pwrseq {
ec7f54
 		compatible = "mmc-pwrseq-simple";
ec7f54
 		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
ec7f54
+		clocks = <&ccu CLK_OUTA>;
ec7f54
+		clock-names = "ext_clock";
ec7f54
 	};
ec7f54
 };
ec7f54
 
ec7f54
@@ -172,6 +174,8 @@
ec7f54
 };
ec7f54
 
ec7f54
 &pio {
ec7f54
+	pinctrl-names = "default";
ec7f54
+	pinctrl-0 = <&clk_out_a_pin>;
ec7f54
 	vcc-pa-supply = <&reg_aldo2>;
ec7f54
 	vcc-pc-supply = <&reg_dcdc1>;
ec7f54
 	vcc-pd-supply = <&reg_dcdc1>;
ec7f54
@@ -233,12 +237,27 @@
917372
 	regulator-name = "vcc-wifi-io";
917372
 };
917372
 
917372
+/*
917372
+ * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
917372
+ * time, with the two being in sync, to be able to meet maximum power
917372
+ * consumption during transmits. Since this is not really supported
917372
+ * right now, just use the two as always on, and we will fix it later.
917372
+ */
917372
+
917372
 &reg_dldo2 {
917372
+	regulator-always-on;
917372
 	regulator-min-microvolt = <3300000>;
917372
 	regulator-max-microvolt = <3300000>;
917372
 	regulator-name = "vcc-wifi";
917372
 };
917372
 
917372
+&reg_dldo3 {
917372
+	regulator-always-on;
917372
+	regulator-min-microvolt = <3300000>;
917372
+	regulator-max-microvolt = <3300000>;
917372
+	regulator-name = "vcc-wifi-2";
917372
+};
917372
+
917372
 &reg_dldo4 {
917372
 	regulator-min-microvolt = <2500000>;
917372
 	regulator-max-microvolt = <2500000>;
ec7f54
@@ -261,6 +280,25 @@
ec7f54
 	status = "okay";
ec7f54
 };
ec7f54
 
ec7f54
+&uart3 {
ec7f54
+	pinctrl-names = "default";
ec7f54
+	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
ec7f54
+	uart-has-rtscts;
ec7f54
+	status = "okay";
ec7f54
+
ec7f54
+	bluetooth {
ec7f54
+		compatible = "brcm,bcm43438-bt";
ec7f54
+		clocks = <&ccu CLK_OUTA>;
ec7f54
+		clock-names = "lpo";
ec7f54
+		vbat-supply = <&reg_dldo2>;
ec7f54
+		vddio-supply = <&reg_dldo1>;
ec7f54
+		device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
ec7f54
+		/* TODO host wake line connected to PMIC GPIO pins */
ec7f54
+		shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
ec7f54
+		max-speed = <1500000>;
ec7f54
+	};
ec7f54
+};
ec7f54
+
ec7f54
 &usbphy {
ec7f54
 	usb1_vbus-supply = <&reg_vcc5v0>;
ec7f54
 	status = "okay";
917372
-- 
917372
1.8.3.1
917372