From: Geoff Levand Date: Sat, 27 Jan 2007 03:08:21 +0000 (-0800) Subject: [POWERPC] ps3: get firmware version X-Git-Tag: v2.6.21-rc1~92^2~23^2~57 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66b44954f8f2129a39d145991c8e635046a71be6;p=linux-2.6 [POWERPC] ps3: get firmware version Add a new routine ps3_get_firmware_version() and use it to output the firmware version to dmesg. Signed-off-by: Geoff Levand Acked-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 8b0569853f..cb91a81352 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "platform.h" @@ -41,6 +42,19 @@ #define DBG(fmt...) do{if(0)printk(fmt);}while(0) #endif +int ps3_get_firmware_version(union ps3_firmware_version *v) +{ + int result = lv1_get_version_info(&v->raw); + + if (result) { + v->raw = 0; + return -1; + } + + return result; +} +EXPORT_SYMBOL_GPL(ps3_get_firmware_version); + static void ps3_power_save(void) { /* @@ -69,8 +83,14 @@ static void ps3_panic(char *str) static void __init ps3_setup_arch(void) { + union ps3_firmware_version v; + DBG(" -> %s:%d\n", __func__, __LINE__); + ps3_get_firmware_version(&v); + printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", v.major, v.minor, + v.rev); + ps3_spu_set_platform(); ps3_map_htab(); diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 00a4c7d3c6..d1ae87df77 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h @@ -27,6 +27,18 @@ #include #include +union ps3_firmware_version { + u64 raw; + struct { + u16 pad; + u16 major; + u16 minor; + u16 rev; + }; +}; + +int ps3_get_firmware_version(union ps3_firmware_version *v); + /** * struct ps3_device_id - HV bus device identifier from the system repository * @bus_id: HV bus id, {1..} (zero invalid)