powerpc/fsl_booke: Add support to boot from core other than 0
First we check to see if we are the first core booting up. This is accomplished by comparing the boot_cpuid with -1, if it is we assume this is the first core coming up. Secondly, we need to update the initial thread info structure to reflect the actual cpu we are running on otherwise smp_processor_id() and related functions will return the default initialization value of the struct or 0. Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
committed by
Kumar Gala
parent
f7a07fd961
commit
2ed38b2359
@@ -152,8 +152,11 @@ _ENTRY(__early_start)
|
|||||||
/* Check to see if we're the second processor, and jump
|
/* Check to see if we're the second processor, and jump
|
||||||
* to the secondary_start code if so
|
* to the secondary_start code if so
|
||||||
*/
|
*/
|
||||||
mfspr r24,SPRN_PIR
|
lis r24, boot_cpuid@h
|
||||||
cmpwi r24,0
|
ori r24, r24, boot_cpuid@l
|
||||||
|
lwz r24, 0(r24)
|
||||||
|
cmpwi r24, -1
|
||||||
|
mfspr r24,SPRN_PIR
|
||||||
bne __secondary_start
|
bne __secondary_start
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -175,6 +178,9 @@ _ENTRY(__early_start)
|
|||||||
li r0,0
|
li r0,0
|
||||||
stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
|
stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
|
||||||
|
|
||||||
|
rlwinm r22,r1,0,0,31-THREAD_SHIFT /* current thread_info */
|
||||||
|
stw r24, TI_CPU(r22)
|
||||||
|
|
||||||
bl early_init
|
bl early_init
|
||||||
|
|
||||||
#ifdef CONFIG_RELOCATABLE
|
#ifdef CONFIG_RELOCATABLE
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
extern void bootx_init(unsigned long r4, unsigned long phys);
|
extern void bootx_init(unsigned long r4, unsigned long phys);
|
||||||
|
|
||||||
int boot_cpuid;
|
int boot_cpuid = -1;
|
||||||
EXPORT_SYMBOL_GPL(boot_cpuid);
|
EXPORT_SYMBOL_GPL(boot_cpuid);
|
||||||
int boot_cpuid_phys;
|
int boot_cpuid_phys;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user