Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org> |
| 4 | */ |
| 5 | |
| 6 | #include <dt-bindings/gpio/gpio.h> |
| 7 | #include <dt-bindings/input/input.h> |
| 8 | |
| 9 | / { |
| 10 | aliases { |
| 11 | ethernet0 = &emac; |
| 12 | serial0 = &uart0; |
| 13 | }; |
| 14 | |
| 15 | chosen { |
| 16 | stdout-path = "serial0:115200n8"; |
| 17 | }; |
| 18 | |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 19 | connector { |
| 20 | compatible = "hdmi-connector"; |
| 21 | type = "a"; |
| 22 | |
| 23 | port { |
| 24 | hdmi_con_in: endpoint { |
| 25 | remote-endpoint = <&hdmi_out_con>; |
| 26 | }; |
| 27 | }; |
| 28 | }; |
| 29 | |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 30 | leds { |
| 31 | compatible = "gpio-leds"; |
| 32 | |
| 33 | pwr_led { |
| 34 | label = "librecomputer:green:pwr"; |
| 35 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ |
| 36 | default-state = "on"; |
| 37 | }; |
| 38 | |
| 39 | status_led { |
| 40 | label = "librecomputer:blue:status"; |
| 41 | gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */ |
| 42 | }; |
| 43 | }; |
| 44 | |
| 45 | gpio_keys { |
| 46 | compatible = "gpio-keys"; |
| 47 | |
| 48 | power { |
| 49 | label = "power"; |
| 50 | linux,code = <KEY_POWER>; |
| 51 | gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ |
Samuel Holland | eef99ea | 2022-04-27 15:31:27 -0500 | [diff] [blame] | 52 | wakeup-source; |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 53 | }; |
| 54 | }; |
| 55 | |
| 56 | reg_vcc1v2: vcc1v2 { |
| 57 | compatible = "regulator-fixed"; |
| 58 | regulator-name = "vcc1v2"; |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 59 | regulator-min-microvolt = <1200000>; |
| 60 | regulator-max-microvolt = <1200000>; |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 61 | regulator-always-on; |
| 62 | regulator-boot-on; |
| 63 | vin-supply = <®_vcc5v0>; |
| 64 | gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ |
| 65 | enable-active-high; |
| 66 | }; |
| 67 | |
| 68 | reg_vcc3v3: vcc3v3 { |
| 69 | compatible = "regulator-fixed"; |
| 70 | regulator-name = "vcc3v3"; |
| 71 | regulator-min-microvolt = <3300000>; |
| 72 | regulator-max-microvolt = <3300000>; |
| 73 | vin-supply = <®_vcc5v0>; |
| 74 | }; |
| 75 | |
| 76 | /* This represents the board's 5V input */ |
| 77 | reg_vcc5v0: vcc5v0 { |
| 78 | compatible = "regulator-fixed"; |
| 79 | regulator-name = "vcc5v0"; |
| 80 | regulator-min-microvolt = <5000000>; |
| 81 | regulator-max-microvolt = <5000000>; |
| 82 | }; |
| 83 | |
| 84 | reg_vcc_dram: vcc-dram { |
| 85 | compatible = "regulator-fixed"; |
| 86 | regulator-name = "vcc-dram"; |
| 87 | regulator-min-microvolt = <1500000>; |
| 88 | regulator-max-microvolt = <1500000>; |
| 89 | regulator-always-on; |
| 90 | regulator-boot-on; |
| 91 | vin-supply = <®_vcc5v0>; |
| 92 | gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ |
| 93 | enable-active-high; |
| 94 | }; |
| 95 | |
| 96 | reg_vcc_io: vcc-io { |
| 97 | compatible = "regulator-fixed"; |
| 98 | regulator-name = "vcc-io"; |
| 99 | regulator-min-microvolt = <3300000>; |
| 100 | regulator-max-microvolt = <3300000>; |
| 101 | regulator-always-on; |
| 102 | regulator-boot-on; |
| 103 | vin-supply = <®_vcc3v3>; |
| 104 | gpio = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */ |
| 105 | }; |
| 106 | |
| 107 | reg_vdd_cpux: vdd-cpux { |
| 108 | compatible = "regulator-fixed"; |
| 109 | regulator-name = "vdd-cpux"; |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 110 | regulator-min-microvolt = <1200000>; |
| 111 | regulator-max-microvolt = <1200000>; |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 112 | regulator-always-on; |
| 113 | regulator-boot-on; |
| 114 | vin-supply = <®_vcc5v0>; |
| 115 | gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ |
| 116 | enable-active-high; |
| 117 | }; |
| 118 | }; |
| 119 | |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 120 | &codec { |
| 121 | allwinner,audio-routing = |
| 122 | "Line Out", "LINEOUT", |
| 123 | "MIC1", "Mic", |
| 124 | "Mic", "MBIAS"; |
| 125 | status = "okay"; |
| 126 | }; |
| 127 | |
| 128 | &cpu0 { |
| 129 | cpu-supply = <®_vdd_cpux>; |
| 130 | }; |
| 131 | |
Samuel Holland | eef99ea | 2022-04-27 15:31:27 -0500 | [diff] [blame] | 132 | &cpu1 { |
| 133 | cpu-supply = <®_vdd_cpux>; |
| 134 | }; |
| 135 | |
| 136 | &cpu2 { |
| 137 | cpu-supply = <®_vdd_cpux>; |
| 138 | }; |
| 139 | |
| 140 | &cpu3 { |
| 141 | cpu-supply = <®_vdd_cpux>; |
| 142 | }; |
| 143 | |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 144 | &de { |
| 145 | status = "okay"; |
| 146 | }; |
| 147 | |
| 148 | &ehci0 { |
| 149 | status = "okay"; |
| 150 | }; |
| 151 | |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 152 | &ehci1 { |
| 153 | status = "okay"; |
| 154 | }; |
| 155 | |
| 156 | &ehci2 { |
| 157 | status = "okay"; |
| 158 | }; |
| 159 | |
| 160 | &ehci3 { |
| 161 | status = "okay"; |
| 162 | }; |
| 163 | |
| 164 | &emac { |
| 165 | phy-handle = <&int_mii_phy>; |
| 166 | phy-mode = "mii"; |
| 167 | allwinner,leds-active-low; |
| 168 | status = "okay"; |
| 169 | }; |
| 170 | |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 171 | &hdmi { |
| 172 | status = "okay"; |
| 173 | }; |
| 174 | |
| 175 | &hdmi_out { |
| 176 | hdmi_out_con: endpoint { |
| 177 | remote-endpoint = <&hdmi_con_in>; |
| 178 | }; |
| 179 | }; |
| 180 | |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 181 | &ir { |
| 182 | pinctrl-names = "default"; |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 183 | pinctrl-0 = <&r_ir_rx_pin>; |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 184 | status = "okay"; |
| 185 | }; |
| 186 | |
| 187 | &mmc0 { |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 188 | vmmc-supply = <®_vcc_io>; |
| 189 | bus-width = <4>; |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 190 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 191 | status = "okay"; |
| 192 | }; |
| 193 | |
Chen-Yu Tsai | 386d243 | 2018-07-14 21:55:45 +0800 | [diff] [blame] | 194 | &mmc2 { |
| 195 | pinctrl-names = "default"; |
| 196 | pinctrl-0 = <&mmc2_8bit_pins>; |
| 197 | vmmc-supply = <®_vcc_io>; |
| 198 | bus-width = <8>; |
| 199 | non-removable; |
| 200 | status = "okay"; |
| 201 | }; |
| 202 | |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 203 | &ohci0 { |
| 204 | status = "okay"; |
| 205 | }; |
| 206 | |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 207 | &ohci1 { |
| 208 | status = "okay"; |
| 209 | }; |
| 210 | |
| 211 | &ohci2 { |
| 212 | status = "okay"; |
| 213 | }; |
| 214 | |
| 215 | &ohci3 { |
| 216 | status = "okay"; |
| 217 | }; |
| 218 | |
| 219 | &uart0 { |
| 220 | pinctrl-names = "default"; |
Chen-Yu Tsai | 8d7da69 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 221 | pinctrl-0 = <&uart0_pa_pins>; |
| 222 | status = "okay"; |
| 223 | }; |
| 224 | |
| 225 | &usb_otg { |
| 226 | dr_mode = "host"; |
Chen-Yu Tsai | 92b3235 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 227 | status = "okay"; |
| 228 | }; |
| 229 | |
| 230 | &usbphy { |
| 231 | /* VBUS on USB ports are always on */ |
| 232 | usb0_vbus-supply = <®_vcc5v0>; |
| 233 | usb1_vbus-supply = <®_vcc5v0>; |
| 234 | usb2_vbus-supply = <®_vcc5v0>; |
| 235 | usb3_vbus-supply = <®_vcc5v0>; |
| 236 | status = "okay"; |
| 237 | }; |