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 |
| 8 | |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 9 | / { |
| 10 | clocks { |
| 11 | spi_uart_clk: osc_max14830 { |
| 12 | compatible = "fixed-clock"; |
| 13 | #clock-cells = <0>; |
| 14 | clock-frequency = <3686400>; |
| 15 | }; |
| 16 | }; |
| 17 | |
| 18 | soc { |
| 19 | internal-regs { |
| 20 | sdhci@d8000 { |
| 21 | /delete-property/ cd-gpios; |
| 22 | broken-cd; |
| 23 | }; |
| 24 | }; |
| 25 | }; |
| 26 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 27 | #ifdef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 28 | gpio_i2c { |
| 29 | compatible = "i2c-gpio"; |
| 30 | sda-gpios = <&gpio0 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| 31 | scl-gpios = <&gpio0 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| 32 | i2c-gpio.delay-us = <1>; |
| 33 | #address-cells = <1>; |
| 34 | #size-cells = <0>; |
| 35 | }; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 36 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 37 | |
| 38 | gpio-leds { |
| 39 | compatible = "gpio-leds"; |
| 40 | |
| 41 | ok_led { |
| 42 | label = "status-ok"; |
| 43 | linux,default-trigger = "default-on"; |
| 44 | gpios = <&max14830 9 GPIO_ACTIVE_HIGH>; |
| 45 | }; |
| 46 | |
| 47 | fail_led { |
| 48 | label = "status-error"; |
| 49 | panic-indicator; |
| 50 | gpios = <&max14830 8 GPIO_ACTIVE_HIGH>; |
| 51 | }; |
| 52 | |
| 53 | uid_led { |
| 54 | label = "UID"; |
| 55 | linux,default-trigger = "heartbeat"; |
| 56 | gpios = <&max14830 10 GPIO_ACTIVE_HIGH>; |
| 57 | }; |
| 58 | }; |
| 59 | }; |
| 60 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 61 | #ifdef CLEARFOG_PMBUS_BITBANG |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 62 | &uart1_pins { |
| 63 | status = "disabled"; |
| 64 | }; |
| 65 | |
| 66 | &uart1 { |
| 67 | status = "disabled"; |
| 68 | }; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 69 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 70 | |
| 71 | &gpio1 { |
| 72 | spi_int { |
| 73 | /* MPP54: this needs an external pull-up */ |
| 74 | gpio-hog; |
| 75 | gpios = <22 GPIO_ACTIVE_HIGH>; |
| 76 | input; |
| 77 | line-name = "SPI-INT"; |
| 78 | }; |
| 79 | }; |
| 80 | |
| 81 | &spi1 { |
| 82 | cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio0 29 GPIO_ACTIVE_HIGH>; |
| 83 | |
| 84 | max14830: max14830@2 { |
| 85 | compatible = "maxim,max14830"; |
| 86 | reg = <2>; |
| 87 | clocks = <&spi_uart_clk>; |
| 88 | clock-names = "xtal"; |
| 89 | interrupt-parent = <&gpio1>; |
| 90 | interrupts = <22 IRQ_TYPE_LEVEL_LOW>; |
| 91 | gpio-controller; |
| 92 | #gpio-cells = <2>; |
| 93 | spi-max-frequency = <26000000>; |
| 94 | |
| 95 | gpio-line-names = |
| 96 | "WSS_HWRST", |
| 97 | "WSS_SSD", |
| 98 | "OCM_HS_IN", |
| 99 | "OCM_RESET", |
| 100 | "WSS_MRST", |
| 101 | "I2C_XOR_ENABLE", |
| 102 | "I2C_XORH", |
| 103 | "I2C_BB_ENABLE", |
| 104 | "LED_RED", |
| 105 | "LED_GREEN", |
| 106 | "LED_BLUE", |
| 107 | "EDFA1_AMPLIFIER_DISABLE", |
| 108 | "EDFA2_AMPLIFIER_DISABLE", |
| 109 | "EDFA1_OUTPUT_POWER_MUTE", |
| 110 | "EDFA2_OUTPUT_POWER_MUTE", |
| 111 | "" /* not used, not routed anywhere */ |
| 112 | ; |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 113 | |
| 114 | i2c_bitbang_enable { |
| 115 | gpio-hog; |
| 116 | gpios = <7 GPIO_ACTIVE_HIGH>; |
| 117 | #ifdef CLEARFOG_PMBUS_BITBANG |
| 118 | output-high; |
| 119 | #else |
| 120 | output-low; |
| 121 | #endif |
| 122 | line-name = "I2C bitbang bus"; |
| 123 | }; |
| 124 | |
| 125 | i2c_xor_high { |
| 126 | gpio-hog; |
| 127 | gpios = <6 GPIO_ACTIVE_HIGH>; |
| 128 | //output-low; // XOR byte 0b0001111 |
| 129 | output-high; // XOR byte 0b1101111 |
| 130 | line-name = "I2C XOR high"; |
| 131 | }; |
| 132 | |
| 133 | i2c_xor_enable { |
| 134 | gpio-hog; |
| 135 | gpios = <5 GPIO_ACTIVE_HIGH>; |
| 136 | #ifdef CLEARFOG_PMBUS_BITBANG |
| 137 | output-low; |
| 138 | #else |
| 139 | output-high; |
| 140 | #endif |
| 141 | line-name = "I2C addr xlate"; |
| 142 | }; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 143 | }; |
| 144 | |
| 145 | gpio_spi_chips: gpio@1 { |
| 146 | compatible = "microchip,mcp23s17"; |
| 147 | reg = <1>; |
| 148 | interrupt-parent = <&gpio1>; |
| 149 | interrupts = <22 IRQ_TYPE_LEVEL_LOW>; |
| 150 | interrupt-controller; |
| 151 | #interrupt-cells = <2>; |
| 152 | gpio-controller; |
| 153 | #gpio-cells = <2>; |
| 154 | microchip,spi-present-mask = <0x06>; /* extra addresses 1 and 2 */ |
| 155 | microchip,irq-mirror; |
| 156 | drive-open-drain; |
| 157 | spi-max-frequency = <10000000>; |
| 158 | |
| 159 | // FIXME: this naming is incompatible with that hack which makes these devices visible as 2*16pin standalone chips |
| 160 | gpio-bank@1 { |
| 161 | address = <1>; |
| 162 | gpio-line-names = |
| 163 | "EDFA1_RESET", |
| 164 | "EDFA2_RESET", |
| 165 | "PMB_ALERT", |
| 166 | "ATX_TTL", /* FIXME: will this be used? */ |
| 167 | "WSS_SC", |
| 168 | "WSS_RST", |
| 169 | "I2C_XOR_RDY", |
| 170 | "OCM_HS_OUT", |
| 171 | |
| 172 | "EDFA1_OUT_REFLECTION_ALARM", |
| 173 | "EDFA1_PUMP_CURRENT_ALARM", |
| 174 | "EDFA1_ST1_IN_LOS_ALARM", |
| 175 | "EDFA1_ST2_IN_LOS_ALARM", |
| 176 | "EDFA1_ST2_OUT_GAIN_ALARM", |
| 177 | "EDFA1_CASE_TEMP_ALARM", |
| 178 | "EDFA1_ST1_OUT_GAIN_ALARM", |
| 179 | "EDFA1_PUMP_TEMP_ALARM"; |
| 180 | }; |
| 181 | |
| 182 | gpio-bank@2 { |
| 183 | address = <2>; |
| 184 | gpio-line-names = |
| 185 | /* these are all grounded */ |
| 186 | "GND", |
| 187 | "GND", |
| 188 | "GND", |
| 189 | "GND", |
| 190 | "GND", |
| 191 | "GND", |
| 192 | "GND", |
| 193 | "GND", |
| 194 | |
| 195 | "EDFA2_OUT_REFLECTION_ALARM", |
| 196 | "EDFA2_PUMP_CURRENT_ALARM", |
| 197 | "EDFA2_ST1_IN_LOS_ALARM", |
| 198 | "EDFA2_ST2_IN_LOS_ALARM", |
| 199 | "EDFA2_ST2_OUT_GAIN_ALARM", |
| 200 | "EDFA2_CASE_TEMP_ALARM", |
| 201 | "EDFA2_ST1_OUT_GAIN_ALARM", |
| 202 | "EDFA2_PUMP_TEMP_ALARM"; |
| 203 | }; |
| 204 | }; |
| 205 | |
| 206 | spidev@3 { |
| 207 | compatible = "spidev"; |
| 208 | reg = <3>; |
| 209 | spi-max-frequency = <12000000>; |
| 210 | // The SPI slave is CPOL=1, but the rest of the devices is CPOL=0 and our SPI master |
| 211 | // appears to have troubles with CPOL=1 toggling -> let's use a physical inverter |
| 212 | linux,spi-wdelay = /bits/ 16 <3>; |
| 213 | }; |
| 214 | }; |
| 215 | |
| 216 | &i2c1 { |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 217 | eeprom@53 { |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 218 | compatible = "atmel,24c128"; |
Jan Kundrát | d512909 | 2018-06-11 18:12:37 +0200 | [diff] [blame] | 219 | reg = <0x53>; |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 220 | pagesize = <64>; |
Jan Kundrát | d9af6aa | 2018-06-06 14:27:23 +0200 | [diff] [blame] | 221 | // There's no read-only parameter because we want to enable flashing the EEPROM by |
| 222 | // installing a physical jumper. It doesn't matter that Linux still considers this |
| 223 | // device as writable during normal operation because any write fill fail anyway |
| 224 | // on the HW level. At least we can install that jumper and make the writes pass |
| 225 | // magically without fiddling with the DT and rebooting. |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 226 | }; |
| 227 | |
| 228 | /* ADT7463: it doesn't use the DT */ |
| 229 | |
Jan Kundrát | d014bb9 | 2018-06-08 21:35:21 +0200 | [diff] [blame] | 230 | #ifndef CLEARFOG_PMBUS_BITBANG |
| 231 | /* TODO: pmbus, but that needs a disabled PEC... */ |
| 232 | #endif |
Jan Kundrát | 130cfb9 | 2018-05-30 15:21:16 +0200 | [diff] [blame] | 233 | }; |