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