aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch')
-rw-r--r--target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch65
1 files changed, 38 insertions, 27 deletions
diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
index fac283f3ee..3bfaf1582e 100644
--- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
@@ -79,7 +79,18 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_bm *bm_priv;
struct mvneta_bm_pool *pool_long;
-@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table
+@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m
+ val &= ~MVNETA_GMAC0_PORT_ENABLE;
+ mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
+
+- pp->link = 0;
+- pp->duplex = -1;
+- pp->speed = 0;
+-
+ udelay(200);
+ }
+
+@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table
mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
}
@@ -124,7 +135,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_percpu_unmask_interrupt(void *arg)
{
struct mvneta_port *pp = arg;
-@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m
+@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m
val &= ~MVNETA_PHY_POLLING_ENABLE;
mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
@@ -132,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mvneta_set_ucast_table(pp, -1);
mvneta_set_special_mcast_table(pp, -1);
mvneta_set_other_mcast_table(pp, -1);
-@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
return IRQ_HANDLED;
}
@@ -161,7 +172,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* NAPI handler
-@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -179,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Release Tx descriptors */
-@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
MVNETA_CAUSE_LINK_CHANGE |
MVNETA_CAUSE_PSC_SYNC_CHANGE);
@@ -188,7 +199,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
netif_tx_start_all_queues(pp->dev);
}
-@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
{
unsigned int cpu;
@@ -197,7 +208,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
+@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
return 0;
}
@@ -438,13 +449,6 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
- struct phy_device *phy_dev;
+ struct mvneta_port *pp = netdev_priv(ndev);
+ u32 val;
-+
-+ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
-+ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
-+ val |= MVNETA_GMAC_FORCE_LINK_PASS;
-+ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
-+ }
- phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
- pp->phy_interface);
@@ -460,10 +464,17 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
- pp->link = 0;
- pp->duplex = 0;
- pp->speed = 0;
-+ mvneta_port_up(pp);
-+}
++ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
++ val |= MVNETA_GMAC_FORCE_LINK_PASS;
++ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++ }
- return 0;
++ mvneta_port_up(pp);
++}
++
+static const struct phylink_mac_ops mvneta_phylink_ops = {
+ .mac_get_support = mvneta_mac_support,
+ .mac_link_state = mvneta_mac_link_state,
@@ -490,7 +501,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Electing a CPU must be done in an atomic way: it should be done
-@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
+@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
{
struct mvneta_port *pp = netdev_priv(dev);
@@ -502,7 +513,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Ethtool methods */
-@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
+@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
{
struct mvneta_port *pp = netdev_priv(dev);
@@ -559,7 +570,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Set interrupt coalescing for ethtools */
-@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
+@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
{
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
@@ -569,7 +580,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
u64 val64;
int i;
-@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_
+@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_
const struct mbus_dram_target_info *dram_target_info;
struct resource *res;
struct device_node *dn = pdev->dev.of_node;
@@ -585,7 +596,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
int tx_csum_limit;
int phy_mode;
int err;
-@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_
+@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_
goto err_free_netdev;
}
@@ -618,7 +629,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
@@ -632,7 +643,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
pp->rxq_def = rxq_def;
-@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_
+@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_
pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
@@ -641,7 +652,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
clk_prepare_enable(pp->clk);
-@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_
+@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
@@ -656,7 +667,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
-@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_
+@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_
platform_set_drvdata(pdev, pp->dev);
@@ -670,7 +681,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 0;
-@@ -4169,13 +4170,13 @@ err_netdev:
+@@ -4173,13 +4170,13 @@ err_netdev:
1 << pp->id);
}
err_free_stats:
@@ -686,7 +697,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err_free_irq:
irq_dispose_mapping(dev->irq);
err_free_netdev:
-@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform
+@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform
free_percpu(pp->ports);
free_percpu(pp->stats);
irq_dispose_mapping(dev->irq);