sun50i-a64-pinebook.dts revision 1.12
1/* $NetBSD: sun50i-a64-pinebook.dts,v 1.12 2018/07/09 10:07:42 jmcneill Exp $ */
2
3/*-
4 * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29/dts-v1/;
30
31#include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi"
32#include "sun50i-a64.dtsi"
33
34#include <dt-bindings/gpio/gpio.h>
35#include <dt-bindings/input/linux-event-codes.h>
36#include <dt-bindings/interrupt-controller/irq.h>
37#include <dt-bindings/pwm/pwm.h>
38
39/ {
40	model = "Pine64 Pinebook";
41	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
42
43	aliases {
44		serial0 = &uart0;
45	};
46
47	chosen {
48		stdout-path = "serial0:115200n8";
49
50		framebuffer@0 {
51			allwinner,pipeline = "mixer0-lcd0";
52		};
53	};
54
55	gpio_keys {
56		compatible = "gpio-keys";
57
58		lid_switch {
59			label = "Lid Switch";
60			gpios = <&pio 7 10 GPIO_ACTIVE_LOW>;	/* PH10 */
61			linux,input-type = <EV_SW>;
62			linux,code = <SW_LID>;
63			linux,can-disable;
64		};
65	};
66
67	backlight: backlight {
68		compatible = "pwm-backlight";
69		pwms = <&pwm 0 50000 0>;
70		brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
71		default-brightness-level = <3>;
72		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>;	/* PD23 */
73	};
74
75	reg_vcc3v3: vcc3v3 {
76		regulator-fixed;
77		regulator-name = "vcc3v3";
78		regulator-min-microvolt = <3300000>;
79		regulator-max-microvolt = <3300000>;
80	};
81
82	sound_spdif {
83		status = "disabled";
84	};
85};
86
87&cpu0 {
88	cpu-supply = <&reg_dcdc2>;
89	operating-points = <
90		/* kHz    uV */
91		1152000 1300000
92		1104000 1260000
93		1008000 1200000
94		816000  1080000
95		648000	1040000
96		408000	1000000
97		>;
98};
99
100&spdif_out {
101	status = "disabled";
102};
103
104&ehci0 {
105	status = "okay";
106};
107
108&ehci1 {
109	status = "okay";
110};
111
112&ohci0 {
113	status = "okay";
114};
115
116&ohci1 {
117	status = "okay";
118};
119
120&usb_otg {
121	dr_mode = "host";
122	status = "okay";
123};
124
125&usbphy {
126	status = "okay";
127};
128
129&mmc0 {
130	pinctrl-names = "default";
131	pinctrl-0 = <&mmc0_pins>;
132	vmmc-supply = <&reg_vcc3v3>;
133	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
134	disable-wp;
135	bus-width = <4>;
136	status = "okay";
137};
138
139&mmc1 {
140	pinctrl-names = "default";
141	pinctrl-0 = <&mmc1_pins>;
142	vmmc-supply = <&reg_dldo4>;
143	vqmmc-supply = <&reg_eldo1>;
144	bus-width = <4>;
145	non-removable;
146	status = "okay";
147
148	rtl8723cs: wifi@1 {
149		reg = <1>;
150	};
151};
152
153&mmc2 {
154	pinctrl-names = "default";
155	pinctrl-0 = <&mmc2_pins>;
156	vmmc-supply = <&reg_dcdc1>;
157	bus-width = <8>;
158	non-removable;
159	cap-mmc-hw-reset;
160	status = "okay";
161};
162
163&uart0 {
164	pinctrl-names = "default";
165	pinctrl-0 = <&uart0_pins_a>;
166	status = "okay";
167};
168
169&pwm {
170	pinctrl-names = "default";
171	pinctrl-0 = <&pwm0_pins>;
172	status = "okay";
173};
174
175&r_rsb {
176	status = "okay";
177
178	axp803: pmic@3a3 {
179		compatible = "x-powers,axp803";
180		reg = <0x3a3>;
181		interrupt-parent = <&r_intc>;
182		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
183	};
184};
185
186#include "axp803.dtsi"
187
188&codec {
189	allwinner,pa-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;	/* PH7 */
190	status = "okay";
191};
192
193&codec_analog {
194	status = "okay";
195};
196
197&dai {
198	status = "okay";
199};
200
201&sound {
202	status = "okay";
203};
204