summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-08-26 00:07:40 +0000
committerimp <imp@FreeBSD.org>2000-08-26 00:07:40 +0000
commit0323c0883bb8fe44a6e4d0fd48bf37d8b7871731 (patch)
treeb6c3030dde03a6a320f26416f5e6b415b875572c /sys/dev/pccard
parent84c0ff464eab1e6a55fde75c0b55fbe2e0dcc2a2 (diff)
downloadFreeBSD-src-0323c0883bb8fe44a6e4d0fd48bf37d8b7871731.zip
FreeBSD-src-0323c0883bb8fe44a6e4d0fd48bf37d8b7871731.tar.gz
Minor tweaks to have the card be properly enabled via the CCR.
Minor debug changes Minor power management pessimizations
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 4b2c4a3..4939412 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -139,9 +139,10 @@ pccard_attach_card(device_t dev)
pf->ih_arg = NULL;
pf->dev = NULL;
}
-
+#if 0
DEVPRINTF((dev, "chip_socket_disable\n"));
POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
+#endif
STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
if (STAILQ_EMPTY(&pf->cfe_head))
@@ -267,7 +268,6 @@ pccard_function_enable(struct pccard_function *pf)
* it's possible for different functions' CCRs to be in the same
* underlying page. Check for that.
*/
-
STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
if ((tmp->pf_flags & PFF_ENABLED) &&
(pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
@@ -293,12 +293,15 @@ pccard_function_enable(struct pccard_function *pf)
if (tmp == NULL) {
pf->ccr_rid = 0;
pf->ccr_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &pf->ccr_rid, pf->ccr_base, pf->ccr_base + PCCARD_CCR_SIZE,
- PCCARD_CCR_SIZE, RF_ACTIVE);
- if (!pf->ccr_res)
+ &pf->ccr_rid, 0xa0000, 0xdffff, 1 << 10, RF_ACTIVE);
+ if (!pf->ccr_res) {
+ DEVPRINTF((dev, "ccr_res == 0\n"));
goto bad;
+ }
CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY,
pf->ccr_rid, PCCARD_A_MEM_ATTR);
+ CARD_SET_MEMORY_OFFSET(device_get_parent(dev), dev,
+ pf->ccr_rid, (pf->ccr_rid >> 10) << 10);
pf->pf_ccrt = rman_get_bustag(pf->ccr_res);
pf->pf_ccrh = rman_get_bushandle(pf->ccr_res);
pf->pf_ccr_offset = rman_get_start(pf->ccr_res);
@@ -375,7 +378,7 @@ pccard_function_enable(struct pccard_function *pf)
*/
if (--pf->sc->sc_enabled_count == 0)
POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
- DEVPRINTF((dev, "--enabled_count = %d\n", pf->sc->sc_enabled_count));
+ DEVPRINTF((dev, "bad --enabled_count = %d\n", pf->sc->sc_enabled_count));
return (1);
}
OpenPOWER on IntegriCloud