Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips/rasoc Add some MT7620 support.



details:   https://anonhg.NetBSD.org/src/rev/c12e48a3d6bb
branches:  trunk
changeset: 329033:c12e48a3d6bb
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 30 01:01:47 2014 +0000

description:
Add some MT7620 support.

diffstat:

 sys/arch/evbmips/rasoc/machdep.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (61 lines):

diff -r 17b25c9b296c -r c12e48a3d6bb sys/arch/evbmips/rasoc/machdep.c
--- a/sys/arch/evbmips/rasoc/machdep.c  Wed Apr 30 01:01:04 2014 +0000
+++ b/sys/arch/evbmips/rasoc/machdep.c  Wed Apr 30 01:01:47 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.9 2014/03/24 20:06:32 christos Exp $     */
+/*     $NetBSD: machdep.c,v 1.10 2014/04/30 01:01:47 matt Exp $        */
 
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2014/04/30 01:01:47 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/boot_flag.h>
@@ -121,6 +121,13 @@
        tmp2 = sysctl_read(RA_SYSCTL_ID1);
        memcpy(id2, &tmp2, sizeof(tmp2));
        id2[4] = id1[4] = '\0';
+       if (id2[2] == ' ') {
+               id2[2] = '\0';
+       } else if (id2[3] == ' ') {
+               id2[3] = '\0';
+       } else {
+               id2[4] = '\0';
+       }
        cpu_setmodel("%s%s", id1, id2);
 
        /*
@@ -155,6 +162,9 @@
        /*
         * Determine the memory size.
         */
+#if defined(MT7620)
+       memsize = 128 << 20;
+#else
        memsize = *(volatile uint32_t *)
            MIPS_PHYS_TO_KSEG1(RA_SYSCTL_BASE + RA_SYSCTL_CFG0);
        memsize = __SHIFTOUT(memsize, SYSCTL_CFG0_DRAM_SIZE);
@@ -163,6 +173,7 @@
        } else {
                memsize = 4 << (20 + memsize);
        }
+#endif
 
        physmem = btoc(memsize);
 
@@ -321,7 +332,9 @@
 
        case SERIAL_CONSOLE:
                magic = sysctl_read(RA_SYSCTL_MEMO1);
-               if (((SERIAL_MAGIC & magic) != 0) || ((keyvalue & 2) != 0)) {
+               if (magic == 0
+                   || (SERIAL_MAGIC & magic) != 0
+                   || (keyvalue & 2) != 0) {
                        keyvalue |= 2;
                        return 1;
                }



Home | Main Index | Thread Index | Old Index