Merge branch 'async-scsi-resume' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / arch / arm / mach-prima2 / l2x0.c
1 /*
2  * l2 cache initialization for CSR SiRFprimaII
3  *
4  * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5  *
6  * Licensed under GPLv2 or later.
7  */
8
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/of.h>
12 #include <asm/hardware/cache-l2x0.h>
13
14 struct l2x0_aux {
15         u32 val;
16         u32 mask;
17 };
18
19 static const struct l2x0_aux prima2_l2x0_aux __initconst = {
20         .val = 2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT,
21         .mask = 0,
22 };
23
24 static const struct l2x0_aux marco_l2x0_aux __initconst = {
25         .val = (2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
26                 (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT),
27         .mask = L2X0_AUX_CTRL_MASK,
28 };
29
30 static const struct of_device_id sirf_l2x0_ids[] __initconst = {
31         { .compatible = "sirf,prima2-pl310-cache", .data = &prima2_l2x0_aux, },
32         { .compatible = "sirf,marco-pl310-cache", .data = &marco_l2x0_aux, },
33         {},
34 };
35
36 static int __init sirfsoc_l2x0_init(void)
37 {
38         struct device_node *np;
39         const struct l2x0_aux *aux;
40
41         np = of_find_matching_node(NULL, sirf_l2x0_ids);
42         if (np) {
43                 aux = of_match_node(sirf_l2x0_ids, np)->data;
44                 return l2x0_of_init(aux->val, aux->mask);
45         }
46
47         return 0;
48 }
49 early_initcall(sirfsoc_l2x0_init);