diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-06-10 02:41:02 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-06-13 11:46:42 -0400 |
commit | 571886b2a52395f030d439c6259663a033e11e6a (patch) | |
tree | 5e386eaa6465785dc16d3dc2693fe8b23e557f1c /arch/mips | |
parent | 9584c55a5cc0db82329dd1142ca570e2d64ea491 (diff) |
MIPS: Netlogic: Initialization when !CONFIG_SMP
The core initialization and reset vector setup needs to be done
even when booting uniprocessor. Move this code from smp.c to setup.c
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5428/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/netlogic/common/Makefile | 3 | ||||
-rw-r--r-- | arch/mips/netlogic/common/smp.c | 6 | ||||
-rw-r--r-- | arch/mips/netlogic/xlp/setup.c | 8 | ||||
-rw-r--r-- | arch/mips/netlogic/xlp/wakeup.c | 1 | ||||
-rw-r--r-- | arch/mips/netlogic/xlr/setup.c | 6 |
5 files changed, 16 insertions, 8 deletions
diff --git a/arch/mips/netlogic/common/Makefile b/arch/mips/netlogic/common/Makefile index a396a39ec491..362739d62b1d 100644 --- a/arch/mips/netlogic/common/Makefile +++ b/arch/mips/netlogic/common/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-y += irq.o time.o | 1 | obj-y += irq.o time.o |
2 | obj-y += nlm-dma.o | 2 | obj-y += nlm-dma.o |
3 | obj-$(CONFIG_SMP) += smp.o smpboot.o reset.o | 3 | obj-y += reset.o |
4 | obj-$(CONFIG_SMP) += smp.o smpboot.o | ||
4 | obj-$(CONFIG_EARLY_PRINTK) += earlycons.o | 5 | obj-$(CONFIG_EARLY_PRINTK) += earlycons.o |
diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c index ffba52489bef..da3d3bc02c20 100644 --- a/arch/mips/netlogic/common/smp.c +++ b/arch/mips/netlogic/common/smp.c | |||
@@ -254,15 +254,9 @@ unsupp: | |||
254 | 254 | ||
255 | int __cpuinit nlm_wakeup_secondary_cpus(void) | 255 | int __cpuinit nlm_wakeup_secondary_cpus(void) |
256 | { | 256 | { |
257 | unsigned long reset_vec; | ||
258 | char *reset_data; | 257 | char *reset_data; |
259 | int threadmode; | 258 | int threadmode; |
260 | 259 | ||
261 | /* Update reset entry point with CPU init code */ | ||
262 | reset_vec = CKSEG1ADDR(RESET_VEC_PHYS); | ||
263 | memcpy((void *)reset_vec, (void *)nlm_reset_entry, | ||
264 | (nlm_reset_entry_end - nlm_reset_entry)); | ||
265 | |||
266 | /* verify the mask and setup core config variables */ | 260 | /* verify the mask and setup core config variables */ |
267 | threadmode = nlm_parse_cpumask(&nlm_cpumask); | 261 | threadmode = nlm_parse_cpumask(&nlm_cpumask); |
268 | 262 | ||
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c index 7b6694998cdc..5bdd354fef48 100644 --- a/arch/mips/netlogic/xlp/setup.c +++ b/arch/mips/netlogic/xlp/setup.c | |||
@@ -98,11 +98,19 @@ void nlm_percpu_init(int hwcpuid) | |||
98 | 98 | ||
99 | void __init prom_init(void) | 99 | void __init prom_init(void) |
100 | { | 100 | { |
101 | void *reset_vec; | ||
102 | |||
101 | nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); | 103 | nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); |
104 | nlm_init_boot_cpu(); | ||
102 | xlp_mmu_init(); | 105 | xlp_mmu_init(); |
103 | nlm_node_init(0); | 106 | nlm_node_init(0); |
104 | xlp_dt_init((void *)(long)fw_arg0); | 107 | xlp_dt_init((void *)(long)fw_arg0); |
105 | 108 | ||
109 | /* Update reset entry point with CPU init code */ | ||
110 | reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS); | ||
111 | memcpy(reset_vec, (void *)nlm_reset_entry, | ||
112 | (nlm_reset_entry_end - nlm_reset_entry)); | ||
113 | |||
106 | #ifdef CONFIG_SMP | 114 | #ifdef CONFIG_SMP |
107 | cpumask_setall(&nlm_cpumask); | 115 | cpumask_setall(&nlm_cpumask); |
108 | nlm_wakeup_secondary_cpus(); | 116 | nlm_wakeup_secondary_cpus(); |
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c index 1a7d529fcec0..abb3e08cc052 100644 --- a/arch/mips/netlogic/xlp/wakeup.c +++ b/arch/mips/netlogic/xlp/wakeup.c | |||
@@ -137,7 +137,6 @@ void xlp_wakeup_secondary_cpus() | |||
137 | * In case of u-boot, the secondaries are in reset | 137 | * In case of u-boot, the secondaries are in reset |
138 | * first wakeup core 0 threads | 138 | * first wakeup core 0 threads |
139 | */ | 139 | */ |
140 | nlm_init_boot_cpu(); | ||
141 | xlp_boot_core0_siblings(); | 140 | xlp_boot_core0_siblings(); |
142 | 141 | ||
143 | /* now get other cores out of reset */ | 142 | /* now get other cores out of reset */ |
diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c index 89c8c1066632..7e27f8591867 100644 --- a/arch/mips/netlogic/xlr/setup.c +++ b/arch/mips/netlogic/xlr/setup.c | |||
@@ -196,6 +196,7 @@ void __init prom_init(void) | |||
196 | { | 196 | { |
197 | int *argv, *envp; /* passed as 32 bit ptrs */ | 197 | int *argv, *envp; /* passed as 32 bit ptrs */ |
198 | struct psb_info *prom_infop; | 198 | struct psb_info *prom_infop; |
199 | void *reset_vec; | ||
199 | #ifdef CONFIG_SMP | 200 | #ifdef CONFIG_SMP |
200 | int i; | 201 | int i; |
201 | #endif | 202 | #endif |
@@ -208,6 +209,11 @@ void __init prom_init(void) | |||
208 | nlm_prom_info = *prom_infop; | 209 | nlm_prom_info = *prom_infop; |
209 | nlm_init_node(); | 210 | nlm_init_node(); |
210 | 211 | ||
212 | /* Update reset entry point with CPU init code */ | ||
213 | reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS); | ||
214 | memcpy(reset_vec, (void *)nlm_reset_entry, | ||
215 | (nlm_reset_entry_end - nlm_reset_entry)); | ||
216 | |||
211 | nlm_early_serial_setup(); | 217 | nlm_early_serial_setup(); |
212 | build_arcs_cmdline(argv); | 218 | build_arcs_cmdline(argv); |
213 | prom_add_memory(); | 219 | prom_add_memory(); |