ramips: dir878/jdcloud: convert to DSA

This commit is contained in:
AmadeusGhost 2020-05-27 16:10:51 +08:00
parent 522db861ae
commit c8a3e6838a
4 changed files with 71 additions and 22 deletions

View File

@ -15,7 +15,7 @@
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_net_orange;
label-mac-device = &ethernet;
label-mac-device = &gmac0;
};
chosen {
@ -27,22 +27,22 @@
led_power_orange: power_orange {
label = "dir-878-a1:orange:power";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
led_power_green: power_green {
label = "dir-878-a1:green:power";
gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
led_net_orange: net_orange {
label = "dir-878-a1:orange:net";
gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
net_green {
label = "dir-878-a1:green:net";
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
};
@ -51,19 +51,19 @@
reset {
label = "reset";
gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
wifi {
label = "wifi";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};
@ -76,7 +76,6 @@
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
@ -140,14 +139,43 @@
};
};
&ethernet {
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
mediatek,portmap = "llllw";
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan4";
};
port@1 {
status = "okay";
label = "lan3";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};
&state_default {
gpio {
groups = "i2c", "uart3", "jtag", "wdt";
groups = "uart3", "jtag", "wdt";
function = "gpio";
};
};

View File

@ -15,7 +15,7 @@
led-failsafe = &led_red;
led-running = &led_green;
led-upgrade = &led_blue;
label-mac-device = &ethernet;
label-mac-device = &gmac0;
};
chosen {
@ -27,7 +27,7 @@
reset {
label = "reset";
gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
@ -37,18 +37,18 @@
led_red: red {
label = "jdcloud:red:sys";
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
panic-indicator;
};
led_green: green {
label = "jdcloud:green:sys";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
led_blue: blue {
label = "jdcloud:blue:sys";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
};
};
@ -109,10 +109,29 @@
};
};
&ethernet {
&gmac0 {
mtd-mac-address-ascii = <&config 0x4429>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan1";
};
port@2 {
status = "okay";
label = "lan2";
};
};
};
&pcie {
status = "okay";
};

View File

@ -235,13 +235,13 @@ define Device/dlink_dir-878-a1
BLOCKSIZE := 64k
IMAGE_SIZE := 16000k
DEVICE_VENDOR := D-Link
IMAGES += factory.bin
DEVICE_MODEL := DIR-878
DEVICE_VARIANT := A1
DEVICE_PACKAGES := kmod-mt7615e wpad-openssl
KERNEL_INITRAMFS := $$(KERNEL) | ubootpad96
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | ubootpad96 |\
pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
IMAGE/factory.bin := append-kernel | append-rootfs | ubootpad96 |\
check-size $$$$(IMAGE_SIZE)
endef
@ -482,7 +482,8 @@ define Device/jdcloud_re-sp-01b
IMAGE_SIZE := 27328k
DEVICE_VENDOR := JDCloud
DEVICE_MODEL := RE-SP-01B
DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 kmod-usb3 wpad-openssl
DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 \
kmod-usb3 wpad-openssl
endef
TARGET_DEVICES += jdcloud_re-sp-01b

View File

@ -26,7 +26,8 @@ d-team,pbr-m1|\
gehua,ghl-r-001)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
;;
dlink,dir-860l-b1)
dlink,dir-860l-b1|\
dlink,dir-878-a1)
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
;;
gnubee,gb-pc1|\