Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev adapt to changes in sxreg.h
details: https://anonhg.NetBSD.org/src/rev/398db5afc3fc
branches: trunk
changeset: 997240:398db5afc3fc
user: macallan <macallan%NetBSD.org@localhost>
date: Fri Mar 01 02:30:42 2019 +0000
description:
adapt to changes in sxreg.h
diffstat:
sys/arch/sparc/dev/sx.c | 23 ++++++++++++++++++++---
sys/arch/sparc/dev/sxvar.h | 4 +++-
2 files changed, 23 insertions(+), 4 deletions(-)
diffs (85 lines):
diff -r e6a8a41ff272 -r 398db5afc3fc sys/arch/sparc/dev/sx.c
--- a/sys/arch/sparc/dev/sx.c Fri Mar 01 02:28:27 2019 +0000
+++ b/sys/arch/sparc/dev/sx.c Fri Mar 01 02:30:42 2019 +0000
@@ -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 @@
#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 @@
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 @@
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 @@
/* ... 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 @@
#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));
+}
diff -r e6a8a41ff272 -r 398db5afc3fc sys/arch/sparc/dev/sxvar.h
--- a/sys/arch/sparc/dev/sxvar.h Fri Mar 01 02:28:27 2019 +0000
+++ b/sys/arch/sparc/dev/sxvar.h Fri Mar 01 02:30:42 2019 +0000
@@ -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 @@
return bus_space_read_4(sc->sc_tag, sc->sc_regh, addr);
}
+void sx_dump(void);
+
#endif
Home |
Main Index |
Thread Index |
Old Index