[PATCH 0/4] Allwinner H6 RSB support

12 views
Skip to first unread message

Samuel Holland

unread,
Dec 13, 2020, 6:55:12 PM12/13/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring, Michael Turquette, Stephen Boyd, Linus Walleij, Philipp Zabel, Andre Przywara, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linu...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland
The Allwinner H6 SoC contains an RSB controller. It is almost completely
undocumented, so it was missed when doing the initial SoC bringup.

This series adds the clock/reset, pin configuration, and device tree
node needed to use the RSB controller. Since RSB is faster, simpler, and
generally more reliable than the I2C controller IP in the SoC, switch to
using it where possible.

This was tested on an Orange Pi 3 and a Pine H64 model B. This series
does not switch the Pine H64 to use RSB, as doing so would prevent
accessing the external RTC that shares the I2C bus.

Samuel Holland (4):
clk: sunxi-ng: h6-r: Add R_APB2_RSB clock and reset
pinctrl: sunxi: h6-r: Add s_rsb pin functions
arm64: dts: allwinner: h6: Add RSB controller node
arm64: dts: allwinner: h6: Use RSB for AXP805 PMIC connection

.../dts/allwinner/sun50i-h6-beelink-gs1.dts | 38 +++++++++----------
.../dts/allwinner/sun50i-h6-orangepi-3.dts | 14 +++----
.../dts/allwinner/sun50i-h6-orangepi.dtsi | 22 +++++------
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 19 ++++++++++
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 5 +++
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h | 2 +-
drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c | 2 +
include/dt-bindings/clock/sun50i-h6-r-ccu.h | 1 +
include/dt-bindings/reset/sun50i-h6-r-ccu.h | 1 +
9 files changed, 66 insertions(+), 38 deletions(-)

--
2.26.2

Samuel Holland

unread,
Dec 13, 2020, 6:55:13 PM12/13/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring, Michael Turquette, Stephen Boyd, Linus Walleij, Philipp Zabel, Andre Przywara, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linu...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland
On boards where the only peripheral connected to PL0/PL1 is an X-Powers
PMIC, configure the connection to use the RSB bus rather than the I2C
bus. Compared to the I2C controller that shares the pins, the RSB
controller allows a higher bus frequency, and it is more CPU-efficient.

Signed-off-by: Samuel Holland <sam...@sholland.org>
---
.../dts/allwinner/sun50i-h6-beelink-gs1.dts | 38 +++++++++----------
.../dts/allwinner/sun50i-h6-orangepi-3.dts | 14 +++----
.../dts/allwinner/sun50i-h6-orangepi.dtsi | 22 +++++------
3 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
index 416e0fa76ba7..8a95abfc2ebb 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
@@ -158,12 +158,28 @@ &pio {
vcc-pg-supply = <&reg_aldo1>;
};

-&r_i2c {
+&r_ir {
+ linux,rc-map-name = "rc-beelink-gs1";
+ status = "okay";
+};
+
+&r_pio {
+ /*
+ * FIXME: We can't add that supply for now since it would
+ * create a circular dependency between pinctrl, the regulator
+ * and the RSB Bus.
+ *
+ * vcc-pl-supply = <&reg_aldo1>;
+ */
+ vcc-pm-supply = <&reg_aldo1>;
+};
+
+&r_rsb {
status = "okay";

- axp805: pmic@36 {
+ axp805: pmic@745 {
compatible = "x-powers,axp805", "x-powers,axp806";
- reg = <0x36>;
+ reg = <0x745>;
interrupt-parent = <&r_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
@@ -281,22 +297,6 @@ sw {
};
};

-&r_ir {
- linux,rc-map-name = "rc-beelink-gs1";
- status = "okay";
-};
-
-&r_pio {
- /*
- * PL0 and PL1 are used for PMIC I2C
- * don't enable the pl-supply else
- * it will fail at boot
- *
- * vcc-pl-supply = <&reg_aldo1>;
- */
- vcc-pm-supply = <&reg_aldo1>;
-};
-
&rtc {
clocks = <&ext_osc32k>;
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
index 8a8d1a608e30..e86360ea022e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
@@ -222,12 +222,16 @@ &pio {
vcc-pg-supply = <&reg_vcc_wifi_io>;
};

-&r_i2c {
+&r_ir {
+ status = "okay";
+};
+
+&r_rsb {
status = "okay";

- axp805: pmic@36 {
+ axp805: pmic@745 {
compatible = "x-powers,axp805", "x-powers,axp806";
- reg = <0x36>;
+ reg = <0x745>;
interrupt-parent = <&r_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
@@ -339,10 +343,6 @@ sw {
};
};

-&r_ir {
- status = "okay";
-};
-
&rtc {
clocks = <&ext_osc32k>;
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
index 0d5f9aeb96d0..96635588e9a6 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
@@ -128,12 +128,20 @@ &pio {
vcc-pg-supply = <&reg_aldo1>;
};

-&r_i2c {
+&r_ir {
+ status = "okay";
+};
+
+&r_pio {
+ vcc-pm-supply = <&reg_bldo3>;
+};
+
+&r_rsb {
status = "okay";

- axp805: pmic@36 {
+ axp805: pmic@745 {
compatible = "x-powers,axp805", "x-powers,axp806";
- reg = <0x36>;
+ reg = <0x745>;
interrupt-parent = <&r_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
@@ -248,14 +256,6 @@ sw {
};
};

-&r_ir {
- status = "okay";
-};
-
-&r_pio {
- vcc-pm-supply = <&reg_bldo3>;
-};
-
&rtc {
clocks = <&ext_osc32k>;
};
--
2.26.2

Reply all
Reply to author
Forward
0 new messages