Module Name:    src
Committed By:   macallan
Date:           Tue Apr 15 10:24:54 UTC 2014

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

Log Message:
print chip revision on attach


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/dev/sx.c
cvs rdiff -u -r1.1 -r1.2 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.2 src/sys/arch/sparc/dev/sx.c:1.3
--- src/sys/arch/sparc/dev/sx.c:1.2	Wed Feb  6 04:06:29 2013
+++ src/sys/arch/sparc/dev/sx.c	Tue Apr 15 10:24:54 2014
@@ -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 @@ sx_attach(device_t parent, device_t self
 {
 	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 @@ sx_attach(device_t parent, device_t self
 		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. */

Index: src/sys/arch/sparc/dev/sxvar.h
diff -u src/sys/arch/sparc/dev/sxvar.h:1.1 src/sys/arch/sparc/dev/sxvar.h:1.2
--- src/sys/arch/sparc/dev/sxvar.h:1.1	Tue Feb  5 21:52:48 2013
+++ src/sys/arch/sparc/dev/sxvar.h	Tue Apr 15 10:24:54 2014
@@ -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 @@ sx_write(struct sx_softc *sc, int addr, 
 	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

Reply via email to