From 6e9de18120988388cdae5097c09e774416d58745 Mon Sep 17 00:00:00 2001 From: John Keller Date: Wed, 22 Aug 2007 19:32:06 -0500 Subject: [IA64] SN: Add support for CPU disable Add additional support for CPU disable on SN platforms. Correctly setup the smp_affinity mask for I/O error IRQs. Restrict the use of the feature to Altix 4000 and 450 systems running with a CPU disable capable PROM, and do not allow disabling of CPU 0. Signed-off-by: John Keller Signed-off-by: Tony Luck --- include/asm-ia64/sn/arch.h | 1 + include/asm-ia64/sn/intr.h | 1 + include/asm-ia64/sn/sn_feature_sets.h | 1 + 3 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h index 16adc93d7a72..7caa1f44cd95 100644 --- a/include/asm-ia64/sn/arch.h +++ b/include/asm-ia64/sn/arch.h @@ -81,5 +81,6 @@ extern u8 sn_sharing_domain_size; extern u8 sn_region_size; extern void sn_flush_all_caches(long addr, long bytes); +extern bool sn_cpu_disable_allowed(int cpu); #endif /* _ASM_IA64_SN_ARCH_H */ diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h index 12b54ddb06be..e0487aa97418 100644 --- a/include/asm-ia64/sn/intr.h +++ b/include/asm-ia64/sn/intr.h @@ -60,6 +60,7 @@ extern u64 sn_intr_alloc(nasid_t, int, int, nasid_t, int); extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); +extern void sn_set_err_irq_affinity(unsigned int); extern struct list_head **sn_irq_lh; #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h index bfdc36273ed4..8e83ac117ace 100644 --- a/include/asm-ia64/sn/sn_feature_sets.h +++ b/include/asm-ia64/sn/sn_feature_sets.h @@ -31,6 +31,7 @@ extern int sn_prom_feature_available(int id); #define PRF_PAL_CACHE_FLUSH_SAFE 0 #define PRF_DEVICE_FLUSH_LIST 1 #define PRF_HOTPLUG_SUPPORT 2 +#define PRF_CPU_DISABLE_SUPPORT 3 /* --------------------- OS Features -------------------------------*/ -- cgit v1.2.3-55-g7522 From 8b713c67bccef7cabb0ee915f47eb33d82636af9 Mon Sep 17 00:00:00 2001 From: Peter Chubb Date: Tue, 21 Aug 2007 13:51:45 +1000 Subject: [IA64] Enable early console for Ski simulator This patch cleans up the `enable early console for SKI' patch (471e7a44848f467c9b83adc3463d019d2fa8817f), and 1. potentially allows the gensparse_defconfig to work again. (there are other problems running a generic kernel on Ski) 2. fixes the `console registered twice' problem. 3. Cleans up the code by moving the `extern hpsim_cons' declaration to a new asm/hpsim.h file. Thanks to Jes for comments. Signed-off-by: Peter Chubb Signed-off-by: Tony Luck --- arch/ia64/hp/sim/hpsim_console.c | 15 ++++++++++++++- arch/ia64/hp/sim/hpsim_setup.c | 9 ++------- arch/ia64/kernel/setup.c | 8 ++------ include/asm-ia64/hpsim.h | 10 ++++++++++ 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 include/asm-ia64/hpsim.h (limited to 'include') diff --git a/arch/ia64/hp/sim/hpsim_console.c b/arch/ia64/hp/sim/hpsim_console.c index 6e149c8ab835..0475a5452404 100644 --- a/arch/ia64/hp/sim/hpsim_console.c +++ b/arch/ia64/hp/sim/hpsim_console.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "hpsim_ssc.h" @@ -28,7 +29,7 @@ static int simcons_init (struct console *, char *); static void simcons_write (struct console *, const char *, unsigned); static struct tty_driver *simcons_console_device (struct console *, int *); -struct console hpsim_cons = { +static struct console hpsim_cons = { .name = "simcons", .write = simcons_write, .device = simcons_console_device, @@ -62,3 +63,15 @@ static struct tty_driver *simcons_console_device (struct console *c, int *index) *index = c->index; return hp_simserial_driver; } + +int simcons_register(void) +{ + if (!ia64_platform_is("hpsim")) + return 1; + + if (hpsim_cons.flags & CON_ENABLED) + return 1; + + register_console(&hpsim_cons); + return 0; +} diff --git a/arch/ia64/hp/sim/hpsim_setup.c b/arch/ia64/hp/sim/hpsim_setup.c index f2297192a582..f629e903ebc7 100644 --- a/arch/ia64/hp/sim/hpsim_setup.c +++ b/arch/ia64/hp/sim/hpsim_setup.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "hpsim_ssc.h" @@ -41,11 +42,5 @@ hpsim_setup (char **cmdline_p) { ROOT_DEV = Root_SDA1; /* default to first SCSI drive */ -#ifdef CONFIG_HP_SIMSERIAL_CONSOLE - { - extern struct console hpsim_cons; - if (ia64_platform_is("hpsim")) - register_console(&hpsim_cons); - } -#endif + simcons_register(); } diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 1f9b1d818dcd..9e392a30d197 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -60,6 +60,7 @@ #include #include #include +#include #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE) # error "struct cpuinfo_ia64 too big!" @@ -389,13 +390,8 @@ early_console_setup (char *cmdline) if (!efi_setup_pcdp_console(cmdline)) earlycons++; #endif -#ifdef CONFIG_HP_SIMSERIAL_CONSOLE - { - extern struct console hpsim_cons; - register_console(&hpsim_cons); + if (!simcons_register()) earlycons++; - } -#endif return (earlycons) ? 0 : -1; } diff --git a/include/asm-ia64/hpsim.h b/include/asm-ia64/hpsim.h new file mode 100644 index 000000000000..d6be3fdc39fa --- /dev/null +++ b/include/asm-ia64/hpsim.h @@ -0,0 +1,10 @@ +#ifndef _ASMIA64_HPSIM_H +#define _ASMIA64_HPSIM_H + +#ifndef CONFIG_HP_SIMSERIAL_CONSOLE +static inline int simcons_register(void) { return 1; } +#else +int simcons_register(void); +#endif + +#endif -- cgit v1.2.3-55-g7522 From 7b3166dbc3df5b72f2ba4ea130f4461e318a3838 Mon Sep 17 00:00:00 2001 From: Peter Chubb Date: Tue, 21 Aug 2007 13:57:01 +1000 Subject: [IA64] Cleanup HPSIM code (was: Re: Enable early console for Ski simulator) After my last patch we have a new header file for HP simulator use. Here's code to use it for stuff that used to have `extern' statements inline in the code. Functionality should not change with this patch. Signed-off-by: Peter Chubb Signed-off-by: Tony Luck --- arch/ia64/hp/sim/hpsim_console.c | 1 - arch/ia64/hp/sim/simeth.c | 12 +++--------- arch/ia64/hp/sim/simscsi.c | 3 +-- include/asm-ia64/hpsim.h | 6 ++++++ 4 files changed, 10 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/arch/ia64/hp/sim/hpsim_console.c b/arch/ia64/hp/sim/hpsim_console.c index 0475a5452404..01663bc42b1a 100644 --- a/arch/ia64/hp/sim/hpsim_console.c +++ b/arch/ia64/hp/sim/hpsim_console.c @@ -59,7 +59,6 @@ simcons_write (struct console *cons, const char *buf, unsigned count) static struct tty_driver *simcons_console_device (struct console *c, int *index) { - extern struct tty_driver *hp_simserial_driver; *index = c->index; return hp_simserial_driver; } diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index f26077a773d5..4017696ada63 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -22,6 +22,9 @@ #include #include #include +#include + +#include "hpsim_ssc.h" #define SIMETH_RECV_MAX 10 @@ -35,12 +38,6 @@ #define SIMETH_FRAME_SIZE ETH_FRAME_LEN -#define SSC_NETDEV_PROBE 100 -#define SSC_NETDEV_SEND 101 -#define SSC_NETDEV_RECV 102 -#define SSC_NETDEV_ATTACH 103 -#define SSC_NETDEV_DETACH 104 - #define NETWORK_INTR 8 struct simeth_local { @@ -124,9 +121,6 @@ simeth_probe (void) return r; } -extern long ia64_ssc (long, long, long, long, int); -extern void ia64_ssc_connect_irq (long intr, long irq); - static inline int netdev_probe(char *name, unsigned char *ether) { diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index e62694f8ef75..4552a1cf5b33 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c @@ -14,6 +14,7 @@ #include #include #include +#include "hpsim_ssc.h" #include #include @@ -59,8 +60,6 @@ struct disk_stat { unsigned count; }; -extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr); - static int desc[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; diff --git a/include/asm-ia64/hpsim.h b/include/asm-ia64/hpsim.h index d6be3fdc39fa..892ab198a9da 100644 --- a/include/asm-ia64/hpsim.h +++ b/include/asm-ia64/hpsim.h @@ -7,4 +7,10 @@ static inline int simcons_register(void) { return 1; } int simcons_register(void); #endif +struct tty_driver; +extern struct tty_driver *hp_simserial_driver; + +void ia64_ssc_connect_irq(long intr, long irq); +void ia64_ctl_trace(long on); + #endif -- cgit v1.2.3-55-g7522