1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2019 BayLibre, SAS 4 * Author: Neil Armstrong <narmstrong@baylibre.com> 5 */ 6 7/dts-v1/; 8 9#include "meson-g12b.dtsi" 10#include <dt-bindings/input/input.h> 11#include <dt-bindings/gpio/meson-g12a-gpio.h> 12#include <dt-bindings/sound/meson-g12a-tohdmitx.h> 13 14/ { 15 compatible = "hardkernel,odroid-n2", "amlogic,g12b"; 16 model = "Hardkernel ODROID-N2"; 17 18 aliases { 19 serial0 = &uart_AO; 20 ethernet0 = ðmac; 21 }; 22 23 chosen { 24 stdout-path = "serial0:115200n8"; 25 }; 26 27 memory@0 { 28 device_type = "memory"; 29 reg = <0x0 0x0 0x0 0x40000000>; 30 }; 31 32 emmc_pwrseq: emmc-pwrseq { 33 compatible = "mmc-pwrseq-emmc"; 34 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; 35 }; 36 37 leds { 38 compatible = "gpio-leds"; 39 40 blue { 41 label = "n2:blue"; 42 gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; 43 linux,default-trigger = "heartbeat"; 44 }; 45 }; 46 47 tflash_vdd: regulator-tflash_vdd { 48 compatible = "regulator-fixed"; 49 50 regulator-name = "TFLASH_VDD"; 51 regulator-min-microvolt = <3300000>; 52 regulator-max-microvolt = <3300000>; 53 54 gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>; 55 enable-active-high; 56 }; 57 58 tf_io: gpio-regulator-tf_io { 59 compatible = "regulator-gpio"; 60 61 regulator-name = "TF_IO"; 62 regulator-min-microvolt = <1800000>; 63 regulator-max-microvolt = <3300000>; 64 65 gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>; 66 gpios-states = <0>; 67 68 states = <3300000 0 69 1800000 1>; 70 }; 71 72 flash_1v8: regulator-flash_1v8 { 73 compatible = "regulator-fixed"; 74 regulator-name = "FLASH_1V8"; 75 regulator-min-microvolt = <1800000>; 76 regulator-max-microvolt = <1800000>; 77 vin-supply = <&vcc_3v3>; 78 regulator-always-on; 79 }; 80 81 main_12v: regulator-main_12v { 82 compatible = "regulator-fixed"; 83 regulator-name = "12V"; 84 regulator-min-microvolt = <12000000>; 85 regulator-max-microvolt = <12000000>; 86 regulator-always-on; 87 }; 88 89 vcc_5v: regulator-vcc_5v { 90 compatible = "regulator-fixed"; 91 regulator-name = "5V"; 92 regulator-min-microvolt = <5000000>; 93 regulator-max-microvolt = <5000000>; 94 regulator-always-on; 95 vin-supply = <&main_12v>; 96 }; 97 98 vcc_1v8: regulator-vcc_1v8 { 99 compatible = "regulator-fixed"; 100 regulator-name = "VCC_1V8"; 101 regulator-min-microvolt = <1800000>; 102 regulator-max-microvolt = <1800000>; 103 vin-supply = <&vcc_3v3>; 104 regulator-always-on; 105 }; 106 107 vcc_3v3: regulator-vcc_3v3 { 108 compatible = "regulator-fixed"; 109 regulator-name = "VCC_3V3"; 110 regulator-min-microvolt = <3300000>; 111 regulator-max-microvolt = <3300000>; 112 vin-supply = <&vddao_3v3>; 113 regulator-always-on; 114 /* FIXME: actually controlled by VDDCPU_B_EN */ 115 }; 116 117 hub_5v: regulator-hub_5v { 118 compatible = "regulator-fixed"; 119 regulator-name = "HUB_5V"; 120 regulator-min-microvolt = <5000000>; 121 regulator-max-microvolt = <5000000>; 122 vin-supply = <&vcc_5v>; 123 124 /* Connected to the Hub CHIPENABLE, LOW sets low power state */ 125 gpio = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; 126 enable-active-high; 127 }; 128 129 usb_pwr_en: regulator-usb_pwr_en { 130 compatible = "regulator-fixed"; 131 regulator-name = "USB_PWR_EN"; 132 regulator-min-microvolt = <5000000>; 133 regulator-max-microvolt = <5000000>; 134 vin-supply = <&vcc_5v>; 135 136 /* Connected to the microUSB port power enable */ 137 gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>; 138 enable-active-high; 139 }; 140 141 vddao_1v8: regulator-vddao_1v8 { 142 compatible = "regulator-fixed"; 143 regulator-name = "VDDAO_1V8"; 144 regulator-min-microvolt = <1800000>; 145 regulator-max-microvolt = <1800000>; 146 vin-supply = <&vddao_3v3>; 147 regulator-always-on; 148 }; 149 150 vddao_3v3: regulator-vddao_3v3 { 151 compatible = "regulator-fixed"; 152 regulator-name = "VDDAO_3V3"; 153 regulator-min-microvolt = <3300000>; 154 regulator-max-microvolt = <3300000>; 155 vin-supply = <&main_12v>; 156 regulator-always-on; 157 }; 158 159 hdmi-connector { 160 compatible = "hdmi-connector"; 161 type = "a"; 162 163 port { 164 hdmi_connector_in: endpoint { 165 remote-endpoint = <&hdmi_tx_tmds_out>; 166 }; 167 }; 168 }; 169 170 sound { 171 compatible = "amlogic,axg-sound-card"; 172 model = "G12A-ODROIDN2"; 173 audio-aux-devs = <&tdmout_b>; 174 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", 175 "TDMOUT_B IN 1", "FRDDR_B OUT 1", 176 "TDMOUT_B IN 2", "FRDDR_C OUT 1", 177 "TDM_B Playback", "TDMOUT_B OUT"; 178 179 assigned-clocks = <&clkc CLKID_MPLL2>, 180 <&clkc CLKID_MPLL0>, 181 <&clkc CLKID_MPLL1>; 182 assigned-clock-parents = <0>, <0>, <0>; 183 assigned-clock-rates = <294912000>, 184 <270950400>, 185 <393216000>; 186 status = "okay"; 187 188 dai-link-0 { 189 sound-dai = <&frddr_a>; 190 }; 191 192 dai-link-1 { 193 sound-dai = <&frddr_b>; 194 }; 195 196 dai-link-2 { 197 sound-dai = <&frddr_c>; 198 }; 199 200 /* 8ch hdmi interface */ 201 dai-link-3 { 202 sound-dai = <&tdmif_b>; 203 dai-format = "i2s"; 204 dai-tdm-slot-tx-mask-0 = <1 1>; 205 dai-tdm-slot-tx-mask-1 = <1 1>; 206 dai-tdm-slot-tx-mask-2 = <1 1>; 207 dai-tdm-slot-tx-mask-3 = <1 1>; 208 mclk-fs = <256>; 209 210 codec { 211 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; 212 }; 213 }; 214 215 /* hdmi glue */ 216 dai-link-4 { 217 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; 218 219 codec { 220 sound-dai = <&hdmi_tx>; 221 }; 222 }; 223 }; 224}; 225 226&arb { 227 status = "okay"; 228}; 229 230&cec_AO { 231 pinctrl-0 = <&cec_ao_a_h_pins>; 232 pinctrl-names = "default"; 233 status = "disabled"; 234 hdmi-phandle = <&hdmi_tx>; 235}; 236 237&cecb_AO { 238 pinctrl-0 = <&cec_ao_b_h_pins>; 239 pinctrl-names = "default"; 240 status = "okay"; 241 hdmi-phandle = <&hdmi_tx>; 242}; 243 244&clkc_audio { 245 status = "okay"; 246}; 247 248&ext_mdio { 249 external_phy: ethernet-phy@0 { 250 /* Realtek RTL8211F (0x001cc916) */ 251 reg = <0>; 252 max-speed = <1000>; 253 }; 254}; 255 256ðmac { 257 pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; 258 pinctrl-names = "default"; 259 status = "okay"; 260 phy-mode = "rgmii"; 261 phy-handle = <&external_phy>; 262 amlogic,tx-delay-ns = <2>; 263}; 264 265&frddr_a { 266 status = "okay"; 267}; 268 269&frddr_b { 270 status = "okay"; 271}; 272 273&frddr_c { 274 status = "okay"; 275}; 276 277&gpio { 278 /* 279 * WARNING: The USB Hub on the Odroid-N2 needs a reset signal 280 * to be turned high in order to be detected by the USB Controller 281 * This signal should be handled by a USB specific power sequence 282 * in order to reset the Hub when USB bus is powered down. 283 */ 284 usb-hub { 285 gpio-hog; 286 gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>; 287 output-high; 288 line-name = "usb-hub-reset"; 289 }; 290}; 291 292&hdmi_tx { 293 status = "okay"; 294 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; 295 pinctrl-names = "default"; 296 hdmi-supply = <&vcc_5v>; 297}; 298 299&hdmi_tx_tmds_port { 300 hdmi_tx_tmds_out: endpoint { 301 remote-endpoint = <&hdmi_connector_in>; 302 }; 303}; 304 305&ir { 306 status = "okay"; 307 pinctrl-0 = <&remote_input_ao_pins>; 308 pinctrl-names = "default"; 309}; 310 311/* SD card */ 312&sd_emmc_b { 313 status = "okay"; 314 pinctrl-0 = <&sdcard_c_pins>; 315 pinctrl-1 = <&sdcard_clk_gate_c_pins>; 316 pinctrl-names = "default", "clk-gate"; 317 318 bus-width = <4>; 319 cap-sd-highspeed; 320 max-frequency = <50000000>; 321 disable-wp; 322 323 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; 324 vmmc-supply = <&tflash_vdd>; 325 vqmmc-supply = <&tf_io>; 326 327}; 328 329/* eMMC */ 330&sd_emmc_c { 331 status = "okay"; 332 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; 333 pinctrl-1 = <&emmc_clk_gate_pins>; 334 pinctrl-names = "default", "clk-gate"; 335 336 bus-width = <8>; 337 cap-mmc-highspeed; 338 mmc-ddr-1_8v; 339 mmc-hs200-1_8v; 340 max-frequency = <200000000>; 341 disable-wp; 342 343 mmc-pwrseq = <&emmc_pwrseq>; 344 vmmc-supply = <&vcc_3v3>; 345 vqmmc-supply = <&flash_1v8>; 346}; 347 348&tdmif_b { 349 status = "okay"; 350}; 351 352&tdmout_b { 353 status = "okay"; 354}; 355 356&tohdmitx { 357 status = "okay"; 358}; 359 360&uart_AO { 361 status = "okay"; 362 pinctrl-0 = <&uart_ao_a_pins>; 363 pinctrl-names = "default"; 364}; 365 366&usb { 367 status = "okay"; 368 vbus-supply = <&usb_pwr_en>; 369}; 370 371&usb2_phy0 { 372 phy-supply = <&vcc_5v>; 373}; 374 375&usb2_phy1 { 376 /* Enable the hub which is connected to this port */ 377 phy-supply = <&hub_5v>; 378}; 379