Module Name:    src
Committed By:   simonb
Date:           Thu Sep  3 06:42:29 UTC 2020

Modified Files:
        src/sys/arch/pmax/tc: ioasic.c

Log Message:
The TC device addresses are defined in KSEG1, but this confuses
bus_space(9) which expects bus addresses and not kernel virtual
addresses.  Pull the addresses back to bus addresses with
MIPS_KSEG1_TO_PHYS().

XXX: Fix this properly one day (without storing KSEG1 addrs in
the TC device configuration).

Fixes problem with TURBOchannel pmaxes panicing during
autoconfiguartion.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/pmax/tc/ioasic.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/pmax/tc/ioasic.c
diff -u src/sys/arch/pmax/tc/ioasic.c:1.22 src/sys/arch/pmax/tc/ioasic.c:1.23
--- src/sys/arch/pmax/tc/ioasic.c:1.22	Sun Nov 10 20:09:53 2013
+++ src/sys/arch/pmax/tc/ioasic.c	Thu Sep  3 06:42:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioasic.c,v 1.22 2013/11/10 20:09:53 christos Exp $	*/
+/*	$NetBSD: ioasic.c,v 1.23 2020/09/03 06:42:29 simonb Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.22 2013/11/10 20:09:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.23 2020/09/03 06:42:29 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -133,7 +133,14 @@ ioasicattach(device_t parent, device_t s
 
 	sc->sc_dev = self;
 	sc->sc_bst = ta->ta_memt;
-	if (bus_space_map(ta->ta_memt, ta->ta_addr,
+	/*
+	 * XXX
+	 * The TC device addresses are defined in KSEG1, but this
+	 * confuses bus_space(9) which expects bus addresses and
+	 * not kernel virtual addresses.  Pull the addresses back
+	 * to bus addresses with MIPS_KSEG1_TO_PHYS().
+	 */
+	if (bus_space_map(ta->ta_memt, MIPS_KSEG1_TO_PHYS(ta->ta_addr),
 			0x400000, 0, &sc->sc_bsh)) {
 		printf("%s: unable to map device\n", device_xname(self));
 		return;

Reply via email to