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 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 41 | #ifdef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 42 | &uart1_pins { |
| 43 | status = "disabled"; |
| 44 | }; |
| 45 | |
| 46 | &uart1 { |
| 47 | status = "disabled"; |
| 48 | }; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 49 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 50 | |
| 51 | &gpio1 { |
| 52 | spi_int { |
| 53 | /* MPP54: this needs an external pull-up */ |
| 54 | gpio-hog; |
| 55 | gpios = <22 GPIO_ACTIVE_HIGH>; |
| 56 | input; |
| 57 | line-name = "SPI-INT"; |
| 58 | }; |
| 59 | }; |
| 60 | |
| 61 | &spi1 { |
| 62 | cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>; |
| 63 | |
| 64 | max14830: max14830@2 { |
| 65 | compatible = "maxim,max14830"; |
| 66 | reg = <2>; |
| 67 | clocks = <&spi_uart_clk>; |
| 68 | clock-names = "xtal"; |
| 69 | interrupt-parent = <&gpio1>; |
| 70 | interrupts = <22 IRQ_TYPE_LEVEL_LOW>; |
| 71 | gpio-controller; |
| 72 | #gpio-cells = <2>; |
| 73 | spi-max-frequency = <26000000>; |
| 74 | |
| 75 | gpio-line-names = |
| 76 | "WSS_HWRST", |
| 77 | "WSS_SSD", |
| 78 | "OCM_HS_IN", |
| 79 | "OCM_RESET", |
| 80 | "WSS_MRST", |
| 81 | "I2C_XOR_ENABLE", |
| 82 | "I2C_XORH", |
| 83 | "I2C_BB_ENABLE", |
Jan Kundrát | 8f3357f | 2018-08-08 14:16:32 +0200 | [diff] [blame] | 84 | "GPIO_K6", |
| 85 | "", |
| 86 | "", |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 87 | "EDFA1_AMP_DISABLE", |
| 88 | "EDFA2_AMP_DISABLE", |
| 89 | "EDFA1_OUT_POWER_MUTE", |
| 90 | "EDFA2_OUT_POWER_MUTE", |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 91 | "EXP_GPIO1" |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 92 | ; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 93 | |
| 94 | i2c_bitbang_enable { |
| 95 | gpio-hog; |
| 96 | gpios = <7 GPIO_ACTIVE_HIGH>; |
| 97 | #ifdef CLEARFOG_PMBUS_BITBANG |
| 98 | output-high; |
| 99 | #else |
| 100 | output-low; |
| 101 | #endif |
| 102 | line-name = "I2C bitbang bus"; |
| 103 | }; |
| 104 | |
| 105 | i2c_xor_high { |
| 106 | gpio-hog; |
| 107 | gpios = <6 GPIO_ACTIVE_HIGH>; |
| 108 | //output-low; // XOR byte 0b0001111 |
Jan Kundrát | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame] | 109 | output-high; // XOR byte 0b1001111 |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 110 | line-name = "I2C XOR high"; |
| 111 | }; |
| 112 | |
| 113 | i2c_xor_enable { |
| 114 | gpio-hog; |
| 115 | gpios = <5 GPIO_ACTIVE_HIGH>; |
| 116 | #ifdef CLEARFOG_PMBUS_BITBANG |
| 117 | output-low; |
| 118 | #else |
| 119 | output-high; |
| 120 | #endif |
| 121 | line-name = "I2C addr xlate"; |
| 122 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | gpio_spi_chips: gpio@1 { |
| 126 | compatible = "microchip,mcp23s17"; |
| 127 | reg = <1>; |
| 128 | interrupt-parent = <&gpio1>; |
| 129 | interrupts = <22 IRQ_TYPE_LEVEL_LOW>; |
| 130 | interrupt-controller; |
| 131 | #interrupt-cells = <2>; |
| 132 | gpio-controller; |
| 133 | #gpio-cells = <2>; |
| 134 | microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */ |
| 135 | microchip,irq-mirror; |
| 136 | drive-open-drain; |
| 137 | spi-max-frequency = <10000000>; |
| 138 | |
| 139 | // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips |
| 140 | gpio-bank@1 { |
| 141 | address = <1>; |
| 142 | gpio-line-names = |
| 143 | "EDFA1_RESET", |
| 144 | "EDFA2_RESET", |
| 145 | "PMB_ALERT", |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 146 | "EXP_GPIO2", |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 147 | "WSS_SC", |
| 148 | "WSS_RST", |
| 149 | "I2C_XOR_RDY", |
| 150 | "OCM_HS_OUT", |
| 151 | |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 152 | "EDFA1_OUT_REFLECT_A", |
| 153 | "EDFA1_PUMP_CURRENT_A", |
| 154 | "EDFA1_ST1_IN_LOS_A", |
| 155 | "EDFA1_ST2_IN_LOS_A", |
| 156 | "EDFA1_ST2_OUT_GAIN_A", |
| 157 | "EDFA1_CASE_TEMP_A", |
| 158 | "EDFA1_ST1_OUT_GAIN_A", |
| 159 | "EDFA1_PUMP_TEMP_A"; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 160 | }; |
| 161 | |
| 162 | gpio-bank@2 { |
| 163 | address = <2>; |
| 164 | gpio-line-names = |
| 165 | /* these are all grounded */ |
| 166 | "GND", |
| 167 | "GND", |
| 168 | "GND", |
| 169 | "GND", |
| 170 | "GND", |
| 171 | "GND", |
| 172 | "GND", |
| 173 | "GND", |
| 174 | |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame] | 175 | "EDFA2_OUT_REFLECT_A", |
| 176 | "EDFA2_PUMP_CURRENT_A", |
| 177 | "EDFA2_ST1_IN_LOS_A", |
| 178 | "EDFA2_ST2_IN_LOS_A", |
| 179 | "EDFA2_ST2_OUT_GAIN_A", |
| 180 | "EDFA2_CASE_TEMP_A", |
| 181 | "EDFA2_ST1_OUT_GAIN_A", |
| 182 | "EDFA2_PUMP_TEMP_A"; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 183 | }; |
Jan Kundrát | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame] | 184 | |
| 185 | i2c_xor_ready { |
| 186 | gpio-hog; |
| 187 | gpios = <6 GPIO_ACTIVE_HIGH>; |
| 188 | input; |
| 189 | line-name = "I2C XOR ready"; |
| 190 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 191 | }; |
| 192 | |
| 193 | spidev@3 { |
| 194 | compatible = "spidev"; |
| 195 | reg = <3>; |
| 196 | spi-max-frequency = <12000000>; |
| 197 | // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master |
| 198 | // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter |
| 199 | linux,spi-wdelay = /bits/ 16 <3>; |
| 200 | }; |
| 201 | }; |
| 202 | |
| 203 | &i2c1 { |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 204 | eeprom@53 { |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 205 | compatible = "atmel,24c128"; |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 206 | reg = <0x53>; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 207 | pagesize = <64>; |
Jan Kundrát | d9af6aa | 2018-06-06 14:27:23 +0200 | [diff] [blame] | 208 | // There's no read-only parameter because we want to enable flashing the EEPROM by |
| 209 | // installing a physical jumper. It doesn't matter that Linux still considers this |
| 210 | // device as writable during normal operation because any write fill fail anyway |
| 211 | // on the HW level. At least we can install that jumper and make the writes pass |
| 212 | // magically without fiddling with the DT and rebooting. |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 213 | }; |
| 214 | |
Jan Kundrát | 8f3357f | 2018-08-08 14:16:32 +0200 | [diff] [blame] | 215 | tlc59116@60 { |
| 216 | #address-cells = <1>; |
| 217 | #size-cells = <0>; |
| 218 | #gpio-cells = <2>; |
| 219 | compatible = "ti,tlc59116"; |
| 220 | reg = <0x60>; |
| 221 | |
| 222 | sfp_red@0 { |
| 223 | label = "sfp:red"; |
| 224 | reg = <0>; |
| 225 | }; |
| 226 | |
| 227 | sfp_green@1 { |
| 228 | label = "sfp:green"; |
| 229 | reg = <1>; |
| 230 | }; |
| 231 | |
| 232 | sfp_blue@2 { |
| 233 | label = "sfp:blue"; |
| 234 | reg = <2>; |
| 235 | }; |
| 236 | |
| 237 | 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 | |
| 252 | status_red@8 { |
| 253 | label = "status:red"; |
| 254 | reg = <8>; |
| 255 | }; |
| 256 | |
| 257 | status_green@9 { |
| 258 | label = "status:green"; |
| 259 | reg = <9>; |
| 260 | linux,default-trigger = "timer"; |
| 261 | }; |
| 262 | |
| 263 | status_blue@10 { |
| 264 | label = "status:blue"; |
| 265 | reg = <10>; |
| 266 | }; |
| 267 | |
| 268 | uid_red@12 { |
| 269 | label = "uid:red"; |
| 270 | reg = <12>; |
| 271 | }; |
| 272 | |
| 273 | uid_green@13 { |
| 274 | label = "uid:green"; |
| 275 | reg = <13>; |
| 276 | }; |
| 277 | |
| 278 | uid_blue@14 { |
| 279 | label = "uid:blue"; |
| 280 | reg = <14>; |
| 281 | }; |
| 282 | }; |
| 283 | |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 284 | /* ADT7463: it doesn't use the DT */ |
| 285 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 286 | #ifndef CLEARFOG_PMBUS_BITBANG |
| 287 | /* TODO: pmbus, but that needs a disabled PEC... */ |
| 288 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 289 | }; |