Commit d10f7e1d authored by David S. Miller's avatar David S. Miller

Merge branch 'lantiq-Minor-fixes-for-vrx200-and-gswip'

Hauke Mehrtens says:

====================
net: lantiq: Minor fixes for vrx200 and gswip

These are mostly minor fixes to problems addresses in the latests round
of the review of the original series adding these driver, which were not
applied before the patches got merged into net-next.
In addition it fixes a data bus error on poweroff.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0a959e45 711ddb62
...@@ -22,9 +22,9 @@ required and optional properties. ...@@ -22,9 +22,9 @@ required and optional properties.
Required properties for GPHY firmware loading: Required properties for GPHY firmware loading:
- compatible : "lantiq,gphy-fw" and "lantiq,xrx200-gphy-fw", - compatible : "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw"
"lantiq,xrx200a1x-gphy-fw", "lantiq,xrx200a2x-gphy-fw", "lantiq,xrx300-gphy-fw", "lantiq,gphy-fw"
"lantiq,xrx300-gphy-fw", or "lantiq,xrx330-gphy-fw" "lantiq,xrx330-gphy-fw", "lantiq,gphy-fw"
for the loading of the firmware into the embedded for the loading of the firmware into the embedded
GPHY core of the SoC. GPHY core of the SoC.
- lantiq,rcu : reference to the rcu syscon - lantiq,rcu : reference to the rcu syscon
...@@ -41,13 +41,13 @@ Example: ...@@ -41,13 +41,13 @@ Example:
Ethernet switch on the VRX200 SoC: Ethernet switch on the VRX200 SoC:
gswip: gswip@E108000 { switch@e108000 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
compatible = "lantiq,xrx200-gswip"; compatible = "lantiq,xrx200-gswip";
reg = < 0xE108000 0x3000 /* switch */ reg = < 0xe108000 0x3100 /* switch */
0xE10B100 0x70 /* mdio */ 0xe10b100 0xd8 /* mdio */
0xE10B1D8 0x30 /* mii */ 0xe10b1d8 0x130 /* mii */
>; >;
dsa,member = <0 0>; dsa,member = <0 0>;
...@@ -97,7 +97,7 @@ gswip: gswip@E108000 { ...@@ -97,7 +97,7 @@ gswip: gswip@E108000 {
}; };
}; };
mdio@0 { mdio {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
compatible = "lantiq,xrx200-mdio"; compatible = "lantiq,xrx200-mdio";
...@@ -123,6 +123,8 @@ gswip: gswip@E108000 { ...@@ -123,6 +123,8 @@ gswip: gswip@E108000 {
gphy-fw { gphy-fw {
compatible = "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw"; compatible = "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw";
lantiq,rcu = <&rcu0>; lantiq,rcu = <&rcu0>;
#address-cells = <1>;
#size-cells = <0>;
gphy@20 { gphy@20 {
reg = <0x20>; reg = <0x20>;
......
...@@ -11,11 +11,11 @@ Required properties: ...@@ -11,11 +11,11 @@ Required properties:
Example: Example:
eth0: eth@E10B308 { ethernet@e10b308 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
compatible = "lantiq,xrx200-net"; compatible = "lantiq,xrx200-net";
reg = <0xE10B308 0x30>; reg = <0xe10b308 0xcf8>;
interrupts = <73>, <72>; interrupts = <73>, <72>;
interrupt-names = "tx", "rx"; interrupt-names = "tx", "rx";
}; };
...@@ -615,33 +615,25 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port, ...@@ -615,33 +615,25 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,
if (!phy_interface_mode_is_rgmii(state->interface) && if (!phy_interface_mode_is_rgmii(state->interface) &&
state->interface != PHY_INTERFACE_MODE_MII && state->interface != PHY_INTERFACE_MODE_MII &&
state->interface != PHY_INTERFACE_MODE_REVMII && state->interface != PHY_INTERFACE_MODE_REVMII &&
state->interface != PHY_INTERFACE_MODE_RMII) { state->interface != PHY_INTERFACE_MODE_RMII)
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); goto unsupported;
dev_err(ds->dev,
"Unsupported interface: %d\n", state->interface);
return;
}
break; break;
case 2: case 2:
case 3: case 3:
case 4: case 4:
if (state->interface != PHY_INTERFACE_MODE_INTERNAL) { if (state->interface != PHY_INTERFACE_MODE_INTERNAL)
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); goto unsupported;
dev_err(ds->dev,
"Unsupported interface: %d\n", state->interface);
return;
}
break; break;
case 5: case 5:
if (!phy_interface_mode_is_rgmii(state->interface) && if (!phy_interface_mode_is_rgmii(state->interface) &&
state->interface != PHY_INTERFACE_MODE_INTERNAL) { state->interface != PHY_INTERFACE_MODE_INTERNAL)
goto unsupported;
break;
default:
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
dev_err(ds->dev, dev_err(ds->dev, "Unsupported port: %i\n", port);
"Unsupported interface: %d\n", state->interface);
return; return;
} }
break;
}
/* Allow all the expected bits */ /* Allow all the expected bits */
phylink_set(mask, Autoneg); phylink_set(mask, Autoneg);
...@@ -667,6 +659,12 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port, ...@@ -667,6 +659,12 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,
__ETHTOOL_LINK_MODE_MASK_NBITS); __ETHTOOL_LINK_MODE_MASK_NBITS);
bitmap_and(state->advertising, state->advertising, mask, bitmap_and(state->advertising, state->advertising, mask,
__ETHTOOL_LINK_MODE_MASK_NBITS); __ETHTOOL_LINK_MODE_MASK_NBITS);
return;
unsupported:
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
dev_err(ds->dev, "Unsupported interface: %d\n", state->interface);
return;
} }
static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, static void gswip_phylink_mac_config(struct dsa_switch *ds, int port,
...@@ -970,7 +968,7 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv, ...@@ -970,7 +968,7 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv,
int err; int err;
int i = 0; int i = 0;
/* The The VRX200 rev 1.1 uses the GSWIP 2.0 and needs the older /* The VRX200 rev 1.1 uses the GSWIP 2.0 and needs the older
* GPHY firmware. The VRX200 rev 1.2 uses the GSWIP 2.1 and also * GPHY firmware. The VRX200 rev 1.2 uses the GSWIP 2.1 and also
* needs a different GPHY firmware. * needs a different GPHY firmware.
*/ */
...@@ -1097,7 +1095,7 @@ static int gswip_probe(struct platform_device *pdev) ...@@ -1097,7 +1095,7 @@ static int gswip_probe(struct platform_device *pdev)
dev_err(dev, "dsa switch register failed: %i\n", err); dev_err(dev, "dsa switch register failed: %i\n", err);
goto mdio_bus; goto mdio_bus;
} }
if (priv->ds->dst->cpu_dp->index != priv->hw_info->cpu_port) { if (!dsa_is_cpu_port(priv->ds, priv->hw_info->cpu_port)) {
dev_err(dev, "wrong CPU port defined, HW only supports port: %i", dev_err(dev, "wrong CPU port defined, HW only supports port: %i",
priv->hw_info->cpu_port); priv->hw_info->cpu_port);
err = -EINVAL; err = -EINVAL;
......
...@@ -115,12 +115,6 @@ static void xrx200_flush_dma(struct xrx200_chan *ch) ...@@ -115,12 +115,6 @@ static void xrx200_flush_dma(struct xrx200_chan *ch)
static int xrx200_open(struct net_device *net_dev) static int xrx200_open(struct net_device *net_dev)
{ {
struct xrx200_priv *priv = netdev_priv(net_dev); struct xrx200_priv *priv = netdev_priv(net_dev);
int err;
/* enable clock gate */
err = clk_prepare_enable(priv->clk);
if (err)
return err;
napi_enable(&priv->chan_tx.napi); napi_enable(&priv->chan_tx.napi);
ltq_dma_open(&priv->chan_tx.dma); ltq_dma_open(&priv->chan_tx.dma);
...@@ -155,8 +149,6 @@ static int xrx200_close(struct net_device *net_dev) ...@@ -155,8 +149,6 @@ static int xrx200_close(struct net_device *net_dev)
napi_disable(&priv->chan_tx.napi); napi_disable(&priv->chan_tx.napi);
ltq_dma_close(&priv->chan_tx.dma); ltq_dma_close(&priv->chan_tx.dma);
clk_disable_unprepare(priv->clk);
return 0; return 0;
} }
...@@ -497,6 +489,11 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -497,6 +489,11 @@ static int xrx200_probe(struct platform_device *pdev)
if (err) if (err)
return err; return err;
/* enable clock gate */
err = clk_prepare_enable(priv->clk);
if (err)
goto err_uninit_dma;
/* set IPG to 12 */ /* set IPG to 12 */
xrx200_pmac_mask(priv, PMAC_RX_IPG_MASK, 0xb, PMAC_RX_IPG); xrx200_pmac_mask(priv, PMAC_RX_IPG_MASK, 0xb, PMAC_RX_IPG);
...@@ -514,9 +511,12 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -514,9 +511,12 @@ static int xrx200_probe(struct platform_device *pdev)
err = register_netdev(net_dev); err = register_netdev(net_dev);
if (err) if (err)
goto err_uninit_dma; goto err_unprepare_clk;
return err; return err;
err_unprepare_clk:
clk_disable_unprepare(priv->clk);
err_uninit_dma: err_uninit_dma:
xrx200_hw_cleanup(priv); xrx200_hw_cleanup(priv);
...@@ -536,6 +536,9 @@ static int xrx200_remove(struct platform_device *pdev) ...@@ -536,6 +536,9 @@ static int xrx200_remove(struct platform_device *pdev)
/* remove the actual device */ /* remove the actual device */
unregister_netdev(net_dev); unregister_netdev(net_dev);
/* release the clock */
clk_disable_unprepare(priv->clk);
/* shut down hardware */ /* shut down hardware */
xrx200_hw_cleanup(priv); xrx200_hw_cleanup(priv);
......
...@@ -88,6 +88,9 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops) ...@@ -88,6 +88,9 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops)
#ifdef CONFIG_NET_DSA_TAG_EDSA #ifdef CONFIG_NET_DSA_TAG_EDSA
[DSA_TAG_PROTO_EDSA] = "edsa", [DSA_TAG_PROTO_EDSA] = "edsa",
#endif #endif
#ifdef CONFIG_NET_DSA_TAG_GSWIP
[DSA_TAG_PROTO_GSWIP] = "gswip",
#endif
#ifdef CONFIG_NET_DSA_TAG_KSZ #ifdef CONFIG_NET_DSA_TAG_KSZ
[DSA_TAG_PROTO_KSZ] = "ksz", [DSA_TAG_PROTO_KSZ] = "ksz",
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment