0001 // SPDX-License-Identifier: (GPL-2.0+ OR X11)
0002 /*
0003 * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
0004 */
0005
0006 /dts-v1/;
0007 #include "sun8i-v3.dtsi"
0008 #include <dt-bindings/gpio/gpio.h>
0009 #include <dt-bindings/input/input.h>
0010
0011 / {
0012 model = "PineCube IP Camera";
0013 compatible = "pine64,pinecube", "sochip,s3", "allwinner,sun8i-v3";
0014
0015 aliases {
0016 serial0 = &uart2;
0017 };
0018
0019 chosen {
0020 stdout-path = "serial0:115200n8";
0021 };
0022
0023 leds {
0024 compatible = "gpio-leds";
0025
0026 led1 {
0027 label = "pine64:ir:led1";
0028 gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; /* PB10 */
0029 };
0030
0031 led2 {
0032 label = "pine64:ir:led2";
0033 gpios = <&pio 1 12 GPIO_ACTIVE_LOW>; /* PB12 */
0034 };
0035 };
0036
0037 reg_vcc5v0: vcc5v0 {
0038 compatible = "regulator-fixed";
0039 regulator-name = "vcc5v0";
0040 regulator-min-microvolt = <5000000>;
0041 regulator-max-microvolt = <5000000>;
0042 };
0043
0044 reg_vcc_wifi: vcc-wifi {
0045 compatible = "regulator-fixed";
0046 regulator-name = "vcc-wifi";
0047 regulator-min-microvolt = <3300000>;
0048 regulator-max-microvolt = <3300000>;
0049 gpio = <&pio 1 2 GPIO_ACTIVE_LOW>; /* PB2 WIFI-EN */
0050 vin-supply = <®_dcdc3>;
0051 startup-delay-us = <200000>;
0052 };
0053
0054 wifi_pwrseq: wifi_pwrseq {
0055 compatible = "mmc-pwrseq-simple";
0056 reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 WIFI-RST */
0057 post-power-on-delay-ms = <200>;
0058 };
0059 };
0060
0061 &csi1 {
0062 pinctrl-names = "default";
0063 pinctrl-0 = <&csi1_8bit_pins>;
0064 status = "okay";
0065
0066 port {
0067 csi1_ep: endpoint {
0068 remote-endpoint = <&ov5640_ep>;
0069 bus-width = <8>;
0070 hsync-active = <1>; /* Active high */
0071 vsync-active = <0>; /* Active low */
0072 data-active = <1>; /* Active high */
0073 pclk-sample = <1>; /* Rising */
0074 };
0075 };
0076 };
0077
0078 &emac {
0079 phy-handle = <&int_mii_phy>;
0080 phy-mode = "mii";
0081 status = "okay";
0082 };
0083
0084 &i2c0 {
0085 status = "okay";
0086
0087 axp209: pmic@34 {
0088 reg = <0x34>;
0089 interrupt-parent = <&nmi_intc>;
0090 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0091 };
0092 };
0093
0094 &i2c1 {
0095 pinctrl-names = "default";
0096 pinctrl-0 = <&i2c1_pe_pins>;
0097 status = "okay";
0098
0099 ov5640: camera@3c {
0100 compatible = "ovti,ov5640";
0101 reg = <0x3c>;
0102 pinctrl-names = "default";
0103 pinctrl-0 = <&csi1_mclk_pin>;
0104 clocks = <&ccu CLK_CSI1_MCLK>;
0105 clock-names = "xclk";
0106
0107 AVDD-supply = <®_ldo3>;
0108 DOVDD-supply = <®_ldo3>;
0109 DVDD-supply = <®_ldo4>;
0110 reset-gpios = <&pio 4 23 GPIO_ACTIVE_LOW>; /* PE23 */
0111 powerdown-gpios = <&pio 4 24 GPIO_ACTIVE_HIGH>; /* PE24 */
0112
0113 port {
0114 ov5640_ep: endpoint {
0115 remote-endpoint = <&csi1_ep>;
0116 bus-width = <8>;
0117 hsync-active = <1>; /* Active high */
0118 vsync-active = <0>; /* Active low */
0119 data-active = <1>; /* Active high */
0120 pclk-sample = <1>; /* Rising */
0121 };
0122 };
0123 };
0124 };
0125
0126 &lradc {
0127 vref-supply = <®_ldo2>;
0128 status = "okay";
0129
0130 button-200 {
0131 label = "Setup";
0132 linux,code = <KEY_SETUP>;
0133 channel = <0>;
0134 voltage = <190000>;
0135 };
0136 };
0137
0138 &mmc0 {
0139 vmmc-supply = <®_dcdc3>;
0140 bus-width = <4>;
0141 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
0142 status = "okay";
0143 };
0144
0145 &mmc1 {
0146 vmmc-supply = <®_vcc_wifi>;
0147 vqmmc-supply = <®_dcdc3>;
0148 mmc-pwrseq = <&wifi_pwrseq>;
0149 bus-width = <4>;
0150 non-removable;
0151 status = "okay";
0152 };
0153
0154 &pio {
0155 vcc-pd-supply = <®_dcdc3>;
0156 vcc-pe-supply = <®_ldo3>;
0157 };
0158
0159 #include "axp209.dtsi"
0160
0161 &ac_power_supply {
0162 status = "okay";
0163 };
0164
0165 ®_dcdc2 {
0166 regulator-always-on;
0167 regulator-min-microvolt = <1250000>;
0168 regulator-max-microvolt = <1250000>;
0169 regulator-name = "vdd-sys-cpu-ephy";
0170 };
0171
0172 ®_dcdc3 {
0173 regulator-always-on;
0174 regulator-min-microvolt = <3300000>;
0175 regulator-max-microvolt = <3300000>;
0176 regulator-name = "vcc-3v3";
0177 };
0178
0179 ®_ldo1 {
0180 regulator-name = "vdd-rtc";
0181 };
0182
0183 ®_ldo2 {
0184 regulator-always-on;
0185 regulator-min-microvolt = <3000000>;
0186 regulator-max-microvolt = <3000000>;
0187 regulator-name = "avcc";
0188 };
0189
0190 ®_ldo3 {
0191 regulator-min-microvolt = <2800000>;
0192 regulator-max-microvolt = <2800000>;
0193 regulator-name = "avdd-dovdd-2v8-csi";
0194 regulator-soft-start;
0195 regulator-ramp-delay = <1600>;
0196 };
0197
0198 ®_ldo4 {
0199 regulator-min-microvolt = <1800000>;
0200 regulator-max-microvolt = <1800000>;
0201 regulator-name = "dvdd-1v8-csi";
0202 };
0203
0204 &spi0 {
0205 status = "okay";
0206
0207 flash@0 {
0208 #address-cells = <1>;
0209 #size-cells = <1>;
0210 compatible = "winbond,w25q128", "jedec,spi-nor";
0211 reg = <0>;
0212 spi-max-frequency = <40000000>;
0213 };
0214 };
0215
0216 &uart2 {
0217 status = "okay";
0218 };
0219
0220 &usb_otg {
0221 dr_mode = "host";
0222 status = "okay";
0223 };
0224
0225 &usbphy {
0226 usb0_vbus-supply = <®_vcc5v0>;
0227 status = "okay";
0228 };