so,3 questions.
1.in mvebu, there is dsa driver in 4.14or 4.19(I see in config-4.14),
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
# CONFIG_NET_DSA_MV88E6XXX_PTP is not set
CONFIG_NET_DSA_TAG_DSA=y
CONFIG_NET_DSA_TAG_EDSA=y
CONFIG_NET_SWITCHDEV=y
does the dsa used tag protocol conflict with 802.1q vlan?
I thought dsa driver use one cpu port to make a tree of switch, to expose each slave phy port, and the 802.1q controls vlans , am swconfig controls vlan table inside the 6171, so don't conflict Am I right?
-
linksys,caiman|\
linksys,cobra|\
linksys,mamba|\
linksys,rango|\
linksys,shelby|\
linksys,venom)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
;;
take an example as 0:lan:4, what is the second ":" mean, the first 0 is port number.
and what is 5@eth0 port 5?@means connected to cpu?
3.I take a look on source code of mvsw61xx.c
if (of_property_read_u32(np, "cpu-port-0", &val)) {
dev_err(&pdev->dev, "CPU port not set\n");
err = -ENODEV;
goto out_err;
}
state->cpu_port0 = val;
if (!of_property_read_u32(np, "cpu-port-1", &val))
state->cpu_port1 = val;
else
state->cpu_port1 = -1;
state->dev.vlans = MV_VLANS;
state->dev.cpu_port = state->cpu_port0;
state->dev.ports = MV_PORTS;
state->dev.name = model_str;
state->dev.ops = &mvsw61xx_ops;
state->dev.alias = dev_name(&pdev->dev);
_mvsw61xx_reset(&state->dev, true);
err = register_switch(&state->dev, NULL);
if (err < 0)
goto out_err;
state->registered = true;
return 0;
out_err:
kfree(state);
return err;
}
to set cpu port 0 just affect "state->dev.cpu_port = state->cpu_port0;"
in mvsw61xx then "if (nla_put_u32(msg, SWITCH_ATTR_CPU_PORT, dev->cpu_port))"
in swconfig.c
to set cpu port1 affect
if (!of_property_read_u32(np, "cpu-port-1", &val))
state->cpu_port1 = val;
and no following. so what the function it is?
-
I drive 6171 with kernel dsa without mvsw61xx got lan1 lan2 lan3 lan4 and wan, I tried
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 " "wan"
it works. is lan1 lan2... and wan isolated by the switch internal tag protocol?
thanks!!
btw:
my device seems has problem,
+ port@5 {
+ reg = <5>;
+ label = "cpu";
+ ethernet = <ð1port>;
+ **phy-mode = "rgmii-id";**
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ port@6 {
+ reg = <6>;
+ label = "aux";
+ ethernet = <ð0port>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
I try dsa driver with switch port 5 and port 6 each time with one port as cpu port . port 5 must to use phy-mode = "rgmii-id"; otherwise no receive package, is it due to hardware design bug? port 6 always ok.