0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Device Tree Source for A20-SOM204-EVB Board
0004 *
0005 * Copyright (C) 2018 Olimex Ltd.
0006 * Author: Stefan Mavrodiev <stefan@olimex.com>
0007 */
0008
0009 /dts-v1/;
0010 #include "sun7i-a20.dtsi"
0011 #include "sunxi-common-regulators.dtsi"
0012
0013
0014 #include <dt-bindings/gpio/gpio.h>
0015 #include <dt-bindings/interrupt-controller/irq.h>
0016 #include <dt-bindings/pwm/pwm.h>
0017
0018 / {
0019 model = "Olimex A20-SOM204-EVB";
0020 compatible = "olimex,a20-olimex-som204-evb", "allwinner,sun7i-a20";
0021
0022 aliases {
0023 serial0 = &uart0;
0024 serial1 = &uart4;
0025 serial2 = &uart7;
0026 spi0 = &spi1;
0027 spi1 = &spi2;
0028 ethernet1 = &rtl8723bs;
0029 };
0030
0031 chosen {
0032 stdout-path = "serial0:115200n8";
0033 };
0034
0035 hdmi-connector {
0036 compatible = "hdmi-connector";
0037 type = "a";
0038
0039 port {
0040 hdmi_con_in: endpoint {
0041 remote-endpoint = <&hdmi_out_con>;
0042 };
0043 };
0044 };
0045
0046 leds {
0047 compatible = "gpio-leds";
0048
0049 led-0 {
0050 label = "a20-som204-evb:green:stat";
0051 gpios = <&pio 8 0 GPIO_ACTIVE_HIGH>;
0052 default-state = "on";
0053 };
0054
0055 led-1 {
0056 label = "a20-som204-evb:green:led1";
0057 gpios = <&pio 8 10 GPIO_ACTIVE_HIGH>;
0058 default-state = "on";
0059 };
0060
0061 led-2 {
0062 label = "a20-som204-evb:yellow:led2";
0063 gpios = <&pio 8 11 GPIO_ACTIVE_HIGH>;
0064 default-state = "on";
0065 };
0066 };
0067
0068 rtl_pwrseq: rtl_pwrseq {
0069 compatible = "mmc-pwrseq-simple";
0070 reset-gpios = <&pio 6 9 GPIO_ACTIVE_LOW>;
0071 };
0072 };
0073
0074 &ahci {
0075 target-supply = <®_ahci_5v>;
0076 status = "okay";
0077 };
0078
0079 &can0 {
0080 pinctrl-names = "default";
0081 pinctrl-0 = <&can_ph_pins>;
0082 status = "okay";
0083 };
0084
0085 &codec {
0086 status = "okay";
0087 };
0088
0089 &cpu0 {
0090 cpu-supply = <®_dcdc2>;
0091 };
0092
0093 &de {
0094 status = "okay";
0095 };
0096
0097 &ehci0 {
0098 status = "okay";
0099 };
0100
0101 &ehci1 {
0102 status = "okay";
0103 };
0104
0105 &gmac {
0106 pinctrl-names = "default";
0107 pinctrl-0 = <&gmac_rgmii_pins>;
0108 phy-handle = <&phy3>;
0109 phy-mode = "rgmii";
0110 phy-supply = <®_vcc3v3>;
0111 status = "okay";
0112 };
0113
0114 &hdmi {
0115 status = "okay";
0116 };
0117
0118 &hdmi_out {
0119 hdmi_out_con: endpoint {
0120 remote-endpoint = <&hdmi_con_in>;
0121 };
0122 };
0123
0124 &i2c0 {
0125 status = "okay";
0126
0127 axp209: pmic@34 {
0128 reg = <0x34>;
0129 interrupt-parent = <&nmi_intc>;
0130 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0131 };
0132 };
0133
0134 /* Exposed to UEXT1 */
0135 &i2c1 {
0136 status = "okay";
0137
0138 eeprom: eeprom@50 {
0139 compatible = "atmel,24c16";
0140 reg = <0x50>;
0141 pagesize = <16>;
0142 };
0143 };
0144
0145 /* Exposed to UEXT2 */
0146 &i2c2 {
0147 status = "okay";
0148 };
0149
0150 &ir0 {
0151 pinctrl-names = "default";
0152 pinctrl-0 = <&ir0_rx_pin>;
0153 status = "okay";
0154 };
0155
0156 &gmac_mdio {
0157 phy3: ethernet-phy@3 {
0158 reg = <3>;
0159 reset-gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
0160 reset-assert-us = <10000>;
0161 /* wait 1s after reset, otherwise fail to read phy id */
0162 reset-deassert-us = <1000000>;
0163 };
0164 };
0165
0166 &mmc0 {
0167 vmmc-supply = <®_vcc3v3>;
0168 bus-width = <4>;
0169 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>;
0170 status = "okay";
0171 };
0172
0173 &mmc3 {
0174 vmmc-supply = <®_vcc3v3>;
0175 mmc-pwrseq = <&rtl_pwrseq>;
0176 bus-width = <4>;
0177 non-removable;
0178 status = "okay";
0179
0180 rtl8723bs: sdio_wifi@1 {
0181 reg = <1>;
0182 };
0183 };
0184
0185 &ohci0 {
0186 status = "okay";
0187 };
0188
0189 &ohci1 {
0190 status = "okay";
0191 };
0192
0193 &otg_sram {
0194 status = "okay";
0195 };
0196
0197 &pio {
0198 uart3_rts_pin: uart3-rts-pin {
0199 pins = "PG8";
0200 function = "uart3";
0201 };
0202 };
0203
0204 #include "axp209.dtsi"
0205
0206 &ac_power_supply {
0207 status = "okay";
0208 };
0209
0210 &battery_power_supply {
0211 status = "okay";
0212 };
0213
0214 ®_ahci_5v {
0215 gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
0216 status = "okay";
0217 };
0218
0219 ®_dcdc2 {
0220 regulator-always-on;
0221 regulator-min-microvolt = <1000000>;
0222 regulator-max-microvolt = <1400000>;
0223 regulator-name = "vdd-cpu";
0224 };
0225
0226 ®_dcdc3 {
0227 regulator-always-on;
0228 regulator-min-microvolt = <1000000>;
0229 regulator-max-microvolt = <1400000>;
0230 regulator-name = "vdd-int-dll";
0231 };
0232
0233 ®_ldo1 {
0234 regulator-always-on;
0235 regulator-min-microvolt = <1300000>;
0236 regulator-max-microvolt = <1300000>;
0237 regulator-name = "vdd-rtc";
0238 };
0239
0240 ®_ldo2 {
0241 regulator-always-on;
0242 regulator-min-microvolt = <3000000>;
0243 regulator-max-microvolt = <3000000>;
0244 regulator-name = "avcc";
0245 };
0246
0247 ®_ldo4 {
0248 regulator-min-microvolt = <3300000>;
0249 regulator-max-microvolt = <3300000>;
0250 regulator-name = "vcc-pg";
0251 };
0252
0253 ®_usb0_vbus {
0254 gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
0255 status = "okay";
0256 };
0257
0258 ®_usb1_vbus {
0259 status = "okay";
0260 };
0261
0262 ®_usb2_vbus {
0263 status = "okay";
0264 };
0265
0266 /* Exposed to UEXT1 */
0267 &spi1 {
0268 pinctrl-names = "default";
0269 pinctrl-0 = <&spi1_pi_pins>,
0270 <&spi1_cs0_pi_pin>;
0271 status = "okay";
0272 };
0273
0274 /* Exposed to UEXT2 */
0275 &spi2 {
0276 pinctrl-names = "default";
0277 pinctrl-0 = <&spi2_pc_pins>,
0278 <&spi2_cs0_pc_pin>;
0279 status = "okay";
0280 };
0281
0282 &uart0 {
0283 pinctrl-names = "default";
0284 pinctrl-0 = <&uart0_pb_pins>;
0285 status = "okay";
0286 };
0287
0288 /* Used for RTL8723BS bluetooth */
0289 &uart3 {
0290 pinctrl-names = "default";
0291 pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_pin>;
0292 status = "okay";
0293 };
0294
0295 /* Exposed to UEXT1 */
0296 &uart4 {
0297 pinctrl-names = "default";
0298 pinctrl-0 = <&uart4_pg_pins>;
0299 status = "okay";
0300 };
0301
0302 /* Exposed to UEXT2 */
0303 &uart7 {
0304 pinctrl-names = "default";
0305 pinctrl-0 = <&uart7_pi_pins>;
0306 status = "okay";
0307 };
0308
0309 &usb_otg {
0310 dr_mode = "otg";
0311 status = "okay";
0312 };
0313
0314 &usb_power_supply {
0315 status = "okay";
0316 };
0317
0318 &usbphy {
0319 usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
0320 usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
0321 usb0_vbus_power-supply = <&usb_power_supply>;
0322 usb0_vbus-supply = <®_usb0_vbus>;
0323 usb1_vbus-supply = <®_usb1_vbus>;
0324 usb2_vbus-supply = <®_usb2_vbus>;
0325 status = "okay";
0326 };