diff options
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 8615961c1287..d63e09b29a96 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * SuperH Ethernet device driver | 2 | * SuperH Ethernet device driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006-2008 Nobuhiro Iwamatsu | 4 | * Copyright (C) 2006-2012 Nobuhiro Iwamatsu |
5 | * Copyright (C) 2008-2009 Renesas Solutions Corp. | 5 | * Copyright (C) 2008-2012 Renesas Solutions Corp. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
8 | * under the terms and conditions of the GNU General Public License, | 8 | * under the terms and conditions of the GNU General Public License, |
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/ethtool.h> | 39 | #include <linux/ethtool.h> |
40 | #include <linux/if_vlan.h> | 40 | #include <linux/if_vlan.h> |
41 | #include <linux/clk.h> | ||
41 | #include <linux/sh_eth.h> | 42 | #include <linux/sh_eth.h> |
42 | 43 | ||
43 | #include "sh_eth.h" | 44 | #include "sh_eth.h" |
@@ -279,8 +280,9 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp) | |||
279 | return &sh_eth_my_cpu_data; | 280 | return &sh_eth_my_cpu_data; |
280 | } | 281 | } |
281 | 282 | ||
282 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | 283 | #elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) |
283 | #define SH_ETH_HAS_TSU 1 | 284 | #define SH_ETH_HAS_TSU 1 |
285 | static void sh_eth_reset_hw_crc(struct net_device *ndev); | ||
284 | static void sh_eth_chip_reset(struct net_device *ndev) | 286 | static void sh_eth_chip_reset(struct net_device *ndev) |
285 | { | 287 | { |
286 | struct sh_eth_private *mdp = netdev_priv(ndev); | 288 | struct sh_eth_private *mdp = netdev_priv(ndev); |
@@ -314,6 +316,9 @@ static void sh_eth_reset(struct net_device *ndev) | |||
314 | sh_eth_write(ndev, 0x0, RDFAR); | 316 | sh_eth_write(ndev, 0x0, RDFAR); |
315 | sh_eth_write(ndev, 0x0, RDFXR); | 317 | sh_eth_write(ndev, 0x0, RDFXR); |
316 | sh_eth_write(ndev, 0x0, RDFFR); | 318 | sh_eth_write(ndev, 0x0, RDFFR); |
319 | |||
320 | /* Reset HW CRC register */ | ||
321 | sh_eth_reset_hw_crc(ndev); | ||
317 | } | 322 | } |
318 | 323 | ||
319 | static void sh_eth_set_duplex(struct net_device *ndev) | 324 | static void sh_eth_set_duplex(struct net_device *ndev) |
@@ -370,8 +375,17 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
370 | .no_trimd = 1, | 375 | .no_trimd = 1, |
371 | .no_ade = 1, | 376 | .no_ade = 1, |
372 | .tsu = 1, | 377 | .tsu = 1, |
378 | #if defined(CONFIG_CPU_SUBTYPE_SH7734) | ||
379 | .hw_crc = 1, | ||
380 | #endif | ||
373 | }; | 381 | }; |
374 | 382 | ||
383 | static void sh_eth_reset_hw_crc(struct net_device *ndev) | ||
384 | { | ||
385 | if (sh_eth_my_cpu_data.hw_crc) | ||
386 | sh_eth_write(ndev, 0x0, CSMR); | ||
387 | } | ||
388 | |||
375 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) | 389 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) |
376 | #define SH_ETH_RESET_DEFAULT 1 | 390 | #define SH_ETH_RESET_DEFAULT 1 |
377 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | 391 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { |
@@ -790,7 +804,7 @@ static int sh_eth_dev_init(struct net_device *ndev) | |||
790 | /* all sh_eth int mask */ | 804 | /* all sh_eth int mask */ |
791 | sh_eth_write(ndev, 0, EESIPR); | 805 | sh_eth_write(ndev, 0, EESIPR); |
792 | 806 | ||
793 | #if defined(__LITTLE_ENDIAN__) | 807 | #if defined(__LITTLE_ENDIAN) |
794 | if (mdp->cd->hw_swap) | 808 | if (mdp->cd->hw_swap) |
795 | sh_eth_write(ndev, EDMR_EL, EDMR); | 809 | sh_eth_write(ndev, EDMR_EL, EDMR); |
796 | else | 810 | else |