Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260526
b: refs/heads/master
c: 93e85d8
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov committed Jul 7, 2011
1 parent f988374 commit 90df501
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00d2711d700ae77b5bb66ea7c73eaa2cf155fa97
refs/heads/master: 93e85d8e902e1a4468c6ade5c6ec3dd3055a489f
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-cns3xxx/cns3420vb.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ static struct platform_device *cns3420_pdevs[] __initdata = {

static void __init cns3420_init(void)
{
cns3xxx_l2x0_init();

platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));

cns3xxx_ahci_init();
Expand Down
43 changes: 43 additions & 0 deletions trunk/arch/arm/mach-cns3xxx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <asm/mach/time.h>
#include <asm/mach/irq.h>
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
#include <mach/cns3xxx.h>
#include "core.h"

Expand Down Expand Up @@ -244,3 +245,45 @@ static void __init cns3xxx_timer_init(void)
struct sys_timer cns3xxx_timer = {
.init = cns3xxx_timer_init,
};

#ifdef CONFIG_CACHE_L2X0

void __init cns3xxx_l2x0_init(void)
{
void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
u32 val;

if (WARN_ON(!base))
return;

/*
* Tag RAM Control register
*
* bit[10:8] - 1 cycle of write accesses latency
* bit[6:4] - 1 cycle of read accesses latency
* bit[3:0] - 1 cycle of setup latency
*
* 1 cycle of latency for setup, read and write accesses
*/
val = readl(base + L2X0_TAG_LATENCY_CTRL);
val &= 0xfffff888;
writel(val, base + L2X0_TAG_LATENCY_CTRL);

/*
* Data RAM Control register
*
* bit[10:8] - 1 cycles of write accesses latency
* bit[6:4] - 1 cycles of read accesses latency
* bit[3:0] - 1 cycle of setup latency
*
* 1 cycle of latency for setup, read and write accesses
*/
val = readl(base + L2X0_DATA_LATENCY_CTRL);
val &= 0xfffff888;
writel(val, base + L2X0_DATA_LATENCY_CTRL);

/* 32 KiB, 8-way, parity disable */
l2x0_init(base, 0x00540000, 0xfe000fff);
}

#endif /* CONFIG_CACHE_L2X0 */
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-cns3xxx/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

extern struct sys_timer cns3xxx_timer;

#ifdef CONFIG_CACHE_L2X0
void __init cns3xxx_l2x0_init(void);
#else
static inline void cns3xxx_l2x0_init(void) {}
#endif /* CONFIG_CACHE_L2X0 */

void __init cns3xxx_map_io(void);
void __init cns3xxx_init_irq(void);
void cns3xxx_power_off(void);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ config CACHE_L2X0
depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
REALVIEW_EB_A9MP || SOC_IMX35 || SOC_IMX31 || MACH_REALVIEW_PBX || \
ARCH_NOMADIK || ARCH_OMAP4 || ARCH_EXYNOS4 || ARCH_TEGRA || \
ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE
ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE || ARCH_CNS3XXX
default y
select OUTER_CACHE
select OUTER_CACHE_SYNC
Expand Down

0 comments on commit 90df501

Please sign in to comment.