summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2006-02-11 09:15:58 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2006-02-11 09:15:58 +0000
commit98989804697fe0acc12890949a5ec670ca6fa246 (patch)
tree50b045eed8e7db62128e046bb7a6a6b026da2cbb
parent9f393a5c765f462857254069d45ea0397de1cc98 (diff)
force a wakeup of the MAC in nfe_init().
this makes my MCP51 board working. committed over a nfe.
-rw-r--r--sys/dev/pci/if_nfe.c11
-rw-r--r--sys/dev/pci/if_nfereg.h5
2 files changed, 13 insertions, 3 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 */
diff --git a/sys/dev/pci/if_nfereg.h b/sys/dev/pci/if_nfereg.h
index 4e345a4bcd9..894ee5f1cd9 100644
--- a/sys/dev/pci/if_nfereg.h
+++ b/sys/dev/pci/if_nfereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfereg.h,v 1.7 2006/02/04 22:11:41 damien Exp $ */
+/* $OpenBSD: if_nfereg.h,v 1.8 2006/02/11 09:15:57 damien Exp $ */
/*-
* Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
@@ -100,6 +100,9 @@
#define NFE_U2M (1 << 5)
#define NFE_PROMISC (1 << 7)
+#define NFE_PWR_VALID (1 << 8)
+#define NFE_PWR_WAKEUP (1 << 15)
+
#define NFE_MEDIA_SET 0x10000
#define NFE_MEDIA_1000T 0x00032
#define NFE_MEDIA_100TX 0x00064