Commit 3930f294 authored by Grant Likely's avatar Grant Likely

of/address: restrict 'no-ranges' kludge to powerpc

Certain Apple machines don't use the ranges property correctly, but the
workaround should not be applied on other architectures.  This patch
disables the workaround for non-powerpc architectures.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
parent 154063a9
...@@ -346,12 +346,21 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, ...@@ -346,12 +346,21 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
* a 1:1 translation at that level. It's up to the caller not to try * a 1:1 translation at that level. It's up to the caller not to try
* to translate addresses that aren't supposed to be translated in * to translate addresses that aren't supposed to be translated in
* the first place. --BenH. * the first place. --BenH.
*
* As far as we know, this damage only exists on Apple machines, so
* This code is only enabled on powerpc. --gcl
*/ */
ranges = of_get_property(parent, rprop, &rlen); ranges = of_get_property(parent, rprop, &rlen);
#if !defined(CONFIG_PPC)
if (ranges == NULL) {
pr_err("OF: no ranges; cannot translate\n");
return 1;
}
#endif /* !defined(CONFIG_PPC) */
if (ranges == NULL || rlen == 0) { if (ranges == NULL || rlen == 0) {
offset = of_read_number(addr, na); offset = of_read_number(addr, na);
memset(addr, 0, pna * 4); memset(addr, 0, pna * 4);
pr_debug("OF: no ranges, 1:1 translation\n"); pr_debug("OF: empty ranges; 1:1 translation\n");
goto finish; goto finish;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment