blob: b32c00948cc7eccded704f6ed6f3855d4cae8802 [file] [log] [blame]
Jan Kundrát0ef140f2023-09-14 12:14:43 +02001#include "../../../include/generated/uapi/linux/version.h"
2#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
Jan Kundrát130cfb92018-05-30 15:21:16 +02003#include "armada-388-clearfog-base.dts"
Jan Kundrát0ef140f2023-09-14 12:14:43 +02004#else
5#include "marvell/armada-388-clearfog-base.dts"
6#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +02007
8&w25q32 {
9 status = "okay";
10};
11
12/ {
13 clocks {
14 spi_uart_clk: osc_max14830 {
15 compatible = "fixed-clock";
16 #clock-cells = <0>;
17 clock-frequency = <3686400>;
18 };
19 };
20
21 soc {
22 internal-regs {
23 sdhci@d8000 {
24 /delete-property/ cd-gpios;
25 broken-cd;
26 };
27 };
28 };
29
Václav Kubernátf1b92ff2021-03-24 07:41:23 +010030 gpio_i2c: gpio_i2c {
Jan Kundrát130cfb92018-05-30 15:21:16 +020031 compatible = "i2c-gpio";
32 sda-gpios = <&gpio0 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
33 scl-gpios = <&gpio0 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
34 i2c-gpio.delay-us = <1>;
35 #address-cells = <1>;
36 #size-cells = <0>;
Jan Kundrátbf1e0912021-03-05 12:45:23 +010037 pinctrl-names = "default";
38 pinctrl-0 = <&uart1_pins_i2c_bb>;
Jan Kundrát130cfb92018-05-30 15:21:16 +020039 };
Jan Kundrát130cfb92018-05-30 15:21:16 +020040};
41
Václav Kubernátf1b92ff2021-03-24 07:41:23 +010042&gpio_i2c {
43 pdu@25 {
44 compatible = "fsp,yh5151e";
45 reg = <0x25>;
46 };
47};
48
Jan Kundrátbf1e0912021-03-05 12:45:23 +010049&pinctrl {
50 uart1_pins_i2c_bb: uart1-pins-i2c-bb {
51 marvell,pins = "mpp24", "mpp25";
52 marvell,function = "gpio";
53 };
54};
55
56&mikro_uart_pins {
Jan Kundrát130cfb92018-05-30 15:21:16 +020057 status = "disabled";
58};
59
60&uart1 {
61 status = "disabled";
62};
63
64&gpio1 {
65 spi_int {
66 /* MPP54: this needs an external pull-up */
67 gpio-hog;
68 gpios = <22 GPIO_ACTIVE_HIGH>;
69 input;
70 line-name = "SPI-INT";
71 };
72};
73
74&spi1 {
75 cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>;
76
77 max14830: max14830@2 {
78 compatible = "maxim,max14830";
79 reg = <2>;
80 clocks = <&spi_uart_clk>;
81 clock-names = "xtal";
82 interrupt-parent = <&gpio1>;
83 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
84 gpio-controller;
85 #gpio-cells = <2>;
86 spi-max-frequency = <26000000>;
87
88 gpio-line-names =
89 "WSS_HWRST",
90 "WSS_SSD",
91 "OCM_HS_IN",
92 "OCM_RESET",
93 "WSS_MRST",
Jan Kundrát6406d512020-11-18 18:24:36 +010094#ifdef CLEARFOG_REV1
Jan Kundrát130cfb92018-05-30 15:21:16 +020095 "I2C_XOR_ENABLE",
96 "I2C_XORH",
97 "I2C_BB_ENABLE",
Jan Kundrát8f3357f2018-08-08 14:16:32 +020098 "GPIO_K6",
Jan Kundrát6406d512020-11-18 18:24:36 +010099#else
100
101 "",
102 "",
103 "",
104 "",
105#endif
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200106 "",
107 "",
Jan Kundrátdb943222018-06-19 20:51:30 +0200108 "EDFA1_AMP_DISABLE",
109 "EDFA2_AMP_DISABLE",
110 "EDFA1_OUT_POWER_MUTE",
111 "EDFA2_OUT_POWER_MUTE",
Jan Kundrát93d79222018-06-19 20:45:35 +0200112 "EXP_GPIO1"
Jan Kundrát130cfb92018-05-30 15:21:16 +0200113 ;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200114
Jan Kundrát6406d512020-11-18 18:24:36 +0100115#ifdef CLEARFOG_REV1
Jan Kundrátd014bb92018-06-08 21:35:21 +0200116 i2c_bitbang_enable {
117 gpio-hog;
118 gpios = <7 GPIO_ACTIVE_HIGH>;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200119 output-high;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200120 line-name = "I2C bitbang bus";
121 };
122
123 i2c_xor_high {
124 gpio-hog;
125 gpios = <6 GPIO_ACTIVE_HIGH>;
Jan Kundrát1e866c62018-07-04 19:54:30 +0200126 output-high; // XOR byte 0b1001111
Jan Kundrátd014bb92018-06-08 21:35:21 +0200127 line-name = "I2C XOR high";
128 };
129
130 i2c_xor_enable {
131 gpio-hog;
132 gpios = <5 GPIO_ACTIVE_HIGH>;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200133 output-low;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200134 line-name = "I2C addr xlate";
135 };
Jan Kundrát6406d512020-11-18 18:24:36 +0100136#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200137 };
138
139 gpio_spi_chips: gpio@1 {
140 compatible = "microchip,mcp23s17";
141 reg = <1>;
142 interrupt-parent = <&gpio1>;
143 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
144 interrupt-controller;
145 #interrupt-cells = <2>;
146 gpio-controller;
147 #gpio-cells = <2>;
148 microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */
149 microchip,irq-mirror;
150 drive-open-drain;
151 spi-max-frequency = <10000000>;
152
153 // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips
154 gpio-bank@1 {
155 address = <1>;
156 gpio-line-names =
157 "EDFA1_RESET",
158 "EDFA2_RESET",
159 "PMB_ALERT",
Jan Kundrát6406d512020-11-18 18:24:36 +0100160#ifdef CLEARFOG_REV1
Jan Kundrát93d79222018-06-19 20:45:35 +0200161 "EXP_GPIO2",
Jan Kundrát6406d512020-11-18 18:24:36 +0100162#else
163 "GND",
164#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200165 "WSS_SC",
166 "WSS_RST",
Jan Kundrát6406d512020-11-18 18:24:36 +0100167#ifdef CLEARFOG_REV1
Jan Kundrát130cfb92018-05-30 15:21:16 +0200168 "I2C_XOR_RDY",
Jan Kundrát6406d512020-11-18 18:24:36 +0100169#else
170 "GND",
171#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200172 "OCM_HS_OUT",
173
Jan Kundrátdb943222018-06-19 20:51:30 +0200174 "EDFA1_OUT_REFLECT_A",
175 "EDFA1_PUMP_CURRENT_A",
176 "EDFA1_ST1_IN_LOS_A",
177 "EDFA1_ST2_IN_LOS_A",
178 "EDFA1_ST2_OUT_GAIN_A",
179 "EDFA1_CASE_TEMP_A",
180 "EDFA1_ST1_OUT_GAIN_A",
181 "EDFA1_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200182 };
183
184 gpio-bank@2 {
185 address = <2>;
186 gpio-line-names =
Jan Kundrát6406d512020-11-18 18:24:36 +0100187#ifdef CLEARFOG_REV1
Jan Kundrát130cfb92018-05-30 15:21:16 +0200188 "GND",
189 "GND",
Jan Kundrát6406d512020-11-18 18:24:36 +0100190#else
191 "OCM_READY",
192 "OCM_ALARM",
193#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200194 "GND",
195 "GND",
196 "GND",
197 "GND",
198 "GND",
199 "GND",
200
Jan Kundrátdb943222018-06-19 20:51:30 +0200201 "EDFA2_OUT_REFLECT_A",
202 "EDFA2_PUMP_CURRENT_A",
203 "EDFA2_ST1_IN_LOS_A",
204 "EDFA2_ST2_IN_LOS_A",
205 "EDFA2_ST2_OUT_GAIN_A",
206 "EDFA2_CASE_TEMP_A",
207 "EDFA2_ST1_OUT_GAIN_A",
208 "EDFA2_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200209 };
Jan Kundrát1e866c62018-07-04 19:54:30 +0200210
Jan Kundrát6406d512020-11-18 18:24:36 +0100211#ifdef CLEARFOG_REV1
Jan Kundrát6eb5a022018-08-20 14:55:33 +0200212 // FIXME: this hogs both .1 and .2 chips' #6 pin...
Jan Kundrát1e866c62018-07-04 19:54:30 +0200213 i2c_xor_ready {
214 gpio-hog;
215 gpios = <6 GPIO_ACTIVE_HIGH>;
216 input;
217 line-name = "I2C XOR ready";
218 };
Jan Kundrát6406d512020-11-18 18:24:36 +0100219#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200220 };
221
Jan Kundrát51c34e12019-04-04 21:00:19 +0200222 lumentum_ocm: lumentum-ocm@3 {
Jan Kundrát463be652018-09-20 23:44:04 +0200223 compatible = "lumentum-ocm";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200224 reg = <3>;
225 spi-max-frequency = <12000000>;
226 // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master
227 // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter
Jan Kundrát130cfb92018-05-30 15:21:16 +0200228 };
229};
230
231&i2c1 {
Jan Kundrát6406d512020-11-18 18:24:36 +0100232#ifdef CLEARFOG_REV1
Jan Kundrátd5129092018-06-11 18:12:37 +0200233 eeprom@53 {
Jan Kundrát130cfb92018-05-30 15:21:16 +0200234 compatible = "atmel,24c128";
Jan Kundrátd5129092018-06-11 18:12:37 +0200235 reg = <0x53>;
Jan Kundrát130cfb92018-05-30 15:21:16 +0200236 pagesize = <64>;
Jan Kundrátd9af6aa2018-06-06 14:27:23 +0200237 // There's no read-only parameter because we want to enable flashing the EEPROM by
238 // installing a physical jumper. It doesn't matter that Linux still considers this
239 // device as writable during normal operation because any write fill fail anyway
240 // on the HW level. At least we can install that jumper and make the writes pass
241 // magically without fiddling with the DT and rebooting.
Jan Kundrát130cfb92018-05-30 15:21:16 +0200242 };
Jan Kundrát6406d512020-11-18 18:24:36 +0100243#else
244 temperature@48 {
245 compatible = "ti,tmp175";
246 reg = <0x48>;
247 };
248
249 // 24CSxx is treated as two separate devices
250 eeprom@53 {
251 compatible = "atmel,24c64";
252 reg = <0x53>;
253 };
254 eeprom@5b {
255 compatible = "atmel,24cs64";
256 reg = <0x5b>;
257 };
258#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200259
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200260 tlc59116@60 {
261 #address-cells = <1>;
262 #size-cells = <0>;
263 #gpio-cells = <2>;
264 compatible = "ti,tlc59116";
265 reg = <0x60>;
266
267 sfp_red@0 {
268 label = "sfp:red";
269 reg = <0>;
270 };
271
272 sfp_green@1 {
273 label = "sfp:green";
274 reg = <1>;
275 };
276
277 sfp_blue@2 {
278 label = "sfp:blue";
279 reg = <2>;
280 };
281
Jan Kundrát079dd672019-04-04 19:51:45 +0200282 // OUT3 remains unused
283
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200284 line_red@4 {
285 label = "line:red";
286 reg = <4>;
287 };
288
289 line_green@5 {
290 label = "line:green";
291 reg = <5>;
292 };
293
294 line_blue@6 {
295 label = "line:blue";
296 reg = <6>;
297 };
298
Jan Kundrát079dd672019-04-04 19:51:45 +0200299 led5_red@7 {
300 label = "led5:red";
301 reg = <7>;
302 };
303
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200304 status_red@8 {
305 label = "status:red";
306 reg = <8>;
307 };
308
309 status_green@9 {
310 label = "status:green";
311 reg = <9>;
312 linux,default-trigger = "timer";
313 };
314
315 status_blue@10 {
316 label = "status:blue";
317 reg = <10>;
318 };
319
Jan Kundrát079dd672019-04-04 19:51:45 +0200320 led5_green@11 {
321 label = "led5:green";
322 reg = <11>;
323 };
324
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200325 uid_red@12 {
326 label = "uid:red";
327 reg = <12>;
328 };
329
330 uid_green@13 {
331 label = "uid:green";
332 reg = <13>;
333 };
334
335 uid_blue@14 {
336 label = "uid:blue";
337 reg = <14>;
338 };
Jan Kundrát079dd672019-04-04 19:51:45 +0200339
340 led5_blue@15 {
341 label = "led5:blue";
342 reg = <15>;
343 };
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200344 };
345
Jan Kundrát6406d512020-11-18 18:24:36 +0100346#ifdef CLEARFOG_REV1
Jan Kundrát130cfb92018-05-30 15:21:16 +0200347 /* ADT7463: it doesn't use the DT */
Jan Kundrát6406d512020-11-18 18:24:36 +0100348#else
349 temperature@49 {
350 compatible = "ti,tmp175";
351 reg = <0x49>;
352 };
353
354 fancontrol@20 {
355 compatible = "maxim,max31790";
356 reg = <0x20>;
357 };
358
359 // 24CSxx is treated as two separate devices
360 eeprom@54 {
361 compatible = "atmel,24c64";
362 reg = <0x54>;
363 };
364 eeprom@5c {
365 compatible = "atmel,24cs64";
366 reg = <0x5c>;
367 };
368#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200369};