summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt18
-rw-r--r--Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt4
-rw-r--r--drivers/net/dsa/lantiq_gswip.c38
-rw-r--r--drivers/net/ethernet/lantiq_xrx200.c21
-rw-r--r--net/dsa/dsa.c3
5 files changed, 45 insertions, 39 deletions
diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt
index a089f5856778..886cbe8ffb38 100644
--- a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt
+++ b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt
@@ -22,9 +22,9 @@ required and optional properties.
Required properties for GPHY firmware loading:
-- compatible : "lantiq,gphy-fw" and "lantiq,xrx200-gphy-fw",
- "lantiq,xrx200a1x-gphy-fw", "lantiq,xrx200a2x-gphy-fw",
- "lantiq,xrx300-gphy-fw", or "lantiq,xrx330-gphy-fw"
+- compatible : "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw"
+ "lantiq,xrx300-gphy-fw", "lantiq,gphy-fw"
+ "lantiq,xrx330-gphy-fw", "lantiq,gphy-fw"
for the loading of the firmware into the embedded
GPHY core of the SoC.
- lantiq,rcu : reference to the rcu syscon
@@ -41,13 +41,13 @@ Example:
Ethernet switch on the VRX200 SoC:
-gswip: gswip@E108000 {
+switch@e108000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "lantiq,xrx200-gswip";
- reg = < 0xE108000 0x3000 /* switch */
- 0xE10B100 0x70 /* mdio */
- 0xE10B1D8 0x30 /* mii */
+ reg = < 0xe108000 0x3100 /* switch */
+ 0xe10b100 0xd8 /* mdio */
+ 0xe10b1d8 0x130 /* mii */
>;
dsa,member = <0 0>;
@@ -97,7 +97,7 @@ gswip: gswip@E108000 {
};
};
- mdio@0 {
+ mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "lantiq,xrx200-mdio";
@@ -123,6 +123,8 @@ gswip: gswip@E108000 {
gphy-fw {
compatible = "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw";
lantiq,rcu = <&rcu0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
gphy@20 {
reg = <0x20>;
diff --git a/Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt b/Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt
index 8a2fe5200cdc..5ff5e68bbbb6 100644
--- a/Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt
+++ b/Documentation/devicetree/bindings/net/lantiq,xrx200-net.txt
@@ -11,11 +11,11 @@ Required properties:
Example:
-eth0: eth@E10B308 {
+ethernet@e10b308 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "lantiq,xrx200-net";
- reg = <0xE10B308 0x30>;
+ reg = <0xe10b308 0xcf8>;
interrupts = <73>, <72>;
interrupt-names = "tx", "rx";
};
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index be1e69911a55..693a67f45bef 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -615,32 +615,24 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,
if (!phy_interface_mode_is_rgmii(state->interface) &&
state->interface != PHY_INTERFACE_MODE_MII &&
state->interface != PHY_INTERFACE_MODE_REVMII &&
- state->interface != PHY_INTERFACE_MODE_RMII) {
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
- dev_err(ds->dev,
- "Unsupported interface: %d\n", state->interface);
- return;
- }
+ state->interface != PHY_INTERFACE_MODE_RMII)
+ goto unsupported;
break;
case 2:
case 3:
case 4:
- if (state->interface != PHY_INTERFACE_MODE_INTERNAL) {
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
- dev_err(ds->dev,
- "Unsupported interface: %d\n", state->interface);
- return;
- }
+ if (state->interface != PHY_INTERFACE_MODE_INTERNAL)
+ goto unsupported;
break;
case 5:
if (!phy_interface_mode_is_rgmii(state->interface) &&
- state->interface != PHY_INTERFACE_MODE_INTERNAL) {
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
- dev_err(ds->dev,
- "Unsupported interface: %d\n", state->interface);
- return;
- }
+ state->interface != PHY_INTERFACE_MODE_INTERNAL)
+ goto unsupported;
break;
+ default:
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
+ dev_err(ds->dev, "Unsupported port: %i\n", port);
+ return;
}
/* Allow all the expected bits */
@@ -667,6 +659,12 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,
__ETHTOOL_LINK_MODE_MASK_NBITS);
bitmap_and(state->advertising, state->advertising, mask,
__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,
@@ -970,7 +968,7 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv,
int err;
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
* needs a different GPHY firmware.
*/
@@ -1097,7 +1095,7 @@ static int gswip_probe(struct platform_device *pdev)
dev_err(dev, "dsa switch register failed: %i\n", err);
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",
priv->hw_info->cpu_port);
err = -EINVAL;
diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 4a160761b3ff..8c5ba4b81fb7 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -115,12 +115,6 @@ static void xrx200_flush_dma(struct xrx200_chan *ch)
static int xrx200_open(struct net_device *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);
ltq_dma_open(&priv->chan_tx.dma);
@@ -155,8 +149,6 @@ static int xrx200_close(struct net_device *net_dev)
napi_disable(&priv->chan_tx.napi);
ltq_dma_close(&priv->chan_tx.dma);
- clk_disable_unprepare(priv->clk);
-
return 0;
}
@@ -497,6 +489,11 @@ static int xrx200_probe(struct platform_device *pdev)
if (err)
return err;
+ /* enable clock gate */
+ err = clk_prepare_enable(priv->clk);
+ if (err)
+ goto err_uninit_dma;
+
/* set IPG to 12 */
xrx200_pmac_mask(priv, PMAC_RX_IPG_MASK, 0xb, PMAC_RX_IPG);
@@ -514,9 +511,12 @@ static int xrx200_probe(struct platform_device *pdev)
err = register_netdev(net_dev);
if (err)
- goto err_uninit_dma;
+ goto err_unprepare_clk;
return err;
+err_unprepare_clk:
+ clk_disable_unprepare(priv->clk);
+
err_uninit_dma:
xrx200_hw_cleanup(priv);
@@ -536,6 +536,9 @@ static int xrx200_remove(struct platform_device *pdev)
/* remove the actual device */
unregister_netdev(net_dev);
+ /* release the clock */
+ clk_disable_unprepare(priv->clk);
+
/* shut down hardware */
xrx200_hw_cleanup(priv);
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 5f73e96cc9e6..a69c1790bbfc 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -88,6 +88,9 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops)
#ifdef CONFIG_NET_DSA_TAG_EDSA
[DSA_TAG_PROTO_EDSA] = "edsa",
#endif
+#ifdef CONFIG_NET_DSA_TAG_GSWIP
+ [DSA_TAG_PROTO_GSWIP] = "gswip",
+#endif
#ifdef CONFIG_NET_DSA_TAG_KSZ
[DSA_TAG_PROTO_KSZ] = "ksz",
#endif