X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Fmvebu%2Fpatches-4.4%2F134-net-mvneta-convert-to-phylink.patch;fp=target%2Flinux%2Fmvebu%2Fpatches-4.4%2F134-net-mvneta-convert-to-phylink.patch;h=3bfaf1582e689b988e9739c5f79638bc63ed8822;hp=fac283f3ee00cbc6b155d3e326ae0a5d85aba55e;hb=efb375b5795dd26fed078fff8463ae5b49a73551;hpb=1d2590f83826bb9cdf658001761593519186ce0e 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 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 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 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 } /* 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 } /* 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 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 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 - 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 - 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 } /* 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 } /* 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 } /* 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 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 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 } 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 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 } 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 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 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 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);