blob: f510fdbbb80db2d603d198d9f8ffdefecd61c327 [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át463be652018-09-20 23:44:04 +0200192 lumentum-ocm@3 {
193 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
198 linux,spi-wdelay = /bits/ 16 <3>;
199 };
200};
201
202&i2c1 {
Jan Kundrátd5129092018-06-11 18:12:37 +0200203 eeprom@53 {
Jan Kundrát130cfb92018-05-30 15:21:16 +0200204 compatible = "atmel,24c128";
Jan Kundrátd5129092018-06-11 18:12:37 +0200205 reg = <0x53>;
Jan Kundrát130cfb92018-05-30 15:21:16 +0200206 pagesize = <64>;
Jan Kundrátd9af6aa2018-06-06 14:27:23 +0200207 // There's no read-only parameter because we want to enable flashing the EEPROM by
208 // installing a physical jumper. It doesn't matter that Linux still considers this
209 // device as writable during normal operation because any write fill fail anyway
210 // on the HW level. At least we can install that jumper and make the writes pass
211 // magically without fiddling with the DT and rebooting.
Jan Kundrát130cfb92018-05-30 15:21:16 +0200212 };
213
Jan Kundrát8f3357f2018-08-08 14:16:32 +0200214 tlc59116@60 {
215 #address-cells = <1>;
216 #size-cells = <0>;
217 #gpio-cells = <2>;
218 compatible = "ti,tlc59116";
219 reg = <0x60>;
220
221 sfp_red@0 {
222 label = "sfp:red";
223 reg = <0>;
224 };
225
226 sfp_green@1 {
227 label = "sfp:green";
228 reg = <1>;
229 };
230
231 sfp_blue@2 {
232 label = "sfp:blue";
233 reg = <2>;
234 };
235
236 line_red@4 {
237 label = "line:red";
238 reg = <4>;
239 };
240
241 line_green@5 {
242 label = "line:green";
243 reg = <5>;
244 };
245
246 line_blue@6 {
247 label = "line:blue";
248 reg = <6>;
249 };
250
251 status_red@8 {
252 label = "status:red";
253 reg = <8>;
254 };
255
256 status_green@9 {
257 label = "status:green";
258 reg = <9>;
259 linux,default-trigger = "timer";
260 };
261
262 status_blue@10 {
263 label = "status:blue";
264 reg = <10>;
265 };
266
267 uid_red@12 {
268 label = "uid:red";
269 reg = <12>;
270 };
271
272 uid_green@13 {
273 label = "uid:green";
274 reg = <13>;
275 };
276
277 uid_blue@14 {
278 label = "uid:blue";
279 reg = <14>;
280 };
281 };
282
Jan Kundrát130cfb92018-05-30 15:21:16 +0200283 /* ADT7463: it doesn't use the DT */
Jan Kundrát130cfb92018-05-30 15:21:16 +0200284};