Skip to content

Commit

Permalink
Merge branch 'sh_eth-sw-reset'
Browse files Browse the repository at this point in the history
Sergei Shtylyov says:

====================
sh_eth: couple of software reset bit cleanups

   Here's a set of 2 patches against DaveM's 'net-next.git' repo. We can save
on the repetitive chip reset code...

[1/2] sh_eth: call sh_eth_tsu_write() from sh_eth_chip_reset_giga()
[2/2] sh_eth: reuse sh_eth_chip_reset()
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 9, 2016
2 parents 59efcba + c66b258 commit 908578e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,7 @@ static struct sh_eth_cpu_data r7s72100_data = {

static void sh_eth_chip_reset_r8a7740(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);

/* reset device */
sh_eth_tsu_write(mdp, ARSTR_ARST, ARSTR);
mdelay(1);
sh_eth_chip_reset(ndev);

sh_eth_select_mii(ndev);
}
Expand Down Expand Up @@ -725,18 +721,16 @@ static struct sh_eth_cpu_data sh7757_data = {
#define GIGA_MAHR(port) (SH_GIGA_ETH_BASE + 0x800 * (port) + 0x05c0)
static void sh_eth_chip_reset_giga(struct net_device *ndev)
{
int i;
u32 mahr[2], malr[2];
int i;

/* save MAHR and MALR */
for (i = 0; i < 2; i++) {
malr[i] = ioread32((void *)GIGA_MALR(i));
mahr[i] = ioread32((void *)GIGA_MAHR(i));
}

/* reset device */
iowrite32(ARSTR_ARST, (void *)(SH_GIGA_ETH_BASE + 0x1800));
mdelay(1);
sh_eth_chip_reset(ndev);

/* restore MAHR and MALR */
for (i = 0; i < 2; i++) {
Expand Down

0 comments on commit 908578e

Please sign in to comment.