realtek: add support for Panasonic Switch-M8eG PN28080K
[openwrt/staging/pepe2k.git] / target / linux / realtek / dts-5.10 / rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include <dt-bindings/input/input.h>
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 chosen {
9 bootargs = "console=ttyS0,9600";
10 };
11
12 memory@0 {
13 device_type = "memory";
14 reg = <0x0 0x8000000>;
15 };
16
17 leds: leds {
18 compatible = "gpio-leds";
19
20 led-0 {
21 label = "amber:any_col";
22 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
23 color = <LED_COLOR_ID_AMBER>;
24 function = LED_FUNCTION_FAULT;
25 };
26
27 led-1 {
28 label = "green:giga";
29 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
30 color = <LED_COLOR_ID_GREEN>;
31 function = LED_FUNCTION_INDICATOR;
32 function-enumerator = <1>;
33 };
34
35 led-2 {
36 label = "green:100m";
37 gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
38 color = <LED_COLOR_ID_GREEN>;
39 function = LED_FUNCTION_INDICATOR;
40 function-enumerator = <2>;
41 };
42
43 led-3 {
44 label = "green:full";
45 gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
46 color = <LED_COLOR_ID_GREEN>;
47 function = LED_FUNCTION_INDICATOR;
48 function-enumerator = <3>;
49 };
50
51 led-4 {
52 label = "green:loop_history";
53 gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
54 color = <LED_COLOR_ID_GREEN>;
55 function = LED_FUNCTION_INDICATOR;
56 function-enumerator = <4>;
57 };
58 };
59
60 keys {
61 compatible = "gpio-keys";
62
63 led_mode {
64 label = "led-mode";
65 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
66 linux,code = <BTN_0>;
67 };
68 };
69
70 gpio-restart {
71 compatible = "gpio-restart";
72 gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
73 };
74
75 i2c_gpio_0: i2c-gpio-0 {
76 compatible = "i2c-gpio";
77 i2c-gpio,delay-us = <2>;
78 #address-cells = <1>;
79 #size-cells = <0>;
80
81 gpio1: gpio@20 {
82 compatible = "nxp,pca9555";
83 reg = <0x20>;
84 gpio-controller;
85 #gpio-cells = <2>;
86 };
87
88 gpio2: gpio@75 {
89 compatible = "nxp,pca9539";
90 reg = <0x75>;
91 gpio-controller;
92 #gpio-cells = <2>;
93
94 /*
95 * GPIO14 (IO1_6): Shift Register RESET (port LED)
96 * - Switch-M8eG PN28080K: 3x 74HC164
97 * - Switch-M24eG PN28240K: 6x 74HC164
98 * - Switch-M48eG PN28480K: 12x 74HC164
99 */
100 portled_sregister_reset {
101 gpio-hog;
102 gpios = <14 GPIO_ACTIVE_HIGH>;
103 output-high;
104 line-name = "portled-sregister-reset";
105 };
106 };
107 };
108
109 i2c_gpio_1: i2c-gpio-1 {
110 compatible = "i2c-gpio";
111 i2c-gpio,delay-us = <2>;
112 #address-cells = <1>;
113 #size-cells = <0>;
114
115 i2c_switch: i2c-switch@70 {
116 compatible = "nxp,pca9545";
117 reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
118 reg = <0x70>;
119 #address-cells = <1>;
120 #size-cells = <0>;
121 };
122 };
123 };
124
125 &spi0 {
126 status = "okay";
127
128 flash@0 {
129 compatible = "jedec,spi-nor";
130 reg = <0>;
131 spi-max-frequency = <10000000>;
132
133 partitions {
134 compatible = "fixed-partitions";
135 #address-cells = <1>;
136 #size-cells = <1>;
137
138 partition@0 {
139 label = "u-boot";
140 reg = <0x0 0x80000>;
141 read-only;
142 };
143
144 partition@80000 {
145 label = "u-boot-env";
146 reg = <0x80000 0x10000>;
147 };
148
149 partition@90000 {
150 label = "u-boot-env2";
151 reg = <0x90000 0x10000>;
152 };
153
154 partition@a0000 {
155 label = "sysinfo";
156 reg = <0xa0000 0x60000>;
157 read-only;
158 };
159
160 /*
161 * Filesystem area in stock firmware
162 * (0x100000-0x1DFFFFF)
163 *
164 * stock firmware images are required to pass
165 * the checking by the U-Boot, also for OpenWrt
166 *
167 * in OpenWrt:
168 * - 0x100000-0xDFFFFF (13M): stock images
169 * - 0xE00000-0x1DFFFFF(16M): OpenWrt image
170 */
171 partition@100000 {
172 label = "fs_reserved";
173 reg = <0x100000 0xd00000>;
174 };
175
176 partition@e00000 {
177 compatible = "denx,uimage";
178 label = "firmware";
179 reg = <0xe00000 0x1000000>;
180 };
181
182 partition@1e00000 {
183 label = "vlog_data";
184 reg = <0x1e00000 0x100000>;
185 read-only;
186 };
187
188 partition@1f00000 {
189 label = "elog_data";
190 reg = <0x1f00000 0x100000>;
191 read-only;
192 };
193 };
194 };
195 };