0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
0004 *
0005 */
0006
0007 /dts-v1/;
0008
0009 #include "sun50i-a64.dtsi"
0010 #include "sun50i-a64-cpu-opp.dtsi"
0011
0012 #include <dt-bindings/gpio/gpio.h>
0013 #include <dt-bindings/input/input.h>
0014 #include <dt-bindings/pwm/pwm.h>
0015
0016 / {
0017 model = "PineTab, Development Sample";
0018 compatible = "pine64,pinetab", "allwinner,sun50i-a64";
0019 chassis-type = "tablet";
0020
0021 aliases {
0022 serial0 = &uart0;
0023 ethernet0 = &rtl8723cs;
0024 };
0025
0026 backlight: backlight {
0027 compatible = "pwm-backlight";
0028 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
0029 brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
0030 default-brightness-level = <15>;
0031 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
0032 power-supply = <&vdd_bl>;
0033 };
0034
0035 chosen {
0036 stdout-path = "serial0:115200n8";
0037 };
0038
0039 hdmi-connector {
0040 compatible = "hdmi-connector";
0041 type = "c";
0042
0043 port {
0044 hdmi_con_in: endpoint {
0045 remote-endpoint = <&hdmi_out_con>;
0046 };
0047 };
0048 };
0049
0050 i2c-csi {
0051 compatible = "i2c-gpio";
0052 sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */
0053 scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */
0054 i2c-gpio,delay-us = <5>;
0055 #address-cells = <1>;
0056 #size-cells = <0>;
0057
0058 /* Rear camera */
0059 ov5640: camera@3c {
0060 compatible = "ovti,ov5640";
0061 reg = <0x3c>;
0062 pinctrl-names = "default";
0063 pinctrl-0 = <&csi_mclk_pin>;
0064 clocks = <&ccu CLK_CSI_MCLK>;
0065 clock-names = "xclk";
0066
0067 AVDD-supply = <®_dldo3>;
0068 DOVDD-supply = <®_aldo1>;
0069 DVDD-supply = <®_eldo3>;
0070 reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */
0071 powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */
0072
0073 port {
0074 ov5640_ep: endpoint {
0075 remote-endpoint = <&csi_ep>;
0076 bus-width = <8>;
0077 hsync-active = <1>; /* Active high */
0078 vsync-active = <0>; /* Active low */
0079 data-active = <1>; /* Active high */
0080 pclk-sample = <1>; /* Rising */
0081 };
0082 };
0083 };
0084 };
0085
0086 speaker_amp: audio-amplifier {
0087 compatible = "simple-audio-amplifier";
0088 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
0089 sound-name-prefix = "Speaker Amp";
0090 };
0091
0092 vdd_bl: regulator {
0093 compatible = "regulator-fixed";
0094 regulator-name = "bl-3v3";
0095 regulator-min-microvolt = <3300000>;
0096 regulator-max-microvolt = <3300000>;
0097 gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
0098 enable-active-high;
0099 };
0100
0101 wifi_pwrseq: wifi_pwrseq {
0102 compatible = "mmc-pwrseq-simple";
0103 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
0104 post-power-on-delay-ms = <200>;
0105 };
0106 };
0107
0108 &codec {
0109 status = "okay";
0110 };
0111
0112 &codec_analog {
0113 cpvdd-supply = <®_eldo1>;
0114 status = "okay";
0115 };
0116
0117 &cpu0 {
0118 cpu-supply = <®_dcdc2>;
0119 };
0120
0121 &cpu1 {
0122 cpu-supply = <®_dcdc2>;
0123 };
0124
0125 &cpu2 {
0126 cpu-supply = <®_dcdc2>;
0127 };
0128
0129 &cpu3 {
0130 cpu-supply = <®_dcdc2>;
0131 };
0132
0133 &csi {
0134 status = "okay";
0135
0136 port {
0137 csi_ep: endpoint {
0138 remote-endpoint = <&ov5640_ep>;
0139 bus-width = <8>;
0140 hsync-active = <1>; /* Active high */
0141 vsync-active = <0>; /* Active low */
0142 data-active = <1>; /* Active high */
0143 pclk-sample = <1>; /* Rising */
0144 };
0145 };
0146 };
0147
0148 &dai {
0149 status = "okay";
0150 };
0151
0152 &de {
0153 status = "okay";
0154 };
0155
0156 &dphy {
0157 status = "okay";
0158 };
0159
0160 &dsi {
0161 vcc-dsi-supply = <®_dldo1>;
0162 status = "okay";
0163
0164 panel@0 {
0165 compatible = "feixin,k101-im2ba02";
0166 reg = <0>;
0167 avdd-supply = <®_dc1sw>;
0168 dvdd-supply = <®_dc1sw>;
0169 cvdd-supply = <®_ldo_io1>;
0170 reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
0171 backlight = <&backlight>;
0172 };
0173 };
0174
0175 &ehci0 {
0176 status = "okay";
0177 };
0178
0179 &ehci1 {
0180 status = "okay";
0181 };
0182
0183 &i2c0 {
0184 status = "okay";
0185
0186 touchscreen@5d {
0187 compatible = "goodix,gt9271";
0188 reg = <0x5d>;
0189 interrupt-parent = <&pio>;
0190 interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
0191 irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
0192 reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
0193 AVDD28-supply = <®_ldo_io1>;
0194 };
0195 };
0196
0197 &i2c0_pins {
0198 bias-pull-up;
0199 };
0200
0201 &i2c1 {
0202 status = "okay";
0203
0204 /* TODO: add Bochs BMA223 accelerometer here */
0205 };
0206
0207 &lradc {
0208 vref-supply = <®_aldo3>;
0209 status = "okay";
0210
0211 button-200 {
0212 label = "Volume Up";
0213 linux,code = <KEY_VOLUMEUP>;
0214 channel = <0>;
0215 voltage = <200000>;
0216 };
0217
0218 button-400 {
0219 label = "Volume Down";
0220 linux,code = <KEY_VOLUMEDOWN>;
0221 channel = <0>;
0222 voltage = <400000>;
0223 };
0224 };
0225
0226 &mixer1 {
0227 status = "okay";
0228 };
0229
0230 &mmc0 {
0231 pinctrl-names = "default";
0232 pinctrl-0 = <&mmc0_pins>;
0233 vmmc-supply = <®_dcdc1>;
0234 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
0235 disable-wp;
0236 bus-width = <4>;
0237 status = "okay";
0238 };
0239
0240 &mmc1 {
0241 pinctrl-names = "default";
0242 pinctrl-0 = <&mmc1_pins>;
0243 vmmc-supply = <®_dldo4>;
0244 vqmmc-supply = <®_eldo1>;
0245 mmc-pwrseq = <&wifi_pwrseq>;
0246 bus-width = <4>;
0247 non-removable;
0248 status = "okay";
0249
0250 rtl8723cs: wifi@1 {
0251 reg = <1>;
0252 };
0253 };
0254
0255 &mmc2 {
0256 pinctrl-names = "default";
0257 pinctrl-0 = <&mmc2_pins>;
0258 vmmc-supply = <®_dcdc1>;
0259 vqmmc-supply = <®_dcdc1>;
0260 bus-width = <8>;
0261 non-removable;
0262 cap-mmc-hw-reset;
0263 status = "okay";
0264 };
0265
0266 &ohci0 {
0267 status = "okay";
0268 };
0269
0270 &pwm {
0271 status = "okay";
0272 };
0273
0274 &r_rsb {
0275 status = "okay";
0276
0277 axp803: pmic@3a3 {
0278 compatible = "x-powers,axp803";
0279 reg = <0x3a3>;
0280 interrupt-parent = <&r_intc>;
0281 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0282 x-powers,drive-vbus-en;
0283 };
0284 };
0285
0286 #include "axp803.dtsi"
0287
0288 &ac_power_supply {
0289 status = "okay";
0290 };
0291
0292 &battery_power_supply {
0293 status = "okay";
0294 };
0295
0296 ®_aldo1 {
0297 regulator-min-microvolt = <2800000>;
0298 regulator-max-microvolt = <2800000>;
0299 regulator-name = "dovdd-csi";
0300 };
0301
0302 ®_aldo2 {
0303 regulator-always-on;
0304 regulator-min-microvolt = <1800000>;
0305 regulator-max-microvolt = <3300000>;
0306 regulator-name = "vcc-pl";
0307 };
0308
0309 ®_aldo3 {
0310 regulator-always-on;
0311 regulator-min-microvolt = <2700000>;
0312 regulator-max-microvolt = <3300000>;
0313 regulator-name = "vcc-pll-avcc";
0314 };
0315
0316 ®_dc1sw {
0317 regulator-name = "vcc-lcd";
0318 };
0319
0320 ®_dcdc1 {
0321 regulator-always-on;
0322 regulator-min-microvolt = <3300000>;
0323 regulator-max-microvolt = <3300000>;
0324 regulator-name = "vcc-3v3";
0325 };
0326
0327 ®_dcdc2 {
0328 regulator-always-on;
0329 regulator-min-microvolt = <1000000>;
0330 regulator-max-microvolt = <1300000>;
0331 regulator-name = "vdd-cpux";
0332 };
0333
0334 /* DCDC3 is polyphased with DCDC2 */
0335
0336 ®_dcdc5 {
0337 regulator-always-on;
0338 regulator-min-microvolt = <1200000>;
0339 regulator-max-microvolt = <1200000>;
0340 regulator-name = "vcc-dram";
0341 };
0342
0343 ®_dcdc6 {
0344 regulator-always-on;
0345 regulator-min-microvolt = <1100000>;
0346 regulator-max-microvolt = <1100000>;
0347 regulator-name = "vdd-sys";
0348 };
0349
0350 ®_dldo1 {
0351 regulator-always-on;
0352 regulator-min-microvolt = <3300000>;
0353 regulator-max-microvolt = <3300000>;
0354 regulator-name = "vcc-hdmi-dsi-sensor";
0355 };
0356
0357 ®_dldo3 {
0358 regulator-min-microvolt = <2800000>;
0359 regulator-max-microvolt = <2800000>;
0360 regulator-name = "avdd-csi";
0361 };
0362
0363 ®_dldo4 {
0364 regulator-min-microvolt = <3300000>;
0365 regulator-max-microvolt = <3300000>;
0366 regulator-name = "vcc-wifi";
0367 };
0368
0369 ®_drivevbus {
0370 regulator-name = "usb0-vbus";
0371 status = "okay";
0372 };
0373
0374 ®_eldo1 {
0375 regulator-always-on;
0376 regulator-min-microvolt = <1800000>;
0377 regulator-max-microvolt = <1800000>;
0378 regulator-name = "cpvdd";
0379 };
0380
0381 ®_eldo2 {
0382 regulator-min-microvolt = <1800000>;
0383 regulator-max-microvolt = <1800000>;
0384 regulator-name = "vcca-1v8";
0385 };
0386
0387 ®_eldo3 {
0388 regulator-min-microvolt = <1800000>;
0389 regulator-max-microvolt = <1800000>;
0390 regulator-name = "dvdd-1v8-csi";
0391 };
0392
0393 ®_fldo1 {
0394 regulator-min-microvolt = <1200000>;
0395 regulator-max-microvolt = <1200000>;
0396 regulator-name = "vcc-1v2-hsic";
0397 };
0398
0399 ®_fldo2 {
0400 regulator-always-on;
0401 regulator-min-microvolt = <1100000>;
0402 regulator-max-microvolt = <1100000>;
0403 regulator-name = "vdd-cpus";
0404 };
0405
0406 ®_ldo_io0 {
0407 regulator-min-microvolt = <3300000>;
0408 regulator-max-microvolt = <3300000>;
0409 regulator-name = "vcc-usb";
0410 status = "okay";
0411 };
0412
0413 ®_ldo_io1 {
0414 regulator-min-microvolt = <3300000>;
0415 regulator-max-microvolt = <3300000>;
0416 regulator-enable-ramp-delay = <3500000>;
0417 regulator-name = "vcc-touchscreen";
0418 status = "okay";
0419 };
0420
0421 ®_rtc_ldo {
0422 regulator-name = "vcc-rtc";
0423 };
0424
0425 &simplefb_hdmi {
0426 vcc-hdmi-supply = <®_dldo1>;
0427 };
0428
0429 &hdmi {
0430 hvcc-supply = <®_dldo1>;
0431 status = "okay";
0432 };
0433
0434 &hdmi_out {
0435 hdmi_out_con: endpoint {
0436 remote-endpoint = <&hdmi_con_in>;
0437 };
0438 };
0439
0440 &sound {
0441 status = "okay";
0442 simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
0443 simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
0444 "Microphone", "Internal Microphone Right",
0445 "Headphone", "Headphone Jack",
0446 "Speaker", "Internal Speaker";
0447 simple-audio-card,routing =
0448 "Left DAC", "DACL",
0449 "Right DAC", "DACR",
0450 "Speaker Amp INL", "LINEOUT",
0451 "Speaker Amp INR", "LINEOUT",
0452 "Internal Speaker", "Speaker Amp OUTL",
0453 "Internal Speaker", "Speaker Amp OUTR",
0454 "Headphone Jack", "HP",
0455 "ADCL", "Left ADC",
0456 "ADCR", "Right ADC",
0457 "Internal Microphone Left", "MBIAS",
0458 "MIC1", "Internal Microphone Left",
0459 "Internal Microphone Right", "HBIAS",
0460 "MIC2", "Internal Microphone Right";
0461 };
0462
0463 &uart0 {
0464 pinctrl-names = "default";
0465 pinctrl-0 = <&uart0_pb_pins>;
0466 status = "okay";
0467 };
0468
0469 &usb_otg {
0470 dr_mode = "otg";
0471 status = "okay";
0472 };
0473
0474 &usb_power_supply {
0475 status = "okay";
0476 };
0477
0478 &usbphy {
0479 usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
0480 usb0_vbus_power-supply = <&usb_power_supply>;
0481 usb0_vbus-supply = <®_drivevbus>;
0482 usb1_vbus-supply = <®_ldo_io0>;
0483 status = "okay";
0484 };