diff options
author | Olof Johansson <olof@lixom.net> | 2017-06-18 23:45:17 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2017-06-18 23:45:17 -0400 |
commit | b69cfb5abfb271e7d7aa872b2dd0921089ae7349 (patch) | |
tree | 5868378a7a762e078eb20f4cdb8821ab1eba6cb8 | |
parent | 08d13c7028121e166cddb88466462595ec206d09 (diff) | |
parent | ea43d9b85acf66eac16ec89dc0fb84751f50f088 (diff) |
Merge tag 'sunxi-dt-h5-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt64
Allwinner H5 DT changes for 4.13
Just like the H3, this is mostly about enabling the EMAC on the H5, and
also has a new board, the Orange Pi Zero Plus 2
* tag 'sunxi-dt-h5-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
arm64: allwinner: h5: Add initial Orangepi Zero Plus 2 support
arm64: allwinner: h5: enable dwmac-sun8i for Nano Pi NEO2
arm64: allwinner: h5: enable dwmac-sun8i for Orange Pi Prime
arm64: allwinner: h5: sort the device nodes in / part for some boards
arm64: allwinner: h5: add support for NanoPi NEO2 board
arm64: allwinner: h5: add support for Orange Pi Prime board
arm64: allwinner: orangepi-pc2: Enable dwmac-sun8i
arm: sun8i: sunxi-h3-h5: add dwmac-sun8i ethernet driver
arm: sun8i: sunxi-h3-h5: Add dt node for the syscon control module
ARM: sunxi: h3-h5: Convert R_CCU raw numbers to macros
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/arm/boot/dts/sunxi-h3-h5.dtsi | 48 | ||||
-rw-r--r-- | arch/arm64/boot/dts/allwinner/Makefile | 3 | ||||
-rw-r--r-- | arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts | 161 | ||||
-rw-r--r-- | arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 27 | ||||
-rw-r--r-- | arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 232 | ||||
-rw-r--r-- | arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 92 |
6 files changed, 560 insertions, 3 deletions
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi index 1aeeacb3a884..1fc663bdfdda 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi | |||
@@ -41,8 +41,10 @@ | |||
41 | */ | 41 | */ |
42 | 42 | ||
43 | #include <dt-bindings/clock/sun8i-h3-ccu.h> | 43 | #include <dt-bindings/clock/sun8i-h3-ccu.h> |
44 | #include <dt-bindings/clock/sun8i-r-ccu.h> | ||
44 | #include <dt-bindings/interrupt-controller/arm-gic.h> | 45 | #include <dt-bindings/interrupt-controller/arm-gic.h> |
45 | #include <dt-bindings/reset/sun8i-h3-ccu.h> | 46 | #include <dt-bindings/reset/sun8i-h3-ccu.h> |
47 | #include <dt-bindings/reset/sun8i-r-ccu.h> | ||
46 | 48 | ||
47 | / { | 49 | / { |
48 | interrupt-parent = <&gic>; | 50 | interrupt-parent = <&gic>; |
@@ -83,6 +85,12 @@ | |||
83 | #size-cells = <1>; | 85 | #size-cells = <1>; |
84 | ranges; | 86 | ranges; |
85 | 87 | ||
88 | syscon: syscon@1c00000 { | ||
89 | compatible = "allwinner,sun8i-h3-system-controller", | ||
90 | "syscon"; | ||
91 | reg = <0x01c00000 0x1000>; | ||
92 | }; | ||
93 | |||
86 | dma: dma-controller@01c02000 { | 94 | dma: dma-controller@01c02000 { |
87 | compatible = "allwinner,sun8i-h3-dma"; | 95 | compatible = "allwinner,sun8i-h3-dma"; |
88 | reg = <0x01c02000 0x1000>; | 96 | reg = <0x01c02000 0x1000>; |
@@ -279,6 +287,14 @@ | |||
279 | interrupt-controller; | 287 | interrupt-controller; |
280 | #interrupt-cells = <3>; | 288 | #interrupt-cells = <3>; |
281 | 289 | ||
290 | emac_rgmii_pins: emac0 { | ||
291 | pins = "PD0", "PD1", "PD2", "PD3", "PD4", | ||
292 | "PD5", "PD7", "PD8", "PD9", "PD10", | ||
293 | "PD12", "PD13", "PD15", "PD16", "PD17"; | ||
294 | function = "emac"; | ||
295 | drive-strength = <40>; | ||
296 | }; | ||
297 | |||
282 | i2c0_pins: i2c0 { | 298 | i2c0_pins: i2c0 { |
283 | pins = "PA11", "PA12"; | 299 | pins = "PA11", "PA12"; |
284 | function = "i2c0"; | 300 | function = "i2c0"; |
@@ -375,6 +391,32 @@ | |||
375 | clocks = <&osc24M>; | 391 | clocks = <&osc24M>; |
376 | }; | 392 | }; |
377 | 393 | ||
394 | emac: ethernet@1c30000 { | ||
395 | compatible = "allwinner,sun8i-h3-emac"; | ||
396 | syscon = <&syscon>; | ||
397 | reg = <0x01c30000 0x104>; | ||
398 | interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; | ||
399 | interrupt-names = "macirq"; | ||
400 | resets = <&ccu RST_BUS_EMAC>; | ||
401 | reset-names = "stmmaceth"; | ||
402 | clocks = <&ccu CLK_BUS_EMAC>; | ||
403 | clock-names = "stmmaceth"; | ||
404 | #address-cells = <1>; | ||
405 | #size-cells = <0>; | ||
406 | status = "disabled"; | ||
407 | |||
408 | mdio: mdio { | ||
409 | #address-cells = <1>; | ||
410 | #size-cells = <0>; | ||
411 | int_mii_phy: ethernet-phy@1 { | ||
412 | compatible = "ethernet-phy-ieee802.3-c22"; | ||
413 | reg = <1>; | ||
414 | clocks = <&ccu CLK_BUS_EPHY>; | ||
415 | resets = <&ccu RST_BUS_EPHY>; | ||
416 | }; | ||
417 | }; | ||
418 | }; | ||
419 | |||
378 | spi0: spi@01c68000 { | 420 | spi0: spi@01c68000 { |
379 | compatible = "allwinner,sun8i-h3-spi"; | 421 | compatible = "allwinner,sun8i-h3-spi"; |
380 | reg = <0x01c68000 0x1000>; | 422 | reg = <0x01c68000 0x1000>; |
@@ -573,9 +615,9 @@ | |||
573 | 615 | ||
574 | ir: ir@01f02000 { | 616 | ir: ir@01f02000 { |
575 | compatible = "allwinner,sun5i-a13-ir"; | 617 | compatible = "allwinner,sun5i-a13-ir"; |
576 | clocks = <&r_ccu 4>, <&r_ccu 11>; | 618 | clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>; |
577 | clock-names = "apb", "ir"; | 619 | clock-names = "apb", "ir"; |
578 | resets = <&r_ccu 0>; | 620 | resets = <&r_ccu RST_APB0_IR>; |
579 | interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; | 621 | interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; |
580 | reg = <0x01f02000 0x40>; | 622 | reg = <0x01f02000 0x40>; |
581 | status = "disabled"; | 623 | status = "disabled"; |
@@ -585,7 +627,7 @@ | |||
585 | compatible = "allwinner,sun8i-h3-r-pinctrl"; | 627 | compatible = "allwinner,sun8i-h3-r-pinctrl"; |
586 | reg = <0x01f02c00 0x400>; | 628 | reg = <0x01f02c00 0x400>; |
587 | interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>; | 629 | interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>; |
588 | clocks = <&r_ccu 3>, <&osc24M>, <&osc32k>; | 630 | clocks = <&r_ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>; |
589 | clock-names = "apb", "hosc", "losc"; | 631 | clock-names = "apb", "hosc", "losc"; |
590 | gpio-controller; | 632 | gpio-controller; |
591 | #gpio-cells = <3>; | 633 | #gpio-cells = <3>; |
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile index 2c9f63743002..108f12ce6d1d 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile | |||
@@ -3,6 +3,9 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb | |||
3 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb | 3 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb |
4 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb | 4 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb |
5 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb | 5 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb |
6 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb | ||
7 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb | ||
8 | dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb | ||
6 | 9 | ||
7 | always := $(dtb-y) | 10 | always := $(dtb-y) |
8 | subdir-y := $(dts-dirs) | 11 | subdir-y := $(dts-dirs) |
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts new file mode 100644 index 000000000000..968908761194 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io> | ||
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 file 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 file 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 | */ | ||
42 | |||
43 | /dts-v1/; | ||
44 | #include "sun50i-h5.dtsi" | ||
45 | |||
46 | #include <dt-bindings/gpio/gpio.h> | ||
47 | |||
48 | / { | ||
49 | model = "FriendlyARM NanoPi NEO 2"; | ||
50 | compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5"; | ||
51 | |||
52 | aliases { | ||
53 | ethernet0 = &emac; | ||
54 | serial0 = &uart0; | ||
55 | }; | ||
56 | |||
57 | chosen { | ||
58 | stdout-path = "serial0:115200n8"; | ||
59 | }; | ||
60 | |||
61 | leds { | ||
62 | compatible = "gpio-leds"; | ||
63 | |||
64 | pwr { | ||
65 | label = "nanopi:green:pwr"; | ||
66 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; | ||
67 | default-state = "on"; | ||
68 | }; | ||
69 | |||
70 | status { | ||
71 | label = "nanopi:blue:status"; | ||
72 | gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; | ||
73 | }; | ||
74 | }; | ||
75 | |||
76 | reg_gmac_3v3: gmac-3v3 { | ||
77 | compatible = "regulator-fixed"; | ||
78 | regulator-name = "gmac-3v3"; | ||
79 | regulator-min-microvolt = <3300000>; | ||
80 | regulator-max-microvolt = <3300000>; | ||
81 | startup-delay-us = <100000>; | ||
82 | enable-active-high; | ||
83 | gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; | ||
84 | }; | ||
85 | |||
86 | reg_vcc3v3: vcc3v3 { | ||
87 | compatible = "regulator-fixed"; | ||
88 | regulator-name = "vcc3v3"; | ||
89 | regulator-min-microvolt = <3300000>; | ||
90 | regulator-max-microvolt = <3300000>; | ||
91 | }; | ||
92 | |||
93 | reg_usb0_vbus: usb0-vbus { | ||
94 | compatible = "regulator-fixed"; | ||
95 | regulator-name = "usb0-vbus"; | ||
96 | regulator-min-microvolt = <5000000>; | ||
97 | regulator-max-microvolt = <5000000>; | ||
98 | enable-active-high; | ||
99 | gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ | ||
100 | status = "okay"; | ||
101 | }; | ||
102 | }; | ||
103 | |||
104 | &ehci0 { | ||
105 | status = "okay"; | ||
106 | }; | ||
107 | |||
108 | &ehci3 { | ||
109 | status = "okay"; | ||
110 | }; | ||
111 | |||
112 | &emac { | ||
113 | pinctrl-names = "default"; | ||
114 | pinctrl-0 = <&emac_rgmii_pins>; | ||
115 | phy-supply = <®_gmac_3v3>; | ||
116 | phy-handle = <&ext_rgmii_phy>; | ||
117 | phy-mode = "rgmii"; | ||
118 | status = "okay"; | ||
119 | }; | ||
120 | |||
121 | &mdio { | ||
122 | ext_rgmii_phy: ethernet-phy@7 { | ||
123 | compatible = "ethernet-phy-ieee802.3-c22"; | ||
124 | reg = <7>; | ||
125 | }; | ||
126 | }; | ||
127 | |||
128 | &mmc0 { | ||
129 | pinctrl-names = "default"; | ||
130 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; | ||
131 | vmmc-supply = <®_vcc3v3>; | ||
132 | bus-width = <4>; | ||
133 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | ||
134 | status = "okay"; | ||
135 | }; | ||
136 | |||
137 | &ohci0 { | ||
138 | status = "okay"; | ||
139 | }; | ||
140 | |||
141 | &ohci3 { | ||
142 | status = "okay"; | ||
143 | }; | ||
144 | |||
145 | &uart0 { | ||
146 | pinctrl-names = "default"; | ||
147 | pinctrl-0 = <&uart0_pins_a>; | ||
148 | status = "okay"; | ||
149 | }; | ||
150 | |||
151 | &usb_otg { | ||
152 | dr_mode = "otg"; | ||
153 | status = "okay"; | ||
154 | }; | ||
155 | |||
156 | &usbphy { | ||
157 | /* USB Type-A port's VBUS is always on */ | ||
158 | usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ | ||
159 | usb0_vbus-supply = <®_usb0_vbus>; | ||
160 | status = "okay"; | ||
161 | }; | ||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts index dfecc17dcc92..a8296feee884 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | |||
@@ -59,6 +59,7 @@ | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | aliases { | 61 | aliases { |
62 | ethernet0 = &emac; | ||
62 | serial0 = &uart0; | 63 | serial0 = &uart0; |
63 | }; | 64 | }; |
64 | 65 | ||
@@ -91,6 +92,16 @@ | |||
91 | }; | 92 | }; |
92 | }; | 93 | }; |
93 | 94 | ||
95 | reg_gmac_3v3: gmac-3v3 { | ||
96 | compatible = "regulator-fixed"; | ||
97 | regulator-name = "gmac-3v3"; | ||
98 | regulator-min-microvolt = <3300000>; | ||
99 | regulator-max-microvolt = <3300000>; | ||
100 | startup-delay-us = <100000>; | ||
101 | enable-active-high; | ||
102 | gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; | ||
103 | }; | ||
104 | |||
94 | reg_usb0_vbus: usb0-vbus { | 105 | reg_usb0_vbus: usb0-vbus { |
95 | compatible = "regulator-fixed"; | 106 | compatible = "regulator-fixed"; |
96 | regulator-name = "usb0-vbus"; | 107 | regulator-name = "usb0-vbus"; |
@@ -126,12 +137,28 @@ | |||
126 | status = "okay"; | 137 | status = "okay"; |
127 | }; | 138 | }; |
128 | 139 | ||
140 | &emac { | ||
141 | pinctrl-names = "default"; | ||
142 | pinctrl-0 = <&emac_rgmii_pins>; | ||
143 | phy-supply = <®_gmac_3v3>; | ||
144 | phy-handle = <&ext_rgmii_phy>; | ||
145 | phy-mode = "rgmii"; | ||
146 | status = "okay"; | ||
147 | }; | ||
148 | |||
129 | &ir { | 149 | &ir { |
130 | pinctrl-names = "default"; | 150 | pinctrl-names = "default"; |
131 | pinctrl-0 = <&ir_pins_a>; | 151 | pinctrl-0 = <&ir_pins_a>; |
132 | status = "okay"; | 152 | status = "okay"; |
133 | }; | 153 | }; |
134 | 154 | ||
155 | &mdio { | ||
156 | ext_rgmii_phy: ethernet-phy@1 { | ||
157 | compatible = "ethernet-phy-ieee802.3-c22"; | ||
158 | reg = <1>; | ||
159 | }; | ||
160 | }; | ||
161 | |||
135 | &mmc0 { | 162 | &mmc0 { |
136 | pinctrl-names = "default"; | 163 | pinctrl-names = "default"; |
137 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; | 164 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; |
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts new file mode 100644 index 000000000000..d906b302cbcd --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | |||
@@ -0,0 +1,232 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz> | ||
3 | * | ||
4 | * Based on sun50i-h5-orangepi-pc2.dts, which is: | ||
5 | * Copyright (C) 2016 ARM Ltd. | ||
6 | * | ||
7 | * This file is dual-licensed: you can use it either under the terms | ||
8 | * of the GPL or the X11 license, at your option. Note that this dual | ||
9 | * licensing only applies to this file, and not this project as a | ||
10 | * whole. | ||
11 | * | ||
12 | * a) This file is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License as | ||
14 | * published by the Free Software Foundation; either version 2 of the | ||
15 | * License, or (at your option) any later version. | ||
16 | * | ||
17 | * This file is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * Or, alternatively, | ||
23 | * | ||
24 | * b) Permission is hereby granted, free of charge, to any person | ||
25 | * obtaining a copy of this software and associated documentation | ||
26 | * files (the "Software"), to deal in the Software without | ||
27 | * restriction, including without limitation the rights to use, | ||
28 | * copy, modify, merge, publish, distribute, sublicense, and/or | ||
29 | * sell copies of the Software, and to permit persons to whom the | ||
30 | * Software is furnished to do so, subject to the following | ||
31 | * conditions: | ||
32 | * | ||
33 | * The above copyright notice and this permission notice shall be | ||
34 | * included in all copies or substantial portions of the Software. | ||
35 | * | ||
36 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
37 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
38 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
39 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
40 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
41 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
42 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
43 | * OTHER DEALINGS IN THE SOFTWARE. | ||
44 | */ | ||
45 | |||
46 | /dts-v1/; | ||
47 | #include "sun50i-h5.dtsi" | ||
48 | |||
49 | #include <dt-bindings/gpio/gpio.h> | ||
50 | #include <dt-bindings/input/input.h> | ||
51 | |||
52 | / { | ||
53 | model = "Xunlong Orange Pi Prime"; | ||
54 | compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5"; | ||
55 | |||
56 | aliases { | ||
57 | ethernet0 = &emac; | ||
58 | serial0 = &uart0; | ||
59 | }; | ||
60 | |||
61 | chosen { | ||
62 | stdout-path = "serial0:115200n8"; | ||
63 | }; | ||
64 | |||
65 | leds { | ||
66 | compatible = "gpio-leds"; | ||
67 | |||
68 | pwr { | ||
69 | label = "orangepi:green:pwr"; | ||
70 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; | ||
71 | default-state = "on"; | ||
72 | }; | ||
73 | |||
74 | status { | ||
75 | label = "orangepi:red:status"; | ||
76 | gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>; | ||
77 | }; | ||
78 | }; | ||
79 | |||
80 | r-gpio-keys { | ||
81 | compatible = "gpio-keys"; | ||
82 | |||
83 | sw4 { | ||
84 | label = "sw4"; | ||
85 | linux,code = <BTN_0>; | ||
86 | gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; | ||
87 | }; | ||
88 | }; | ||
89 | |||
90 | reg_gmac_3v3: gmac-3v3 { | ||
91 | compatible = "regulator-fixed"; | ||
92 | regulator-name = "gmac-3v3"; | ||
93 | regulator-min-microvolt = <3300000>; | ||
94 | regulator-max-microvolt = <3300000>; | ||
95 | startup-delay-us = <100000>; | ||
96 | enable-active-high; | ||
97 | gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; | ||
98 | }; | ||
99 | |||
100 | reg_vcc3v3: vcc3v3 { | ||
101 | compatible = "regulator-fixed"; | ||
102 | regulator-name = "vcc3v3"; | ||
103 | regulator-min-microvolt = <3300000>; | ||
104 | regulator-max-microvolt = <3300000>; | ||
105 | }; | ||
106 | |||
107 | reg_usb0_vbus: usb0-vbus { | ||
108 | compatible = "regulator-fixed"; | ||
109 | regulator-name = "usb0-vbus"; | ||
110 | regulator-min-microvolt = <5000000>; | ||
111 | regulator-max-microvolt = <5000000>; | ||
112 | enable-active-high; | ||
113 | gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ | ||
114 | status = "okay"; | ||
115 | }; | ||
116 | |||
117 | wifi_pwrseq: wifi_pwrseq { | ||
118 | compatible = "mmc-pwrseq-simple"; | ||
119 | reset-gpios = <&pio 2 14 GPIO_ACTIVE_LOW>; /* PC14 */ | ||
120 | }; | ||
121 | }; | ||
122 | |||
123 | &codec { | ||
124 | allwinner,audio-routing = | ||
125 | "Line Out", "LINEOUT", | ||
126 | "MIC1", "Mic", | ||
127 | "Mic", "MBIAS"; | ||
128 | status = "okay"; | ||
129 | }; | ||
130 | |||
131 | &ehci0 { | ||
132 | status = "okay"; | ||
133 | }; | ||
134 | |||
135 | &ehci1 { | ||
136 | status = "okay"; | ||
137 | }; | ||
138 | |||
139 | &ehci2 { | ||
140 | status = "okay"; | ||
141 | }; | ||
142 | |||
143 | &ehci3 { | ||
144 | status = "okay"; | ||
145 | }; | ||
146 | |||
147 | &emac { | ||
148 | pinctrl-names = "default"; | ||
149 | pinctrl-0 = <&emac_rgmii_pins>; | ||
150 | phy-supply = <®_gmac_3v3>; | ||
151 | phy-handle = <&ext_rgmii_phy>; | ||
152 | phy-mode = "rgmii"; | ||
153 | status = "okay"; | ||
154 | }; | ||
155 | |||
156 | &ir { | ||
157 | pinctrl-names = "default"; | ||
158 | pinctrl-0 = <&ir_pins_a>; | ||
159 | status = "okay"; | ||
160 | }; | ||
161 | |||
162 | &mdio { | ||
163 | ext_rgmii_phy: ethernet-phy@1 { | ||
164 | compatible = "ethernet-phy-ieee802.3-c22"; | ||
165 | reg = <1>; | ||
166 | }; | ||
167 | }; | ||
168 | |||
169 | &mmc0 { | ||
170 | pinctrl-names = "default"; | ||
171 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; | ||
172 | vmmc-supply = <®_vcc3v3>; | ||
173 | bus-width = <4>; | ||
174 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | ||
175 | status = "okay"; | ||
176 | }; | ||
177 | |||
178 | &mmc1 { | ||
179 | pinctrl-names = "default"; | ||
180 | pinctrl-0 = <&mmc1_pins_a>; | ||
181 | vmmc-supply = <®_vcc3v3>; | ||
182 | mmc-pwrseq = <&wifi_pwrseq>; | ||
183 | bus-width = <4>; | ||
184 | non-removable; | ||
185 | status = "okay"; | ||
186 | }; | ||
187 | |||
188 | &ohci0 { | ||
189 | status = "okay"; | ||
190 | }; | ||
191 | |||
192 | &ohci1 { | ||
193 | status = "okay"; | ||
194 | }; | ||
195 | |||
196 | &ohci2 { | ||
197 | status = "okay"; | ||
198 | }; | ||
199 | |||
200 | &ohci3 { | ||
201 | status = "okay"; | ||
202 | }; | ||
203 | |||
204 | &uart0 { | ||
205 | pinctrl-names = "default"; | ||
206 | pinctrl-0 = <&uart0_pins_a>; | ||
207 | status = "okay"; | ||
208 | }; | ||
209 | |||
210 | &uart1 { | ||
211 | pinctrl-names = "default"; | ||
212 | pinctrl-0 = <&uart1_pins>; | ||
213 | status = "disabled"; | ||
214 | }; | ||
215 | |||
216 | &uart2 { | ||
217 | pinctrl-names = "default"; | ||
218 | pinctrl-0 = <&uart2_pins>; | ||
219 | status = "disabled"; | ||
220 | }; | ||
221 | |||
222 | &usb_otg { | ||
223 | dr_mode = "otg"; | ||
224 | status = "okay"; | ||
225 | }; | ||
226 | |||
227 | &usbphy { | ||
228 | /* USB Type-A ports' VBUS is always on */ | ||
229 | usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */ | ||
230 | usb0_vbus-supply = <®_usb0_vbus>; | ||
231 | status = "okay"; | ||
232 | }; | ||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts new file mode 100644 index 000000000000..b6b7a561df8c --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | |||
@@ -0,0 +1,92 @@ | |||
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 | */ | ||
42 | |||
43 | /dts-v1/; | ||
44 | |||
45 | #include "sun50i-h5.dtsi" | ||
46 | |||
47 | #include <dt-bindings/gpio/gpio.h> | ||
48 | |||
49 | / { | ||
50 | model = "OrangePi Zero Plus2"; | ||
51 | compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5"; | ||
52 | |||
53 | aliases { | ||
54 | serial0 = &uart0; | ||
55 | }; | ||
56 | |||
57 | chosen { | ||
58 | stdout-path = "serial0:115200n8"; | ||
59 | }; | ||
60 | |||
61 | reg_vcc3v3: vcc3v3 { | ||
62 | compatible = "regulator-fixed"; | ||
63 | regulator-name = "vcc3v3"; | ||
64 | regulator-min-microvolt = <3300000>; | ||
65 | regulator-max-microvolt = <3300000>; | ||
66 | }; | ||
67 | }; | ||
68 | |||
69 | &mmc0 { | ||
70 | pinctrl-names = "default"; | ||
71 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; | ||
72 | vmmc-supply = <®_vcc3v3>; | ||
73 | bus-width = <4>; | ||
74 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; | ||
75 | status = "okay"; | ||
76 | }; | ||
77 | |||
78 | &mmc2 { | ||
79 | pinctrl-names = "default"; | ||
80 | pinctrl-0 = <&mmc2_8bit_pins>; | ||
81 | vmmc-supply = <®_vcc3v3>; | ||
82 | bus-width = <8>; | ||
83 | non-removable; | ||
84 | cap-mmc-hw-reset; | ||
85 | status = "okay"; | ||
86 | }; | ||
87 | |||
88 | &uart0 { | ||
89 | pinctrl-names = "default"; | ||
90 | pinctrl-0 = <&uart0_pins_a>; | ||
91 | status = "okay"; | ||
92 | }; | ||