diff mbox

[2/3] ARM: dts: sun5i: Add sun5i-q8-common.dtsi

Message ID 1441464953-26351-2-git-send-email-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede Sept. 5, 2015, 2:55 p.m. UTC
This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
serial console, and PG0 for card-detect for mmc0.

This also adds pmic and otg support, which both use the same config on
all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
because pmic / otg support for sun8i has not yet been merged.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/arm/boot/dts/sun5i-q8-common.dtsi | 170 +++++++++++++++++++++++++++++++++
 1 file changed, 170 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun5i-q8-common.dtsi

Comments

Maxime Ripard Sept. 8, 2015, 2:33 p.m. UTC | #1
On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
> This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
> files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
> serial console, and PG0 for card-detect for mmc0.
> 
> This also adds pmic and otg support, which both use the same config on
> all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
> because pmic / otg support for sun8i has not yet been merged.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Are we going to have any user but the one you posted in the patch 3
planned?

Thanks,
Maxime
Hans de Goede Sept. 8, 2015, 9:26 p.m. UTC | #2
Hi,

On 09/08/2015 04:33 PM, Maxime Ripard wrote:
> On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
>> This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
>> files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
>> serial console, and PG0 for card-detect for mmc0.
>>
>> This also adds pmic and otg support, which both use the same config on
>> all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
>> because pmic / otg support for sun8i has not yet been merged.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Are we going to have any user but the one you posted in the patch 3
> planned?

Depends on what I can get my hands on / what is in the post atm.

One difference in fex files of different 18 variants is how the usb wifi is
powered, either via a gpio or via ldo3. Also there are differences in which
accelerometer is used, so eventually I expect there to be several users
of this dtsi.

I've bought several second hand q8 formfactor tablets on the internet lately,
when they arrive and I get around to work on them a second user may show
up soon.

Regards,

Hans
Maxime Ripard Sept. 9, 2015, 2:01 p.m. UTC | #3
On Tue, Sep 08, 2015 at 11:26:51PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 09/08/2015 04:33 PM, Maxime Ripard wrote:
> >On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
> >>This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
> >>files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
> >>serial console, and PG0 for card-detect for mmc0.
> >>
> >>This also adds pmic and otg support, which both use the same config on
> >>all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
> >>because pmic / otg support for sun8i has not yet been merged.
> >>
> >>Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >
> >Are we going to have any user but the one you posted in the patch 3
> >planned?
> 
> Depends on what I can get my hands on / what is in the post atm.
> 
> One difference in fex files of different 18 variants is how the usb wifi is
> powered, either via a gpio or via ldo3. Also there are differences in which
> accelerometer is used, so eventually I expect there to be several users
> of this dtsi.

But no difference in the SoC used (A13 vs A10s)?

I'm not sure having 18 DTs for a single board name is going to be
really helpful. It would be something to be supported by some quirks
mechanism, instead of having to require the user to pick the right one.

Maxime
Hans de Goede Sept. 10, 2015, 3:05 p.m. UTC | #4
Hi,

On 09-09-15 16:01, Maxime Ripard wrote:
> On Tue, Sep 08, 2015 at 11:26:51PM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 09/08/2015 04:33 PM, Maxime Ripard wrote:
>>> On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
>>>> This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
>>>> files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
>>>> serial console, and PG0 for card-detect for mmc0.
>>>>
>>>> This also adds pmic and otg support, which both use the same config on
>>>> all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
>>>> because pmic / otg support for sun8i has not yet been merged.
>>>>
>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>
>>> Are we going to have any user but the one you posted in the patch 3
>>> planned?
>>
>> Depends on what I can get my hands on / what is in the post atm.
>>
>> One difference in fex files of different 18 variants is how the usb wifi is
>> powered, either via a gpio or via ldo3. Also there are differences in which
>> accelerometer is used, so eventually I expect there to be several users
>> of this dtsi.
>
> But no difference in the SoC used (A13 vs A10s)?
>
> I'm not sure having 18 DTs for a single board name is going to be
> really helpful.

Sorry I meant to write q8 not 18 :)

>It would be something to be supported by some quirks
> mechanism, instead of having to require the user to pick the right one.

Agreed, which is why I added a generic sun5i-a13-q8-tablet.dts, which
can then later be extended with quirks and such to get all the different
variants supported. Which I guess means that the contents of
sun5i-q8-common.dtsi can be folded into sun5i-a13-q8-tablet.dts, otoh
we may have some special cases which do require a separate dts and
having sun5i-q8-common.dtsi follows the same scheme as used for the
a23 / a33 tablets. In the future we should probably also add
sun8i-a23-q8-tablet.dts and sun8i-a33-q8-tablet.dts files and make
the existing ones just empty files with a single #include for
compatibility.

If possible I would like to at least have you queue up the default
sun5i-a13-q8-tablet.dts so that we've a dts file for a13 based tablets
which at least gets the basics going.

Either in its current form, or with it and sun5i-q8-common.dtsi
squashed together. If you want a squashed version let me know and
I'll do a resend.

Are you coming to ELCE ? I think the both of us should go to:

http://lceeu2015.sched.org/event/999c45c7fe78824a88269f35539c7e5c#.VfGcCLPYqlM

(Device Tree NG BoF) and try to hash out a solution for this there,
the quirks / variants stuff sounds good, but I wonder how far along
that is ?

Regards,

Hans
Maxime Ripard Sept. 18, 2015, 7:38 p.m. UTC | #5
On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
> This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
> files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
> serial console, and PG0 for card-detect for mmc0.
> 
> This also adds pmic and otg support, which both use the same config on
> all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
> because pmic / otg support for sun8i has not yet been merged.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied, thanks!

Maxime
Maxime Ripard Sept. 18, 2015, 7:53 p.m. UTC | #6
On Thu, Sep 10, 2015 at 05:05:39PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 09-09-15 16:01, Maxime Ripard wrote:
> >On Tue, Sep 08, 2015 at 11:26:51PM +0200, Hans de Goede wrote:
> >>Hi,
> >>
> >>On 09/08/2015 04:33 PM, Maxime Ripard wrote:
> >>>On Sat, Sep 05, 2015 at 04:55:52PM +0200, Hans de Goede wrote:
> >>>>This is the sun5i / a13 version of sun8i-q8-common.dtsi for use in dts
> >>>>files for a13 q8 based tablets. Compared to sun8i this uses uart1 for the
> >>>>serial console, and PG0 for card-detect for mmc0.
> >>>>
> >>>>This also adds pmic and otg support, which both use the same config on
> >>>>all known q8 a13 devices. This is not present in sun5i-q8-common.dtsi
> >>>>because pmic / otg support for sun8i has not yet been merged.
> >>>>
> >>>>Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >>>
> >>>Are we going to have any user but the one you posted in the patch 3
> >>>planned?
> >>
> >>Depends on what I can get my hands on / what is in the post atm.
> >>
> >>One difference in fex files of different 18 variants is how the usb wifi is
> >>powered, either via a gpio or via ldo3. Also there are differences in which
> >>accelerometer is used, so eventually I expect there to be several users
> >>of this dtsi.
> >
> >But no difference in the SoC used (A13 vs A10s)?
> >
> >I'm not sure having 18 DTs for a single board name is going to be
> >really helpful.
> 
> Sorry I meant to write q8 not 18 :)
> 
> >It would be something to be supported by some quirks
> >mechanism, instead of having to require the user to pick the right one.
> 
> Agreed, which is why I added a generic sun5i-a13-q8-tablet.dts, which
> can then later be extended with quirks and such to get all the different
> variants supported. Which I guess means that the contents of
> sun5i-q8-common.dtsi can be folded into sun5i-a13-q8-tablet.dts, otoh
> we may have some special cases which do require a separate dts and
> having sun5i-q8-common.dtsi follows the same scheme as used for the
> a23 / a33 tablets. In the future we should probably also add
> sun8i-a23-q8-tablet.dts and sun8i-a33-q8-tablet.dts files and make
> the existing ones just empty files with a single #include for
> compatibility.
> 
> If possible I would like to at least have you queue up the default
> sun5i-a13-q8-tablet.dts so that we've a dts file for a13 based tablets
> which at least gets the basics going.
> 
> Either in its current form, or with it and sun5i-q8-common.dtsi
> squashed together. If you want a squashed version let me know and
> I'll do a resend.
> 
> Are you coming to ELCE ? I think the both of us should go to:
> 
> http://lceeu2015.sched.org/event/999c45c7fe78824a88269f35539c7e5c#.VfGcCLPYqlM
> 
> (Device Tree NG BoF) and try to hash out a solution for this there,
> the quirks / variants stuff sounds good, but I wonder how far along
> that is ?

I will be to the technical showcase, but we can always discuss with
Pantelis a bit later :)

Maxime
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sun5i-q8-common.dtsi b/arch/arm/boot/dts/sun5i-q8-common.dtsi
new file mode 100644
index 0000000..0641d68
--- /dev/null
+++ b/arch/arm/boot/dts/sun5i-q8-common.dtsi
@@ -0,0 +1,170 @@ 
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.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 "sunxi-q8-common.dtsi"
+
+/ {
+	aliases {
+		serial0 = &uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&i2c0 {
+	axp209: pmic@34 {
+		reg = <0x34>;
+		interrupts = <0>;
+	};
+};
+
+&i2c1 {
+	pcf8563: rtc@51 {
+		compatible = "nxp,pcf8563";
+		reg = <0x51>;
+	};
+};
+
+#include "axp209.dtsi"
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>;
+	vmmc-supply = <&reg_vcc3v0>;
+	bus-width = <4>;
+	cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+	cd-inverted;
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+&pio {
+	mmc0_cd_pin_q8: mmc0_cd_pin@0 {
+		allwinner,pins = "PG0";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
+	usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+		allwinner,pins = "PG1";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+	};
+
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+		allwinner,pins = "PG2";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
+	usb0_vbus_pin_a: usb0_vbus_pin@0 {
+		allwinner,pins = "PG12";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1500000>;
+	regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+	regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+	gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins_b>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+	usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+	usb0_vbus-supply = <&reg_usb0_vbus>;
+	status = "okay";
+};