|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT |
| 2 | + |
| 3 | +#include "mt7621.dtsi" |
| 4 | + |
| 5 | +#include <dt-bindings/gpio/gpio.h> |
| 6 | +#include <dt-bindings/input/input.h> |
| 7 | +#include <dt-bindings/leds/common.h> |
| 8 | + |
| 9 | +/ { |
| 10 | + compatible = "wodesys,wd-r1802u", "mediatek,mt7621-soc"; |
| 11 | + model = "Wodesys WD-R1802U"; |
| 12 | + |
| 13 | + aliases { |
| 14 | + label-mac-device = &gmac0; |
| 15 | + led-boot = &led_blue; |
| 16 | + led-failsafe = &led_red; |
| 17 | + led-running = &led_green; |
| 18 | + led-upgrade = &led_blue; |
| 19 | + }; |
| 20 | + |
| 21 | + chosen { |
| 22 | + bootargs = "console=ttyS0,115200"; |
| 23 | + }; |
| 24 | + |
| 25 | + gpio-keys { |
| 26 | + compatible = "gpio-keys"; |
| 27 | + |
| 28 | + key-0 { |
| 29 | + label = "reset"; |
| 30 | + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; |
| 31 | + linux,code = <KEY_RESTART>; |
| 32 | + }; |
| 33 | + }; |
| 34 | + |
| 35 | + gpio-leds { |
| 36 | + compatible = "gpio-leds"; |
| 37 | + |
| 38 | + led_green: led-0 { |
| 39 | + color = <LED_COLOR_ID_GREEN>; |
| 40 | + function = LED_FUNCTION_STATUS; |
| 41 | + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; |
| 42 | + }; |
| 43 | + |
| 44 | + led_blue: led-1 { |
| 45 | + color = <LED_COLOR_ID_BLUE>; |
| 46 | + function = LED_FUNCTION_STATUS; |
| 47 | + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; |
| 48 | + }; |
| 49 | + |
| 50 | + led_red: led-2 { |
| 51 | + color = <LED_COLOR_ID_RED>; |
| 52 | + function = LED_FUNCTION_STATUS; |
| 53 | + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; |
| 54 | + panic-indicator; |
| 55 | + }; |
| 56 | + |
| 57 | + }; |
| 58 | +}; |
| 59 | + |
| 60 | +&gmac0 { |
| 61 | + nvmem-cells = <&macaddr_factory_4 1>; |
| 62 | + nvmem-cell-names = "mac-address"; |
| 63 | +}; |
| 64 | + |
| 65 | +&pcie { |
| 66 | + status = "okay"; |
| 67 | +}; |
| 68 | + |
| 69 | +&pcie1 { |
| 70 | + wifi@0,0 { |
| 71 | + compatible = "mediatek,mt76"; |
| 72 | + reg = <0x0000 0 0 0 0>; |
| 73 | + nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>; |
| 74 | + nvmem-cell-names = "eeprom", "precal"; |
| 75 | + mediatek,disable-radar-background; |
| 76 | + }; |
| 77 | +}; |
| 78 | + |
| 79 | +&spi0 { |
| 80 | + status = "okay"; |
| 81 | + |
| 82 | + flash@0 { |
| 83 | + compatible = "jedec,spi-nor"; |
| 84 | + reg = <0>; |
| 85 | + spi-max-frequency = <50000000>; |
| 86 | + #address-cells = <1>; |
| 87 | + #size-cells = <1>; |
| 88 | + |
| 89 | + partitions { |
| 90 | + compatible = "fixed-partitions"; |
| 91 | + |
| 92 | + partition@0 { |
| 93 | + label = "u-boot"; |
| 94 | + reg = <0x00000 0x30000>; |
| 95 | + read-only; |
| 96 | + }; |
| 97 | + |
| 98 | + partition@30000 { // empty (all FF) |
| 99 | + label = "config"; |
| 100 | + reg = <0x30000 0x10000>; |
| 101 | + read-only; |
| 102 | + }; |
| 103 | + |
| 104 | + partition@40000 { // empty (all FF) |
| 105 | + compatible = "u-boot,env"; |
| 106 | + label = "u-boot-env"; |
| 107 | + reg = <0x40000 0x10000>; |
| 108 | + }; |
| 109 | + |
| 110 | + partition@50000 { |
| 111 | + label = "factory"; |
| 112 | + reg = <0x50000 0x40000>; |
| 113 | + read-only; |
| 114 | + |
| 115 | + nvmem-layout { |
| 116 | + compatible = "fixed-layout"; |
| 117 | + #address-cells = <1>; |
| 118 | + #size-cells = <1>; |
| 119 | + |
| 120 | + eeprom_factory_0: eeprom@0 { |
| 121 | + reg = <0x0 0xe00>; |
| 122 | + }; |
| 123 | + |
| 124 | + macaddr_factory_4: macaddr@4 { // wifi 2.4 |
| 125 | + compatible = "mac-base"; |
| 126 | + reg = <0x4 0x6>; |
| 127 | + #nvmem-cell-cells = <1>; |
| 128 | + }; |
| 129 | + |
| 130 | + precal_factory_e10: precal@e10 { |
| 131 | + reg = <0xe10 0x19c10>; |
| 132 | + }; |
| 133 | + }; |
| 134 | + }; |
| 135 | + |
| 136 | + partition@90000 { |
| 137 | + compatible = "denx,uimage"; |
| 138 | + label = "firmware"; |
| 139 | + reg = <0x90000 0xf70000>; |
| 140 | + }; |
| 141 | + }; |
| 142 | + }; |
| 143 | +}; |
| 144 | + |
| 145 | +&state_default { |
| 146 | + gpio { |
| 147 | + groups = "i2c", "jtag", "wdt"; |
| 148 | + function = "gpio"; |
| 149 | + }; |
| 150 | +}; |
| 151 | + |
| 152 | +&switch0 { |
| 153 | + ports { |
| 154 | + port@4 { |
| 155 | + status = "okay"; |
| 156 | + label = "lan"; |
| 157 | + }; |
| 158 | + }; |
| 159 | +}; |
| 160 | + |
| 161 | +&xhci { |
| 162 | + status = "disabled"; |
| 163 | +}; |
0 commit comments