0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 // Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
0003 // Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
0004
0005 /dts-v1/;
0006
0007 #include "sun50i-a64.dtsi"
0008 #include "sun50i-a64-cpu-opp.dtsi"
0009
0010 #include <dt-bindings/gpio/gpio.h>
0011 #include <dt-bindings/input/gpio-keys.h>
0012 #include <dt-bindings/input/input.h>
0013 #include <dt-bindings/pwm/pwm.h>
0014
0015 / {
0016 model = "Pinebook";
0017 compatible = "pine64,pinebook", "allwinner,sun50i-a64";
0018 chassis-type = "laptop";
0019
0020 aliases {
0021 serial0 = &uart0;
0022 ethernet0 = &rtl8723cs;
0023 };
0024
0025 backlight: backlight {
0026 compatible = "pwm-backlight";
0027 pwms = <&pwm 0 50000 0>;
0028 brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
0029 default-brightness-level = <2>;
0030 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
0031 power-supply = <®_vbklt>;
0032 };
0033
0034 chosen {
0035 stdout-path = "serial0:115200n8";
0036 };
0037
0038 gpio-keys {
0039 compatible = "gpio-keys";
0040
0041 lid-switch {
0042 label = "Lid Switch";
0043 gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
0044 linux,input-type = <EV_SW>;
0045 linux,code = <SW_LID>;
0046 linux,can-disable;
0047 wakeup-source;
0048 wakeup-event-action = <EV_ACT_DEASSERTED>;
0049 };
0050 };
0051
0052 panel_edp: panel-edp {
0053 compatible = "neweast,wjfh116008a";
0054 backlight = <&backlight>;
0055 power-supply = <®_dc1sw>;
0056
0057 port {
0058 panel_edp_in: endpoint {
0059 remote-endpoint = <&anx6345_out_edp>;
0060 };
0061 };
0062 };
0063
0064 reg_vbklt: vbklt {
0065 compatible = "regulator-fixed";
0066 regulator-name = "vbklt";
0067 regulator-min-microvolt = <18000000>;
0068 regulator-max-microvolt = <18000000>;
0069 gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
0070 enable-active-high;
0071 };
0072
0073 reg_vcc5v0: vcc5v0 {
0074 compatible = "regulator-fixed";
0075 regulator-name = "vcc5v0";
0076 regulator-min-microvolt = <5000000>;
0077 regulator-max-microvolt = <5000000>;
0078 gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
0079 enable-active-high;
0080 };
0081
0082 wifi_pwrseq: wifi_pwrseq {
0083 compatible = "mmc-pwrseq-simple";
0084 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
0085 };
0086
0087 speaker_amp: audio-amplifier {
0088 compatible = "simple-audio-amplifier";
0089 VCC-supply = <®_vcc5v0>;
0090 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
0091 sound-name-prefix = "Speaker Amp";
0092 };
0093
0094 };
0095
0096 &codec {
0097 status = "okay";
0098 };
0099
0100 &codec_analog {
0101 cpvdd-supply = <®_eldo1>;
0102 status = "okay";
0103 };
0104
0105 &cpu0 {
0106 cpu-supply = <®_dcdc2>;
0107 };
0108
0109 &cpu1 {
0110 cpu-supply = <®_dcdc2>;
0111 };
0112
0113 &cpu2 {
0114 cpu-supply = <®_dcdc2>;
0115 };
0116
0117 &cpu3 {
0118 cpu-supply = <®_dcdc2>;
0119 };
0120
0121 &dai {
0122 status = "okay";
0123 };
0124
0125 &de {
0126 status = "okay";
0127 };
0128
0129 &ehci0 {
0130 status = "okay";
0131 };
0132
0133 &ehci1 {
0134 status = "okay";
0135 };
0136
0137 &mixer0 {
0138 status = "okay";
0139 };
0140
0141 &mmc0 {
0142 pinctrl-names = "default";
0143 pinctrl-0 = <&mmc0_pins>;
0144 vmmc-supply = <®_dcdc1>;
0145 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0146 disable-wp;
0147 bus-width = <4>;
0148 status = "okay";
0149 };
0150
0151 &mmc1 {
0152 pinctrl-names = "default";
0153 pinctrl-0 = <&mmc1_pins>;
0154 vmmc-supply = <®_dldo4>;
0155 vqmmc-supply = <®_eldo1>;
0156 mmc-pwrseq = <&wifi_pwrseq>;
0157 bus-width = <4>;
0158 non-removable;
0159 status = "okay";
0160
0161 rtl8723cs: wifi@1 {
0162 reg = <1>;
0163 };
0164 };
0165
0166 &mmc2 {
0167 pinctrl-names = "default";
0168 pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
0169 vmmc-supply = <®_dcdc1>;
0170 vqmmc-supply = <®_eldo1>;
0171 max-frequency = <200000000>;
0172 bus-width = <8>;
0173 non-removable;
0174 cap-mmc-hw-reset;
0175 mmc-hs200-1_8v;
0176 status = "okay";
0177 };
0178
0179 &ohci0 {
0180 status = "okay";
0181 };
0182
0183 &ohci1 {
0184 status = "okay";
0185 };
0186
0187 &pio {
0188 vcc-pc-supply = <®_eldo1>;
0189 vcc-pd-supply = <®_dcdc1>;
0190 vcc-pe-supply = <®_aldo1>;
0191 vcc-pg-supply = <®_eldo1>;
0192 };
0193
0194 &pwm {
0195 status = "okay";
0196 };
0197
0198 &r_i2c {
0199 clock-frequency = <100000>;
0200 pinctrl-names = "default";
0201 pinctrl-0 = <&r_i2c_pl89_pins>;
0202 status = "okay";
0203
0204 anx6345: anx6345@38 {
0205 compatible = "analogix,anx6345";
0206 reg = <0x38>;
0207 reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
0208 dvdd25-supply = <®_dldo2>;
0209 dvdd12-supply = <®_fldo1>;
0210
0211 ports {
0212 #address-cells = <1>;
0213 #size-cells = <0>;
0214
0215 anx6345_in: port@0 {
0216 reg = <0>;
0217 anx6345_in_tcon0: endpoint {
0218 remote-endpoint = <&tcon0_out_anx6345>;
0219 };
0220 };
0221
0222 anx6345_out: port@1 {
0223 reg = <1>;
0224 anx6345_out_edp: endpoint {
0225 remote-endpoint = <&panel_edp_in>;
0226 };
0227 };
0228 };
0229 };
0230 };
0231
0232 &r_pio {
0233 /*
0234 * FIXME: We can't add that supply for now since it would
0235 * create a circular dependency between pinctrl, the regulator
0236 * and the RSB Bus.
0237 *
0238 * vcc-pl-supply = <®_aldo2>;
0239 */
0240 };
0241
0242 &r_rsb {
0243 status = "okay";
0244
0245 axp803: pmic@3a3 {
0246 compatible = "x-powers,axp803";
0247 reg = <0x3a3>;
0248 interrupt-parent = <&r_intc>;
0249 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0250 };
0251 };
0252
0253 #include "axp803.dtsi"
0254
0255 &ac_power_supply {
0256 status = "okay";
0257 };
0258
0259 &battery_power_supply {
0260 status = "okay";
0261 };
0262
0263 ®_aldo1 {
0264 regulator-name = "vcc-pe";
0265 };
0266
0267 ®_aldo2 {
0268 regulator-always-on;
0269 regulator-min-microvolt = <1800000>;
0270 regulator-max-microvolt = <3300000>;
0271 regulator-name = "vcc-pl";
0272 };
0273
0274 ®_aldo3 {
0275 regulator-always-on;
0276 regulator-min-microvolt = <2700000>;
0277 regulator-max-microvolt = <3300000>;
0278 regulator-name = "vcc-pll-avcc";
0279 };
0280
0281 ®_dc1sw {
0282 regulator-name = "vcc-lcd";
0283 };
0284
0285 ®_dcdc1 {
0286 regulator-always-on;
0287 regulator-min-microvolt = <3300000>;
0288 regulator-max-microvolt = <3300000>;
0289 regulator-name = "vcc-3v3";
0290 };
0291
0292 ®_dcdc2 {
0293 regulator-always-on;
0294 regulator-min-microvolt = <1000000>;
0295 regulator-max-microvolt = <1300000>;
0296 regulator-name = "vdd-cpux";
0297 };
0298
0299 /* DCDC3 is polyphased with DCDC2 */
0300
0301 ®_dcdc5 {
0302 regulator-always-on;
0303 regulator-min-microvolt = <1200000>;
0304 regulator-max-microvolt = <1200000>;
0305 regulator-name = "vcc-dram";
0306 };
0307
0308 ®_dcdc6 {
0309 regulator-always-on;
0310 regulator-min-microvolt = <1100000>;
0311 regulator-max-microvolt = <1100000>;
0312 regulator-name = "vdd-sys";
0313 };
0314
0315 ®_dldo1 {
0316 regulator-min-microvolt = <3300000>;
0317 regulator-max-microvolt = <3300000>;
0318 regulator-name = "vcc-hdmi";
0319 };
0320
0321 ®_dldo2 {
0322 regulator-min-microvolt = <2500000>;
0323 regulator-max-microvolt = <2500000>;
0324 regulator-name = "vcc-edp";
0325 };
0326
0327 ®_dldo4 {
0328 regulator-min-microvolt = <3300000>;
0329 regulator-max-microvolt = <3300000>;
0330 regulator-name = "vcc-wifi";
0331 };
0332
0333 ®_eldo1 {
0334 regulator-always-on;
0335 regulator-min-microvolt = <1800000>;
0336 regulator-max-microvolt = <1800000>;
0337 regulator-name = "cpvdd";
0338 };
0339
0340 ®_fldo1 {
0341 regulator-min-microvolt = <1200000>;
0342 regulator-max-microvolt = <1200000>;
0343 regulator-name = "vcc-1v2-hsic";
0344 };
0345
0346 ®_fldo2 {
0347 regulator-always-on;
0348 regulator-min-microvolt = <1100000>;
0349 regulator-max-microvolt = <1100000>;
0350 regulator-name = "vdd-cpus";
0351 };
0352
0353 ®_rtc_ldo {
0354 regulator-name = "vcc-rtc";
0355 };
0356
0357 &simplefb_lcd {
0358 panel-supply = <®_dc1sw>;
0359 dvdd25-supply = <®_dldo2>;
0360 dvdd12-supply = <®_fldo1>;
0361 };
0362
0363 &simplefb_hdmi {
0364 vcc-hdmi-supply = <®_dldo1>;
0365 };
0366
0367 &sound {
0368 status = "okay";
0369 simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
0370 simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
0371 "Microphone", "Internal Microphone Right",
0372 "Headphone", "Headphone Jack",
0373 "Speaker", "Internal Speaker";
0374 simple-audio-card,routing =
0375 "Left DAC", "DACL",
0376 "Right DAC", "DACR",
0377 "Speaker Amp INL", "LINEOUT",
0378 "Speaker Amp INR", "LINEOUT",
0379 "Internal Speaker", "Speaker Amp OUTL",
0380 "Internal Speaker", "Speaker Amp OUTR",
0381 "Headphone Jack", "HP",
0382 "ADCL", "Left ADC",
0383 "ADCR", "Right ADC",
0384 "Internal Microphone Left", "MBIAS",
0385 "MIC1", "Internal Microphone Left",
0386 "Internal Microphone Right", "HBIAS",
0387 "MIC2", "Internal Microphone Right";
0388 };
0389
0390 &tcon0 {
0391 pinctrl-names = "default";
0392 pinctrl-0 = <&lcd_rgb666_pins>;
0393
0394 status = "okay";
0395 };
0396
0397 &tcon0_out {
0398 tcon0_out_anx6345: endpoint {
0399 remote-endpoint = <&anx6345_in_tcon0>;
0400 };
0401 };
0402
0403 &uart0 {
0404 pinctrl-names = "default";
0405 pinctrl-0 = <&uart0_pb_pins>;
0406 status = "okay";
0407 };
0408
0409 &usb_otg {
0410 dr_mode = "host";
0411 };
0412
0413 &usbphy {
0414 usb0_vbus-supply = <®_vcc5v0>;
0415 usb1_vbus-supply = <®_vcc5v0>;
0416 status = "okay";
0417 };