Module Name:    src
Committed By:   macallan
Date:           Sat Sep 18 23:54:13 UTC 2021

Modified Files:
        src/sys/arch/hppa/dev: dino.c

Log Message:
explain why we skip over dev 1f func 7 in config space access functions
no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/dev/dino.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/dev/dino.c
diff -u src/sys/arch/hppa/dev/dino.c:1.12 src/sys/arch/hppa/dev/dino.c:1.13
--- src/sys/arch/hppa/dev/dino.c:1.12	Sat Aug  7 16:18:55 2021
+++ src/sys/arch/hppa/dev/dino.c	Sat Sep 18 23:54:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.12 2021/08/07 16:18:55 thorpej Exp $ */
+/*	$NetBSD: dino.c,v 1.13 2021/09/18 23:54:13 macallan Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.12 2021/08/07 16:18:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.13 2021/09/18 23:54:13 macallan Exp $");
 
 /* #include "cardbus.h" */
 
@@ -347,8 +347,18 @@ dino_conf_read(void *v, pcitag_t tag, in
 
 	/*
 	 * XXX
-	 * accessing dev 1f / func 7 on the 2nd Dino causes a machine check
-	 * exception on my C200
+	 * thus sayeth the Dino manual:
+	 * 7.7.1 Generating PCI Special Cycles thru PA I/O Space
+	 * When the PCI_CONFIG_ADDR registers BUS_NUM is the equal to the
+	 * DINO’s bus number, 8’h00, DEV_NUM and Function fields are all ones,
+	 * and the REG_NUM field is all zeros the next write to PCI_CONFIG_DATA
+	 * register will generate a special cycle on DINO’s PCI bus. If the
+	 * BUS_NUM field does not equal DINO bus number then a type 1
+	 * transaction will be forwarded to PCI as described above.
+	 * Note: Dino is using a legal PCI configuration address to generate a
+	 * PCI special cycle. System firmware and software should not attempt
+	 * to read or write to this configuration address when walking the
+	 * PCI bus through configuration address space.
 	 */
 	if ((tag & 0xff00) == 0xff00)
 		return -1;
@@ -377,9 +387,7 @@ dino_conf_write(void *v, pcitag_t tag, i
 		return;
 
 	/*
-	 * XXX
-	 * accessing dev 1f / func 7 on the 2nd Dino causes a machine check
-	 * exception on my C200
+	 * don't try to access dev 1f / func 7, see comment in dino_conf_read()
 	 */
 	if ((tag & 0xff00) == 0xff00) return;
 
@@ -1644,7 +1652,7 @@ dinoattach(device_t parent, device_t sel
 		return;
 	}
 
-	sc->sc_regs = r = (volatile struct dino_regs *)sc->sc_bh;
+	sc->sc_regs = r = (volatile struct dino_regs *)sc->sc_bh;	
 #ifdef trust_the_firmware_to_proper_initialize_everything
 	r->io_addr_en = 0;
 	r->io_control = 0x80;
@@ -1652,7 +1660,7 @@ dinoattach(device_t parent, device_t sel
 	r->papr = 0;
 	r->io_fbb_en |= 1;
 	r->damode = 0;
-	r->gmask &= ~1;	/* allow GSC bus req */
+	r->gmask &= ~1; /* allow GSC bus req */
 	r->pciror = 0;
 	r->pciwor = 0;
 	r->brdg_feat = 0xc0000000;

Reply via email to