diff options
author | Chao Xie <xiechao.mail@gmail.com> | 2012-07-31 02:13:14 -0400 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@gmail.com> | 2012-08-16 04:16:50 -0400 |
commit | c2b7e05c753156dfba3240c59c400d557c5c8746 (patch) | |
tree | 9d906c9594730b1d1305c1e2773dac163ea28984 /arch/arm/mm/cache-tauros2.c | |
parent | 5cc5815795379690a07d8226fda24ba2fc3f1339 (diff) |
ARM: cache: add dt support for tauros2 cache
Signed-off-by: Chao Xie <xiechao.mail@gmail.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm/mm/cache-tauros2.c')
-rw-r--r-- | arch/arm/mm/cache-tauros2.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c index e9f054fc7e87..1be0f4e5e6eb 100644 --- a/arch/arm/mm/cache-tauros2.c +++ b/arch/arm/mm/cache-tauros2.c | |||
@@ -15,6 +15,8 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/of.h> | ||
19 | #include <linux/of_address.h> | ||
18 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
19 | #include <asm/cp15.h> | 21 | #include <asm/cp15.h> |
20 | #include <asm/cputype.h> | 22 | #include <asm/cputype.h> |
@@ -198,7 +200,7 @@ static void enable_extra_feature(unsigned int features) | |||
198 | write_extra_features(u); | 200 | write_extra_features(u); |
199 | } | 201 | } |
200 | 202 | ||
201 | void __init tauros2_init(unsigned int features) | 203 | static void __init tauros2_internal_init(unsigned int features) |
202 | { | 204 | { |
203 | char *mode = NULL; | 205 | char *mode = NULL; |
204 | 206 | ||
@@ -294,3 +296,34 @@ void __init tauros2_init(unsigned int features) | |||
294 | printk(KERN_INFO "Tauros2: L2 cache support initialised " | 296 | printk(KERN_INFO "Tauros2: L2 cache support initialised " |
295 | "in %s mode.\n", mode); | 297 | "in %s mode.\n", mode); |
296 | } | 298 | } |
299 | |||
300 | #ifdef CONFIG_OF | ||
301 | static const struct of_device_id tauros2_ids[] __initconst = { | ||
302 | { .compatible = "marvell,tauros2-cache"}, | ||
303 | {} | ||
304 | }; | ||
305 | #endif | ||
306 | |||
307 | void __init tauros2_init(unsigned int features) | ||
308 | { | ||
309 | #ifdef CONFIG_OF | ||
310 | struct device_node *node; | ||
311 | int ret; | ||
312 | unsigned int f; | ||
313 | |||
314 | node = of_find_matching_node(NULL, tauros2_ids); | ||
315 | if (!node) { | ||
316 | pr_info("Not found marvell,tauros2-cache, disable it\n"); | ||
317 | return; | ||
318 | } | ||
319 | |||
320 | ret = of_property_read_u32(node, "marvell,tauros2-cache-features", &f); | ||
321 | if (ret) { | ||
322 | pr_info("Not found marvell,tauros-cache-features property, " | ||
323 | "disable extra features\n"); | ||
324 | features = 0; | ||
325 | } else | ||
326 | features = f; | ||
327 | #endif | ||
328 | tauros2_internal_init(features); | ||
329 | } | ||