Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 2 | // Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz> |
| 3 | // Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com> |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 4 | |
| 5 | /dts-v1/; |
| 6 | |
| 7 | #include "sun50i-a64.dtsi" |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 8 | #include "sun50i-a64-cpu-opp.dtsi" |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 9 | |
| 10 | #include <dt-bindings/gpio/gpio.h> |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 11 | #include <dt-bindings/input/gpio-keys.h> |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 12 | #include <dt-bindings/input/input.h> |
| 13 | #include <dt-bindings/pwm/pwm.h> |
| 14 | |
| 15 | / { |
| 16 | model = "Pinebook"; |
| 17 | compatible = "pine64,pinebook", "allwinner,sun50i-a64"; |
| 18 | |
| 19 | aliases { |
| 20 | serial0 = &uart0; |
| 21 | ethernet0 = &rtl8723cs; |
| 22 | }; |
| 23 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 24 | backlight: backlight { |
| 25 | compatible = "pwm-backlight"; |
| 26 | pwms = <&pwm 0 50000 0>; |
| 27 | brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>; |
| 28 | default-brightness-level = <2>; |
| 29 | enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 30 | power-supply = <®_vbklt>; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | chosen { |
| 34 | stdout-path = "serial0:115200n8"; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | gpio_keys { |
| 38 | compatible = "gpio-keys"; |
| 39 | |
| 40 | lid_switch { |
| 41 | label = "Lid Switch"; |
| 42 | gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */ |
| 43 | linux,input-type = <EV_SW>; |
| 44 | linux,code = <SW_LID>; |
| 45 | linux,can-disable; |
| 46 | wakeup-source; |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 47 | wakeup-event-action = <EV_ACT_DEASSERTED>; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 48 | }; |
| 49 | }; |
| 50 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 51 | panel_edp: panel-edp { |
| 52 | compatible = "neweast,wjfh116008a"; |
| 53 | backlight = <&backlight>; |
| 54 | power-supply = <®_dc1sw>; |
| 55 | |
| 56 | port { |
| 57 | panel_edp_in: endpoint { |
| 58 | remote-endpoint = <&anx6345_out_edp>; |
| 59 | }; |
| 60 | }; |
| 61 | }; |
| 62 | |
| 63 | reg_vbklt: vbklt { |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 64 | compatible = "regulator-fixed"; |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 65 | regulator-name = "vbklt"; |
| 66 | regulator-min-microvolt = <18000000>; |
| 67 | regulator-max-microvolt = <18000000>; |
| 68 | gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ |
| 69 | enable-active-high; |
| 70 | }; |
| 71 | |
| 72 | reg_vcc5v0: vcc5v0 { |
| 73 | compatible = "regulator-fixed"; |
| 74 | regulator-name = "vcc5v0"; |
| 75 | regulator-min-microvolt = <5000000>; |
| 76 | regulator-max-microvolt = <5000000>; |
| 77 | gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>; |
| 78 | enable-active-high; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | wifi_pwrseq: wifi_pwrseq { |
| 82 | compatible = "mmc-pwrseq-simple"; |
| 83 | reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ |
| 84 | }; |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 85 | |
| 86 | speaker_amp: audio-amplifier { |
| 87 | compatible = "simple-audio-amplifier"; |
| 88 | VCC-supply = <®_vcc5v0>; |
| 89 | enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ |
| 90 | sound-name-prefix = "Speaker Amp"; |
| 91 | }; |
| 92 | |
| 93 | }; |
| 94 | |
| 95 | &codec { |
| 96 | status = "okay"; |
| 97 | }; |
| 98 | |
| 99 | &codec_analog { |
| 100 | cpvdd-supply = <®_eldo1>; |
| 101 | status = "okay"; |
| 102 | }; |
| 103 | |
| 104 | &cpu0 { |
| 105 | cpu-supply = <®_dcdc2>; |
| 106 | }; |
| 107 | |
| 108 | &cpu1 { |
| 109 | cpu-supply = <®_dcdc2>; |
| 110 | }; |
| 111 | |
| 112 | &cpu2 { |
| 113 | cpu-supply = <®_dcdc2>; |
| 114 | }; |
| 115 | |
| 116 | &cpu3 { |
| 117 | cpu-supply = <®_dcdc2>; |
| 118 | }; |
| 119 | |
| 120 | &dai { |
| 121 | status = "okay"; |
| 122 | }; |
| 123 | |
| 124 | &de { |
| 125 | status = "okay"; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 126 | }; |
| 127 | |
| 128 | &ehci0 { |
| 129 | phys = <&usbphy 0>; |
| 130 | phy-names = "usb"; |
| 131 | status = "okay"; |
| 132 | }; |
| 133 | |
| 134 | &ehci1 { |
| 135 | status = "okay"; |
| 136 | }; |
| 137 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 138 | &mixer0 { |
| 139 | status = "okay"; |
| 140 | }; |
| 141 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 142 | &mmc0 { |
| 143 | pinctrl-names = "default"; |
| 144 | pinctrl-0 = <&mmc0_pins>; |
| 145 | vmmc-supply = <®_dcdc1>; |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 146 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 147 | disable-wp; |
| 148 | bus-width = <4>; |
| 149 | status = "okay"; |
| 150 | }; |
| 151 | |
| 152 | &mmc1 { |
| 153 | pinctrl-names = "default"; |
| 154 | pinctrl-0 = <&mmc1_pins>; |
| 155 | vmmc-supply = <®_dldo4>; |
| 156 | vqmmc-supply = <®_eldo1>; |
| 157 | mmc-pwrseq = <&wifi_pwrseq>; |
| 158 | bus-width = <4>; |
| 159 | non-removable; |
| 160 | status = "okay"; |
| 161 | |
| 162 | rtl8723cs: wifi@1 { |
| 163 | reg = <1>; |
| 164 | }; |
| 165 | }; |
| 166 | |
| 167 | &mmc2 { |
| 168 | pinctrl-names = "default"; |
| 169 | pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>; |
| 170 | vmmc-supply = <®_dcdc1>; |
| 171 | vqmmc-supply = <®_eldo1>; |
| 172 | bus-width = <8>; |
| 173 | non-removable; |
| 174 | cap-mmc-hw-reset; |
| 175 | mmc-hs200-1_8v; |
| 176 | status = "okay"; |
| 177 | }; |
| 178 | |
| 179 | &ohci0 { |
| 180 | phys = <&usbphy 0>; |
| 181 | phy-names = "usb"; |
| 182 | status = "okay"; |
| 183 | }; |
| 184 | |
| 185 | &ohci1 { |
| 186 | status = "okay"; |
| 187 | }; |
| 188 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 189 | &pio { |
| 190 | vcc-pc-supply = <®_eldo1>; |
| 191 | vcc-pd-supply = <®_dcdc1>; |
| 192 | vcc-pe-supply = <®_aldo1>; |
| 193 | vcc-pg-supply = <®_eldo1>; |
| 194 | }; |
| 195 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 196 | &pwm { |
| 197 | status = "okay"; |
| 198 | }; |
| 199 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 200 | &r_i2c { |
| 201 | clock-frequency = <100000>; |
| 202 | pinctrl-names = "default"; |
| 203 | pinctrl-0 = <&r_i2c_pl89_pins>; |
| 204 | status = "okay"; |
| 205 | |
| 206 | anx6345: anx6345@38 { |
| 207 | compatible = "analogix,anx6345"; |
| 208 | reg = <0x38>; |
| 209 | reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */ |
| 210 | dvdd25-supply = <®_dldo2>; |
| 211 | dvdd12-supply = <®_fldo1>; |
| 212 | |
| 213 | ports { |
| 214 | #address-cells = <1>; |
| 215 | #size-cells = <0>; |
| 216 | |
| 217 | anx6345_in: port@0 { |
| 218 | reg = <0>; |
| 219 | anx6345_in_tcon0: endpoint { |
| 220 | remote-endpoint = <&tcon0_out_anx6345>; |
| 221 | }; |
| 222 | }; |
| 223 | |
| 224 | anx6345_out: port@1 { |
| 225 | reg = <1>; |
| 226 | anx6345_out_edp: endpoint { |
| 227 | remote-endpoint = <&panel_edp_in>; |
| 228 | }; |
| 229 | }; |
| 230 | }; |
| 231 | }; |
| 232 | }; |
| 233 | |
| 234 | &r_pio { |
| 235 | /* |
| 236 | * FIXME: We can't add that supply for now since it would |
| 237 | * create a circular dependency between pinctrl, the regulator |
| 238 | * and the RSB Bus. |
| 239 | * |
| 240 | * vcc-pl-supply = <®_aldo2>; |
| 241 | */ |
| 242 | }; |
| 243 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 244 | &r_rsb { |
| 245 | status = "okay"; |
| 246 | |
| 247 | axp803: pmic@3a3 { |
| 248 | compatible = "x-powers,axp803"; |
| 249 | reg = <0x3a3>; |
| 250 | interrupt-parent = <&r_intc>; |
| 251 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
| 252 | }; |
| 253 | }; |
| 254 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 255 | #include "axp803.dtsi" |
| 256 | |
| 257 | &ac_power_supply { |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 258 | status = "okay"; |
| 259 | }; |
| 260 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 261 | &battery_power_supply { |
| 262 | status = "okay"; |
| 263 | }; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 264 | |
| 265 | ®_aldo1 { |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 266 | regulator-name = "vcc-pe"; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 267 | }; |
| 268 | |
| 269 | ®_aldo2 { |
| 270 | regulator-always-on; |
| 271 | regulator-min-microvolt = <1800000>; |
| 272 | regulator-max-microvolt = <3300000>; |
| 273 | regulator-name = "vcc-pl"; |
| 274 | }; |
| 275 | |
| 276 | ®_aldo3 { |
| 277 | regulator-always-on; |
| 278 | regulator-min-microvolt = <2700000>; |
| 279 | regulator-max-microvolt = <3300000>; |
| 280 | regulator-name = "vcc-pll-avcc"; |
| 281 | }; |
| 282 | |
| 283 | ®_dc1sw { |
| 284 | regulator-name = "vcc-lcd"; |
| 285 | }; |
| 286 | |
| 287 | ®_dcdc1 { |
| 288 | regulator-always-on; |
| 289 | regulator-min-microvolt = <3300000>; |
| 290 | regulator-max-microvolt = <3300000>; |
| 291 | regulator-name = "vcc-3v3"; |
| 292 | }; |
| 293 | |
| 294 | ®_dcdc2 { |
| 295 | regulator-always-on; |
| 296 | regulator-min-microvolt = <1000000>; |
| 297 | regulator-max-microvolt = <1300000>; |
| 298 | regulator-name = "vdd-cpux"; |
| 299 | }; |
| 300 | |
| 301 | /* DCDC3 is polyphased with DCDC2 */ |
| 302 | |
| 303 | ®_dcdc5 { |
| 304 | regulator-always-on; |
| 305 | regulator-min-microvolt = <1200000>; |
| 306 | regulator-max-microvolt = <1200000>; |
| 307 | regulator-name = "vcc-dram"; |
| 308 | }; |
| 309 | |
| 310 | ®_dcdc6 { |
| 311 | regulator-always-on; |
| 312 | regulator-min-microvolt = <1100000>; |
| 313 | regulator-max-microvolt = <1100000>; |
| 314 | regulator-name = "vdd-sys"; |
| 315 | }; |
| 316 | |
| 317 | ®_dldo1 { |
| 318 | regulator-min-microvolt = <3300000>; |
| 319 | regulator-max-microvolt = <3300000>; |
| 320 | regulator-name = "vcc-hdmi"; |
| 321 | }; |
| 322 | |
| 323 | ®_dldo2 { |
| 324 | regulator-min-microvolt = <2500000>; |
| 325 | regulator-max-microvolt = <2500000>; |
| 326 | regulator-name = "vcc-edp"; |
| 327 | }; |
| 328 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 329 | ®_dldo4 { |
| 330 | regulator-min-microvolt = <3300000>; |
| 331 | regulator-max-microvolt = <3300000>; |
| 332 | regulator-name = "vcc-wifi"; |
| 333 | }; |
| 334 | |
| 335 | ®_eldo1 { |
| 336 | regulator-always-on; |
| 337 | regulator-min-microvolt = <1800000>; |
| 338 | regulator-max-microvolt = <1800000>; |
| 339 | regulator-name = "cpvdd"; |
| 340 | }; |
| 341 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 342 | ®_fldo1 { |
| 343 | regulator-min-microvolt = <1200000>; |
| 344 | regulator-max-microvolt = <1200000>; |
| 345 | regulator-name = "vcc-1v2-hsic"; |
| 346 | }; |
| 347 | |
| 348 | ®_fldo2 { |
| 349 | regulator-always-on; |
| 350 | regulator-min-microvolt = <1100000>; |
| 351 | regulator-max-microvolt = <1100000>; |
| 352 | regulator-name = "vdd-cpus"; |
| 353 | }; |
| 354 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 355 | ®_rtc_ldo { |
| 356 | regulator-name = "vcc-rtc"; |
| 357 | }; |
| 358 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 359 | &simplefb_lcd { |
| 360 | panel-supply = <®_dc1sw>; |
| 361 | dvdd25-supply = <®_dldo2>; |
| 362 | dvdd12-supply = <®_fldo1>; |
| 363 | }; |
| 364 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 365 | &simplefb_hdmi { |
| 366 | vcc-hdmi-supply = <®_dldo1>; |
| 367 | }; |
| 368 | |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 369 | &sound { |
| 370 | status = "okay"; |
| 371 | simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>; |
| 372 | simple-audio-card,widgets = "Microphone", "Internal Microphone Left", |
| 373 | "Microphone", "Internal Microphone Right", |
| 374 | "Headphone", "Headphone Jack", |
| 375 | "Speaker", "Internal Speaker"; |
| 376 | simple-audio-card,routing = |
| 377 | "Left DAC", "AIF1 Slot 0 Left", |
| 378 | "Right DAC", "AIF1 Slot 0 Right", |
| 379 | "Speaker Amp INL", "LINEOUT", |
| 380 | "Speaker Amp INR", "LINEOUT", |
| 381 | "Internal Speaker", "Speaker Amp OUTL", |
| 382 | "Internal Speaker", "Speaker Amp OUTR", |
| 383 | "Headphone Jack", "HP", |
| 384 | "AIF1 Slot 0 Left ADC", "Left ADC", |
| 385 | "AIF1 Slot 0 Right ADC", "Right ADC", |
| 386 | "Internal Microphone Left", "MBIAS", |
| 387 | "MIC1", "Internal Microphone Left", |
| 388 | "Internal Microphone Right", "HBIAS", |
| 389 | "MIC2", "Internal Microphone Right"; |
| 390 | }; |
| 391 | |
| 392 | &tcon0 { |
| 393 | pinctrl-names = "default"; |
| 394 | pinctrl-0 = <&lcd_rgb666_pins>; |
| 395 | |
| 396 | status = "okay"; |
| 397 | }; |
| 398 | |
| 399 | &tcon0_out { |
| 400 | tcon0_out_anx6345: endpoint { |
| 401 | remote-endpoint = <&anx6345_in_tcon0>; |
| 402 | }; |
| 403 | }; |
| 404 | |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 405 | &uart0 { |
| 406 | pinctrl-names = "default"; |
| 407 | pinctrl-0 = <&uart0_pb_pins>; |
| 408 | status = "okay"; |
| 409 | }; |
| 410 | |
| 411 | &usb_otg { |
| 412 | dr_mode = "host"; |
| 413 | }; |
| 414 | |
| 415 | &usbphy { |
Samuel Holland | e210ec0 | 2020-10-24 10:21:55 -0500 | [diff] [blame] | 416 | usb0_vbus-supply = <®_vcc5v0>; |
| 417 | usb1_vbus-supply = <®_vcc5v0>; |
Vasily Khoruzhick | b972831 | 2018-11-05 20:24:31 -0800 | [diff] [blame] | 418 | status = "okay"; |
| 419 | }; |