From bb9aaa392eabd1071c4528c7172c0ac266b0bce4 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Mon, 29 Mar 2021 00:44:02 +0200 Subject: [PATCH 1/3] Fix config after menuconfig --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f304a3..666f87a 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,8 @@ clean: rm -f root_overlay/root/.ssh/authorized_keys rm -f root_overlay/bin/door.py -menuconfig: +menuconfig: buildroot/.config make -C buildroot menuconfig + if [[ ! -L buildroot/.config ]]; then mv buildroot/.config config && ln -s ../config buildroot/.config; fi .PHONY: all clean sdcard.img menuconfig root_overlay root_overlay/etc/dropbear/dropbear_ecdsa_host_key From a558f8aad745eccef2d85f4325c489a4b87bc54f Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Mon, 29 Mar 2021 00:45:20 +0200 Subject: [PATCH 2/3] Update config --- config | 77 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/config b/config index 5c67bf0..bdbf2c6 100644 --- a/config +++ b/config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Buildroot 2021.02-rc2 Configuration +# Buildroot 2021.02-177-g2b3ceddd87 Configuration # BR2_HAVE_DOT_CONFIG=y BR2_EXTERNAL_DOOR_PI_PATH="/home/apo/Projects/Hackerspace/DoorPi/br_external" @@ -252,9 +252,11 @@ BR2_KERNEL_HEADERS_AS_KERNEL=y # BR2_KERNEL_HEADERS_4_19 is not set # BR2_KERNEL_HEADERS_5_4 is not set # BR2_KERNEL_HEADERS_5_10 is not set +# BR2_KERNEL_HEADERS_5_11 is not set # BR2_KERNEL_HEADERS_VERSION is not set # BR2_KERNEL_HEADERS_CUSTOM_TARBALL is not set # BR2_KERNEL_HEADERS_CUSTOM_GIT is not set +# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_11 is not set BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y # BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_9 is not set # BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8 is not set @@ -422,7 +424,6 @@ BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7=y BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8=y BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9=y BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10=y -BR2_TOOLCHAIN_HEADERS_LATEST=y BR2_TOOLCHAIN_HEADERS_AT_LEAST="5.10" BR2_TOOLCHAIN_GCC_AT_LEAST_4_3=y BR2_TOOLCHAIN_GCC_AT_LEAST_4_4=y @@ -613,11 +614,11 @@ BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS=y BR2_PACKAGE_KODI_ARCH_SUPPORTS=y # -# kodi needs python w/ .py modules, a uClibc or glibc toolchain w/ C++, threads, wchar, dynamic library, gcc >= 4.8 +# kodi needs python3 w/ .py modules, a uClibc or glibc toolchain w/ C++, threads, wchar, dynamic library, gcc >= 4.9 # # -# kodi needs an OpenGL EGL backend with OpenGL support +# kodi needs an OpenGL EGL backend with OpenGL or GLES support # # BR2_PACKAGE_LAME is not set # BR2_PACKAGE_MADPLAY is not set @@ -858,6 +859,7 @@ BR2_PACKAGE_PROVIDES_HOST_GETTEXT="host-gettext-tiny" # BR2_PACKAGE_JQ is not set # BR2_PACKAGE_LIBTOOL is not set # BR2_PACKAGE_MAKE is not set +# BR2_PACKAGE_MAWK is not set # BR2_PACKAGE_PATCH is not set # BR2_PACKAGE_PKGCONF is not set # BR2_PACKAGE_RIPGREP is not set @@ -1033,7 +1035,7 @@ BR2_PACKAGE_MTD_UBIBLOCK=y # # -# cage needs udev, mesa3d w/ EGL and GLES support +# cage needs udev, EGL w/ Wayland backend and OpenGL ES support # # @@ -1384,6 +1386,7 @@ BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS=y # BR2_PACKAGE_GAUCHE is not set # BR2_PACKAGE_GUILE is not set # BR2_PACKAGE_HASERL is not set +# BR2_PACKAGE_JANET is not set # BR2_PACKAGE_JIMTCL is not set # BR2_PACKAGE_LUA is not set BR2_PACKAGE_PROVIDES_HOST_LUAINTERPRETER="host-lua" @@ -1484,10 +1487,12 @@ BR2_PACKAGE_PYTHON3_SQLITE=y # BR2_PACKAGE_PYTHON_AVRO is not set # BR2_PACKAGE_PYTHON_BABEL is not set # BR2_PACKAGE_PYTHON_BACKCALL is not set -# BR2_PACKAGE_PYTHON_BCRYPT is not set +BR2_PACKAGE_PYTHON_BCRYPT=y # BR2_PACKAGE_PYTHON_BEAUTIFULSOUP4 is not set # BR2_PACKAGE_PYTHON_BITSTRING is not set +BR2_PACKAGE_PYTHON_BLEACH=y # BR2_PACKAGE_PYTHON_BLEAK is not set +BR2_PACKAGE_PYTHON_BLINKER=y # BR2_PACKAGE_PYTHON_BLUEZERO is not set # BR2_PACKAGE_PYTHON_BOTO3 is not set # BR2_PACKAGE_PYTHON_BOTOCORE is not set @@ -1504,7 +1509,7 @@ BR2_PACKAGE_PYTHON3_SQLITE=y # python-cchardet needs a toolchain w/ C++ # # BR2_PACKAGE_PYTHON_CERTIFI is not set -# BR2_PACKAGE_PYTHON_CFFI is not set +BR2_PACKAGE_PYTHON_CFFI=y # # python-channels needs a toolchain w/ C++ @@ -1518,7 +1523,7 @@ BR2_PACKAGE_PYTHON3_SQLITE=y # BR2_PACKAGE_PYTHON_CHEETAH is not set # BR2_PACKAGE_PYTHON_CHEROOT is not set # BR2_PACKAGE_PYTHON_CHERRYPY is not set -# BR2_PACKAGE_PYTHON_CLICK is not set +BR2_PACKAGE_PYTHON_CLICK=y # BR2_PACKAGE_PYTHON_COLORAMA is not set # BR2_PACKAGE_PYTHON_COLORLOG is not set # BR2_PACKAGE_PYTHON_COLORZERO is not set @@ -1554,7 +1559,7 @@ BR2_PACKAGE_PYTHON3_SQLITE=y # BR2_PACKAGE_PYTHON_DICTTOXML is not set # BR2_PACKAGE_PYTHON_DJANGO is not set # BR2_PACKAGE_PYTHON_DJANGO_ENUMFIELDS is not set -# BR2_PACKAGE_PYTHON_DNSPYTHON is not set +BR2_PACKAGE_PYTHON_DNSPYTHON=y # BR2_PACKAGE_PYTHON_DOCKER is not set # BR2_PACKAGE_PYTHON_DOCKER_PYCREDS is not set # BR2_PACKAGE_PYTHON_DOCKERPTY is not set @@ -1563,18 +1568,23 @@ BR2_PACKAGE_PYTHON3_SQLITE=y # BR2_PACKAGE_PYTHON_DOMINATE is not set # BR2_PACKAGE_PYTHON_DPKT is not set # BR2_PACKAGE_PYTHON_ECDSA is not set +BR2_PACKAGE_PYTHON_EMAIL_VALIDATOR=y # BR2_PACKAGE_PYTHON_ENGINEIO is not set # BR2_PACKAGE_PYTHON_ENTRYPOINTS is not set # BR2_PACKAGE_PYTHON_ESPTOOL is not set # BR2_PACKAGE_PYTHON_FALCON is not set # BR2_PACKAGE_PYTHON_FILELOCK is not set # BR2_PACKAGE_PYTHON_FIRE is not set -# BR2_PACKAGE_PYTHON_FLASK is not set +BR2_PACKAGE_PYTHON_FLASK=y # BR2_PACKAGE_PYTHON_FLASK_BABEL is not set # BR2_PACKAGE_PYTHON_FLASK_CORS is not set # BR2_PACKAGE_PYTHON_FLASK_JSONRPC is not set -# BR2_PACKAGE_PYTHON_FLASK_LOGIN is not set -# BR2_PACKAGE_PYTHON_FLASK_SQLALCHEMY is not set +BR2_PACKAGE_PYTHON_FLASK_LOGIN=y +BR2_PACKAGE_PYTHON_FLASK_MAIL=y +BR2_PACKAGE_PYTHON_FLASK_SECURITY_TOO=y +BR2_PACKAGE_PYTHON_FLASK_SQLALCHEMY=y +BR2_PACKAGE_PYTHON_FLASK_PRINCIPAL=y +BR2_PACKAGE_PYTHON_FLASK_WTF=y # BR2_PACKAGE_PYTHON_FLATBUFFERS is not set # BR2_PACKAGE_PYTHON_FROZENLIST is not set # BR2_PACKAGE_PYTHON_FUTURE is not set @@ -1594,7 +1604,7 @@ BR2_PACKAGE_PYTHON_GREENLET_ARCH_SUPPORTS=y # BR2_PACKAGE_PYTHON_HYPERFRAME is not set # BR2_PACKAGE_PYTHON_HYPERLINK is not set # BR2_PACKAGE_PYTHON_IBMIOTF is not set -# BR2_PACKAGE_PYTHON_IDNA is not set +BR2_PACKAGE_PYTHON_IDNA=y # BR2_PACKAGE_PYTHON_IFADDR is not set # BR2_PACKAGE_PYTHON_INCREMENTAL is not set # BR2_PACKAGE_PYTHON_INFLECTION is not set @@ -1608,12 +1618,12 @@ BR2_PACKAGE_PYTHON_GREENLET_ARCH_SUPPORTS=y # BR2_PACKAGE_PYTHON_IPYTHON is not set # BR2_PACKAGE_PYTHON_IPYTHON_GENUTILS is not set # BR2_PACKAGE_PYTHON_ISO8601 is not set -# BR2_PACKAGE_PYTHON_ITSDANGEROUS is not set +BR2_PACKAGE_PYTHON_ITSDANGEROUS=y # BR2_PACKAGE_PYTHON_JANUS is not set # BR2_PACKAGE_PYTHON_JARACO_CLASSES is not set # BR2_PACKAGE_PYTHON_JARACO_FUNCTOOLS is not set # BR2_PACKAGE_PYTHON_JEDI is not set -# BR2_PACKAGE_PYTHON_JINJA2 is not set +BR2_PACKAGE_PYTHON_JINJA2=y # BR2_PACKAGE_PYTHON_JMESPATH is not set # BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR is not set # BR2_PACKAGE_PYTHON_JSONMODELS is not set @@ -1626,6 +1636,7 @@ BR2_PACKAGE_PYTHON_GREENLET_ARCH_SUPPORTS=y # # python-kiwisolver needs a toolchain w/ C++ # +BR2_PACKAGE_PYTHON_LDAP3=y # # python-libconfig needs a glibc or uClibc toolchain w/ C++, threads @@ -1641,7 +1652,7 @@ BR2_PACKAGE_PYTHON_GREENLET_ARCH_SUPPORTS=y # BR2_PACKAGE_PYTHON_MAKO is not set # BR2_PACKAGE_PYTHON_MARKDOWN is not set # BR2_PACKAGE_PYTHON_MARKDOWN2 is not set -# BR2_PACKAGE_PYTHON_MARKUPSAFE is not set +BR2_PACKAGE_PYTHON_MARKUPSAFE=y # # python-matplotlib needs a toolchain w/ C++ @@ -1670,14 +1681,14 @@ BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS=y # BR2_PACKAGE_PYTHON_NUMPY is not set # BR2_PACKAGE_PYTHON_OAUTHLIB is not set # BR2_PACKAGE_PYTHON_OPCUA_ASYNCIO is not set -# BR2_PACKAGE_PYTHON_PACKAGING is not set +BR2_PACKAGE_PYTHON_PACKAGING=y BR2_PACKAGE_PYTHON_PAHO_MQTT=y # # python-paramiko needs a toolchain w/ C++ # # BR2_PACKAGE_PYTHON_PARSO is not set -# BR2_PACKAGE_PYTHON_PASSLIB is not set +BR2_PACKAGE_PYTHON_PASSLIB=y # BR2_PACKAGE_PYTHON_PATHPY is not set # BR2_PACKAGE_PYTHON_PATHTOOLS is not set # BR2_PACKAGE_PYTHON_PATHVALIDATE is not set @@ -1702,13 +1713,13 @@ BR2_PACKAGE_PYTHON_PAHO_MQTT=y # BR2_PACKAGE_PYTHON_PY is not set # BR2_PACKAGE_PYTHON_PYAES is not set # BR2_PACKAGE_PYTHON_PYALSA is not set -# BR2_PACKAGE_PYTHON_PYASN1 is not set +BR2_PACKAGE_PYTHON_PYASN1=y # BR2_PACKAGE_PYTHON_PYASN1_MODULES is not set # BR2_PACKAGE_PYTHON_PYBIND is not set # BR2_PACKAGE_PYTHON_PYCAIRO is not set # BR2_PACKAGE_PYTHON_PYCARES is not set # BR2_PACKAGE_PYTHON_PYCLI is not set -# BR2_PACKAGE_PYTHON_PYCPARSER is not set +BR2_PACKAGE_PYTHON_PYCPARSER=y # BR2_PACKAGE_PYTHON_PYCRYPTODOMEX is not set # BR2_PACKAGE_PYTHON_PYDAL is not set # BR2_PACKAGE_PYTHON_PYDANTIC is not set @@ -1732,7 +1743,7 @@ BR2_PACKAGE_PYTHON_PAHO_MQTT=y # # python-pyopenssl needs a toolchain w/ C++ # -# BR2_PACKAGE_PYTHON_PYPARSING is not set +BR2_PACKAGE_PYTHON_PYPARSING=y # BR2_PACKAGE_PYTHON_PYPARTED is not set # BR2_PACKAGE_PYTHON_PYQRCODE is not set @@ -1803,7 +1814,7 @@ BR2_PACKAGE_PYTHON_SERIAL=y # BR2_PACKAGE_PYTHON_SIMPLEJSON is not set # BR2_PACKAGE_PYTHON_SIMPLELOGGING is not set # BR2_PACKAGE_PYTHON_SIMPLESQLITE is not set -# BR2_PACKAGE_PYTHON_SIX is not set +BR2_PACKAGE_PYTHON_SIX=y # # python-slob needs a toolchain w/ C++, gcc >= 4.9, host gcc >= 4.9 @@ -1819,7 +1830,7 @@ BR2_PACKAGE_PYTHON_SERIAL=y # BR2_PACKAGE_PYTHON_SORTEDCONTAINERS is not set # BR2_PACKAGE_PYTHON_SOUPSIEVE is not set # BR2_PACKAGE_PYTHON_SPIDEV is not set -# BR2_PACKAGE_PYTHON_SQLALCHEMY is not set +BR2_PACKAGE_PYTHON_SQLALCHEMY=y # BR2_PACKAGE_PYTHON_SQLITESCHEMA is not set # BR2_PACKAGE_PYTHON_SQLPARSE is not set @@ -1863,17 +1874,17 @@ BR2_PACKAGE_PYTHON_SERIAL=y # BR2_PACKAGE_PYTHON_WATCHDOG is not set # BR2_PACKAGE_PYTHON_WCWIDTH is not set # BR2_PACKAGE_PYTHON_WEB2PY is not set -# BR2_PACKAGE_PYTHON_WEBENCODINGS is not set +BR2_PACKAGE_PYTHON_WEBENCODINGS=y # BR2_PACKAGE_PYTHON_WEBOB is not set # BR2_PACKAGE_PYTHON_WEBPY is not set # BR2_PACKAGE_PYTHON_WEBSOCKET_CLIENT is not set # BR2_PACKAGE_PYTHON_WEBSOCKETS is not set -# BR2_PACKAGE_PYTHON_WERKZEUG is not set +BR2_PACKAGE_PYTHON_WERKZEUG=y # BR2_PACKAGE_PYTHON_WHOOSH is not set # BR2_PACKAGE_PYTHON_WRAPT is not set # BR2_PACKAGE_PYTHON_WS4PY is not set # BR2_PACKAGE_PYTHON_WSACCEL is not set -# BR2_PACKAGE_PYTHON_WTFORMS is not set +BR2_PACKAGE_PYTHON_WTFORMS=y # BR2_PACKAGE_PYTHON_XLIB is not set # BR2_PACKAGE_PYTHON_XLRD is not set # BR2_PACKAGE_PYTHON_XLSXWRITER is not set @@ -2052,8 +2063,10 @@ BR2_PACKAGE_LIBGPG_ERROR_SYSCFG="arm-unknown-linux-gnueabi" # BR2_PACKAGE_LIBSSH2 is not set # BR2_PACKAGE_LIBTOMCRYPT is not set # BR2_PACKAGE_LIBUECC is not set +# BR2_PACKAGE_LIBXCRYPT is not set # BR2_PACKAGE_MBEDTLS is not set # BR2_PACKAGE_NETTLE is not set +BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS=y BR2_PACKAGE_OPENSSL=y BR2_PACKAGE_LIBOPENSSL=y BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH="linux-armv4" @@ -2332,7 +2345,7 @@ BR2_PACKAGE_WEBKITGTK_ARCH_SUPPORTS=y # BR2_PACKAGE_WEBP is not set # -# wlroots needs udev, mesa3d w/ EGL and GLES support +# wlroots needs udev, EGL w/ Wayland backend and OpenGL ES support # # @@ -3673,6 +3686,9 @@ BR2_PACKAGE_WIRELESS_TOOLS_LIB=y # BR2_PACKAGE_WIRESHARK is not set BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y +# BR2_PACKAGE_WPA_SUPPLICANT_WEXT is not set +# BR2_PACKAGE_WPA_SUPPLICANT_WIRED is not set +# BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN is not set # BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT is not set # BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN is not set # BR2_PACKAGE_WPA_SUPPLICANT_EAP is not set @@ -3683,6 +3699,7 @@ BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y # BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO is not set # BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE is not set +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y # BR2_PACKAGE_WPA_SUPPLICANT_DBUS is not set # BR2_PACKAGE_WPAN_TOOLS is not set # BR2_PACKAGE_XINETD is not set @@ -4222,6 +4239,11 @@ BR2_PACKAGE_HOST_UTIL_LINUX=y # Legacy config options # +# +# Legacy options removed in 2021.05 +# +# BR2_PACKAGE_KODI_SCREENSAVER_CRYSTALMORPH is not set + # # Legacy options removed in 2021.02 # @@ -4801,3 +4823,4 @@ BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="" # BR2_PACKAGE_POLL_DESFIRE=y BR2_PACKAGE_LIBFREEFARE_GIT=y +BR2_PACKAGE_PYTHON_DOOR_ADMIN=y From 8f12446c5a5d1b77c3efa5a6c009bddf67743161 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Mon, 29 Mar 2021 00:46:59 +0200 Subject: [PATCH 3/3] Update device tree sources to enable USB and UART on pin headers --- config | 4 +- sun8i-h2-plus-orangepi-zero.dts | 236 ++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 sun8i-h2-plus-orangepi-zero.dts diff --git a/config b/config index bdbf2c6..d8335aa 100644 --- a/config +++ b/config @@ -537,8 +537,8 @@ BR2_LINUX_KERNEL_GZIP=y # BR2_LINUX_KERNEL_ZSTD is not set BR2_LINUX_KERNEL_DTS_SUPPORT=y # BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT is not set -BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero" -BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="" +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="../sun8i-h2-plus-orangepi-zero.dts" # BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME is not set # BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT is not set # BR2_LINUX_KERNEL_INSTALL_TARGET is not set diff --git a/sun8i-h2-plus-orangepi-zero.dts b/sun8i-h2-plus-orangepi-zero.dts new file mode 100644 index 0000000..183c9af --- /dev/null +++ b/sun8i-h2-plus-orangepi-zero.dts @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2016 Icenowy Zheng + * + * Based on sun8i-h3-orangepi-one.dts, which is: + * Copyright (C) 2016 Hans de Goede + * + * 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 "sun8i-h3.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include +#include + +/ { + model = "Xunlong Orange Pi Zero"; + compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h2-plus"; + + aliases { + serial0 = &uart0; + /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ + ethernet0 = &emac; + ethernet1 = &xr819; + spi1 = &spi1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + pwr_led { + label = "orangepi:green:pwr"; + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + status_led { + label = "orangepi:red:status"; + gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; + }; + }; + + reg_vcc_wifi: reg_vcc_wifi { + compatible = "regulator-fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; + enable-active-high; + gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; + }; + + reg_vdd_cpux: vdd-cpux-regulator { + compatible = "regulator-gpio"; + regulator-name = "vdd-cpux"; + regulator-type = "voltage"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1300000>; + regulator-ramp-delay = <50>; /* 4ms */ + + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + enable-active-high; + gpios-states = <1>; + states = <1100000 0>, <1300000 1>; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; + post-power-on-delay-ms = <200>; + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpux>; +}; + +&ehci0 { status = "okay"; }; +&ehci1 { status = "okay"; }; +&ehci2 { status = "okay"; }; +&ehci3 { status = "okay"; }; +&ohci0 { status = "okay"; }; +&ohci1 { status = "okay"; }; +&ohci2 { status = "okay"; }; +&ohci3 { status = "okay"; }; + +&emac { + phy-handle = <&int_mii_phy>; + phy-mode = "mii"; + allwinner,leds-active-low; + status = "okay"; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc_wifi>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + /* + * Explicitly define the sdio device, so that we can add an ethernet + * alias for it (which e.g. makes u-boot set a mac-address). + */ + xr819: sdio_wifi@1 { + reg = <1>; + compatible = "xradio,xr819"; + interrupt-parent = <&pio>; + interrupts = <6 10 IRQ_TYPE_EDGE_RISING>; + }; +}; + +&spi0 { + /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */ + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mxicy,mx25l1606e", "winbond,w25q128"; + reg = <0>; + spi-max-frequency = <40000000>; + + partition@00000000 { + reg = <0x00000000 0x200000>; /* 2Mb */ + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pa_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + /* + * USB Type-A port VBUS is always on. However, MicroUSB VBUS can only + * power up the board; when it's used as OTG port, this VBUS is + * always off even if the board is powered via GPIO pins. + */ + status = "okay"; + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ +}; + +&spi0 { + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mxicy,mx25l1606e", "winbond,w25q128"; + reg = <0>; + spi-max-frequency = <40000000>; + + partition@00000000 { + reg = <0x00000000 0x200000>; /* 2Mb */ + }; + }; +}; + +&spi1 { + status = "okay"; + + spidev@0 { + compatible = "rohm,dh2228fv"; + reg = <0>; + spi-max-frequency = <10000000>; + }; +};