All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: allwinner: a64: Add initial support for Pinebook
@ 2018-06-06  5:16 ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:16 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, linux-arm-kernel, devicetree
  Cc: Vasily Khoruzhick

This series adds dts for Pinebook with few prerequisites - PWM and R_I2C
devices nodes.

v2: - add my signoff
    - add default pinmux option for PWM
    - add alternate pinmux option for R_I2C controller
    - add A64 compatible for R_I2C controller

Andre Przywara (1):
  arm64: dts: allwinner: a64: Add PWM controllers

Icenowy Zheng (2):
  arm64: dts: allwinner: a64: add R_I2C controller
  arm64: dts: allwinner: add support for Pinebook

 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |  56 ++++
 3 files changed, 337 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts

-- 
2.17.1

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

* [PATCH v2 0/3] arm64: allwinner: a64: Add initial support for Pinebook
@ 2018-06-06  5:16 ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:16 UTC (permalink / raw)
  To: linux-arm-kernel

This series adds dts for Pinebook with few prerequisites - PWM and R_I2C
devices nodes.

v2: - add my signoff
    - add default pinmux option for PWM
    - add alternate pinmux option for R_I2C controller
    - add A64 compatible for R_I2C controller

Andre Przywara (1):
  arm64: dts: allwinner: a64: Add PWM controllers

Icenowy Zheng (2):
  arm64: dts: allwinner: a64: add R_I2C controller
  arm64: dts: allwinner: add support for Pinebook

 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |  56 ++++
 3 files changed, 337 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts

-- 
2.17.1

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

* [PATCH v2 1/3] arm64: dts: allwinner: a64: add R_I2C controller
  2018-06-06  5:16 ` Vasily Khoruzhick
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, linux-arm-kernel, devicetree
  Cc: Vasily Khoruzhick, Icenowy Zheng

From: Icenowy Zheng <icenowy@aosc.io>

Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has
two groups of pinmuxes on PL bank, so it's called R_I2C.

Add support for this I2C controller and the pinmux which doesn't conflict
with RSB.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 1b2ef28c42bd..dcf957b2e7c8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -46,6 +46,7 @@
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-r-ccu.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -655,6 +656,18 @@
 			#reset-cells = <1>;
 		};
 
+		r_i2c: i2c@1f02400 {
+			compatible = "allwinner,sun50i-a64-i2c",
+				     "allwinner,sun6i-a31-i2c";
+			reg = <0x01f02400 0x400>;
+			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&r_ccu CLK_APB0_I2C>;
+			resets = <&r_ccu RST_APB0_I2C>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		r_pio: pinctrl@1f02c00 {
 			compatible = "allwinner,sun50i-a64-r-pinctrl";
 			reg = <0x01f02c00 0x400>;
@@ -666,6 +679,17 @@
 			interrupt-controller;
 			#interrupt-cells = <3>;
 
+
+			r_i2c_pins: i2c {
+				pins = "PL0", "PL1";
+				function = "s_i2c";
+			};
+
+			r_i2c_pins_a: i2c-a {
+				pins = "PL8", "PL9";
+				function = "s_i2c";
+			};
+
 			r_rsb_pins: rsb {
 				pins = "PL0", "PL1";
 				function = "s_rsb";
-- 
2.17.1

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

* [PATCH v2 1/3] arm64: dts: allwinner: a64: add R_I2C controller
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Icenowy Zheng <icenowy@aosc.io>

Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has
two groups of pinmuxes on PL bank, so it's called R_I2C.

Add support for this I2C controller and the pinmux which doesn't conflict
with RSB.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 1b2ef28c42bd..dcf957b2e7c8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -46,6 +46,7 @@
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-r-ccu.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -655,6 +656,18 @@
 			#reset-cells = <1>;
 		};
 
+		r_i2c: i2c at 1f02400 {
+			compatible = "allwinner,sun50i-a64-i2c",
+				     "allwinner,sun6i-a31-i2c";
+			reg = <0x01f02400 0x400>;
+			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&r_ccu CLK_APB0_I2C>;
+			resets = <&r_ccu RST_APB0_I2C>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		r_pio: pinctrl at 1f02c00 {
 			compatible = "allwinner,sun50i-a64-r-pinctrl";
 			reg = <0x01f02c00 0x400>;
@@ -666,6 +679,17 @@
 			interrupt-controller;
 			#interrupt-cells = <3>;
 
+
+			r_i2c_pins: i2c {
+				pins = "PL0", "PL1";
+				function = "s_i2c";
+			};
+
+			r_i2c_pins_a: i2c-a {
+				pins = "PL8", "PL9";
+				function = "s_i2c";
+			};
+
 			r_rsb_pins: rsb {
 				pins = "PL0", "PL1";
 				function = "s_rsb";
-- 
2.17.1

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

* [PATCH v2 2/3] arm64: dts: allwinner: a64: Add PWM controllers
  2018-06-06  5:16 ` Vasily Khoruzhick
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, linux-arm-kernel, devicetree
  Cc: Vasily Khoruzhick, Andre Przywara

From: Andre Przywara <andre.przywara@arm.com>

The Allwinner A64 SoC features two PWM controllers, which are fully
compatible to the one used in the A13 and H3 chips.

Add the nodes for the devices (one for the "normal" PWM, the other for
the one in the CPUS domain) and the pins their outputs are connected to.

On the A64 the "normal" PWM is muxed together with one of the MDIO pins
used to communicate with the Ethernet PHY, so it won't be usable on many
boards. But the Pinebook laptop uses this pin for controlling the LCD
backlight.

On Pine64 the CPUS PWM pin however is routed to the "RPi2" header,
at the same location as the PWM pin on the RaspberryPi.

Tested on Pinebook and Teres-I

[vasily: fixed comment message as requested by Stefan Bruens, added default
         muxing options to pwm and r_pwm nodes]

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Harald Geyer <harald@ccbib.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index dcf957b2e7c8..360bb1a4a504 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -365,6 +365,11 @@
 				bias-pull-up;
 			};
 
+			pwm_pin: pwm_pin {
+				pins = "PD22";
+				function = "pwm";
+			};
+
 			rmii_pins: rmii_pins {
 				pins = "PD10", "PD11", "PD13", "PD14", "PD17",
 				       "PD18", "PD19", "PD20", "PD22", "PD23";
@@ -630,6 +635,17 @@
 			#interrupt-cells = <3>;
 		};
 
+		pwm: pwm@1c21400 {
+			compatible = "allwinner,sun50i-a64-pwm",
+				     "allwinner,sun5i-a13-pwm";
+			reg = <0x01c21400 0x400>;
+			clocks = <&osc24M>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pwm_pin>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		rtc: rtc@1f00000 {
 			compatible = "allwinner,sun6i-a31-rtc";
 			reg = <0x01f00000 0x54>;
@@ -668,6 +684,17 @@
 			#size-cells = <0>;
 		};
 
+		r_pwm: pwm@1f03800 {
+			compatible = "allwinner,sun50i-a64-pwm",
+				     "allwinner,sun5i-a13-pwm";
+			reg = <0x01f03800 0x400>;
+			clocks = <&osc24M>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&r_pwm_pin>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		r_pio: pinctrl@1f02c00 {
 			compatible = "allwinner,sun50i-a64-r-pinctrl";
 			reg = <0x01f02c00 0x400>;
@@ -690,6 +717,11 @@
 				function = "s_i2c";
 			};
 
+			r_pwm_pin: pwm {
+				pins = "PL10";
+				function = "s_pwm";
+			};
+
 			r_rsb_pins: rsb {
 				pins = "PL0", "PL1";
 				function = "s_rsb";
-- 
2.17.1

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

* [PATCH v2 2/3] arm64: dts: allwinner: a64: Add PWM controllers
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andre Przywara <andre.przywara@arm.com>

The Allwinner A64 SoC features two PWM controllers, which are fully
compatible to the one used in the A13 and H3 chips.

Add the nodes for the devices (one for the "normal" PWM, the other for
the one in the CPUS domain) and the pins their outputs are connected to.

On the A64 the "normal" PWM is muxed together with one of the MDIO pins
used to communicate with the Ethernet PHY, so it won't be usable on many
boards. But the Pinebook laptop uses this pin for controlling the LCD
backlight.

On Pine64 the CPUS PWM pin however is routed to the "RPi2" header,
at the same location as the PWM pin on the RaspberryPi.

Tested on Pinebook and Teres-I

[vasily: fixed comment message as requested by Stefan Bruens, added default
         muxing options to pwm and r_pwm nodes]

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Harald Geyer <harald@ccbib.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index dcf957b2e7c8..360bb1a4a504 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -365,6 +365,11 @@
 				bias-pull-up;
 			};
 
+			pwm_pin: pwm_pin {
+				pins = "PD22";
+				function = "pwm";
+			};
+
 			rmii_pins: rmii_pins {
 				pins = "PD10", "PD11", "PD13", "PD14", "PD17",
 				       "PD18", "PD19", "PD20", "PD22", "PD23";
@@ -630,6 +635,17 @@
 			#interrupt-cells = <3>;
 		};
 
+		pwm: pwm at 1c21400 {
+			compatible = "allwinner,sun50i-a64-pwm",
+				     "allwinner,sun5i-a13-pwm";
+			reg = <0x01c21400 0x400>;
+			clocks = <&osc24M>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pwm_pin>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		rtc: rtc at 1f00000 {
 			compatible = "allwinner,sun6i-a31-rtc";
 			reg = <0x01f00000 0x54>;
@@ -668,6 +684,17 @@
 			#size-cells = <0>;
 		};
 
+		r_pwm: pwm at 1f03800 {
+			compatible = "allwinner,sun50i-a64-pwm",
+				     "allwinner,sun5i-a13-pwm";
+			reg = <0x01f03800 0x400>;
+			clocks = <&osc24M>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&r_pwm_pin>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		r_pio: pinctrl at 1f02c00 {
 			compatible = "allwinner,sun50i-a64-r-pinctrl";
 			reg = <0x01f02c00 0x400>;
@@ -690,6 +717,11 @@
 				function = "s_i2c";
 			};
 
+			r_pwm_pin: pwm {
+				pins = "PL10";
+				function = "s_pwm";
+			};
+
 			r_rsb_pins: rsb {
 				pins = "PL0", "PL1";
 				function = "s_rsb";
-- 
2.17.1

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

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
  2018-06-06  5:16 ` Vasily Khoruzhick
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, linux-arm-kernel, devicetree
  Cc: Vasily Khoruzhick, Icenowy Zheng

From: Icenowy Zheng <icenowy@aosc.xyz>

Pinebook is a A64-based laptop produced by Pine64, with the following
peripherals:

USB:
- Two external USB ports (one is directly connected to A64's OTG
controller, the other is under a internal hub connected to the host-only
controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.

Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.

Storage:
- An eMMC by Foresee on the main board (in the product revision of the
main board it's designed to be switchable).
- An external MicroSD card slot.

Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.

Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.

This commit adds basical support for it.

[vasily: squashed several commits into one, added simplefb node, added usbphy
	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
 2 files changed, 281 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 8bebe7da5ed9..a8c6d0c6f2c5 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
new file mode 100644
index 000000000000..58253d6f9be1
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -0,0 +1,280 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
+ *
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+	model = "Pinebook";
+	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
+
+	aliases {
+		serial0 = &uart0;
+		ethernet0 = &rtl8723cs;
+	};
+
+	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 */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+
+		framebuffer-lcd {
+			panel-supply = <&reg_dc1sw>;
+			dvdd25-supply = <&reg_dldo2>;
+			dvdd12-supply = <&reg_fldo1>;
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+
+		lid_switch {
+			label = "Lid Switch";
+			gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+		};
+	};
+
+	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 */
+	};
+};
+
+&ehci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
+	cd-inverted;
+	disable-wp;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dldo4>;
+	vqmmc-supply = <&reg_eldo1>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8723cs: wifi@1 {
+		reg = <1>;
+	};
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_eldo1>;
+	bus-width = <8>;
+	non-removable;
+	cap-mmc-hw-reset;
+	mmc-hs200-1_8v;
+	status = "okay";
+};
+
+&ohci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&pwm {
+	status = "okay";
+};
+
+&r_rsb {
+	status = "okay";
+
+	axp803: pmic@3a3 {
+		compatible = "x-powers,axp803";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+/* The ANX6345 eDP-bridge is on r_i2c */
+&r_i2c {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&r_i2c_pins_a>;
+	status = "okay";
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo1 {
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-name = "vcc-csi";
+};
+
+&reg_aldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+	regulator-always-on;
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dc1sw {
+	regulator-name = "vcc-lcd";
+};
+
+&reg_dcdc1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+	regulator-always-on;
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-hdmi";
+};
+
+&reg_dldo2 {
+	regulator-min-microvolt = <2500000>;
+	regulator-max-microvolt = <2500000>;
+	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>;
+	regulator-name = "vcc-wifi";
+};
+
+&reg_eldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	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>;
+	regulator-name = "vcc-1v2-hsic";
+};
+
+&reg_fldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	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";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "host";
+};
+
+&usbphy {
+	usb0_vbus-supply = <&reg_ldo_io0>;
+	usb1_vbus-supply = <&reg_ldo_io0>;
+	status = "okay";
+};
-- 
2.17.1

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

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
@ 2018-06-06  5:17   ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Icenowy Zheng <icenowy@aosc.xyz>

Pinebook is a A64-based laptop produced by Pine64, with the following
peripherals:

USB:
- Two external USB ports (one is directly connected to A64's OTG
controller, the other is under a internal hub connected to the host-only
controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.

Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.

Storage:
- An eMMC by Foresee on the main board (in the product revision of the
main board it's designed to be switchable).
- An external MicroSD card slot.

Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.

Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.

This commit adds basical support for it.

[vasily: squashed several commits into one, added simplefb node, added usbphy
	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
 2 files changed, 281 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 8bebe7da5ed9..a8c6d0c6f2c5 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
new file mode 100644
index 000000000000..58253d6f9be1
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -0,0 +1,280 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
+ *
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+	model = "Pinebook";
+	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
+
+	aliases {
+		serial0 = &uart0;
+		ethernet0 = &rtl8723cs;
+	};
+
+	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 */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+
+		framebuffer-lcd {
+			panel-supply = <&reg_dc1sw>;
+			dvdd25-supply = <&reg_dldo2>;
+			dvdd12-supply = <&reg_fldo1>;
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+
+		lid_switch {
+			label = "Lid Switch";
+			gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+		};
+	};
+
+	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 */
+	};
+};
+
+&ehci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
+	cd-inverted;
+	disable-wp;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dldo4>;
+	vqmmc-supply = <&reg_eldo1>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8723cs: wifi at 1 {
+		reg = <1>;
+	};
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_eldo1>;
+	bus-width = <8>;
+	non-removable;
+	cap-mmc-hw-reset;
+	mmc-hs200-1_8v;
+	status = "okay";
+};
+
+&ohci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&pwm {
+	status = "okay";
+};
+
+&r_rsb {
+	status = "okay";
+
+	axp803: pmic at 3a3 {
+		compatible = "x-powers,axp803";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+/* The ANX6345 eDP-bridge is on r_i2c */
+&r_i2c {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&r_i2c_pins_a>;
+	status = "okay";
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo1 {
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-name = "vcc-csi";
+};
+
+&reg_aldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+	regulator-always-on;
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dc1sw {
+	regulator-name = "vcc-lcd";
+};
+
+&reg_dcdc1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+	regulator-always-on;
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-hdmi";
+};
+
+&reg_dldo2 {
+	regulator-min-microvolt = <2500000>;
+	regulator-max-microvolt = <2500000>;
+	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>;
+	regulator-name = "vcc-wifi";
+};
+
+&reg_eldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	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>;
+	regulator-name = "vcc-1v2-hsic";
+};
+
+&reg_fldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	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";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "host";
+};
+
+&usbphy {
+	usb0_vbus-supply = <&reg_ldo_io0>;
+	usb1_vbus-supply = <&reg_ldo_io0>;
+	status = "okay";
+};
-- 
2.17.1

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

* Re: [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
  2018-06-06  5:17   ` Vasily Khoruzhick
@ 2018-06-06  5:20     ` Icenowy Zheng
  -1 siblings, 0 replies; 20+ messages in thread
From: Icenowy Zheng @ 2018-06-06  5:20 UTC (permalink / raw)
  To: linux-arm-kernel, Vasily Khoruzhick, Maxime Ripard, Chen-Yu Tsai,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	devicetree
  Cc: Icenowy Zheng



于 2018年6月6日 GMT+08:00 下午1:17:02, Vasily Khoruzhick <anarsoul@gmail.com> 写到:
>From: Icenowy Zheng <icenowy@aosc.xyz>

Could you change all the mail address to @aosc.io ?

>
>Pinebook is a A64-based laptop produced by Pine64, with the following
>peripherals:
>
>USB:
>- Two external USB ports (one is directly connected to A64's OTG
>controller, the other is under a internal hub connected to the
>host-only
>controller.)
>- USB HID keyboard and touchpad connected to the internal hub.
>- USB UVC camera connected to the internal hub.
>
>Power-related:
>- A DC IN jack connected to AXP803's DCIN pin.
>- A Li-Polymer battery connected to AXP803's battery pins.
>
>Storage:
>- An eMMC by Foresee on the main board (in the product revision of the
>main board it's designed to be switchable).
>- An external MicroSD card slot.
>
>Display:
>- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
>- A mini HDMI port.
>
>Misc:
>- A Hall sensor designed to detect the status of lid, connected to GPIO
>PL12.
>- A headphone jack connected to the SoC's internal codec.
>- A debug UART port muxed with headphone jack.
>
>This commit adds basical support for it.
>
>[vasily: squashed several commits into one, added simplefb node, added
>usbphy
>	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]
>
>Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>---
> arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
> 2 files changed, 281 insertions(+)
>create mode 100644
>arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>
>diff --git a/arch/arm64/boot/dts/allwinner/Makefile
>b/arch/arm64/boot/dts/allwinner/Makefile
>index 8bebe7da5ed9..a8c6d0c6f2c5 100644
>--- a/arch/arm64/boot/dts/allwinner/Makefile
>+++ b/arch/arm64/boot/dts/allwinner/Makefile
>@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
>diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>new file mode 100644
>index 000000000000..58253d6f9be1
>--- /dev/null
>+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>@@ -0,0 +1,280 @@
>+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>+/*
>+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
>+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
>+ *
>+ */
>+
>+/dts-v1/;
>+
>+#include "sun50i-a64.dtsi"
>+
>+#include <dt-bindings/gpio/gpio.h>
>+#include <dt-bindings/input/input.h>
>+#include <dt-bindings/pwm/pwm.h>
>+
>+/ {
>+	model = "Pinebook";
>+	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
>+
>+	aliases {
>+		serial0 = &uart0;
>+		ethernet0 = &rtl8723cs;
>+	};
>+
>+	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 */
>+	};
>+
>+	chosen {
>+		stdout-path = "serial0:115200n8";
>+
>+		framebuffer-lcd {
>+			panel-supply = <&reg_dc1sw>;
>+			dvdd25-supply = <&reg_dldo2>;
>+			dvdd12-supply = <&reg_fldo1>;
>+		};
>+	};
>+
>+	gpio_keys {
>+		compatible = "gpio-keys";
>+
>+		lid_switch {
>+			label = "Lid Switch";
>+			gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
>+			linux,input-type = <EV_SW>;
>+			linux,code = <SW_LID>;
>+			linux,can-disable;
>+		};
>+	};
>+
>+	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 */
>+	};
>+};
>+
>+&ehci0 {
>+	phys = <&usbphy 0>;
>+	phy-names = "usb";
>+	status = "okay";
>+};
>+
>+&ehci1 {
>+	status = "okay";
>+};
>+
>+&mmc0 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc0_pins>;
>+	vmmc-supply = <&reg_dcdc1>;
>+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
>+	cd-inverted;
>+	disable-wp;
>+	bus-width = <4>;
>+	status = "okay";
>+};
>+
>+&mmc1 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc1_pins>;
>+	vmmc-supply = <&reg_dldo4>;
>+	vqmmc-supply = <&reg_eldo1>;
>+	mmc-pwrseq = <&wifi_pwrseq>;
>+	bus-width = <4>;
>+	non-removable;
>+	status = "okay";
>+
>+	rtl8723cs: wifi@1 {
>+		reg = <1>;
>+	};
>+};
>+
>+&mmc2 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc2_pins>;
>+	vmmc-supply = <&reg_dcdc1>;
>+	vqmmc-supply = <&reg_eldo1>;
>+	bus-width = <8>;
>+	non-removable;
>+	cap-mmc-hw-reset;
>+	mmc-hs200-1_8v;
>+	status = "okay";
>+};
>+
>+&ohci0 {
>+	phys = <&usbphy 0>;
>+	phy-names = "usb";
>+	status = "okay";
>+};
>+
>+&ohci1 {
>+	status = "okay";
>+};
>+
>+&pwm {
>+	status = "okay";
>+};
>+
>+&r_rsb {
>+	status = "okay";
>+
>+	axp803: pmic@3a3 {
>+		compatible = "x-powers,axp803";
>+		reg = <0x3a3>;
>+		interrupt-parent = <&r_intc>;
>+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>+	};
>+};
>+
>+/* The ANX6345 eDP-bridge is on r_i2c */
>+&r_i2c {
>+	clock-frequency = <100000>;
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&r_i2c_pins_a>;
>+	status = "okay";
>+};
>+
>+#include "axp803.dtsi"
>+
>+&reg_aldo1 {
>+	regulator-min-microvolt = <2800000>;
>+	regulator-max-microvolt = <2800000>;
>+	regulator-name = "vcc-csi";
>+};
>+
>+&reg_aldo2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1800000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-pl";
>+};
>+
>+&reg_aldo3 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <2700000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-pll-avcc";
>+};
>+
>+&reg_dc1sw {
>+	regulator-name = "vcc-lcd";
>+};
>+
>+&reg_dcdc1 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <3300000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-3v3";
>+};
>+
>+&reg_dcdc2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1000000>;
>+	regulator-max-microvolt = <1300000>;
>+	regulator-name = "vdd-cpux";
>+};
>+
>+/* DCDC3 is polyphased with DCDC2 */
>+
>+&reg_dcdc5 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1200000>;
>+	regulator-max-microvolt = <1200000>;
>+	regulator-name = "vcc-dram";
>+};
>+
>+&reg_dcdc6 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1100000>;
>+	regulator-max-microvolt = <1100000>;
>+	regulator-name = "vdd-sys";
>+};
>+
>+&reg_dldo1 {
>+	regulator-min-microvolt = <3300000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-hdmi";
>+};
>+
>+&reg_dldo2 {
>+	regulator-min-microvolt = <2500000>;
>+	regulator-max-microvolt = <2500000>;
>+	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>;
>+	regulator-name = "vcc-wifi";
>+};
>+
>+&reg_eldo1 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1800000>;
>+	regulator-max-microvolt = <1800000>;
>+	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>;
>+	regulator-name = "vcc-1v2-hsic";
>+};
>+
>+&reg_fldo2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1100000>;
>+	regulator-max-microvolt = <1100000>;
>+	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";
>+};
>+
>+&uart0 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&uart0_pins_a>;
>+	status = "okay";
>+};
>+
>+&usb_otg {
>+	dr_mode = "host";
>+};
>+
>+&usbphy {
>+	usb0_vbus-supply = <&reg_ldo_io0>;
>+	usb1_vbus-supply = <&reg_ldo_io0>;
>+	status = "okay";
>+};

_______________________________________________
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] 20+ messages in thread

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
@ 2018-06-06  5:20     ` Icenowy Zheng
  0 siblings, 0 replies; 20+ messages in thread
From: Icenowy Zheng @ 2018-06-06  5:20 UTC (permalink / raw)
  To: linux-arm-kernel



? 2018?6?6? GMT+08:00 ??1:17:02, Vasily Khoruzhick <anarsoul@gmail.com> ??:
>From: Icenowy Zheng <icenowy@aosc.xyz>

Could you change all the mail address to @aosc.io ?

>
>Pinebook is a A64-based laptop produced by Pine64, with the following
>peripherals:
>
>USB:
>- Two external USB ports (one is directly connected to A64's OTG
>controller, the other is under a internal hub connected to the
>host-only
>controller.)
>- USB HID keyboard and touchpad connected to the internal hub.
>- USB UVC camera connected to the internal hub.
>
>Power-related:
>- A DC IN jack connected to AXP803's DCIN pin.
>- A Li-Polymer battery connected to AXP803's battery pins.
>
>Storage:
>- An eMMC by Foresee on the main board (in the product revision of the
>main board it's designed to be switchable).
>- An external MicroSD card slot.
>
>Display:
>- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
>- A mini HDMI port.
>
>Misc:
>- A Hall sensor designed to detect the status of lid, connected to GPIO
>PL12.
>- A headphone jack connected to the SoC's internal codec.
>- A debug UART port muxed with headphone jack.
>
>This commit adds basical support for it.
>
>[vasily: squashed several commits into one, added simplefb node, added
>usbphy
>	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]
>
>Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>---
> arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
> 2 files changed, 281 insertions(+)
>create mode 100644
>arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>
>diff --git a/arch/arm64/boot/dts/allwinner/Makefile
>b/arch/arm64/boot/dts/allwinner/Makefile
>index 8bebe7da5ed9..a8c6d0c6f2c5 100644
>--- a/arch/arm64/boot/dts/allwinner/Makefile
>+++ b/arch/arm64/boot/dts/allwinner/Makefile
>@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
>diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>new file mode 100644
>index 000000000000..58253d6f9be1
>--- /dev/null
>+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>@@ -0,0 +1,280 @@
>+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>+/*
>+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
>+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
>+ *
>+ */
>+
>+/dts-v1/;
>+
>+#include "sun50i-a64.dtsi"
>+
>+#include <dt-bindings/gpio/gpio.h>
>+#include <dt-bindings/input/input.h>
>+#include <dt-bindings/pwm/pwm.h>
>+
>+/ {
>+	model = "Pinebook";
>+	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
>+
>+	aliases {
>+		serial0 = &uart0;
>+		ethernet0 = &rtl8723cs;
>+	};
>+
>+	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 */
>+	};
>+
>+	chosen {
>+		stdout-path = "serial0:115200n8";
>+
>+		framebuffer-lcd {
>+			panel-supply = <&reg_dc1sw>;
>+			dvdd25-supply = <&reg_dldo2>;
>+			dvdd12-supply = <&reg_fldo1>;
>+		};
>+	};
>+
>+	gpio_keys {
>+		compatible = "gpio-keys";
>+
>+		lid_switch {
>+			label = "Lid Switch";
>+			gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
>+			linux,input-type = <EV_SW>;
>+			linux,code = <SW_LID>;
>+			linux,can-disable;
>+		};
>+	};
>+
>+	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 */
>+	};
>+};
>+
>+&ehci0 {
>+	phys = <&usbphy 0>;
>+	phy-names = "usb";
>+	status = "okay";
>+};
>+
>+&ehci1 {
>+	status = "okay";
>+};
>+
>+&mmc0 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc0_pins>;
>+	vmmc-supply = <&reg_dcdc1>;
>+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
>+	cd-inverted;
>+	disable-wp;
>+	bus-width = <4>;
>+	status = "okay";
>+};
>+
>+&mmc1 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc1_pins>;
>+	vmmc-supply = <&reg_dldo4>;
>+	vqmmc-supply = <&reg_eldo1>;
>+	mmc-pwrseq = <&wifi_pwrseq>;
>+	bus-width = <4>;
>+	non-removable;
>+	status = "okay";
>+
>+	rtl8723cs: wifi at 1 {
>+		reg = <1>;
>+	};
>+};
>+
>+&mmc2 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc2_pins>;
>+	vmmc-supply = <&reg_dcdc1>;
>+	vqmmc-supply = <&reg_eldo1>;
>+	bus-width = <8>;
>+	non-removable;
>+	cap-mmc-hw-reset;
>+	mmc-hs200-1_8v;
>+	status = "okay";
>+};
>+
>+&ohci0 {
>+	phys = <&usbphy 0>;
>+	phy-names = "usb";
>+	status = "okay";
>+};
>+
>+&ohci1 {
>+	status = "okay";
>+};
>+
>+&pwm {
>+	status = "okay";
>+};
>+
>+&r_rsb {
>+	status = "okay";
>+
>+	axp803: pmic at 3a3 {
>+		compatible = "x-powers,axp803";
>+		reg = <0x3a3>;
>+		interrupt-parent = <&r_intc>;
>+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>+	};
>+};
>+
>+/* The ANX6345 eDP-bridge is on r_i2c */
>+&r_i2c {
>+	clock-frequency = <100000>;
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&r_i2c_pins_a>;
>+	status = "okay";
>+};
>+
>+#include "axp803.dtsi"
>+
>+&reg_aldo1 {
>+	regulator-min-microvolt = <2800000>;
>+	regulator-max-microvolt = <2800000>;
>+	regulator-name = "vcc-csi";
>+};
>+
>+&reg_aldo2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1800000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-pl";
>+};
>+
>+&reg_aldo3 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <2700000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-pll-avcc";
>+};
>+
>+&reg_dc1sw {
>+	regulator-name = "vcc-lcd";
>+};
>+
>+&reg_dcdc1 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <3300000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-3v3";
>+};
>+
>+&reg_dcdc2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1000000>;
>+	regulator-max-microvolt = <1300000>;
>+	regulator-name = "vdd-cpux";
>+};
>+
>+/* DCDC3 is polyphased with DCDC2 */
>+
>+&reg_dcdc5 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1200000>;
>+	regulator-max-microvolt = <1200000>;
>+	regulator-name = "vcc-dram";
>+};
>+
>+&reg_dcdc6 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1100000>;
>+	regulator-max-microvolt = <1100000>;
>+	regulator-name = "vdd-sys";
>+};
>+
>+&reg_dldo1 {
>+	regulator-min-microvolt = <3300000>;
>+	regulator-max-microvolt = <3300000>;
>+	regulator-name = "vcc-hdmi";
>+};
>+
>+&reg_dldo2 {
>+	regulator-min-microvolt = <2500000>;
>+	regulator-max-microvolt = <2500000>;
>+	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>;
>+	regulator-name = "vcc-wifi";
>+};
>+
>+&reg_eldo1 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1800000>;
>+	regulator-max-microvolt = <1800000>;
>+	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>;
>+	regulator-name = "vcc-1v2-hsic";
>+};
>+
>+&reg_fldo2 {
>+	regulator-always-on;
>+	regulator-min-microvolt = <1100000>;
>+	regulator-max-microvolt = <1100000>;
>+	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";
>+};
>+
>+&uart0 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&uart0_pins_a>;
>+	status = "okay";
>+};
>+
>+&usb_otg {
>+	dr_mode = "host";
>+};
>+
>+&usbphy {
>+	usb0_vbus-supply = <&reg_ldo_io0>;
>+	usb1_vbus-supply = <&reg_ldo_io0>;
>+	status = "okay";
>+};

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

* Re: [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
  2018-06-06  5:20     ` Icenowy Zheng
@ 2018-06-06  5:23       ` Vasily Khoruzhick
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:23 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Mark Rutland, devicetree, Maxime Ripard, Catalin Marinas,
	Will Deacon, Chen-Yu Tsai, Rob Herring, Icenowy Zheng, arm-linux

OK, will do.

On Tue, Jun 5, 2018 at 10:20 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> 于 2018年6月6日 GMT+08:00 下午1:17:02, Vasily Khoruzhick <anarsoul@gmail.com> 写到:
>>From: Icenowy Zheng <icenowy@aosc.xyz>
>
> Could you change all the mail address to @aosc.io ?
>
>>
>>Pinebook is a A64-based laptop produced by Pine64, with the following
>>peripherals:
>>
>>USB:
>>- Two external USB ports (one is directly connected to A64's OTG
>>controller, the other is under a internal hub connected to the
>>host-only
>>controller.)
>>- USB HID keyboard and touchpad connected to the internal hub.
>>- USB UVC camera connected to the internal hub.
>>
>>Power-related:
>>- A DC IN jack connected to AXP803's DCIN pin.
>>- A Li-Polymer battery connected to AXP803's battery pins.
>>
>>Storage:
>>- An eMMC by Foresee on the main board (in the product revision of the
>>main board it's designed to be switchable).
>>- An external MicroSD card slot.
>>
>>Display:
>>- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
>>- A mini HDMI port.
>>
>>Misc:
>>- A Hall sensor designed to detect the status of lid, connected to GPIO
>>PL12.
>>- A headphone jack connected to the SoC's internal codec.
>>- A debug UART port muxed with headphone jack.
>>
>>This commit adds basical support for it.
>>
>>[vasily: squashed several commits into one, added simplefb node, added
>>usbphy
>>        to ehci0 and ohci0 nodes and other cosmetic changes to dts]
>>
>>Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>>Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>>---
>> arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>> .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
>> 2 files changed, 281 insertions(+)
>>create mode 100644
>>arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>
>>diff --git a/arch/arm64/boot/dts/allwinner/Makefile
>>b/arch/arm64/boot/dts/allwinner/Makefile
>>index 8bebe7da5ed9..a8c6d0c6f2c5 100644
>>--- a/arch/arm64/boot/dts/allwinner/Makefile
>>+++ b/arch/arm64/boot/dts/allwinner/Makefile
>>@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
>>diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>new file mode 100644
>>index 000000000000..58253d6f9be1
>>--- /dev/null
>>+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>@@ -0,0 +1,280 @@
>>+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>+/*
>>+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
>>+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
>>+ *
>>+ */
>>+
>>+/dts-v1/;
>>+
>>+#include "sun50i-a64.dtsi"
>>+
>>+#include <dt-bindings/gpio/gpio.h>
>>+#include <dt-bindings/input/input.h>
>>+#include <dt-bindings/pwm/pwm.h>
>>+
>>+/ {
>>+      model = "Pinebook";
>>+      compatible = "pine64,pinebook", "allwinner,sun50i-a64";
>>+
>>+      aliases {
>>+              serial0 = &uart0;
>>+              ethernet0 = &rtl8723cs;
>>+      };
>>+
>>+      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 */
>>+      };
>>+
>>+      chosen {
>>+              stdout-path = "serial0:115200n8";
>>+
>>+              framebuffer-lcd {
>>+                      panel-supply = <&reg_dc1sw>;
>>+                      dvdd25-supply = <&reg_dldo2>;
>>+                      dvdd12-supply = <&reg_fldo1>;
>>+              };
>>+      };
>>+
>>+      gpio_keys {
>>+              compatible = "gpio-keys";
>>+
>>+              lid_switch {
>>+                      label = "Lid Switch";
>>+                      gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
>>+                      linux,input-type = <EV_SW>;
>>+                      linux,code = <SW_LID>;
>>+                      linux,can-disable;
>>+              };
>>+      };
>>+
>>+      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 */
>>+      };
>>+};
>>+
>>+&ehci0 {
>>+      phys = <&usbphy 0>;
>>+      phy-names = "usb";
>>+      status = "okay";
>>+};
>>+
>>+&ehci1 {
>>+      status = "okay";
>>+};
>>+
>>+&mmc0 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc0_pins>;
>>+      vmmc-supply = <&reg_dcdc1>;
>>+      cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
>>+      cd-inverted;
>>+      disable-wp;
>>+      bus-width = <4>;
>>+      status = "okay";
>>+};
>>+
>>+&mmc1 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc1_pins>;
>>+      vmmc-supply = <&reg_dldo4>;
>>+      vqmmc-supply = <&reg_eldo1>;
>>+      mmc-pwrseq = <&wifi_pwrseq>;
>>+      bus-width = <4>;
>>+      non-removable;
>>+      status = "okay";
>>+
>>+      rtl8723cs: wifi@1 {
>>+              reg = <1>;
>>+      };
>>+};
>>+
>>+&mmc2 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc2_pins>;
>>+      vmmc-supply = <&reg_dcdc1>;
>>+      vqmmc-supply = <&reg_eldo1>;
>>+      bus-width = <8>;
>>+      non-removable;
>>+      cap-mmc-hw-reset;
>>+      mmc-hs200-1_8v;
>>+      status = "okay";
>>+};
>>+
>>+&ohci0 {
>>+      phys = <&usbphy 0>;
>>+      phy-names = "usb";
>>+      status = "okay";
>>+};
>>+
>>+&ohci1 {
>>+      status = "okay";
>>+};
>>+
>>+&pwm {
>>+      status = "okay";
>>+};
>>+
>>+&r_rsb {
>>+      status = "okay";
>>+
>>+      axp803: pmic@3a3 {
>>+              compatible = "x-powers,axp803";
>>+              reg = <0x3a3>;
>>+              interrupt-parent = <&r_intc>;
>>+              interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>>+      };
>>+};
>>+
>>+/* The ANX6345 eDP-bridge is on r_i2c */
>>+&r_i2c {
>>+      clock-frequency = <100000>;
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&r_i2c_pins_a>;
>>+      status = "okay";
>>+};
>>+
>>+#include "axp803.dtsi"
>>+
>>+&reg_aldo1 {
>>+      regulator-min-microvolt = <2800000>;
>>+      regulator-max-microvolt = <2800000>;
>>+      regulator-name = "vcc-csi";
>>+};
>>+
>>+&reg_aldo2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1800000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-pl";
>>+};
>>+
>>+&reg_aldo3 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <2700000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-pll-avcc";
>>+};
>>+
>>+&reg_dc1sw {
>>+      regulator-name = "vcc-lcd";
>>+};
>>+
>>+&reg_dcdc1 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <3300000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-3v3";
>>+};
>>+
>>+&reg_dcdc2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1000000>;
>>+      regulator-max-microvolt = <1300000>;
>>+      regulator-name = "vdd-cpux";
>>+};
>>+
>>+/* DCDC3 is polyphased with DCDC2 */
>>+
>>+&reg_dcdc5 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1200000>;
>>+      regulator-max-microvolt = <1200000>;
>>+      regulator-name = "vcc-dram";
>>+};
>>+
>>+&reg_dcdc6 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1100000>;
>>+      regulator-max-microvolt = <1100000>;
>>+      regulator-name = "vdd-sys";
>>+};
>>+
>>+&reg_dldo1 {
>>+      regulator-min-microvolt = <3300000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-hdmi";
>>+};
>>+
>>+&reg_dldo2 {
>>+      regulator-min-microvolt = <2500000>;
>>+      regulator-max-microvolt = <2500000>;
>>+      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>;
>>+      regulator-name = "vcc-wifi";
>>+};
>>+
>>+&reg_eldo1 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1800000>;
>>+      regulator-max-microvolt = <1800000>;
>>+      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>;
>>+      regulator-name = "vcc-1v2-hsic";
>>+};
>>+
>>+&reg_fldo2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1100000>;
>>+      regulator-max-microvolt = <1100000>;
>>+      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";
>>+};
>>+
>>+&uart0 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&uart0_pins_a>;
>>+      status = "okay";
>>+};
>>+
>>+&usb_otg {
>>+      dr_mode = "host";
>>+};
>>+
>>+&usbphy {
>>+      usb0_vbus-supply = <&reg_ldo_io0>;
>>+      usb1_vbus-supply = <&reg_ldo_io0>;
>>+      status = "okay";
>>+};

_______________________________________________
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] 20+ messages in thread

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
@ 2018-06-06  5:23       ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06  5:23 UTC (permalink / raw)
  To: linux-arm-kernel

OK, will do.

On Tue, Jun 5, 2018 at 10:20 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> ? 2018?6?6? GMT+08:00 ??1:17:02, Vasily Khoruzhick <anarsoul@gmail.com> ??:
>>From: Icenowy Zheng <icenowy@aosc.xyz>
>
> Could you change all the mail address to @aosc.io ?
>
>>
>>Pinebook is a A64-based laptop produced by Pine64, with the following
>>peripherals:
>>
>>USB:
>>- Two external USB ports (one is directly connected to A64's OTG
>>controller, the other is under a internal hub connected to the
>>host-only
>>controller.)
>>- USB HID keyboard and touchpad connected to the internal hub.
>>- USB UVC camera connected to the internal hub.
>>
>>Power-related:
>>- A DC IN jack connected to AXP803's DCIN pin.
>>- A Li-Polymer battery connected to AXP803's battery pins.
>>
>>Storage:
>>- An eMMC by Foresee on the main board (in the product revision of the
>>main board it's designed to be switchable).
>>- An external MicroSD card slot.
>>
>>Display:
>>- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
>>- A mini HDMI port.
>>
>>Misc:
>>- A Hall sensor designed to detect the status of lid, connected to GPIO
>>PL12.
>>- A headphone jack connected to the SoC's internal codec.
>>- A debug UART port muxed with headphone jack.
>>
>>This commit adds basical support for it.
>>
>>[vasily: squashed several commits into one, added simplefb node, added
>>usbphy
>>        to ehci0 and ohci0 nodes and other cosmetic changes to dts]
>>
>>Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>>Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>>---
>> arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>> .../dts/allwinner/sun50i-a64-pinebook.dts     | 280 ++++++++++++++++++
>> 2 files changed, 281 insertions(+)
>>create mode 100644
>>arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>
>>diff --git a/arch/arm64/boot/dts/allwinner/Makefile
>>b/arch/arm64/boot/dts/allwinner/Makefile
>>index 8bebe7da5ed9..a8c6d0c6f2c5 100644
>>--- a/arch/arm64/boot/dts/allwinner/Makefile
>>+++ b/arch/arm64/boot/dts/allwinner/Makefile
>>@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.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-sopine-baseboard.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
>>diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>new file mode 100644
>>index 000000000000..58253d6f9be1
>>--- /dev/null
>>+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
>>@@ -0,0 +1,280 @@
>>+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>+/*
>>+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
>>+ * Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
>>+ *
>>+ */
>>+
>>+/dts-v1/;
>>+
>>+#include "sun50i-a64.dtsi"
>>+
>>+#include <dt-bindings/gpio/gpio.h>
>>+#include <dt-bindings/input/input.h>
>>+#include <dt-bindings/pwm/pwm.h>
>>+
>>+/ {
>>+      model = "Pinebook";
>>+      compatible = "pine64,pinebook", "allwinner,sun50i-a64";
>>+
>>+      aliases {
>>+              serial0 = &uart0;
>>+              ethernet0 = &rtl8723cs;
>>+      };
>>+
>>+      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 */
>>+      };
>>+
>>+      chosen {
>>+              stdout-path = "serial0:115200n8";
>>+
>>+              framebuffer-lcd {
>>+                      panel-supply = <&reg_dc1sw>;
>>+                      dvdd25-supply = <&reg_dldo2>;
>>+                      dvdd12-supply = <&reg_fldo1>;
>>+              };
>>+      };
>>+
>>+      gpio_keys {
>>+              compatible = "gpio-keys";
>>+
>>+              lid_switch {
>>+                      label = "Lid Switch";
>>+                      gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
>>+                      linux,input-type = <EV_SW>;
>>+                      linux,code = <SW_LID>;
>>+                      linux,can-disable;
>>+              };
>>+      };
>>+
>>+      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 */
>>+      };
>>+};
>>+
>>+&ehci0 {
>>+      phys = <&usbphy 0>;
>>+      phy-names = "usb";
>>+      status = "okay";
>>+};
>>+
>>+&ehci1 {
>>+      status = "okay";
>>+};
>>+
>>+&mmc0 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc0_pins>;
>>+      vmmc-supply = <&reg_dcdc1>;
>>+      cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
>>+      cd-inverted;
>>+      disable-wp;
>>+      bus-width = <4>;
>>+      status = "okay";
>>+};
>>+
>>+&mmc1 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc1_pins>;
>>+      vmmc-supply = <&reg_dldo4>;
>>+      vqmmc-supply = <&reg_eldo1>;
>>+      mmc-pwrseq = <&wifi_pwrseq>;
>>+      bus-width = <4>;
>>+      non-removable;
>>+      status = "okay";
>>+
>>+      rtl8723cs: wifi at 1 {
>>+              reg = <1>;
>>+      };
>>+};
>>+
>>+&mmc2 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&mmc2_pins>;
>>+      vmmc-supply = <&reg_dcdc1>;
>>+      vqmmc-supply = <&reg_eldo1>;
>>+      bus-width = <8>;
>>+      non-removable;
>>+      cap-mmc-hw-reset;
>>+      mmc-hs200-1_8v;
>>+      status = "okay";
>>+};
>>+
>>+&ohci0 {
>>+      phys = <&usbphy 0>;
>>+      phy-names = "usb";
>>+      status = "okay";
>>+};
>>+
>>+&ohci1 {
>>+      status = "okay";
>>+};
>>+
>>+&pwm {
>>+      status = "okay";
>>+};
>>+
>>+&r_rsb {
>>+      status = "okay";
>>+
>>+      axp803: pmic at 3a3 {
>>+              compatible = "x-powers,axp803";
>>+              reg = <0x3a3>;
>>+              interrupt-parent = <&r_intc>;
>>+              interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>>+      };
>>+};
>>+
>>+/* The ANX6345 eDP-bridge is on r_i2c */
>>+&r_i2c {
>>+      clock-frequency = <100000>;
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&r_i2c_pins_a>;
>>+      status = "okay";
>>+};
>>+
>>+#include "axp803.dtsi"
>>+
>>+&reg_aldo1 {
>>+      regulator-min-microvolt = <2800000>;
>>+      regulator-max-microvolt = <2800000>;
>>+      regulator-name = "vcc-csi";
>>+};
>>+
>>+&reg_aldo2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1800000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-pl";
>>+};
>>+
>>+&reg_aldo3 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <2700000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-pll-avcc";
>>+};
>>+
>>+&reg_dc1sw {
>>+      regulator-name = "vcc-lcd";
>>+};
>>+
>>+&reg_dcdc1 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <3300000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-3v3";
>>+};
>>+
>>+&reg_dcdc2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1000000>;
>>+      regulator-max-microvolt = <1300000>;
>>+      regulator-name = "vdd-cpux";
>>+};
>>+
>>+/* DCDC3 is polyphased with DCDC2 */
>>+
>>+&reg_dcdc5 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1200000>;
>>+      regulator-max-microvolt = <1200000>;
>>+      regulator-name = "vcc-dram";
>>+};
>>+
>>+&reg_dcdc6 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1100000>;
>>+      regulator-max-microvolt = <1100000>;
>>+      regulator-name = "vdd-sys";
>>+};
>>+
>>+&reg_dldo1 {
>>+      regulator-min-microvolt = <3300000>;
>>+      regulator-max-microvolt = <3300000>;
>>+      regulator-name = "vcc-hdmi";
>>+};
>>+
>>+&reg_dldo2 {
>>+      regulator-min-microvolt = <2500000>;
>>+      regulator-max-microvolt = <2500000>;
>>+      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>;
>>+      regulator-name = "vcc-wifi";
>>+};
>>+
>>+&reg_eldo1 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1800000>;
>>+      regulator-max-microvolt = <1800000>;
>>+      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>;
>>+      regulator-name = "vcc-1v2-hsic";
>>+};
>>+
>>+&reg_fldo2 {
>>+      regulator-always-on;
>>+      regulator-min-microvolt = <1100000>;
>>+      regulator-max-microvolt = <1100000>;
>>+      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";
>>+};
>>+
>>+&uart0 {
>>+      pinctrl-names = "default";
>>+      pinctrl-0 = <&uart0_pins_a>;
>>+      status = "okay";
>>+};
>>+
>>+&usb_otg {
>>+      dr_mode = "host";
>>+};
>>+
>>+&usbphy {
>>+      usb0_vbus-supply = <&reg_ldo_io0>;
>>+      usb1_vbus-supply = <&reg_ldo_io0>;
>>+      status = "okay";
>>+};

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

* Re: [PATCH v2 1/3] arm64: dts: allwinner: a64: add R_I2C controller
  2018-06-06  5:17   ` Vasily Khoruzhick
@ 2018-06-06 19:32     ` Maxime Ripard
  -1 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:32 UTC (permalink / raw)
  To: Vasily Khoruzhick
  Cc: Mark Rutland, devicetree, Catalin Marinas, Will Deacon,
	Chen-Yu Tsai, Rob Herring, linux-arm-kernel, Icenowy Zheng

On Tue, Jun 05, 2018 at 10:17:00PM -0700, Vasily Khoruzhick wrote:
> From: Icenowy Zheng <icenowy@aosc.io>
> 
> Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has
> two groups of pinmuxes on PL bank, so it's called R_I2C.
> 
> Add support for this I2C controller and the pinmux which doesn't conflict
> with RSB.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 1b2ef28c42bd..dcf957b2e7c8 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -46,6 +46,7 @@
>  #include <dt-bindings/clock/sun8i-r-ccu.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include <dt-bindings/reset/sun50i-a64-ccu.h>
> +#include <dt-bindings/reset/sun8i-r-ccu.h>
>  
>  / {
>  	interrupt-parent = <&gic>;
> @@ -655,6 +656,18 @@
>  			#reset-cells = <1>;
>  		};
>  
> +		r_i2c: i2c@1f02400 {
> +			compatible = "allwinner,sun50i-a64-i2c",
> +				     "allwinner,sun6i-a31-i2c";
> +			reg = <0x01f02400 0x400>;
> +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&r_ccu CLK_APB0_I2C>;
> +			resets = <&r_ccu RST_APB0_I2C>;
> +			status = "disabled";
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};
> +
>  		r_pio: pinctrl@1f02c00 {
>  			compatible = "allwinner,sun50i-a64-r-pinctrl";
>  			reg = <0x01f02c00 0x400>;
> @@ -666,6 +679,17 @@
>  			interrupt-controller;
>  			#interrupt-cells = <3>;
>  
> +
> +			r_i2c_pins: i2c {
> +				pins = "PL0", "PL1";
> +				function = "s_i2c";
> +			};
> +

We usually don't have pin groups that are not used by any boards. I've
removed it and applied.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v2 1/3] arm64: dts: allwinner: a64: add R_I2C controller
@ 2018-06-06 19:32     ` Maxime Ripard
  0 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2018 at 10:17:00PM -0700, Vasily Khoruzhick wrote:
> From: Icenowy Zheng <icenowy@aosc.io>
> 
> Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has
> two groups of pinmuxes on PL bank, so it's called R_I2C.
> 
> Add support for this I2C controller and the pinmux which doesn't conflict
> with RSB.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 1b2ef28c42bd..dcf957b2e7c8 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -46,6 +46,7 @@
>  #include <dt-bindings/clock/sun8i-r-ccu.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include <dt-bindings/reset/sun50i-a64-ccu.h>
> +#include <dt-bindings/reset/sun8i-r-ccu.h>
>  
>  / {
>  	interrupt-parent = <&gic>;
> @@ -655,6 +656,18 @@
>  			#reset-cells = <1>;
>  		};
>  
> +		r_i2c: i2c at 1f02400 {
> +			compatible = "allwinner,sun50i-a64-i2c",
> +				     "allwinner,sun6i-a31-i2c";
> +			reg = <0x01f02400 0x400>;
> +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&r_ccu CLK_APB0_I2C>;
> +			resets = <&r_ccu RST_APB0_I2C>;
> +			status = "disabled";
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};
> +
>  		r_pio: pinctrl at 1f02c00 {
>  			compatible = "allwinner,sun50i-a64-r-pinctrl";
>  			reg = <0x01f02c00 0x400>;
> @@ -666,6 +679,17 @@
>  			interrupt-controller;
>  			#interrupt-cells = <3>;
>  
> +
> +			r_i2c_pins: i2c {
> +				pins = "PL0", "PL1";
> +				function = "s_i2c";
> +			};
> +

We usually don't have pin groups that are not used by any boards. I've
removed it and applied.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v2 2/3] arm64: dts: allwinner: a64: Add PWM controllers
  2018-06-06  5:17   ` Vasily Khoruzhick
@ 2018-06-06 19:32     ` Maxime Ripard
  -1 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:32 UTC (permalink / raw)
  To: Vasily Khoruzhick
  Cc: Mark Rutland, devicetree, Catalin Marinas, Will Deacon,
	Chen-Yu Tsai, Rob Herring, Andre Przywara, linux-arm-kernel

On Tue, Jun 05, 2018 at 10:17:01PM -0700, Vasily Khoruzhick wrote:
> From: Andre Przywara <andre.przywara@arm.com>
> 
> The Allwinner A64 SoC features two PWM controllers, which are fully
> compatible to the one used in the A13 and H3 chips.
> 
> Add the nodes for the devices (one for the "normal" PWM, the other for
> the one in the CPUS domain) and the pins their outputs are connected to.
> 
> On the A64 the "normal" PWM is muxed together with one of the MDIO pins
> used to communicate with the Ethernet PHY, so it won't be usable on many
> boards. But the Pinebook laptop uses this pin for controlling the LCD
> backlight.
> 
> On Pine64 the CPUS PWM pin however is routed to the "RPi2" header,
> at the same location as the PWM pin on the RaspberryPi.
> 
> Tested on Pinebook and Teres-I
> 
> [vasily: fixed comment message as requested by Stefan Bruens, added default
>          muxing options to pwm and r_pwm nodes]
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> Tested-by: Harald Geyer <harald@ccbib.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v2 2/3] arm64: dts: allwinner: a64: Add PWM controllers
@ 2018-06-06 19:32     ` Maxime Ripard
  0 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2018 at 10:17:01PM -0700, Vasily Khoruzhick wrote:
> From: Andre Przywara <andre.przywara@arm.com>
> 
> The Allwinner A64 SoC features two PWM controllers, which are fully
> compatible to the one used in the A13 and H3 chips.
> 
> Add the nodes for the devices (one for the "normal" PWM, the other for
> the one in the CPUS domain) and the pins their outputs are connected to.
> 
> On the A64 the "normal" PWM is muxed together with one of the MDIO pins
> used to communicate with the Ethernet PHY, so it won't be usable on many
> boards. But the Pinebook laptop uses this pin for controlling the LCD
> backlight.
> 
> On Pine64 the CPUS PWM pin however is routed to the "RPi2" header,
> at the same location as the PWM pin on the RaspberryPi.
> 
> Tested on Pinebook and Teres-I
> 
> [vasily: fixed comment message as requested by Stefan Bruens, added default
>          muxing options to pwm and r_pwm nodes]
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> Tested-by: Harald Geyer <harald@ccbib.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
  2018-06-06  5:17   ` Vasily Khoruzhick
@ 2018-06-06 19:37     ` Maxime Ripard
  -1 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:37 UTC (permalink / raw)
  To: Vasily Khoruzhick
  Cc: Mark Rutland, devicetree, Catalin Marinas, Will Deacon,
	Chen-Yu Tsai, Rob Herring, Icenowy Zheng, linux-arm-kernel

On Tue, Jun 05, 2018 at 10:17:02PM -0700, Vasily Khoruzhick wrote:
> From: Icenowy Zheng <icenowy@aosc.xyz>
> 
> Pinebook is a A64-based laptop produced by Pine64, with the following
> peripherals:
> 
> USB:
> - Two external USB ports (one is directly connected to A64's OTG
> controller, the other is under a internal hub connected to the host-only
> controller.)
> - USB HID keyboard and touchpad connected to the internal hub.
> - USB UVC camera connected to the internal hub.
> 
> Power-related:
> - A DC IN jack connected to AXP803's DCIN pin.
> - A Li-Polymer battery connected to AXP803's battery pins.
> 
> Storage:
> - An eMMC by Foresee on the main board (in the product revision of the
> main board it's designed to be switchable).
> - An external MicroSD card slot.
> 
> Display:
> - An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
> - A mini HDMI port.
> 
> Misc:
> - A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
> - A headphone jack connected to the SoC's internal codec.
> - A debug UART port muxed with headphone jack.
> 
> This commit adds basical support for it.
> 
> [vasily: squashed several commits into one, added simplefb node, added usbphy
> 	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

I've updated Icenowy's domain and applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
@ 2018-06-06 19:37     ` Maxime Ripard
  0 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2018-06-06 19:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2018 at 10:17:02PM -0700, Vasily Khoruzhick wrote:
> From: Icenowy Zheng <icenowy@aosc.xyz>
> 
> Pinebook is a A64-based laptop produced by Pine64, with the following
> peripherals:
> 
> USB:
> - Two external USB ports (one is directly connected to A64's OTG
> controller, the other is under a internal hub connected to the host-only
> controller.)
> - USB HID keyboard and touchpad connected to the internal hub.
> - USB UVC camera connected to the internal hub.
> 
> Power-related:
> - A DC IN jack connected to AXP803's DCIN pin.
> - A Li-Polymer battery connected to AXP803's battery pins.
> 
> Storage:
> - An eMMC by Foresee on the main board (in the product revision of the
> main board it's designed to be switchable).
> - An external MicroSD card slot.
> 
> Display:
> - An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
> - A mini HDMI port.
> 
> Misc:
> - A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
> - A headphone jack connected to the SoC's internal codec.
> - A debug UART port muxed with headphone jack.
> 
> This commit adds basical support for it.
> 
> [vasily: squashed several commits into one, added simplefb node, added usbphy
> 	 to ehci0 and ohci0 nodes and other cosmetic changes to dts]
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

I've updated Icenowy's domain and applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
  2018-06-06 19:37     ` Maxime Ripard
@ 2018-06-06 20:16       ` Vasily Khoruzhick
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06 20:16 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree, Catalin Marinas, Will Deacon,
	Chen-Yu Tsai, Rob Herring, Icenowy Zheng, arm-linux

On Wed, Jun 6, 2018 at 12:37 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
>
> I've updated Icenowy's domain and applied, thanks!
> Maxime

Thanks!

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

* [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook
@ 2018-06-06 20:16       ` Vasily Khoruzhick
  0 siblings, 0 replies; 20+ messages in thread
From: Vasily Khoruzhick @ 2018-06-06 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 6, 2018 at 12:37 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
>
> I've updated Icenowy's domain and applied, thanks!
> Maxime

Thanks!

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

end of thread, other threads:[~2018-06-06 20:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-06  5:16 [PATCH v2 0/3] arm64: allwinner: a64: Add initial support for Pinebook Vasily Khoruzhick
2018-06-06  5:16 ` Vasily Khoruzhick
2018-06-06  5:17 ` [PATCH v2 1/3] arm64: dts: allwinner: a64: add R_I2C controller Vasily Khoruzhick
2018-06-06  5:17   ` Vasily Khoruzhick
2018-06-06 19:32   ` Maxime Ripard
2018-06-06 19:32     ` Maxime Ripard
2018-06-06  5:17 ` [PATCH v2 2/3] arm64: dts: allwinner: a64: Add PWM controllers Vasily Khoruzhick
2018-06-06  5:17   ` Vasily Khoruzhick
2018-06-06 19:32   ` Maxime Ripard
2018-06-06 19:32     ` Maxime Ripard
2018-06-06  5:17 ` [PATCH v2 3/3] arm64: dts: allwinner: add support for Pinebook Vasily Khoruzhick
2018-06-06  5:17   ` Vasily Khoruzhick
2018-06-06  5:20   ` Icenowy Zheng
2018-06-06  5:20     ` Icenowy Zheng
2018-06-06  5:23     ` Vasily Khoruzhick
2018-06-06  5:23       ` Vasily Khoruzhick
2018-06-06 19:37   ` Maxime Ripard
2018-06-06 19:37     ` Maxime Ripard
2018-06-06 20:16     ` Vasily Khoruzhick
2018-06-06 20:16       ` Vasily Khoruzhick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.