ramips: use gpio-export for Mikrotik RouterBOARD 750Gr3 beeper
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_mikrotik_routerboard-750gr3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/gpio/gpio.h>
8
9 / {
10 compatible = "mikrotik,routerboard-750gr3", "mediatek,mt7621-soc";
11 model = "MikroTik RouterBOARD 750Gr3";
12
13 aliases {
14 led-boot = &led_usr;
15 led-failsafe = &led_usr;
16 led-running = &led_usr;
17 led-upgrade = &led_usr;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 pwr {
28 label = "routerboard-750gr3:blue:pwr";
29 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
30 default-state = "on";
31 };
32
33 led_usr: usr {
34 label = "routerboard-750gr3:green:usr";
35 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
36 };
37 };
38
39 keys {
40 compatible = "gpio-keys";
41
42 mode {
43 label = "mode";
44 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
45 linux,code = <BTN_0>;
46 };
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53 };
54
55 gpio_export {
56 compatible = "gpio-export";
57 #size-cells = <0>;
58
59 buzzer {
60 /* Beeper requires PWM for frequency selection */
61 gpio-export,name = "buzzer";
62 gpio-export,output = <0>;
63 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
64 };
65
66 usb_power {
67 gpio-export,name = "usb_power";
68 gpio-export,output = <1>;
69 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
70 };
71 };
72 };
73
74 &spi0 {
75 status = "okay";
76
77 flash@0 {
78 compatible = "jedec,spi-nor";
79 reg = <0>;
80 spi-max-frequency = <20000000>;
81
82 partitions {
83 compatible = "fixed-partitions";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 partition@0 {
88 label = "RouterBoot";
89 reg = <0x0 0x40000>;
90 read-only;
91 compatible = "mikrotik,routerboot-partitions";
92 #address-cells = <1>;
93 #size-cells = <1>;
94
95 partition@0 {
96 label = "bootloader1";
97 reg = <0x0 0x0>;
98 read-only;
99 };
100
101 hard_config: hard_config {
102 read-only;
103 };
104
105 partition@10000 {
106 label = "bootloader2";
107 reg = <0x10000 0xf000>;
108 read-only;
109 };
110
111 soft_config {
112 };
113
114 partition@30000 {
115 label = "bios";
116 reg = <0x30000 0x1000>;
117 read-only;
118 };
119 };
120
121 partition@40000 {
122 compatible = "mikrotik,minor";
123 label = "firmware";
124 reg = <0x040000 0xfc0000>;
125 };
126 };
127 };
128 };
129
130 &switch0 {
131 ports {
132 port@0 {
133 status = "okay";
134 label = "wan";
135 };
136
137 port@1 {
138 status = "okay";
139 label = "lan2";
140 };
141
142 port@2 {
143 status = "okay";
144 label = "lan3";
145 };
146
147 port@3 {
148 status = "okay";
149 label = "lan4";
150 };
151
152 port@4 {
153 status = "okay";
154 label = "lan5";
155 };
156 };
157 };
158
159 &state_default {
160 gpio {
161 /* via gpio7 (uart3 group) the PoE status can be read */
162 groups = "uart2", "uart3", "jtag", "wdt";
163 function = "gpio";
164 };
165 };
166
167 &sdhci {
168 status = "okay";
169 };