blob: c99837797d76b6fb3d254c8aaa97cd860cd77e4e [file] [log] [blame]
Rongjun Ying89e162a2011-07-08 02:40:14 -07001/*
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 Ying89e162a2011-07-08 02:40:14 -070011#include <linux/of.h>
Rongjun Ying89e162a2011-07-08 02:40:14 -070012#include <asm/hardware/cache-l2x0.h>
Rongjun Ying89e162a2011-07-08 02:40:14 -070013
Barry Song917d8532011-09-15 19:16:28 -070014static struct of_device_id prima2_l2x0_ids[] = {
15 { .compatible = "sirf,prima2-pl310-cache" },
16 {},
Rongjun Ying89e162a2011-07-08 02:40:14 -070017};
18
Barry Song917d8532011-09-15 19:16:28 -070019static int __init sirfsoc_l2x0_init(void)
Rongjun Ying89e162a2011-07-08 02:40:14 -070020{
21 struct device_node *np;
Rongjun Ying89e162a2011-07-08 02:40:14 -070022
Barry Song917d8532011-09-15 19:16:28 -070023 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 Ying89e162a2011-07-08 02:40:14 -070027 }
Rongjun Ying89e162a2011-07-08 02:40:14 -070028
29 return 0;
30}
Barry Song917d8532011-09-15 19:16:28 -070031early_initcall(sirfsoc_l2x0_init);