Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea flesh out RANGE_TYPE_MACIO



details:   https://anonhg.NetBSD.org/src/rev/02f61868e909
branches:  trunk
changeset: 826596:02f61868e909
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Sep 15 21:27:46 2017 +0000

description:
flesh out RANGE_TYPE_MACIO

diffstat:

 sys/arch/powerpc/oea/ofwoea_machdep.c |  20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 9d8598045d8b -r 02f61868e909 sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Sep 15 21:03:26 2017 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Sep 15 21:27:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.39 2016/12/22 14:47:58 cherry Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.40 2017/09/15 21:27:46 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.39 2016/12/22 14:47:58 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.40 2017/09/15 21:27:46 macallan Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -551,7 +551,13 @@
                goto rec;
        if (type == RANGE_TYPE_ISA && strcmp("isa", tmp) != 0)
                goto rec;
-       len = OF_getprop(node, "ranges", map, sizeof(map));
+       if (type == RANGE_TYPE_MACIO && strcmp("memory-controller", tmp) == 0) {
+               len = OF_getprop(node, "reg", map, sizeof(map));
+               acells = 1;
+               scells = 1;
+       } else {
+               len = OF_getprop(node, "ranges", map, sizeof(map));
+       }
        if (len == -1)
                goto rec;
        if (OF_getprop(OF_parent(node), "#address-cells", &parent_acells,
@@ -613,6 +619,12 @@
                                (*cur)++;
                        }
                        break;
+               case RANGE_TYPE_MACIO:
+                       regions[*cur].type = RANGE_MEM;
+                       regions[*cur].size = map[1];
+                       regions[*cur].addr = map[0];
+                       (*cur)++;               
+                       break;
        }
        DPRINTF("returning with CUR=%d\n", *cur);
        return;
@@ -764,7 +776,7 @@
                    holes[i].size, holes[i].type);
        /* AT THIS POINT WE MAP IT */
 
-       if (rangetype == RANGE_TYPE_PCI) {
+       if ((rangetype == RANGE_TYPE_PCI) || (rangetype == RANGE_TYPE_MACIO)) {
                if (exmap == EXSTORAGE_MAX)
                        panic("Not enough ex_storage space. "
                            "Increase EXSTORAGE_MAX");



Home | Main Index | Thread Index | Old Index