summaryrefslogtreecommitdiffstats
path: root/sys/dev/bce
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2006-09-20 18:55:16 +0000
committerambrisko <ambrisko@FreeBSD.org>2006-09-20 18:55:16 +0000
commitd0248e472fa247af29e5075a3f56c787b47fe780 (patch)
tree80fd7be07caf33aaf16499b9787e3c835f5a1584 /sys/dev/bce
parentaf202f9ad60105fc83e7ae3e8c014b8a5be15957 (diff)
downloadFreeBSD-src-d0248e472fa247af29e5075a3f56c787b47fe780.zip
FreeBSD-src-d0248e472fa247af29e5075a3f56c787b47fe780.tar.gz
Add a new 'bce_mgmt_init_locked' function to enable the minimal parts
of the chip to let ASF/IPMI firmware to respond to IPMI after attaching and when the chip is down. David looked at it but could really say what they right minimal config. stuff would be. It's not documented. I figured this out via trial and error. Reviewed by: davidch
Diffstat (limited to 'sys/dev/bce')
-rw-r--r--sys/dev/bce/if_bce.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c
index 34ba0c6..d6cce9d 100644
--- a/sys/dev/bce/if_bce.c
+++ b/sys/dev/bce/if_bce.c
@@ -309,6 +309,7 @@ static int bce_ifmedia_upd (struct ifnet *);
static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *);
static void bce_init_locked (struct bce_softc *);
static void bce_init (void *);
+static void bce_mgmt_init_locked(struct bce_softc *sc);
static void bce_init_context (struct bce_softc *);
static void bce_get_mac_addr (struct bce_softc *);
@@ -781,6 +782,11 @@ bce_attach(device_t dev)
/* Add the supported sysctls to the kernel. */
bce_add_sysctls(sc);
+ /* Get the firmware running so IPMI still works */
+ BCE_LOCK(sc);
+ bce_mgmt_init_locked(sc);
+ BCE_UNLOCK(sc);
+
goto bce_attach_exit;
bce_attach_fail:
@@ -3241,6 +3247,7 @@ bce_stop(struct bce_softc *sc)
DBPRINT(sc, BCE_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
+ bce_mgmt_init_locked(sc);
}
@@ -4569,6 +4576,43 @@ bce_init_locked_exit:
return;
}
+static void
+bce_mgmt_init_locked(struct bce_softc *sc)
+{
+ u32 val;
+ struct ifnet *ifp;
+
+ DBPRINT(sc, BCE_VERBOSE_RESET, "Entering %s()\n", __FUNCTION__);
+
+ BCE_LOCK_ASSERT(sc);
+
+ ifp = sc->bce_ifp;
+
+ /* Check if the driver is still running and bail out if it is. */
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+ goto bce_mgmt_init_locked_exit;
+
+ /* Initialize the on-boards CPUs */
+ bce_init_cpus(sc);
+
+ val = (BCM_PAGE_BITS - 8) << 24;
+ REG_WR(sc, BCE_RV2P_CONFIG, val);
+
+ /* Enable all critical blocks in the MAC. */
+ REG_WR(sc, BCE_MISC_ENABLE_SET_BITS,
+ BCE_MISC_ENABLE_SET_BITS_RX_V2P_ENABLE |
+ BCE_MISC_ENABLE_SET_BITS_RX_DMA_ENABLE |
+ BCE_MISC_ENABLE_SET_BITS_COMPLETION_ENABLE);
+ REG_RD(sc, BCE_MISC_ENABLE_SET_BITS);
+ DELAY(20);
+
+ bce_ifmedia_upd(ifp);
+bce_mgmt_init_locked_exit:
+ DBPRINT(sc, BCE_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
+
+ return;
+}
+
/****************************************************************************/
/* Handles controller initialization when called from an unlocked routine. */
OpenPOWER on IntegriCloud