Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Device Tree file for D-Link DIR-685 Xtreme N Storage Router |
| 3 | */ |
| 4 | |
| 5 | /dts-v1/; |
| 6 | |
| 7 | #include "gemini.dtsi" |
| 8 | #include <dt-bindings/input/input.h> |
| 9 | |
| 10 | / { |
| 11 | model = "D-Link DIR-685 Xtreme N Storage Router"; |
| 12 | compatible = "dlink,dir-685", "cortina,gemini"; |
| 13 | #address-cells = <1>; |
| 14 | #size-cells = <1>; |
| 15 | |
| 16 | memory { |
| 17 | /* 128 MB SDRAM in 2 x Hynix HY5DU121622DTP-D43 */ |
| 18 | device_type = "memory"; |
| 19 | reg = <0x00000000 0x8000000>; |
| 20 | }; |
| 21 | |
| 22 | chosen { |
Linus Walleij | 0d6ce77 | 2018-05-02 09:17:25 +0200 | [diff] [blame^] | 23 | bootargs = "console=ttyS0,19200n8 root=/dev/sda1 rw rootwait"; |
| 24 | stdout-path = "uart0:19200n8"; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | gpio_keys { |
| 28 | compatible = "gpio-keys"; |
| 29 | #address-cells = <1>; |
| 30 | #size-cells = <0>; |
| 31 | button-esc { |
Geert Uytterhoeven | c0b20ba | 2018-02-13 15:15:31 +0100 | [diff] [blame] | 32 | debounce-interval = <50>; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 33 | wakeup-source; |
| 34 | linux,code = <KEY_ESC>; |
| 35 | label = "reset"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 36 | /* Collides with LPC_LAD[0], UART DCD, SSP 97RST */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 37 | gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; |
| 38 | }; |
| 39 | button-eject { |
Geert Uytterhoeven | c0b20ba | 2018-02-13 15:15:31 +0100 | [diff] [blame] | 40 | debounce-interval = <50>; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 41 | wakeup-source; |
| 42 | linux,code = <KEY_EJECTCD>; |
| 43 | label = "unmount"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 44 | /* Collides with LPC LFRAME, UART RTS, SSP TXD */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 45 | gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; |
| 46 | }; |
| 47 | }; |
| 48 | |
Linus Walleij | ea6f23f | 2017-07-15 21:02:06 +0200 | [diff] [blame] | 49 | vdisp: regulator { |
| 50 | compatible = "regulator-fixed"; |
| 51 | regulator-name = "display-power"; |
| 52 | regulator-min-microvolt = <3600000>; |
| 53 | regulator-max-microvolt = <3600000>; |
| 54 | /* Collides with LCD E */ |
| 55 | gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>; |
| 56 | enable-active-high; |
| 57 | }; |
| 58 | |
| 59 | spi { |
| 60 | compatible = "spi-gpio"; |
| 61 | #address-cells = <1>; |
| 62 | #size-cells = <0>; |
| 63 | |
| 64 | /* Collides with IDE pins, that's cool (we do not use them) */ |
| 65 | gpio-sck = <&gpio1 5 GPIO_ACTIVE_HIGH>; |
| 66 | gpio-miso = <&gpio1 8 GPIO_ACTIVE_HIGH>; |
| 67 | gpio-mosi = <&gpio1 7 GPIO_ACTIVE_HIGH>; |
| 68 | /* Collides with pflash CE1, not so cool */ |
| 69 | cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; |
| 70 | num-chipselects = <1>; |
| 71 | |
| 72 | panel: display@0 { |
| 73 | compatible = "dlink,dir-685-panel", "ilitek,ili9322"; |
| 74 | reg = <0>; |
| 75 | /* 50 ns min period = 20 MHz */ |
| 76 | spi-max-frequency = <20000000>; |
| 77 | spi-cpol; /* Clock active low */ |
| 78 | vcc-supply = <&vdisp>; |
| 79 | iovcc-supply = <&vdisp>; |
| 80 | vci-supply = <&vdisp>; |
| 81 | |
| 82 | port { |
| 83 | panel_in: endpoint { |
| 84 | remote-endpoint = <&display_out>; |
| 85 | }; |
| 86 | }; |
| 87 | }; |
| 88 | }; |
| 89 | |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 90 | leds { |
| 91 | compatible = "gpio-leds"; |
| 92 | led-wps { |
| 93 | label = "dir685:blue:WPS"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 94 | /* Collides with ICE */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 95 | gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; |
| 96 | default-state = "on"; |
| 97 | linux,default-trigger = "heartbeat"; |
| 98 | }; |
| 99 | /* |
| 100 | * These two LEDs are on the side of the device. |
| 101 | * For electrical reasons, both LEDs cannot be active |
Linus Walleij | 8cb2459 | 2018-04-11 15:58:24 +0200 | [diff] [blame] | 102 | * at the same time so only blue or orange can be on at |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 103 | * one time. Enabling both makes the LED go dark. |
| 104 | * The LEDs both sit inside the unmount button and the |
| 105 | * label on the case says "unmount". |
| 106 | */ |
| 107 | led-blue-hd { |
| 108 | label = "dir685:blue:HD"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 109 | /* Collides with LPC_SERIRQ, UART DTR, SSP FSC pins */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 110 | gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; |
| 111 | default-state = "off"; |
Linus Walleij | 8cb2459 | 2018-04-11 15:58:24 +0200 | [diff] [blame] | 112 | linux,default-trigger = "disk-read"; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 113 | }; |
| 114 | led-orange-hd { |
| 115 | label = "dir685:orange:HD"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 116 | /* Collides with LPC_LAD[2], UART DSR, SSP ECLK pins */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 117 | gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; |
| 118 | default-state = "off"; |
Linus Walleij | 8cb2459 | 2018-04-11 15:58:24 +0200 | [diff] [blame] | 119 | linux,default-trigger = "disk-write"; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 120 | }; |
| 121 | }; |
| 122 | |
| 123 | /* |
| 124 | * This is a Sunon Maglev GM0502PFV2-8 cooling fan @10000 RPM. |
| 125 | * Since the platform has no temperature sensor, this is controlled |
| 126 | * from userspace by using the hard disks S.M.A.R.T. temperature |
| 127 | * sensor. It is turned on when the temperature exceeds 46 degrees |
| 128 | * and turned off when the temperatures goes below 41 degrees |
| 129 | * (celsius). |
| 130 | */ |
| 131 | gpio-fan { |
| 132 | compatible = "gpio-fan"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 133 | /* Collides with IDE */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 134 | gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; |
| 135 | gpio-fan,speed-map = <0 0>, <10000 1>; |
| 136 | #cooling-cells = <2>; |
| 137 | }; |
| 138 | |
| 139 | /* |
| 140 | * The touchpad input is connected to a GPIO bit-banged |
| 141 | * I2C bus. |
| 142 | */ |
| 143 | gpio-i2c { |
| 144 | compatible = "i2c-gpio"; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 145 | /* Collides with ICE */ |
Linus Walleij | 8632a66 | 2017-09-10 20:02:33 +0200 | [diff] [blame] | 146 | sda-gpios = <&gpio0 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; |
| 147 | scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 148 | #address-cells = <1>; |
| 149 | #size-cells = <0>; |
| 150 | |
| 151 | touchkeys@26 { |
| 152 | compatible = "dlink,dir685-touchkeys"; |
| 153 | reg = <0x26>; |
| 154 | interrupt-parent = <&gpio0>; |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 155 | /* Collides with NAND flash */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 156 | interrupts = <17 IRQ_TYPE_EDGE_FALLING>; |
| 157 | }; |
| 158 | }; |
| 159 | |
| 160 | soc { |
| 161 | flash@30000000 { |
Linus Walleij | ea6f23f | 2017-07-15 21:02:06 +0200 | [diff] [blame] | 162 | /* |
| 163 | * Flash access is by default disabled, because it |
| 164 | * collides with the Chip Enable signal for the display |
| 165 | * panel, that reuse the parallel flash Chip Select 1 |
| 166 | * (CS1). Enabling flash makes graphics stop working. |
| 167 | * |
| 168 | * We might be able to hack around this by letting |
| 169 | * GPIO poke around in the flash controller registers. |
| 170 | */ |
| 171 | /* status = "okay"; */ |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 172 | /* 32MB of flash */ |
| 173 | reg = <0x30000000 0x02000000>; |
| 174 | |
| 175 | /* |
| 176 | * This "RedBoot" is the Storlink derivative. |
| 177 | */ |
| 178 | partition@0 { |
| 179 | label = "RedBoot"; |
| 180 | reg = <0x00000000 0x00040000>; |
| 181 | read-only; |
| 182 | }; |
| 183 | /* |
| 184 | * Between the boot loader and the rootfs is the kernel |
| 185 | * in a custom Storlink format flashed from the boot |
| 186 | * menu. The rootfs is in squashfs format. |
| 187 | */ |
| 188 | partition@1800c0 { |
| 189 | label = "rootfs"; |
| 190 | reg = <0x001800c0 0x01dbff40>; |
| 191 | read-only; |
| 192 | }; |
| 193 | partition@1f40000 { |
| 194 | label = "upgrade"; |
| 195 | reg = <0x01f40000 0x00040000>; |
| 196 | read-only; |
| 197 | }; |
| 198 | partition@1f80000 { |
| 199 | label = "rgdb"; |
| 200 | reg = <0x01f80000 0x00040000>; |
| 201 | read-only; |
| 202 | }; |
| 203 | /* |
| 204 | * This partition contains MAC addresses for WAN, |
| 205 | * WLAN and LAN, and the country code (for wireless |
| 206 | * I guess). |
| 207 | */ |
| 208 | partition@1fc0000 { |
| 209 | label = "nvram"; |
| 210 | reg = <0x01fc0000 0x00020000>; |
| 211 | read-only; |
| 212 | }; |
| 213 | partition@1fe0000 { |
| 214 | label = "LangPack"; |
| 215 | reg = <0x01fe0000 0x00020000>; |
| 216 | read-only; |
| 217 | }; |
| 218 | }; |
| 219 | |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 220 | syscon: syscon@40000000 { |
| 221 | pinctrl { |
| 222 | /* |
| 223 | * gpio0bgrp cover line 5, 6 used by TK I2C |
| 224 | * gpio0bgrp cover line 7 used by WPS LED |
| 225 | * gpio0cgrp cover line 8, 13 used by keys |
| 226 | * and 11, 12 used by the HD LEDs |
| 227 | * gpio0egrp cover line 16 used by VDISP |
| 228 | * gpio0fgrp cover line 17 used by TK IRQ |
| 229 | * gpio0ggrp cover line 20 used by panel CS |
| 230 | * gpio0hgrp cover line 21,22 used by RTL8366RB |
| 231 | */ |
| 232 | gpio0_default_pins: pinctrl-gpio0 { |
| 233 | mux { |
| 234 | function = "gpio0"; |
| 235 | groups = "gpio0bgrp", |
| 236 | "gpio0cgrp", |
| 237 | "gpio0egrp", |
| 238 | "gpio0fgrp", |
| 239 | "gpio0ggrp", |
| 240 | "gpio0hgrp"; |
| 241 | }; |
| 242 | }; |
| 243 | /* |
| 244 | * gpio1bgrp cover line 5,8,7 used by panel SPI |
| 245 | * also line 6 used by the fan |
| 246 | * |
| 247 | */ |
| 248 | gpio1_default_pins: pinctrl-gpio1 { |
| 249 | mux { |
| 250 | function = "gpio1"; |
| 251 | groups = "gpio1bgrp"; |
| 252 | }; |
| 253 | }; |
| 254 | }; |
| 255 | }; |
| 256 | |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 257 | sata: sata@46000000 { |
| 258 | cortina,gemini-ata-muxmode = <0>; |
| 259 | cortina,gemini-enable-sata-bridge; |
| 260 | status = "okay"; |
| 261 | }; |
| 262 | |
Linus Walleij | f328c2e | 2017-07-05 16:59:33 +0200 | [diff] [blame] | 263 | gpio0: gpio@4d000000 { |
| 264 | pinctrl-names = "default"; |
| 265 | pinctrl-0 = <&gpio0_default_pins>; |
| 266 | }; |
| 267 | |
| 268 | gpio1: gpio@4e000000 { |
| 269 | pinctrl-names = "default"; |
| 270 | pinctrl-0 = <&gpio1_default_pins>; |
| 271 | }; |
| 272 | |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 273 | pci@50000000 { |
| 274 | status = "okay"; |
| 275 | interrupt-map-mask = <0xf800 0 0 7>; |
| 276 | interrupt-map = |
| 277 | <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */ |
| 278 | <0x4800 0 0 2 &pci_intc 1>, |
| 279 | <0x4800 0 0 3 &pci_intc 2>, |
| 280 | <0x4800 0 0 4 &pci_intc 3>, |
| 281 | <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */ |
| 282 | <0x5000 0 0 2 &pci_intc 2>, |
| 283 | <0x5000 0 0 3 &pci_intc 3>, |
| 284 | <0x5000 0 0 4 &pci_intc 0>, |
| 285 | <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */ |
| 286 | <0x5800 0 0 2 &pci_intc 3>, |
| 287 | <0x5800 0 0 3 &pci_intc 0>, |
| 288 | <0x5800 0 0 4 &pci_intc 1>, |
| 289 | <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */ |
| 290 | <0x6000 0 0 2 &pci_intc 0>, |
| 291 | <0x6000 0 0 3 &pci_intc 1>, |
| 292 | <0x6000 0 0 4 &pci_intc 2>; |
| 293 | }; |
| 294 | |
| 295 | ata@63000000 { |
| 296 | status = "okay"; |
| 297 | }; |
Linus Walleij | ea6f23f | 2017-07-15 21:02:06 +0200 | [diff] [blame] | 298 | |
| 299 | display-controller@6a000000 { |
| 300 | status = "okay"; |
| 301 | |
| 302 | port@0 { |
| 303 | reg = <0>; |
| 304 | display_out: endpoint { |
| 305 | remote-endpoint = <&panel_in>; |
| 306 | }; |
| 307 | }; |
| 308 | }; |
Linus Walleij | 22789ae | 2017-04-29 22:39:11 +0200 | [diff] [blame] | 309 | }; |
| 310 | }; |