diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2009-05-24 19:54:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-26 01:49:56 -0400 |
commit | 65ac8851490ec97a96759af729132c96f925a795 (patch) | |
tree | 3bd4fdb7bb1e46a2f606db89cdbc5df605f6b1f0 /drivers/net/sh_eth.c | |
parent | 380af9e390ec81e74a2fd7fad948a8b12eeec7da (diff) |
net: sh_eth: Add support SH7724
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sh_eth.c')
-rw-r--r-- | drivers/net/sh_eth.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 19571f759610..cdd73b9c553d 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -34,7 +34,57 @@ | |||
34 | #include "sh_eth.h" | 34 | #include "sh_eth.h" |
35 | 35 | ||
36 | /* There is CPU dependent code */ | 36 | /* There is CPU dependent code */ |
37 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | 37 | #if defined(CONFIG_CPU_SUBTYPE_SH7724) |
38 | #define SH_ETH_RESET_DEFAULT 1 | ||
39 | static void sh_eth_set_duplex(struct net_device *ndev) | ||
40 | { | ||
41 | struct sh_eth_private *mdp = netdev_priv(ndev); | ||
42 | u32 ioaddr = ndev->base_addr; | ||
43 | |||
44 | if (mdp->duplex) /* Full */ | ||
45 | ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR); | ||
46 | else /* Half */ | ||
47 | ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR); | ||
48 | } | ||
49 | |||
50 | static void sh_eth_set_rate(struct net_device *ndev) | ||
51 | { | ||
52 | struct sh_eth_private *mdp = netdev_priv(ndev); | ||
53 | u32 ioaddr = ndev->base_addr; | ||
54 | |||
55 | switch (mdp->speed) { | ||
56 | case 10: /* 10BASE */ | ||
57 | ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_RTM, ioaddr + ECMR); | ||
58 | break; | ||
59 | case 100:/* 100BASE */ | ||
60 | ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_RTM, ioaddr + ECMR); | ||
61 | break; | ||
62 | default: | ||
63 | break; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | /* SH7724 */ | ||
68 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | ||
69 | .set_duplex = sh_eth_set_duplex, | ||
70 | .set_rate = sh_eth_set_rate, | ||
71 | |||
72 | .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD, | ||
73 | .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP, | ||
74 | .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x01ff009f, | ||
75 | |||
76 | .tx_check = EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO, | ||
77 | .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE | | ||
78 | EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI, | ||
79 | .tx_error_check = EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE, | ||
80 | |||
81 | .apr = 1, | ||
82 | .mpr = 1, | ||
83 | .tpauser = 1, | ||
84 | .hw_swap = 1, | ||
85 | }; | ||
86 | |||
87 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
38 | #define SH_ETH_HAS_TSU 1 | 88 | #define SH_ETH_HAS_TSU 1 |
39 | static void sh_eth_chip_reset(struct net_device *ndev) | 89 | static void sh_eth_chip_reset(struct net_device *ndev) |
40 | { | 90 | { |