Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260460
b: refs/heads/master
c: 89e162a
h: refs/heads/master
v: v3
  • Loading branch information
Rongjun Ying authored and Barry Song committed Jul 8, 2011
1 parent dfd3ced commit 0f13874
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31adb06f9d68f9d033284c9ab0e264b2d581bceb
refs/heads/master: 89e162afd37caa6acab4e05b6e9e9fad6235381e
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-prima2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ obj-y += clock.o
obj-y += rstc.o
obj-y += prima2.o
obj-$(CONFIG_DEBUG_LL) += lluart.o
obj-$(CONFIG_CACHE_L2X0) += l2x0.o
59 changes: 59 additions & 0 deletions trunk/arch/arm/mach-prima2/l2x0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* l2 cache initialization for CSR SiRFprimaII
*
* Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
*
* Licensed under GPLv2 or later.
*/

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/errno.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <asm/hardware/cache-l2x0.h>
#include <mach/memory.h>

#define L2X0_ADDR_FILTERING_START 0xC00
#define L2X0_ADDR_FILTERING_END 0xC04

static struct of_device_id l2x_ids[] = {
{ .compatible = "arm,pl310-cache" },
};

static int __init sirfsoc_of_l2x_init(void)
{
struct device_node *np;
void __iomem *sirfsoc_l2x_base;

np = of_find_matching_node(NULL, l2x_ids);
if (!np)
panic("unable to find compatible l2x node in dtb\n");

sirfsoc_l2x_base = of_iomap(np, 0);
if (!sirfsoc_l2x_base)
panic("unable to map l2x cpu registers\n");

of_node_put(np);

if (!(readl_relaxed(sirfsoc_l2x_base + L2X0_CTRL) & 1)) {
/*
* set the physical memory windows L2 cache will cover
*/
writel_relaxed(PLAT_PHYS_OFFSET + 1024 * 1024 * 1024,
sirfsoc_l2x_base + L2X0_ADDR_FILTERING_END);
writel_relaxed(PLAT_PHYS_OFFSET | 0x1,
sirfsoc_l2x_base + L2X0_ADDR_FILTERING_START);

writel_relaxed(0,
sirfsoc_l2x_base + L2X0_TAG_LATENCY_CTRL);
writel_relaxed(0,
sirfsoc_l2x_base + L2X0_DATA_LATENCY_CTRL);
}
l2x0_init((void __iomem *)sirfsoc_l2x_base, 0x00040000,
0x00000000);

return 0;
}
early_initcall(sirfsoc_of_l2x_init);

0 comments on commit 0f13874

Please sign in to comment.