Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 Print the host Id in mainbus_attach...



details:   https://anonhg.NetBSD.org/src/rev/ae8fcdbbeecb
branches:  trunk
changeset: 559431:ae8fcdbbeecb
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Mar 17 14:35:53 2004 +0000

description:
Print the host Id in mainbus_attach() instead of clock_attach().

diffstat:

 sys/arch/sparc64/sparc64/autoconf.c |   7 ++++---
 sys/arch/sparc64/sparc64/clock.c    |  23 ++++-------------------
 2 files changed, 8 insertions(+), 22 deletions(-)

diffs (94 lines):

diff -r 3924c8a48615 -r ae8fcdbbeecb sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Wed Mar 17 14:26:59 2004 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Wed Mar 17 14:35:53 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.90 2004/03/16 23:05:45 pk Exp $ */
+/*     $NetBSD: autoconf.c,v 1.91 2004/03/17 14:35:53 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.90 2004/03/16 23:05:45 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.91 2004/03/17 14:35:53 pk Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -639,7 +639,8 @@
        };
 
        OF_getprop(findroot(), "name", machine_model, sizeof machine_model);
-       printf(": %s\n", machine_model);
+       prom_getidprom();
+       printf(": %s: hostid %lx\n", machine_model, hostid);
 
        /*
         * Locate and configure the ``early'' devices.  These must be
diff -r 3924c8a48615 -r ae8fcdbbeecb sys/arch/sparc64/sparc64/clock.c
--- a/sys/arch/sparc64/sparc64/clock.c  Wed Mar 17 14:26:59 2004 +0000
+++ b/sys/arch/sparc64/sparc64/clock.c  Wed Mar 17 14:35:53 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.68 2004/03/17 14:26:59 pk Exp $ */
+/*     $NetBSD: clock.c,v 1.69 2004/03/17 14:35:53 pk Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.68 2004/03/17 14:26:59 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.69 2004/03/17 14:35:53 pk Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -84,7 +84,6 @@
 #include <machine/autoconf.h>
 #include <machine/eeprom.h>
 #include <machine/cpu.h>
-#include <machine/idprom.h>
 
 #include <dev/clock_subr.h>
 #include <dev/ic/mk48txxreg.h>
@@ -145,9 +144,8 @@
 
 extern struct cfdriver clock_cd;
 
-/* Global TOD clock handle & idprom pointer */
+/* Global TOD clock handle */
 static todr_chip_handle_t todr_handle = NULL;
-static struct idprom *idprom;
 
 static int     timermatch __P((struct device *, struct cfdata *, void *));
 static void    timerattach __P((struct device *, struct device *, void *));
@@ -330,8 +328,6 @@
        struct mk48txx_softc *sc;
        int node;
 {
-       struct idprom *idp;
-       int h;
 
        sc->sc_model = PROM_getpropstring(node, "model");
 
@@ -344,18 +340,7 @@
        sc->sc_year0 = 1968;
        mk48txx_attach(sc);
 
-#define IDPROM_OFFSET (8*1024 - 40)    /* XXX - get nvram sz from driver */
-       idp = (struct idprom *)((vaddr_t)bus_space_vaddr(sc->sc_bst,
-           sc->sc_bsh) + IDPROM_OFFSET);
-
-       h = idp->id_machine << 24;
-       h |= idp->id_hostid[0] << 16;
-       h |= idp->id_hostid[1] << 8;
-       h |= idp->id_hostid[2];
-       hostid = h;
-       printf(": hostid %x\n", (u_int)hostid);
-
-       idprom = idp;
+       printf("\n");
 
        /* XXX should be done by todr_attach() */
        todr_handle = &sc->sc_handle;



Home | Main Index | Thread Index | Old Index