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 | |
Jan Kundrát | 6eb5a02 | 2018-08-20 14:55:33 +0200 | [diff] [blame^] | 185 | // FIXME: this hogs both .1 and .2 chips' #6 pin... |
Jan Kundrát | 1e866c6 | 2018-07-04 19:54:30 +0200 | [diff] [blame] | 186 | i2c_xor_ready { |
| 187 | gpio-hog; |
| 188 | gpios = <6 GPIO_ACTIVE_HIGH>; |
| 189 | input; |
| 190 | line-name = "I2C XOR ready"; |
| 191 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 192 | }; |
| 193 | |
| 194 | spidev@3 { |
| 195 | compatible = "spidev"; |
| 196 | reg = <3>; |
| 197 | spi-max-frequency = <12000000>; |
| 198 | // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master |
| 199 | // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter |
| 200 | linux,spi-wdelay = /bits/ 16 <3>; |
| 201 | }; |
| 202 | }; |
| 203 | |
| 204 | &i2c1 { |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 205 | eeprom@53 { |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 206 | compatible = "atmel,24c128"; |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 207 | reg = <0x53>; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 208 | pagesize = <64>; |
Jan Kundrát | d9af6aa | 2018-06-06 14:27:23 +0200 | [diff] [blame] | 209 | // There's no read-only parameter because we want to enable flashing the EEPROM by |
| 210 | // installing a physical jumper. It doesn't matter that Linux still considers this |
| 211 | // device as writable during normal operation because any write fill fail anyway |
| 212 | // on the HW level. At least we can install that jumper and make the writes pass |
| 213 | // magically without fiddling with the DT and rebooting. |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 214 | }; |
| 215 | |
Jan Kundrát | 8f3357f | 2018-08-08 14:16:32 +0200 | [diff] [blame] | 216 | tlc59116@60 { |
| 217 | #address-cells = <1>; |
| 218 | #size-cells = <0>; |
| 219 | #gpio-cells = <2>; |
| 220 | compatible = "ti,tlc59116"; |
| 221 | reg = <0x60>; |
| 222 | |
| 223 | sfp_red@0 { |
| 224 | label = "sfp:red"; |
| 225 | reg = <0>; |
| 226 | }; |
| 227 | |
| 228 | sfp_green@1 { |
| 229 | label = "sfp:green"; |
| 230 | reg = <1>; |
| 231 | }; |
| 232 | |
| 233 | sfp_blue@2 { |
| 234 | label = "sfp:blue"; |
| 235 | reg = <2>; |
| 236 | }; |
| 237 | |
| 238 | line_red@4 { |
| 239 | label = "line:red"; |
| 240 | reg = <4>; |
| 241 | }; |
| 242 | |
| 243 | line_green@5 { |
| 244 | label = "line:green"; |
| 245 | reg = <5>; |
| 246 | }; |
| 247 | |
| 248 | line_blue@6 { |
| 249 | label = "line:blue"; |
| 250 | reg = <6>; |
| 251 | }; |
| 252 | |
| 253 | status_red@8 { |
| 254 | label = "status:red"; |
| 255 | reg = <8>; |
| 256 | }; |
| 257 | |
| 258 | status_green@9 { |
| 259 | label = "status:green"; |
| 260 | reg = <9>; |
| 261 | linux,default-trigger = "timer"; |
| 262 | }; |
| 263 | |
| 264 | status_blue@10 { |
| 265 | label = "status:blue"; |
| 266 | reg = <10>; |
| 267 | }; |
| 268 | |
| 269 | uid_red@12 { |
| 270 | label = "uid:red"; |
| 271 | reg = <12>; |
| 272 | }; |
| 273 | |
| 274 | uid_green@13 { |
| 275 | label = "uid:green"; |
| 276 | reg = <13>; |
| 277 | }; |
| 278 | |
| 279 | uid_blue@14 { |
| 280 | label = "uid:blue"; |
| 281 | reg = <14>; |
| 282 | }; |
| 283 | }; |
| 284 | |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 285 | /* ADT7463: it doesn't use the DT */ |
| 286 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 287 | #ifndef CLEARFOG_PMBUS_BITBANG |
| 288 | /* TODO: pmbus, but that needs a disabled PEC... */ |
| 289 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 290 | }; |