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 |
| 147 | output-high; // XOR byte 0b1101111 |
| 148 | line-name = "I2C XOR high"; |
| 149 | }; |
| 150 | |
| 151 | i2c_xor_enable { |
| 152 | gpio-hog; |
| 153 | gpios = <5 GPIO_ACTIVE_HIGH>; |
| 154 | #ifdef CLEARFOG_PMBUS_BITBANG |
| 155 | output-low; |
| 156 | #else |
| 157 | output-high; |
| 158 | #endif |
| 159 | line-name = "I2C addr xlate"; |
| 160 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | gpio_spi_chips: gpio@1 { |
| 164 | compatible = "microchip,mcp23s17"; |
| 165 | reg = <1>; |
| 166 | interrupt-parent = <&gpio1>; |
| 167 | interrupts = <22 IRQ_TYPE_LEVEL_LOW>; |
| 168 | interrupt-controller; |
| 169 | #interrupt-cells = <2>; |
| 170 | gpio-controller; |
| 171 | #gpio-cells = <2>; |
| 172 | microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */ |
| 173 | microchip,irq-mirror; |
| 174 | drive-open-drain; |
| 175 | spi-max-frequency = <10000000>; |
| 176 | |
| 177 | // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips |
| 178 | gpio-bank@1 { |
| 179 | address = <1>; |
| 180 | gpio-line-names = |
| 181 | "EDFA1_RESET", |
| 182 | "EDFA2_RESET", |
| 183 | "PMB_ALERT", |
Jan Kundrát | 93d7922 | 2018-06-19 20:45:35 +0200 | [diff] [blame] | 184 | #ifdef IFACE_V_1_0 |
| 185 | "ATX_TTL", |
| 186 | #else |
| 187 | "EXP_GPIO2", |
| 188 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 189 | "WSS_SC", |
| 190 | "WSS_RST", |
| 191 | "I2C_XOR_RDY", |
| 192 | "OCM_HS_OUT", |
| 193 | |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame^] | 194 | "EDFA1_OUT_REFLECT_A", |
| 195 | "EDFA1_PUMP_CURRENT_A", |
| 196 | "EDFA1_ST1_IN_LOS_A", |
| 197 | "EDFA1_ST2_IN_LOS_A", |
| 198 | "EDFA1_ST2_OUT_GAIN_A", |
| 199 | "EDFA1_CASE_TEMP_A", |
| 200 | "EDFA1_ST1_OUT_GAIN_A", |
| 201 | "EDFA1_PUMP_TEMP_A"; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 202 | }; |
| 203 | |
| 204 | gpio-bank@2 { |
| 205 | address = <2>; |
| 206 | gpio-line-names = |
| 207 | /* these are all grounded */ |
| 208 | "GND", |
| 209 | "GND", |
| 210 | "GND", |
| 211 | "GND", |
| 212 | "GND", |
| 213 | "GND", |
| 214 | "GND", |
| 215 | "GND", |
| 216 | |
Jan Kundrát | db94322 | 2018-06-19 20:51:30 +0200 | [diff] [blame^] | 217 | "EDFA2_OUT_REFLECT_A", |
| 218 | "EDFA2_PUMP_CURRENT_A", |
| 219 | "EDFA2_ST1_IN_LOS_A", |
| 220 | "EDFA2_ST2_IN_LOS_A", |
| 221 | "EDFA2_ST2_OUT_GAIN_A", |
| 222 | "EDFA2_CASE_TEMP_A", |
| 223 | "EDFA2_ST1_OUT_GAIN_A", |
| 224 | "EDFA2_PUMP_TEMP_A"; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 225 | }; |
| 226 | }; |
| 227 | |
| 228 | spidev@3 { |
| 229 | compatible = "spidev"; |
| 230 | reg = <3>; |
| 231 | spi-max-frequency = <12000000>; |
| 232 | // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master |
| 233 | // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter |
| 234 | linux,spi-wdelay = /bits/ 16 <3>; |
| 235 | }; |
| 236 | }; |
| 237 | |
| 238 | &i2c1 { |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 239 | eeprom@53 { |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 240 | compatible = "atmel,24c128"; |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 241 | reg = <0x53>; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 242 | pagesize = <64>; |
Jan Kundrát | d9af6aa | 2018-06-06 14:27:23 +0200 | [diff] [blame] | 243 | // There's no read-only parameter because we want to enable flashing the EEPROM by |
| 244 | // installing a physical jumper. It doesn't matter that Linux still considers this |
| 245 | // device as writable during normal operation because any write fill fail anyway |
| 246 | // on the HW level. At least we can install that jumper and make the writes pass |
| 247 | // magically without fiddling with the DT and rebooting. |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 248 | }; |
| 249 | |
| 250 | /* ADT7463: it doesn't use the DT */ |
| 251 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 252 | #ifndef CLEARFOG_PMBUS_BITBANG |
| 253 | /* TODO: pmbus, but that needs a disabled PEC... */ |
| 254 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 255 | }; |