xref: /netbsd-src/sys/arch/arm/dts/sun50i-a64-pinebook.dts (revision e7ac2a8b5bd66fa2e050809de09a075c36a7014d)
1/* $NetBSD: sun50i-a64-pinebook.dts,v 1.18 2020/01/03 15:50:13 skrll Exp $ */
2
3/*-
4 * Copyright (c) 2017-2019 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#include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts"
30#include "sun50i-a64.dtsi"
31
32#include <dt-bindings/gpio/gpio.h>
33#include <dt-bindings/input/linux-event-codes.h>
34#include <dt-bindings/interrupt-controller/irq.h>
35#include <dt-bindings/pwm/pwm.h>
36
37/ {
38	chosen {
39		framebuffer@0 {
40			allwinner,pipeline = "mixer0-lcd0";
41		};
42	};
43
44	gpio_keys {
45		lid_switch {
46			/*
47			 * This is listed as PL12 in 4.20.3 sources, but
48			 * we have used PH10 all along.
49			 */
50			gpios = <&pio 7 10 GPIO_ACTIVE_LOW>;	/* PH10 */
51		};
52	};
53
54	sound_spdif {
55		status = "disabled";
56	};
57
58	hdmi-connector {
59		compatible = "hdmi-connector";
60		type = "c";
61
62		port {
63			hdmi_con_in: endpoint {
64				remote-endpoint = <&hdmi_out_con>;
65			};
66		};
67	};
68};
69
70&cpu0 {
71	cpu-supply = <&reg_dcdc2>;
72	operating-points = <
73		/* kHz    uV */
74		1152000 1300000
75		1104000 1260000
76		1008000 1200000
77		816000  1080000
78		648000	1040000
79		408000	1000000
80		>;
81};
82
83&spdif_out {
84	status = "disabled";
85};
86
87&uart1 {
88	pinctrl-names = "default";
89	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
90	status = "okay";
91	bluetooth {
92		compatible = "realtek,rtl8723cs-bt";
93		reset-gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; /* PL4 */
94		device-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
95		host-wake-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
96		firmware-postfix = "pinebook";
97	};
98};
99
100&codec {
101	allwinner,pa-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;	/* PH7 */
102	status = "okay";
103};
104
105&de {
106	status = "okay";
107};
108
109&mixer0 {
110	status = "okay";
111};
112
113&tcon0 {
114	pinctrl-names = "default";
115	pinctrl-0 = <&lcd_rgb666_pins>;
116
117	status = "okay";
118};
119
120&tcon0_out {
121	tcon0_out_anx6345: endpoint@0 {
122		reg = <0>;
123		remote-endpoint = <&anx6345_in>;
124	};
125};
126
127&r_pio {
128	r_i2c_pins_a: i2c-a {
129		pins = "PL8", "PL9";
130		function = "s_i2c";
131	};
132};
133
134&r_i2c {
135	pinctrl-names = "default";
136	pinctrl-0 = <&r_i2c_pins_a>;
137	status = "okay";
138
139	anx6345: anx6345@38 {
140		compatible = "analogix,anx6345";
141		reg = <0x38>;
142		reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>;	/* PD24 */
143		panel-supply = <&reg_dc1sw>;
144		dvdd25-supply = <&reg_dldo2>;
145		dvdd12-supply = <&reg_fldo1>;
146
147		port {
148			anx6345_in: endpoint {
149				remote-endpoint = <&tcon0_out_anx6345>;
150			};
151		};
152	};
153};
154
155&reg_dldo1 {
156	regulator-min-microvolt = <3300000>;
157	regulator-max-microvolt = <3300000>;
158	regulator-name = "vcc-hdmi";
159};
160
161&hdmi {
162	hvcc-supply = <&reg_dldo1>;
163	status = "okay";
164};
165
166&hdmi_out {
167	hdmi_out_con: endpoint {
168		remote-endpoint = <&hdmi_con_in>;
169	};
170};
171
172&i2s2 {
173	status = "okay";
174};
175
176&sound_hdmi {
177	status = "okay";
178};
179