From owner-freebsd-mobile Wed Aug 29 19:32:53 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 3D6E137B405 for ; Wed, 29 Aug 2001 19:32:47 -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 f7U2Wjq77207; Wed, 29 Aug 2001 20:32:45 -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 f7U2Win16728; Wed, 29 Aug 2001 20:32:45 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200108300232.f7U2Win16728@harmony.village.org> To: Allen Landsidel Subject: Re: Getting closer.. Cc: freebsd-mobile@FreeBSD.ORG In-reply-to: Your message of "Wed, 29 Aug 2001 21:46:57 EDT." <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> References: <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> Date: Wed, 29 Aug 2001 20:32:44 -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.20010829214607.00bc6628@rfnj.org> Allen Landsidel writes: : At 21:41 8/29/2001 -0400, Allen Landsidel wrote: : : >I just cvsupped again today and tried out the myriad changes made since : >the last time.. things still aren't : : Oh... as an addendum to this, I should note that slot-0 is now working : properly. slot-1 however appears to be attached to that bogus pccard1.. : : So, is it fair to say we're half-way done? ;) OK. I know *EXACTLY* what is going on here. First, the PnP BIOS says that there's a device at 0xfcfc that's a pcic. Second, the CL-PD6729/30 is I/O mapped. This means that it is accessed like an ISA device. However, the PCI attachment code assumes one PCI device, ONE SLOT. See the problem? Maybe this patch will help. It is two patches, really, the second one is to get rid of the duplicate insert messages. Note, it uses magic numbers that I'd like to not use, but that can be touched up if this works... Note, you'll still get the whining about can't get I/O port range, but just ignore it for now :-) 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 02:30:07 @@ -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,8 +734,6 @@ &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; @@ -741,6 +741,12 @@ 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; + 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 +769,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 +833,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