blob: 66bd34057de08e76cc29ba123b7ddd2b2f9c4cda [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";
45 linux,default-trigger = "default-on";
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";
55 panic-indicator;
Jan Kundrát93d79222018-06-19 20:45:35 +020056#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +020057 gpios = <&max14830 8 GPIO_ACTIVE_HIGH>;
Jan Kundrát93d79222018-06-19 20:45:35 +020058#else
59 gpios = <&max14830 9 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
60#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020061 };
62
63 uid_led {
64 label = "UID";
65 linux,default-trigger = "heartbeat";
Jan Kundrát93d79222018-06-19 20:45:35 +020066#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +020067 gpios = <&max14830 10 GPIO_ACTIVE_HIGH>;
Jan Kundrát93d79222018-06-19 20:45:35 +020068#else
69 gpios = <&max14830 10 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
70#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020071 };
72 };
73};
74
Jan Kundrátd014bb92018-06-08 21:35:21 +020075#ifdef CLEARFOG_PMBUS_BITBANG
Jan Kundrát130cfb92018-05-30 15:21:16 +020076&uart1_pins {
77 status = "disabled";
78};
79
80&uart1 {
81 status = "disabled";
82};
Jan Kundrátd014bb92018-06-08 21:35:21 +020083#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +020084
85&gpio1 {
86 spi_int {
87 /* MPP54: this needs an external pull-up */
88 gpio-hog;
89 gpios = <22 GPIO_ACTIVE_HIGH>;
90 input;
91 line-name = "SPI-INT";
92 };
93};
94
95&spi1 {
96 cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>;
97
98 max14830: max14830@2 {
99 compatible = "maxim,max14830";
100 reg = <2>;
101 clocks = <&spi_uart_clk>;
102 clock-names = "xtal";
103 interrupt-parent = <&gpio1>;
104 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
105 gpio-controller;
106 #gpio-cells = <2>;
107 spi-max-frequency = <26000000>;
108
109 gpio-line-names =
110 "WSS_HWRST",
111 "WSS_SSD",
112 "OCM_HS_IN",
113 "OCM_RESET",
114 "WSS_MRST",
115 "I2C_XOR_ENABLE",
116 "I2C_XORH",
117 "I2C_BB_ENABLE",
118 "LED_RED",
119 "LED_GREEN",
120 "LED_BLUE",
Jan Kundrátdb943222018-06-19 20:51:30 +0200121 "EDFA1_AMP_DISABLE",
122 "EDFA2_AMP_DISABLE",
123 "EDFA1_OUT_POWER_MUTE",
124 "EDFA2_OUT_POWER_MUTE",
Jan Kundrát93d79222018-06-19 20:45:35 +0200125#ifdef IFACE_V_1_0
Jan Kundrát130cfb92018-05-30 15:21:16 +0200126 "" /* not used, not routed anywhere */
Jan Kundrát93d79222018-06-19 20:45:35 +0200127#else
128 "EXP_GPIO1"
129#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200130 ;
Jan Kundrátd014bb92018-06-08 21:35:21 +0200131
132 i2c_bitbang_enable {
133 gpio-hog;
134 gpios = <7 GPIO_ACTIVE_HIGH>;
135#ifdef CLEARFOG_PMBUS_BITBANG
136 output-high;
137#else
138 output-low;
139#endif
140 line-name = "I2C bitbang bus";
141 };
142
143 i2c_xor_high {
144 gpio-hog;
145 gpios = <6 GPIO_ACTIVE_HIGH>;
146 //output-low; // XOR byte 0b0001111
Jan Kundrát1e866c62018-07-04 19:54:30 +0200147#ifdef IFACE_V_1_0
Jan Kundrátd014bb92018-06-08 21:35:21 +0200148 output-high; // XOR byte 0b1101111
Jan Kundrát1e866c62018-07-04 19:54:30 +0200149#else
150 output-high; // XOR byte 0b1001111
151#endif
Jan Kundrátd014bb92018-06-08 21:35:21 +0200152 line-name = "I2C XOR high";
153 };
154
155 i2c_xor_enable {
156 gpio-hog;
157 gpios = <5 GPIO_ACTIVE_HIGH>;
158#ifdef CLEARFOG_PMBUS_BITBANG
159 output-low;
160#else
161 output-high;
162#endif
163 line-name = "I2C addr xlate";
164 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200165 };
166
167 gpio_spi_chips: gpio@1 {
168 compatible = "microchip,mcp23s17";
169 reg = <1>;
170 interrupt-parent = <&gpio1>;
171 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
172 interrupt-controller;
173 #interrupt-cells = <2>;
174 gpio-controller;
175 #gpio-cells = <2>;
176 microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */
177 microchip,irq-mirror;
178 drive-open-drain;
179 spi-max-frequency = <10000000>;
180
181 // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips
182 gpio-bank@1 {
183 address = <1>;
184 gpio-line-names =
185 "EDFA1_RESET",
186 "EDFA2_RESET",
187 "PMB_ALERT",
Jan Kundrát93d79222018-06-19 20:45:35 +0200188#ifdef IFACE_V_1_0
189 "ATX_TTL",
190#else
191 "EXP_GPIO2",
192#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200193 "WSS_SC",
194 "WSS_RST",
195 "I2C_XOR_RDY",
196 "OCM_HS_OUT",
197
Jan Kundrátdb943222018-06-19 20:51:30 +0200198 "EDFA1_OUT_REFLECT_A",
199 "EDFA1_PUMP_CURRENT_A",
200 "EDFA1_ST1_IN_LOS_A",
201 "EDFA1_ST2_IN_LOS_A",
202 "EDFA1_ST2_OUT_GAIN_A",
203 "EDFA1_CASE_TEMP_A",
204 "EDFA1_ST1_OUT_GAIN_A",
205 "EDFA1_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200206 };
207
208 gpio-bank@2 {
209 address = <2>;
210 gpio-line-names =
211 /* these are all grounded */
212 "GND",
213 "GND",
214 "GND",
215 "GND",
216 "GND",
217 "GND",
218 "GND",
219 "GND",
220
Jan Kundrátdb943222018-06-19 20:51:30 +0200221 "EDFA2_OUT_REFLECT_A",
222 "EDFA2_PUMP_CURRENT_A",
223 "EDFA2_ST1_IN_LOS_A",
224 "EDFA2_ST2_IN_LOS_A",
225 "EDFA2_ST2_OUT_GAIN_A",
226 "EDFA2_CASE_TEMP_A",
227 "EDFA2_ST1_OUT_GAIN_A",
228 "EDFA2_PUMP_TEMP_A";
Jan Kundrát130cfb92018-05-30 15:21:16 +0200229 };
Jan Kundrát1e866c62018-07-04 19:54:30 +0200230
231 i2c_xor_ready {
232 gpio-hog;
233 gpios = <6 GPIO_ACTIVE_HIGH>;
234 input;
235 line-name = "I2C XOR ready";
236 };
Jan Kundrát130cfb92018-05-30 15:21:16 +0200237 };
238
239 spidev@3 {
240 compatible = "spidev";
241 reg = <3>;
242 spi-max-frequency = <12000000>;
243 // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master
244 // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter
245 linux,spi-wdelay = /bits/ 16 <3>;
246 };
247};
248
249&i2c1 {
Jan Kundrátd5129092018-06-11 18:12:37 +0200250 eeprom@53 {
Jan Kundrát130cfb92018-05-30 15:21:16 +0200251 compatible = "atmel,24c128";
Jan Kundrátd5129092018-06-11 18:12:37 +0200252 reg = <0x53>;
Jan Kundrát130cfb92018-05-30 15:21:16 +0200253 pagesize = <64>;
Jan Kundrátd9af6aa2018-06-06 14:27:23 +0200254 // There's no read-only parameter because we want to enable flashing the EEPROM by
255 // installing a physical jumper. It doesn't matter that Linux still considers this
256 // device as writable during normal operation because any write fill fail anyway
257 // on the HW level. At least we can install that jumper and make the writes pass
258 // magically without fiddling with the DT and rebooting.
Jan Kundrát130cfb92018-05-30 15:21:16 +0200259 };
260
261 /* ADT7463: it doesn't use the DT */
262
Jan Kundrátd014bb92018-06-08 21:35:21 +0200263#ifndef CLEARFOG_PMBUS_BITBANG
264 /* TODO: pmbus, but that needs a disabled PEC... */
265#endif
Jan Kundrát130cfb92018-05-30 15:21:16 +0200266};