|
| 1 | +// SPDX-License-Identifier: (GPL-2.0 OR MIT) |
| 2 | +/* |
| 3 | + * Copyright (C) 2022 MediaTek Inc. |
| 4 | + |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | +#include "mt7988a.dtsi" |
| 9 | +#include <dt-bindings/gpio/gpio.h> |
| 10 | +#include <dt-bindings/input/input.h> |
| 11 | +#include <dt-bindings/leds/common.h> |
| 12 | +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> |
| 13 | + |
| 14 | +/ { |
| 15 | + model = "Bananapi BPI-R4 V00"; |
| 16 | + compatible = "bananapi,bpi-r4", |
| 17 | + "mediatek,mt7988"; |
| 18 | + |
| 19 | + aliases { |
| 20 | + serial0 = &uart0; |
| 21 | + led-boot = &led_green; |
| 22 | + led-failsafe = &led_green; |
| 23 | + led-running = &led_green; |
| 24 | + led-upgrade = &led_green; |
| 25 | + }; |
| 26 | + |
| 27 | + chosen { |
| 28 | + stdout-path = &uart0; |
| 29 | + bootargs = "console=ttyS0,115200n1 loglevel=8 pci=pcie_bus_perf"; |
| 30 | + }; |
| 31 | + |
| 32 | + memory { |
| 33 | + reg = <0x00 0x40000000 0x00 0x10000000>; |
| 34 | + }; |
| 35 | + |
| 36 | + regulator-sfp1-3v3 { |
| 37 | + compatible = "regulator-fixed"; |
| 38 | + regulator-name = "sfp1"; |
| 39 | + regulator-min-microvolt = <3300000>; |
| 40 | + regulator-max-microvolt = <3300000>; |
| 41 | + gpio = <&pio 82 GPIO_ACTIVE_LOW>; |
| 42 | + regulator-always-on; |
| 43 | + }; |
| 44 | + |
| 45 | + regulator-sfp2-3v3 { |
| 46 | + compatible = "regulator-fixed"; |
| 47 | + regulator-name = "sfp2"; |
| 48 | + regulator-min-microvolt = <3300000>; |
| 49 | + regulator-max-microvolt = <3300000>; |
| 50 | + gpio = <&pio 83 GPIO_ACTIVE_LOW>; |
| 51 | + regulator-always-on; |
| 52 | + }; |
| 53 | + |
| 54 | + /* left SFP cage (wan) using hardware i2c bus */ |
| 55 | + sfp0: sfp1-wan { |
| 56 | + compatible = "sff,sfp"; |
| 57 | + i2c-bus = <&i2c1>; |
| 58 | + mod-def0-gpios = <&pio 12 GPIO_ACTIVE_LOW>; |
| 59 | + los-gpios = <&pio 68 GPIO_ACTIVE_HIGH>; |
| 60 | + tx-disable-gpios = <&pio 11 GPIO_ACTIVE_HIGH>; |
| 61 | + rate-select0-gpios = <&pio 54 GPIO_ACTIVE_LOW>; |
| 62 | + maximum-power-milliwatt = <3000>; |
| 63 | + }; |
| 64 | + |
| 65 | + /* i2c of the right SFP cage (lan) */ |
| 66 | + i2c_sfp2: i2c-gpio-0 { |
| 67 | + compatible = "i2c-gpio"; |
| 68 | + sda-gpios = <&pio 51 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| 69 | + scl-gpios = <&pio 53 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| 70 | + i2c-gpio,delay-us = <2>; |
| 71 | + #address-cells = <1>; |
| 72 | + #size-cells = <0>; |
| 73 | + }; |
| 74 | + |
| 75 | + sfp1: sfp2-lan { |
| 76 | + compatible = "sff,sfp"; |
| 77 | + i2c-bus = <&i2c_sfp2>; |
| 78 | + mod-def0-gpios = <&pio 52 GPIO_ACTIVE_LOW>; |
| 79 | + los-gpios = <&pio 80 GPIO_ACTIVE_HIGH>; |
| 80 | + tx-disable-gpios = <&pio 21 GPIO_ACTIVE_HIGH>; |
| 81 | + rate-select0-gpios = <&pio 81 GPIO_ACTIVE_LOW>; |
| 82 | + maximum-power-milliwatt = <3000>; |
| 83 | + }; |
| 84 | + |
| 85 | + gpio-keys { |
| 86 | + compatible = "gpio-keys"; |
| 87 | + |
| 88 | + factory { |
| 89 | + label = "RST"; |
| 90 | + linux,code = <KEY_RESTART>; |
| 91 | + gpios = <&pio 13 GPIO_ACTIVE_LOW>; |
| 92 | + }; |
| 93 | + |
| 94 | + wps { |
| 95 | + label = "WPS"; |
| 96 | + linux,code = <KEY_WPS_BUTTON>; |
| 97 | + gpios = <&pio 14 GPIO_ACTIVE_LOW>; |
| 98 | + }; |
| 99 | + }; |
| 100 | + |
| 101 | + gpio-leds { |
| 102 | + compatible = "gpio-leds"; |
| 103 | + |
| 104 | + led_green: led-green { |
| 105 | + label = "status:green"; |
| 106 | + function = LED_FUNCTION_STATUS; |
| 107 | + color = <LED_COLOR_ID_GREEN>; |
| 108 | + gpios = <&pio 64 GPIO_ACTIVE_HIGH>; |
| 109 | + default-state = "on"; |
| 110 | + }; |
| 111 | + |
| 112 | + led_blue: led-blue { |
| 113 | + label = "wps:blue"; |
| 114 | + function = LED_FUNCTION_WPS; |
| 115 | + color = <LED_COLOR_ID_BLUE>; |
| 116 | + gpios = <&pio 65 GPIO_ACTIVE_HIGH>; |
| 117 | + default-state = "off"; |
| 118 | + }; |
| 119 | + }; |
| 120 | +}; |
| 121 | + |
| 122 | +ð { |
| 123 | + status = "okay"; |
| 124 | +}; |
| 125 | + |
| 126 | +&gmac0 { |
| 127 | + status = "okay"; |
| 128 | +}; |
| 129 | + |
| 130 | +&gmac1 { |
| 131 | + sfp = <&sfp1>; |
| 132 | + managed = "in-band-status"; |
| 133 | + phy-mode = "usxgmii"; |
| 134 | + status = "okay"; |
| 135 | +}; |
| 136 | + |
| 137 | +&gmac2 { |
| 138 | + sfp = <&sfp0>; |
| 139 | + managed = "in-band-status"; |
| 140 | + phy-mode = "usxgmii"; |
| 141 | + status = "okay"; |
| 142 | +}; |
| 143 | + |
| 144 | +&switch { |
| 145 | + status = "okay"; |
| 146 | +}; |
| 147 | + |
| 148 | +&gsw_phy0 { |
| 149 | + pinctrl-names = "gbe-led"; |
| 150 | + pinctrl-0 = <&gbe0_led1_pins>; |
| 151 | +}; |
| 152 | + |
| 153 | +&gsw_phy0_led1 { |
| 154 | + status = "okay"; |
| 155 | + color = <LED_COLOR_ID_GREEN>; |
| 156 | +}; |
| 157 | + |
| 158 | +&gsw_phy1 { |
| 159 | + pinctrl-names = "gbe-led"; |
| 160 | + pinctrl-0 = <&gbe1_led1_pins>; |
| 161 | +}; |
| 162 | + |
| 163 | +&gsw_phy1_led1 { |
| 164 | + status = "okay"; |
| 165 | + color = <LED_COLOR_ID_GREEN>; |
| 166 | +}; |
| 167 | + |
| 168 | +&gsw_phy2 { |
| 169 | + pinctrl-names = "gbe-led"; |
| 170 | + pinctrl-0 = <&gbe2_led1_pins>; |
| 171 | +}; |
| 172 | + |
| 173 | +&gsw_phy2_led1 { |
| 174 | + status = "okay"; |
| 175 | + color = <LED_COLOR_ID_GREEN>; |
| 176 | +}; |
| 177 | + |
| 178 | +&gsw_phy3 { |
| 179 | + pinctrl-names = "gbe-led"; |
| 180 | + pinctrl-0 = <&gbe3_led1_pins>; |
| 181 | +}; |
| 182 | + |
| 183 | +&gsw_phy3_led1 { |
| 184 | + status = "okay"; |
| 185 | + color = <LED_COLOR_ID_GREEN>; |
| 186 | +}; |
| 187 | + |
| 188 | +&cpu0 { |
| 189 | + proc-supply = <&rt5190_buck3>; |
| 190 | +}; |
| 191 | + |
| 192 | +&cpu1 { |
| 193 | + proc-supply = <&rt5190_buck3>; |
| 194 | +}; |
| 195 | + |
| 196 | +&cpu2 { |
| 197 | + proc-supply = <&rt5190_buck3>; |
| 198 | +}; |
| 199 | + |
| 200 | +&cpu3 { |
| 201 | + proc-supply = <&rt5190_buck3>; |
| 202 | +}; |
| 203 | + |
| 204 | +&cci { |
| 205 | + proc-supply = <&rt5190_buck3>; |
| 206 | +}; |
| 207 | + |
| 208 | +&i2c0 { |
| 209 | + pinctrl-names = "default"; |
| 210 | + pinctrl-0 = <&i2c0_pins>; |
| 211 | + status = "okay"; |
| 212 | + |
| 213 | + rt5190a_64: rt5190a@64 { |
| 214 | + compatible = "richtek,rt5190a"; |
| 215 | + reg = <0x64>; |
| 216 | + vin2-supply = <&rt5190_buck1>; |
| 217 | + vin3-supply = <&rt5190_buck1>; |
| 218 | + vin4-supply = <&rt5190_buck1>; |
| 219 | + |
| 220 | + regulators { |
| 221 | + rt5190_buck1: buck1 { |
| 222 | + regulator-name = "rt5190a-buck1"; |
| 223 | + regulator-min-microvolt = <5090000>; |
| 224 | + regulator-max-microvolt = <5090000>; |
| 225 | + regulator-allowed-modes = |
| 226 | + <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>; |
| 227 | + regulator-boot-on; |
| 228 | + regulator-always-on; |
| 229 | + }; |
| 230 | + buck2 { |
| 231 | + regulator-name = "vcore"; |
| 232 | + regulator-min-microvolt = <600000>; |
| 233 | + regulator-max-microvolt = <1400000>; |
| 234 | + regulator-boot-on; |
| 235 | + regulator-always-on; |
| 236 | + }; |
| 237 | + rt5190_buck3: buck3 { |
| 238 | + regulator-name = "vproc"; |
| 239 | + regulator-min-microvolt = <600000>; |
| 240 | + regulator-max-microvolt = <1400000>; |
| 241 | + regulator-boot-on; |
| 242 | + }; |
| 243 | + buck4 { |
| 244 | + regulator-name = "rt5190a-buck4"; |
| 245 | + regulator-min-microvolt = <850000>; |
| 246 | + regulator-max-microvolt = <850000>; |
| 247 | + regulator-allowed-modes = |
| 248 | + <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>; |
| 249 | + regulator-boot-on; |
| 250 | + regulator-always-on; |
| 251 | + }; |
| 252 | + ldo { |
| 253 | + regulator-name = "rt5190a-ldo"; |
| 254 | + regulator-min-microvolt = <1200000>; |
| 255 | + regulator-max-microvolt = <1200000>; |
| 256 | + regulator-boot-on; |
| 257 | + regulator-always-on; |
| 258 | + }; |
| 259 | + }; |
| 260 | + }; |
| 261 | +}; |
| 262 | + |
| 263 | +&i2c1 { |
| 264 | + pinctrl-names = "default"; |
| 265 | + pinctrl-0 = <&i2c1_sfp_pins>; |
| 266 | + status = "okay"; |
| 267 | +}; |
| 268 | + |
| 269 | +&i2c2 { |
| 270 | + pinctrl-names = "default"; |
| 271 | + pinctrl-0 = <&i2c2_1_pins>; |
| 272 | + status = "okay"; |
| 273 | + |
| 274 | + eeprom@50 { |
| 275 | + compatible = "atmel,24c02"; |
| 276 | + reg = <0x50>; |
| 277 | + address-bits = <0x08>; |
| 278 | + page-size = <0x08>; |
| 279 | + size = <0x100>; |
| 280 | + }; |
| 281 | + |
| 282 | + pcf8563: rtc@51 { |
| 283 | + compatible = "nxp,pcf8563"; |
| 284 | + reg = <0x51>; |
| 285 | + status = "disabled"; |
| 286 | + }; |
| 287 | +}; |
| 288 | + |
| 289 | +&pcie0 { |
| 290 | + pinctrl-names = "default"; |
| 291 | + pinctrl-0 = <&pcie0_pins>; |
| 292 | + status = "okay"; |
| 293 | +}; |
| 294 | + |
| 295 | +&pcie1 { |
| 296 | + pinctrl-names = "default"; |
| 297 | + pinctrl-0 = <&pcie1_pins>; |
| 298 | + status = "okay"; |
| 299 | +}; |
| 300 | + |
| 301 | +&pcie2 { |
| 302 | + status = "disabled"; |
| 303 | +}; |
| 304 | + |
| 305 | +&pcie3 { |
| 306 | + pinctrl-names = "default"; |
| 307 | + pinctrl-0 = <&pcie3_pins>; |
| 308 | + status = "okay"; |
| 309 | +}; |
| 310 | + |
| 311 | +&ssusb0 { |
| 312 | + status = "okay"; |
| 313 | +}; |
| 314 | + |
| 315 | +&ssusb1 { |
| 316 | + status = "okay"; |
| 317 | +}; |
| 318 | + |
| 319 | +&tphy { |
| 320 | + status = "okay"; |
| 321 | +}; |
| 322 | + |
| 323 | +&spi0 { |
| 324 | + pinctrl-names = "default"; |
| 325 | + pinctrl-0 = <&spi0_flash_pins>; |
| 326 | + status = "okay"; |
| 327 | + |
| 328 | + spi_nand: nand@0 { |
| 329 | + compatible = "spi-nand"; |
| 330 | + reg = <0>; |
| 331 | + spi-max-frequency = <52000000>; |
| 332 | + spi-tx-buswidth = <4>; |
| 333 | + spi-rx-buswidth = <4>; |
| 334 | + }; |
| 335 | +}; |
| 336 | + |
| 337 | +&spi_nand { |
| 338 | + partitions { |
| 339 | + compatible = "fixed-partitions"; |
| 340 | + #address-cells = <1>; |
| 341 | + #size-cells = <1>; |
| 342 | + |
| 343 | + partition@0 { |
| 344 | + label = "bl2"; |
| 345 | + reg = <0x0 0x100000>; |
| 346 | + read-only; |
| 347 | + }; |
| 348 | + |
| 349 | + partition@100000 { |
| 350 | + label = "reserved"; |
| 351 | + reg = <0x100000 0x480000>; |
| 352 | + read-only; |
| 353 | + }; |
| 354 | + |
| 355 | + partition@580000 { |
| 356 | + label = "fip"; |
| 357 | + reg = <0x580000 0x0200000>; |
| 358 | + read-only; |
| 359 | + }; |
| 360 | + |
| 361 | + partition@780000 { |
| 362 | + label = "ubi"; |
| 363 | + reg = <0x780000 0x7880000>; |
| 364 | + compatible = "linux,ubi"; |
| 365 | + }; |
| 366 | + }; |
| 367 | +}; |
| 368 | + |
| 369 | +&uart0 { |
| 370 | + status = "okay"; |
| 371 | +}; |
| 372 | + |
| 373 | +&watchdog { |
| 374 | + status = "okay"; |
| 375 | +}; |
| 376 | + |
| 377 | +&xphy { |
| 378 | + status = "okay"; |
| 379 | +}; |