aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2013-04-22 15:46:09 +0100
committerJon Medhurst <tixy@linaro.org>2013-04-29 09:42:44 +0100
commit63e2534f7546effe9889b87ca82b088a92aa81a1 (patch)
treec43d61c96ad6e8c6d480d847de7d8c8d9d8e38a3 /drivers
parent23018a563687a50f83acbb938350542a7f663105 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gator/gator_events_l2c-310.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gator/gator_events_l2c-310.c b/drivers/gator/gator_events_l2c-310.c
index 52472c7a9e6..e646215f37f 100644
--- a/drivers/gator/gator_events_l2c-310.c
+++ b/drivers/gator/gator_events_l2c-310.c
@@ -11,6 +11,8 @@
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
#include <asm/hardware/cache-l2x0.h>
#include "gator.h"
@@ -151,6 +153,12 @@ static void __iomem *gator_events_l2c310_probe(void)
};
int i;
+#if defined(CONFIG_OF)
+ if (of_have_populated_dt())
+ return of_iomap(of_find_compatible_node(NULL,
+ NULL, "arm,pl310-cache"), 0);
+#endif
+
for (i = 0; i < ARRAY_SIZE(variants); i++) {
void __iomem *base = ioremap(variants[i], SZ_4K);