mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-12 18:23:45 +00:00
ARM: shmobile: Per-CPU SMP boot / sleep code for SCU SoCs
Hook in the per-CPU boot and sleep code in the shared mach-shmobile SCU code. CPUs may be kept in the asm routine until ->boot_secondary() when the per-CPU boot vector is installed. At the end of ->die() the asm sleep routine is invoked. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
This commit is contained in:
parent
cc61591e45
commit
1d33a354bb
1 changed files with 11 additions and 6 deletions
|
@ -18,8 +18,9 @@
|
||||||
|
|
||||||
void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
|
void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
|
||||||
{
|
{
|
||||||
shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
|
/* install boot code shared by all CPUs */
|
||||||
shmobile_boot_arg = (unsigned long)shmobile_scu_base;
|
shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
|
||||||
|
shmobile_boot_arg = MPIDR_HWID_BITMASK;
|
||||||
|
|
||||||
/* enable SCU and cache coherency on booting CPU */
|
/* enable SCU and cache coherency on booting CPU */
|
||||||
scu_enable(shmobile_scu_base);
|
scu_enable(shmobile_scu_base);
|
||||||
|
@ -28,22 +29,26 @@ void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
|
||||||
|
|
||||||
int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||||
{
|
{
|
||||||
/* do nothing for now */
|
/* For this particular CPU register SCU boot vector */
|
||||||
|
shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
|
||||||
|
(unsigned long)shmobile_scu_base);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
void shmobile_smp_scu_cpu_die(unsigned int cpu)
|
void shmobile_smp_scu_cpu_die(unsigned int cpu)
|
||||||
{
|
{
|
||||||
|
/* For this particular CPU deregister boot vector */
|
||||||
|
shmobile_smp_hook(cpu, 0, 0);
|
||||||
|
|
||||||
dsb();
|
dsb();
|
||||||
flush_cache_all();
|
flush_cache_all();
|
||||||
|
|
||||||
/* disable cache coherency */
|
/* disable cache coherency */
|
||||||
scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF);
|
scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF);
|
||||||
|
|
||||||
/* Endless loop until reset */
|
/* jump to shared mach-shmobile sleep / reset code */
|
||||||
while (1)
|
shmobile_smp_sleep();
|
||||||
cpu_do_idle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shmobile_smp_scu_psr_core_disabled(int cpu)
|
static int shmobile_smp_scu_psr_core_disabled(int cpu)
|
||||||
|
|
Loading…
Add table
Reference in a new issue