@@ -644,6 +644,7 @@ EXPORT_SYMBOL(b53_brcm_hdr_setup);
static void b53_enable_cpu_port(struct b53_device *dev, int port)
{
+ u32 port_mask;
u8 port_ctrl;
/* BCM5325 CPU port is at 8 */
@@ -658,6 +659,14 @@ static void b53_enable_cpu_port(struct b53_device *dev, int port)
b53_brcm_hdr_setup(dev->ds, port);
b53_br_egress_floods(dev->ds, port, true, true);
+
+ b53_read32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, &port_mask);
+
+ if (dev->chip_id == BCM583XX_DEVICE_ID)
+ port_mask |= JPM_10_100_JUMBO_EN;
+
+ port_mask |= BIT(port);
+ b53_write32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, port_mask);
}
static void b53_enable_mib(struct b53_device *dev)
@@ -2065,6 +2074,30 @@ int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
}
EXPORT_SYMBOL(b53_set_mac_eee);
+static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
+{
+ struct b53_device *dev = ds->priv;
+ u32 port_mask;
+
+ if (dev->chip_id == BCM58XX_DEVICE_ID ||
+ is5325(dev) || is5365(dev))
+ return -EOPNOTSUPP;
+
+ b53_read32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, &port_mask);
+
+ if (mtu >= JMS_MIN_SIZE)
+ port_mask |= BIT(port);
+ else
+ port_mask &= ~BIT(port);
+
+ return b53_write32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, port_mask);
+}
+
+static int b53_get_max_mtu(struct dsa_switch *ds, int port)
+{
+ return JMS_MAX_SIZE;
+}
+
static const struct dsa_switch_ops b53_switch_ops = {
.get_tag_protocol = b53_get_tag_protocol,
.setup = b53_setup,
@@ -2102,6 +2135,8 @@ static const struct dsa_switch_ops b53_switch_ops = {
.port_mdb_prepare = b53_mdb_prepare,
.port_mdb_add = b53_mdb_add,
.port_mdb_del = b53_mdb_del,
+ .port_max_mtu = b53_get_max_mtu,
+ .port_change_mtu = b53_change_mtu,
};
struct b53_chip_data {