diff options
author | 2004-01-20 14:50:22 +0000 | |
---|---|---|
committer | 2004-01-20 14:50:22 +0000 | |
commit | a54a99c7b05415ea06f88c3dbbe16969d5fac0fd (patch) | |
tree | 502ba25a28c5906a7832db7e7d1eba670db48277 | |
parent | Use shifts and logical arithmetic, rather than multiplications and integer (diff) | |
download | wireguard-openbsd-a54a99c7b05415ea06f88c3dbbe16969d5fac0fd.tar.xz wireguard-openbsd-a54a99c7b05415ea06f88c3dbbe16969d5fac0fd.zip |
when reading eeprom for the address, DELAY(4) during the operations.
added by netbsd to support cats machines, but i ran into it on the
alpha cs20's fxp0 when additional bits got set or reset randomly
-rw-r--r-- | sys/dev/ic/fxp.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 6e45fb7d077..e0544984306 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.46 2004/01/08 17:40:33 jmc Exp $ */ +/* $OpenBSD: fxp.c,v 1.47 2004/01/20 14:50:22 deraadt Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -522,9 +522,9 @@ fxp_autosize_eeprom(sc) CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg | FXP_EEPROM_EESK); - DELAY(1); + DELAY(4); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); - DELAY(1); + DELAY(4); } /* * Shift in address. @@ -534,14 +534,14 @@ fxp_autosize_eeprom(sc) CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS | FXP_EEPROM_EESK); - DELAY(1); + DELAY(4); if ((CSR_READ_2(sc, FXP_CSR_EEPROMCONTROL) & FXP_EEPROM_EEDO) == 0) break; CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS); - DELAY(1); + DELAY(4); } CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0); - DELAY(1); + DELAY(4); sc->eeprom_size = x; } /* @@ -575,9 +575,9 @@ fxp_read_eeprom(sc, data, offset, words) CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg | FXP_EEPROM_EESK); - DELAY(1); + DELAY(4); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); - DELAY(1); + DELAY(4); } /* * Shift in address. @@ -591,9 +591,9 @@ fxp_read_eeprom(sc, data, offset, words) CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg | FXP_EEPROM_EESK); - DELAY(1); + DELAY(4); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); - DELAY(1); + DELAY(4); } reg = FXP_EEPROM_EECS; data[i] = 0; @@ -603,16 +603,16 @@ fxp_read_eeprom(sc, data, offset, words) for (x = 16; x > 0; x--) { CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg | FXP_EEPROM_EESK); - DELAY(1); + DELAY(4); if (CSR_READ_2(sc, FXP_CSR_EEPROMCONTROL) & FXP_EEPROM_EEDO) data[i] |= (1 << (x - 1)); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg); - DELAY(1); + DELAY(4); } data[i] = letoh16(data[i]); CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0); - DELAY(1); + DELAY(4); } } |