diff options
author | Jon Medhurst | 2013-04-22 09:46:09 -0500 |
---|---|---|
committer | Jon Medhurst | 2013-04-26 07:29:03 -0500 |
commit | b69d31aa944d1c6aea0f54399fb754127ad2ab18 (patch) | |
tree | c025c5c3a9ee2aa424e90e349bdad3a69be73f27 | |
parent | 91fab6bd992a48167a7e6259bc7e715b0968a28c (diff) | |
download | arm-ds5-gator-b69d31aa944d1c6aea0f54399fb754127ad2ab18.tar.gz arm-ds5-gator-b69d31aa944d1c6aea0f54399fb754127ad2ab18.tar.xz arm-ds5-gator-b69d31aa944d1c6aea0f54399fb754127ad2ab18.zip |
gator: Use device-tree when available for address of pl310 cache
This helps us avoid probing hard coded addresses which can cause
data aborts and crash the system, as happens on the A9 RTSM.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | driver/gator_events_l2c-310.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/driver/gator_events_l2c-310.c b/driver/gator_events_l2c-310.c index 52472c7..e646215 100644 --- a/driver/gator_events_l2c-310.c +++ b/driver/gator_events_l2c-310.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/io.h> | 12 | #include <linux/io.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/of.h> | ||
15 | #include <linux/of_address.h> | ||
14 | #include <asm/hardware/cache-l2x0.h> | 16 | #include <asm/hardware/cache-l2x0.h> |
15 | 17 | ||
16 | #include "gator.h" | 18 | #include "gator.h" |
@@ -151,6 +153,12 @@ static void __iomem *gator_events_l2c310_probe(void) | |||
151 | }; | 153 | }; |
152 | int i; | 154 | int i; |
153 | 155 | ||
156 | #if defined(CONFIG_OF) | ||
157 | if (of_have_populated_dt()) | ||
158 | return of_iomap(of_find_compatible_node(NULL, | ||
159 | NULL, "arm,pl310-cache"), 0); | ||
160 | #endif | ||
161 | |||
154 | for (i = 0; i < ARRAY_SIZE(variants); i++) { | 162 | for (i = 0; i < ARRAY_SIZE(variants); i++) { |
155 | void __iomem *base = ioremap(variants[i], SZ_4K); | 163 | void __iomem *base = ioremap(variants[i], SZ_4K); |
156 | 164 | ||