diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2015-03-26 18:32:56 +0100 |
---|---|---|
committer | Kukjin Kim <kgene@kernel.org> | 2015-03-26 18:32:56 +0100 |
commit | dc1b9448d23deb51ad74a873392402560955dbc2 (patch) | |
tree | 001875aa8d3efb61728c8f93b8bd662b837230a0 /arch/arm/mach-exynos/firmware.c | |
parent | ARM: EXYNOS: fix CPU1 hotplug on Exynos3250 (diff) | |
download | linux-dc1b9448d23deb51ad74a873392402560955dbc2.tar.xz linux-dc1b9448d23deb51ad74a873392402560955dbc2.zip |
ARM: EXYNOS: add code for setting/clearing boot flag
This code is needed for cpuidle (W-)AFTR mode support on Exynos3250.
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
Diffstat (limited to 'arch/arm/mach-exynos/firmware.c')
-rw-r--r-- | arch/arm/mach-exynos/firmware.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 4791a3cc00f9..27b8ae3e1f89 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -206,3 +206,28 @@ void __init exynos_firmware_init(void) outer_cache.configure = exynos_l2_configure; } } + +#define REG_CPU_STATE_ADDR (sysram_ns_base_addr + 0x28) +#define BOOT_MODE_MASK 0x1f + +void exynos_set_boot_flag(unsigned int cpu, unsigned int mode) +{ + unsigned int tmp; + + tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4); + + if (mode & BOOT_MODE_MASK) + tmp &= ~BOOT_MODE_MASK; + + tmp |= mode; + __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4); +} + +void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode) +{ + unsigned int tmp; + + tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4); + tmp &= ~mode; + __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4); +} |