xref: /freebsd-src/sys/contrib/device-tree/src/arm/allwinner/sun8i-s3-pinecube.dts (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1f126890aSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR X11)
2f126890aSEmmanuel Vadot/*
3f126890aSEmmanuel Vadot * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
4f126890aSEmmanuel Vadot */
5f126890aSEmmanuel Vadot
6f126890aSEmmanuel Vadot/dts-v1/;
7f126890aSEmmanuel Vadot#include "sun8i-v3.dtsi"
8f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
9f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h>
10f126890aSEmmanuel Vadot
11f126890aSEmmanuel Vadot/ {
12f126890aSEmmanuel Vadot	model = "PineCube IP Camera";
13f126890aSEmmanuel Vadot	compatible = "pine64,pinecube", "sochip,s3", "allwinner,sun8i-v3";
14f126890aSEmmanuel Vadot
15f126890aSEmmanuel Vadot	aliases {
16f126890aSEmmanuel Vadot		serial0 = &uart2;
17f126890aSEmmanuel Vadot	};
18f126890aSEmmanuel Vadot
19f126890aSEmmanuel Vadot	chosen {
20f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
21f126890aSEmmanuel Vadot	};
22f126890aSEmmanuel Vadot
23f126890aSEmmanuel Vadot	leds {
24f126890aSEmmanuel Vadot		compatible = "gpio-leds";
25f126890aSEmmanuel Vadot
26f126890aSEmmanuel Vadot		led1 {
27f126890aSEmmanuel Vadot			label = "pine64:ir:led1";
28f126890aSEmmanuel Vadot			gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; /* PB10 */
29f126890aSEmmanuel Vadot		};
30f126890aSEmmanuel Vadot
31f126890aSEmmanuel Vadot		led2 {
32f126890aSEmmanuel Vadot			label = "pine64:ir:led2";
33f126890aSEmmanuel Vadot			gpios = <&pio 1 12 GPIO_ACTIVE_LOW>; /* PB12 */
34f126890aSEmmanuel Vadot		};
35f126890aSEmmanuel Vadot	};
36f126890aSEmmanuel Vadot
37f126890aSEmmanuel Vadot	reg_vcc5v0: vcc5v0 {
38f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
39f126890aSEmmanuel Vadot		regulator-name = "vcc5v0";
40f126890aSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
41f126890aSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
42f126890aSEmmanuel Vadot	};
43f126890aSEmmanuel Vadot
44f126890aSEmmanuel Vadot	reg_vcc_wifi: vcc-wifi {
45f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
46f126890aSEmmanuel Vadot		regulator-name = "vcc-wifi";
47f126890aSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
48f126890aSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
49f126890aSEmmanuel Vadot		gpio = <&pio 1 2 GPIO_ACTIVE_LOW>; /* PB2 WIFI-EN */
50f126890aSEmmanuel Vadot		vin-supply = <&reg_dcdc3>;
51f126890aSEmmanuel Vadot		startup-delay-us = <200000>;
52f126890aSEmmanuel Vadot	};
53f126890aSEmmanuel Vadot
54*7d0873ebSEmmanuel Vadot	wifi_pwrseq: pwrseq {
55f126890aSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
56f126890aSEmmanuel Vadot		reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 WIFI-RST */
57f126890aSEmmanuel Vadot		post-power-on-delay-ms = <200>;
58f126890aSEmmanuel Vadot	};
59f126890aSEmmanuel Vadot};
60f126890aSEmmanuel Vadot
61f126890aSEmmanuel Vadot&csi1 {
62f126890aSEmmanuel Vadot	pinctrl-names = "default";
63f126890aSEmmanuel Vadot	pinctrl-0 = <&csi1_8bit_pins>;
64f126890aSEmmanuel Vadot	status = "okay";
65f126890aSEmmanuel Vadot
66f126890aSEmmanuel Vadot	port {
67f126890aSEmmanuel Vadot		csi1_ep: endpoint {
68f126890aSEmmanuel Vadot			remote-endpoint = <&ov5640_ep>;
69f126890aSEmmanuel Vadot			bus-width = <8>;
70f126890aSEmmanuel Vadot			hsync-active = <1>; /* Active high */
71f126890aSEmmanuel Vadot			vsync-active = <0>; /* Active low */
72f126890aSEmmanuel Vadot			data-active = <1>;  /* Active high */
73f126890aSEmmanuel Vadot			pclk-sample = <1>;  /* Rising */
74f126890aSEmmanuel Vadot		};
75f126890aSEmmanuel Vadot	};
76f126890aSEmmanuel Vadot};
77f126890aSEmmanuel Vadot
78f126890aSEmmanuel Vadot&emac {
79f126890aSEmmanuel Vadot	phy-handle = <&int_mii_phy>;
80f126890aSEmmanuel Vadot	phy-mode = "mii";
81f126890aSEmmanuel Vadot	status = "okay";
82f126890aSEmmanuel Vadot};
83f126890aSEmmanuel Vadot
84f126890aSEmmanuel Vadot&i2c0 {
85f126890aSEmmanuel Vadot	status = "okay";
86f126890aSEmmanuel Vadot
87f126890aSEmmanuel Vadot	axp209: pmic@34 {
88f126890aSEmmanuel Vadot		reg = <0x34>;
89f126890aSEmmanuel Vadot		interrupt-parent = <&nmi_intc>;
90f126890aSEmmanuel Vadot		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
91f126890aSEmmanuel Vadot	};
92f126890aSEmmanuel Vadot};
93f126890aSEmmanuel Vadot
94f126890aSEmmanuel Vadot&i2c1 {
95f126890aSEmmanuel Vadot	pinctrl-names = "default";
96f126890aSEmmanuel Vadot	pinctrl-0 = <&i2c1_pe_pins>;
97f126890aSEmmanuel Vadot	status = "okay";
98f126890aSEmmanuel Vadot
99f126890aSEmmanuel Vadot	ov5640: camera@3c {
100f126890aSEmmanuel Vadot		compatible = "ovti,ov5640";
101f126890aSEmmanuel Vadot		reg = <0x3c>;
102f126890aSEmmanuel Vadot		pinctrl-names = "default";
103f126890aSEmmanuel Vadot		pinctrl-0 = <&csi1_mclk_pin>;
104f126890aSEmmanuel Vadot		clocks = <&ccu CLK_CSI1_MCLK>;
105f126890aSEmmanuel Vadot		clock-names = "xclk";
106f126890aSEmmanuel Vadot
107f126890aSEmmanuel Vadot		AVDD-supply = <&reg_ldo3>;
108f126890aSEmmanuel Vadot		DOVDD-supply = <&reg_ldo3>;
109f126890aSEmmanuel Vadot		DVDD-supply = <&reg_ldo4>;
110f126890aSEmmanuel Vadot		reset-gpios = <&pio 4 23 GPIO_ACTIVE_LOW>; /* PE23 */
111f126890aSEmmanuel Vadot		powerdown-gpios = <&pio 4 24 GPIO_ACTIVE_HIGH>; /* PE24 */
112f126890aSEmmanuel Vadot
113f126890aSEmmanuel Vadot		port {
114f126890aSEmmanuel Vadot			ov5640_ep: endpoint {
115f126890aSEmmanuel Vadot				remote-endpoint = <&csi1_ep>;
116f126890aSEmmanuel Vadot				bus-width = <8>;
117f126890aSEmmanuel Vadot				hsync-active = <1>; /* Active high */
118f126890aSEmmanuel Vadot				vsync-active = <0>; /* Active low */
119f126890aSEmmanuel Vadot				data-active = <1>;  /* Active high */
120f126890aSEmmanuel Vadot				pclk-sample = <1>;  /* Rising */
121f126890aSEmmanuel Vadot			};
122f126890aSEmmanuel Vadot		};
123f126890aSEmmanuel Vadot	};
124f126890aSEmmanuel Vadot};
125f126890aSEmmanuel Vadot
126f126890aSEmmanuel Vadot&lradc {
127f126890aSEmmanuel Vadot	vref-supply = <&reg_ldo2>;
128f126890aSEmmanuel Vadot	status = "okay";
129f126890aSEmmanuel Vadot
130f126890aSEmmanuel Vadot	button-200 {
131f126890aSEmmanuel Vadot		label = "Setup";
132f126890aSEmmanuel Vadot		linux,code = <KEY_SETUP>;
133f126890aSEmmanuel Vadot		channel = <0>;
134f126890aSEmmanuel Vadot		voltage = <190000>;
135f126890aSEmmanuel Vadot	};
136f126890aSEmmanuel Vadot};
137f126890aSEmmanuel Vadot
138f126890aSEmmanuel Vadot&mmc0 {
139f126890aSEmmanuel Vadot	vmmc-supply = <&reg_dcdc3>;
140f126890aSEmmanuel Vadot	bus-width = <4>;
141f126890aSEmmanuel Vadot	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
142f126890aSEmmanuel Vadot	status = "okay";
143f126890aSEmmanuel Vadot};
144f126890aSEmmanuel Vadot
145f126890aSEmmanuel Vadot&mmc1 {
146f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc_wifi>;
147f126890aSEmmanuel Vadot	vqmmc-supply = <&reg_dcdc3>;
148f126890aSEmmanuel Vadot	mmc-pwrseq = <&wifi_pwrseq>;
149f126890aSEmmanuel Vadot	bus-width = <4>;
150f126890aSEmmanuel Vadot	non-removable;
151f126890aSEmmanuel Vadot	status = "okay";
152f126890aSEmmanuel Vadot};
153f126890aSEmmanuel Vadot
154f126890aSEmmanuel Vadot&pio {
155f126890aSEmmanuel Vadot	vcc-pd-supply = <&reg_dcdc3>;
156f126890aSEmmanuel Vadot	vcc-pe-supply = <&reg_ldo3>;
157f126890aSEmmanuel Vadot};
158f126890aSEmmanuel Vadot
159f126890aSEmmanuel Vadot#include "axp209.dtsi"
160f126890aSEmmanuel Vadot
161f126890aSEmmanuel Vadot&ac_power_supply {
162f126890aSEmmanuel Vadot	status = "okay";
163f126890aSEmmanuel Vadot};
164f126890aSEmmanuel Vadot
165f126890aSEmmanuel Vadot&reg_dcdc2 {
166f126890aSEmmanuel Vadot	regulator-always-on;
167f126890aSEmmanuel Vadot	regulator-min-microvolt = <1250000>;
168f126890aSEmmanuel Vadot	regulator-max-microvolt = <1250000>;
169f126890aSEmmanuel Vadot	regulator-name = "vdd-sys-cpu-ephy";
170f126890aSEmmanuel Vadot};
171f126890aSEmmanuel Vadot
172f126890aSEmmanuel Vadot&reg_dcdc3 {
173f126890aSEmmanuel Vadot	regulator-always-on;
174f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
175f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
176f126890aSEmmanuel Vadot	regulator-name = "vcc-3v3";
177f126890aSEmmanuel Vadot};
178f126890aSEmmanuel Vadot
179f126890aSEmmanuel Vadot&reg_ldo1 {
180f126890aSEmmanuel Vadot	regulator-name = "vdd-rtc";
181f126890aSEmmanuel Vadot};
182f126890aSEmmanuel Vadot
183f126890aSEmmanuel Vadot&reg_ldo2 {
184f126890aSEmmanuel Vadot	regulator-always-on;
185f126890aSEmmanuel Vadot	regulator-min-microvolt = <3000000>;
186f126890aSEmmanuel Vadot	regulator-max-microvolt = <3000000>;
187f126890aSEmmanuel Vadot	regulator-name = "avcc";
188f126890aSEmmanuel Vadot};
189f126890aSEmmanuel Vadot
190f126890aSEmmanuel Vadot&reg_ldo3 {
191f126890aSEmmanuel Vadot	regulator-min-microvolt = <2800000>;
192f126890aSEmmanuel Vadot	regulator-max-microvolt = <2800000>;
193f126890aSEmmanuel Vadot	regulator-name = "avdd-dovdd-2v8-csi";
194f126890aSEmmanuel Vadot	regulator-soft-start;
195f126890aSEmmanuel Vadot	regulator-ramp-delay = <1600>;
196f126890aSEmmanuel Vadot};
197f126890aSEmmanuel Vadot
198f126890aSEmmanuel Vadot&reg_ldo4 {
199f126890aSEmmanuel Vadot	regulator-min-microvolt = <1800000>;
200f126890aSEmmanuel Vadot	regulator-max-microvolt = <1800000>;
201f126890aSEmmanuel Vadot	regulator-name = "dvdd-1v8-csi";
202f126890aSEmmanuel Vadot};
203f126890aSEmmanuel Vadot
204f126890aSEmmanuel Vadot&spi0 {
205f126890aSEmmanuel Vadot	status = "okay";
206f126890aSEmmanuel Vadot
207f126890aSEmmanuel Vadot	flash@0 {
208f126890aSEmmanuel Vadot		#address-cells = <1>;
209f126890aSEmmanuel Vadot		#size-cells = <1>;
210f126890aSEmmanuel Vadot		compatible = "winbond,w25q128", "jedec,spi-nor";
211f126890aSEmmanuel Vadot		reg = <0>;
212f126890aSEmmanuel Vadot		spi-max-frequency = <40000000>;
213f126890aSEmmanuel Vadot	};
214f126890aSEmmanuel Vadot};
215f126890aSEmmanuel Vadot
216f126890aSEmmanuel Vadot&uart2 {
217f126890aSEmmanuel Vadot	status = "okay";
218f126890aSEmmanuel Vadot};
219f126890aSEmmanuel Vadot
220f126890aSEmmanuel Vadot&usb_otg {
221f126890aSEmmanuel Vadot	dr_mode = "host";
222f126890aSEmmanuel Vadot	status = "okay";
223f126890aSEmmanuel Vadot};
224f126890aSEmmanuel Vadot
225f126890aSEmmanuel Vadot&usbphy {
226f126890aSEmmanuel Vadot	usb0_vbus-supply = <&reg_vcc5v0>;
227f126890aSEmmanuel Vadot	status = "okay";
228f126890aSEmmanuel Vadot};
229