Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/sparc64/sparc64 Pullup 1.10-1.14 [eeh]:



details:   https://anonhg.NetBSD.org/src/rev/5e6408d2d905
branches:  netbsd-1-5
changeset: 489775:5e6408d2d905
user:      tv <tv%NetBSD.org@localhost>
date:      Tue Oct 17 01:56:37 2000 +0000

description:
Pullup 1.10-1.14 [eeh]:
Fix some sign extension bugs.
----------------------------
Fix E250 identification.
----------------------------
Add workaround for E250s.
----------------------------
prom_claim_phys: it appears one result argument too many was specified.
Now we can return the actual result of the call rather than merely
reflecting the input.
----------------------------
prom_claim_phys: set `align' parameter to 0 (meaning: get the chunk at the
specified address).

diffstat:

 sys/arch/sparc64/sparc64/ofw_machdep.c |  27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diffs (74 lines):

diff -r 94682d1a30ea -r 5e6408d2d905 sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c    Tue Oct 17 01:46:31 2000 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c    Tue Oct 17 01:56:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_machdep.c,v 1.9.4.1 2000/07/18 16:23:31 mrg Exp $  */
+/*     $NetBSD: ofw_machdep.c,v 1.9.4.2 2000/10/17 01:56:37 tv Exp $   */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -163,7 +163,7 @@
                    (int)(args.mode>>32), (int)args.mode, (int)(args.phys_hi>>32), (int)args.phys_hi,
                    (int)(args.phys_lo>>32), (int)args.phys_lo);
 #endif
-       return (paddr_t)((((paddr_t)args.phys_hi)<<32)|(int)args.phys_lo); 
+       return (paddr_t)((((paddr_t)args.phys_hi)<<32)|(u_int32_t)args.phys_lo); 
 }
 
 /* 
@@ -401,7 +401,7 @@
        args.len = len;
        if (openfirmware(&args) != 0)
                return 0;
-       return (paddr_t)((((paddr_t)args.phys_hi)<<32)|(int)args.phys_lo);
+       return (paddr_t)((((paddr_t)args.phys_hi)<<32)|(u_int32_t)args.phys_lo);
 }
 
 /* 
@@ -444,7 +444,7 @@
        args.phys_lo = HDL2CELL(phys);
        if (openfirmware(&args) != 0)
                return -1;
-       return (paddr_t)((((paddr_t)args.rphys_hi)<<32)|(int)args.rphys_lo);
+       return (paddr_t)((((paddr_t)args.rphys_hi)<<32)|(u_int32_t)args.rphys_lo);
 }
 
 /* 
@@ -507,12 +507,26 @@
                cell_t phys_lo;
        } args;
        paddr_t addr;
+       int rooth;
+       int is_e250 = 1;
+
+       /* E250s tend to have buggy PROMs that break on test-method */
+       if ((rooth = OF_finddevice("/")) != -1) {
+               char name[80];
+
+               if ((OF_getprop(rooth, "name", &name, sizeof(name))) != -1) {
+                       if (strcmp(name, "SUNW,Ultra-250")) 
+                               is_e250 = 0;
+               } else prom_printf("prom_get_msgbuf: cannot get \"name\"\r\n");
+       } else prom_printf("prom_get_msgbuf: cannot open root device \r\n");
 
        if (memh == -1 && ((memh = get_memory_handle()) == -1)) {
                prom_printf("prom_get_msgbuf: cannot get memh\r\n");
                return -1;
        }
-       if (OF_test("test-method") == 0) {
+       if (is_e250) {
+               prom_printf("prom_get_msgbuf: Cannot recover msgbuf on E250\r\n");
+       } else if (OF_test("test-method") == 0) {
                if (OF_test_method(memh, "SUNW,retain") != 0) {
                        args.name = ADR2CELL(&"call-method");
                        args.nargs = 5;
@@ -524,7 +538,8 @@
                        args.align = align;
                        args.status = -1;
                        if (openfirmware(&args) == 0 && args.status == 0) {
-                               return (((paddr_t)args.phys_hi<<32)|args.phys_lo);
+                               return (((paddr_t)args.phys_hi<<32)|
+                                       (u_int32_t)args.phys_lo);
                        } else prom_printf("prom_get_msgbuf: SUNW,retain failed\r\n");
                } else prom_printf("prom_get_msgbuf: test-method failed\r\n");
        } else prom_printf("prom_get_msgbuf: test failed\r\n");



Home | Main Index | Thread Index | Old Index