diff options
Diffstat (limited to 'drivers/net/ethernet/renesas/ravb_main.c')
| -rw-r--r-- | drivers/net/ethernet/renesas/ravb_main.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index ac43ed914fcf..86449c357168 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c | |||
| @@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct net_device *ndev, | |||
| 1139 | if (netif_running(ndev)) { | 1139 | if (netif_running(ndev)) { |
| 1140 | netif_device_detach(ndev); | 1140 | netif_device_detach(ndev); |
| 1141 | /* Stop PTP Clock driver */ | 1141 | /* Stop PTP Clock driver */ |
| 1142 | ravb_ptp_stop(ndev); | 1142 | if (priv->chip_id == RCAR_GEN2) |
| 1143 | ravb_ptp_stop(ndev); | ||
| 1143 | /* Wait for DMA stopping */ | 1144 | /* Wait for DMA stopping */ |
| 1144 | error = ravb_stop_dma(ndev); | 1145 | error = ravb_stop_dma(ndev); |
| 1145 | if (error) { | 1146 | if (error) { |
| @@ -1170,7 +1171,8 @@ static int ravb_set_ringparam(struct net_device *ndev, | |||
| 1170 | ravb_emac_init(ndev); | 1171 | ravb_emac_init(ndev); |
| 1171 | 1172 | ||
| 1172 | /* Initialise PTP Clock driver */ | 1173 | /* Initialise PTP Clock driver */ |
| 1173 | ravb_ptp_init(ndev, priv->pdev); | 1174 | if (priv->chip_id == RCAR_GEN2) |
| 1175 | ravb_ptp_init(ndev, priv->pdev); | ||
| 1174 | 1176 | ||
| 1175 | netif_device_attach(ndev); | 1177 | netif_device_attach(ndev); |
| 1176 | } | 1178 | } |
| @@ -1298,7 +1300,8 @@ static void ravb_tx_timeout_work(struct work_struct *work) | |||
| 1298 | netif_tx_stop_all_queues(ndev); | 1300 | netif_tx_stop_all_queues(ndev); |
| 1299 | 1301 | ||
| 1300 | /* Stop PTP Clock driver */ | 1302 | /* Stop PTP Clock driver */ |
| 1301 | ravb_ptp_stop(ndev); | 1303 | if (priv->chip_id == RCAR_GEN2) |
| 1304 | ravb_ptp_stop(ndev); | ||
| 1302 | 1305 | ||
| 1303 | /* Wait for DMA stopping */ | 1306 | /* Wait for DMA stopping */ |
| 1304 | ravb_stop_dma(ndev); | 1307 | ravb_stop_dma(ndev); |
| @@ -1311,7 +1314,8 @@ static void ravb_tx_timeout_work(struct work_struct *work) | |||
| 1311 | ravb_emac_init(ndev); | 1314 | ravb_emac_init(ndev); |
| 1312 | 1315 | ||
| 1313 | /* Initialise PTP Clock driver */ | 1316 | /* Initialise PTP Clock driver */ |
| 1314 | ravb_ptp_init(ndev, priv->pdev); | 1317 | if (priv->chip_id == RCAR_GEN2) |
| 1318 | ravb_ptp_init(ndev, priv->pdev); | ||
| 1315 | 1319 | ||
| 1316 | netif_tx_start_all_queues(ndev); | 1320 | netif_tx_start_all_queues(ndev); |
| 1317 | } | 1321 | } |
| @@ -1718,7 +1722,6 @@ static int ravb_set_gti(struct net_device *ndev) | |||
| 1718 | static int ravb_probe(struct platform_device *pdev) | 1722 | static int ravb_probe(struct platform_device *pdev) |
| 1719 | { | 1723 | { |
| 1720 | struct device_node *np = pdev->dev.of_node; | 1724 | struct device_node *np = pdev->dev.of_node; |
| 1721 | const struct of_device_id *match; | ||
| 1722 | struct ravb_private *priv; | 1725 | struct ravb_private *priv; |
| 1723 | enum ravb_chip_id chip_id; | 1726 | enum ravb_chip_id chip_id; |
| 1724 | struct net_device *ndev; | 1727 | struct net_device *ndev; |
| @@ -1750,8 +1753,7 @@ static int ravb_probe(struct platform_device *pdev) | |||
| 1750 | ndev->base_addr = res->start; | 1753 | ndev->base_addr = res->start; |
| 1751 | ndev->dma = -1; | 1754 | ndev->dma = -1; |
| 1752 | 1755 | ||
| 1753 | match = of_match_device(of_match_ptr(ravb_match_table), &pdev->dev); | 1756 | chip_id = (enum ravb_chip_id)of_device_get_match_data(&pdev->dev); |
| 1754 | chip_id = (enum ravb_chip_id)match->data; | ||
| 1755 | 1757 | ||
| 1756 | if (chip_id == RCAR_GEN3) | 1758 | if (chip_id == RCAR_GEN3) |
| 1757 | irq = platform_get_irq_byname(pdev, "ch22"); | 1759 | irq = platform_get_irq_byname(pdev, "ch22"); |
| @@ -1814,10 +1816,6 @@ static int ravb_probe(struct platform_device *pdev) | |||
| 1814 | CCC_OPC_CONFIG | CCC_GAC | CCC_CSEL_HPB, CCC); | 1816 | CCC_OPC_CONFIG | CCC_GAC | CCC_CSEL_HPB, CCC); |
| 1815 | } | 1817 | } |
| 1816 | 1818 | ||
| 1817 | /* Set CSEL value */ | ||
| 1818 | ravb_write(ndev, (ravb_read(ndev, CCC) & ~CCC_CSEL) | CCC_CSEL_HPB, | ||
| 1819 | CCC); | ||
| 1820 | |||
| 1821 | /* Set GTI value */ | 1819 | /* Set GTI value */ |
| 1822 | error = ravb_set_gti(ndev); | 1820 | error = ravb_set_gti(ndev); |
| 1823 | if (error) | 1821 | if (error) |
