Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2001 22:30:20 -0600
From:      Warner Losh <imp@harmony.village.org>
To:        Allen Landsidel <all@biosys.net>
Cc:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: Getting closer.. 
Message-ID:  <200108300430.f7U4UKn17585@harmony.village.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>  <Your message of "Wed, 29 Aug 2001 22:02:29 MDT." <200108300402.f7U42Tn17359@harmony.village.org> <200108300402.f7U42Tn17359@harmony.village.org> <5.1.0.14.0.20010829235424.00c34fd0@rfnj.org> <Your message of "Wed, 29 Aug 2001 21:46:57 EDT." <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Cirrus Logic PD6729/6730 PC-Card Controller> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108300430.f7U4UKn17585>