Module Name: src Committed By: macallan Date: Fri Sep 15 21:27:46 UTC 2017
Modified Files: src/sys/arch/powerpc/oea: ofwoea_machdep.c Log Message: flesh out RANGE_TYPE_MACIO To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/arch/powerpc/oea/ofwoea_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/oea/ofwoea_machdep.c diff -u src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.39 src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.40 --- src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.39 Thu Dec 22 14:47:58 2016 +++ src/sys/arch/powerpc/oea/ofwoea_machdep.c Fri Sep 15 21:27:46 2017 @@ -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 @@ find_ranges(int base, rangemap_t *region 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 @@ find_ranges(int base, rangemap_t *region (*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 @@ ofwoea_map_space(int rangetype, int iome 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");