| 1 |
// SPDX-License-Identifier: GPL-2.0-only OR MIT |
| 2 |
|
| 3 |
/dts-v1/; |
| 4 |
|
| 5 |
#include "mt7981b.dtsi" |
| 6 |
#include <dt-bindings/gpio/gpio.h> |
| 7 |
#include <dt-bindings/leds/common.h> |
| 8 |
#include "dt-bindings/pinctrl/mt65xx.h" |
| 9 |
|
| 10 |
/ { |
| 11 |
compatible = "openwrt,one", "mediatek,mt7981b"; |
| 12 |
model = "OpenWrt One"; |
| 13 |
|
| 14 |
aliases { |
| 15 |
ethernet0 = &gmac1; |
| 16 |
ethernet1 = &gmac0; |
| 17 |
serial0 = &uart0; |
| 18 |
}; |
| 19 |
|
| 20 |
chosen { |
| 21 |
stdout-path = "serial0:115200n8"; |
| 22 |
}; |
| 23 |
|
| 24 |
memory@40000000 { |
| 25 |
reg = <0 0x40000000 0 0x40000000>; |
| 26 |
device_type = "memory"; |
| 27 |
}; |
| 28 |
|
| 29 |
pwm-leds { |
| 30 |
compatible = "pwm-leds"; |
| 31 |
|
| 32 |
led-0 { |
| 33 |
color = <LED_COLOR_ID_WHITE>; |
| 34 |
default-brightness = <0>; |
| 35 |
function = LED_FUNCTION_STATUS; |
| 36 |
max-brightness = <255>; |
| 37 |
pwms = <&pwm 0 10000>; |
| 38 |
}; |
| 39 |
|
| 40 |
led-1 { |
| 41 |
color = <LED_COLOR_ID_GREEN>; |
| 42 |
default-brightness = <0>; |
| 43 |
function = LED_FUNCTION_STATUS; |
| 44 |
max-brightness = <255>; |
| 45 |
pwms = <&pwm 1 10000>; |
| 46 |
}; |
| 47 |
}; |
| 48 |
|
| 49 |
gpio-leds { |
| 50 |
compatible = "gpio-leds"; |
| 51 |
|
| 52 |
led-0 { |
| 53 |
color = <LED_COLOR_ID_RED>; |
| 54 |
function = LED_FUNCTION_STATUS; |
| 55 |
gpios = <&pio 9 GPIO_ACTIVE_HIGH>; |
| 56 |
}; |
| 57 |
|
| 58 |
led-1 { |
| 59 |
color = <LED_COLOR_ID_AMBER>; |
| 60 |
function = LED_FUNCTION_LAN; |
| 61 |
gpios = <&pio 34 GPIO_ACTIVE_LOW>; |
| 62 |
linux,default-trigger = "netdev"; |
| 63 |
}; |
| 64 |
|
| 65 |
led-2 { |
| 66 |
color = <LED_COLOR_ID_GREEN>; |
| 67 |
function = LED_FUNCTION_LAN; |
| 68 |
gpios = <&pio 35 GPIO_ACTIVE_LOW>; |
| 69 |
linux,default-trigger = "netdev"; |
| 70 |
}; |
| 71 |
}; |
| 72 |
|
| 73 |
reg_3p3v: regulator-3p3v { |
| 74 |
compatible = "regulator-fixed"; |
| 75 |
regulator-name = "fixed-3.3V"; |
| 76 |
regulator-min-microvolt = <3300000>; |
| 77 |
regulator-max-microvolt = <3300000>; |
| 78 |
regulator-boot-on; |
| 79 |
regulator-always-on; |
| 80 |
}; |
| 81 |
|
| 82 |
reg_5v: regulator-5v { |
| 83 |
compatible = "regulator-fixed"; |
| 84 |
regulator-name = "fixed-5V"; |
| 85 |
regulator-min-microvolt = <5000000>; |
| 86 |
regulator-max-microvolt = <5000000>; |
| 87 |
regulator-boot-on; |
| 88 |
regulator-always-on; |
| 89 |
}; |
| 90 |
}; |
| 91 |
|
| 92 |
ð { |
| 93 |
#address-cells = <1>; |
| 94 |
#size-cells = <0>; |
| 95 |
status = "okay"; |
| 96 |
|
| 97 |
/* WAN interface */ |
| 98 |
gmac0: mac@0 { |
| 99 |
compatible = "mediatek,eth-mac"; |
| 100 |
reg = <0>; |
| 101 |
nvmem-cells = <&wan_factory_mac 0>; |
| 102 |
nvmem-cell-names = "mac-address"; |
| 103 |
phy-mode = "2500base-x"; |
| 104 |
phy-handle = <&phy15>; |
| 105 |
}; |
| 106 |
|
| 107 |
/* LAN interface */ |
| 108 |
gmac1: mac@1 { |
| 109 |
compatible = "mediatek,eth-mac"; |
| 110 |
reg = <1>; |
| 111 |
phy-mode = "gmii"; |
| 112 |
phy-handle = <&int_gbe_phy>; |
| 113 |
}; |
| 114 |
}; |
| 115 |
|
| 116 |
&mdio_bus { |
| 117 |
phy15: ethernet-phy@f { |
| 118 |
compatible = "ethernet-phy-id03a2.a411"; |
| 119 |
reg = <0xf>; |
| 120 |
interrupt-parent = <&pio>; |
| 121 |
interrupts = <38 IRQ_TYPE_LEVEL_LOW>; |
| 122 |
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; |
| 123 |
reset-assert-us = <10000>; |
| 124 |
reset-deassert-us = <20000>; |
| 125 |
airoha,pnswap-rx; |
| 126 |
|
| 127 |
leds { |
| 128 |
#address-cells = <1>; |
| 129 |
#size-cells = <0>; |
| 130 |
|
| 131 |
led@0 { |
| 132 |
reg = <0>; |
| 133 |
function = LED_FUNCTION_WAN; |
| 134 |
color = <LED_COLOR_ID_AMBER>; |
| 135 |
}; |
| 136 |
|
| 137 |
led@1 { |
| 138 |
reg = <1>; |
| 139 |
function = LED_FUNCTION_WAN; |
| 140 |
color = <LED_COLOR_ID_GREEN>; |
| 141 |
}; |
| 142 |
}; |
| 143 |
}; |
| 144 |
}; |
| 145 |
|
| 146 |
&pcie { |
| 147 |
pinctrl-names = "default"; |
| 148 |
pinctrl-0 = <&pcie_pins>; |
| 149 |
status = "okay"; |
| 150 |
}; |
| 151 |
|
| 152 |
&pio { |
| 153 |
pcie_pins: pcie-pins { |
| 154 |
mux { |
| 155 |
function = "pcie"; |
| 156 |
groups = "pcie_pereset"; |
| 157 |
}; |
| 158 |
}; |
| 159 |
|
| 160 |
pwm_pins: pwm-pins { |
| 161 |
mux { |
| 162 |
function = "pwm"; |
| 163 |
groups = "pwm0_0", "pwm1_1"; |
| 164 |
}; |
| 165 |
}; |
| 166 |
|
| 167 |
spi2_flash_pins: spi2-pins { |
| 168 |
mux { |
| 169 |
function = "spi"; |
| 170 |
groups = "spi2"; |
| 171 |
}; |
| 172 |
|
| 173 |
conf-pu { |
| 174 |
bias-pull-up = <MTK_PUPD_SET_R1R0_11>; |
| 175 |
drive-strength = <8>; |
| 176 |
pins = "SPI2_CS", "SPI2_WP"; |
| 177 |
}; |
| 178 |
|
| 179 |
conf-pd { |
| 180 |
bias-pull-down = <MTK_PUPD_SET_R1R0_11>; |
| 181 |
drive-strength = <8>; |
| 182 |
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; |
| 183 |
}; |
| 184 |
}; |
| 185 |
|
| 186 |
wifi_dbdc_pins: wifi-dbdc-pins { |
| 187 |
mux { |
| 188 |
function = "eth"; |
| 189 |
groups = "wf0_mode1"; |
| 190 |
}; |
| 191 |
|
| 192 |
conf { |
| 193 |
pins = "WF_HB1", "WF_HB2", "WF_HB3", "WF_HB4", |
| 194 |
"WF_HB0", "WF_HB0_B", "WF_HB5", "WF_HB6", |
| 195 |
"WF_HB7", "WF_HB8", "WF_HB9", "WF_HB10", |
| 196 |
"WF_TOP_CLK", "WF_TOP_DATA", "WF_XO_REQ", |
| 197 |
"WF_CBA_RESETB", "WF_DIG_RESETB"; |
| 198 |
drive-strength = <4>; |
| 199 |
}; |
| 200 |
}; |
| 201 |
}; |
| 202 |
|
| 203 |
&pwm { |
| 204 |
pinctrl-names = "default"; |
| 205 |
pinctrl-0 = <&pwm_pins>; |
| 206 |
status = "okay"; |
| 207 |
}; |
| 208 |
|
| 209 |
&spi2 { |
| 210 |
pinctrl-names = "default"; |
| 211 |
pinctrl-0 = <&spi2_flash_pins>; |
| 212 |
status = "okay"; |
| 213 |
|
| 214 |
flash@0 { |
| 215 |
compatible = "jedec,spi-nor"; |
| 216 |
reg = <0>; |
| 217 |
spi-max-frequency = <40000000>; |
| 218 |
|
| 219 |
partitions { |
| 220 |
compatible = "fixed-partitions"; |
| 221 |
#address-cells = <1>; |
| 222 |
#size-cells = <1>; |
| 223 |
|
| 224 |
partition@0 { |
| 225 |
reg = <0x00000 0x40000>; |
| 226 |
label = "bl2-nor"; |
| 227 |
}; |
| 228 |
|
| 229 |
partition@40000 { |
| 230 |
reg = <0x40000 0xc0000>; |
| 231 |
label = "factory"; |
| 232 |
read-only; |
| 233 |
|
| 234 |
nvmem-layout { |
| 235 |
compatible = "fixed-layout"; |
| 236 |
#address-cells = <1>; |
| 237 |
#size-cells = <1>; |
| 238 |
|
| 239 |
wifi_factory_calibration: eeprom@0 { |
| 240 |
reg = <0x0 0x1000>; |
| 241 |
}; |
| 242 |
|
| 243 |
wan_factory_mac: macaddr@24 { |
| 244 |
reg = <0x24 0x6>; |
| 245 |
compatible = "mac-base"; |
| 246 |
#nvmem-cell-cells = <1>; |
| 247 |
}; |
| 248 |
}; |
| 249 |
}; |
| 250 |
|
| 251 |
partition@100000 { |
| 252 |
reg = <0x100000 0x80000>; |
| 253 |
label = "fip-nor"; |
| 254 |
}; |
| 255 |
|
| 256 |
partition@180000 { |
| 257 |
reg = <0x180000 0xc80000>; |
| 258 |
label = "recovery"; |
| 259 |
}; |
| 260 |
}; |
| 261 |
}; |
| 262 |
}; |
| 263 |
|
| 264 |
&sgmiisys0 { |
| 265 |
mediatek,pnswap; |
| 266 |
}; |
| 267 |
|
| 268 |
&uart0 { |
| 269 |
status = "okay"; |
| 270 |
}; |
| 271 |
|
| 272 |
&usb_phy { |
| 273 |
status = "okay"; |
| 274 |
}; |
| 275 |
|
| 276 |
&wifi { |
| 277 |
nvmem-cells = <&wifi_factory_calibration>; |
| 278 |
nvmem-cell-names = "eeprom"; |
| 279 |
pinctrl-names = "dbdc"; |
| 280 |
pinctrl-0 = <&wifi_dbdc_pins>; |
| 281 |
status = "okay"; |
| 282 |
}; |
| 283 |
|
| 284 |
&xhci { |
| 285 |
phys = <&u2port0 PHY_TYPE_USB2>; |
| 286 |
vusb33-supply = <®_3p3v>; |
| 287 |
vbus-supply = <®_5v>; |
| 288 |
mediatek,u3p-dis-msk = <0x01>; |
| 289 |
status = "okay"; |
| 290 |
}; |