Skip to contentSkip to conversation

Add support for Pine64 PinePhone Linux Smartphone

PATCH Applied Ondrej Jirman 2 participants 7 messages Feb 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Add support for Pine64 PinePhone Linux Smartphone

This series adds an initial support for Pine64 PinePhone.

Please take a look.

thank you and regards,
Ondrej Jirman

Changes in v2:
- make i2c2_pins default pinctrl config for i2c2 node
- add description of the differences between 1.0 and 1.1 to the commit message
- added copyright header for Martijn Braam
- drop pinctrl config from i2c1 and i2c2 nodes, since it's now the default
- extend comments on i2c2 and uart3 nodes to be more clear
- rebased on top of linux-next and resolved conflicts
- dropped the function-enumerator from leds

Changes not made:
- I didn't drop pinctrl configs on mmc0, mmc2 and uart3
- these are actually not default in dtsi, as was suggested
- gpio-leds kept with the new function/color binding, but I dropped the function-enumerator

It seems intention for the future (since about 06-2019[0]) is for LEDs to not have a devicename in their class name, because that's determinable from the sysfs in other ways, and to use the function and color properties instead of label in DT.

[0] https://lore.kernel.org/lkml/[email protected]/T/

function-enumerator is supposed to be used if function/color don't make the LED name unique for the board. [1] So I dropped function-enumerator from my series, as it just added a numeric suffix to the LED name for no reason.

[1] https://lore.kernel.org/patchwork/patch/1063388/

This follow the recent new board binding additions to the kernel (in 5.6):

https://elixir.bootlin.com/linux/v5.6-rc3/source/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi#L96

Ondrej Jirman (3):
arm64: dts: sun50i-a64: Add i2c2 pins
dt-bindings: arm: sunxi: Add PinePhone 1.0 and 1.1 bindings
arm64: dts: allwinner: Add initial support for Pine64 PinePhone

 .../devicetree/bindings/arm/sunxi.yaml        |  10 +
 arch/arm64/boot/dts/allwinner/Makefile        |   2 +
 .../allwinner/sun50i-a64-pinephone-1.0.dts    |  11 +
 .../allwinner/sun50i-a64-pinephone-1.1.dts    |  11 +
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   | 379 ++++++++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |   8 +-
 6 files changed, 420 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/3 arm64: dts: sun50i-a64: Add i2c2 pins

PinePhone needs I2C2 pins description. Add it, and make it default for i2c2, since it's the only possiblilty.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +7 -1
index 72b1b34879c6d..990de71ca048a 100644
@@ -671,6 +671,11 @@ i2c1_pins: i2c1-pins {
 				function = "i2c1";
 			};
 
+			i2c2_pins: i2c2-pins {
+				pins = "PE14", "PE15";
+				function = "i2c2";
+			};
+
 			/omit-if-no-ref/
 			lcd_rgb666_pins: lcd-rgb666-pins {
 				pins = "PD0", "PD1", "PD2", "PD3", "PD4",
@@ -958,12 +963,13 @@ i2c2: i2c@1c2b400 {
 			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C2>;
 			resets = <&ccu RST_BUS_I2C2>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c2_pins>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
 		};
 
-
 		spi0: spi@1c68000 {
 			compatible = "allwinner,sun8i-h3-spi";
 			reg = <0x01c68000 0x1000>;
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/3 dt-bindings: arm: sunxi: Add PinePhone 1.0 and 1.1 bindings

In reply to Ondrej Jirman

Document board compatible names for Pine64 PinePhone:

- 1.0 - Developer variant
- 1.1 - Braveheart variant

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +10 -0
index 5b22b77e4bb73..abf2d97fb7ae3 100644
@@ -642,6 +642,16 @@ properties:
           - const: pine64,pinebook
           - const: allwinner,sun50i-a64
 
+      - description: Pine64 PinePhone Developer Batch (1.0)
+        items:
+          - const: pine64,pinephone-1.0
+          - const: allwinner,sun50i-a64
+
+      - description: Pine64 PinePhone Braveheart (1.1)
+        items:
+          - const: pine64,pinephone-1.1
+          - const: allwinner,sun50i-a64
+
       - description: Pine64 PineTab
         items:
           - const: pine64,pinetab
Signature · 1 line
2.25.1
author Reviewed-by Rob Herring on v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] dt-bindings: arm: sunxi: Add PinePhone 1.0 and 1.1 bindings

Hello,

Quoted 6 lines · megous hlavni

Document board compatible names for Pine64 PinePhone:

- 1.0 - Developer variant
- 1.1 - Braveheart variant

This also got:

short time ago on v1. I didn't catch that before sending v2 out.

regards,

	o.
Quoted 28 lines
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +10 -0
index 5b22b77e4bb73..abf2d97fb7ae3 100644
@@ -642,6 +642,16 @@ properties:
           - const: pine64,pinebook
           - const: allwinner,sun50i-a64
 
+      - description: Pine64 PinePhone Developer Batch (1.0)
+        items:
+          - const: pine64,pinephone-1.0
+          - const: allwinner,sun50i-a64
+
+      - description: Pine64 PinePhone Braveheart (1.1)
+        items:
+          - const: pine64,pinephone-1.1
+          - const: allwinner,sun50i-a64
+
       - description: Pine64 PineTab
         items:
           - const: pine64,pinetab
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 3/3 arm64: dts: allwinner: Add initial support for Pine64 PinePhone

In reply to Ondrej Jirman

At the moment PinePhone comes in two slightly incompatible variants:

- 1.0: Early Developer Batch
- 1.1: Braveheart Batch

There will be at least one more incompatible variant in the very near future, so let's start by sharing the dtsi among multiple variants, right away, even though the HW description doesn't yet include the different bits.

The differences between 1.0 and 1.1 are: change in pins that control the flash LED, differences in modem power status signal routing, and maybe some other subtler things, that have not been determined yet.

This is a basic DT that includes only features that are already supported by mainline drivers.

---
 arch/arm64/boot/dts/allwinner/Makefile        |   2 +
 .../allwinner/sun50i-a64-pinephone-1.0.dts    |  11 +
 .../allwinner/sun50i-a64-pinephone-1.1.dts    |  11 +
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   | 379 ++++++++++++++++++
 4 files changed, 403 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
arch/arm64/boot/dts/allwinner/Makefile +2 -0
index 6dad63881cd3a..e4d3cd0ac5bb7 100644
@@ -9,6 +9,8 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-lts.dtb
 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-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts new file +11 -0
new file mode 100644
index 0000000000000..0c42272106afa
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <[email protected]>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone.dtsi"
+
+/ {
+	model = "Pine64 PinePhone Developer Batch (1.0)";
+	compatible = "pine64,pinephone-1.0", "allwinner,sun50i-a64";
+};
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts new file +11 -0
new file mode 100644
index 0000000000000..06a775c41664b
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <[email protected]>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone.dtsi"
+
+/ {
+	model = "Pine64 PinePhone Braveheart (1.1)";
+	compatible = "pine64,pinephone-1.1", "allwinner,sun50i-a64";
+};
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi new file +379 -0

379 lines not on this page · raw message

Signature · 1 line
2.25.1
#5 lore raw
In reply to Ondrej Jirman
Quoted 6 lines · Ondrej Jirman

This series adds an initial support for Pine64 PinePhone.

Please take a look.

thank you and regards,
Ondrej Jirman

Applied all three, thanks

Maxime

#6 lore raw
Quoted 9 lines · Maxime Ripard
Quoted 6 lines · Ondrej Jirman

This series adds an initial support for Pine64 PinePhone.

Please take a look.

thank you and regards,
Ondrej Jirman

Applied all three, thanks

Thank you too! :)

regards,

	o.
Quoted 1 line

Maxime