Subject: Re: Problems with 1.5.2/1.6_RC and AMD network drivers
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 08/21/2002 22:09:36
--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Aug 19, 2002 at 09:29:02AM +1000, Darren Reed wrote:
> I picked up two PCI cards with AMD network chips, on the weekend.
> One is a combo card (53c875 + AMD), the other is a dual-10/100 port
> network card.  Both 1.5.2 & 1.6 see the SCSI fine, but I'm not sure
> about the network card(s).   1.5.2 would give me le1, 1.6 gives me
> a pcn1.  That's two AMD network ports missing in action.  Output
> from boot messages (with the PCI verbose thing set) is included.

What about the attached patch ? It seems that for some reasons,
I/O space are not allocated to the first AMD network device.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: if_pcn.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/if_pcn.c,v
retrieving revision 1.9
diff -u -r1.9 if_pcn.c
--- if_pcn.c	2002/05/03 00:16:12	1.9
+++ if_pcn.c	2002/08/21 20:07:50
@@ -542,10 +542,11 @@
 	pci_chipset_tag_t pc = pa->pa_pc;
 	pci_intr_handle_t ih;
 	const char *intrstr = NULL;
-	bus_space_tag_t iot;
-	bus_space_handle_t ioh;
+	bus_space_tag_t iot, memt;
+	bus_space_handle_t ioh, memh;
 	bus_dma_segment_t seg;
 	int ioh_valid;
+	int memh_valid;
 	int i, rseg, error;
 	pcireg_t pmode;
 	uint32_t chipid, reg;
@@ -561,10 +562,15 @@
 	 */
 	ioh_valid = (pci_mapreg_map(pa, PCN_PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
 	    &iot, &ioh, NULL, NULL) == 0);
+	memh_valid = (pci_mapreg_map(pa, PCN_PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
+	    &memt, &memh, NULL, NULL) == 0);
 
 	if (ioh_valid) {
 		sc->sc_st = iot;
 		sc->sc_sh = ioh;
+	} else if (memh_valid) {
+		sc->sc_st = memt;
+		sc->sc_sh = memh;
 	} else {
 		printf("%s: unable to map device registers\n",
 		    sc->sc_dev.dv_xname);
Index: if_pcnreg.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/if_pcnreg.h,v
retrieving revision 1.2
diff -u -r1.2 if_pcnreg.h
--- if_pcnreg.h	2001/11/29 17:15:44	1.2
+++ if_pcnreg.h	2002/08/21 20:07:50
@@ -52,6 +52,7 @@
  */
 
 #define	PCN_PCI_CBIO	(PCI_MAPREG_START + 0x00)
+#define	PCN_PCI_CBMEM	(PCI_MAPREG_START + 0x04)
 
 /*
  * I/O map in Word I/O mode.

--IJpNTDwzlM2Ie8A6--