aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/clock-emev2.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-05-16 15:45:25 +0900
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-18 00:14:02 +0200
commitbd5a875d90c878be4d23f54ea565253734ae2377 (patch)
tree98cc3435486ab8b55374d24051b262c21600b95b /arch/arm/mach-shmobile/clock-emev2.c
parentmach-shmobile: KZM9D board support V3 (diff)
downloadlinux-dev-bd5a875d90c878be4d23f54ea565253734ae2377.tar.xz
linux-dev-bd5a875d90c878be4d23f54ea565253734ae2377.zip
mach-shmobile: Emma Mobile EV2 SMP support V3
This is V3 of Emma Mobile EV2 SMP support. At this point only the most basic form of SMP operation is supported. TWD and CPU Hotplug support is excluded. Tied to both the Emma Mobile EV2 and the KZM9D board due to the need to switch on board in platsmp.c and the newly introduced need for static mappings. The static mappings are needed to allow hardware acces early during boot when SMP is initialized. This early requirement forces us to also map in the SMU registers. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/clock-emev2.c')
-rw-r--r--arch/arm/mach-shmobile/clock-emev2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
index 73a121659314..5bc97de4a1ed 100644
--- a/arch/arm/mach-shmobile/clock-emev2.c
+++ b/arch/arm/mach-shmobile/clock-emev2.c
@@ -40,6 +40,7 @@
#define USIB2SCLKDIV 0x65c
#define USIB3SCLKDIV 0x660
#define STI_CLKSEL 0x688
+#define SMU_GENERAL_REG0 0x7c0
/* not pretty, but hey */
static void __iomem *smu_base;
@@ -50,6 +51,11 @@ static void emev2_smu_write(unsigned long value, int offs)
iowrite32(value, smu_base + offs);
}
+void emev2_set_boot_vector(unsigned long value)
+{
+ emev2_smu_write(value, SMU_GENERAL_REG0);
+}
+
static struct clk_mapping smu_mapping = {
.phys = EMEV2_SMU_BASE,
.len = PAGE_SIZE,
@@ -194,6 +200,18 @@ static struct clk_lookup lookups[] = {
void __init emev2_clock_init(void)
{
int k, ret = 0;
+ static int is_setup;
+
+ /* yuck, this is ugly as hell, but the non-smp case of clocks
+ * code is now designed to rely on ioremap() instead of static
+ * entity maps. in the case of smp we need access to the SMU
+ * register earlier than ioremap() is actually working without
+ * any static maps. to enable SMP in ugly but with dynamic
+ * mappings we have to call emev2_clock_init() from different
+ * places depending on UP and SMP...
+ */
+ if (is_setup++)
+ return;
smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
BUG_ON(!smu_base);