linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for Pine64 PinePhone HW Revision 1.2
@ 2020-07-03 19:48 Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 1/3] dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings Ondrej Jirman
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ondrej Jirman @ 2020-07-03 19:48 UTC (permalink / raw)
  To: linux-sunxi, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Samuel Holland, Bhushan Shah,
	linux-kernel, Martijn Braam, Luca Weiss, devicetree,
	linux-arm-kernel, Icenowy Zheng

This series adds an initial support for Pine64 PinePhone 1.2.

The differences against 1.1 and 1.0 are larger. So far this
series describes the magnetometer interrupt that is wired
correctly on 1.2 and backlight differences.

There are also a lot of changes in how modem gpios are exposed,
and in HDMI/USB bridge and USB power in this revision. Those
will be expressed later, when the base dtsi gains support for
these things.

Please take a look.

thank you and regards,
  Ondrej Jirman

Ondrej Jirman (3):
  dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings
  arm64: dts: allwinner: Add support for PinePhone revision 1.2
  arm64: dts: sun50i-pinephone: dldo4 must not be >= 1.8V

 .../devicetree/bindings/arm/sunxi.yaml        |  5 +++
 arch/arm64/boot/dts/allwinner/Makefile        |  1 +
 .../allwinner/sun50i-a64-pinephone-1.2.dts    | 40 +++++++++++++++++++
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   |  4 +-
 4 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts

-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings
  2020-07-03 19:48 [PATCH 0/3] Add support for Pine64 PinePhone HW Revision 1.2 Ondrej Jirman
@ 2020-07-03 19:48 ` Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2 Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 3/3] arm64: dts: sun50i-pinephone: dldo4 must not be >= 1.8V Ondrej Jirman
  2 siblings, 0 replies; 5+ messages in thread
From: Ondrej Jirman @ 2020-07-03 19:48 UTC (permalink / raw)
  To: linux-sunxi, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Samuel Holland, Bhushan Shah,
	linux-kernel, Martijn Braam, Luca Weiss, devicetree,
	linux-arm-kernel, Icenowy Zheng

Document board compatible names for Pine64 PinePhone 1.2.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index 87817ff0cd35..efc9118233b4 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -657,6 +657,11 @@ properties:
           - const: pine64,pinephone-1.1
           - const: allwinner,sun50i-a64
 
+      - description: Pine64 PinePhone (1.2)
+        items:
+          - const: pine64,pinephone-1.2
+          - const: allwinner,sun50i-a64
+
       - description: Pine64 PineTab
         items:
           - const: pine64,pinetab
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2
  2020-07-03 19:48 [PATCH 0/3] Add support for Pine64 PinePhone HW Revision 1.2 Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 1/3] dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings Ondrej Jirman
@ 2020-07-03 19:48 ` Ondrej Jirman
  2020-07-06  5:13   ` Maxime Ripard
  2020-07-03 19:48 ` [PATCH 3/3] arm64: dts: sun50i-pinephone: dldo4 must not be >= 1.8V Ondrej Jirman
  2 siblings, 1 reply; 5+ messages in thread
From: Ondrej Jirman @ 2020-07-03 19:48 UTC (permalink / raw)
  To: linux-sunxi, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Samuel Holland, Bhushan Shah,
	linux-kernel, Martijn Braam, Luca Weiss, devicetree,
	linux-arm-kernel, Icenowy Zheng

Revision 1.2 should be the final production version of the PinePhone.
It has most of the known HW quirks fixed.

Interrupt to the magnetometer is routed correctly, in this revision.

The bulk of the changes are in how modem and the USB-C HDMI bridge
chip is powered and where the signals from the modem are connected.

Also backlight intensity seemingly behaves differently, than on the
1.1 and 1.0 boards, and the PWM duty cycle where backlight starts
to work is 10% (as tested on 2 1.2 PinePhones I have access to).

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |  1 +
 .../allwinner/sun50i-a64-pinephone-1.2.dts    | 40 +++++++++++++++++++
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   |  2 +-
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index e4d3cd0ac5bb..916d10d5b87c 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
new file mode 100644
index 000000000000..a9f5b670c9b8
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone.dtsi"
+
+/ {
+	model = "Pine64 PinePhone (1.2)";
+	compatible = "pine64,pinephone-1.2", "allwinner,sun50i-a64";
+};
+
+&backlight {
+	power-supply = <&reg_ldo_io0>;
+	/*
+	 * PWM backlight circuit on this PinePhone revision was changed since 1.0,
+	 * and the lowest PWM duty cycle that doesn't lead to backlight being off
+	 * is around 10%. Duty cycle for the lowest brightness level also varries
+	 * quite a bit between individual boards, so the lowest value here was
+	 * chosen as a safe default.
+	 */
+	brightness-levels = <
+		5000 5248 5506 5858 6345
+		6987 7805 8823 10062 11543
+		13287 15317 17654 20319 23336
+		26724 30505 34702 39335 44427
+		50000
+	>;
+	num-interpolated-steps = <50>;
+	default-brightness-level = <500>;
+};
+
+&lis3mdl {
+	/*
+	 * Board revision 1.2 fixed routing of the interrupt to DRDY pin,
+	 * enable interrupts.
+	 */
+	interrupt-parent = <&pio>;
+	interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index a3b400ff972b..904122711a89 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -142,7 +142,7 @@ &i2c1 {
 	status = "okay";
 
 	/* Magnetometer */
-	lis3mdl@1e {
+	lis3mdl: lis3mdl@1e {
 		compatible = "st,lis3mdl-magn";
 		reg = <0x1e>;
 		vdd-supply = <&reg_dldo1>;
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] arm64: dts: sun50i-pinephone: dldo4 must not be >= 1.8V
  2020-07-03 19:48 [PATCH 0/3] Add support for Pine64 PinePhone HW Revision 1.2 Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 1/3] dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings Ondrej Jirman
  2020-07-03 19:48 ` [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2 Ondrej Jirman
@ 2020-07-03 19:48 ` Ondrej Jirman
  2 siblings, 0 replies; 5+ messages in thread
From: Ondrej Jirman @ 2020-07-03 19:48 UTC (permalink / raw)
  To: linux-sunxi, Rob Herring, Maxime Ripard, Chen-Yu Tsai
  Cc: Ondrej Jirman, Mark Rutland, Samuel Holland, Bhushan Shah,
	linux-kernel, Martijn Braam, Luca Weiss, devicetree,
	linux-arm-kernel, Icenowy Zheng

Some outputs from the RTL8723CS are connected to the PL port (BT_WAKE_AP),
which runs at 1.8V. When BT_WAKE_AP is high, the PL pin this signal is
connected to is overdriven, and the whole PL port's voltage rises
somewhat. This results in changing voltage on the R_PWM pin (PL10),
which is the cause for backlight flickering very noticeably when typing
on a Bluetooth keyboard, because backlight intensity is highly sensitive
to the voltage of the R_PWM pin.

Limit the maximum WiFi/BT I/O voltage to 1.8V to avoid overdriving
the PL port pins via BT and WiFi IO port signals. WiFi and BT
functionality is unaffected by this change.

This completely stops the backlight flicker when using bluetooth.

Fixes: 91f480d40942 ("arm64: dts: allwinner: Add initial support for Pine64 PinePhone")
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 904122711a89..25150aba749d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -329,7 +329,7 @@ &reg_dldo3 {
 
 &reg_dldo4 {
 	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <3300000>;
+	regulator-max-microvolt = <1800000>;
 	regulator-name = "vcc-wifi-io";
 };
 
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2
  2020-07-03 19:48 ` [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2 Ondrej Jirman
@ 2020-07-06  5:13   ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2020-07-06  5:13 UTC (permalink / raw)
  To: Ondrej Jirman
  Cc: Mark Rutland, Luca Weiss, Samuel Holland, Bhushan Shah,
	Chen-Yu Tsai, linux-kernel, Martijn Braam, linux-sunxi,
	Rob Herring, linux-arm-kernel, devicetree, Icenowy Zheng


[-- Attachment #1.1: Type: text/plain, Size: 3911 bytes --]

Hi,

On Fri, Jul 03, 2020 at 09:48:41PM +0200, Ondrej Jirman wrote:
> Revision 1.2 should be the final production version of the PinePhone.
> It has most of the known HW quirks fixed.
> 
> Interrupt to the magnetometer is routed correctly, in this revision.
> 
> The bulk of the changes are in how modem and the USB-C HDMI bridge
> chip is powered and where the signals from the modem are connected.
> 
> Also backlight intensity seemingly behaves differently, than on the
> 1.1 and 1.0 boards, and the PWM duty cycle where backlight starts
> to work is 10% (as tested on 2 1.2 PinePhones I have access to).
> 
> Signed-off-by: Ondrej Jirman <megous@megous.com>
> ---
>  arch/arm64/boot/dts/allwinner/Makefile        |  1 +
>  .../allwinner/sun50i-a64-pinephone-1.2.dts    | 40 +++++++++++++++++++
>  .../dts/allwinner/sun50i-a64-pinephone.dtsi   |  2 +-
>  3 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> index e4d3cd0ac5bb..916d10d5b87c 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
> new file mode 100644
> index 000000000000..a9f5b670c9b8
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
> @@ -0,0 +1,40 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
> +
> +/dts-v1/;
> +
> +#include "sun50i-a64-pinephone.dtsi"
> +
> +/ {
> +	model = "Pine64 PinePhone (1.2)";
> +	compatible = "pine64,pinephone-1.2", "allwinner,sun50i-a64";
> +};
> +
> +&backlight {
> +	power-supply = <&reg_ldo_io0>;
> +	/*
> +	 * PWM backlight circuit on this PinePhone revision was changed since 1.0,
> +	 * and the lowest PWM duty cycle that doesn't lead to backlight being off
> +	 * is around 10%. Duty cycle for the lowest brightness level also varries
> +	 * quite a bit between individual boards, so the lowest value here was
> +	 * chosen as a safe default.
> +	 */
> +	brightness-levels = <
> +		5000 5248 5506 5858 6345
> +		6987 7805 8823 10062 11543
> +		13287 15317 17654 20319 23336
> +		26724 30505 34702 39335 44427
> +		50000
> +	>;
> +	num-interpolated-steps = <50>;
> +	default-brightness-level = <500>;
> +};
> +
> +&lis3mdl {
> +	/*
> +	 * Board revision 1.2 fixed routing of the interrupt to DRDY pin,
> +	 * enable interrupts.
> +	 */
> +	interrupt-parent = <&pio>;
> +	interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */
> +};
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> index a3b400ff972b..904122711a89 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> @@ -142,7 +142,7 @@ &i2c1 {
>  	status = "okay";
>  
>  	/* Magnetometer */
> -	lis3mdl@1e {
> +	lis3mdl: lis3mdl@1e {

I just applied all three patches, but the node name here is wrong and
should be the class of the device.

Can you send a follow-up patch renaming the node name to magnetometer?

Thanks!
Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-06  5:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 19:48 [PATCH 0/3] Add support for Pine64 PinePhone HW Revision 1.2 Ondrej Jirman
2020-07-03 19:48 ` [PATCH 1/3] dt-bindings: arm: sunxi: Add PinePhone 1.2 bindings Ondrej Jirman
2020-07-03 19:48 ` [PATCH 2/3] arm64: dts: allwinner: Add support for PinePhone revision 1.2 Ondrej Jirman
2020-07-06  5:13   ` Maxime Ripard
2020-07-03 19:48 ` [PATCH 3/3] arm64: dts: sun50i-pinephone: dldo4 must not be >= 1.8V Ondrej Jirman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).