ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_xiaoyu_xy-c5.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "xiaoyu,xy-c5", "mediatek,mt7621-soc";
8 model = "XiaoYu XY-C5";
9
10 aliases {
11 led-boot = &led_sys;
12 led-failsafe = &led_sys;
13 led-running = &led_sys;
14 led-upgrade = &led_sys;
15 label-mac-device = &gmac0;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 work {
22 label = "green:work";
23 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
24 };
25
26 led_sys: sys {
27 label = "green:sys";
28 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
29 };
30 };
31
32 keys {
33 compatible = "gpio-keys";
34
35 reset {
36 label = "reset";
37 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
38 linux,code = <KEY_RESTART>;
39 };
40 };
41 };
42
43 &spi0 {
44 status = "okay";
45
46 flash@0 {
47 compatible = "jedec,spi-nor";
48 reg = <0>;
49 spi-max-frequency = <25000000>;
50
51 partitions {
52 compatible = "fixed-partitions";
53 #address-cells = <1>;
54 #size-cells = <1>;
55
56 partition@0 {
57 label = "u-boot";
58 reg = <0x0 0x30000>;
59 read-only;
60 };
61
62 partition@30000 {
63 label = "u-boot-env";
64 reg = <0x30000 0x10000>;
65 read-only;
66 };
67
68 factory: partition@40000 {
69 label = "factory";
70 reg = <0x40000 0x10000>;
71 read-only;
72 };
73
74 partition@50000 {
75 compatible = "denx,uimage";
76 label = "firmware";
77 reg = <0x50000 0x1fb0000>;
78 };
79 };
80 };
81 };
82
83 &pcie {
84 status = "okay";
85 };
86
87 &gmac0 {
88 nvmem-cells = <&macaddr_factory_4>;
89 nvmem-cell-names = "mac-address";
90 };
91
92 &switch0 {
93 ports {
94 port@0 {
95 status = "okay";
96 label = "lan1";
97 };
98
99 port@1 {
100 status = "okay";
101 label = "lan2";
102 };
103
104 port@2 {
105 status = "okay";
106 label = "lan3";
107 };
108
109 port@3 {
110 status = "okay";
111 label = "lan4";
112 };
113
114 port@4 {
115 status = "okay";
116 label = "wan";
117 nvmem-cells = <&macaddr_factory_4>;
118 nvmem-cell-names = "mac-address";
119 mac-address-increment = <1>;
120 };
121 };
122 };
123
124 &state_default {
125 gpio {
126 groups = "uart3", "wdt";
127 function = "gpio";
128 };
129 };
130
131 &factory {
132 compatible = "nvmem-cells";
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 macaddr_factory_4: macaddr@4 {
137 reg = <0x4 0x6>;
138 };
139 };