blob: 04d5b382464fab8204dbe639a399420caaa0ca3a [file] [log] [blame]
Jan Kundrát130cfb92018-05-30 15:21:16 +02001#include "armada-388-clearfog-base.dts"
2
3&w25q32 {
4 status = "okay";
5};
6
Jan Kundrát5d9ddb82018-09-05 16:06:49 +02007#define CLEARFOG_PMBUS_BITBANG
Jan Kundrátd014bb92018-06-08 21:35:21 +02008
Jan Kundrát130cfb92018-05-30 15:21:16 +02009/ {
10 clocks {
11 spi_uart_clk: osc_max14830 {
12 compatible = "fixed-clock";
13 #clock-cells = <0>;
14 clock-frequency = <3686400>;
15 };
16 };
17
18 soc {
19 internal-regs {
20 sdhci@d8000 {
21 /delete-property/ cd-gpios;
22 broken-cd;
23 };
24 };
25 };
26
Jan Kundrátd014bb92018-06-08 21:35:21 +020027#ifdef CLEARFOG_PMBUS_BITBANG
Jan Kundrát130cfb92018-05-30 15:21:16 +020028 gpio_i2c {
29 compatible = "i2c-gpio";
30 sda-gpios = <&gpio0 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
31 scl-gpios = <&gpio0 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
32 i2c-gpio.delay-us = <1>;
33 #address-cells = <1>;
34 #size-cells = <0>;
35 };
Jan Kundrátd014bb92018-06-08 21:35:21 +020036#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020037};
38
Jan Kundrátd014bb92018-06-08 21:35:21 +020039#ifdef CLEARFOG_PMBUS_BITBANG
Jan Kundrát130cfb92018-05-30 15:21:16 +020040&uart1_pins {
41 status = "disabled";
42};
43
44&uart1 {
45 status = "disabled";
46};
Jan Kundrátd014bb92018-06-08 21:35:21 +020047#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020048
49&gpio1 {
50 spi_int {
51 /* MPP54: this needs an external pull-up */
52 gpio-hog;
53 gpios = <22 GPIO_ACTIVE_HIGH>;
54 input;
55 line-name = "SPI-INT";
56 };
57};
58
59&spi1 {
60 cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>;
61
62 max14830: max14830@2 {
63 compatible = "maxim,max14830";
64 reg = <2>;
65 clocks = <&spi_uart_clk>;
66 clock-names = "xtal";
67 interrupt-parent = <&gpio1>;
68 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
69 gpio-controller;
70 #gpio-cells = <2>;
71 spi-max-frequency = <26000000>;
72
73 gpio-line-names =
74 "WSS_HWRST",
75 "WSS_SSD",
76 "OCM_HS_IN",
77 "OCM_RESET",
78 "WSS_MRST",
79 "I2C_XOR_ENABLE",
80 "I2C_XORH",
81 "I2C_BB_ENABLE",
Jan Kundrát8f3357f2018-08-08 14:16:32 +020082 "GPIO_K6",
83 "",
84 "",
Jan Kundrátdb943222018-06-19 20:51:30 +020085 "EDFA1_AMP_DISABLE",
86 "EDFA2_AMP_DISABLE",
87 "EDFA1_OUT_POWER_MUTE",
88 "EDFA2_OUT_POWER_MUTE",
Jan Kundrát93d79222018-06-19 20:45:35 +020089 "EXP_GPIO1"
Jan Kundrát130cfb92018-05-30 15:21:16 +020090 ;
Jan Kundrátd014bb92018-06-08 21:35:21 +020091
92 i2c_bitbang_enable {
93 gpio-hog;
94 gpios = <7 GPIO_ACTIVE_HIGH>;
95#ifdef CLEARFOG_PMBUS_BITBANG
96 output-high;
97#else
98 output-low;
99#endif
100 line-name = "I2C bitbang bus";
101 };
102
103 i2c_xor_high {
104 gpio-hog;
105 gpios = <6 GPIO_ACTIVE_HIGH>;
106 //output-low; // XOR byte 0b0001111
Jan Kundrát1e866c62018-07-04 19:54:30 +0200107 output-high; // XOR byte 0b1001111
Jan Kundrátd014bb92018-06-08 21:35:21 +0200108 line-name = "I2C XOR high";
109 };
110
111 i2c_xor_enable {
112 gpio-hog;
113 gpios = <5 GPIO_ACTIVE_HIGH>;
114#ifdef CLEARFOG_PMBUS_BITBANG
115 output-low;
116#else
117 output-high;
118#endif
119 line-name = "I2C addr xlate";
120 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200121 };
122
123 gpio_spi_chips: gpio@1 {
124 compatible = "microchip,mcp23s17";
125 reg = <1>;
126 interrupt-parent = <&gpio1>;
127 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
128 interrupt-controller;
129 #interrupt-cells = <2>;
130 gpio-controller;
131 #gpio-cells = <2>;
132 microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */
133 microchip,irq-mirror;
134 drive-open-drain;
135 spi-max-frequency = <10000000>;
136
137 // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips
138 gpio-bank@1 {
139 address = <1>;
140 gpio-line-names =
141 "EDFA1_RESET",
142 "EDFA2_RESET",
143 "PMB_ALERT",
Jan Kundrát93d79222018-06-19 20:45:35 +0200144 "EXP_GPIO2",
Jan Kundrát130cfb92018-05-30 15:21:16 +0200145 "WSS_SC",
146 "WSS_RST",
147 "I2C_XOR_RDY",
148 "OCM_HS_OUT",
149
Jan Kundrátdb943222018-06-19 20:51:30 +0200150 "EDFA1_OUT_REFLECT_A",
151 "EDFA1_PUMP_CURRENT_A",
152 "EDFA1_ST1_IN_LOS_A",
153 "EDFA1_ST2_IN_LOS_A",
154 "EDFA1_ST2_OUT_GAIN_A",
155 "EDFA1_CASE_TEMP_A",
156 "EDFA1_ST1_OUT_GAIN_A",
157 "EDFA1_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200158 };
159
160 gpio-bank@2 {
161 address = <2>;
162 gpio-line-names =
163 /* these are all grounded */
164 "GND",
165 "GND",
166 "GND",
167 "GND",
168 "GND",
169 "GND",
170 "GND",
171 "GND",
172
Jan Kundrátdb943222018-06-19 20:51:30 +0200173 "EDFA2_OUT_REFLECT_A",
174 "EDFA2_PUMP_CURRENT_A",
175 "EDFA2_ST1_IN_LOS_A",
176 "EDFA2_ST2_IN_LOS_A",
177 "EDFA2_ST2_OUT_GAIN_A",
178 "EDFA2_CASE_TEMP_A",
179 "EDFA2_ST1_OUT_GAIN_A",
180 "EDFA2_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200181 };
Jan Kundrát1e866c62018-07-04 19:54:30 +0200182
Jan Kundrát6eb5a022018-08-20 14:55:33 +0200183 // FIXME: this hogs both .1 and .2 chips' #6 pin...
Jan Kundrát1e866c62018-07-04 19:54:30 +0200184 i2c_xor_ready {
185 gpio-hog;
186 gpios = <6 GPIO_ACTIVE_HIGH>;
187 input;
188 line-name = "I2C XOR ready";
189 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200190 };
191
Jan Kundrát51c34e12019-04-04 21:00:19 +0200192 lumentum_ocm: lumentum-ocm@3 {
Jan Kundrát463be652018-09-20 23:44:04 +0200193 compatible = "lumentum-ocm";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200194 reg = <3>;
195 spi-max-frequency = <12000000>;
196 // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master
197 // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter
Jan Kundrát130cfb92018-05-30 15:21:16 +0200198 };
199};
200
201&i2c1 {
Jan Kundrátd5129092018-06-11 18:12:37 +0200202 eeprom@53 {
Jan Kundrát130cfb92018-05-30 15:21:16 +0200203 compatible = "atmel,24c128";
Jan Kundrátd5129092018-06-11 18:12:37 +0200204 reg = <0x53>;
Jan Kundrát130cfb92018-05-30 15:21:16 +0200205 pagesize = <64>;
Jan Kundrátd9af6aa2018-06-06 14:27:23 +0200206 // There's no read-only parameter because we want to enable flashing the EEPROM by
207 // installing a physical jumper. It doesn't matter that Linux still considers this
208 // device as writable during normal operation because any write fill fail anyway
209 // on the HW level. At least we can install that jumper and make the writes pass
210 // magically without fiddling with the DT and rebooting.
Jan Kundrát130cfb92018-05-30 15:21:16 +0200211 };
212
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200213 tlc59116@60 {
214 #address-cells = <1>;
215 #size-cells = <0>;
216 #gpio-cells = <2>;
217 compatible = "ti,tlc59116";
218 reg = <0x60>;
219
220 sfp_red@0 {
221 label = "sfp:red";
222 reg = <0>;
223 };
224
225 sfp_green@1 {
226 label = "sfp:green";
227 reg = <1>;
228 };
229
230 sfp_blue@2 {
231 label = "sfp:blue";
232 reg = <2>;
233 };
234
Jan Kundrát079dd672019-04-04 19:51:45 +0200235 // OUT3 remains unused
236
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200237 line_red@4 {
238 label = "line:red";
239 reg = <4>;
240 };
241
242 line_green@5 {
243 label = "line:green";
244 reg = <5>;
245 };
246
247 line_blue@6 {
248 label = "line:blue";
249 reg = <6>;
250 };
251
Jan Kundrát079dd672019-04-04 19:51:45 +0200252 led5_red@7 {
253 label = "led5:red";
254 reg = <7>;
255 };
256
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200257 status_red@8 {
258 label = "status:red";
259 reg = <8>;
260 };
261
262 status_green@9 {
263 label = "status:green";
264 reg = <9>;
265 linux,default-trigger = "timer";
266 };
267
268 status_blue@10 {
269 label = "status:blue";
270 reg = <10>;
271 };
272
Jan Kundrát079dd672019-04-04 19:51:45 +0200273 led5_green@11 {
274 label = "led5:green";
275 reg = <11>;
276 };
277
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200278 uid_red@12 {
279 label = "uid:red";
280 reg = <12>;
281 };
282
283 uid_green@13 {
284 label = "uid:green";
285 reg = <13>;
286 };
287
288 uid_blue@14 {
289 label = "uid:blue";
290 reg = <14>;
291 };
Jan Kundrát079dd672019-04-04 19:51:45 +0200292
293 led5_blue@15 {
294 label = "led5:blue";
295 reg = <15>;
296 };
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200297 };
298
Jan Kundrát130cfb92018-05-30 15:21:16 +0200299 /* ADT7463: it doesn't use the DT */
Jan Kundrát130cfb92018-05-30 15:21:16 +0200300};