diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-02-11 09:15:58 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-02-11 09:15:58 +0000 |
commit | 98989804697fe0acc12890949a5ec670ca6fa246 (patch) | |
tree | 50b045eed8e7db62128e046bb7a6a6b026da2cbb /sys/dev/pci/if_nfe.c | |
parent | 9f393a5c765f462857254069d45ea0397de1cc98 (diff) |
force a wakeup of the MAC in nfe_init().
this makes my MCP51 board working.
committed over a nfe.
Diffstat (limited to 'sys/dev/pci/if_nfe.c')
-rw-r--r-- | sys/dev/pci/if_nfe.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index c88250efca1..b711d837ad9 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.23 2006/02/10 03:54:54 brad Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.24 2006/02/11 09:15:57 damien Exp $ */ /*- * Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr> @@ -954,7 +954,7 @@ int nfe_init(struct ifnet *ifp) { struct nfe_softc *sc = ifp->if_softc; - uint32_t rxtxctl; + uint32_t tmp, rxtxctl; if (ifp->if_flags & IFF_RUNNING) return 0; @@ -990,6 +990,13 @@ nfe_init(struct ifnet *ifp) (NFE_RX_RING_COUNT - 1) << 16 | (NFE_TX_RING_COUNT - 1)); + /* force MAC to wakeup */ + tmp = NFE_READ(sc, NFE_PWR_STATE); + NFE_WRITE(sc, NFE_PWR_STATE, tmp | NFE_PWR_WAKEUP); + DELAY(10); + tmp = NFE_READ(sc, NFE_PWR_STATE); + NFE_WRITE(sc, NFE_PWR_STATE, tmp | NFE_PWR_VALID); + NFE_WRITE(sc, NFE_SETUP_R1, NFE_R1_MAGIC); NFE_WRITE(sc, NFE_SETUP_R2, NFE_R2_MAGIC); NFE_WRITE(sc, NFE_TIMER_INT, 970); /* XXX Magic */ |