| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | |
| 3 | #include "ar9344.dtsi" |
| 4 | |
| 5 | #include <dt-bindings/gpio/gpio.h> |
| 6 | #include <dt-bindings/input/input.h> |
| 7 | |
| 8 | / { |
| 9 | compatible = "mikrotik,routerboard-912uag-2hpnd", "qca,ar9342"; |
| 10 | model = "MikroTik RouterBOARD 912UAG-2HPnD"; |
| 11 | |
| 12 | aliases { |
| 13 | led-boot = &led_power; |
| 14 | led-failsafe = &led_power; |
| 15 | led-running = &led_power; |
| 16 | led-upgrade = &led_power; |
| 17 | }; |
| 18 | |
| 19 | gpio_latch: gpio_latch { |
| 20 | compatible = "gpio-latch"; |
| 21 | gpio-controller; |
| 22 | #gpio-cells = <2>; |
| 23 | gpios = <&gpio 0 GPIO_ACTIVE_HIGH>, |
| 24 | <&gpio 1 GPIO_ACTIVE_HIGH>, |
| 25 | <&gpio 2 GPIO_ACTIVE_HIGH>, |
| 26 | <&gpio 3 GPIO_ACTIVE_HIGH>, |
| 27 | <0>, /* Not connected */ |
| 28 | <&gpio 13 GPIO_ACTIVE_HIGH>, |
| 29 | <&gpio 14 GPIO_ACTIVE_HIGH>, |
| 30 | <&gpio 15 GPIO_ACTIVE_HIGH>, |
| 31 | <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */ |
| 32 | }; |
| 33 | |
| 34 | nand_gpio { |
| 35 | compatible = "mikrotik,rb91x-nand"; |
| 36 | |
| 37 | gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */ |
| 38 | <&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */ |
| 39 | <&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */ |
| 40 | <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */ |
| 41 | <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */ |
| 42 | <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */ |
| 43 | <&gpio_latch 8 GPIO_ACTIVE_LOW>; /* Latch Enable (nLE) */ |
| 44 | |
| 45 | partitions { |
| 46 | compatible = "fixed-partitions"; |
| 47 | #size-cells = <1>; |
| 48 | |
| 49 | partition@0 { |
| 50 | label = "booter"; |
| 51 | reg = <0x0 0x0040000>; |
| 52 | read-only; |
| 53 | }; |
| 54 | |
| 55 | partition@40000 { |
| 56 | label = "kernel"; |
| 57 | reg = <0x0040000 0x03c0000>; |
| 58 | }; |
| 59 | |
| 60 | partition@400000 { |
| 61 | label = "ubi"; |
| 62 | reg = <0x0400000 0x7c00000>; |
| 63 | }; |
| 64 | }; |
| 65 | }; |
| 66 | |
| 67 | leds { |
| 68 | compatible = "gpio-leds"; |
| 69 | |
| 70 | led_power: power { |
| 71 | label = "green:power"; |
| 72 | gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>; |
| 73 | default-state = "on"; |
| 74 | }; |
| 75 | |
| 76 | user { |
| 77 | label = "green:user"; |
| 78 | gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>; |
| 79 | }; |
| 80 | |
| 81 | led1 { |
| 82 | label = "green:led1"; |
| 83 | gpios = <&ssr 0 GPIO_ACTIVE_HIGH>; |
| 84 | }; |
| 85 | |
| 86 | led2 { |
| 87 | label = "green:led2"; |
| 88 | gpios = <&ssr 1 GPIO_ACTIVE_HIGH>; |
| 89 | }; |
| 90 | |
| 91 | led3 { |
| 92 | label = "green:led3"; |
| 93 | gpios = <&ssr 2 GPIO_ACTIVE_HIGH>; |
| 94 | }; |
| 95 | |
| 96 | led4 { |
| 97 | label = "green:led4"; |
| 98 | gpios = <&ssr 3 GPIO_ACTIVE_HIGH>; |
| 99 | }; |
| 100 | |
| 101 | led5 { |
| 102 | label = "green:led5"; |
| 103 | gpios = <&ssr 4 GPIO_ACTIVE_HIGH>; |
| 104 | }; |
| 105 | }; |
| 106 | |
| 107 | gpio-export { |
| 108 | compatible = "gpio-export"; |
| 109 | |
| 110 | beeper { |
| 111 | gpio-export,name = "beeper"; |
| 112 | gpio-export,output = <1>; /* Must be 1 to avoid EMI induced clicking noise */ |
| 113 | gpios = <&ssr 5 GPIO_ACTIVE_HIGH>; |
| 114 | }; |
| 115 | |
| 116 | usb_power { |
| 117 | gpio-export,name = "power-usb"; |
| 118 | gpio-export,output = <1>; |
| 119 | gpios = <&ssr 6 GPIO_ACTIVE_HIGH>; |
| 120 | }; |
| 121 | |
| 122 | pcie_power { |
| 123 | gpio-export,name = "power-pcie"; |
| 124 | gpio-export,output = <0>; |
| 125 | gpios = <&ssr 7 GPIO_ACTIVE_HIGH>; |
| 126 | }; |
| 127 | }; |
| 128 | }; |
| 129 | |
| 130 | &ref { |
| 131 | clock-frequency = <25000000>; |
| 132 | }; |
| 133 | |
| 134 | &spi { |
| 135 | status = "okay"; |
| 136 | |
| 137 | compatible = "qca,ar7100-spi"; |
| 138 | |
| 139 | cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>; |
| 140 | |
| 141 | flash@0 { |
| 142 | compatible = "jedec,spi-nor"; |
| 143 | reg = <0>; |
| 144 | spi-max-frequency = <50000000>; |
| 145 | |
| 146 | partitions { |
| 147 | compatible = "mikrotik,routerboot-partitions"; |
| 148 | #address-cells = <1>; |
| 149 | #size-cells = <1>; |
| 150 | |
| 151 | partition@0 { |
| 152 | label = "routerboot"; |
| 153 | reg = <0x0 0x0>; |
| 154 | read-only; |
| 155 | }; |
| 156 | |
| 157 | hard_config: hard_config { |
| 158 | read-only; |
| 159 | }; |
| 160 | |
| 161 | bios { |
| 162 | size = <0x1000>; |
| 163 | read-only; |
| 164 | }; |
| 165 | |
| 166 | soft_config { |
| 167 | }; |
| 168 | }; |
| 169 | }; |
| 170 | |
| 171 | ssr: ssr@1 { |
| 172 | compatible = "fairchild,74hc595"; |
| 173 | gpio-controller; |
| 174 | #gpio-cells = <2>; |
| 175 | registers-number = <1>; |
| 176 | reg = <1>; |
| 177 | spi-max-frequency = <50000000>; |
| 178 | }; |
| 179 | }; |
| 180 | |
| 181 | &mdio0 { |
| 182 | status = "okay"; |
| 183 | |
| 184 | phy-mask = <0>; |
| 185 | |
| 186 | phy0: ethernet-phy@0 { |
| 187 | reg = <0>; |
| 188 | }; |
| 189 | }; |
| 190 | |
| 191 | ð0 { |
| 192 | status = "okay"; |
| 193 | |
| 194 | phy-mode = "rgmii-id"; |
| 195 | phy-handle = <&phy0>; |
| 196 | pll-data = <0x02000000 0x00000101 0x00001313>; |
| 197 | |
| 198 | gmac-config { |
| 199 | device = <&gmac>; |
| 200 | rgmii-gmac0 = <1>; |
| 201 | rgmii-enabled = <1>; |
| 202 | rxd-delay = <1>; |
| 203 | txd-delay = <1>; |
| 204 | }; |
| 205 | }; |
| 206 | |
| 207 | &wmac { |
| 208 | status = "okay"; |
| 209 | qca,no-eeprom; |
| 210 | }; |
| 211 | |
| 212 | &pcie { |
| 213 | status = "okay"; |
| 214 | }; |
| 215 | |
| 216 | &usb { |
| 217 | status = "okay"; |
| 218 | }; |
| 219 | |
| 220 | &usb_phy { |
| 221 | status = "okay"; |
| 222 | }; |