mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 20:18:54 -04:00
DM9000: Some minor code cleanups
Some lines of the U-boot DM9000x driver are longer than 80 characters, or need some other minor cleanup. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
850ba7555d
commit
98291e2e68
@ -51,6 +51,7 @@ v1.2 03/18/2003 Weilun Huang <weilun_huang@davicom.com.tw>:
|
||||
for DM9000A.
|
||||
- Adapted reset procedure to match DM9000 application
|
||||
notes (i.e. double reset)
|
||||
- some minor code cleanups
|
||||
These changes are tested with DM9000{A,EP,E} together
|
||||
with a 200MHz Atmel AT91SAM92161 core
|
||||
|
||||
@ -454,15 +455,22 @@ eth_init(bd_t * bd)
|
||||
/* Set PHY */
|
||||
set_PHY_mode();
|
||||
|
||||
/* Program operating register */
|
||||
DM9000_iow(DM9000_NCR, 0x0); /* only intern phy supported by now */
|
||||
DM9000_iow(DM9000_TCR, 0); /* TX Polling clear */
|
||||
DM9000_iow(DM9000_BPTR, 0x3f); /* Less 3Kb, 200us */
|
||||
DM9000_iow(DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8)); /* Flow Control : High/Low Water */
|
||||
DM9000_iow(DM9000_FCR, 0x0); /* SH FIXME: This looks strange! Flow Control */
|
||||
DM9000_iow(DM9000_SMCR, 0); /* Special Mode */
|
||||
DM9000_iow(DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END); /* clear TX status */
|
||||
DM9000_iow(DM9000_ISR, 0x0f); /* Clear interrupt status */
|
||||
/* Program operating register, only intern phy supported by now */
|
||||
DM9000_iow(DM9000_NCR, 0x0);
|
||||
/* TX Polling clear */
|
||||
DM9000_iow(DM9000_TCR, 0);
|
||||
/* Less 3Kb, 200us */
|
||||
DM9000_iow(DM9000_BPTR, 0x3f);
|
||||
/* Flow Control : High/Low Water */
|
||||
DM9000_iow(DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8));
|
||||
/* SH FIXME: This looks strange! Flow Control */
|
||||
DM9000_iow(DM9000_FCR, 0x0);
|
||||
/* Special Mode */
|
||||
DM9000_iow(DM9000_SMCR, 0);
|
||||
/* clear TX status */
|
||||
DM9000_iow(DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
|
||||
/* Clear interrupt status */
|
||||
DM9000_iow(DM9000_ISR, 0x0f);
|
||||
|
||||
/* Set Node address */
|
||||
for (i = 0; i < 6; i++)
|
||||
@ -496,8 +504,11 @@ eth_init(bd_t * bd)
|
||||
DM9000_DBG("\n");
|
||||
|
||||
/* Activate DM9000 */
|
||||
DM9000_iow(DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN); /* RX enable */
|
||||
DM9000_iow(DM9000_IMR, IMR_PAR); /* Enable TX/RX interrupt mask */
|
||||
/* RX enable */
|
||||
DM9000_iow(DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
|
||||
/* Enable TX/RX interrupt mask */
|
||||
DM9000_iow(DM9000_IMR, IMR_PAR);
|
||||
|
||||
i = 0;
|
||||
while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */
|
||||
udelay(1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user