blob: b2b6c57a2419f89b765b1b3ae675b712a4485a1e [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átd014bb92018-06-08 21:35:21 +02007#undef CLEARFOG_PMBUS_BITBANG
Jan Kundrát93d79222018-06-19 20:45:35 +02008#define IFACE_V_1_0 // v1.0, a first prototype
9//#undef IFACE_V_1_0 // v1.0.1, the second iteration
Jan Kundrátd014bb92018-06-08 21:35:21 +020010
Jan Kundrát130cfb92018-05-30 15:21:16 +020011/ {
12 clocks {
13 spi_uart_clk: osc_max14830 {
14 compatible = "fixed-clock";
15 #clock-cells = <0>;
16 clock-frequency = <3686400>;
17 };
18 };
19
20 soc {
21 internal-regs {
22 sdhci@d8000 {
23 /delete-property/ cd-gpios;
24 broken-cd;
25 };
26 };
27 };
28
Jan Kundrátd014bb92018-06-08 21:35:21 +020029#ifdef CLEARFOG_PMBUS_BITBANG
Jan Kundrát130cfb92018-05-30 15:21:16 +020030 gpio_i2c {
31 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>;
37 };
Jan Kundrátd014bb92018-06-08 21:35:21 +020038#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020039
40 gpio-leds {
41 compatible = "gpio-leds";
42
43 ok_led {
44 label = "status-ok";
Jan Kundrát713b2c12018-07-04 20:30:11 +020045 linux,default-trigger = "timer";
Jan Kundrát93d79222018-06-19 20:45:35 +020046#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +020047 gpios = <&max14830 9 GPIO_ACTIVE_HIGH>;
Jan Kundrát93d79222018-06-19 20:45:35 +020048#else
49 gpios = <&max14830 8 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
50#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020051 };
52
53 fail_led {
54 label = "status-error";
Jan Kundrát93d79222018-06-19 20:45:35 +020055#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +020056 gpios = <&max14830 8 GPIO_ACTIVE_HIGH>;
Jan Kundrát93d79222018-06-19 20:45:35 +020057#else
58 gpios = <&max14830 9 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
59#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020060 };
61
62 uid_led {
63 label = "UID";
Jan Kundrát93d79222018-06-19 20:45:35 +020064#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +020065 gpios = <&max14830 10 GPIO_ACTIVE_HIGH>;
Jan Kundrát93d79222018-06-19 20:45:35 +020066#else
67 gpios = <&max14830 10 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
68#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020069 };
70 };
71};
72
Jan Kundrátd014bb92018-06-08 21:35:21 +020073#ifdef CLEARFOG_PMBUS_BITBANG
Jan Kundrát130cfb92018-05-30 15:21:16 +020074&uart1_pins {
75 status = "disabled";
76};
77
78&uart1 {
79 status = "disabled";
80};
Jan Kundrátd014bb92018-06-08 21:35:21 +020081#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020082
83&gpio1 {
84 spi_int {
85 /* MPP54: this needs an external pull-up */
86 gpio-hog;
87 gpios = <22 GPIO_ACTIVE_HIGH>;
88 input;
89 line-name = "SPI-INT";
90 };
91};
92
93&spi1 {
94 cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>;
95
96 max14830: max14830@2 {
97 compatible = "maxim,max14830";
98 reg = <2>;
99 clocks = <&spi_uart_clk>;
100 clock-names = "xtal";
101 interrupt-parent = <&gpio1>;
102 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
103 gpio-controller;
104 #gpio-cells = <2>;
105 spi-max-frequency = <26000000>;
106
107 gpio-line-names =
108 "WSS_HWRST",
109 "WSS_SSD",
110 "OCM_HS_IN",
111 "OCM_RESET",
112 "WSS_MRST",
113 "I2C_XOR_ENABLE",
114 "I2C_XORH",
115 "I2C_BB_ENABLE",
116 "LED_RED",
117 "LED_GREEN",
118 "LED_BLUE",
Jan Kundrátdb943222018-06-19 20:51:30 +0200119 "EDFA1_AMP_DISABLE",
120 "EDFA2_AMP_DISABLE",
121 "EDFA1_OUT_POWER_MUTE",
122 "EDFA2_OUT_POWER_MUTE",
Jan Kundrát93d79222018-06-19 20:45:35 +0200123#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +0200124 "" /* not used, not routed anywhere */
Jan Kundrát93d79222018-06-19 20:45:35 +0200125#else
126 "EXP_GPIO1"
127#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200128 ;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200129
130 i2c_bitbang_enable {
131 gpio-hog;
132 gpios = <7 GPIO_ACTIVE_HIGH>;
133#ifdef CLEARFOG_PMBUS_BITBANG
134 output-high;
135#else
136 output-low;
137#endif
138 line-name = "I2C bitbang bus";
139 };
140
141 i2c_xor_high {
142 gpio-hog;
143 gpios = <6 GPIO_ACTIVE_HIGH>;
144 //output-low; // XOR byte 0b0001111
Jan Kundrát1e866c62018-07-04 19:54:30 +0200145#ifdef IFACE_V_1_0
Jan Kundrátd014bb92018-06-08 21:35:21 +0200146 output-high; // XOR byte 0b1101111
Jan Kundrát1e866c62018-07-04 19:54:30 +0200147#else
148 output-high; // XOR byte 0b1001111
149#endif
Jan Kundrátd014bb92018-06-08 21:35:21 +0200150 line-name = "I2C XOR high";
151 };
152
153 i2c_xor_enable {
154 gpio-hog;
155 gpios = <5 GPIO_ACTIVE_HIGH>;
156#ifdef CLEARFOG_PMBUS_BITBANG
157 output-low;
158#else
159 output-high;
160#endif
161 line-name = "I2C addr xlate";
162 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200163 };
164
165 gpio_spi_chips: gpio@1 {
166 compatible = "microchip,mcp23s17";
167 reg = <1>;
168 interrupt-parent = <&gpio1>;
169 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
170 interrupt-controller;
171 #interrupt-cells = <2>;
172 gpio-controller;
173 #gpio-cells = <2>;
174 microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */
175 microchip,irq-mirror;
176 drive-open-drain;
177 spi-max-frequency = <10000000>;
178
179 // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips
180 gpio-bank@1 {
181 address = <1>;
182 gpio-line-names =
183 "EDFA1_RESET",
184 "EDFA2_RESET",
185 "PMB_ALERT",
Jan Kundrát93d79222018-06-19 20:45:35 +0200186#ifdef IFACE_V_1_0
187 "ATX_TTL",
188#else
189 "EXP_GPIO2",
190#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200191 "WSS_SC",
192 "WSS_RST",
193 "I2C_XOR_RDY",
194 "OCM_HS_OUT",
195
Jan Kundrátdb943222018-06-19 20:51:30 +0200196 "EDFA1_OUT_REFLECT_A",
197 "EDFA1_PUMP_CURRENT_A",
198 "EDFA1_ST1_IN_LOS_A",
199 "EDFA1_ST2_IN_LOS_A",
200 "EDFA1_ST2_OUT_GAIN_A",
201 "EDFA1_CASE_TEMP_A",
202 "EDFA1_ST1_OUT_GAIN_A",
203 "EDFA1_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200204 };
205
206 gpio-bank@2 {
207 address = <2>;
208 gpio-line-names =
209 /* these are all grounded */
210 "GND",
211 "GND",
212 "GND",
213 "GND",
214 "GND",
215 "GND",
216 "GND",
217 "GND",
218
Jan Kundrátdb943222018-06-19 20:51:30 +0200219 "EDFA2_OUT_REFLECT_A",
220 "EDFA2_PUMP_CURRENT_A",
221 "EDFA2_ST1_IN_LOS_A",
222 "EDFA2_ST2_IN_LOS_A",
223 "EDFA2_ST2_OUT_GAIN_A",
224 "EDFA2_CASE_TEMP_A",
225 "EDFA2_ST1_OUT_GAIN_A",
226 "EDFA2_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200227 };
Jan Kundrát1e866c62018-07-04 19:54:30 +0200228
229 i2c_xor_ready {
230 gpio-hog;
231 gpios = <6 GPIO_ACTIVE_HIGH>;
232 input;
233 line-name = "I2C XOR ready";
234 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200235 };
236
237 spidev@3 {
238 compatible = "spidev";
239 reg = <3>;
240 spi-max-frequency = <12000000>;
241 // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master
242 // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter
243 linux,spi-wdelay = /bits/ 16 <3>;
244 };
245};
246
247&i2c1 {
Jan Kundrátd5129092018-06-11 18:12:37 +0200248 eeprom@53 {
Jan Kundrát130cfb92018-05-30 15:21:16 +0200249 compatible = "atmel,24c128";
Jan Kundrátd5129092018-06-11 18:12:37 +0200250 reg = <0x53>;
Jan Kundrát130cfb92018-05-30 15:21:16 +0200251 pagesize = <64>;
Jan Kundrátd9af6aa2018-06-06 14:27:23 +0200252 // There's no read-only parameter because we want to enable flashing the EEPROM by
253 // installing a physical jumper. It doesn't matter that Linux still considers this
254 // device as writable during normal operation because any write fill fail anyway
255 // on the HW level. At least we can install that jumper and make the writes pass
256 // magically without fiddling with the DT and rebooting.
Jan Kundrát130cfb92018-05-30 15:21:16 +0200257 };
258
259 /* ADT7463: it doesn't use the DT */
260
Jan Kundrátd014bb92018-06-08 21:35:21 +0200261#ifndef CLEARFOG_PMBUS_BITBANG
262 /* TODO: pmbus, but that needs a disabled PEC... */
263#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200264};