@@ -1604,7 +1604,7 @@ void ksz8_config_cpu_port(struct dsa_switch *ds)
masks = dev->info->masks;
regs = dev->info->regs;
- ksz_cfg(dev, regs[S_TAIL_TAG_CTRL], masks[SW_TAIL_TAG_ENABLE], true);
+ ksz_cfg(dev, regs[S_TAIL_TAG_CTRL], masks[SW_TAIL_TAG_ENABLE], !dev->no_tag_proto);
ksz8_port_setup(dev, dev->cpu_port, true);
@@ -1195,7 +1195,7 @@ void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
/* enable tag tail for host port */
if (cpu_port)
ksz_port_cfg(dev, port, REG_PORT_CTRL_0, PORT_TAIL_TAG_ENABLE,
- true);
+ !dev->no_tag_proto);
ksz9477_port_queue_split(dev, port);
@@ -2882,9 +2882,7 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds,
struct ksz_device *dev = ds->priv;
enum dsa_tag_protocol proto = DSA_TAG_PROTO_NONE;
- if (dev->chip_id == KSZ8795_CHIP_ID ||
- dev->chip_id == KSZ8794_CHIP_ID ||
- dev->chip_id == KSZ8765_CHIP_ID)
+ if (ksz_is_ksz87xx(dev))
proto = DSA_TAG_PROTO_KSZ8795;
if (dev->chip_id == KSZ8830_CHIP_ID ||
@@ -2903,6 +2901,9 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds,
if (is_lan937x(dev))
proto = DSA_TAG_PROTO_LAN937X;
+ if (dev->no_tag_proto)
+ proto = DSA_TAG_PROTO_NONE;
+
return proto;
}
@@ -2912,6 +2913,8 @@ static int ksz_connect_tag_protocol(struct dsa_switch *ds,
struct ksz_tagger_data *tagger_data;
switch (proto) {
+ case DSA_TAG_PROTO_NONE:
+ return 0;
case DSA_TAG_PROTO_KSZ8795:
return 0;
case DSA_TAG_PROTO_KSZ9893:
@@ -4459,6 +4462,8 @@ int ksz_switch_register(struct ksz_device *dev)
dev->wakeup_source = of_property_read_bool(dev->dev->of_node,
"wakeup-source");
+ dev->no_tag_proto = of_property_read_bool(dev->dev->of_node,
+ "microchip,no-tag-protocol");
}
ret = dsa_register_switch(dev->ds);
@@ -174,6 +174,7 @@ struct ksz_device {
bool synclko_125;
bool synclko_disable;
bool wakeup_source;
+ bool no_tag_proto;
struct vlan_table *vlan_cache;
@@ -182,7 +182,7 @@ void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port)
/* enable tag tail for host port */
if (cpu_port)
lan937x_port_cfg(dev, port, REG_PORT_CTRL_0,
- PORT_TAIL_TAG_ENABLE, true);
+ PORT_TAIL_TAG_ENABLE, !dev->no_tag_proto);
/* Enable the Port Queue split */
ksz9477_port_queue_split(dev, port);