Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (c) 2019 BayLibre, SAS |
| 4 | * Author: Neil Armstrong <narmstrong@baylibre.com> |
| 5 | * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com> |
| 6 | */ |
| 7 | |
| 8 | #include <dt-bindings/input/input.h> |
| 9 | #include <dt-bindings/gpio/meson-g12a-gpio.h> |
| 10 | |
| 11 | / { |
Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 12 | aliases { |
| 13 | serial0 = &uart_AO; |
| 14 | ethernet0 = ðmac; |
| 15 | }; |
| 16 | |
| 17 | chosen { |
| 18 | stdout-path = "serial0:115200n8"; |
| 19 | }; |
| 20 | |
| 21 | memory@0 { |
| 22 | device_type = "memory"; |
| 23 | reg = <0x0 0x0 0x0 0x80000000>; |
| 24 | }; |
| 25 | |
| 26 | adc-keys { |
| 27 | compatible = "adc-keys"; |
| 28 | io-channels = <&saradc 2>; |
| 29 | io-channel-names = "buttons"; |
| 30 | keyup-threshold-microvolt = <1710000>; |
| 31 | |
| 32 | button-function { |
| 33 | label = "Function"; |
| 34 | linux,code = <KEY_FN>; |
| 35 | press-threshold-microvolt = <10000>; |
| 36 | }; |
| 37 | }; |
| 38 | |
| 39 | leds { |
| 40 | compatible = "gpio-leds"; |
| 41 | |
| 42 | white { |
| 43 | label = "vim3:white:sys"; |
| 44 | gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; |
| 45 | linux,default-trigger = "heartbeat"; |
| 46 | }; |
| 47 | |
| 48 | red { |
| 49 | label = "vim3:red"; |
| 50 | gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>; |
| 51 | }; |
| 52 | }; |
| 53 | |
| 54 | emmc_pwrseq: emmc-pwrseq { |
| 55 | compatible = "mmc-pwrseq-emmc"; |
| 56 | reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; |
| 57 | }; |
| 58 | |
| 59 | gpio-keys-polled { |
| 60 | compatible = "gpio-keys-polled"; |
| 61 | poll-interval = <100>; |
| 62 | |
| 63 | power-button { |
| 64 | label = "power"; |
| 65 | linux,code = <KEY_POWER>; |
| 66 | gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>; |
| 67 | }; |
| 68 | }; |
| 69 | |
| 70 | sdio_pwrseq: sdio-pwrseq { |
| 71 | compatible = "mmc-pwrseq-simple"; |
| 72 | reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; |
| 73 | clocks = <&wifi32k>; |
| 74 | clock-names = "ext_clock"; |
| 75 | }; |
| 76 | |
| 77 | dc_in: regulator-dc_in { |
| 78 | compatible = "regulator-fixed"; |
| 79 | regulator-name = "DC_IN"; |
| 80 | regulator-min-microvolt = <5000000>; |
| 81 | regulator-max-microvolt = <5000000>; |
| 82 | regulator-always-on; |
| 83 | }; |
| 84 | |
| 85 | vcc_5v: regulator-vcc_5v { |
| 86 | compatible = "regulator-fixed"; |
| 87 | regulator-name = "VCC_5V"; |
| 88 | regulator-min-microvolt = <5000000>; |
| 89 | regulator-max-microvolt = <5000000>; |
| 90 | vin-supply = <&dc_in>; |
| 91 | |
| 92 | gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; |
| 93 | enable-active-high; |
| 94 | }; |
| 95 | |
| 96 | vcc_1v8: regulator-vcc_1v8 { |
| 97 | compatible = "regulator-fixed"; |
| 98 | regulator-name = "VCC_1V8"; |
| 99 | regulator-min-microvolt = <1800000>; |
| 100 | regulator-max-microvolt = <1800000>; |
| 101 | vin-supply = <&vcc_3v3>; |
| 102 | regulator-always-on; |
| 103 | }; |
| 104 | |
| 105 | vcc_3v3: regulator-vcc_3v3 { |
| 106 | compatible = "regulator-fixed"; |
| 107 | regulator-name = "VCC_3V3"; |
| 108 | regulator-min-microvolt = <3300000>; |
| 109 | regulator-max-microvolt = <3300000>; |
| 110 | vin-supply = <&vsys_3v3>; |
| 111 | regulator-always-on; |
| 112 | /* FIXME: actually controlled by VDDCPU_B_EN */ |
| 113 | }; |
| 114 | |
| 115 | vddao_1v8: regulator-vddao_1v8 { |
| 116 | compatible = "regulator-fixed"; |
| 117 | regulator-name = "VDDIO_AO1V8"; |
| 118 | regulator-min-microvolt = <1800000>; |
| 119 | regulator-max-microvolt = <1800000>; |
| 120 | vin-supply = <&vsys_3v3>; |
| 121 | regulator-always-on; |
| 122 | }; |
| 123 | |
| 124 | emmc_1v8: regulator-emmc_1v8 { |
| 125 | compatible = "regulator-fixed"; |
| 126 | regulator-name = "EMMC_AO1V8"; |
| 127 | regulator-min-microvolt = <1800000>; |
| 128 | regulator-max-microvolt = <1800000>; |
| 129 | vin-supply = <&vcc_3v3>; |
| 130 | regulator-always-on; |
| 131 | }; |
| 132 | |
| 133 | vsys_3v3: regulator-vsys_3v3 { |
| 134 | compatible = "regulator-fixed"; |
| 135 | regulator-name = "VSYS_3V3"; |
| 136 | regulator-min-microvolt = <3300000>; |
| 137 | regulator-max-microvolt = <3300000>; |
| 138 | vin-supply = <&dc_in>; |
| 139 | regulator-always-on; |
| 140 | }; |
| 141 | |
| 142 | usb_pwr: regulator-usb_pwr { |
| 143 | compatible = "regulator-fixed"; |
| 144 | regulator-name = "USB_PWR"; |
| 145 | regulator-min-microvolt = <5000000>; |
| 146 | regulator-max-microvolt = <5000000>; |
| 147 | vin-supply = <&vcc_5v>; |
| 148 | |
| 149 | gpio = <&gpio GPIOA_6 GPIO_ACTIVE_HIGH>; |
| 150 | enable-active-high; |
| 151 | }; |
| 152 | |
| 153 | hdmi-connector { |
| 154 | compatible = "hdmi-connector"; |
| 155 | type = "a"; |
| 156 | |
| 157 | port { |
| 158 | hdmi_connector_in: endpoint { |
| 159 | remote-endpoint = <&hdmi_tx_tmds_out>; |
| 160 | }; |
| 161 | }; |
| 162 | }; |
| 163 | |
| 164 | wifi32k: wifi32k { |
| 165 | compatible = "pwm-clock"; |
| 166 | #clock-cells = <0>; |
| 167 | clock-frequency = <32768>; |
| 168 | pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ |
| 169 | }; |
| 170 | }; |
| 171 | |
| 172 | &cec_AO { |
| 173 | pinctrl-0 = <&cec_ao_a_h_pins>; |
| 174 | pinctrl-names = "default"; |
| 175 | status = "disabled"; |
| 176 | hdmi-phandle = <&hdmi_tx>; |
| 177 | }; |
| 178 | |
| 179 | &cecb_AO { |
| 180 | pinctrl-0 = <&cec_ao_b_h_pins>; |
| 181 | pinctrl-names = "default"; |
| 182 | status = "okay"; |
| 183 | hdmi-phandle = <&hdmi_tx>; |
| 184 | }; |
| 185 | |
| 186 | &ext_mdio { |
| 187 | external_phy: ethernet-phy@0 { |
| 188 | /* Realtek RTL8211F (0x001cc916) */ |
| 189 | reg = <0>; |
| 190 | max-speed = <1000>; |
| 191 | |
| 192 | interrupt-parent = <&gpio_intc>; |
| 193 | /* MAC_INTR on GPIOZ_14 */ |
| 194 | interrupts = <26 IRQ_TYPE_LEVEL_LOW>; |
| 195 | }; |
| 196 | }; |
| 197 | |
| 198 | ðmac { |
| 199 | pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; |
| 200 | pinctrl-names = "default"; |
| 201 | status = "okay"; |
| 202 | phy-mode = "rgmii"; |
| 203 | phy-handle = <&external_phy>; |
| 204 | amlogic,tx-delay-ns = <2>; |
| 205 | }; |
| 206 | |
| 207 | &hdmi_tx { |
| 208 | status = "okay"; |
| 209 | pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; |
| 210 | pinctrl-names = "default"; |
| 211 | hdmi-supply = <&vcc_5v>; |
| 212 | }; |
| 213 | |
| 214 | &hdmi_tx_tmds_port { |
| 215 | hdmi_tx_tmds_out: endpoint { |
| 216 | remote-endpoint = <&hdmi_connector_in>; |
| 217 | }; |
| 218 | }; |
| 219 | |
| 220 | &i2c_AO { |
| 221 | status = "okay"; |
| 222 | pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>; |
| 223 | pinctrl-names = "default"; |
| 224 | |
| 225 | gpio_expander: gpio-controller@20 { |
| 226 | compatible = "ti,tca6408"; |
| 227 | reg = <0x20>; |
| 228 | vcc-supply = <&vcc_3v3>; |
| 229 | gpio-controller; |
| 230 | #gpio-cells = <2>; |
| 231 | }; |
| 232 | |
| 233 | rtc@51 { |
| 234 | compatible = "haoyu,hym8563"; |
| 235 | reg = <0x51>; |
| 236 | #clock-cells = <0>; |
| 237 | }; |
| 238 | }; |
| 239 | |
| 240 | &ir { |
| 241 | status = "okay"; |
| 242 | pinctrl-0 = <&remote_input_ao_pins>; |
| 243 | pinctrl-names = "default"; |
| 244 | linux,rc-map-name = "rc-khadas"; |
| 245 | }; |
| 246 | |
Jerome Brunet | dd5f235 | 2020-03-05 12:12:38 +0100 | [diff] [blame] | 247 | &pcie { |
| 248 | reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>; |
| 249 | }; |
| 250 | |
Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 251 | &pwm_ef { |
| 252 | status = "okay"; |
| 253 | pinctrl-0 = <&pwm_e_pins>; |
| 254 | pinctrl-names = "default"; |
| 255 | }; |
| 256 | |
| 257 | &saradc { |
| 258 | status = "okay"; |
| 259 | vref-supply = <&vddao_1v8>; |
| 260 | }; |
| 261 | |
| 262 | /* SDIO */ |
| 263 | &sd_emmc_a { |
| 264 | status = "okay"; |
| 265 | pinctrl-0 = <&sdio_pins>; |
| 266 | pinctrl-1 = <&sdio_clk_gate_pins>; |
| 267 | pinctrl-names = "default", "clk-gate"; |
| 268 | #address-cells = <1>; |
| 269 | #size-cells = <0>; |
| 270 | |
| 271 | bus-width = <4>; |
| 272 | cap-sd-highspeed; |
| 273 | sd-uhs-sdr50; |
| 274 | max-frequency = <100000000>; |
| 275 | |
| 276 | non-removable; |
| 277 | disable-wp; |
| 278 | |
Jerome Brunet | dd5f235 | 2020-03-05 12:12:38 +0100 | [diff] [blame] | 279 | /* WiFi firmware requires power to be kept while in suspend */ |
| 280 | keep-power-in-suspend; |
| 281 | |
Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 282 | mmc-pwrseq = <&sdio_pwrseq>; |
| 283 | |
| 284 | vmmc-supply = <&vsys_3v3>; |
| 285 | vqmmc-supply = <&vddao_1v8>; |
| 286 | |
| 287 | brcmf: wifi@1 { |
| 288 | reg = <1>; |
| 289 | compatible = "brcm,bcm4329-fmac"; |
| 290 | }; |
| 291 | }; |
| 292 | |
| 293 | /* SD card */ |
| 294 | &sd_emmc_b { |
| 295 | status = "okay"; |
| 296 | pinctrl-0 = <&sdcard_c_pins>; |
| 297 | pinctrl-1 = <&sdcard_clk_gate_c_pins>; |
| 298 | pinctrl-names = "default", "clk-gate"; |
| 299 | |
| 300 | bus-width = <4>; |
| 301 | cap-sd-highspeed; |
| 302 | max-frequency = <50000000>; |
| 303 | disable-wp; |
| 304 | |
| 305 | cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; |
| 306 | vmmc-supply = <&vsys_3v3>; |
| 307 | vqmmc-supply = <&vsys_3v3>; |
| 308 | }; |
| 309 | |
| 310 | /* eMMC */ |
| 311 | &sd_emmc_c { |
| 312 | status = "okay"; |
Neil Armstrong | 3a7d6a9 | 2020-04-20 15:44:41 +0200 | [diff] [blame] | 313 | pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; |
Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 314 | pinctrl-1 = <&emmc_clk_gate_pins>; |
| 315 | pinctrl-names = "default", "clk-gate"; |
| 316 | |
| 317 | bus-width = <8>; |
| 318 | cap-mmc-highspeed; |
| 319 | mmc-ddr-1_8v; |
| 320 | mmc-hs200-1_8v; |
| 321 | max-frequency = <200000000>; |
| 322 | disable-wp; |
| 323 | |
| 324 | mmc-pwrseq = <&emmc_pwrseq>; |
| 325 | vmmc-supply = <&vcc_3v3>; |
| 326 | vqmmc-supply = <&emmc_1v8>; |
| 327 | }; |
| 328 | |
Neil Armstrong | 3a7d6a9 | 2020-04-20 15:44:41 +0200 | [diff] [blame] | 329 | /* |
| 330 | * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR CS |
| 331 | * and eMMC Data 4 to 7 pins. |
| 332 | * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0, |
| 333 | * and change bus-width to 4 then spifc can be enabled. |
| 334 | */ |
| 335 | &spifc { |
| 336 | status = "disabled"; |
| 337 | pinctrl-0 = <&nor_pins>; |
| 338 | pinctrl-names = "default"; |
| 339 | |
| 340 | w25q32: spi-flash@0 { |
| 341 | #address-cells = <1>; |
| 342 | #size-cells = <1>; |
| 343 | compatible = "winbond,w25q128fw", "jedec,spi-nor"; |
| 344 | reg = <0>; |
| 345 | spi-max-frequency = <104000000>; |
| 346 | }; |
| 347 | }; |
| 348 | |
Andreas Färber | 1a87cc7 | 2019-10-09 16:03:54 +0200 | [diff] [blame] | 349 | &uart_A { |
| 350 | status = "okay"; |
| 351 | pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; |
| 352 | pinctrl-names = "default"; |
| 353 | uart-has-rtscts; |
| 354 | |
| 355 | bluetooth { |
| 356 | compatible = "brcm,bcm43438-bt"; |
| 357 | shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; |
| 358 | max-speed = <2000000>; |
| 359 | clocks = <&wifi32k>; |
| 360 | clock-names = "lpo"; |
| 361 | }; |
| 362 | }; |
| 363 | |
| 364 | &uart_AO { |
| 365 | status = "okay"; |
| 366 | pinctrl-0 = <&uart_ao_a_pins>; |
| 367 | pinctrl-names = "default"; |
| 368 | }; |
| 369 | |
| 370 | &usb2_phy0 { |
| 371 | phy-supply = <&dc_in>; |
| 372 | }; |
| 373 | |
| 374 | &usb2_phy1 { |
| 375 | phy-supply = <&usb_pwr>; |
| 376 | }; |
| 377 | |
| 378 | &usb3_pcie_phy { |
| 379 | phy-supply = <&usb_pwr>; |
| 380 | }; |
| 381 | |
| 382 | &usb { |
| 383 | status = "okay"; |
| 384 | dr_mode = "peripheral"; |
| 385 | }; |