Re: [PATCH v3 -next 2/2] ARM: dts: sunxi: add support for Orange Pi Zero board
flat view
From: Icenowy Zheng <hidden>
Date: 2016-12-03 13:24:19
<p dir="ltr"><br>
2016年12月3日 下午5:43于 Jernej Skrabec <jernej.skrabec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>写道:<br>
><br>
> Hi,<br>
><br>
> Dne petek, 02. december 2016 17.42.04 UTC+1 je oseba Chen-Yu Tsai napisala:<br>
>><br>
>> Hi, <br>
>><br>
>> On Fri, Dec 2, 2016 at 11:05 PM, Icenowy Zheng <ice...-ymACFijhrKM@public.gmane.org> wrote: <br>
>> > Orange Pi Zero is a board that came with the new Allwinner H2+ SoC and a <br>
>> > SDIO Wi-Fi chip by Allwinner (XR819). <br>
>> > <br>
>> > Add a device tree file for it. <br>
>> > <br>
>> > Signed-off-by: Icenowy Zheng <ice...-ymACFijhrKM@public.gmane.org> <br>
>> > --- <br>
>> > Changes since v2: <br>
>> > - Merged SDIO Wi-Fi patch into it. <br>
>> > - SDIO Wi-Fi: add a ethernet1 alias to it, as it has no internal NVRAM. <br>
>> > - SDIO Wi-Fi: changed pinctrl binding to generic pinconf <br>
>> > - removed all gpio pinctrl nodes <br>
>> > - changed h2plus to h2-plus <br>
>> > Changes since v1: <br>
>> > - Convert to generic pinconf bindings. <br>
>> > - SDIO Wi-Fi: add patch. <br>
>> > <br>
>> > Some notes: <br>
>> > - The uart1 and uart2 is available on the unsoldered gpio header. <br>
>> > - The onboard USB connector has its Vbus directly connected to DCIN-5V (the <br>
>> >   power jack) <br>
>> > <br>
>> >  arch/arm/boot/dts/Makefile                        |   1 + <br>
>> >  arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 159 ++++++++++++++++++++++ <br>
>> >  2 files changed, 160 insertions(+) <br>
>> >  create mode 100644 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts <br>
>> > <br>
>> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile <br>
>> > index 6447abc..59f6e86 100644 <br>
>> > --- a/arch/arm/boot/dts/Makefile <br>
>> > +++ b/arch/arm/boot/dts/Makefile <br>
>> > @@ -844,6 +844,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ <br>
>> >         sun8i-a33-sinlinx-sina33.dtb \ <br>
>> >         sun8i-a83t-allwinner-h8homlet-v2.dtb \ <br>
>> >         sun8i-a83t-cubietruck-plus.dtb \ <br>
>> > +       sun8i-h2-plus-orangepi-zero.dtb \ <br>
>> >         sun8i-h3-bananapi-m2-plus.dtb \ <br>
>> >         sun8i-h3-nanopi-neo.dtb \ <br>
>> >         sun8i-h3-orangepi-2.dtb \ <br>
>> > diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts <br>
>> > new file mode 100644 <br>
>> > index 0000000..d18807f <br>
>> > --- /dev/null <br>
>> > +++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts <br>
>> > @@ -0,0 +1,159 @@ <br>
>> > +/* <br>
>> > + * Copyright (C) 2016 Icenowy Zheng <ice...-ymACFijhrKM@public.gmane.org> <br>
>> > + * <br>
>> > + * Based on sun8i-h3-orangepi-one.dts, which is: <br>
>> > + *   Copyright (C) 2016 Hans de Goede <hdeg...-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> <br>
>> > + * <br>
>> > + * This file is dual-licensed: you can use it either under the terms <br>
>> > + * of the GPL or the X11 license, at your option. Note that this dual <br>
>> > + * licensing only applies to this file, and not this project as a <br>
>> > + * whole. <br>
>> > + * <br>
>> > + *  a) This file is free software; you can redistribute it and/or <br>
>> > + *     modify it under the terms of the GNU General Public License as <br>
>> > + *     published by the Free Software Foundation; either version 2 of the <br>
>> > + *     License, or (at your option) any later version. <br>
>> > + * <br>
>> > + *     This file is distributed in the hope that it will be useful, <br>
>> > + *     but WITHOUT ANY WARRANTY; without even the implied warranty of <br>
>> > + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the <br>
>> > + *     GNU General Public License for more details. <br>
>> > + * <br>
>> > + * Or, alternatively, <br>
>> > + * <br>
>> > + *  b) Permission is hereby granted, free of charge, to any person <br>
>> > + *     obtaining a copy of this software and associated documentation <br>
>> > + *     files (the "Software"), to deal in the Software without <br>
>> > + *     restriction, including without limitation the rights to use, <br>
>> > + *     copy, modify, merge, publish, distribute, sublicense, and/or <br>
>> > + *     sell copies of the Software, and to permit persons to whom the <br>
>> > + *     Software is furnished to do so, subject to the following <br>
>> > + *     conditions: <br>
>> > + * <br>
>> > + *     The above copyright notice and this permission notice shall be <br>
>> > + *     included in all copies or substantial portions of the Software. <br>
>> > + * <br>
>> > + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, <br>
>> > + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES <br>
>> > + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND <br>
>> > + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT <br>
>> > + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, <br>
>> > + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING <br>
>> > + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR <br>
>> > + *     OTHER DEALINGS IN THE SOFTWARE. <br>
>> > + */ <br>
>> > + <br>
>> > +/dts-v1/; <br>
>> > +#include "sun8i-h3.dtsi" <br>
>> > +#include "sunxi-common-regulators.dtsi" <br>
>> > + <br>
>> > +#include <dt-bindings/gpio/gpio.h> <br>
>> > +#include <dt-bindings/input/input.h> <br>
>> > +#include <dt-bindings/pinctrl/sun4i-a10.h> <br>
>> > + <br>
>> > +/ { <br>
>> > +       model = "Xunlong Orange Pi Zero"; <br>
>> > +       compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h2-plus"; <br>
>> > + <br>
>> > +       aliases { <br>
>> > +               serial0 = &uart0; <br>
>> > +               /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ <br>
>> > +               ethernet1 = &xr819; <br>
>> > +       }; <br>
>> > + <br>
>> > +       chosen { <br>
>> > +               stdout-path = "serial0:115200n8"; <br>
>> > +       }; <br>
>> > + <br>
>> > +       leds { <br>
>> > +               compatible = "gpio-leds"; <br>
>> > + <br>
>> > +               pwr_led { <br>
>> > +                       label = "orangepi:green:pwr"; <br>
>> > +                       gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; <br>
>> > +                       default-state = "on"; <br>
>> > +               }; <br>
>> > + <br>
>> > +               status_led { <br>
>> > +                       label = "orangepi:red:status"; <br>
>> > +                       gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; <br>
>> > +               }; <br>
>> > +       }; <br>
>> > + <br>
>> > +       reg_vcc_wifi: reg_vcc_wifi { <br>
>> > +               compatible = "regulator-fixed"; <br>
>> > +               regulator-min-microvolt = <3300000>; <br>
>> > +               regulator-max-microvolt = <3300000>; <br>
>> > +               regulator-name = "vcc-wifi"; <br>
>> > +               enable-active-high; <br>
>> > +               gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; <br>
>> > +       }; <br>
>> > + <br>
>> > +       wifi_pwrseq: wifi_pwrseq { <br>
>> > +               compatible = "mmc-pwrseq-simple"; <br>
>> > +               reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; <br>
>> > +       }; <br>
>> > +}; <br>
>> > + <br>
>> > +&ehci1 { <br>
>> > +       status = "okay"; <br>
>> > +}; <br>
>> > + <br>
>> > +&mmc0 { <br>
>> > +       pinctrl-names = "default"; <br>
>> > +       pinctrl-0 = <&mmc0_pins_a>; <br>
>> > +       vmmc-supply = <&reg_vcc3v3>; <br>
>> > +       bus-width = <4>; <br>
>> > +       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ <br>
>> > +       cd-inverted; <br>
>> > +       status = "okay"; <br>
>> > +}; <br>
>> > + <br>
>> > +&mmc1 { <br>
>> > +       pinctrl-names = "default"; <br>
>> > +       pinctrl-0 = <&mmc1_pins_a>; <br>
>> > +       vmmc-supply = <&reg_vcc_wifi>; <br>
>> > +       mmc-pwrseq = <&wifi_pwrseq>; <br>
>> > +       bus-width = <4>; <br>
>> > +       non-removable; <br>
>> > +       status = "okay"; <br>
>> > + <br>
>> > +       /* <br>
>> > +        * Explicitly define the sdio device, so that we can add an ethernet <br>
>> > +        * alias for it (which e.g. makes u-boot set a mac-address). <br>
>> > +        */ <br>
>> > +       xr819: sdio_wifi@1 { <br>
>> > +               reg = <1>; <br>
>> > +       }; <br>
>> > +}; <br>
>> > + <br>
>> > +&mmc1_pins_a { <br>
>> > +       bias-pull-up; <br>
>><br>
>> This is already set in h3.dtsi <br>
>><br>
>> > +}; <br>
>> > + <br>
>> > +&ohci1 { <br>
>> > +       status = "okay"; <br>
>> > +}; <br>
>> > + <br>
>> > +&uart0 { <br>
>> > +       pinctrl-names = "default"; <br>
>> > +       pinctrl-0 = <&uart0_pins_a>; <br>
>> > +       status = "okay"; <br>
>> > +}; <br>
>> > + <br>
>> > +&uart1 { <br>
>> > +       pinctrl-names = "default"; <br>
>> > +       pinctrl-0 = <&uart1_pins>; <br>
>> > +       status = "disabled"; <br>
>> > +}; <br>
>> > + <br>
>> > +&uart2 { <br>
>> > +       pinctrl-names = "default"; <br>
>> > +       pinctrl-0 = <&uart2_pins>; <br>
>> > +       status = "disabled"; <br>
>> > +}; <br>
>> > + <br>
>> > +&usbphy { <br>
>> > +       /* USB VBUS is always on */ <br>
>><br>
>> I think this comment could use a little work. <br>
>><br>
>> AFAIK this board doesn't have an actual USB port. <br>
>> It's just the D+/D- pins on the pin header, along <br>
>> with the board-wide 5V, also on the pin header. <br>
><br>
><br>
> How is addon board handled then? It has two USBs,<br>
> IR, audio, mic and probably also TV out. I can't see<br>
> any obvious way how to detect that the addon board<br>
> is plugged in from the image.</p>
<p dir="ltr">It cannot be detected.</p>
<p dir="ltr">However, the pins on it are nearly all not muxed (maybe except IR).</p>
<p dir="ltr">><br>
> https://www.aliexpress.com/item/New-Orange-Pi-Zreo-Expansion-board-Interface-board-Development-board-beyond-Raspberry-Pi/32770665186.html<br>
><br>
> Best regards,<br>
> Jernej Škrabec<br>
>  <br>
>><br>
>><br>
>> ChenYu <br>
>><br>
>> > +       status = "okay"; <br>
>> > +}; <br>
>> > -- <br>
>> > 2.10.2 <br>
>> > <br>
>> > -- <br>
>> > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. <br>
>> > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org <br>
>> > For more options, visit https://groups.google.com/d/optout. <br>
</p>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org">linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br />
For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br />