Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc prom mailbox map: look for the property...



details:   https://anonhg.NetBSD.org/src/rev/552b7dc45640
branches:  trunk
changeset: 541089:552b7dc45640
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Jan 01 15:51:00 2003 +0000

description:
prom mailbox map: look for the property `mailbox-virtual' first.

diffstat:

 sys/arch/sparc/sparc/cpu.c |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 167c25d54b1e -r 552b7dc45640 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Wed Jan 01 15:25:54 2003 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Wed Jan 01 15:51:00 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.145 2002/12/31 15:10:28 pk Exp $ */
+/*     $NetBSD: cpu.c,v 1.146 2003/01/01 15:51:00 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -295,6 +295,7 @@
        void *aux;
 {
        struct mainbus_attach_args *ma = aux;
+       struct { u_int32_t va; u_int32_t size; } *mbprop = NULL;
        struct openprom_addr *rrp = NULL;
        struct cpu_info *cpi;
        int mid, node;
@@ -309,9 +310,20 @@
        /*
         * Map CPU mailbox if available
         */
-       if (node != 0 && (error = PROM_getprop(node, "mailbox",
+       if (node != 0 && (error = PROM_getprop(node, "mailbox-virtual",
+                                       sizeof(*mbprop),
+                                       &n, (void **)&mbprop)) == 0) {
+               cpi->mailbox = mbprop->va;
+               free(mbprop, M_DEVBUF);
+       } else if (node != 0 && (error = PROM_getprop(node, "mailbox",
                                        sizeof(struct openprom_addr),
-                                        &n, (void **)&rrp)) == 0) {
+                                       &n, (void **)&rrp)) == 0) {
+               if (rrp[0].oa_space != 0)
+                       panic("%s: mailbox in I/O space", self->dv_xname);
+
+               /* XXX - map cached/uncached? If cached, deal with
+                *       cache congruency!
+                */
                if (bus_space_map(ma->ma_bustag,
                                BUS_ADDR(rrp[0].oa_space, rrp[0].oa_base),
                                rrp[0].oa_size,
@@ -1587,6 +1599,8 @@
        } else {
                sc->cache_flush = viking_cache_flush;
        }
+       if (cpus != NULL && cpus[0]->mxcc != sc->mxcc)
+               panic("[MXCC module mismatch]");
 
        /* XXX! */
        if (sc->mxcc)



Home | Main Index | Thread Index | Old Index