1f64f2e0fSJagan Teki// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2cabbaed7SClément Péron// Copyright (C) 2018 Amarula Solutions B.V. 3cabbaed7SClément Péron// Author: Jagan Teki <jagan@amarulasolutions.com> 4f64f2e0fSJagan Teki 5f64f2e0fSJagan Teki/dts-v1/; 6f64f2e0fSJagan Teki 7f64f2e0fSJagan Teki#include "sun50i-a64.dtsi" 8ac904843SVasily Khoruzhick#include "sun50i-a64-cpu-opp.dtsi" 9f64f2e0fSJagan Teki 10f64f2e0fSJagan Teki#include <dt-bindings/gpio/gpio.h> 11f64f2e0fSJagan Teki 12f64f2e0fSJagan Teki/ { 13f64f2e0fSJagan Teki model = "Amarula A64-Relic"; 14f64f2e0fSJagan Teki compatible = "amarula,a64-relic", "allwinner,sun50i-a64"; 15f64f2e0fSJagan Teki 16f64f2e0fSJagan Teki aliases { 17f64f2e0fSJagan Teki serial0 = &uart0; 18f64f2e0fSJagan Teki }; 19f64f2e0fSJagan Teki 20f64f2e0fSJagan Teki chosen { 21f64f2e0fSJagan Teki stdout-path = "serial0:115200n8"; 22f64f2e0fSJagan Teki }; 2333c3d4ebSJagan Teki 247cc399f2SJagan Teki i2c { 257cc399f2SJagan Teki compatible = "i2c-gpio"; 267cc399f2SJagan Teki sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; 277cc399f2SJagan Teki scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; 287cc399f2SJagan Teki i2c-gpio,delay-us = <5>; 297cc399f2SJagan Teki #address-cells = <1>; 307cc399f2SJagan Teki #size-cells = <0>; 317cc399f2SJagan Teki 327cc399f2SJagan Teki ov5640: camera@3c { 337cc399f2SJagan Teki compatible = "ovti,ov5640"; 347cc399f2SJagan Teki reg = <0x3c>; 357cc399f2SJagan Teki pinctrl-names = "default"; 367cc399f2SJagan Teki pinctrl-0 = <&csi_mclk_pin>; 377cc399f2SJagan Teki clocks = <&ccu CLK_CSI_MCLK>; 387cc399f2SJagan Teki clock-names = "xclk"; 397cc399f2SJagan Teki 407cc399f2SJagan Teki AVDD-supply = <®_aldo1>; 417cc399f2SJagan Teki DOVDD-supply = <®_dldo3>; 427cc399f2SJagan Teki DVDD-supply = <®_eldo3>; 437cc399f2SJagan Teki reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* CSI-RST-R: PE14 */ 447cc399f2SJagan Teki powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* CSI-STBY-R: PE15 */ 457cc399f2SJagan Teki 467cc399f2SJagan Teki port { 477cc399f2SJagan Teki ov5640_ep: endpoint { 487cc399f2SJagan Teki remote-endpoint = <&csi_ep>; 497cc399f2SJagan Teki bus-width = <8>; 507cc399f2SJagan Teki hsync-active = <1>; /* Active high */ 517cc399f2SJagan Teki vsync-active = <0>; /* Active low */ 527cc399f2SJagan Teki data-active = <1>; /* Active high */ 537cc399f2SJagan Teki pclk-sample = <1>; /* Rising */ 547cc399f2SJagan Teki }; 557cc399f2SJagan Teki }; 567cc399f2SJagan Teki }; 577cc399f2SJagan Teki }; 587cc399f2SJagan Teki 5933c3d4ebSJagan Teki wifi_pwrseq: wifi-pwrseq { 6033c3d4ebSJagan Teki compatible = "mmc-pwrseq-simple"; 61*1b9dac68SSamuel Holland clocks = <&rtc CLK_OSC32K_FANOUT>; 6233c3d4ebSJagan Teki clock-names = "ext_clock"; 6333c3d4ebSJagan Teki reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* WL-PMU-EN: PL2 */ 6433c3d4ebSJagan Teki }; 65f64f2e0fSJagan Teki}; 66f64f2e0fSJagan Teki 67ac904843SVasily Khoruzhick&cpu0 { 68ac904843SVasily Khoruzhick cpu-supply = <®_dcdc2>; 69ac904843SVasily Khoruzhick}; 70ac904843SVasily Khoruzhick 71ac904843SVasily Khoruzhick&cpu1 { 72ac904843SVasily Khoruzhick cpu-supply = <®_dcdc2>; 73ac904843SVasily Khoruzhick}; 74ac904843SVasily Khoruzhick 75ac904843SVasily Khoruzhick&cpu2 { 76ac904843SVasily Khoruzhick cpu-supply = <®_dcdc2>; 77ac904843SVasily Khoruzhick}; 78ac904843SVasily Khoruzhick 79ac904843SVasily Khoruzhick&cpu3 { 80ac904843SVasily Khoruzhick cpu-supply = <®_dcdc2>; 81ac904843SVasily Khoruzhick}; 82ac904843SVasily Khoruzhick 837cc399f2SJagan Teki&csi { 847cc399f2SJagan Teki status = "okay"; 857cc399f2SJagan Teki 867cc399f2SJagan Teki port { 877cc399f2SJagan Teki csi_ep: endpoint { 887cc399f2SJagan Teki remote-endpoint = <&ov5640_ep>; 897cc399f2SJagan Teki bus-width = <8>; 907cc399f2SJagan Teki hsync-active = <1>; /* Active high */ 917cc399f2SJagan Teki vsync-active = <0>; /* Active low */ 927cc399f2SJagan Teki data-active = <1>; /* Active high */ 937cc399f2SJagan Teki pclk-sample = <1>; /* Rising */ 947cc399f2SJagan Teki }; 957cc399f2SJagan Teki }; 967cc399f2SJagan Teki}; 977cc399f2SJagan Teki 98f64f2e0fSJagan Teki&ehci0 { 99f64f2e0fSJagan Teki status = "okay"; 100f64f2e0fSJagan Teki}; 101f64f2e0fSJagan Teki 102ea738c32SJagan Teki&i2c0 { 103ea738c32SJagan Teki status = "okay"; 104ea738c32SJagan Teki 105ea738c32SJagan Teki sensor@48 { 106ea738c32SJagan Teki compatible = "st,stlm75"; 107ea738c32SJagan Teki reg = <0x48>; 108ea738c32SJagan Teki }; 109ea738c32SJagan Teki}; 110ea738c32SJagan Teki 111ea738c32SJagan Teki&i2c0_pins { 112ea738c32SJagan Teki bias-pull-up; 113ea738c32SJagan Teki}; 114ea738c32SJagan Teki 1155aa45a24SJagan Teki&i2c1 { 1165aa45a24SJagan Teki status = "okay"; 1175aa45a24SJagan Teki 1185aa45a24SJagan Teki touchscreen@5d { 1195aa45a24SJagan Teki compatible = "goodix,gt5663"; 1205aa45a24SJagan Teki reg = <0x5d>; 1215aa45a24SJagan Teki AVDD28-supply = <®_ldo_io0>; /* VCC-CTP: GPIO0-LDO */ 1225aa45a24SJagan Teki interrupt-parent = <&pio>; 1235aa45a24SJagan Teki interrupts = <7 4 IRQ_TYPE_EDGE_FALLING>; 1245aa45a24SJagan Teki irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* CTP-INT: PH4 */ 1255aa45a24SJagan Teki reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* CTP-RST: PH8 */ 1265aa45a24SJagan Teki touchscreen-inverted-x; 1275aa45a24SJagan Teki touchscreen-inverted-y; 1285aa45a24SJagan Teki }; 1295aa45a24SJagan Teki}; 1305aa45a24SJagan Teki 13133c3d4ebSJagan Teki&mmc1 { 13233c3d4ebSJagan Teki pinctrl-names = "default"; 13333c3d4ebSJagan Teki pinctrl-0 = <&mmc1_pins>; 13433c3d4ebSJagan Teki vmmc-supply = <®_dcdc1>; 13533c3d4ebSJagan Teki /* 13633c3d4ebSJagan Teki * Schematic shows both dldo4 and eldo1 connected for vcc-io-wifi, but 13733c3d4ebSJagan Teki * dldo4 connection shows DNP(Do Not Populate) and eldo1 connected with 13833c3d4ebSJagan Teki * 0Ohm register to vcc-io-wifi so eldo1 is used. 13933c3d4ebSJagan Teki */ 14033c3d4ebSJagan Teki vqmmc-supply = <®_eldo1>; 14133c3d4ebSJagan Teki mmc-pwrseq = <&wifi_pwrseq>; 14233c3d4ebSJagan Teki bus-width = <4>; 14333c3d4ebSJagan Teki non-removable; 14433c3d4ebSJagan Teki status = "okay"; 14533c3d4ebSJagan Teki 14633c3d4ebSJagan Teki brcmf: wifi@1 { 14733c3d4ebSJagan Teki reg = <1>; 14833c3d4ebSJagan Teki compatible = "brcm,bcm4329-fmac"; 14933c3d4ebSJagan Teki interrupt-parent = <&r_pio>; 15033c3d4ebSJagan Teki interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* WL-WAKE-AP: PL3 */ 15133c3d4ebSJagan Teki interrupt-names = "host-wake"; 15233c3d4ebSJagan Teki }; 15333c3d4ebSJagan Teki}; 15433c3d4ebSJagan Teki 155f64f2e0fSJagan Teki&mmc2 { 156f64f2e0fSJagan Teki pinctrl-names = "default"; 157f64f2e0fSJagan Teki pinctrl-0 = <&mmc2_pins>; 158f64f2e0fSJagan Teki vmmc-supply = <®_dcdc1>; 159f64f2e0fSJagan Teki bus-width = <8>; 160f64f2e0fSJagan Teki non-removable; 161f64f2e0fSJagan Teki cap-mmc-hw-reset; 162f64f2e0fSJagan Teki status = "okay"; 163f64f2e0fSJagan Teki}; 164f64f2e0fSJagan Teki 165f64f2e0fSJagan Teki&ohci0 { 166f64f2e0fSJagan Teki status = "okay"; 167f64f2e0fSJagan Teki}; 168f64f2e0fSJagan Teki 169f64f2e0fSJagan Teki&r_rsb { 170f64f2e0fSJagan Teki status = "okay"; 171f64f2e0fSJagan Teki 172f64f2e0fSJagan Teki axp803: pmic@3a3 { 173f64f2e0fSJagan Teki compatible = "x-powers,axp803"; 174f64f2e0fSJagan Teki reg = <0x3a3>; 175f64f2e0fSJagan Teki interrupt-parent = <&r_intc>; 17673088dfeSSamuel Holland interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>; 177f64f2e0fSJagan Teki x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */ 178f64f2e0fSJagan Teki }; 179f64f2e0fSJagan Teki}; 180f64f2e0fSJagan Teki 181f64f2e0fSJagan Teki#include "axp803.dtsi" 182f64f2e0fSJagan Teki 183f64f2e0fSJagan Teki®_aldo1 { 184f64f2e0fSJagan Teki regulator-always-on; 185f64f2e0fSJagan Teki regulator-min-microvolt = <2800000>; 186f64f2e0fSJagan Teki regulator-max-microvolt = <2800000>; 187f64f2e0fSJagan Teki regulator-name = "avdd-csi"; 188f64f2e0fSJagan Teki}; 189f64f2e0fSJagan Teki 190f64f2e0fSJagan Teki®_aldo2 { 191f64f2e0fSJagan Teki regulator-always-on; 192f64f2e0fSJagan Teki regulator-min-microvolt = <1800000>; 193f64f2e0fSJagan Teki regulator-max-microvolt = <3300000>; 194f64f2e0fSJagan Teki regulator-name = "vcc-pl"; 195f64f2e0fSJagan Teki}; 196f64f2e0fSJagan Teki 197f64f2e0fSJagan Teki®_aldo3 { 198f64f2e0fSJagan Teki regulator-always-on; 199f64f2e0fSJagan Teki regulator-min-microvolt = <3000000>; 200f64f2e0fSJagan Teki regulator-max-microvolt = <3000000>; 201f64f2e0fSJagan Teki regulator-name = "vcc-pll-avcc"; 202f64f2e0fSJagan Teki}; 203f64f2e0fSJagan Teki 204f64f2e0fSJagan Teki®_dcdc1 { 205f64f2e0fSJagan Teki regulator-always-on; 206f64f2e0fSJagan Teki regulator-min-microvolt = <3300000>; 207f64f2e0fSJagan Teki regulator-max-microvolt = <3300000>; 208f64f2e0fSJagan Teki regulator-name = "vcc-3v3"; 209f64f2e0fSJagan Teki}; 210f64f2e0fSJagan Teki 211f64f2e0fSJagan Teki®_dcdc2 { 212f64f2e0fSJagan Teki regulator-always-on; 213f64f2e0fSJagan Teki regulator-min-microvolt = <1040000>; 214f64f2e0fSJagan Teki regulator-max-microvolt = <1300000>; 215f64f2e0fSJagan Teki regulator-name = "vdd-cpux"; 216f64f2e0fSJagan Teki}; 217f64f2e0fSJagan Teki 218f64f2e0fSJagan Teki/* DCDC3 is polyphased with DCDC2 */ 219f64f2e0fSJagan Teki 220f64f2e0fSJagan Teki®_dcdc5 { 221f64f2e0fSJagan Teki regulator-always-on; 222f64f2e0fSJagan Teki regulator-min-microvolt = <1500000>; 223f64f2e0fSJagan Teki regulator-max-microvolt = <1500000>; 224f64f2e0fSJagan Teki regulator-name = "vcc-dram"; 225f64f2e0fSJagan Teki}; 226f64f2e0fSJagan Teki 227f64f2e0fSJagan Teki®_dcdc6 { 228f64f2e0fSJagan Teki regulator-always-on; 229f64f2e0fSJagan Teki regulator-min-microvolt = <1100000>; 230f64f2e0fSJagan Teki regulator-max-microvolt = <1100000>; 231f64f2e0fSJagan Teki regulator-name = "vdd-sys"; 232f64f2e0fSJagan Teki}; 233f64f2e0fSJagan Teki 234f64f2e0fSJagan Teki®_dldo1 { 235f64f2e0fSJagan Teki regulator-min-microvolt = <3300000>; 236f64f2e0fSJagan Teki regulator-max-microvolt = <3300000>; 237f64f2e0fSJagan Teki regulator-name = "vcc-hdmi-dsi-sensor"; 238f64f2e0fSJagan Teki}; 239f64f2e0fSJagan Teki 240f64f2e0fSJagan Teki®_dldo2 { 241f64f2e0fSJagan Teki regulator-min-microvolt = <3300000>; 242f64f2e0fSJagan Teki regulator-max-microvolt = <3300000>; 243f64f2e0fSJagan Teki regulator-name = "vcc-mipi"; 244f64f2e0fSJagan Teki}; 245f64f2e0fSJagan Teki 246f64f2e0fSJagan Teki®_dldo3 { 247f64f2e0fSJagan Teki regulator-min-microvolt = <2800000>; 248f64f2e0fSJagan Teki regulator-max-microvolt = <2800000>; 249f64f2e0fSJagan Teki regulator-name = "dovdd-csi"; 250f64f2e0fSJagan Teki}; 251f64f2e0fSJagan Teki 252f64f2e0fSJagan Teki®_dldo4 { 253f64f2e0fSJagan Teki regulator-min-microvolt = <3300000>; 254f64f2e0fSJagan Teki regulator-max-microvolt = <3300000>; 255f64f2e0fSJagan Teki regulator-name = "vcc-wifi-io"; 256f64f2e0fSJagan Teki}; 257f64f2e0fSJagan Teki 258f64f2e0fSJagan Teki®_drivevbus { 259f64f2e0fSJagan Teki regulator-name = "usb0-vbus"; 260f64f2e0fSJagan Teki status = "okay"; 261f64f2e0fSJagan Teki}; 262f64f2e0fSJagan Teki 263f64f2e0fSJagan Teki®_eldo1 { 264f64f2e0fSJagan Teki regulator-always-on; 265f64f2e0fSJagan Teki regulator-min-microvolt = <1800000>; 266f64f2e0fSJagan Teki regulator-max-microvolt = <1800000>; 267f64f2e0fSJagan Teki regulator-name = "cpvdd"; 268f64f2e0fSJagan Teki}; 269f64f2e0fSJagan Teki 270f64f2e0fSJagan Teki®_eldo3 { 271f64f2e0fSJagan Teki regulator-min-microvolt = <1800000>; 272f64f2e0fSJagan Teki regulator-max-microvolt = <1800000>; 273f64f2e0fSJagan Teki regulator-name = "dvdd-csi"; 274f64f2e0fSJagan Teki}; 275f64f2e0fSJagan Teki 276f64f2e0fSJagan Teki®_fldo1 { 277f64f2e0fSJagan Teki regulator-min-microvolt = <1200000>; 278f64f2e0fSJagan Teki regulator-max-microvolt = <1200000>; 279f64f2e0fSJagan Teki regulator-name = "vcc-1v2-hsic"; 280f64f2e0fSJagan Teki}; 281f64f2e0fSJagan Teki 282f64f2e0fSJagan Teki/* 283f64f2e0fSJagan Teki * The A64 chip cannot work without this regulator off, although 284f64f2e0fSJagan Teki * it seems to be only driving the AR100 core. 285f64f2e0fSJagan Teki * Maybe we don't still know well about CPUs domain. 286f64f2e0fSJagan Teki */ 287f64f2e0fSJagan Teki®_fldo2 { 288f64f2e0fSJagan Teki regulator-always-on; 289f64f2e0fSJagan Teki regulator-min-microvolt = <1100000>; 290f64f2e0fSJagan Teki regulator-max-microvolt = <1100000>; 291f64f2e0fSJagan Teki regulator-name = "vdd-cpus"; 292f64f2e0fSJagan Teki}; 293f64f2e0fSJagan Teki 2945aa45a24SJagan Teki®_ldo_io0 { 2955aa45a24SJagan Teki regulator-min-microvolt = <2800000>; 2965aa45a24SJagan Teki regulator-max-microvolt = <2800000>; 2975aa45a24SJagan Teki regulator-name = "vcc-ctp"; 2985aa45a24SJagan Teki status = "okay"; 2995aa45a24SJagan Teki}; 3005aa45a24SJagan Teki 301f64f2e0fSJagan Teki®_rtc_ldo { 302f64f2e0fSJagan Teki regulator-name = "vcc-rtc"; 303f64f2e0fSJagan Teki}; 304f64f2e0fSJagan Teki 305f64f2e0fSJagan Teki&uart0 { 306f64f2e0fSJagan Teki pinctrl-names = "default"; 307d91ebb95SChen-Yu Tsai pinctrl-0 = <&uart0_pb_pins>; 308f64f2e0fSJagan Teki status = "okay"; 309f64f2e0fSJagan Teki}; 310f64f2e0fSJagan Teki 311f64f2e0fSJagan Teki&usb_otg { 312f64f2e0fSJagan Teki dr_mode = "otg"; 313f64f2e0fSJagan Teki status = "okay"; 314f64f2e0fSJagan Teki}; 315f64f2e0fSJagan Teki 316f64f2e0fSJagan Teki&usbphy { 317f64f2e0fSJagan Teki usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ 318f64f2e0fSJagan Teki usb0_vbus-supply = <®_drivevbus>; 319f64f2e0fSJagan Teki status = "okay"; 320f64f2e0fSJagan Teki}; 321