summaryrefslogtreecommitdiffstats
path: root/arm64-pinebook-fixes.patch
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2020-02-27 22:51:41 +0000
committerPeter Robinson <pbrobinson@gmail.com>2020-02-27 22:51:41 +0000
commit70c4f19642f3a196b01f22c9cc8e0629df609727 (patch)
tree437bc09cb1202d4a809d766b08d16e9c75708326 /arm64-pinebook-fixes.patch
parent55159bd6fe2fc50fc5c855759a9613a86155d57b (diff)
downloadkernel-70c4f19642f3a196b01f22c9cc8e0629df609727.tar.gz
kernel-70c4f19642f3a196b01f22c9cc8e0629df609727.tar.xz
kernel-70c4f19642f3a196b01f22c9cc8e0629df609727.zip
Fixes and enhancements to some AllWinner Pine64 devices
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Diffstat (limited to 'arm64-pinebook-fixes.patch')
-rw-r--r--arm64-pinebook-fixes.patch429
1 files changed, 429 insertions, 0 deletions
diff --git a/arm64-pinebook-fixes.patch b/arm64-pinebook-fixes.patch
new file mode 100644
index 000000000..410487293
--- /dev/null
+++ b/arm64-pinebook-fixes.patch
@@ -0,0 +1,429 @@
+From e7a6e6b0c6506a9f070dbfb2ca948770c47a1d78 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:30:57 -0600
+Subject: [PATCH 1/8] arm64: dts: allwinner: pinebook: Remove unused vcc3v3
+ regulator
+
+This fixed regulator has no consumers, GPIOs, or other connections.
+Remove it.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index 3d894b208901..ff32ca1a495e 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -63,13 +63,6 @@ lid_switch {
+ };
+ };
+
+- reg_vcc3v3: vcc3v3 {
+- compatible = "regulator-fixed";
+- regulator-name = "vcc3v3";
+- regulator-min-microvolt = <3300000>;
+- regulator-max-microvolt = <3300000>;
+- };
+-
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+--
+2.24.1
+
+From 5eea216437eeff908d6d2942bf893fb77ebfc111 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:30:59 -0600
+Subject: [PATCH 2/8] arm64: dts: allwinner: pinebook: Sort device tree nodes
+
+The r_i2c node should come before r_rsb, and in any case should not
+separate the axp803 node from its subnodes.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index ff32ca1a495e..77784f7b1da7 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -172,6 +172,14 @@ &pwm {
+ status = "okay";
+ };
+
++/* The ANX6345 eDP-bridge is on r_i2c */
++&r_i2c {
++ clock-frequency = <100000>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&r_i2c_pl89_pins>;
++ status = "okay";
++};
++
+ &r_rsb {
+ status = "okay";
+
+@@ -183,14 +191,6 @@ axp803: pmic@3a3 {
+ };
+ };
+
+-/* The ANX6345 eDP-bridge is on r_i2c */
+-&r_i2c {
+- clock-frequency = <100000>;
+- pinctrl-names = "default";
+- pinctrl-0 = <&r_i2c_pl89_pins>;
+- status = "okay";
+-};
+-
+ #include "axp803.dtsi"
+
+ &ac_power_supply {
+--
+2.24.1
+
+From 4bdf53ffc64e5c6738c942dcdc422d5ca8a2070a Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:31:00 -0600
+Subject: [PATCH 3/8] arm64: dts: allwinner: pinebook: Make simplefb more
+ consistent
+
+Boards generally reference the simplefb nodes from the SoC dtsi by
+label, not by full path. simplefb_hdmi is already like this in the
+Pinebook DTS. Update simplefb_lcd to match.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index 77784f7b1da7..224bed65d008 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -41,12 +41,6 @@ backlight: backlight {
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+-
+- framebuffer-lcd {
+- panel-supply = <&reg_dc1sw>;
+- dvdd25-supply = <&reg_dldo2>;
+- dvdd12-supply = <&reg_fldo1>;
+- };
+ };
+
+ gpio_keys {
+@@ -316,6 +310,12 @@ &reg_rtc_ldo {
+ regulator-name = "vcc-rtc";
+ };
+
++&simplefb_lcd {
++ panel-supply = <&reg_dc1sw>;
++ dvdd25-supply = <&reg_dldo2>;
++ dvdd12-supply = <&reg_fldo1>;
++};
++
+ &simplefb_hdmi {
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+--
+2.24.1
+
+From c0f416de7141bbc713f080ad123b256f6320ec92 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:31:01 -0600
+Subject: [PATCH 4/8] arm64: dts: allwinner: pinebook: Document MMC0 CD pin
+ name
+
+Normally GPIO pin references are followed by a comment giving the pin
+name for searchability. Add the comment here where it was missing.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index 224bed65d008..a1e15777d524 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -119,7 +119,7 @@ &mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins>;
+ vmmc-supply = <&reg_dcdc1>;
+- cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+ disable-wp;
+ bus-width = <4>;
+ status = "okay";
+--
+2.24.1
+
+From 8818d55ec31fa6e0dc14fb7a4924b3e8d3ecef7d Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:31:02 -0600
+Subject: [PATCH 5/8] arm64: dts: allwinner: pinebook: Add GPIO port regulators
+
+Allwinner A64 SoC has separate supplies for PC, PD, PE, PG and PL.
+
+VCC-PC and VCC-PG are supplied by ELDO1 at 1.8v.
+VCC-PD is supplied by DCDC1 (VCC-IO) at 3.3v.
+VCC-PE is supplied by ALDO1, and is unused.
+
+VCC-PL creates a circular dependency, so it is omitted for now.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index a1e15777d524..1ec39120323f 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -162,6 +162,13 @@ &ohci1 {
+ status = "okay";
+ };
+
++&pio {
++ vcc-pc-supply = <&reg_eldo1>;
++ vcc-pd-supply = <&reg_dcdc1>;
++ vcc-pe-supply = <&reg_aldo1>;
++ vcc-pg-supply = <&reg_eldo1>;
++};
++
+ &pwm {
+ status = "okay";
+ };
+@@ -174,6 +181,16 @@ &r_i2c {
+ 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_aldo2>;
++ */
++};
++
+ &r_rsb {
+ status = "okay";
+
+--
+2.24.1
+
+From bd863f25d41173e140850772f9a02ffb3b3e0d6b Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:31:03 -0600
+Subject: [PATCH 6/8] arm64: dts: allwinner: pinebook: Fix backlight regulator
+
+The output from the backlight regulator is labeled as "VBKLT" in the
+schematic. Using the equation and resistor values from the schematic,
+the output is approximately 18V, not 3.3V. Since the regulator in use
+(SS6640STR) is a boost regulator powered by PS (battery or AC input),
+which are both >3.3V, the output could not be 3.3V anyway.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../dts/allwinner/sun50i-a64-pinebook.dts | 20 +++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index 1ec39120323f..313f4e6edc19 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -21,22 +21,13 @@ aliases {
+ ethernet0 = &rtl8723cs;
+ };
+
+- vdd_bl: regulator@0 {
+- compatible = "regulator-fixed";
+- regulator-name = "bl-3v3";
+- regulator-min-microvolt = <3300000>;
+- regulator-max-microvolt = <3300000>;
+- gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+- enable-active-high;
+- };
+-
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pwms = <&pwm 0 50000 0>;
+ brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
+ default-brightness-level = <2>;
+ enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
+- power-supply = <&vdd_bl>;
++ power-supply = <&reg_vbklt>;
+ };
+
+ chosen {
+@@ -57,6 +48,15 @@ lid_switch {
+ };
+ };
+
++ reg_vbklt: vbklt {
++ compatible = "regulator-fixed";
++ regulator-name = "vbklt";
++ regulator-min-microvolt = <18000000>;
++ regulator-max-microvolt = <18000000>;
++ gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
++ enable-active-high;
++ };
++
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+--
+2.24.1
+
+From 425472eb612873c9c64b41df70020de58448bef3 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:31:04 -0600
+Subject: [PATCH 7/8] arm64: dts: allwinner: pinebook: Fix 5v0 boost regulator
+
+Now that AXP803 GPIO support is available, we can properly model
+the hardware. Replace the use of GPIO0-LDO with a fixed regulator
+controlled by GPIO0. This boost regulator is used to power the
+(internal and external) USB ports, as well as the speakers.
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../dts/allwinner/sun50i-a64-pinebook.dts | 27 +++++++++----------
+ 1 file changed, 12 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index 313f4e6edc19..c06c540e6c08 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -57,6 +57,15 @@ reg_vbklt: vbklt {
+ enable-active-high;
+ };
+
++ reg_vcc5v0: vcc5v0 {
++ compatible = "regulator-fixed";
++ regulator-name = "vcc5v0";
++ regulator-min-microvolt = <5000000>;
++ regulator-max-microvolt = <5000000>;
++ gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+@@ -64,12 +73,7 @@ wifi_pwrseq: wifi_pwrseq {
+
+ speaker_amp: audio-amplifier {
+ compatible = "simple-audio-amplifier";
+- /*
+- * TODO This is actually a fixed regulator controlled by
+- * the GPIO line on the PMIC. This should be corrected
+- * once GPIO support is added for this PMIC.
+- */
+- VCC-supply = <&reg_ldo_io0>;
++ VCC-supply = <&reg_vcc5v0>;
+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+ sound-name-prefix = "Speaker Amp";
+ };
+@@ -316,13 +320,6 @@ &reg_fldo2 {
+ regulator-name = "vdd-cpus";
+ };
+
+-&reg_ldo_io0 {
+- regulator-min-microvolt = <3300000>;
+- regulator-max-microvolt = <3300000>;
+- regulator-name = "vcc-usb";
+- status = "okay";
+-};
+-
+ &reg_rtc_ldo {
+ regulator-name = "vcc-rtc";
+ };
+@@ -371,7 +368,7 @@ &usb_otg {
+ };
+
+ &usbphy {
+- usb0_vbus-supply = <&reg_ldo_io0>;
+- usb1_vbus-supply = <&reg_ldo_io0>;
++ usb0_vbus-supply = <&reg_vcc5v0>;
++ usb1_vbus-supply = <&reg_vcc5v0>;
+ status = "okay";
+ };
+--
+2.24.1
+
+From c3aea4ea2117f5dc28da3d4175fc93296653ecd5 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 19 Jan 2020 10:30:58 -0600
+Subject: [PATCH 8/8] arm64: dts: allwinner: pinebook: Remove unused AXP803
+ regulators
+
+The Pinebook does not use the CSI bus on the A64. In fact it does not
+use GPIO port E for anything at all. Thus the following regulators are
+not used and do not need voltages set:
+
+ - ALDO1: Connected to VCC-PE only
+ - DLDO3: Not connected
+ - ELDO3: Not connected
+
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 16 +---------------
+ 1 file changed, 1 insertion(+), 15 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+index c06c540e6c08..12e513ba8f50 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+@@ -217,9 +217,7 @@ &battery_power_supply {
+ };
+
+ &reg_aldo1 {
+- regulator-min-microvolt = <2800000>;
+- regulator-max-microvolt = <2800000>;
+- regulator-name = "vcc-csi";
++ regulator-name = "vcc-pe";
+ };
+
+ &reg_aldo2 {
+@@ -282,12 +280,6 @@ &reg_dldo2 {
+ regulator-name = "vcc-edp";
+ };
+
+-&reg_dldo3 {
+- regulator-min-microvolt = <3300000>;
+- regulator-max-microvolt = <3300000>;
+- regulator-name = "avdd-csi";
+-};
+-
+ &reg_dldo4 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+@@ -301,12 +293,6 @@ &reg_eldo1 {
+ regulator-name = "cpvdd";
+ };
+
+-&reg_eldo3 {
+- regulator-min-microvolt = <1800000>;
+- regulator-max-microvolt = <1800000>;
+- regulator-name = "vdd-1v8-csi";
+-};
+-
+ &reg_fldo1 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+--
+2.24.1
+