From owner-freebsd-mobile Wed Aug 29 21:30:26 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 16F0037B401 for ; Wed, 29 Aug 2001 21:30:22 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f7U4UKq77540; Wed, 29 Aug 2001 22:30:21 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.4) with ESMTP id f7U4UKn17585; Wed, 29 Aug 2001 22:30:20 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200108300430.f7U4UKn17585@harmony.village.org> To: Allen Landsidel Subject: Re: Getting closer.. Cc: freebsd-mobile@FreeBSD.ORG In-reply-to: Your message of "Thu, 30 Aug 2001 00:24:56 EDT." <5.1.0.14.0.20010830002045.00c53d18@rfnj.org> References: <5.1.0.14.0.20010830002045.00c53d18@rfnj.org> <200108300402.f7U42Tn17359@harmony.village.org> <5.1.0.14.0.20010829235424.00c34fd0@rfnj.org> <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> Date: Wed, 29 Aug 2001 22:30:20 -0600 From: Warner Losh Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <5.1.0.14.0.20010830002045.00c53d18@rfnj.org> Allen Landsidel writes: : Ok we're going backwards.. no I've got 0 slots detected. On the other : hand, the machine reboots properly now. ;) OK. That's a big clue. I wonder what I've done wrong... : dmesg : : : pcic0: port 0xfcfc-0xfcff at : device 19.0 on pci0 : pcic0: Polling mode OK. Maybe I made a paren error? Warner Index: pcic_pci.c =================================================================== RCS file: /cache/ncvs/src/sys/pccard/pcic_pci.c,v retrieving revision 1.54.2.12 diff -u -r1.54.2.12 pcic_pci.c --- pcic_pci.c 2001/08/27 16:34:03 1.54.2.12 +++ pcic_pci.c 2001/08/30 04:27:48 @@ -706,8 +706,10 @@ struct pcic_slot *sp; struct pcic_softc *sc; u_int32_t sockbase; + u_int32_t stat; struct pcic_pci_table *itm; int rid; + int i; struct resource *r = NULL; int error; u_long irq = 0; @@ -732,15 +734,20 @@ &sc->iorid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (sc->iores == NULL) return (ENOMEM); - sp->getb = pcic_getb_io; - sp->putb = pcic_putb_io; sp->bst = rman_get_bustag(sc->iores); sp->bsh = rman_get_bushandle(sc->iores); - sp->offset = pci_get_function(dev) * PCIC_SLOT_SIZE; sp->controller = PCIC_PD672X; sp->revision = 0; sc->flags = PCIC_PD_POWER; itm = pcic_pci_lookup(device_id, &pcic_pci_devs[0]); + for (i = 0; i < 2; i++) { + sp[i].getb = pcic_getb_io; + sp[i].putb = pcic_putb_io; + sp[i].offset = i * PCIC_SLOT_SIZE; + printf("ID is 0x%x\n", sp[i].getb(sp, PCIC_ID_REV)); + if ((sp[i].getb(sp, PCIC_ID_REV) & 0xc0) == 0x80) + sp[i].slt = (struct slot *) 1; + } } else { sc->memrid = CB_PCI_SOCKET_BASE; sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, @@ -763,11 +770,11 @@ sp->revision = 0; sc->flags = PCIC_DF_POWER; } + sp->slt = (struct slot *) 1; } sc->dev = dev; sc->csc_route = pcic_intr_path; sc->func_route = pcic_intr_path; - sp->slt = (struct slot *) 1; if (sc->csc_route == pcic_iw_pci) { rid = 0; @@ -827,6 +834,8 @@ } } + stat = bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_STATE); + sc->cd_present = (stat & CB_SS_CD) == 0; return (pcic_attach(dev)); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message