Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 1 | #include "armada-388-clearfog-base.dts" |
| 2 | |
| 3 | &w25q32 { |
| 4 | status = "okay"; |
| 5 | }; |
| 6 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 7 | #undef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 8 | #define IFACE_V_1_0 // v1.0, a first prototype |
| 9 | //#undef IFACE_V_1_0 // v1.0.1, the second iteration |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 10 | |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 11 | / { |
| 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át | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 29 | #ifdef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 30 | 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át | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 38 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 39 | |
| 40 | gpio-leds { |
| 41 | compatible = "gpio-leds"; |
| 42 | |
| 43 | ok_led { |
| 44 | label = "status-ok"; |
| 45 | linux,default-trigger = "default-on"; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 46 | #ifdef IFACE_V_1_0 |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 47 | gpios = <&max14830 9 GPIO_ACTIVE_HIGH>; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 48 | #else |
| 49 | gpios = <&max14830 8 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; |
| 50 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | fail_led { |
| 54 | label = "status-error"; |
| 55 | panic-indicator; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 56 | #ifdef IFACE_V_1_0 |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 57 | gpios = <&max14830 8 GPIO_ACTIVE_HIGH>; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 58 | #else |
| 59 | gpios = <&max14830 9 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; |
| 60 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | uid_led { |
| 64 | label = "UID"; |
| 65 | linux,default-trigger = "heartbeat"; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 66 | #ifdef IFACE_V_1_0 |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 67 | gpios = <&max14830 10 GPIO_ACTIVE_HIGH>; |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 68 | #else |
| 69 | gpios = <&max14830 10 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; |
| 70 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 71 | }; |
| 72 | }; |
| 73 | }; |
| 74 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 75 | #ifdef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 76 | &uart1_pins { |
| 77 | status = "disabled"; |
| 78 | }; |
| 79 | |
| 80 | &uart1 { |
| 81 | status = "disabled"; |
| 82 | }; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 83 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 84 | |
| 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át | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 121 | "EDFA1_AMP_DISABLE", |
| 122 | "EDFA2_AMP_DISABLE", |
| 123 | "EDFA1_OUT_POWER_MUTE", |
| 124 | "EDFA2_OUT_POWER_MUTE", |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 125 | #ifdef IFACE_V_1_0 |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 126 | "" /* not used, not routed anywhere */ |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 127 | #else |
| 128 | "EXP_GPIO1" |
| 129 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 130 | ; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 131 | |
| 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át | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame^] | 147 | #ifdef IFACE_V_1_0 |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 148 | output-high; // XOR byte 0b1101111 |
Jan Kundrát | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame^] | 149 | #else |
| 150 | output-high; // XOR byte 0b1001111 |
| 151 | #endif |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 152 | 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át | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 165 | }; |
| 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át | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 188 | #ifdef IFACE_V_1_0 |
| 189 | "ATX_TTL", |
| 190 | #else |
| 191 | "EXP_GPIO2", |
| 192 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 193 | "WSS_SC", |
| 194 | "WSS_RST", |
| 195 | "I2C_XOR_RDY", |
| 196 | "OCM_HS_OUT", |
| 197 | |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 198 | "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át | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 206 | }; |
| 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át | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 221 | "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át | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 229 | }; |
Jan Kundrát | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame^] | 230 | |
| 231 | i2c_xor_ready { |
| 232 | gpio-hog; |
| 233 | gpios = <6 GPIO_ACTIVE_HIGH>; |
| 234 | input; |
| 235 | line-name = "I2C XOR ready"; |
| 236 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 237 | }; |
| 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át | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 250 | eeprom@53 { |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 251 | compatible = "atmel,24c128"; |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 252 | reg = <0x53>; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 253 | pagesize = <64>; |
Jan Kundrát | d9af6aa | 2018-06-06 14:27:23 +0200 | [diff] [blame] | 254 | // 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át | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 259 | }; |
| 260 | |
| 261 | /* ADT7463: it doesn't use the DT */ |
| 262 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 263 | #ifndef CLEARFOG_PMBUS_BITBANG |
| 264 | /* TODO: pmbus, but that needs a disabled PEC... */ |
| 265 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 266 | }; |