powerpc/mpic: Add ability to reset a core via MPIC
Subsystems (2)
PATCH 1/2 powerpc/mpic: Add ability to reset a core via MPIC
We need the ability to reset cores for use with kexec/kdump for SMP systems. Calling this function with the specific core you want to reset will cause the CPU to spin in reset.
Signed-off-by Matthew McClintock <[email protected]>
--- arch/powerpc/sysdev/mpic.c | 18 ++++++++++++++++++ arch/powerpc/sysdev/mpic.h | 1 + 2 files changed, 19 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/mpic.c +18 -0
@@ -1636,6 +1636,24 @@ void __devinit smp_mpic_setup_cpu(int cpu) {mpic_setup_this_cpu (); } + +void mpic_reset_core (int cpu) +{ +struct mpic *mpic = mpic_primary; +u32 pir; +int cpuid =get_hard_smp_processor_id (cpu); + +/* Set target bit for core reset */ + pir =mpic_read (mpic->gregs,MPIC_INFO (GREG_PROCESSOR_INIT )); + pir |= (1 << cpuid); +mpic_write (mpic->gregs,MPIC_INFO (GREG_PROCESSOR_INIT ), pir); +mpic_read (mpic->gregs,MPIC_INFO (GREG_PROCESSOR_INIT )); + +/* Restore target bit after reset complete */ + pir &= ~(1 << cpuid); +mpic_write (mpic->gregs,MPIC_INFO (GREG_PROCESSOR_INIT ), pir); +mpic_read (mpic->gregs,MPIC_INFO (GREG_PROCESSOR_INIT )); +}#endif /* CONFIG_SMP */ #ifdef CONFIG_PM
arch/powerpc/sysdev/mpic.h +1 -0
@@ -37,5 +37,6 @@ static inline int mpic_pasemi_msi_init(struct mpic *mpic)extern int mpic_set_irq_type (unsigned int virq,unsigned int flow_type);extern void mpic_set_vector (unsigned int virq,unsigned int vector);extern int mpic_set_affinity (unsigned int irq,const struct cpumask *cpumask); +extern void mpic_reset_core (int cpu);#endif /* _POWERPC_SYSDEV_MPIC_H */
Signature · 1 line
1.6.6.1
PATCH 2/2 powerpc/85xx platorms: kexec for SMP 85xx BookE systems
Adds support for kexec on 85xx machines for the BookE platform. Including support for SMP machines
Based off work from Maxim Uvarov <[email protected]>
Signed-off-by Matthew McClintock <[email protected]>
---
To test/use you will need to fetch kexec from GIT and apply the following patch for kexec to work properply with uImages
http://lists.infradead.org/pipermail/kexec/2010-June/004163.html
arch/powerpc/Kconfig | 2 +- arch/powerpc/platforms/85xx/smp.c | 57 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletions(-)
arch/powerpc/Kconfig +1 -1
@@ -351,7 +351,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE config KEXEC bool "kexec system call (EXPERIMENTAL)" - depends on (PPC_BOOK3S || (FSL_BOOKE && !SMP)) && EXPERIMENTAL + depends on (PPC_BOOK3S || FSL_BOOKE) && EXPERIMENTAL help kexec is a system call that implements the ability to shutdown your current kernel, and to start another kernel. It is like a reboot
arch/powerpc/platforms/85xx/smp.c +57 -0
81 lines not on this page · raw message
Signature · 1 line
1.6.6.1