0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (C) 2019 Igor Pecovnik <igor@armbian.com>
0004 * Copyright (C) 2020 Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
0005 * Copyright (C) 2020 Yu-Tung Chang <mtwget@gmail.com>
0006 */
0007
0008 #include "sun8i-h3-nanopi.dtsi"
0009 #include <dt-bindings/leds/common.h>
0010
0011 / {
0012 model = "FriendlyARM NanoPi R1";
0013 compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3";
0014
0015 aliases {
0016 serial1 = &uart1;
0017 ethernet0 = &emac;
0018 ethernet1 = &wifi;
0019 };
0020
0021 reg_gmac_3v3: gmac-3v3 {
0022 compatible = "regulator-fixed";
0023 regulator-name = "gmac-3v3";
0024 regulator-min-microvolt = <3300000>;
0025 regulator-max-microvolt = <3300000>;
0026 startup-delay-us = <100000>;
0027 enable-active-high;
0028 gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
0029 };
0030
0031 reg_vdd_cpux: gpio-regulator {
0032 compatible = "regulator-gpio";
0033 regulator-name = "vdd-cpux";
0034 regulator-type = "voltage";
0035 regulator-boot-on;
0036 regulator-always-on;
0037 regulator-min-microvolt = <1100000>;
0038 regulator-max-microvolt = <1300000>;
0039 regulator-ramp-delay = <50>;
0040 gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0041 gpios-states = <0x1>;
0042 states = <1100000 0x0>,
0043 <1300000 0x1>;
0044 };
0045
0046 wifi_pwrseq: wifi_pwrseq {
0047 compatible = "mmc-pwrseq-simple";
0048 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0049 clocks = <&rtc CLK_OSC32K_FANOUT>;
0050 clock-names = "ext_clock";
0051 };
0052
0053 leds {
0054 led-2 {
0055 function = LED_FUNCTION_WAN;
0056 color = <LED_COLOR_ID_GREEN>;
0057 gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
0058 };
0059
0060 led-3 {
0061 function = LED_FUNCTION_LAN;
0062 color = <LED_COLOR_ID_GREEN>;
0063 gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; /* PA9 */
0064 };
0065 };
0066 };
0067
0068 &cpu0 {
0069 cpu-supply = <®_vdd_cpux>;
0070 };
0071
0072 &ehci1 {
0073 status = "okay";
0074 };
0075
0076 &ehci2 {
0077 status = "okay";
0078 };
0079
0080 &emac {
0081 pinctrl-names = "default";
0082 pinctrl-0 = <&emac_rgmii_pins>;
0083 phy-supply = <®_gmac_3v3>;
0084 phy-handle = <&ext_rgmii_phy>;
0085 phy-mode = "rgmii-id";
0086 status = "okay";
0087 };
0088
0089 &external_mdio {
0090 ext_rgmii_phy: ethernet-phy@7 {
0091 compatible = "ethernet-phy-ieee802.3-c22";
0092 reg = <7>;
0093 };
0094 };
0095
0096 &mmc1 {
0097 vmmc-supply = <®_vcc3v3>;
0098 vqmmc-supply = <®_vcc3v3>;
0099 mmc-pwrseq = <&wifi_pwrseq>;
0100 bus-width = <4>;
0101 non-removable;
0102 status = "okay";
0103
0104 wifi: wifi@1 {
0105 reg = <1>;
0106 compatible = "brcm,bcm4329-fmac";
0107 interrupt-parent = <&pio>;
0108 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
0109 interrupt-names = "host-wake";
0110 };
0111 };
0112
0113 &mmc2 {
0114 pinctrl-names = "default";
0115 pinctrl-0 = <&mmc2_8bit_pins>;
0116 vmmc-supply = <®_vcc3v3>;
0117 vqmmc-supply = <®_vcc3v3>;
0118 bus-width = <8>;
0119 non-removable;
0120 status = "okay";
0121 };
0122
0123 &ohci1 {
0124 status = "okay";
0125 };
0126
0127 &ohci2 {
0128 status = "okay";
0129 };
0130
0131 ®_usb0_vbus {
0132 gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
0133 status = "okay";
0134 };
0135
0136 &uart1 {
0137 pinctrl-names = "default";
0138 pinctrl-0 = <&uart1_pins>;
0139 status = "okay";
0140 };
0141
0142 &uart3 {
0143 pinctrl-names = "default";
0144 pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
0145 uart-has-rtscts;
0146 status = "okay";
0147
0148 bluetooth {
0149 compatible = "brcm,bcm43438-bt";
0150 clocks = <&rtc CLK_OSC32K_FANOUT>;
0151 clock-names = "lpo";
0152 vbat-supply = <®_vcc3v3>;
0153 vddio-supply = <®_vcc3v3>;
0154 device-wakeup-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
0155 host-wakeup-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */
0156 shutdown-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
0157 };
0158 };
0159
0160 &usb_otg {
0161 status = "okay";
0162 dr_mode = "otg";
0163 };
0164
0165 &usbphy {
0166 usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0167 usb0_vbus-supply = <®_usb0_vbus>;
0168 status = "okay";
0169 };