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 print chip revision on attach
details: https://anonhg.NetBSD.org/src/rev/a0acab2a4cb3
branches: trunk
changeset: 328721:a0acab2a4cb3
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Apr 15 10:24:54 2014 +0000
description:
print chip revision on attach
diffstat:
sys/arch/sparc/dev/sx.c | 10 ++++++++--
sys/arch/sparc/dev/sxvar.h | 8 +++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diffs (59 lines):
diff -r cb2e5612bb22 -r a0acab2a4cb3 sys/arch/sparc/dev/sx.c
--- a/sys/arch/sparc/dev/sx.c Tue Apr 15 10:02:21 2014 +0000
+++ b/sys/arch/sparc/dev/sx.c Tue Apr 15 10:24:54 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sx.c,v 1.2 2013/02/06 04:06:29 macallan Exp $ */
+/* $NetBSD: sx.c,v 1.3 2014/04/15 10:24:54 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.2 2013/02/06 04:06:29 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.3 2014/04/15 10:24:54 macallan Exp $");
#include "locators.h"
@@ -70,6 +70,7 @@
{
struct sx_softc *sc = device_private(self);
struct mainbus_attach_args *ma = aux;
+ uint32_t id;
int i;
#ifdef SX_DEBUG
int j;
@@ -86,6 +87,11 @@
return;
}
+ 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);
+
/* stop the processor */
sx_write(sc, SX_CONTROL_STATUS, 0);
/* initialize control registers, clear errors etc. */
diff -r cb2e5612bb22 -r a0acab2a4cb3 sys/arch/sparc/dev/sxvar.h
--- a/sys/arch/sparc/dev/sxvar.h Tue Apr 15 10:02:21 2014 +0000
+++ b/sys/arch/sparc/dev/sxvar.h Tue Apr 15 10:24:54 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sxvar.h,v 1.1 2013/02/05 21:52:48 macallan Exp $ */
+/* $NetBSD: sxvar.h,v 1.2 2014/04/15 10:24:54 macallan Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,4 +45,10 @@
bus_space_write_4(sc->sc_tag, sc->sc_regh, addr, val);
}
+static inline uint32_t
+sx_read(struct sx_softc *sc, int addr)
+{
+ return bus_space_read_4(sc->sc_tag, sc->sc_regh, addr);
+}
+
#endif
\ No newline at end of file
Home |
Main Index |
Thread Index |
Old Index