- Move some function prototypes into header files.
- Remove late_setup_cpu, put the set indicator and vpa init into xics
probe instead
- rtas-proc was doing weird stuff with the 9005 indicator. Get rid of
it.
- Dont open code the set_indicator call in the hotplug code
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
#include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <asm/smp.h>
#include <asm/paca.h>
#include <asm/time.h>
-#include <asm/ppcdebug.h>
#include <asm/machdep.h>
#include <asm/xics.h>
#include <asm/cputable.h>
int pSeries_cpu_disable(void)
{
- /* FIXME: go put this in a header somewhere */
- extern void xics_migrate_irqs_away(void);
-
systemcfg->processorCount--;
/*fix boot_cpuid here*/
}
}
-extern void xics_request_IPIs(void);
-
static int __init smp_xics_probe(void)
{
xics_request_IPIs();
{
if (cpu != boot_cpuid)
xics_setup_cpu();
+
+ if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
+ vpa_init(cpu);
+
+#ifdef CONFIG_IRQ_ALL_CPUS
+ /*
+ * Put the calling processor into the GIQ. This is really only
+ * necessary from a secondary thread as the OF start-cpu interface
+ * performs this function for us on primary threads.
+ */
+ rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, default_distrib_server, 1);
+#endif
}
static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED;
spin_unlock(&timebase_lock);
}
-static void __devinit pSeries_late_setup_cpu(int cpu)
-{
- extern unsigned int default_distrib_server;
-
- if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
- vpa_init(cpu);
- }
-
-#ifdef CONFIG_IRQ_ALL_CPUS
- /* Put the calling processor into the GIQ. This is really only
- * necessary from a secondary thread as the OF start-cpu interface
- * performs this function for us on primary threads.
- */
- /* TODO: 9005 is #defined in rtas-proc.c -- move to a header */
- rtas_set_indicator(9005, default_distrib_server, 1);
-#endif
-}
-
-
-void __devinit smp_pSeries_kick_cpu(int nr)
+static void __devinit smp_pSeries_kick_cpu(int nr)
{
BUG_ON(nr < 0 || nr >= NR_CPUS);
.probe = smp_mpic_probe,
.kick_cpu = smp_pSeries_kick_cpu,
.setup_cpu = smp_mpic_setup_cpu,
- .late_setup_cpu = pSeries_late_setup_cpu,
};
static struct smp_ops_t pSeries_xics_smp_ops = {
.probe = smp_xics_probe,
.kick_cpu = smp_pSeries_kick_cpu,
.setup_cpu = smp_xics_setup_cpu,
- .late_setup_cpu = pSeries_late_setup_cpu,
};
/* This is called very early */
}
}
- if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
- vpa_init(boot_cpuid);
-
/* Non-lpar has additional take/give timebase */
if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
smp_ops->give_timebase = pSeries_give_timebase;
#define IBM_VOLTAGE 0x232a /* 9002 */
#define IBM_DRCONNECTOR 0x232b /* 9003 */
#define IBM_POWERSUPPLY 0x232c /* 9004 */
-#define IBM_INTQUEUE 0x232d /* 9005 */
/* Status return values */
#define SENSOR_CRITICAL_HIGH 13
#define DR_ACTION 0x2329 /* 9001 */
#define DR_INDICATOR 0x232a /* 9002 */
/* 9003 - 9004: Vendor specific */
-#define GLOBAL_INTERRUPT_QUEUE 0x232d /* 9005 */
/* 9006 - 9999: Vendor specific */
/* other */
"No current flow" };
const char * ibm_drconnector[] = { "Empty", "Present", "Unusable",
"Exchange" };
- const char * ibm_intqueue[] = { "Disabled", "Enabled" };
int have_strings = 0;
int num_states = 0;
case IBM_POWERSUPPLY:
seq_printf(m, "Powersupply:\t");
break;
- case IBM_INTQUEUE:
- seq_printf(m, "Interrupt queue:\t");
- num_states = sizeof(ibm_intqueue) / sizeof(char *);
- if (state < num_states) {
- seq_printf(m, "%s\t",
- ibm_intqueue[state]);
- have_strings = 1;
- }
- break;
default:
seq_printf(m, "Unknown sensor (type %d), ignoring it\n",
s->token);
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
#include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/pgtable.h>
-#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
#include <asm/paca.h>
#include <asm/time.h>
-#include <asm/ppcdebug.h>
#include <asm/machdep.h>
#include <asm/cputable.h>
#include <asm/system.h>
#endif
int smp_threads_ready;
-unsigned long cache_decay_ticks;
cpumask_t cpu_possible_map = CPU_MASK_NONE;
cpumask_t cpu_online_map = CPU_MASK_NONE;
int smt_enabled_at_boot = 1;
-/* Low level assembly function used to backup CPU 0 state */
-extern void __save_cpu_setup(void);
-
-
#ifdef CONFIG_PPC_MULTIPLATFORM
void smp_mpic_message_pass(int target, int msg)
{
if (smp_ops->take_timebase)
smp_ops->take_timebase();
- if (smp_ops->late_setup_cpu)
- smp_ops->late_setup_cpu(cpu);
-
spin_lock(&call_lock);
cpu_set(cpu, cpu_online_map);
spin_unlock(&call_lock);
/* Interrupts are disabled. */
void xics_migrate_irqs_away(void)
{
- int set_indicator = rtas_token("set-indicator");
- const unsigned int giqs = 9005UL; /* Global Interrupt Queue Server */
- int status = 0;
+ int status;
unsigned int irq, virq, cpu = smp_processor_id();
- BUG_ON(set_indicator == RTAS_UNKNOWN_SERVICE);
-
/* Reject any interrupt that was queued to us... */
ops->cppr_info(cpu, 0);
iosync();
/* Refuse any new interrupts... */
- rtas_call(set_indicator, 3, 1, &status, giqs,
- hard_smp_processor_id(), 0);
+ status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+ hard_smp_processor_id(), 0);
WARN_ON(status != 0);
/* Allow IPIs again... */
int (*probe)(void);
void (*kick_cpu)(int nr);
void (*setup_cpu)(int nr);
- void (*late_setup_cpu)(int nr);
void (*take_timebase)(void);
void (*give_timebase)(void);
int (*cpu_disable)(void);
/* RMO buffer reserved for user-space RTAS use */
extern unsigned long rtas_rmo_buf;
+#define GLOBAL_INTERRUPT_QUEUE 9005
+
#endif /* _PPC64_RTAS_H */
int xics_get_irq(struct pt_regs *);
void xics_setup_cpu(void);
void xics_cause_IPI(int cpu);
+void xics_request_IPIs(void);
+void xics_migrate_irqs_away(void);
/* first argument is ignored for now*/
void pSeriesLP_cppr_info(int n_cpu, u8 value);
extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
+extern unsigned int default_distrib_server;
+
#endif /* _PPC64_KERNEL_XICS_H */