From: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>

The patch fixes a problem with ES7000 Server Management mechanism that uses
platform register mip_port.  It was not initialized, so the mechanism was not
functional.

The patch also fixes the APIC destination for hierarchical and flat cluster
models used in ES7000.  The destination ID's reflect policies for Cascade
based systems which use logical delivery and lowest priority mechanism, and
for xAPIC based models that use physical delivery and fixed APIC destinations.

The patch also turns on NO_IOAPIC_CHECK (1) to avoid error messages and
attempts to re-write the ID, because on ES7000 all ID's are hard coded in the
BIOS and cannot be altered.


---

 25-akpm/arch/i386/mach-es7000/es7000.c           |    1 +
 25-akpm/arch/i386/mach-es7000/es7000.h           |    1 +
 25-akpm/include/asm-i386/mach-es7000/mach_apic.h |   10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff -puN arch/i386/mach-es7000/es7000.c~es7000-subarch-update-2 arch/i386/mach-es7000/es7000.c
--- 25/arch/i386/mach-es7000/es7000.c~es7000-subarch-update-2	Mon Apr 19 15:46:38 2004
+++ 25-akpm/arch/i386/mach-es7000/es7000.c	Mon Apr 19 15:46:38 2004
@@ -83,6 +83,7 @@ parse_unisys_oem (char *oemptr, int oem_
 			host = (struct mip_reg *)val;
 			host_reg = __va(host);
 			val = MIP_RD_LO(mi->mip_reg);
+			mip_port = MIP_PORT(mi->mip_info);
 			mip_addr = val;
 			mip = (struct mip_reg *)val;
 			mip_reg = __va(mip);
diff -puN arch/i386/mach-es7000/es7000.h~es7000-subarch-update-2 arch/i386/mach-es7000/es7000.h
--- 25/arch/i386/mach-es7000/es7000.h~es7000-subarch-update-2	Mon Apr 19 15:46:38 2004
+++ 25-akpm/arch/i386/mach-es7000/es7000.h	Mon Apr 19 15:46:38 2004
@@ -30,6 +30,7 @@
 #define	MIP_BUSY		1
 #define	MIP_SPIN		0xf0000
 #define	MIP_VALID		0x0100000000000000
+#define	MIP_PORT(VALUE)	((VALUE >> 32) & 0xffff)
 
 #define	MIP_RD_LO(VALUE)	(VALUE & 0xffffffff)   
 
diff -puN include/asm-i386/mach-es7000/mach_apic.h~es7000-subarch-update-2 include/asm-i386/mach-es7000/mach_apic.h
--- 25/include/asm-i386/mach-es7000/mach_apic.h~es7000-subarch-update-2	Mon Apr 19 15:46:38 2004
+++ 25-akpm/include/asm-i386/mach-es7000/mach_apic.h	Mon Apr 19 15:46:38 2004
@@ -39,7 +39,7 @@ static inline cpumask_t target_cpus(void
 #endif
 
 #define APIC_BROADCAST_ID	(0xff)
-#define NO_IOAPIC_CHECK (0)
+#define NO_IOAPIC_CHECK (1)
 
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
 { 
@@ -169,7 +169,11 @@ static inline unsigned int cpu_mask_to_a
 	num_bits_set = cpus_weight_const(cpumask);
 	/* Return id to all */
 	if (num_bits_set == NR_CPUS)
+#if defined CONFIG_ES7000_CLUSTERED_APIC
 		return 0xFF;
+#else
+		return cpu_to_logical_apicid(0);
+#endif
 	/* 
 	 * The cpus in the mask must all be on the apic cluster.  If are not 
 	 * on the same apicid cluster return default value of TARGET_CPUS. 
@@ -182,7 +186,11 @@ static inline unsigned int cpu_mask_to_a
 			if (apicid_cluster(apicid) != 
 					apicid_cluster(new_apicid)){
 				printk ("%s: Not a valid mask!\n",__FUNCTION__);
+#if defined CONFIG_ES7000_CLUSTERED_APIC
 				return 0xFF;
+#else
+				return cpu_to_logical_apicid(0);
+#endif
 			}
 			apicid = new_apicid;
 			cpus_found++;

_