forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] ath79: support Mikrotik RouterBOARD 2011-UiAS-2HnD
TODO: - SFP probes but no link status or link establishment - Unknown connection to display and touch panel, but some documentation is available (connected via bitbanged SPI) Cobbled-up-by: Lech Perczak <[email protected]>
- Loading branch information
Showing
7 changed files
with
360 additions
and
0 deletions.
There are no files selected for viewing
311 changes: 311 additions & 0 deletions
311
target/linux/ath79/dts/ar9344_mikrotik_routerboard-2011uias-2hnd.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,311 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT | ||
|
||
#include "ar9344.dtsi" | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/input/input.h> | ||
|
||
/ { | ||
model = "MikroTik RouterBOARD 2011UiAS-2HnD"; | ||
compatible = "mikrotik,routerboard-2011uias-2hnd", "qca,ar9344"; | ||
|
||
aliases { | ||
led-boot = &led_user; | ||
led-failsafe = &led_user; | ||
led-running = &led_user; | ||
led-upgrade = &led_user; | ||
}; | ||
|
||
keys { | ||
compatible = "gpio-keys"; | ||
|
||
reset { | ||
label = "reset"; | ||
linux,code = <KEY_RESTART>; | ||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; | ||
debounce-interval = <60>; | ||
}; | ||
}; | ||
|
||
beeper { | ||
compatible = "gpio-beeper"; | ||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
sfp_i2c: i2c-gpio { | ||
compatible = "i2c-gpio"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
sda-gpios = <&gpio 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; | ||
scl-gpios = <&gpio 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; | ||
i2c-gpio,delay-us = <2>; | ||
}; | ||
|
||
sfp_port: sfp { | ||
compatible = "sff,sfp"; | ||
i2c-bus = <&sfp_i2c>; | ||
los-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; | ||
maximum-power-milliwatt = <1000>; | ||
}; | ||
|
||
gpio-export { | ||
compatible = "gpio-export"; | ||
|
||
gpio_poe_status { | ||
gpio-export,name = "poe:status"; | ||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
gpio_usb_power { | ||
gpio-export,name = "usb:power"; | ||
gpio-export,output = <0>; | ||
gpios = <&gpio 20 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
gpio_poe_out { | ||
gpio-export,name = "poe:power"; | ||
gpio-export,output = <1>; | ||
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
}; | ||
|
||
&ref { | ||
clock-frequency = <25000000>; | ||
}; | ||
|
||
&gpio { | ||
nand-nce { | ||
gpio-hog; | ||
gpios = <14 GPIO_ACTIVE_LOW>; | ||
output-high; | ||
line-name = "nand-nce"; | ||
}; | ||
}; | ||
|
||
&nand { | ||
status = "okay"; | ||
|
||
nand-ecc-mode = "soft"; | ||
nand-ecc-step-size = <2048>; | ||
qca,nand-swap-dma; | ||
qca,nand-scan-fixup; | ||
|
||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
partition@0 { | ||
label = "booter"; | ||
reg = <0x0000000 0x0040000>; | ||
read-only; | ||
}; | ||
|
||
partition@40000 { | ||
label = "kernel"; | ||
reg = <0x0040000 0x03c0000>; | ||
}; | ||
|
||
partition@400000 { | ||
label = "ubi"; | ||
reg = <0x0400000 0x0>; | ||
}; | ||
}; | ||
}; | ||
|
||
&spi { | ||
status = "okay"; | ||
|
||
flash@0 { | ||
compatible = "jedec,spi-nor"; | ||
reg = <0>; | ||
spi-max-frequency = <25000000>; | ||
|
||
partitions { | ||
compatible = "mikrotik,routerboot-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
partition@0 { | ||
label = "routerboot"; | ||
reg = <0x0 0x0>; | ||
read-only; | ||
}; | ||
|
||
hard_config { | ||
read-only; | ||
|
||
nvmem-layout { | ||
compatible = "fixed-layout"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
macaddr_hardconfig_10: macaddr@10 { | ||
compatible = "mac-base"; | ||
reg = <0x10 0x6>; | ||
#nvmem-cell-cells = <1>; | ||
}; | ||
}; | ||
}; | ||
|
||
bios { | ||
size = <0x1000>; | ||
read-only; | ||
}; | ||
|
||
soft_config { | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
&mdio0 { | ||
status = "okay"; | ||
|
||
phy0: ethernet-phy@0 { | ||
reg = <0>; | ||
phy-mode = "rgmii"; | ||
|
||
qca,ar8327-initvals = < | ||
0x04 0x07C00000 /* PORT0 PAD MODE CTRL */ | ||
0x0C 0x00000080 /* PORT6 PAD MODE CTRL */ | ||
0x10 0x80000080 /* POWER_ON_STRAP */ | ||
0x50 0xc731c731 /* LED_CTRL0 */ | ||
0x54 0x00000000 /* LED_CTRL1 */ | ||
0x58 0x00000000 /* LED_CTRL2 */ | ||
0x5c 0x0030c300 /* LED_CTRL3 */ | ||
0x7c 0x0000007e /* PORT0_STATUS */ | ||
0x94 0x0000007e /* PORT6_STATUS */ | ||
0xE0 0xc70167d0 /* SGMII_CTRL */ | ||
>; | ||
|
||
sfp_phy: ethernet-phy@6 { | ||
reg = <6>; | ||
sfp = <&sfp_port>; | ||
}; | ||
|
||
leds { | ||
led@0 { | ||
reg = <0>; | ||
label = "green:eth1"; | ||
qca,led_mode = <0>; | ||
}; | ||
|
||
led@1 { | ||
reg = <1>; | ||
label = "green:eth6"; | ||
qca,led_mode = <1>; | ||
}; | ||
|
||
led@3 { | ||
reg = <3>; | ||
label = "green:eth2"; | ||
qca,led_mode = <0>; | ||
}; | ||
|
||
led@4 { | ||
reg = <4>; | ||
label = "green:eth7"; | ||
qca,led_mode = <1>; | ||
}; | ||
|
||
led@6 { | ||
reg = <6>; | ||
label = "green:eth3"; | ||
qca,led_mode = <0>; | ||
}; | ||
|
||
led@7 { | ||
reg = <7>; | ||
label = "green:eth8"; | ||
qca,led_mode = <1>; | ||
}; | ||
|
||
led@9 { | ||
reg = <9>; | ||
label = "green:eth4"; | ||
qca,led_mode = <0>; | ||
}; | ||
|
||
led@10 { | ||
reg = <10>; | ||
label = "green:eth9"; | ||
qca,led_mode = <1>; | ||
}; | ||
|
||
led@12 { | ||
reg = <12>; | ||
label = "green:eth5"; | ||
qca,led_mode = <0>; | ||
}; | ||
|
||
led@13 { | ||
reg = <13>; | ||
label = "green:eth10"; | ||
qca,led_mode = <1>; | ||
}; | ||
|
||
led_user: led@14 { | ||
reg = <14>; | ||
label = "green:user"; | ||
qca,led_mode = <1>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
ð0 { | ||
status = "okay"; | ||
|
||
/* default for ar934x, except for 1000M */ | ||
pll-data = <0x6f000000 0x00000101 0x00001616>; | ||
|
||
phy-mode = "rgmii"; | ||
phy-handle = <&phy0>; | ||
|
||
nvmem-cells = <&macaddr_hardconfig_10 0>; | ||
nvmem-cell-names = "mac-address"; | ||
|
||
gmac-config { | ||
device = <&gmac>; | ||
rgmii-gmac0 = <1>; | ||
switch-phy-swap = <0>; | ||
switch-only-mode = <1>; | ||
rxd-delay = <1>; | ||
}; | ||
|
||
port@6 { | ||
compatible = "swconfig,port"; | ||
phy-handle = <&sfp_phy>; | ||
reg = <6>; | ||
swconfig,segment = "lan"; | ||
swconfig,portmap = <7 7>; | ||
}; | ||
}; | ||
|
||
&builtin_switch { | ||
/delete-property/ qca,phy4-mii-enable; | ||
}; | ||
|
||
ð1 { | ||
status = "okay"; | ||
|
||
nvmem-cells = <&macaddr_hardconfig_10 5>; | ||
nvmem-cell-names = "mac-address"; | ||
}; | ||
|
||
&usb { | ||
status = "okay"; | ||
}; | ||
|
||
&usb_phy { | ||
status = "okay"; | ||
}; | ||
|
||
&wmac { | ||
status = "okay"; | ||
|
||
qca,no-eeprom; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
target/linux/ath79/mikrotik/base-files/etc/board.d/03_gpio_switches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (C) 2023 OpenWrt.org | ||
# | ||
|
||
. /lib/functions/uci-defaults.sh | ||
|
||
board_config_update | ||
|
||
board=$(board_name) | ||
|
||
case "$board" in | ||
mikrotik,routerboar-2011uias-2hnd) | ||
ucidef_add_gpio_switch "usb_power" "USB host power" "20" "1" | ||
ucidef_add_gpio_switch "poe_port10_out_power" "PoE outuput on port 10" "2" "0" | ||
;; | ||
esac | ||
|
||
board_config_flush | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.