diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-12-31 18:24:42 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-12-31 18:24:42 +0000 |
commit | 8ec04d2f6327714e70c13f43d91fcb037d69ea4e (patch) | |
tree | 3ba76e2a383e9d41d7652f746b26a42fb03c76c7 /sys/dev/ic | |
parent | bf8a0140762ef18077e4bf3698a30c3a2480b2f5 (diff) |
move reading of the hardware revision earlier.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/athn.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c index 3f42e96d79d..67bc0fb1fed 100644 --- a/sys/dev/ic/athn.c +++ b/sys/dev/ic/athn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: athn.c,v 1.66 2010/12/31 17:17:14 damien Exp $ */ +/* $OpenBSD: athn.c,v 1.67 2010/12/31 18:24:41 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -174,6 +174,9 @@ athn_attach(struct athn_softc *sc) struct ifnet *ifp = &ic->ic_if; int error; + /* Read hardware revision. */ + athn_get_chipid(sc); + if ((error = athn_reset_power_on(sc)) != 0) { printf("%s: could not reset chip\n", sc->sc_dev.dv_xname); return (error); @@ -602,7 +605,6 @@ athn_reset_power_on(struct athn_softc *sc) AR_WRITE(sc, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT); - /* XXX on first call, we do not know the chip id yet. */ if (!AR_SREV_9380_10_OR_LATER(sc)) { /* Make sure no DMA is active by doing an AHB reset. */ AR_WRITE(sc, AR_RC, AR_RC_AHB); @@ -626,10 +628,6 @@ athn_reset_power_on(struct athn_softc *sc) DPRINTF(("RTC not waking up\n")); return (ETIMEDOUT); } - - /* Read hardware revision. */ - athn_get_chipid(sc); - return (athn_reset(sc, 0)); } |