Module Name: src Committed By: martin Date: Thu Oct 17 18:47:48 UTC 2019
Modified Files: src/sys/arch/evbarm/conf [netbsd-9]: GENERIC Added Files: src/sys/arch/arm/dts [netbsd-9]: sun8i-h3-nanopi-duo2.dts sun8i-h3-nanopi-r1.dts Log Message: Pull up following revision(s) (requested by bad in ticket #341): sys/arch/evbarm/conf/GENERIC: revision 1.54 sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts: revision 1.1 sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts: revision 1.2 sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts: revision 1.1 Add sun8i-h3-nanopi-r1.dts and sun8i-h3-nanopi-duo2.dts. >From >https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/xxx-add-nanopi-r1-and-duo2.patch Cherry pick a few changes from the armbian u-boot patch. Makes my NanoPi R1 boot reliably. >From >https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-sunxi/add-nano+pi-r1-and-duo2.patch Add sun8i-h3-nanopi-duo2.dts and sun8i-h3-nanopi-r1.dts. The former is untested. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts cvs rdiff -u -r0 -r1.2.2.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts cvs rdiff -u -r1.48.2.2 -r1.48.2.3 src/sys/arch/evbarm/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/evbarm/conf/GENERIC diff -u src/sys/arch/evbarm/conf/GENERIC:1.48.2.2 src/sys/arch/evbarm/conf/GENERIC:1.48.2.3 --- src/sys/arch/evbarm/conf/GENERIC:1.48.2.2 Sun Oct 6 11:19:25 2019 +++ src/sys/arch/evbarm/conf/GENERIC Thu Oct 17 18:47:47 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC,v 1.48.2.2 2019/10/06 11:19:25 martin Exp $ +# $NetBSD: GENERIC,v 1.48.2.3 2019/10/17 18:47:47 martin Exp $ # # GENERIC ARM (aarch32) kernel # @@ -123,8 +123,10 @@ makeoptions DTS=" sun8i-h3-beelink-x2.dts sun8i-h3-libretech-all-h3-cc.dts sun8i-h3-mapleboard-mp130.dts + sun8i-h3-nanopi-duo2.dts sun8i-h3-nanopi-m1-plus.dts sun8i-h3-nanopi-m1.dts + sun8i-h3-nanopi-r1.dts sun8i-h3-nanopi-neo.dts sun8i-h3-nanopi-neo-air.dts sun8i-h3-orangepi-2.dts Added files: Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts:1.1.2.2 --- /dev/null Thu Oct 17 18:47:48 2019 +++ src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts Thu Oct 17 18:47:48 2019 @@ -0,0 +1,99 @@ +/* $NetBSD: sun8i-h3-nanopi-duo2.dts,v 1.1.2.2 2019/10/17 18:47:48 martin Exp $ */ + +/* + * Copyright (C) 2019 Igor <i...@armbian.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 "sun8i-h3-nanopi.dtsi" + +/ { + model = "FriendlyElec NanoPi-Duo2"; + compatible = "friendlyarm,nanopi-duo2", "allwinner,sun8i-h3"; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ + post-power-on-delay-ms = <200>; + }; + +}; + +&r_pio { + wifi_en_npi: wifi_en_pin { + pins = "PL7"; + function = "gpio_out"; + }; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + sdio_wifi: sdio_wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ + interrupt-names = "host-wake"; + }; + +}; + +&emac { + phy-handle = <&int_mii_phy>; + phy-mode = "mii"; + allwinner,leds-active-low; + status = "okay"; +}; + +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + status = "okay"; +}; Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.2.2.2 --- /dev/null Thu Oct 17 18:47:48 2019 +++ src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts Thu Oct 17 18:47:48 2019 @@ -0,0 +1,206 @@ +/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.2.2.2 2019/10/17 18:47:48 martin Exp $ */ + +/* + * Copyright (C) 2019 Igor Pecovnik <i...@armbian.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 "sun8i-h3-nanopi.dtsi" + +/ { + model = "FriendlyElec NanoPi-R1"; + compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3"; + + aliases { + serial1 = &uart3; + ethernet0 = &emac; + ethernet1 = &emac; + ethernet2 = &sdio_wifi; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ + }; + + reg_gmac_3v3: gmac-3v3 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + regulator-name = "gmac-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + startup-delay-us = <100000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; + }; + + rfkill_bt { + compatible = "rfkill-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_pwr_pin>; + reset-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ + clocks = <&osc32k>; + clock-frequency = <32768>; + rfkill-name = "sunxi-bt"; + rfkill-type = "bluetooth"; + }; + + leds { + /delete-node/ status; + /delete-node/ pwr; + led1 { + label = "LED1"; + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + + led2 { + label = "LED2"; + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "netdev"; + }; + + led3 { + label = "LED3"; + gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "netdev"; + }; + }; + + r_gpio_keys { + compatible = "gpio-keys"; + input-name = "k1"; + pinctrl-names = "default"; + pinctrl-0 = <&sw_r_npi>; + + /delete-node/ k1; + reset { + label = "reset"; + linux,code = <BTN_1>; + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + + +&pio { + bt_pwr_pin: bt_pwr_pin@0 { + pins = "PG13"; + function = "gpio_out"; + }; +}; + +#if 0 /* XXX u-boot dts for NanoPi R1 has this but not needed? */ +&pio { + gmac_power_pin_nanopi: gmac_power_pin@0 { + pins = "PD6"; + function = "gpio_out"; + }; +}; +#endif + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&emac_rgmii_pins>; + phy-supply = <®_gmac_3v3>; + phy-handle = <&ext_rgmii_phy>; + phy-mode = "rgmii"; + + status = "okay"; +}; + +&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <7>; + }; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + sdio_wifi: sdio_wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ + interrupt-names = "host-wake"; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + status = "okay"; +};