Skip to content

Commit 8d7217e

Browse files
Magnus Dammhorms
authored andcommitted
ARM: shmobile: Disconnect EMEV2 SMP code from clocks
Update the EMEV2 SMP code to access the SMU directly instead of relying on help from the legacy clock code. This change moves us one step closer to common clocks. Signed-off-by: Magnus Damm <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Simon Horman <[email protected]>
1 parent b9a30ef commit 8d7217e

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

arch/arm/mach-shmobile/clock-emev2.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#define USIB2SCLKDIV 0x65c
4141
#define USIB3SCLKDIV 0x660
4242
#define STI_CLKSEL 0x688
43-
#define SMU_GENERAL_REG0 0x7c0
4443

4544
/* not pretty, but hey */
4645
static void __iomem *smu_base;
@@ -51,11 +50,6 @@ static void emev2_smu_write(unsigned long value, int offs)
5150
iowrite32(value, smu_base + offs);
5251
}
5352

54-
void emev2_set_boot_vector(unsigned long value)
55-
{
56-
emev2_smu_write(value, SMU_GENERAL_REG0);
57-
}
58-
5953
static struct clk_mapping smu_mapping = {
6054
.phys = EMEV2_SMU_BASE,
6155
.len = PAGE_SIZE,
@@ -205,18 +199,6 @@ static struct clk_lookup lookups[] = {
205199
void __init emev2_clock_init(void)
206200
{
207201
int k, ret = 0;
208-
static int is_setup;
209-
210-
/* yuck, this is ugly as hell, but the non-smp case of clocks
211-
* code is now designed to rely on ioremap() instead of static
212-
* entity maps. in the case of smp we need access to the SMU
213-
* register earlier than ioremap() is actually working without
214-
* any static maps. to enable SMP in ugly but with dynamic
215-
* mappings we have to call emev2_clock_init() from different
216-
* places depending on UP and SMP...
217-
*/
218-
if (is_setup++)
219-
return;
220202

221203
smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
222204
BUG_ON(!smu_base);

arch/arm/mach-shmobile/include/mach/emev2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ extern void emev2_map_io(void);
55
extern void emev2_init_delay(void);
66
extern void emev2_add_standard_devices(void);
77
extern void emev2_clock_init(void);
8-
extern void emev2_set_boot_vector(unsigned long value);
98

109
#define EMEV2_GPIO_BASE 200
1110
#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))

arch/arm/mach-shmobile/smp-emev2.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <asm/smp_scu.h>
3030

3131
#define EMEV2_SCU_BASE 0x1e000000
32+
#define EMEV2_SMU_BASE 0xe0110000
33+
#define SMU_GENERAL_REG0 0x7c0
3234

3335
static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
3436
{
@@ -38,13 +40,18 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
3840

3941
static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
4042
{
43+
void __iomem *smu;
44+
4145
/* setup EMEV2 specific SCU base, enable */
4246
shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
4347
scu_enable(shmobile_scu_base);
4448

4549
/* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */
46-
emev2_clock_init(); /* need ioremapped SMU */
47-
emev2_set_boot_vector(__pa(shmobile_boot_vector));
50+
smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
51+
if (smu) {
52+
iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0);
53+
iounmap(smu);
54+
}
4855
shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
4956
shmobile_boot_arg = (unsigned long)shmobile_scu_base;
5057

0 commit comments

Comments
 (0)