forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
....@@ -1,48 +1,10 @@
1
-/*
2
- * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
3
- *
4
- * This file is dual-licensed: you can use it either under the terms
5
- * of the GPL or the X11 license, at your option. Note that this dual
6
- * licensing only applies to this file, and not this project as a
7
- * whole.
8
- *
9
- * a) This library is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License as
11
- * published by the Free Software Foundation; either version 2 of the
12
- * License, or (at your option) any later version.
13
- *
14
- * This library is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * Or, alternatively,
20
- *
21
- * b) Permission is hereby granted, free of charge, to any person
22
- * obtaining a copy of this software and associated documentation
23
- * files (the "Software"), to deal in the Software without
24
- * restriction, including without limitation the rights to use,
25
- * copy, modify, merge, publish, distribute, sublicense, and/or
26
- * sell copies of the Software, and to permit persons to whom the
27
- * Software is furnished to do so, subject to the following
28
- * conditions:
29
- *
30
- * The above copyright notice and this permission notice shall be
31
- * included in all copies or substantial portions of the Software.
32
- *
33
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40
- * OTHER DEALINGS IN THE SOFTWARE.
41
- */
1
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
+// Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
423
434 /dts-v1/;
445
456 #include "sun50i-a64.dtsi"
7
+#include "sun50i-a64-cpu-opp.dtsi"
468
479 #include <dt-bindings/gpio/gpio.h>
4810
....@@ -51,6 +13,7 @@
5113 compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64";
5214
5315 aliases {
16
+ ethernet0 = &emac;
5417 serial0 = &uart0;
5518 };
5619
....@@ -58,9 +21,96 @@
5821 stdout-path = "serial0:115200n8";
5922 };
6023
24
+ hdmi-connector {
25
+ compatible = "hdmi-connector";
26
+ type = "a";
27
+
28
+ port {
29
+ hdmi_con_in: endpoint {
30
+ remote-endpoint = <&hdmi_out_con>;
31
+ };
32
+ };
33
+ };
34
+
35
+ leds {
36
+ compatible = "gpio-leds";
37
+
38
+ led-0 {
39
+ label = "a64-olinuxino:red:user";
40
+ gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
41
+ };
42
+ };
43
+
44
+ reg_usb1_vbus: usb1-vbus {
45
+ compatible = "regulator-fixed";
46
+ regulator-name = "usb1-vbus";
47
+ regulator-min-microvolt = <5000000>;
48
+ regulator-max-microvolt = <5000000>;
49
+ regulator-boot-on;
50
+ enable-active-high;
51
+ gpio = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 */
52
+ status = "okay";
53
+ };
54
+
6155 wifi_pwrseq: wifi_pwrseq {
6256 compatible = "mmc-pwrseq-simple";
6357 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
58
+ };
59
+};
60
+
61
+&cpu0 {
62
+ cpu-supply = <&reg_dcdc2>;
63
+};
64
+
65
+&cpu1 {
66
+ cpu-supply = <&reg_dcdc2>;
67
+};
68
+
69
+&cpu2 {
70
+ cpu-supply = <&reg_dcdc2>;
71
+};
72
+
73
+&cpu3 {
74
+ cpu-supply = <&reg_dcdc2>;
75
+};
76
+
77
+&de {
78
+ status = "okay";
79
+};
80
+
81
+&ehci0 {
82
+ status = "okay";
83
+};
84
+
85
+&ehci1 {
86
+ status = "okay";
87
+};
88
+
89
+&emac {
90
+ pinctrl-names = "default";
91
+ pinctrl-0 = <&rgmii_pins>;
92
+ phy-mode = "rgmii";
93
+ phy-handle = <&ext_rgmii_phy>;
94
+ phy-supply = <&reg_dcdc1>;
95
+ allwinner,tx-delay-ps = <600>;
96
+ status = "okay";
97
+};
98
+
99
+&hdmi {
100
+ hvcc-supply = <&reg_dldo1>;
101
+ status = "okay";
102
+};
103
+
104
+&hdmi_out {
105
+ hdmi_out_con: endpoint {
106
+ remote-endpoint = <&hdmi_con_in>;
107
+ };
108
+};
109
+
110
+&mdio {
111
+ ext_rgmii_phy: ethernet-phy@1 {
112
+ compatible = "ethernet-phy-ieee802.3-c22";
113
+ reg = <1>;
64114 };
65115 };
66116
....@@ -92,6 +142,42 @@
92142 };
93143 };
94144
145
+&ohci0 {
146
+ status = "okay";
147
+};
148
+
149
+&ohci1 {
150
+ status = "okay";
151
+};
152
+
153
+&pio {
154
+ vcc-pc-supply = <&reg_dcdc1>;
155
+ vcc-pd-supply = <&reg_dcdc1>;
156
+ vcc-pe-supply = <&reg_aldo1>;
157
+ vcc-pg-supply = <&reg_dldo4>;
158
+};
159
+
160
+&r_pio {
161
+ /*
162
+ * FIXME: We can't add that supply for now since it would
163
+ * create a circular dependency between pinctrl, the regulator
164
+ * and the RSB Bus.
165
+ *
166
+ * vcc-pl-supply = <&reg_aldo2>;
167
+ */
168
+};
169
+
170
+&pio {
171
+ vcc-pa-supply = <&reg_dcdc1>;
172
+ vcc-pb-supply = <&reg_dcdc1>;
173
+ vcc-pc-supply = <&reg_dcdc1>;
174
+ vcc-pd-supply = <&reg_dcdc1>;
175
+ vcc-pe-supply = <&reg_aldo1>;
176
+ vcc-pf-supply = <&reg_dcdc1>;
177
+ vcc-pg-supply = <&reg_dldo4>;
178
+ vcc-ph-supply = <&reg_dcdc1>;
179
+};
180
+
95181 &r_rsb {
96182 status = "okay";
97183
....@@ -100,10 +186,25 @@
100186 reg = <0x3a3>;
101187 interrupt-parent = <&r_intc>;
102188 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
189
+ x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */
103190 };
104191 };
105192
193
+/* VCC-PL is powered by aldo2 but we cannot add it as the RSB */
194
+/* interface used to talk to the PMIC in on the PL pins */
195
+/* &r_pio { */
196
+/* vcc-pl-supply = <&reg_aldo2>; */
197
+/* }; */
198
+
106199 #include "axp803.dtsi"
200
+
201
+&ac_power_supply {
202
+ status = "okay";
203
+};
204
+
205
+&battery_power_supply {
206
+ status = "okay";
207
+};
107208
108209 &reg_aldo1 {
109210 regulator-always-on;
....@@ -184,6 +285,11 @@
184285 regulator-name = "vcc-wifi-io";
185286 };
186287
288
+&reg_drivevbus {
289
+ regulator-name = "usb0-vbus";
290
+ status = "okay";
291
+};
292
+
187293 &reg_eldo1 {
188294 regulator-min-microvolt = <1800000>;
189295 regulator-max-microvolt = <1800000>;
....@@ -224,6 +330,18 @@
224330
225331 &uart0 {
226332 pinctrl-names = "default";
227
- pinctrl-0 = <&uart0_pins_a>;
333
+ pinctrl-0 = <&uart0_pb_pins>;
228334 status = "okay";
229335 };
336
+
337
+&usb_otg {
338
+ dr_mode = "otg";
339
+ status = "okay";
340
+};
341
+
342
+&usbphy {
343
+ status = "okay";
344
+ usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
345
+ usb0_vbus-supply = <&reg_drivevbus>;
346
+ usb1_vbus-supply = <&reg_usb1_vbus>;
347
+};