ramips: Use dts alias based status led
[openwrt/openwrt.git] / target / linux / ramips / dts / K2G.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "phicomm,k2g", "ralink,mt7620a-soc";
10 model = "Phicomm K2G";
11
12 aliases {
13 led-status = &led_blue;
14 serial0 = &uartlite;
15 };
16
17 gpio-leds {
18 compatible = "gpio-leds";
19
20 led_blue: blue {
21 label = "k2g:blue:status";
22 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
23 };
24
25 yellow {
26 label = "k2g:yellow:status";
27 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
28 };
29
30 red {
31 label = "k2g:red:status";
32 gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
33 };
34 };
35
36 gpio-keys-polled {
37 compatible = "gpio-keys-polled";
38 #address-cells = <1>;
39 #size-cells = <0>;
40 poll-interval = <20>;
41
42 reset {
43 label = "reset";
44 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
45 linux,code = <KEY_RESTART>;
46 };
47 };
48 };
49
50 &spi0 {
51 status = "okay";
52
53 m25p80@0 {
54 #address-cells = <1>;
55 #size-cells = <1>;
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <24000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 u-boot@0 {
66 reg = <0x0 0x30000>;
67 read-only;
68 };
69
70 u-boot-env@30000 {
71 reg = <0x30000 0x10000>;
72 read-only;
73 };
74
75 factory: factory@40000 {
76 reg = <0x40000 0x10000>;
77 read-only;
78 };
79
80 permanent_config@50000 {
81 reg = <0x50000 0x50000>;
82 read-only;
83 };
84
85 firmware@a0000 {
86 reg = <0xa0000 0x760000>;
87 };
88 };
89 };
90 };
91
92 &pinctrl {
93 state_default: pinctrl0 {
94 gpio {
95 ralink,group = "i2c", "uartf";
96 ralink,function = "gpio";
97 };
98 };
99 };
100
101 &ethernet {
102 pinctrl-names = "default";
103 pinctrl-0 = <&rgmii2_pins &mdio_pins>;
104 mtd-mac-address = <&factory 0x28>;
105 mediatek,portmap = "llllw";
106
107 port@5 {
108 status = "okay";
109 phy-handle = <&phy5>;
110 phy-mode = "rgmii";
111 };
112
113 mdio-bus {
114 status = "okay";
115
116 phy5: ethernet-phy@5 {
117 reg = <5>;
118 phy-mode = "rgmii";
119 };
120 };
121 };
122
123 &pcie {
124 status = "okay";
125
126 pcie-bridge {
127 mt76@0,0 {
128 reg = <0x0000 0 0 0 0>;
129 device_type = "pci";
130 mediatek,mtd-eeprom = <&factory 0x8000>;
131 ieee80211-freq-limit = <5000000 6000000>;
132 };
133 };
134 };
135
136 &wmac {
137 ralink,mtd-eeprom = <&factory 0>;
138 pinctrl-names = "default";
139 pinctrl-0 = <&pa_pins>;
140 };