Module Name:    src
Committed By:   macallan
Date:           Fri Mar  1 02:30:42 UTC 2019

Modified Files:
        src/sys/arch/sparc/dev: sx.c sxvar.h

Log Message:
adapt to changes in sxreg.h


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc/dev/sx.c \
    src/sys/arch/sparc/dev/sxvar.h

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/sparc/dev/sx.c
diff -u src/sys/arch/sparc/dev/sx.c:1.3 src/sys/arch/sparc/dev/sx.c:1.4
--- src/sys/arch/sparc/dev/sx.c:1.3	Tue Apr 15 10:24:54 2014
+++ src/sys/arch/sparc/dev/sx.c	Fri Mar  1 02:30:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sx.c,v 1.3 2014/04/15 10:24:54 macallan Exp $	*/
+/*	$NetBSD: sx.c,v 1.4 2019/03/01 02:30:42 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.3 2014/04/15 10:24:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.4 2019/03/01 02:30:42 macallan Exp $");
 
 #include "locators.h"
 
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.3 2
 #include <sparc/sparc/asm.h>
 #include <sparc/dev/sxvar.h>
 #include <sparc/dev/sxreg.h>
+#include "opt_sx.h"
 
 /* autoconfiguration driver */
 static	int sx_match(device_t, struct cfdata *, void *);
@@ -57,6 +58,8 @@ static	void sx_attach(device_t, device_t
 CFATTACH_DECL_NEW(sx, sizeof(struct sx_softc),
     sx_match, sx_attach, NULL, NULL);
 
+static struct sx_softc *sx0 = NULL;
+
 static int
 sx_match(device_t parent, struct cfdata *cf, void *aux)
 {
@@ -90,7 +93,7 @@ sx_attach(device_t parent, device_t self
 	id = sx_read(sc, SX_ID);
 	aprint_normal_dev(self, "architecture rev. %d chip rev. %d\n",
 	    (id & SX_ARCHITECTURE_MASK),
-	    (id & SX_CHIP_REVISION) >> 8);
+	    (id & SX_CHIP_REVISION) >> 3);
 
 	/* stop the processor */
 	sx_write(sc, SX_CONTROL_STATUS, 0);
@@ -114,6 +117,8 @@ sx_attach(device_t parent, device_t self
 	/* ... and start the processor again */
 	sx_write(sc, SX_CONTROL_STATUS, SX_PB | SX_GO);
 
+	sx0 = sc;
+
 #ifdef SX_DEBUG
 	sta(0xfc000000, ASI_SX, SX_LD(8, 31, 0));
 	for (i = 1; i < 60; i++)
@@ -143,3 +148,15 @@ sx_attach(device_t parent, device_t self
 #endif
 }
 
+void
+sx_dump(void)
+{
+	if (sx0 == NULL)
+		return;
+	printf("SX STATUS: %08x\n",
+	    bus_space_read_4(sx0->sc_tag, sx0->sc_regh, SX_CONTROL_STATUS));
+	printf("SX ERROR : %08x\n",
+	    bus_space_read_4(sx0->sc_tag, sx0->sc_regh, SX_ERROR));
+	printf("SX DIAG  : %08x\n",
+	    bus_space_read_4(sx0->sc_tag, sx0->sc_regh, SX_DIAGNOSTICS));
+}
Index: src/sys/arch/sparc/dev/sxvar.h
diff -u src/sys/arch/sparc/dev/sxvar.h:1.3 src/sys/arch/sparc/dev/sxvar.h:1.4
--- src/sys/arch/sparc/dev/sxvar.h:1.3	Sun Jun 29 03:57:10 2014
+++ src/sys/arch/sparc/dev/sxvar.h	Fri Mar  1 02:30:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sxvar.h,v 1.3 2014/06/29 03:57:10 tsutsui Exp $	*/
+/*	$NetBSD: sxvar.h,v 1.4 2019/03/01 02:30:42 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,4 +51,6 @@ sx_read(struct sx_softc *sc, int addr)
 	return bus_space_read_4(sc->sc_tag, sc->sc_regh, addr);
 }
 
+void sx_dump(void);
+
 #endif

Reply via email to