Skip to content

Commit

Permalink
net: sh_eth: Add eth support for R8A7779 device
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Edworthy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Phil Edworthy authored and davem330 committed Aug 20, 2012
1 parent 61abcb7 commit d0418bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/renesas/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ config SH_ETH
(CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
CPU_SUBTYPE_SH7757 || ARCH_R8A7740)
CPU_SUBTYPE_SH7757 || ARCH_R8A7740 || ARCH_R8A7779)
select CRC32
select NET_CORE
select MII
Expand All @@ -18,4 +18,4 @@ config SH_ETH
Renesas SuperH Ethernet device driver.
This driver supporting CPUs are:
- SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
and R8A7740.
R8A7740 and R8A7779.
11 changes: 8 additions & 3 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void sh_eth_select_mii(struct net_device *ndev)
#endif

/* There is CPU dependent code */
#if defined(CONFIG_CPU_SUBTYPE_SH7724)
#if defined(CONFIG_CPU_SUBTYPE_SH7724) || defined(CONFIG_ARCH_R8A7779)
#define SH_ETH_RESET_DEFAULT 1
static void sh_eth_set_duplex(struct net_device *ndev)
{
Expand All @@ -93,13 +93,18 @@ static void sh_eth_set_duplex(struct net_device *ndev)
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
unsigned int bits = ECMR_RTM;

#if defined(CONFIG_ARCH_R8A7779)
bits |= ECMR_ELB;
#endif

switch (mdp->speed) {
case 10: /* 10BASE */
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_RTM, ECMR);
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~bits, ECMR);
break;
case 100:/* 100BASE */
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_RTM, ECMR);
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | bits, ECMR);
break;
default:
break;
Expand Down

0 comments on commit d0418bb

Please sign in to comment.