Subject: KA53 asc/clock bug
To: None <port-vax@netbsd.org>
From: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
List: port-vax
Date: 07/29/2007 11:05:22
--PmA2V3Z32TCmWXqI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In asc_vsbus_attach() the SCSI id for the controller is read from some
clock chip NVRAM. This causes a segv in kernel mode for the KA53 which
seems to lack the clock chip. OpenBSD uses a hardcoded SCSI id 6 for all
systems but KA46, but since the existing code works with KA48 and KA49
too I made the hardcoded value a special case for the KA53.
--
%SYSTEM-F-ANARCHISM, The operating system has been overthrown
--PmA2V3Z32TCmWXqI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="asc_vsbus.diff"
Index: asc_vsbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vsa/asc_vsbus.c,v
retrieving revision 1.35
diff -u -r1.35 asc_vsbus.c
--- asc_vsbus.c 4 Mar 2007 19:21:56 -0000 1.35
+++ asc_vsbus.c 29 Jul 2007 08:53:04 -0000
@@ -249,8 +249,18 @@
error = bus_dmamap_create(asc->sc_dmat, ASC_MAXXFERSIZE, 1,
ASC_MAXXFERSIZE, 0, BUS_DMA_NOWAIT, &asc->sc_dmamap);
- /* SCSI ID is store in the clock NVRAM at magic address 0xbc */
- sc->sc_id = (clk_page[0xbc/2] >> clk_tweak) & 7;
+ switch (vax_boardtype) {
+#if defined(VAX53)
+ case VAX_BTYP_53:
+ sc->sc_id = 6; /* XXX need to get this from VMB */
+ break;
+#endif
+ default:
+ /* SCSI ID is store in the clock NVRAM at magic address 0xbc */
+ sc->sc_id = (clk_page[0xbc/2] >> clk_tweak) & 7;
+ break;
+ }
+
sc->sc_freq = ASC_FREQUENCY;
/* gimme MHz */
--PmA2V3Z32TCmWXqI--