[PATCH 3/4] Add UV partition call
Add a bios call to return partitioning related info.
Signed-off-by: Russ Anderson <rja@sgi.com>
---
arch/x86/kernel/bios_uv.c | 52 ++++++++++++++++++++++++++++++++++-----
arch/x86/kernel/genx2apic_uv_x.c | 14 ++++++----
include/asm-x86/uv/bios.h | 30 ++++++++++++++++------
3 files changed, 76 insertions(+), 20 deletions(-)
Index: linux/arch/x86/kernel/bios_uv.c
===================================================================
--- linux.orig/arch/x86/kernel/bios_uv.c 2008-09-22 16:01:11.000000000 -0500
+++ linux/arch/x86/kernel/bios_uv.c 2008-09-22 16:01:16.000000000 -0500
@@ -62,14 +62,54 @@ s64 uv_bios_call_reentrant(int which, u6
return ret;
}
-long
-x86_bios_freq_base(unsigned long clock_type, unsigned long *ticks_per_second,
- unsigned long *drift_info)
+
+u8 sn_partition_id;
+EXPORT_SYMBOL(sn_partition_id);
+u8 uv_coherency_id;
+EXPORT_SYMBOL(uv_coherency_id);
+u8 uv_type;
+EXPORT_SYMBOL(uv_type);
+
+/*
+ * Returns information about the UV HUB.
+ *
+ * Parameters for UV_BIOS_GET_SN_INFO call:
+ * In:
+ * arg0 - UV_BIOS_GET_SN_INFO
+ * arg1 - fc (0 for now, other values reserved for future use)
+ * Out:
+ * v0
+ * [7:0] - uv hub version (0=hub1, 1=hub2)
+ * [31:24] - partition ID
+ * [39:32] - coherency_id
+ */
+s64 uv_bios_get_sn_info(int fc, u8 *uvtype, u8 *partid, u8 *coher)
{
- return uv_bios_call(BIOS_FREQ_BASE, clock_type,
- (u64)ticks_per_second, 0, 0, 0);
+ s64 ret;
+ u64 v0, v1;
+
+ ret = uv_bios_call_irqsave(UV_BIOS_GET_SN_INFO, fc,
+ (u64)(&v0), (u64)(&v1), 0, 0);
+ if (ret != BIOS_STATUS_SUCCESS)
+ return ret;
+
+ if (uvtype)
+ *uvtype = v0 & 0xff;
+ if (partid)
+ *partid = (v0 >> 8) & 0xff;
+ if (coher)
+ *coher = (v0 >> 24) & 0xff;
+ return ret;
}
-EXPORT_SYMBOL_GPL(x86_bios_freq_base);
+
+
+s64
+uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second)
+{
+ return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type,
+ ...