diff options
Diffstat (limited to 'drivers/net/dsa')
| -rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 14 | ||||
| -rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 11 | ||||
| -rw-r--r-- | drivers/net/dsa/mt7530.c | 52 | 
3 files changed, 40 insertions, 37 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index a162499bcafc..eb443721c58e 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1105,13 +1105,6 @@ static int b53_setup(struct dsa_switch *ds)  			b53_disable_port(ds, port);  	} -	/* Let DSA handle the case were multiple bridges span the same switch -	 * device and different VLAN awareness settings are requested, which -	 * would be breaking filtering semantics for any of the other bridge -	 * devices. (not hardware supported) -	 */ -	ds->vlan_filtering_is_global = true; -  	return b53_setup_devlink_resources(ds);  } @@ -2664,6 +2657,13 @@ struct b53_device *b53_switch_alloc(struct device *base,  	ds->ops = &b53_switch_ops;  	ds->untag_bridge_pvid = true;  	dev->vlan_enabled = true; +	/* Let DSA handle the case were multiple bridges span the same switch +	 * device and different VLAN awareness settings are requested, which +	 * would be breaking filtering semantics for any of the other bridge +	 * devices. (not hardware supported) +	 */ +	ds->vlan_filtering_is_global = true; +  	mutex_init(&dev->reg_mutex);  	mutex_init(&dev->stats_mutex); diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index f277df922fcd..ba5d546d06aa 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -114,7 +114,10 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)  		/* Force link status for IMP port */  		reg = core_readl(priv, offset);  		reg |= (MII_SW_OR | LINK_STS); -		reg &= ~GMII_SPEED_UP_2G; +		if (priv->type == BCM4908_DEVICE_ID) +			reg |= GMII_SPEED_UP_2G; +		else +			reg &= ~GMII_SPEED_UP_2G;  		core_writel(priv, reg, offset);  		/* Enable Broadcast, Multicast, Unicast forwarding to IMP port */ @@ -585,8 +588,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)  	 * in bits 15:8 and the patch level in bits 7:0 which is exactly what  	 * the REG_PHY_REVISION register layout is.  	 */ - -	return priv->hw_params.gphy_rev; +	if (priv->int_phy_mask & BIT(port)) +		return priv->hw_params.gphy_rev; +	else +		return 0;  }  static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index f06f5fa2f898..9871d7cff93a 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -436,34 +436,32 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)  			     TD_DM_DRVP(8) | TD_DM_DRVN(8));  	/* Setup core clock for MT7530 */ -	if (!trgint) { -		/* Disable MT7530 core clock */ -		core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); - -		/* Disable PLL, since phy_device has not yet been created -		 * provided for phy_[read,write]_mmd_indirect is called, we -		 * provide our own core_write_mmd_indirect to complete this -		 * function. -		 */ -		core_write_mmd_indirect(priv, -					CORE_GSWPLL_GRP1, -					MDIO_MMD_VEND2, -					0); - -		/* Set core clock into 500Mhz */ -		core_write(priv, CORE_GSWPLL_GRP2, -			   RG_GSWPLL_POSDIV_500M(1) | -			   RG_GSWPLL_FBKDIV_500M(25)); +	/* Disable MT7530 core clock */ +	core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); -		/* Enable PLL */ -		core_write(priv, CORE_GSWPLL_GRP1, -			   RG_GSWPLL_EN_PRE | -			   RG_GSWPLL_POSDIV_200M(2) | -			   RG_GSWPLL_FBKDIV_200M(32)); - -		/* Enable MT7530 core clock */ -		core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); -	} +	/* Disable PLL, since phy_device has not yet been created +	 * provided for phy_[read,write]_mmd_indirect is called, we +	 * provide our own core_write_mmd_indirect to complete this +	 * function. +	 */ +	core_write_mmd_indirect(priv, +				CORE_GSWPLL_GRP1, +				MDIO_MMD_VEND2, +				0); + +	/* Set core clock into 500Mhz */ +	core_write(priv, CORE_GSWPLL_GRP2, +		   RG_GSWPLL_POSDIV_500M(1) | +		   RG_GSWPLL_FBKDIV_500M(25)); + +	/* Enable PLL */ +	core_write(priv, CORE_GSWPLL_GRP1, +		   RG_GSWPLL_EN_PRE | +		   RG_GSWPLL_POSDIV_200M(2) | +		   RG_GSWPLL_FBKDIV_200M(32)); + +	/* Enable MT7530 core clock */ +	core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN);  	/* Setup the MT7530 TRGMII Tx Clock */  	core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN);  |