Skip to content

Commit

Permalink
apm821xx: migrate to DSA
Browse files Browse the repository at this point in the history
The qca8k driver is upstream, unlike swconfig. This applies to the mx60
and wndr4700 only. Fixed up LED definitions as well.

RTL83xx DSA for WNDAP62300/660 is not working.

Signed-off-by: Rosen Penev <[email protected]>
Link: openwrt#14037
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
neheb authored and robimarko committed Sep 15, 2024
1 parent 9d663c7 commit 5815884
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 40 deletions.
12 changes: 2 additions & 10 deletions target/linux/apm821xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ meraki,mr24)
ucidef_set_led_wlan "wlan2g_0" "WIFI 2.4GHz-0" "green:wlan-3" "phy0radio"
;;

meraki,mx60)
ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
ucidef_set_led_switch "lan1" "LAN1" "green:lan-0" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "green:lan-1" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "green:lan-2" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "green:lan-3" "switch0" "0x02"
;;

netgear,wndap620)
ucidef_set_led_switch "lan_act" "LAN (Activity)" "green:activity" "switch0" "0x04" "0x0f" "rx tx"
ucidef_set_led_switch "lan_100" "LAN 100Mbps" "amber:lan" "switch0" "0x04" "0x04" "link"
Expand All @@ -39,8 +31,8 @@ netgear,wndap660)
;;

netgear,wndr4700)
ucidef_set_led_switch "wan_green" "WAN (green)" "green:wan" "switch0" "0x20"
ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "yellow:wan" "eth0.2" "tx rx"
ucidef_set_led_netdev "wan_green" "WAN (green)" "green:wan" "wan" "link"
ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "yellow:wan" "wan" "tx rx"
;;

esac
Expand Down
3 changes: 1 addition & 2 deletions target/linux/apm821xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ netgear,wndap660)
;;
meraki,mx60|\
netgear,wndr4700)
ucidef_add_switch "switch0" \
"0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan"
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;

*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meraki,mx60|\
netgear,wndap620|\
netgear,wndap660|\
netgear,wndr4700)
uci set system.@system[0].compat_version="2.0"
uci set system.@system[0].compat_version="3.0"
uci commit system
;;
esac
Expand Down
240 changes: 229 additions & 11 deletions target/linux/apm821xx/dts/meraki-mx60.dts
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,241 @@

&EMAC0 {
status = "okay";
phy-handle = <&phy0>;

fixed-link {
speed = <1000>;
full-duplex;
};

mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@0 {

phy_port1: phy@0 {
compatible = "ethernet-phy-id004d.d034";
reg = <0>;
qca,mib-poll-interval = <500>;

qca,ar8327-initvals = <
0x0010 0x40000000
0x0624 0x007f7f7f
0x0004 0x07a00000 /* PAD0_MODE */
0x000c 0x01000000 /* PAD6_MODE */
0x007c 0x0000007e /* PORT0_STATUS */
>;
};

phy_port2: phy@1 {
compatible = "ethernet-phy-id004d.d034";
reg = <1>;
};

phy_port3: phy@2 {
compatible = "ethernet-phy-id004d.d034";
reg = <2>;
};

phy_port4: phy@3 {
compatible = "ethernet-phy-id004d.d034";
reg = <3>;
};

phy_port5: phy@4 {
compatible = "ethernet-phy-id004d.d034";
reg = <4>;
};

switch0@10 {
compatible = "qca,qca8327";
reg = <0x10>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
ethernet = <&EMAC0>;
phy-mode = "rgmii-id";
tx-internal-delay-ps = <2000>;

fixed-link {
speed = <1000>;
full-duplex;
};
};

port@1 {
reg = <1>;
label = "lan4";
phy-mode = "internal";
phy-handle = <&phy_port1>;

leds {
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};

led@1 {
reg = <1>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
default-state = "keep";
};
};
};

port@2 {
reg = <2>;
label = "lan3";
phy-mode = "internal";
phy-handle = <&phy_port2>;

leds {
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};

led@1 {
reg = <1>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
default-state = "keep";
};
};
};

port@3 {
reg = <3>;
label = "lan2";
phy-mode = "internal";
phy-handle = <&phy_port3>;

leds {
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};

led@1 {
reg = <1>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
default-state = "keep";
};
};
};

port@4 {
reg = <4>;
label = "lan1";
phy-mode = "internal";
phy-handle = <&phy_port4>;

leds {
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};

led@1 {
reg = <1>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
default-state = "keep";
};
};
};

port@5 {
reg = <5>;
label = "wan";
phy-mode = "internal";
phy-handle = <&phy_port5>;

leds {
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
function-enumerator = <0>;
default-state = "keep";
};

led@1 {
reg = <1>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_WAN;
function-enumerator = <1>;
default-state = "keep";
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
function-enumerator = <2>;
default-state = "keep";
};
};
};
};
};
};
};
Expand Down
Loading

0 comments on commit 5815884

Please sign in to comment.