aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2013-04-22 15:46:09 +0100
committerJon Medhurst <tixy@linaro.org>2013-05-21 08:53:45 +0100
commit58df6b9be50e819771baa7f8a09ce1fb4a5a6751 (patch)
tree8011b1f72318b81ed42a4a35d4e563154cb7ce11
parentf6a4dd0b71fd21ac0f0c3c4e90ac7957600fc126 (diff)
gator: Use device-tree when available for address of pl310 cachetracking-gator-llct-20130521.0
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--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 52472c7a9e62..e646215f37f6 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);