aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-12-08 00:37:57 -0500
committerLinus Walleij <linus.walleij@stericsson.com>2011-01-10 12:34:52 -0500
commit92389ca8362c42952c7ebb8a0350ac522dcde0f4 (patch)
tree6c840e0d706712729bded5900aed93fa70778ca2 /arch
parent0c21e3aaf6ae85bee804a325aa29c325209180fd (diff)
ux500: remove build-time changing macros
To allow the possiblity of building U8500 and U5500 support in the same image. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> [Rebased to latest changes in Russells tree] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/clock.c14
-rw-r--r--arch/arm/mach-ux500/cpu-db5500.c12
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c18
-rw-r--r--arch/arm/mach-ux500/cpu.c74
-rw-r--r--arch/arm/mach-ux500/include/mach/debug-macro.S19
-rw-r--r--arch/arm/mach-ux500/include/mach/entry-macro.S5
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h60
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h1
-rw-r--r--arch/arm/mach-ux500/platsmp.c37
9 files changed, 123 insertions, 117 deletions
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index ccff2dae167f..b2b0a3b9be8f 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -136,8 +136,7 @@ EXPORT_SYMBOL(clk_disable);
136 */ 136 */
137static unsigned long clk_mtu_get_rate(struct clk *clk) 137static unsigned long clk_mtu_get_rate(struct clk *clk)
138{ 138{
139 void __iomem *addr = __io_address(UX500_PRCMU_BASE) 139 void __iomem *addr;
140 + PRCM_TCR;
141 u32 tcr; 140 u32 tcr;
142 int mtu = (int) clk->data; 141 int mtu = (int) clk->data;
143 /* 142 /*
@@ -149,13 +148,20 @@ static unsigned long clk_mtu_get_rate(struct clk *clk)
149 unsigned long mturate; 148 unsigned long mturate;
150 unsigned long retclk; 149 unsigned long retclk;
151 150
151 if (cpu_is_u5500())
152 addr = __io_address(U5500_PRCMU_BASE);
153 else if (cpu_is_u8500())
154 addr = __io_address(U8500_PRCMU_BASE);
155 else
156 ux500_unknown_soc();
157
152 /* 158 /*
153 * On a startup, always conifgure the TCR to the doze mode; 159 * On a startup, always conifgure the TCR to the doze mode;
154 * bootloaders do it for us. Do this in the kernel too. 160 * bootloaders do it for us. Do this in the kernel too.
155 */ 161 */
156 writel(PRCM_TCR_DOZE_MODE, addr); 162 writel(PRCM_TCR_DOZE_MODE, addr + PRCM_TCR);
157 163
158 tcr = readl(addr); 164 tcr = readl(addr + PRCM_TCR);
159 165
160 /* Get the rate from the parent as a default */ 166 /* Get the rate from the parent as a default */
161 if (clk->parent_periph) 167 if (clk->parent_periph)
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c
index acc841e48de4..7b0ab8336f3f 100644
--- a/arch/arm/mach-ux500/cpu-db5500.c
+++ b/arch/arm/mach-ux500/cpu-db5500.c
@@ -22,6 +22,16 @@
22#include "devices-db5500.h" 22#include "devices-db5500.h"
23 23
24static struct map_desc u5500_io_desc[] __initdata = { 24static struct map_desc u5500_io_desc[] __initdata = {
25 __IO_DEV_DESC(U5500_UART0_BASE, SZ_4K),
26 __IO_DEV_DESC(U5500_UART2_BASE, SZ_4K),
27 __IO_DEV_DESC(U5500_GIC_CPU_BASE, SZ_4K),
28 __IO_DEV_DESC(U5500_GIC_DIST_BASE, SZ_4K),
29 __IO_DEV_DESC(U5500_L2CC_BASE, SZ_4K),
30 __IO_DEV_DESC(U5500_TWD_BASE, SZ_4K),
31 __IO_DEV_DESC(U5500_MTU0_BASE, SZ_4K),
32 __IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),
33 __IO_DEV_DESC(U5500_BACKUPRAM0_BASE, SZ_8K),
34
25 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), 35 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K),
26 __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K), 36 __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K),
27 __IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K), 37 __IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K),
@@ -143,8 +153,6 @@ static void __init db5500_add_gpios(void)
143 153
144void __init u5500_map_io(void) 154void __init u5500_map_io(void)
145{ 155{
146 ux500_map_io();
147
148 iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc)); 156 iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc));
149} 157}
150 158
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index c0f34a404c53..1b2b81c0f27c 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -30,6 +30,22 @@ static struct platform_device *platform_devs[] __initdata = {
30 30
31/* minimum static i/o mapping required to boot U8500 platforms */ 31/* minimum static i/o mapping required to boot U8500 platforms */
32static struct map_desc u8500_io_desc[] __initdata = { 32static struct map_desc u8500_io_desc[] __initdata = {
33 __IO_DEV_DESC(U8500_UART0_BASE, SZ_4K),
34 __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K),
35 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),
36 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
37 __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),
38 __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
39 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
40 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
41 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
42
43 __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
44 __IO_DEV_DESC(U8500_CLKRST2_BASE, SZ_4K),
45 __IO_DEV_DESC(U8500_CLKRST3_BASE, SZ_4K),
46 __IO_DEV_DESC(U8500_CLKRST5_BASE, SZ_4K),
47 __IO_DEV_DESC(U8500_CLKRST6_BASE, SZ_4K),
48
33 __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), 49 __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K),
34 __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), 50 __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K),
35 __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), 51 __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K),
@@ -117,8 +133,6 @@ bool cpu_is_u8500v20(void)
117 133
118void __init u8500_map_io(void) 134void __init u8500_map_io(void)
119{ 135{
120 ux500_map_io();
121
122 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 136 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
123 137
124 if (cpu_is_u8500ed()) 138 if (cpu_is_u8500ed())
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 5730409c0f7d..35a3af13fb30 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -23,37 +23,29 @@
23 23
24#include "clock.h" 24#include "clock.h"
25 25
26static struct map_desc ux500_io_desc[] __initdata = { 26#ifdef CONFIG_CACHE_L2X0
27 __IO_DEV_DESC(UX500_UART0_BASE, SZ_4K), 27static void __iomem *l2x0_base;
28 __IO_DEV_DESC(UX500_UART2_BASE, SZ_4K), 28#endif
29
30 __IO_DEV_DESC(UX500_GIC_CPU_BASE, SZ_4K),
31 __IO_DEV_DESC(UX500_GIC_DIST_BASE, SZ_4K),
32 __IO_DEV_DESC(UX500_L2CC_BASE, SZ_4K),
33 __IO_DEV_DESC(UX500_TWD_BASE, SZ_4K),
34 __IO_DEV_DESC(UX500_SCU_BASE, SZ_4K),
35
36 __IO_DEV_DESC(UX500_CLKRST1_BASE, SZ_4K),
37 __IO_DEV_DESC(UX500_CLKRST2_BASE, SZ_4K),
38 __IO_DEV_DESC(UX500_CLKRST3_BASE, SZ_4K),
39 __IO_DEV_DESC(UX500_CLKRST5_BASE, SZ_4K),
40 __IO_DEV_DESC(UX500_CLKRST6_BASE, SZ_4K),
41
42 __IO_DEV_DESC(UX500_MTU0_BASE, SZ_4K),
43 __IO_DEV_DESC(UX500_MTU1_BASE, SZ_4K),
44
45 __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K),
46};
47 29
48void __init ux500_map_io(void) 30void __init ux500_map_io(void)
49{ 31{
50 iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc));
51} 32}
52 33
53void __init ux500_init_irq(void) 34void __init ux500_init_irq(void)
54{ 35{
55 gic_init(0, 29, __io_address(UX500_GIC_DIST_BASE), 36 void __iomem *dist_base;
56 __io_address(UX500_GIC_CPU_BASE)); 37 void __iomem *cpu_base;
38
39 if (cpu_is_u5500()) {
40 dist_base = __io_address(U5500_GIC_DIST_BASE);
41 cpu_base = __io_address(U5500_GIC_CPU_BASE);
42 } else if (cpu_is_u8500()) {
43 dist_base = __io_address(U8500_GIC_DIST_BASE);
44 cpu_base = __io_address(U8500_GIC_CPU_BASE);
45 } else
46 ux500_unknown_soc();
47
48 gic_init(0, 29, dist_base, cpu_base);
57 49
58 /* 50 /*
59 * Init clocks here so that they are available for system timer 51 * Init clocks here so that they are available for system timer
@@ -74,7 +66,8 @@ static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask)
74 66
75static inline void ux500_cache_sync(void) 67static inline void ux500_cache_sync(void)
76{ 68{
77 void __iomem *base = __io_address(UX500_L2CC_BASE); 69 void __iomem *base = l2x0_base;
70
78 writel_relaxed(0, base + L2X0_CACHE_SYNC); 71 writel_relaxed(0, base + L2X0_CACHE_SYNC);
79 ux500_cache_wait(base + L2X0_CACHE_SYNC, 1); 72 ux500_cache_wait(base + L2X0_CACHE_SYNC, 1);
80} 73}
@@ -96,20 +89,23 @@ static void ux500_l2x0_disable(void)
96 */ 89 */
97static void ux500_l2x0_inv_all(void) 90static void ux500_l2x0_inv_all(void)
98{ 91{
99 void __iomem *l2x0_base = __io_address(UX500_L2CC_BASE); 92 void __iomem *base = l2x0_base;
100 uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */ 93 uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */
101 94
102 /* invalidate all ways */ 95 /* invalidate all ways */
103 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); 96 writel_relaxed(l2x0_way_mask, base + L2X0_INV_WAY);
104 ux500_cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); 97 ux500_cache_wait(base + L2X0_INV_WAY, l2x0_way_mask);
105 ux500_cache_sync(); 98 ux500_cache_sync();
106} 99}
107 100
108static int ux500_l2x0_init(void) 101static int ux500_l2x0_init(void)
109{ 102{
110 void __iomem *l2x0_base; 103 if (cpu_is_u5500())
111 104 l2x0_base = __io_address(U5500_L2CC_BASE);
112 l2x0_base = __io_address(UX500_L2CC_BASE); 105 else if (cpu_is_u8500())
106 l2x0_base = __io_address(U8500_L2CC_BASE);
107 else
108 ux500_unknown_soc();
113 109
114 /* 64KB way size, 8 way associativity, force WA */ 110 /* 64KB way size, 8 way associativity, force WA */
115 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff); 111 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);
@@ -127,13 +123,21 @@ static void __init ux500_timer_init(void)
127{ 123{
128#ifdef CONFIG_LOCAL_TIMERS 124#ifdef CONFIG_LOCAL_TIMERS
129 /* Setup the local timer base */ 125 /* Setup the local timer base */
130 twd_base = __io_address(UX500_TWD_BASE); 126 if (cpu_is_u5500())
127 twd_base = __io_address(U5500_TWD_BASE);
128 else if (cpu_is_u8500())
129 twd_base = __io_address(U8500_TWD_BASE);
130 else
131 ux500_unknown_soc();
131#endif 132#endif
132 /* Setup the MTU base */ 133 if (cpu_is_u5500())
133 if (cpu_is_u8500ed()) 134 mtu_base = __io_address(U5500_MTU0_BASE);
135 else if (cpu_is_u8500ed())
134 mtu_base = __io_address(U8500_MTU0_BASE_ED); 136 mtu_base = __io_address(U8500_MTU0_BASE_ED);
137 else if (cpu_is_u8500())
138 mtu_base = __io_address(U8500_MTU0_BASE);
135 else 139 else
136 mtu_base = __io_address(UX500_MTU0_BASE); 140 ux500_unknown_soc();
137 141
138 nmdk_timer_init(); 142 nmdk_timer_init();
139} 143}
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S
index be7c0f14e310..700fb05ee815 100644
--- a/arch/arm/mach-ux500/include/mach/debug-macro.S
+++ b/arch/arm/mach-ux500/include/mach/debug-macro.S
@@ -14,7 +14,24 @@
14#error Invalid Ux500 debug UART 14#error Invalid Ux500 debug UART
15#endif 15#endif
16 16
17#define __UX500_UART(n) UX500_UART##n##_BASE 17/*
18 * DEBUG_LL only works if only one SOC is built in. We don't use #else below
19 * in order to get "__UX500_UART redefined" warnings if more than one SOC is
20 * built, so that there's some hint during the build that something is wrong.
21 */
22
23#ifdef CONFIG_UX500_SOC_DB5500
24#define __UX500_UART(n) U5500_UART##n##_BASE
25#endif
26
27#ifdef CONFIG_UX500_SOC_DB8500
28#define __UX500_UART(n) U8500_UART##n##_BASE
29#endif
30
31#ifndef __UX500_UART
32#error Unknown SOC
33#endif
34
18#define UX500_UART(n) __UX500_UART(n) 35#define UX500_UART(n) __UX500_UART(n)
19#define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART) 36#define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART)
20 37
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S
index a37f585a3ecb..071bba94f727 100644
--- a/arch/arm/mach-ux500/include/mach/entry-macro.S
+++ b/arch/arm/mach-ux500/include/mach/entry-macro.S
@@ -11,15 +11,10 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13#include <mach/hardware.h> 13#include <mach/hardware.h>
14#define HAVE_GET_IRQNR_PREAMBLE
15#include <asm/hardware/entry-macro-gic.S> 14#include <asm/hardware/entry-macro-gic.S>
16 15
17 .macro disable_fiq 16 .macro disable_fiq
18 .endm 17 .endm
19 18
20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =IO_ADDRESS(UX500_GIC_CPU_BASE)
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2 19 .macro arch_ret_to_user, tmp1, tmp2
25 .endm 20 .endm
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index 6295cc581355..bced4a8e16ef 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -29,65 +29,6 @@
29#include <mach/db8500-regs.h> 29#include <mach/db8500-regs.h>
30#include <mach/db5500-regs.h> 30#include <mach/db5500-regs.h>
31 31
32#ifdef CONFIG_UX500_SOC_DB8500
33#define UX500(periph) U8500_##periph##_BASE
34#elif defined(CONFIG_UX500_SOC_DB5500)
35#define UX500(periph) U5500_##periph##_BASE
36#endif
37
38#define UX500_BACKUPRAM0_BASE UX500(BACKUPRAM0)
39#define UX500_BACKUPRAM1_BASE UX500(BACKUPRAM1)
40#define UX500_B2R2_BASE UX500(B2R2)
41
42#define UX500_CLKRST1_BASE UX500(CLKRST1)
43#define UX500_CLKRST2_BASE UX500(CLKRST2)
44#define UX500_CLKRST3_BASE UX500(CLKRST3)
45#define UX500_CLKRST5_BASE UX500(CLKRST5)
46#define UX500_CLKRST6_BASE UX500(CLKRST6)
47
48#define UX500_DMA_BASE UX500(DMA)
49#define UX500_FSMC_BASE UX500(FSMC)
50
51#define UX500_GIC_CPU_BASE UX500(GIC_CPU)
52#define UX500_GIC_DIST_BASE UX500(GIC_DIST)
53
54#define UX500_I2C1_BASE UX500(I2C1)
55#define UX500_I2C2_BASE UX500(I2C2)
56#define UX500_I2C3_BASE UX500(I2C3)
57
58#define UX500_L2CC_BASE UX500(L2CC)
59#define UX500_MCDE_BASE UX500(MCDE)
60#define UX500_MTU0_BASE UX500(MTU0)
61#define UX500_MTU1_BASE UX500(MTU1)
62#define UX500_PRCMU_BASE UX500(PRCMU)
63
64#define UX500_RNG_BASE UX500(RNG)
65#define UX500_RTC_BASE UX500(RTC)
66
67#define UX500_SCU_BASE UX500(SCU)
68
69#define UX500_SDI0_BASE UX500(SDI0)
70#define UX500_SDI1_BASE UX500(SDI1)
71#define UX500_SDI2_BASE UX500(SDI2)
72#define UX500_SDI3_BASE UX500(SDI3)
73#define UX500_SDI4_BASE UX500(SDI4)
74
75#define UX500_SPI0_BASE UX500(SPI0)
76#define UX500_SPI1_BASE UX500(SPI1)
77#define UX500_SPI2_BASE UX500(SPI2)
78#define UX500_SPI3_BASE UX500(SPI3)
79
80#define UX500_SIA_BASE UX500(SIA)
81#define UX500_SVA_BASE UX500(SVA)
82
83#define UX500_TWD_BASE UX500(TWD)
84
85#define UX500_UART0_BASE UX500(UART0)
86#define UX500_UART1_BASE UX500(UART1)
87#define UX500_UART2_BASE UX500(UART2)
88
89#define UX500_USBOTG_BASE UX500(USBOTG)
90
91/* ST-Ericsson modified pl022 id */ 32/* ST-Ericsson modified pl022 id */
92#define SSP_PER_ID 0x01080022 33#define SSP_PER_ID 0x01080022
93 34
@@ -143,6 +84,7 @@ static inline bool cpu_is_u5500(void)
143} 84}
144 85
145#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 86#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
87#define ux500_unknown_soc() BUG()
146 88
147#endif 89#endif
148 90
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 469877e0de90..5d8423294d41 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -14,7 +14,6 @@
14#include <asm/mach/time.h> 14#include <asm/mach/time.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17extern void __init ux500_map_io(void);
18extern void __init u5500_map_io(void); 17extern void __init u5500_map_io(void);
19extern void __init u8500_map_io(void); 18extern void __init u8500_map_io(void);
20 19
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index d77e76cb7edd..4fff4d408417 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -20,6 +20,7 @@
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/smp_scu.h> 21#include <asm/smp_scu.h>
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/setup.h>
23 24
24/* 25/*
25 * control for which core is the next to come out of the secondary 26 * control for which core is the next to come out of the secondary
@@ -40,6 +41,18 @@ static void write_pen_release(int val)
40 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); 41 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
41} 42}
42 43
44static void __iomem *scu_base_addr(void)
45{
46 if (cpu_is_u5500())
47 return __io_address(U5500_SCU_BASE);
48 else if (cpu_is_u8500())
49 return __io_address(U8500_SCU_BASE);
50 else
51 ux500_unknown_soc();
52
53 return NULL;
54}
55
43static DEFINE_SPINLOCK(boot_lock); 56static DEFINE_SPINLOCK(boot_lock);
44 57
45void __cpuinit platform_secondary_init(unsigned int cpu) 58void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -100,21 +113,28 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
100 113
101static void __init wakeup_secondary(void) 114static void __init wakeup_secondary(void)
102{ 115{
116 void __iomem *backupram;
117
118 if (cpu_is_u5500())
119 backupram = __io_address(U5500_BACKUPRAM0_BASE);
120 else if (cpu_is_u8500())
121 backupram = __io_address(U8500_BACKUPRAM0_BASE);
122 else
123 ux500_unknown_soc();
124
103 /* 125 /*
104 * write the address of secondary startup into the backup ram register 126 * write the address of secondary startup into the backup ram register
105 * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the 127 * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the
106 * backup ram register at offset 0x1FF0, which is what boot rom code 128 * backup ram register at offset 0x1FF0, which is what boot rom code
107 * is waiting for. This would wake up the secondary core from WFE 129 * is waiting for. This would wake up the secondary core from WFE
108 */ 130 */
109#define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 131#define UX500_CPU1_JUMPADDR_OFFSET 0x1FF4
110 __raw_writel(virt_to_phys(u8500_secondary_startup), 132 __raw_writel(virt_to_phys(u8500_secondary_startup),
111 __io_address(UX500_BACKUPRAM0_BASE) + 133 backupram + UX500_CPU1_JUMPADDR_OFFSET);
112 U8500_CPU1_JUMPADDR_OFFSET);
113 134
114#define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 135#define UX500_CPU1_WAKEMAGIC_OFFSET 0x1FF0
115 __raw_writel(0xA1FEED01, 136 __raw_writel(0xA1FEED01,
116 __io_address(UX500_BACKUPRAM0_BASE) + 137 backupram + UX500_CPU1_WAKEMAGIC_OFFSET);
117 U8500_CPU1_WAKEMAGIC_OFFSET);
118 138
119 /* make sure write buffer is drained */ 139 /* make sure write buffer is drained */
120 mb(); 140 mb();
@@ -126,9 +146,10 @@ static void __init wakeup_secondary(void)
126 */ 146 */
127void __init smp_init_cpus(void) 147void __init smp_init_cpus(void)
128{ 148{
149 void __iomem *scu_base = scu_base_addr();
129 unsigned int i, ncores; 150 unsigned int i, ncores;
130 151
131 ncores = scu_get_core_count(__io_address(UX500_SCU_BASE)); 152 ncores = scu_base ? scu_get_core_count(scu_base) : 1;
132 153
133 /* sanity check */ 154 /* sanity check */
134 if (ncores > NR_CPUS) { 155 if (ncores > NR_CPUS) {
@@ -154,6 +175,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
154 for (i = 0; i < max_cpus; i++) 175 for (i = 0; i < max_cpus; i++)
155 set_cpu_present(i, true); 176 set_cpu_present(i, true);
156 177
157 scu_enable(__io_address(UX500_SCU_BASE)); 178 scu_enable(scu_base_addr());
158 wakeup_secondary(); 179 wakeup_secondary();
159} 180}