Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 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> |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 11 | #include <linux/of.h> |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 12 | #include <asm/hardware/cache-l2x0.h> |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 13 | |
Barry Song | 917d853 | 2011-09-15 19:16:28 -0700 | [diff] [blame] | 14 | static struct of_device_id prima2_l2x0_ids[] = { |
| 15 | { .compatible = "sirf,prima2-pl310-cache" }, |
| 16 | {}, |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 17 | }; |
| 18 | |
Barry Song | 917d853 | 2011-09-15 19:16:28 -0700 | [diff] [blame] | 19 | static int __init sirfsoc_l2x0_init(void) |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 20 | { |
| 21 | struct device_node *np; |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 22 | |
Barry Song | 917d853 | 2011-09-15 19:16:28 -0700 | [diff] [blame] | 23 | np = of_find_matching_node(NULL, prima2_l2x0_ids); |
| 24 | if (np) { |
| 25 | pr_info("Initializing prima2 L2 cache\n"); |
| 26 | return l2x0_of_init(0x40000, 0); |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 27 | } |
Rongjun Ying | 89e162a | 2011-07-08 02:40:14 -0700 | [diff] [blame] | 28 | |
| 29 | return 0; |
| 30 | } |
Barry Song | 917d853 | 2011-09-15 19:16:28 -0700 | [diff] [blame] | 31 | early_initcall(sirfsoc_l2x0_init); |