projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net, davinci_emac: add KSZ8864 switch
[oweals/u-boot.git]
/
drivers
/
net
/
netarm_eth.c
diff --git
a/drivers/net/netarm_eth.c
b/drivers/net/netarm_eth.c
index ecf45dc92f6ed8e0c18ddef1b3c12f6115d1a978..f54817e58dd3c984c5bcbb6a8ec670944fc5aaab 100644
(file)
--- a/
drivers/net/netarm_eth.c
+++ b/
drivers/net/netarm_eth.c
@@
-22,15
+22,11
@@
#include <common.h>
#include <common.h>
-
-#ifdef CONFIG_DRIVER_NETARMETH
#include <command.h>
#include <net.h>
#include "netarm_eth.h"
#include <asm/arch/netarm_registers.h>
#include <command.h>
#include <net.h>
#include "netarm_eth.h"
#include <asm/arch/netarm_registers.h>
-#if defined(CONFIG_CMD_NET)
-
static int na_mii_poll_busy (void);
static void na_get_mac_addr (void)
static int na_mii_poll_busy (void);
static void na_get_mac_addr (void)
@@
-60,7
+56,7
@@
static void na_mii_write (int reg, int value)
int mii_addr;
/* Select register */
int mii_addr;
/* Select register */
- mii_addr = C
FG
_ETH_PHY_ADDR + reg;
+ mii_addr = C
ONFIG_SYS
_ETH_PHY_ADDR + reg;
SET_EADDR (NETARM_ETH_MII_ADDR, mii_addr);
/* Write value */
SET_EADDR (NETARM_ETH_MII_WRITE, value);
SET_EADDR (NETARM_ETH_MII_ADDR, mii_addr);
/* Write value */
SET_EADDR (NETARM_ETH_MII_WRITE, value);
@@
-72,7
+68,7
@@
static unsigned int na_mii_read (int reg)
int mii_addr, val;
/* Select register */
int mii_addr, val;
/* Select register */
- mii_addr = C
FG
_ETH_PHY_ADDR + reg;
+ mii_addr = C
ONFIG_SYS
_ETH_PHY_ADDR + reg;
SET_EADDR (NETARM_ETH_MII_ADDR, mii_addr);
/* do one management cycle */
SET_EADDR (NETARM_ETH_MII_CMD,
SET_EADDR (NETARM_ETH_MII_ADDR, mii_addr);
/* do one management cycle */
SET_EADDR (NETARM_ETH_MII_CMD,
@@
-85,9
+81,10
@@
static unsigned int na_mii_read (int reg)
static int na_mii_poll_busy (void)
{
static int na_mii_poll_busy (void)
{
+ ulong start;
/* arm simple, non interrupt dependent timer */
/* arm simple, non interrupt dependent timer */
-
reset_timer_masked (
);
- while (get_timer
_masked (
) < NA_MII_POLL_BUSY_DELAY) {
+
start = get_timer(0)
);
+ while (get_timer
(start
) < NA_MII_POLL_BUSY_DELAY) {
if (!(GET_EADDR (NETARM_ETH_MII_IND) & NETARM_ETH_MIII_BUSY)) {
return 1;
}
if (!(GET_EADDR (NETARM_ETH_MII_IND) & NETARM_ETH_MIII_BUSY)) {
return 1;
}
@@
-168,19
+165,20
@@
static unsigned int na_mii_check_speed (void)
static int reset_eth (void)
{
int pt;
static int reset_eth (void)
{
int pt;
+ ulong start;
na_get_mac_addr ();
pt = na_mii_identify_phy ();
/* reset the phy */
na_mii_write (MII_PHY_CONTROL, 0x8000);
na_get_mac_addr ();
pt = na_mii_identify_phy ();
/* reset the phy */
na_mii_write (MII_PHY_CONTROL, 0x8000);
-
reset_timer_masked (
);
- while (get_timer
_masked (
) < NA_MII_NEGOTIATE_DELAY) {
+
start = get_timer(0
);
+ while (get_timer
(start
) < NA_MII_NEGOTIATE_DELAY) {
if ((na_mii_read (MII_PHY_STATUS) & 0x8000) == 0) {
break;
}
}
if ((na_mii_read (MII_PHY_STATUS) & 0x8000) == 0) {
break;
}
}
- if (get_timer
_masked (
) >= NA_MII_NEGOTIATE_DELAY)
+ if (get_timer
(start
) >= NA_MII_NEGOTIATE_DELAY)
printf ("phy reset timeout\n");
/* set the PCS reg */
printf ("phy reset timeout\n");
/* set the PCS reg */
@@
-352,7
+350,3
@@
extern int eth_send (volatile void *packet, int length)
printf ("eth_send timeout\n");
return 1;
}
printf ("eth_send timeout\n");
return 1;
}
-
-#endif /* CONFIG_CMD_NET */
-
-#endif /* CONFIG_DRIVER_NETARMETH */