aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2010-04-10 10:44:41 +0000
committerMarius Strobl <marius@FreeBSD.org>2010-04-10 10:44:41 +0000
commit15edea2038b9b22f1c7ede4ec23230ff841f7552 (patch)
treea86e5aa739a50ed6e312d7fdb15633890d0d0322 /sys/sparc64
parentb4ab02b84232e41721b0a77c35359740f3cb23c5 (diff)
downloadsrc-15edea2038b9b22f1c7ede4ec23230ff841f7552.tar.gz
src-15edea2038b9b22f1c7ede4ec23230ff841f7552.zip
Do as the comment suggests and determine the bus space based on the last
bus we actually mapped at rather than always based on the last bus we encountered while moving upward in the tree. Otherwise we might use the wrong bus space in case the bridge directly underneath the nexus doesn't require mapping, i.e. was skipped as it's the case for ssm(4) nodes.
Notes
Notes: svn path=/head/; revision=206448
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/ofw_machdep.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/sparc64/sparc64/ofw_machdep.c b/sys/sparc64/sparc64/ofw_machdep.c
index 9d522629c788..07f95e20e511 100644
--- a/sys/sparc64/sparc64/ofw_machdep.c
+++ b/sys/sparc64/sparc64/ofw_machdep.c
@@ -186,13 +186,10 @@ OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr)
name[sizeof(name) - 1] = '\0';
goto skip;
}
- if (lbus != bus) {
- if (OF_getprop(bus, "#size-cells", &szc,
- sizeof(szc)) == -1)
- szc = 1;
- if (szc < 1 || szc > 2)
- return (ENXIO);
- }
+ if (OF_getprop(bus, "#size-cells", &szc, sizeof(szc)) == -1)
+ szc = 1;
+ if (szc < 1 || szc > 2)
+ return (ENXIO);
nbank /= sizeof(banks[0]) * (addrc + paddrc + szc);
bank = 0;
for (i = 0; i < nbank; i++) {
@@ -232,9 +229,9 @@ OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr)
}
if (i == nbank)
return (ENXIO);
+ lbus = bus;
skip:
addrc = paddrc;
- lbus = bus;
bus = pbus;
}