Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (C) 2019 Karl Palsson <karlp@tweak.net.au>
0004  */
0005 
0006 /dts-v1/;
0007 #include "sun8i-h3.dtsi"
0008 #include "sunxi-common-regulators.dtsi"
0009 
0010 #include <dt-bindings/gpio/gpio.h>
0011 #include <dt-bindings/input/input.h>
0012 
0013 / {
0014         model = "FriendlyARM NanoPi Duo2";
0015         compatible = "friendlyarm,nanopi-duo2", "allwinner,sun8i-h3";
0016 
0017         aliases {
0018                 serial0 = &uart0;
0019         };
0020 
0021         chosen {
0022                 stdout-path = "serial0:115200n8";
0023         };
0024 
0025         leds {
0026                 compatible = "gpio-leds";
0027 
0028                 led-0 {
0029                         label = "nanopi:red:pwr";
0030                         gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
0031                         default-state = "on";
0032                 };
0033 
0034                 led-1 {
0035                         label = "nanopi:green:status";
0036                         gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
0037                 };
0038         };
0039 
0040         gpio-keys {
0041                 compatible = "gpio-keys";
0042 
0043                 key-0 {
0044                         label = "k1";
0045                         linux,code = <BTN_0>;
0046                         gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; /* PL3 */
0047                 };
0048         };
0049 
0050         reg_vdd_cpux: vdd-cpux-regulator {
0051                 compatible = "regulator-gpio";
0052                 regulator-name = "vdd-cpux";
0053                 regulator-min-microvolt = <1100000>;
0054                 regulator-max-microvolt = <1300000>;
0055                 regulator-always-on;
0056                 regulator-boot-on;
0057                 regulator-ramp-delay = <50>; /* 4ms */
0058 
0059                 enable-active-high;
0060                 enable-gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
0061                 gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0062                 gpios-states = <0x1>;
0063                 states = <1100000 0>, <1300000 1>;
0064         };
0065 
0066         reg_vcc_dram: vcc-dram {
0067                 compatible = "regulator-fixed";
0068                 regulator-name = "vcc-dram";
0069                 regulator-min-microvolt = <1500000>;
0070                 regulator-max-microvolt = <1500000>;
0071                 regulator-always-on;
0072                 regulator-boot-on;
0073                 enable-active-high;
0074                 gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
0075                 vin-supply = <&reg_vcc5v0>;
0076         };
0077 
0078         reg_vdd_sys: vdd-sys {
0079                 compatible = "regulator-fixed";
0080                 regulator-name = "vdd-sys";
0081                 regulator-min-microvolt = <1200000>;
0082                 regulator-max-microvolt = <1200000>;
0083                 regulator-always-on;
0084                 regulator-boot-on;
0085                 enable-active-high;
0086                 gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
0087                 vin-supply = <&reg_vcc5v0>;
0088         };
0089 
0090         wifi_pwrseq: wifi_pwrseq {
0091                 compatible = "mmc-pwrseq-simple";
0092                 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0093                 clocks = <&rtc CLK_OSC32K_FANOUT>;
0094                 clock-names = "ext_clock";
0095         };
0096 
0097 };
0098 
0099 &cpu0 {
0100         cpu-supply = <&reg_vdd_cpux>;
0101 };
0102 
0103 &ehci0 {
0104         status = "okay";
0105 };
0106 
0107 &mmc0 {
0108         bus-width = <4>;
0109         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0110         status = "okay";
0111         vmmc-supply = <&reg_vcc3v3>;
0112 };
0113 
0114 &mmc1 {
0115         vmmc-supply = <&reg_vcc3v3>;
0116         vqmmc-supply = <&reg_vcc3v3>;
0117         mmc-pwrseq = <&wifi_pwrseq>;
0118         bus-width = <4>;
0119         non-removable;
0120         status = "okay";
0121 
0122         sdio_wifi: sdio_wifi@1 {
0123                 reg = <1>;
0124                 compatible = "brcm,bcm4329-fmac";
0125                 interrupt-parent = <&pio>;
0126                 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
0127                 interrupt-names = "host-wake";
0128         };
0129 };
0130 
0131 &ohci0 {
0132         status = "okay";
0133 };
0134 
0135 &reg_usb0_vbus {
0136         gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
0137         status = "okay";
0138 };
0139 
0140 &uart0 {
0141         pinctrl-names = "default";
0142         pinctrl-0 = <&uart0_pa_pins>;
0143         status = "okay";
0144 };
0145 
0146 &uart2 {
0147         pinctrl-names = "default";
0148         pinctrl-0 = <&uart2_pins>, <&uart2_rts_cts_pins>;
0149         uart-has-rtscts;
0150         status = "okay";
0151 
0152         bluetooth {
0153                 compatible = "brcm,bcm43438-bt";
0154                 clocks = <&rtc CLK_OSC32K_FANOUT>;
0155                 clock-names = "lpo";
0156                 vbat-supply = <&reg_vcc3v3>;
0157                 vddio-supply = <&reg_vcc3v3>;
0158                 device-wakeup-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
0159                 host-wakeup-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */
0160                 shutdown-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
0161         };
0162 };
0163 
0164 &usb_otg {
0165         status = "okay";
0166         dr_mode = "otg";
0167 };
0168 
0169 &usbphy {
0170         usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0171         usb0_vbus-supply = <&reg_usb0_vbus>;
0172         status = "okay";
0173 };