linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ARM: sunxi: Introduce CHIP support
@ 2015-09-18  8:48 Maxime Ripard
  2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

Hi,

Here is a serie introducing the support for the Allwinner R8 and the
Nextthing's CHIP.

Support is almost complete for the CHIP itself, the only missing part
for now is the WiFi chip that needs to be powered through two combined
regulators (AXP209's LDO3 and LDO4). The audio codec is also missing
since it's not already enabled in the DT.

Both these features will be addressed eventually.

Let me know what you think,
Maxime

Maxime Ripard (5):
  ARM: sunxi: Add R8 support
  ARM: sun5i: Add R8 DTSI
  ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI
  ARM: sun5i: dt: Add UART3 CTS and RTS pins
  ARM: sun5i: Add C.H.I.P DTS

 arch/arm/boot/dts/Makefile          |   3 +-
 arch/arm/boot/dts/sun5i-a10s.dtsi   |   7 -
 arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/sun5i-r8.dtsi     |  61 +++++++++
 arch/arm/boot/dts/sun5i.dtsi        |  14 ++
 arch/arm/mach-sunxi/sunxi.c         |   3 +-
 drivers/clk/sunxi/clk-sunxi.c       |   1 +
 7 files changed, 341 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts
 create mode 100644 arch/arm/boot/dts/sun5i-r8.dtsi

-- 
2.5.1


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

* [PATCH 1/5] ARM: sunxi: Add R8 support
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
@ 2015-09-18  8:48 ` Maxime Ripard
  2015-09-18  9:47   ` Chen-Yu Tsai
  2015-09-30 22:38   ` Stephen Boyd
  2015-09-18  8:48 ` [PATCH 2/5] ARM: sun5i: Add R8 DTSI Maxime Ripard
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

The R8 is a new Allwinner SoC based on the A13. While both are very
similar, there's still a few differences. Introduce a new compatible to
deal with them.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/mach-sunxi/sunxi.c   | 3 ++-
 drivers/clk/sunxi/clk-sunxi.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 65bab2876343..8583a9ca86bd 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -26,10 +26,11 @@ static const char * const sunxi_board_dt_compat[] = {
 	"allwinner,sun4i-a10",
 	"allwinner,sun5i-a10s",
 	"allwinner,sun5i-a13",
+	"allwinner,sun5i-r8",
 	NULL,
 };
 
-DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
+DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
 	.dt_compat	= sunxi_board_dt_compat,
 	.init_late	= sunxi_dt_cpufreq_init,
 MACHINE_END
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 413070d07b3f..9c79af0c03b2 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1196,6 +1196,7 @@ static void __init sun5i_init_clocks(struct device_node *node)
 }
 CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sun5i_init_clocks);
 CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sun5i_init_clocks);
+CLK_OF_DECLARE(sun5i_r8_clk_init, "allwinner,sun5i-r8", sun5i_init_clocks);
 CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sun5i_init_clocks);
 
 static const char *sun6i_critical_clocks[] __initdata = {
-- 
2.5.1


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

* [PATCH 2/5] ARM: sun5i: Add R8 DTSI
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
  2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
@ 2015-09-18  8:48 ` Maxime Ripard
  2015-09-18  9:41   ` Chen-Yu Tsai
  2015-09-18  8:48 ` [PATCH 3/5] ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI Maxime Ripard
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

The R8 is very close to the A13, but it still has a few differences,
notably a composite output, which the A13 lacks.

Add a DTSI based on the A13's to hold those differences.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boot/dts/sun5i-r8.dtsi | 61 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun5i-r8.dtsi

diff --git a/arch/arm/boot/dts/sun5i-r8.dtsi b/arch/arm/boot/dts/sun5i-r8.dtsi
new file mode 100644
index 000000000000..c9ed854687ca
--- /dev/null
+++ b/arch/arm/boot/dts/sun5i-r8.dtsi
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2015 Free Electrons
+ * Copyright 2015 NextThing Co
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "skeleton.dtsi"
+
+#include "sun5i-a13.dtsi"
+
+/ {
+	chosen {
+		framebuffer@1 {
+			compatible = "allwinner,simple-framebuffer",
+				     "simple-framebuffer";
+			allwinner,pipeline = "de_be0-lcd0-tve0";
+			clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
+				 <&ahb_gates 44>;
+			status = "disabled";
+		}; 
+	};
+};
-- 
2.5.1


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

* [PATCH 3/5] ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
  2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
  2015-09-18  8:48 ` [PATCH 2/5] ARM: sun5i: Add R8 DTSI Maxime Ripard
@ 2015-09-18  8:48 ` Maxime Ripard
  2015-09-18  8:48 ` [PATCH 4/5] ARM: sun5i: dt: Add UART3 CTS and RTS pins Maxime Ripard
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

The uart3 pins are shared between the A10s and A13, move the pinctrl node
to the common DTSI to avoid duplication.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boot/dts/sun5i-a10s.dtsi | 7 -------
 arch/arm/boot/dts/sun5i.dtsi      | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index 0fdabe8eb9e8..2ebd32f5bc6e 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -204,13 +204,6 @@
 		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 	};
 
-	uart3_pins_a: uart3@0 {
-		allwinner,pins = "PG9", "PG10";
-		allwinner,function = "uart3";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
-
 	emac_pins_a: emac0@0 {
 		allwinner,pins = "PA0", "PA1", "PA2",
 				"PA3", "PA4", "PA5", "PA6",
diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
index 78b993abbaa3..433c83a321ca 100644
--- a/arch/arm/boot/dts/sun5i.dtsi
+++ b/arch/arm/boot/dts/sun5i.dtsi
@@ -529,6 +529,13 @@
 				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
 				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
+
+			uart3_pins_a: uart3@0 {
+				allwinner,pins = "PG9", "PG10";
+				allwinner,function = "uart3";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
 		};
 
 		timer@01c20c00 {
-- 
2.5.1


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

* [PATCH 4/5] ARM: sun5i: dt: Add UART3 CTS and RTS pins
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
                   ` (2 preceding siblings ...)
  2015-09-18  8:48 ` [PATCH 3/5] ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI Maxime Ripard
@ 2015-09-18  8:48 ` Maxime Ripard
  2015-09-18  8:48 ` [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS Maxime Ripard
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

Add a separate pinctrl node for the UART3 CTS and RTS pins shared between
the A10s and A13.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boot/dts/sun5i.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
index 433c83a321ca..7d355e52efe2 100644
--- a/arch/arm/boot/dts/sun5i.dtsi
+++ b/arch/arm/boot/dts/sun5i.dtsi
@@ -536,6 +536,13 @@
 				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
+
+			uart3_pins_cts_rts_a: uart3-cts-rts@0 {
+				allwinner,pins = "PG11", "PG12";
+				allwinner,function = "uart3";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
 		};
 
 		timer@01c20c00 {
-- 
2.5.1


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

* [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
                   ` (3 preceding siblings ...)
  2015-09-18  8:48 ` [PATCH 4/5] ARM: sun5i: dt: Add UART3 CTS and RTS pins Maxime Ripard
@ 2015-09-18  8:48 ` Maxime Ripard
  2015-09-18 16:41   ` Chen-Yu Tsai
  2015-09-18  9:02 ` [PATCH 0/5] ARM: sunxi: Introduce CHIP support Arnd Bergmann
  2015-09-18 15:36 ` [linux-sunxi] " Hans de Goede
  6 siblings, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18  8:48 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, Hans de Goede, linux-clk, linux-kernel,
	linux-sunxi, Maxime Ripard

The C.H.I.P. is a small SBC with an Allwinner R8, 8GB of NAND, 512MB of
RAM, USB host and OTG, a wifi / bluetooth combo chip, an audio/video jack
and two connectors to plug additional boards on top of it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boot/dts/Makefile          |   3 +-
 arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
 2 files changed, 263 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b276174b670a..7efd37b907f1 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -599,7 +599,8 @@ dtb-$(CONFIG_MACH_SUN5I) += \
 	sun5i-a13-inet-98v-rev2.dtb \
 	sun5i-a13-olinuxino.dtb \
 	sun5i-a13-olinuxino-micro.dtb \
-	sun5i-a13-utoo-p66.dtb
+	sun5i-a13-utoo-p66.dtb \
+	sun5i-r8-chip.dtb
 dtb-$(CONFIG_MACH_SUN6I) += \
 	sun6i-a31-app4-evb1.dtb \
 	sun6i-a31-colombus.dtb \
diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
new file mode 100644
index 000000000000..6cb3c4f1cd61
--- /dev/null
+++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
@@ -0,0 +1,261 @@
+/*
+ * Copyright 2015 Free Electrons
+ * Copyright 2015 NextThing Co
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a13.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+	model = "NextThing C.H.I.P.";
+	compatible = "nextthing,chip", "allwinner,sun5i-r8";
+
+	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		serial0 = &uart1;
+		serial1 = &uart3;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	dram_vcc: dram_vcc {
+		compatible = "regulator-fixed";
+		regulator-name = "dram-vcc";
+		regulator-min-microvolt = <1600000>;
+		regulator-max-microvolt = <1600000>;
+		vin-supply = <&ipsout>;
+		regulator-always-on;
+	};
+
+	ipsout: ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	usb0_vbus: usb0_vbus {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		pinctrl-0 = <&chip_vbus_pin>;
+
+		regulator-name = "vbus-usb0";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vcc_5v0>;
+		gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
+		enable-active-high;
+	};
+
+	vcc_3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&ipsout>;
+		regulator-always-on;
+	};
+
+	vcc_5v0: vcc5v0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v0";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&ipsout>;
+		regulator-always-on;
+	};
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins_a>;
+	status = "okay";
+
+	axp209: pmic@34 {
+		reg = <0x34>;
+
+		/*
+		 * The interrupt is routed through the "External Fast
+                 * Interrupt Request" pin (ball G13 of the module)
+                 * directly to the main interrupt controller, without
+                 * any other controller interfering.
+		 */
+		interrupts = <0>;
+	};
+};
+
+#include "axp209.dtsi"
+
+/*
+ * i2c1 is routed to the external pins and doesn't have any device
+ * attached to it on the C.H.I.P itself.
+ */
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins_a>;
+	status = "okay";
+};
+
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pins_a>;
+	status = "okay";
+
+	xio: gpio@38 {
+		compatible = "nxp,pcf8574a";
+		reg = <0x38>;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		interrupt-parent = <&pio>;
+		interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>;
+	vmmc-supply = <&vcc_3v3>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+&pio {
+	chip_vbus_pin: chip_vbus_pin@0 {
+	        allwinner,pins = "PB10";
+	        allwinner,function = "gpio_out";
+	        allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+	        allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	chip_id_det_pin: chip_id_det_pin@0 {
+	        allwinner,pins = "PG2";
+	        allwinner,function = "gpio_in";
+	        allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+	        allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&reg_dcdc2 {
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "cpuvdd";
+	regulator-always-on;
+};
+
+&reg_dcdc3 {
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-name = "corevdd";
+	regulator-always-on;
+};
+
+&reg_ldo1 {
+	regulator-name = "rtcvdd";
+};
+
+&reg_ldo2 {
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "avcc";
+	regulator-always-on;
+};
+
+&reg_ldo5 {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "vcc-1v8";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins_b>;
+	status = "okay";
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins_a>,
+		    <&uart3_pins_cts_rts_a>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&chip_id_det_pin>;
+	status = "okay";
+
+	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+
+	usb0_vbus-supply = <&usb0_vbus>;
+	usb1_vbus-supply = <&vcc_5v0>;
+};
-- 
2.5.1


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

* Re: [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
                   ` (4 preceding siblings ...)
  2015-09-18  8:48 ` [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS Maxime Ripard
@ 2015-09-18  9:02 ` Arnd Bergmann
  2015-09-18 12:19   ` Maxime Ripard
  2015-09-18 15:36 ` [linux-sunxi] " Hans de Goede
  6 siblings, 1 reply; 26+ messages in thread
From: Arnd Bergmann @ 2015-09-18  9:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Maxime Ripard, Mike Turquette, Stephen Boyd, linux-sunxi,
	linux-kernel, Hans de Goede, Chen-Yu Tsai, linux-clk,
	ulf.hansson

On Friday 18 September 2015 10:48:45 Maxime Ripard wrote:
> 
> Here is a serie introducing the support for the Allwinner R8 and the
> Nextthing's CHIP.
> 
> Support is almost complete for the CHIP itself, the only missing part
> for now is the WiFi chip that needs to be powered through two combined
> regulators (AXP209's LDO3 and LDO4). The audio codec is also missing
> since it's not already enabled in the DT.
> 
> Both these features will be addressed eventually.
> 
> Let me know what you think,

Very nice!

When you get to the WiFi support, please loop in Ulf and me to the Cc list.
IIRC there were some open questions about how we should handle SDIO wifi
controllers with special requirements like this, both in general and
in particular with this driver.

	Arnd

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

* Re: [PATCH 2/5] ARM: sun5i: Add R8 DTSI
  2015-09-18  8:48 ` [PATCH 2/5] ARM: sun5i: Add R8 DTSI Maxime Ripard
@ 2015-09-18  9:41   ` Chen-Yu Tsai
  2015-09-18 12:19     ` Maxime Ripard
  0 siblings, 1 reply; 26+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  9:41 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Chen-Yu Tsai,
	Hans de Goede, linux-clk, linux-kernel, linux-sunxi

Hi,

On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The R8 is very close to the A13, but it still has a few differences,
> notably a composite output, which the A13 lacks.
>
> Add a DTSI based on the A13's to hold those differences.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun5i-r8.dtsi | 61 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 arch/arm/boot/dts/sun5i-r8.dtsi
>
> diff --git a/arch/arm/boot/dts/sun5i-r8.dtsi b/arch/arm/boot/dts/sun5i-r8.dtsi
> new file mode 100644
> index 000000000000..c9ed854687ca
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun5i-r8.dtsi
> @@ -0,0 +1,61 @@
> +/*
> + * Copyright 2015 Free Electrons
> + * Copyright 2015 NextThing Co
> + *
> + * Maxime Ripard <maxime.ripard@free-electrons.com>
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This file is distributed in the hope that it will be useful,
> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *     GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use,
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include "skeleton.dtsi"

This is already included by sun5i.dtsi, which is included by sun5i-a13.dtsi.

> +
> +#include "sun5i-a13.dtsi"
> +
> +/ {
> +       chosen {
> +               framebuffer@1 {
> +                       compatible = "allwinner,simple-framebuffer",
> +                                    "simple-framebuffer";
> +                       allwinner,pipeline = "de_be0-lcd0-tve0";
> +                       clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
> +                                <&ahb_gates 44>;
> +                       status = "disabled";
> +               };
> +       };
> +};
> --
> 2.5.1
>

The rest looks good.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

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

* Re: [PATCH 1/5] ARM: sunxi: Add R8 support
  2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
@ 2015-09-18  9:47   ` Chen-Yu Tsai
  2015-09-18 12:20     ` Maxime Ripard
  2015-09-30 22:38   ` Stephen Boyd
  1 sibling, 1 reply; 26+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  9:47 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Chen-Yu Tsai,
	Hans de Goede, linux-clk, linux-kernel, linux-sunxi

On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The R8 is a new Allwinner SoC based on the A13. While both are very
> similar, there's still a few differences. Introduce a new compatible to
> deal with them.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/mach-sunxi/sunxi.c   | 3 ++-
>  drivers/clk/sunxi/clk-sunxi.c | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
> index 65bab2876343..8583a9ca86bd 100644
> --- a/arch/arm/mach-sunxi/sunxi.c
> +++ b/arch/arm/mach-sunxi/sunxi.c
> @@ -26,10 +26,11 @@ static const char * const sunxi_board_dt_compat[] = {
>         "allwinner,sun4i-a10",
>         "allwinner,sun5i-a10s",
>         "allwinner,sun5i-a13",
> +       "allwinner,sun5i-r8",
>         NULL,
>  };
>
> -DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
> +DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")

Nit: might want to mention the rename.

>         .dt_compat      = sunxi_board_dt_compat,
>         .init_late      = sunxi_dt_cpufreq_init,
>  MACHINE_END
> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
> index 413070d07b3f..9c79af0c03b2 100644
> --- a/drivers/clk/sunxi/clk-sunxi.c
> +++ b/drivers/clk/sunxi/clk-sunxi.c
> @@ -1196,6 +1196,7 @@ static void __init sun5i_init_clocks(struct device_node *node)
>  }
>  CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sun5i_init_clocks);
>  CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sun5i_init_clocks);
> +CLK_OF_DECLARE(sun5i_r8_clk_init, "allwinner,sun5i-r8", sun5i_init_clocks);
>  CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sun5i_init_clocks);
>
>  static const char *sun6i_critical_clocks[] __initdata = {
> --
> 2.5.1
>

What about Documentation/devicetree/bindings/arm/sunxi.txt and
Documentation/arm/sunxi/README?


Thanks
ChenYu

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

* Re: [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18  9:02 ` [PATCH 0/5] ARM: sunxi: Introduce CHIP support Arnd Bergmann
@ 2015-09-18 12:19   ` Maxime Ripard
  2015-09-18 13:18     ` Arnd Bergmann
  0 siblings, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18 12:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Mike Turquette, Stephen Boyd, linux-sunxi,
	linux-kernel, Hans de Goede, Chen-Yu Tsai, linux-clk,
	ulf.hansson

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]

Hi Arnd,

On Fri, Sep 18, 2015 at 11:02:33AM +0200, Arnd Bergmann wrote:
> On Friday 18 September 2015 10:48:45 Maxime Ripard wrote:
> > 
> > Here is a serie introducing the support for the Allwinner R8 and the
> > Nextthing's CHIP.
> > 
> > Support is almost complete for the CHIP itself, the only missing part
> > for now is the WiFi chip that needs to be powered through two combined
> > regulators (AXP209's LDO3 and LDO4). The audio codec is also missing
> > since it's not already enabled in the DT.
> > 
> > Both these features will be addressed eventually.
> > 
> > Let me know what you think,
> 
> Very nice!
> 
> When you get to the WiFi support, please loop in Ulf and me to the Cc list.

Ack.

> IIRC there were some open questions about how we should handle SDIO wifi
> controllers with special requirements like this, both in general and
> in particular with this driver.

There's actually two issues that are pretty orthogonal:

  * the fact that the regulator to power the wifi chip needs to be
    enabled before it enumerates and the driver is probed. The MMC
    pwrseq stuff seems to fix that, even if it doesn't really fit in
    the usual DT model.

  * The fact that that regulator on this board is actually two
    regulators in parallel that needs to be controlled in parallel
    too. Here, it will probably require a new regulator driver to
    combine two regulators into one.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 2/5] ARM: sun5i: Add R8 DTSI
  2015-09-18  9:41   ` Chen-Yu Tsai
@ 2015-09-18 12:19     ` Maxime Ripard
  0 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18 12:19 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Hans de Goede,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 4116 bytes --]

On Fri, Sep 18, 2015 at 05:41:47PM +0800, Chen-Yu Tsai wrote:
> Hi,
> 
> On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The R8 is very close to the A13, but it still has a few differences,
> > notably a composite output, which the A13 lacks.
> >
> > Add a DTSI based on the A13's to hold those differences.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  arch/arm/boot/dts/sun5i-r8.dtsi | 61 +++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 61 insertions(+)
> >  create mode 100644 arch/arm/boot/dts/sun5i-r8.dtsi
> >
> > diff --git a/arch/arm/boot/dts/sun5i-r8.dtsi b/arch/arm/boot/dts/sun5i-r8.dtsi
> > new file mode 100644
> > index 000000000000..c9ed854687ca
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/sun5i-r8.dtsi
> > @@ -0,0 +1,61 @@
> > +/*
> > + * Copyright 2015 Free Electrons
> > + * Copyright 2015 NextThing Co
> > + *
> > + * Maxime Ripard <maxime.ripard@free-electrons.com>
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + *     modify it under the terms of the GNU General Public License as
> > + *     published by the Free Software Foundation; either version 2 of the
> > + *     License, or (at your option) any later version.
> > + *
> > + *     This file is distributed in the hope that it will be useful,
> > + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *     GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + *     obtaining a copy of this software and associated documentation
> > + *     files (the "Software"), to deal in the Software without
> > + *     restriction, including without limitation the rights to use,
> > + *     copy, modify, merge, publish, distribute, sublicense, and/or
> > + *     sell copies of the Software, and to permit persons to whom the
> > + *     Software is furnished to do so, subject to the following
> > + *     conditions:
> > + *
> > + *     The above copyright notice and this permission notice shall be
> > + *     included in all copies or substantial portions of the Software.
> > + *
> > + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + *     OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +#include "skeleton.dtsi"
> 
> This is already included by sun5i.dtsi, which is included by
> sun5i-a13.dtsi.

Ah, yes.

> > +
> > +#include "sun5i-a13.dtsi"
> > +
> > +/ {
> > +       chosen {
> > +               framebuffer@1 {
> > +                       compatible = "allwinner,simple-framebuffer",
> > +                                    "simple-framebuffer";
> > +                       allwinner,pipeline = "de_be0-lcd0-tve0";
> > +                       clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
> > +                                <&ahb_gates 44>;
> > +                       status = "disabled";
> > +               };
> > +       };
> > +};
> > --
> > 2.5.1
> >
> 
> The rest looks good.
> 
> Reviewed-by: Chen-Yu Tsai <wens@csie.org>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/5] ARM: sunxi: Add R8 support
  2015-09-18  9:47   ` Chen-Yu Tsai
@ 2015-09-18 12:20     ` Maxime Ripard
  0 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18 12:20 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Hans de Goede,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

On Fri, Sep 18, 2015 at 05:47:44PM +0800, Chen-Yu Tsai wrote:
> On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The R8 is a new Allwinner SoC based on the A13. While both are very
> > similar, there's still a few differences. Introduce a new compatible to
> > deal with them.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  arch/arm/mach-sunxi/sunxi.c   | 3 ++-
> >  drivers/clk/sunxi/clk-sunxi.c | 1 +
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
> > index 65bab2876343..8583a9ca86bd 100644
> > --- a/arch/arm/mach-sunxi/sunxi.c
> > +++ b/arch/arm/mach-sunxi/sunxi.c
> > @@ -26,10 +26,11 @@ static const char * const sunxi_board_dt_compat[] = {
> >         "allwinner,sun4i-a10",
> >         "allwinner,sun5i-a10s",
> >         "allwinner,sun5i-a13",
> > +       "allwinner,sun5i-r8",
> >         NULL,
> >  };
> >
> > -DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
> > +DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
> 
> Nit: might want to mention the rename.

Indeed, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18 12:19   ` Maxime Ripard
@ 2015-09-18 13:18     ` Arnd Bergmann
  2015-09-18 13:55       ` Maxime Ripard
  0 siblings, 1 reply; 26+ messages in thread
From: Arnd Bergmann @ 2015-09-18 13:18 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Maxime Ripard, ulf.hansson, Mike Turquette, Stephen Boyd,
	linux-kernel, Hans de Goede, linux-sunxi, Chen-Yu Tsai,
	linux-clk

On Friday 18 September 2015 14:19:05 Maxime Ripard wrote:
> 
> There's actually two issues that are pretty orthogonal:
> 
>   * the fact that the regulator to power the wifi chip needs to be
>     enabled before it enumerates and the driver is probed. The MMC
>     pwrseq stuff seems to fix that, even if it doesn't really fit in
>     the usual DT model.

Ok. If there is anything missing in the pwrseq implementation or
binding at the moment, you'll have to work with Ulf to get it to
drive your hardware then.

>   * The fact that that regulator on this board is actually two
>     regulators in parallel that needs to be controlled in parallel
>     too. Here, it will probably require a new regulator driver to
>     combine two regulators into one.

I don't yet understand what it means to control them in parallel.
Do you mean the hardware uses two outputs to support a higher
current than you could do with one?

How critical is the timing? Would it be enough if the mmc
code knew how to set more than one regulator and do them
one at a time?

	Arnd

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

* Re: [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18 13:18     ` Arnd Bergmann
@ 2015-09-18 13:55       ` Maxime Ripard
  2015-09-18 13:58         ` Arnd Bergmann
  0 siblings, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-18 13:55 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, ulf.hansson, Mike Turquette, Stephen Boyd,
	linux-kernel, Hans de Goede, linux-sunxi, Chen-Yu Tsai,
	linux-clk

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

On Fri, Sep 18, 2015 at 03:18:57PM +0200, Arnd Bergmann wrote:
> On Friday 18 September 2015 14:19:05 Maxime Ripard wrote:
> > 
> > There's actually two issues that are pretty orthogonal:
> > 
> >   * the fact that the regulator to power the wifi chip needs to be
> >     enabled before it enumerates and the driver is probed. The MMC
> >     pwrseq stuff seems to fix that, even if it doesn't really fit in
> >     the usual DT model.
> 
> Ok. If there is anything missing in the pwrseq implementation or
> binding at the moment, you'll have to work with Ulf to get it to
> drive your hardware then.

Yep.

> >   * The fact that that regulator on this board is actually two
> >     regulators in parallel that needs to be controlled in parallel
> >     too. Here, it will probably require a new regulator driver to
> >     combine two regulators into one.
> 
> I don't yet understand what it means to control them in parallel.
> Do you mean the hardware uses two outputs to support a higher
> current than you could do with one?

Yes.

> How critical is the timing? Would it be enough if the mmc
> code knew how to set more than one regulator and do them
> one at a time?

I don't think it's critical as in both should happen exactly at the
same time (but I've not really tried it either, so I'm not 100% sure).

And I don't think it's something the MMC core should deal with. The
device itself has a single pin to provide its power, it's the board
that is wired that way. The way I was seeing it was more that I needed
to create a regulator driver that would take two inputs, that the mmc
core would use. Last time I discussed it with Mark (Brown), it semes
like he was open to the idea, so I just need to find some time to do
just that.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18 13:55       ` Maxime Ripard
@ 2015-09-18 13:58         ` Arnd Bergmann
  0 siblings, 0 replies; 26+ messages in thread
From: Arnd Bergmann @ 2015-09-18 13:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Maxime Ripard, ulf.hansson, Mike Turquette, Stephen Boyd,
	linux-kernel, Hans de Goede, linux-sunxi, Chen-Yu Tsai,
	linux-clk

On Friday 18 September 2015 15:55:38 Maxime Ripard wrote:
> 
> And I don't think it's something the MMC core should deal with. The
> device itself has a single pin to provide its power, it's the board
> that is wired that way. The way I was seeing it was more that I needed
> to create a regulator driver that would take two inputs, that the mmc
> core would use. Last time I discussed it with Mark (Brown), it semes
> like he was open to the idea, so I just need to find some time to do
> just that.
> 

Ok, fair enough.

	Arnd

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

* Re: [linux-sunxi] [PATCH 0/5] ARM: sunxi: Introduce CHIP support
  2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
                   ` (5 preceding siblings ...)
  2015-09-18  9:02 ` [PATCH 0/5] ARM: sunxi: Introduce CHIP support Arnd Bergmann
@ 2015-09-18 15:36 ` Hans de Goede
  6 siblings, 0 replies; 26+ messages in thread
From: Hans de Goede @ 2015-09-18 15:36 UTC (permalink / raw)
  To: Maxime Ripard, Mike Turquette, Stephen Boyd, linux-arm-kernel
  Cc: Chen-Yu Tsai, linux-clk, linux-kernel, linux-sunxi

Hi,

On 09/18/2015 04:48 AM, Maxime Ripard wrote:
> Hi,
>
> Here is a serie introducing the support for the Allwinner R8 and the
> Nextthing's CHIP.
>
> Support is almost complete for the CHIP itself, the only missing part
> for now is the WiFi chip that needs to be powered through two combined
> regulators (AXP209's LDO3 and LDO4). The audio codec is also missing
> since it's not already enabled in the DT.
>
> Both these features will be addressed eventually.
>
> Let me know what you think,

Assuming you will be fixing Chen-Yu's comments this series looks good
to me and is:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> Maxime
>
> Maxime Ripard (5):
>    ARM: sunxi: Add R8 support
>    ARM: sun5i: Add R8 DTSI
>    ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI
>    ARM: sun5i: dt: Add UART3 CTS and RTS pins
>    ARM: sun5i: Add C.H.I.P DTS
>
>   arch/arm/boot/dts/Makefile          |   3 +-
>   arch/arm/boot/dts/sun5i-a10s.dtsi   |   7 -
>   arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
>   arch/arm/boot/dts/sun5i-r8.dtsi     |  61 +++++++++
>   arch/arm/boot/dts/sun5i.dtsi        |  14 ++
>   arch/arm/mach-sunxi/sunxi.c         |   3 +-
>   drivers/clk/sunxi/clk-sunxi.c       |   1 +
>   7 files changed, 341 insertions(+), 9 deletions(-)
>   create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts
>   create mode 100644 arch/arm/boot/dts/sun5i-r8.dtsi
>

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

* Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-18  8:48 ` [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS Maxime Ripard
@ 2015-09-18 16:41   ` Chen-Yu Tsai
  2015-09-22 12:47     ` Maxime Ripard
  0 siblings, 1 reply; 26+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18 16:41 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Chen-Yu Tsai,
	Hans de Goede, linux-clk, linux-kernel, linux-sunxi

On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The C.H.I.P. is a small SBC with an Allwinner R8, 8GB of NAND, 512MB of
> RAM, USB host and OTG, a wifi / bluetooth combo chip, an audio/video jack
> and two connectors to plug additional boards on top of it.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/boot/dts/Makefile          |   3 +-
>  arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 263 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index b276174b670a..7efd37b907f1 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -599,7 +599,8 @@ dtb-$(CONFIG_MACH_SUN5I) += \
>         sun5i-a13-inet-98v-rev2.dtb \
>         sun5i-a13-olinuxino.dtb \
>         sun5i-a13-olinuxino-micro.dtb \
> -       sun5i-a13-utoo-p66.dtb
> +       sun5i-a13-utoo-p66.dtb \
> +       sun5i-r8-chip.dtb
>  dtb-$(CONFIG_MACH_SUN6I) += \
>         sun6i-a31-app4-evb1.dtb \
>         sun6i-a31-colombus.dtb \
> diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> new file mode 100644
> index 000000000000..6cb3c4f1cd61
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> @@ -0,0 +1,261 @@
> +/*
> + * Copyright 2015 Free Electrons
> + * Copyright 2015 NextThing Co
> + *
> + * Maxime Ripard <maxime.ripard@free-electrons.com>
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This file is distributed in the hope that it will be useful,
> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *     GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use,
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +#include "sun5i-a13.dtsi"
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +
> +/ {
> +       model = "NextThing C.H.I.P.";
> +       compatible = "nextthing,chip", "allwinner,sun5i-r8";
> +
> +       aliases {
> +               i2c0 = &i2c0;
> +               i2c1 = &i2c1;
> +               i2c2 = &i2c2;
> +               serial0 = &uart1;
> +               serial1 = &uart3;
> +       };
> +
> +       chosen {
> +               stdout-path = "serial0:115200n8";
> +       };
> +
> +       dram_vcc: dram_vcc {
> +               compatible = "regulator-fixed";
> +               regulator-name = "dram-vcc";
> +               regulator-min-microvolt = <1600000>;
> +               regulator-max-microvolt = <1600000>;
> +               vin-supply = <&ipsout>;
> +               regulator-always-on;
> +       };

Do we need this if it's not controllable?

> +
> +       ipsout: ipsout {
> +               compatible = "regulator-fixed";
> +               regulator-name = "ipsout";
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +               regulator-always-on;
> +       };

This isn't needed. What we might want is a proper representation
of the AXP209's power supply.

> +
> +       usb0_vbus: usb0_vbus {
> +               compatible = "regulator-fixed";
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&chip_vbus_pin>;
> +
> +               regulator-name = "vbus-usb0";
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +               vin-supply = <&vcc_5v0>;
> +               gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
> +               enable-active-high;
> +       };
> +
> +       vcc_3v3: vcc3v3 {
> +               compatible = "regulator-fixed";
> +               regulator-name = "vcc-3v3";
> +               regulator-min-microvolt = <3300000>;
> +               regulator-max-microvolt = <3300000>;
> +               vin-supply = <&ipsout>;
> +               regulator-always-on;
> +       };
> +
> +       vcc_5v0: vcc5v0 {
> +               compatible = "regulator-fixed";
> +               regulator-name = "vcc-5v0";
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +               vin-supply = <&ipsout>;
> +               regulator-always-on;
> +       };

We have these in sunxi-common-regulators.dtsi.

> +};
> +
> +&ehci0 {
> +       status = "okay";
> +};
> +
> +&i2c0 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&i2c0_pins_a>;
> +       status = "okay";
> +
> +       axp209: pmic@34 {
> +               reg = <0x34>;
> +
> +               /*
> +                * The interrupt is routed through the "External Fast
> +                 * Interrupt Request" pin (ball G13 of the module)
> +                 * directly to the main interrupt controller, without
> +                 * any other controller interfering.
> +                */
> +               interrupts = <0>;
> +       };
> +};
> +
> +#include "axp209.dtsi"
> +
> +/*
> + * i2c1 is routed to the external pins and doesn't have any device
> + * attached to it on the C.H.I.P itself.
> + */
> +&i2c1 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&i2c1_pins_a>;
> +       status = "okay";
> +};
> +
> +&i2c2 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&i2c2_pins_a>;
> +       status = "okay";
> +
> +       xio: gpio@38 {
> +               compatible = "nxp,pcf8574a";
> +               reg = <0x38>;
> +
> +               gpio-controller;
> +               #gpio-cells = <2>;
> +
> +               interrupt-parent = <&pio>;
> +               interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
> +               interrupt-controller;
> +               #interrupt-cells = <2>;
> +       };
> +};
> +
> +&mmc0 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&mmc0_pins_a>;
> +       vmmc-supply = <&vcc_3v3>;
> +       bus-width = <4>;
> +       non-removable;
> +       status = "okay";
> +};
> +
> +&ohci0 {
> +       status = "okay";
> +};
> +
> +&otg_sram {
> +       status = "okay";
> +};
> +
> +&pio {
> +       chip_vbus_pin: chip_vbus_pin@0 {
> +               allwinner,pins = "PB10";
> +               allwinner,function = "gpio_out";
> +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> +       };
> +
> +       chip_id_det_pin: chip_id_det_pin@0 {
> +               allwinner,pins = "PG2";
> +               allwinner,function = "gpio_in";
> +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> +       };
> +};
> +
> +&reg_dcdc2 {
> +       regulator-min-microvolt = <1000000>;
> +       regulator-max-microvolt = <1400000>;
> +       regulator-name = "cpuvdd";
> +       regulator-always-on;
> +};
> +
> +&reg_dcdc3 {
> +       regulator-min-microvolt = <1000000>;
> +       regulator-max-microvolt = <1300000>;
> +       regulator-name = "corevdd";
> +       regulator-always-on;
> +};
> +
> +&reg_ldo1 {
> +       regulator-name = "rtcvdd";
> +};
> +
> +&reg_ldo2 {
> +       regulator-min-microvolt = <2700000>;
> +       regulator-max-microvolt = <3300000>;

Maybe just fix this to 3.0V?

> +       regulator-name = "avcc";
> +       regulator-always-on;
> +};
> +
> +&reg_ldo5 {
> +       regulator-min-microvolt = <1800000>;
> +       regulator-max-microvolt = <1800000>;
> +       regulator-name = "vcc-1v8";

A comment here saying this is found on the header, and to be used
by overlays would be nice.

> +};
> +
> +&uart1 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&uart1_pins_b>;
> +       status = "okay";
> +};
> +
> +&uart3 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&uart3_pins_a>,
> +                   <&uart3_pins_cts_rts_a>;
> +       status = "okay";
> +};
> +
> +&usb_otg {
> +       dr_mode = "otg";
> +       status = "okay";
> +};
> +
> +&usbphy {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&chip_id_det_pin>;
> +       status = "okay";
> +
> +       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */

Better leave a comment here saying VBUS detection requires AXP209
usb-power-supply support.

> +
> +       usb0_vbus-supply = <&usb0_vbus>;
> +       usb1_vbus-supply = <&vcc_5v0>;
> +};
> --
> 2.5.1
>

Thanks!

ChenYu

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

* Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-18 16:41   ` Chen-Yu Tsai
@ 2015-09-22 12:47     ` Maxime Ripard
  2015-09-22 12:57       ` [linux-sunxi] " Chen-Yu Tsai
  0 siblings, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-22 12:47 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, Hans de Goede,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 11487 bytes --]

On Sat, Sep 19, 2015 at 12:41:07AM +0800, Chen-Yu Tsai wrote:
> On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The C.H.I.P. is a small SBC with an Allwinner R8, 8GB of NAND, 512MB of
> > RAM, USB host and OTG, a wifi / bluetooth combo chip, an audio/video jack
> > and two connectors to plug additional boards on top of it.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  arch/arm/boot/dts/Makefile          |   3 +-
> >  arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
> >  2 files changed, 263 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts
> >
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index b276174b670a..7efd37b907f1 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -599,7 +599,8 @@ dtb-$(CONFIG_MACH_SUN5I) += \
> >         sun5i-a13-inet-98v-rev2.dtb \
> >         sun5i-a13-olinuxino.dtb \
> >         sun5i-a13-olinuxino-micro.dtb \
> > -       sun5i-a13-utoo-p66.dtb
> > +       sun5i-a13-utoo-p66.dtb \
> > +       sun5i-r8-chip.dtb
> >  dtb-$(CONFIG_MACH_SUN6I) += \
> >         sun6i-a31-app4-evb1.dtb \
> >         sun6i-a31-colombus.dtb \
> > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > new file mode 100644
> > index 000000000000..6cb3c4f1cd61
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > @@ -0,0 +1,261 @@
> > +/*
> > + * Copyright 2015 Free Electrons
> > + * Copyright 2015 NextThing Co
> > + *
> > + * Maxime Ripard <maxime.ripard@free-electrons.com>
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + *     modify it under the terms of the GNU General Public License as
> > + *     published by the Free Software Foundation; either version 2 of the
> > + *     License, or (at your option) any later version.
> > + *
> > + *     This file is distributed in the hope that it will be useful,
> > + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *     GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + *     obtaining a copy of this software and associated documentation
> > + *     files (the "Software"), to deal in the Software without
> > + *     restriction, including without limitation the rights to use,
> > + *     copy, modify, merge, publish, distribute, sublicense, and/or
> > + *     sell copies of the Software, and to permit persons to whom the
> > + *     Software is furnished to do so, subject to the following
> > + *     conditions:
> > + *
> > + *     The above copyright notice and this permission notice shall be
> > + *     included in all copies or substantial portions of the Software.
> > + *
> > + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + *     OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include "sun5i-a13.dtsi"
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/interrupt-controller/irq.h>
> > +
> > +/ {
> > +       model = "NextThing C.H.I.P.";
> > +       compatible = "nextthing,chip", "allwinner,sun5i-r8";
> > +
> > +       aliases {
> > +               i2c0 = &i2c0;
> > +               i2c1 = &i2c1;
> > +               i2c2 = &i2c2;
> > +               serial0 = &uart1;
> > +               serial1 = &uart3;
> > +       };
> > +
> > +       chosen {
> > +               stdout-path = "serial0:115200n8";
> > +       };
> > +
> > +       dram_vcc: dram_vcc {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "dram-vcc";
> > +               regulator-min-microvolt = <1600000>;
> > +               regulator-max-microvolt = <1600000>;
> > +               vin-supply = <&ipsout>;
> > +               regulator-always-on;
> > +       };
> 
> Do we need this if it's not controllable?

Probably not, except if we want a comprehensive regulator tree.

> > +
> > +       ipsout: ipsout {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "ipsout";
> > +               regulator-min-microvolt = <5000000>;
> > +               regulator-max-microvolt = <5000000>;
> > +               regulator-always-on;
> > +       };
> 
> This isn't needed. What we might want is a proper representation
> of the AXP209's power supply.

Probably.

> > +
> > +       usb0_vbus: usb0_vbus {
> > +               compatible = "regulator-fixed";
> > +               pinctrl-names = "default";
> > +               pinctrl-0 = <&chip_vbus_pin>;
> > +
> > +               regulator-name = "vbus-usb0";
> > +               regulator-min-microvolt = <5000000>;
> > +               regulator-max-microvolt = <5000000>;
> > +               vin-supply = <&vcc_5v0>;
> > +               gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
> > +               enable-active-high;
> > +       };
> > +
> > +       vcc_3v3: vcc3v3 {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "vcc-3v3";
> > +               regulator-min-microvolt = <3300000>;
> > +               regulator-max-microvolt = <3300000>;
> > +               vin-supply = <&ipsout>;
> > +               regulator-always-on;
> > +       };
> > +
> > +       vcc_5v0: vcc5v0 {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "vcc-5v0";
> > +               regulator-min-microvolt = <5000000>;
> > +               regulator-max-microvolt = <5000000>;
> > +               vin-supply = <&ipsout>;
> > +               regulator-always-on;
> > +       };
> 
> We have these in sunxi-common-regulators.dtsi.

True, I'll change that.

> 
> > +};
> > +
> > +&ehci0 {
> > +       status = "okay";
> > +};
> > +
> > +&i2c0 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&i2c0_pins_a>;
> > +       status = "okay";
> > +
> > +       axp209: pmic@34 {
> > +               reg = <0x34>;
> > +
> > +               /*
> > +                * The interrupt is routed through the "External Fast
> > +                 * Interrupt Request" pin (ball G13 of the module)
> > +                 * directly to the main interrupt controller, without
> > +                 * any other controller interfering.
> > +                */
> > +               interrupts = <0>;
> > +       };
> > +};
> > +
> > +#include "axp209.dtsi"
> > +
> > +/*
> > + * i2c1 is routed to the external pins and doesn't have any device
> > + * attached to it on the C.H.I.P itself.
> > + */
> > +&i2c1 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&i2c1_pins_a>;
> > +       status = "okay";
> > +};
> > +
> > +&i2c2 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&i2c2_pins_a>;
> > +       status = "okay";
> > +
> > +       xio: gpio@38 {
> > +               compatible = "nxp,pcf8574a";
> > +               reg = <0x38>;
> > +
> > +               gpio-controller;
> > +               #gpio-cells = <2>;
> > +
> > +               interrupt-parent = <&pio>;
> > +               interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
> > +               interrupt-controller;
> > +               #interrupt-cells = <2>;
> > +       };
> > +};
> > +
> > +&mmc0 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&mmc0_pins_a>;
> > +       vmmc-supply = <&vcc_3v3>;
> > +       bus-width = <4>;
> > +       non-removable;
> > +       status = "okay";
> > +};
> > +
> > +&ohci0 {
> > +       status = "okay";
> > +};
> > +
> > +&otg_sram {
> > +       status = "okay";
> > +};
> > +
> > +&pio {
> > +       chip_vbus_pin: chip_vbus_pin@0 {
> > +               allwinner,pins = "PB10";
> > +               allwinner,function = "gpio_out";
> > +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> > +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> > +       };
> > +
> > +       chip_id_det_pin: chip_id_det_pin@0 {
> > +               allwinner,pins = "PG2";
> > +               allwinner,function = "gpio_in";
> > +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> > +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> > +       };
> > +};
> > +
> > +&reg_dcdc2 {
> > +       regulator-min-microvolt = <1000000>;
> > +       regulator-max-microvolt = <1400000>;
> > +       regulator-name = "cpuvdd";
> > +       regulator-always-on;
> > +};
> > +
> > +&reg_dcdc3 {
> > +       regulator-min-microvolt = <1000000>;
> > +       regulator-max-microvolt = <1300000>;
> > +       regulator-name = "corevdd";
> > +       regulator-always-on;
> > +};
> > +
> > +&reg_ldo1 {
> > +       regulator-name = "rtcvdd";
> > +};
> > +
> > +&reg_ldo2 {
> > +       regulator-min-microvolt = <2700000>;
> > +       regulator-max-microvolt = <3300000>;
> 
> Maybe just fix this to 3.0V?

Those are constraints that the board can accept. We have that
information, why lie about it?

> 
> > +       regulator-name = "avcc";
> > +       regulator-always-on;
> > +};
> > +
> > +&reg_ldo5 {
> > +       regulator-min-microvolt = <1800000>;
> > +       regulator-max-microvolt = <1800000>;
> > +       regulator-name = "vcc-1v8";
> 
> A comment here saying this is found on the header, and to be used
> by overlays would be nice.

There's open schematics for that kind of information.

> > +};
> > +
> > +&uart1 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&uart1_pins_b>;
> > +       status = "okay";
> > +};
> > +
> > +&uart3 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&uart3_pins_a>,
> > +                   <&uart3_pins_cts_rts_a>;
> > +       status = "okay";
> > +};
> > +
> > +&usb_otg {
> > +       dr_mode = "otg";
> > +       status = "okay";
> > +};
> > +
> > +&usbphy {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&chip_id_det_pin>;
> > +       status = "okay";
> > +
> > +       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
> 
> Better leave a comment here saying VBUS detection requires AXP209
> usb-power-supply support.

Does it? It can be powered by a battery, with or without VBUS, and
that wouldn't be tied to the fact that the power-supply is USB or
something else.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 12:47     ` Maxime Ripard
@ 2015-09-22 12:57       ` Chen-Yu Tsai
  2015-09-22 13:01         ` Hans de Goede
  0 siblings, 1 reply; 26+ messages in thread
From: Chen-Yu Tsai @ 2015-09-22 12:57 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Mike Turquette, Stephen Boyd, linux-arm-kernel,
	Hans de Goede, linux-clk, linux-kernel, linux-sunxi

On Tue, Sep 22, 2015 at 8:47 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Sat, Sep 19, 2015 at 12:41:07AM +0800, Chen-Yu Tsai wrote:
>> On Fri, Sep 18, 2015 at 4:48 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The C.H.I.P. is a small SBC with an Allwinner R8, 8GB of NAND, 512MB of
>> > RAM, USB host and OTG, a wifi / bluetooth combo chip, an audio/video jack
>> > and two connectors to plug additional boards on top of it.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> > ---
>> >  arch/arm/boot/dts/Makefile          |   3 +-
>> >  arch/arm/boot/dts/sun5i-r8-chip.dts | 261 ++++++++++++++++++++++++++++++++++++
>> >  2 files changed, 263 insertions(+), 1 deletion(-)
>> >  create mode 100644 arch/arm/boot/dts/sun5i-r8-chip.dts
>> >
>> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>> > index b276174b670a..7efd37b907f1 100644
>> > --- a/arch/arm/boot/dts/Makefile
>> > +++ b/arch/arm/boot/dts/Makefile
>> > @@ -599,7 +599,8 @@ dtb-$(CONFIG_MACH_SUN5I) += \
>> >         sun5i-a13-inet-98v-rev2.dtb \
>> >         sun5i-a13-olinuxino.dtb \
>> >         sun5i-a13-olinuxino-micro.dtb \
>> > -       sun5i-a13-utoo-p66.dtb
>> > +       sun5i-a13-utoo-p66.dtb \
>> > +       sun5i-r8-chip.dtb
>> >  dtb-$(CONFIG_MACH_SUN6I) += \
>> >         sun6i-a31-app4-evb1.dtb \
>> >         sun6i-a31-colombus.dtb \
>> > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
>> > new file mode 100644
>> > index 000000000000..6cb3c4f1cd61
>> > --- /dev/null
>> > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
>> > @@ -0,0 +1,261 @@
>> > +/*
>> > + * Copyright 2015 Free Electrons
>> > + * Copyright 2015 NextThing Co
>> > + *
>> > + * Maxime Ripard <maxime.ripard@free-electrons.com>
>> > + *
>> > + * This file is dual-licensed: you can use it either under the terms
>> > + * of the GPL or the X11 license, at your option. Note that this dual
>> > + * licensing only applies to this file, and not this project as a
>> > + * whole.
>> > + *
>> > + *  a) This file is free software; you can redistribute it and/or
>> > + *     modify it under the terms of the GNU General Public License as
>> > + *     published by the Free Software Foundation; either version 2 of the
>> > + *     License, or (at your option) any later version.
>> > + *
>> > + *     This file is distributed in the hope that it will be useful,
>> > + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > + *     GNU General Public License for more details.
>> > + *
>> > + * Or, alternatively,
>> > + *
>> > + *  b) Permission is hereby granted, free of charge, to any person
>> > + *     obtaining a copy of this software and associated documentation
>> > + *     files (the "Software"), to deal in the Software without
>> > + *     restriction, including without limitation the rights to use,
>> > + *     copy, modify, merge, publish, distribute, sublicense, and/or
>> > + *     sell copies of the Software, and to permit persons to whom the
>> > + *     Software is furnished to do so, subject to the following
>> > + *     conditions:
>> > + *
>> > + *     The above copyright notice and this permission notice shall be
>> > + *     included in all copies or substantial portions of the Software.
>> > + *
>> > + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> > + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> > + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> > + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> > + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> > + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> > + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> > + *     OTHER DEALINGS IN THE SOFTWARE.
>> > + */
>> > +
>> > +/dts-v1/;
>> > +#include "sun5i-a13.dtsi"
>> > +
>> > +#include <dt-bindings/gpio/gpio.h>
>> > +#include <dt-bindings/interrupt-controller/irq.h>
>> > +
>> > +/ {
>> > +       model = "NextThing C.H.I.P.";
>> > +       compatible = "nextthing,chip", "allwinner,sun5i-r8";
>> > +
>> > +       aliases {
>> > +               i2c0 = &i2c0;
>> > +               i2c1 = &i2c1;
>> > +               i2c2 = &i2c2;
>> > +               serial0 = &uart1;
>> > +               serial1 = &uart3;
>> > +       };
>> > +
>> > +       chosen {
>> > +               stdout-path = "serial0:115200n8";
>> > +       };
>> > +
>> > +       dram_vcc: dram_vcc {
>> > +               compatible = "regulator-fixed";
>> > +               regulator-name = "dram-vcc";
>> > +               regulator-min-microvolt = <1600000>;
>> > +               regulator-max-microvolt = <1600000>;
>> > +               vin-supply = <&ipsout>;
>> > +               regulator-always-on;
>> > +       };
>>
>> Do we need this if it's not controllable?
>
> Probably not, except if we want a comprehensive regulator tree.
>
>> > +
>> > +       ipsout: ipsout {
>> > +               compatible = "regulator-fixed";
>> > +               regulator-name = "ipsout";
>> > +               regulator-min-microvolt = <5000000>;
>> > +               regulator-max-microvolt = <5000000>;
>> > +               regulator-always-on;
>> > +       };
>>
>> This isn't needed. What we might want is a proper representation
>> of the AXP209's power supply.
>
> Probably.
>
>> > +
>> > +       usb0_vbus: usb0_vbus {
>> > +               compatible = "regulator-fixed";
>> > +               pinctrl-names = "default";
>> > +               pinctrl-0 = <&chip_vbus_pin>;
>> > +
>> > +               regulator-name = "vbus-usb0";
>> > +               regulator-min-microvolt = <5000000>;
>> > +               regulator-max-microvolt = <5000000>;
>> > +               vin-supply = <&vcc_5v0>;
>> > +               gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
>> > +               enable-active-high;
>> > +       };
>> > +
>> > +       vcc_3v3: vcc3v3 {
>> > +               compatible = "regulator-fixed";
>> > +               regulator-name = "vcc-3v3";
>> > +               regulator-min-microvolt = <3300000>;
>> > +               regulator-max-microvolt = <3300000>;
>> > +               vin-supply = <&ipsout>;
>> > +               regulator-always-on;
>> > +       };
>> > +
>> > +       vcc_5v0: vcc5v0 {
>> > +               compatible = "regulator-fixed";
>> > +               regulator-name = "vcc-5v0";
>> > +               regulator-min-microvolt = <5000000>;
>> > +               regulator-max-microvolt = <5000000>;
>> > +               vin-supply = <&ipsout>;
>> > +               regulator-always-on;
>> > +       };
>>
>> We have these in sunxi-common-regulators.dtsi.
>
> True, I'll change that.
>
>>
>> > +};
>> > +
>> > +&ehci0 {
>> > +       status = "okay";
>> > +};
>> > +
>> > +&i2c0 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&i2c0_pins_a>;
>> > +       status = "okay";
>> > +
>> > +       axp209: pmic@34 {
>> > +               reg = <0x34>;
>> > +
>> > +               /*
>> > +                * The interrupt is routed through the "External Fast
>> > +                 * Interrupt Request" pin (ball G13 of the module)
>> > +                 * directly to the main interrupt controller, without
>> > +                 * any other controller interfering.
>> > +                */
>> > +               interrupts = <0>;
>> > +       };
>> > +};
>> > +
>> > +#include "axp209.dtsi"
>> > +
>> > +/*
>> > + * i2c1 is routed to the external pins and doesn't have any device
>> > + * attached to it on the C.H.I.P itself.
>> > + */
>> > +&i2c1 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&i2c1_pins_a>;
>> > +       status = "okay";
>> > +};
>> > +
>> > +&i2c2 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&i2c2_pins_a>;
>> > +       status = "okay";
>> > +
>> > +       xio: gpio@38 {
>> > +               compatible = "nxp,pcf8574a";
>> > +               reg = <0x38>;
>> > +
>> > +               gpio-controller;
>> > +               #gpio-cells = <2>;
>> > +
>> > +               interrupt-parent = <&pio>;
>> > +               interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
>> > +               interrupt-controller;
>> > +               #interrupt-cells = <2>;
>> > +       };
>> > +};
>> > +
>> > +&mmc0 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&mmc0_pins_a>;
>> > +       vmmc-supply = <&vcc_3v3>;
>> > +       bus-width = <4>;
>> > +       non-removable;
>> > +       status = "okay";
>> > +};
>> > +
>> > +&ohci0 {
>> > +       status = "okay";
>> > +};
>> > +
>> > +&otg_sram {
>> > +       status = "okay";
>> > +};
>> > +
>> > +&pio {
>> > +       chip_vbus_pin: chip_vbus_pin@0 {
>> > +               allwinner,pins = "PB10";
>> > +               allwinner,function = "gpio_out";
>> > +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
>> > +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>> > +       };
>> > +
>> > +       chip_id_det_pin: chip_id_det_pin@0 {
>> > +               allwinner,pins = "PG2";
>> > +               allwinner,function = "gpio_in";
>> > +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
>> > +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>> > +       };
>> > +};
>> > +
>> > +&reg_dcdc2 {
>> > +       regulator-min-microvolt = <1000000>;
>> > +       regulator-max-microvolt = <1400000>;
>> > +       regulator-name = "cpuvdd";
>> > +       regulator-always-on;
>> > +};
>> > +
>> > +&reg_dcdc3 {
>> > +       regulator-min-microvolt = <1000000>;
>> > +       regulator-max-microvolt = <1300000>;
>> > +       regulator-name = "corevdd";
>> > +       regulator-always-on;
>> > +};
>> > +
>> > +&reg_ldo1 {
>> > +       regulator-name = "rtcvdd";
>> > +};
>> > +
>> > +&reg_ldo2 {
>> > +       regulator-min-microvolt = <2700000>;
>> > +       regulator-max-microvolt = <3300000>;
>>
>> Maybe just fix this to 3.0V?
>
> Those are constraints that the board can accept. We have that
> information, why lie about it?

I'm ok either way. We fixed it to 3.0V for the cubieboard2 and the cubietruck.

>>
>> > +       regulator-name = "avcc";
>> > +       regulator-always-on;
>> > +};
>> > +
>> > +&reg_ldo5 {
>> > +       regulator-min-microvolt = <1800000>;
>> > +       regulator-max-microvolt = <1800000>;
>> > +       regulator-name = "vcc-1v8";
>>
>> A comment here saying this is found on the header, and to be used
>> by overlays would be nice.
>
> There's open schematics for that kind of information.

Fair enough.

>> > +};
>> > +
>> > +&uart1 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&uart1_pins_b>;
>> > +       status = "okay";
>> > +};
>> > +
>> > +&uart3 {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&uart3_pins_a>,
>> > +                   <&uart3_pins_cts_rts_a>;
>> > +       status = "okay";
>> > +};
>> > +
>> > +&usb_otg {
>> > +       dr_mode = "otg";
>> > +       status = "okay";
>> > +};
>> > +
>> > +&usbphy {
>> > +       pinctrl-names = "default";
>> > +       pinctrl-0 = <&chip_id_det_pin>;
>> > +       status = "okay";
>> > +
>> > +       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
>>
>> Better leave a comment here saying VBUS detection requires AXP209
>> usb-power-supply support.
>
> Does it? It can be powered by a battery, with or without VBUS, and
> that wouldn't be tied to the fact that the power-supply is USB or
> something else.

The AXP209 VBUS / USB power-supply also doubles for VBUS detection,
which on most boards is done using a separate GPIO pin. Hans posted
support for the AXP20X power-supply driver, and support in the usb
phy driver using it for VBUS detection.

In short, this is not about "power supply" but VBUS detection. IIRC,
if no VBUS detection method is provided, the phy driver just waits a
period of time after an ID pin change and then considers VBUS invalid.


Regards
ChenYu

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 12:57       ` [linux-sunxi] " Chen-Yu Tsai
@ 2015-09-22 13:01         ` Hans de Goede
  2015-09-22 13:34           ` Hans de Goede
  2015-09-22 14:04           ` Maxime Ripard
  0 siblings, 2 replies; 26+ messages in thread
From: Hans de Goede @ 2015-09-22 13:01 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, linux-clk,
	linux-kernel, linux-sunxi

Hi,

On 22-09-15 14:57, Chen-Yu Tsai wrote:
> On Tue, Sep 22, 2015 at 8:47 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:

<snip>

>>>> +&usb_otg {
>>>> +       dr_mode = "otg";
>>>> +       status = "okay";
>>>> +};
>>>> +
>>>> +&usbphy {
>>>> +       pinctrl-names = "default";
>>>> +       pinctrl-0 = <&chip_id_det_pin>;
>>>> +       status = "okay";
>>>> +
>>>> +       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
>>>
>>> Better leave a comment here saying VBUS detection requires AXP209
>>> usb-power-supply support.
>>
>> Does it? It can be powered by a battery, with or without VBUS, and
>> that wouldn't be tied to the fact that the power-supply is USB or
>> something else.
>
> The AXP209 VBUS / USB power-supply also doubles for VBUS detection,
> which on most boards is done using a separate GPIO pin. Hans posted
> support for the AXP20X power-supply driver, and support in the usb
> phy driver using it for VBUS detection.

Ack.

> In short, this is not about "power supply" but VBUS detection. IIRC,
> if no VBUS detection method is provided, the phy driver just waits a
> period of time after an ID pin change and then considers VBUS invalid.

Right, but that is a hack for boards with no / broken vbus detection
(or vbus control), we really want to use vbus-det where available,
so I agree that a TODO comment here would be good.

Regards,

Hans

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 13:01         ` Hans de Goede
@ 2015-09-22 13:34           ` Hans de Goede
  2015-09-22 14:04           ` Maxime Ripard
  1 sibling, 0 replies; 26+ messages in thread
From: Hans de Goede @ 2015-09-22 13:34 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard
  Cc: Mike Turquette, Stephen Boyd, linux-arm-kernel, linux-clk,
	linux-kernel, linux-sunxi

Hi,

On 22-09-15 15:01, Hans de Goede wrote:
> Hi,
>
> On 22-09-15 14:57, Chen-Yu Tsai wrote:
>> On Tue, Sep 22, 2015 at 8:47 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>
> <snip>
>
>>>>> +&usb_otg {
>>>>> +       dr_mode = "otg";
>>>>> +       status = "okay";
>>>>> +};
>>>>> +
>>>>> +&usbphy {
>>>>> +       pinctrl-names = "default";
>>>>> +       pinctrl-0 = <&chip_id_det_pin>;
>>>>> +       status = "okay";
>>>>> +
>>>>> +       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
>>>>
>>>> Better leave a comment here saying VBUS detection requires AXP209
>>>> usb-power-supply support.
>>>
>>> Does it? It can be powered by a battery, with or without VBUS, and
>>> that wouldn't be tied to the fact that the power-supply is USB or
>>> something else.
>>
>> The AXP209 VBUS / USB power-supply also doubles for VBUS detection,
>> which on most boards is done using a separate GPIO pin. Hans posted
>> support for the AXP20X power-supply driver, and support in the usb
>> phy driver using it for VBUS detection.
>
> Ack.
>
>> In short, this is not about "power supply" but VBUS detection. IIRC,
>> if no VBUS detection method is provided, the phy driver just waits a
>> period of time after an ID pin change and then considers VBUS invalid.
>
> Right, but that is a hack for boards with no / broken vbus detection
> (or vbus control), we really want to use vbus-det where available,
> so I agree that a TODO comment here would be good.

The axp209 usb-power-supply has just been merged into
linux-power-supply/next so even better we can simply update axp209.dtsi
with the node, and add do the right thing in the CHIP dts right away.

I'll send out all the dts patches which I've had queued up waiting
for this driver to get merged, including the axp209.dtsi changes.

Regards,

Hans





>
> Regards,
>
> Hans

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 13:01         ` Hans de Goede
  2015-09-22 13:34           ` Hans de Goede
@ 2015-09-22 14:04           ` Maxime Ripard
  2015-09-22 14:30             ` Hans de Goede
  1 sibling, 1 reply; 26+ messages in thread
From: Maxime Ripard @ 2015-09-22 14:04 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Chen-Yu Tsai, Mike Turquette, Stephen Boyd, linux-arm-kernel,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Tue, Sep 22, 2015 at 03:01:58PM +0200, Hans de Goede wrote:
> >In short, this is not about "power supply" but VBUS detection. IIRC,
> >if no VBUS detection method is provided, the phy driver just waits a
> >period of time after an ID pin change and then considers VBUS invalid.
> 
> Right, but that is a hack for boards with no / broken vbus detection
> (or vbus control), we really want to use vbus-det where available,
> so I agree that a TODO comment here would be good.

What's so special in our SoCs that makes that we can't just rely on
the ID pin ? (which seems to be working just fine here)

Other SoCs don't need to rely on such a hack as well.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 14:04           ` Maxime Ripard
@ 2015-09-22 14:30             ` Hans de Goede
  2015-09-29 19:36               ` Maxime Ripard
  0 siblings, 1 reply; 26+ messages in thread
From: Hans de Goede @ 2015-09-22 14:30 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Mike Turquette, Stephen Boyd, linux-arm-kernel,
	linux-clk, linux-kernel, linux-sunxi

Hi,

On 22-09-15 16:04, Maxime Ripard wrote:
> On Tue, Sep 22, 2015 at 03:01:58PM +0200, Hans de Goede wrote:
>>> In short, this is not about "power supply" but VBUS detection. IIRC,
>>> if no VBUS detection method is provided, the phy driver just waits a
>>> period of time after an ID pin change and then considers VBUS invalid.
>>
>> Right, but that is a hack for boards with no / broken vbus detection
>> (or vbus control), we really want to use vbus-det where available,
>> so I agree that a TODO comment here would be good.
>
> What's so special in our SoCs that makes that we can't just rely on
> the ID pin ? (which seems to be working just fine here)

There is nothing special, AFAIK all OTG ports (also for other SoCs)
have some sort of vbus detection mechanism. We need the hack because
vbus-det is broken on some of our boards.

And where it is not broken we should be using vbus-det normallu.

Regards,

Hans

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

* Re: [linux-sunxi] Re: [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS
  2015-09-22 14:30             ` Hans de Goede
@ 2015-09-29 19:36               ` Maxime Ripard
  0 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-09-29 19:36 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Chen-Yu Tsai, Mike Turquette, Stephen Boyd, linux-arm-kernel,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

On Tue, Sep 22, 2015 at 04:30:04PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 22-09-15 16:04, Maxime Ripard wrote:
> >On Tue, Sep 22, 2015 at 03:01:58PM +0200, Hans de Goede wrote:
> >>>In short, this is not about "power supply" but VBUS detection. IIRC,
> >>>if no VBUS detection method is provided, the phy driver just waits a
> >>>period of time after an ID pin change and then considers VBUS invalid.
> >>
> >>Right, but that is a hack for boards with no / broken vbus detection
> >>(or vbus control), we really want to use vbus-det where available,
> >>so I agree that a TODO comment here would be good.
> >
> >What's so special in our SoCs that makes that we can't just rely on
> >the ID pin ? (which seems to be working just fine here)
> 
> There is nothing special, AFAIK all OTG ports (also for other SoCs)
> have some sort of vbus detection mechanism. We need the hack because
> vbus-det is broken on some of our boards.
> 
> And where it is not broken we should be using vbus-det normallu.

Ah, and most controllers embed that directly into the controller
itself and don't rely on a GPIO to do that. Understood.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/5] ARM: sunxi: Add R8 support
  2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
  2015-09-18  9:47   ` Chen-Yu Tsai
@ 2015-09-30 22:38   ` Stephen Boyd
  2015-10-01  6:58     ` Maxime Ripard
  1 sibling, 1 reply; 26+ messages in thread
From: Stephen Boyd @ 2015-09-30 22:38 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mike Turquette, linux-arm-kernel, Chen-Yu Tsai, Hans de Goede,
	linux-clk, linux-kernel, linux-sunxi

On 09/18, Maxime Ripard wrote:
> The R8 is a new Allwinner SoC based on the A13. While both are very
> similar, there's still a few differences. Introduce a new compatible to
> deal with them.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---

Acked-by: Stephen Boyd <sboyd@codeaurora.org>

BTW, why is the entire series sent To: Mike and I? Are these
patches intended to go through clk tree?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 1/5] ARM: sunxi: Add R8 support
  2015-09-30 22:38   ` Stephen Boyd
@ 2015-10-01  6:58     ` Maxime Ripard
  0 siblings, 0 replies; 26+ messages in thread
From: Maxime Ripard @ 2015-10-01  6:58 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mike Turquette, linux-arm-kernel, Chen-Yu Tsai, Hans de Goede,
	linux-clk, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Wed, Sep 30, 2015 at 03:38:29PM -0700, Stephen Boyd wrote:
> On 09/18, Maxime Ripard wrote:
> > The R8 is a new Allwinner SoC based on the A13. While both are very
> > similar, there's still a few differences. Introduce a new compatible to
> > deal with them.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> 
> Acked-by: Stephen Boyd <sboyd@codeaurora.org>
> 
> BTW, why is the entire series sent To: Mike and I? Are these
> patches intended to go through clk tree?

I wanted to have the Ack from one of you on this patch. I usually
prefer to have the whole serie instead of a single out of context
patch, just let me know if you feel otherwise :)

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-10-01  6:59 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18  8:48 [PATCH 0/5] ARM: sunxi: Introduce CHIP support Maxime Ripard
2015-09-18  8:48 ` [PATCH 1/5] ARM: sunxi: Add R8 support Maxime Ripard
2015-09-18  9:47   ` Chen-Yu Tsai
2015-09-18 12:20     ` Maxime Ripard
2015-09-30 22:38   ` Stephen Boyd
2015-10-01  6:58     ` Maxime Ripard
2015-09-18  8:48 ` [PATCH 2/5] ARM: sun5i: Add R8 DTSI Maxime Ripard
2015-09-18  9:41   ` Chen-Yu Tsai
2015-09-18 12:19     ` Maxime Ripard
2015-09-18  8:48 ` [PATCH 3/5] ARM: sun5i: dt: Move uart3 pinctrl node to common DTSI Maxime Ripard
2015-09-18  8:48 ` [PATCH 4/5] ARM: sun5i: dt: Add UART3 CTS and RTS pins Maxime Ripard
2015-09-18  8:48 ` [PATCH 5/5] ARM: sun5i: Add C.H.I.P DTS Maxime Ripard
2015-09-18 16:41   ` Chen-Yu Tsai
2015-09-22 12:47     ` Maxime Ripard
2015-09-22 12:57       ` [linux-sunxi] " Chen-Yu Tsai
2015-09-22 13:01         ` Hans de Goede
2015-09-22 13:34           ` Hans de Goede
2015-09-22 14:04           ` Maxime Ripard
2015-09-22 14:30             ` Hans de Goede
2015-09-29 19:36               ` Maxime Ripard
2015-09-18  9:02 ` [PATCH 0/5] ARM: sunxi: Introduce CHIP support Arnd Bergmann
2015-09-18 12:19   ` Maxime Ripard
2015-09-18 13:18     ` Arnd Bergmann
2015-09-18 13:55       ` Maxime Ripard
2015-09-18 13:58         ` Arnd Bergmann
2015-09-18 15:36 ` [linux-sunxi] " Hans de Goede

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).