aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2013-03-12 14:28:24 +0530
committerTushar Behera <tushar.behera@linaro.org>2013-03-14 10:46:00 +0530
commitd57659d7681d2236f27b25664a49361768eb7df1 (patch)
treece6fe9cfa796be528ca6e6dddd885dccfd2126fc /arch
parentca51e73f5b5a198c6cc2d714404f7c0c0cf6e6ce (diff)
ARM: EXYNOS: Add firmware call for L2X0 initialization
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-exynos/common.c23
-rw-r--r--arch/arm/mach-exynos/firmware.c18
2 files changed, 31 insertions, 10 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4369601be6e0..0f7006d899a0 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -31,6 +31,7 @@
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/cacheflush.h>
+#include <asm/firmware.h>
#include <mach/regs-irq.h>
#include <mach/regs-pmu.h>
@@ -775,18 +776,20 @@ static int __init exynos4_l2x0_cache_init(void)
l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs);
- __raw_writel(l2x0_saved_regs.tag_latency,
- S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
- __raw_writel(l2x0_saved_regs.data_latency,
- S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
+ if (call_firmware_op(l2x0_init)) {
+ __raw_writel(l2x0_saved_regs.tag_latency,
+ S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
+ __raw_writel(l2x0_saved_regs.data_latency,
+ S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
- /* L2X0 Prefetch Control */
- __raw_writel(l2x0_saved_regs.prefetch_ctrl,
- S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
+ /* L2X0 Prefetch Control */
+ __raw_writel(l2x0_saved_regs.prefetch_ctrl,
+ S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
- /* L2X0 Power Control */
- __raw_writel(l2x0_saved_regs.pwr_ctrl,
- S5P_VA_L2CC + L2X0_POWER_CTRL);
+ /* L2X0 Power Control */
+ __raw_writel(l2x0_saved_regs.pwr_ctrl,
+ S5P_VA_L2CC + L2X0_POWER_CTRL);
+ }
clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long));
clean_dcache_area(&l2x0_saved_regs, sizeof(struct l2x0_regs));
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index a1339606caef..56125e9e458c 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -15,11 +15,15 @@
#include <linux/of_address.h>
#include <asm/firmware.h>
+#include <asm/hardware/cache-l2x0.h>
#include <mach/map.h>
#include "smc.h"
+#define L2_AUX_VAL 0x7C470001
+#define L2_AUX_MASK 0xC200ffff
+
static int exynos_do_idle(void)
{
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -40,10 +44,24 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
return 0;
}
+static int exynos_l2x0_init(void)
+{
+ exynos_smc(SMC_CMD_L2X0SETUP1,
+ l2x0_saved_regs.tag_latency,
+ l2x0_saved_regs.data_latency,
+ l2x0_saved_regs.prefetch_ctrl);
+ exynos_smc(SMC_CMD_L2X0SETUP2, l2x0_saved_regs.pwr_ctrl, L2_AUX_VAL,
+ L2_AUX_MASK);
+ exynos_smc(SMC_CMD_L2X0INVALL, 0, 0, 0);
+ exynos_smc(SMC_CMD_L2X0CTRL, 1, 0, 0);
+ return 0;
+}
+
static const struct firmware_ops exynos_firmware_ops = {
.do_idle = exynos_do_idle,
.set_cpu_boot_addr = exynos_set_cpu_boot_addr,
.cpu_boot = exynos_cpu_boot,
+ .l2x0_init = exynos_l2x0_init,
};
void __init exynos_firmware_init(void)