diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2007-01-26 22:08:21 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-02-06 22:03:18 -0500 |
commit | 66b44954f8f2129a39d145991c8e635046a71be6 (patch) | |
tree | 609b4fde791008196ba8b2e2701ecabe04193b75 | |
parent | 73d976b33998bca9aa7300e59f5d6c756be38b87 (diff) |
[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 <geoffrey.levand@am.sony.com>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 20 | ||||
-rw-r--r-- | include/asm-powerpc/ps3.h | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 8b0569853fcd..cb91a81352bf 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/udbg.h> | 32 | #include <asm/udbg.h> |
33 | #include <asm/prom.h> | 33 | #include <asm/prom.h> |
34 | #include <asm/lv1call.h> | 34 | #include <asm/lv1call.h> |
35 | #include <asm/ps3.h> | ||
35 | 36 | ||
36 | #include "platform.h" | 37 | #include "platform.h" |
37 | 38 | ||
@@ -41,6 +42,19 @@ | |||
41 | #define DBG(fmt...) do{if(0)printk(fmt);}while(0) | 42 | #define DBG(fmt...) do{if(0)printk(fmt);}while(0) |
42 | #endif | 43 | #endif |
43 | 44 | ||
45 | int ps3_get_firmware_version(union ps3_firmware_version *v) | ||
46 | { | ||
47 | int result = lv1_get_version_info(&v->raw); | ||
48 | |||
49 | if (result) { | ||
50 | v->raw = 0; | ||
51 | return -1; | ||
52 | } | ||
53 | |||
54 | return result; | ||
55 | } | ||
56 | EXPORT_SYMBOL_GPL(ps3_get_firmware_version); | ||
57 | |||
44 | static void ps3_power_save(void) | 58 | static void ps3_power_save(void) |
45 | { | 59 | { |
46 | /* | 60 | /* |
@@ -69,8 +83,14 @@ static void ps3_panic(char *str) | |||
69 | 83 | ||
70 | static void __init ps3_setup_arch(void) | 84 | static void __init ps3_setup_arch(void) |
71 | { | 85 | { |
86 | union ps3_firmware_version v; | ||
87 | |||
72 | DBG(" -> %s:%d\n", __func__, __LINE__); | 88 | DBG(" -> %s:%d\n", __func__, __LINE__); |
73 | 89 | ||
90 | ps3_get_firmware_version(&v); | ||
91 | printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", v.major, v.minor, | ||
92 | v.rev); | ||
93 | |||
74 | ps3_spu_set_platform(); | 94 | ps3_spu_set_platform(); |
75 | ps3_map_htab(); | 95 | ps3_map_htab(); |
76 | 96 | ||
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 00a4c7d3c6d1..d1ae87df7776 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
@@ -27,6 +27,18 @@ | |||
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <scsi/scsi.h> | 28 | #include <scsi/scsi.h> |
29 | 29 | ||
30 | union ps3_firmware_version { | ||
31 | u64 raw; | ||
32 | struct { | ||
33 | u16 pad; | ||
34 | u16 major; | ||
35 | u16 minor; | ||
36 | u16 rev; | ||
37 | }; | ||
38 | }; | ||
39 | |||
40 | int ps3_get_firmware_version(union ps3_firmware_version *v); | ||
41 | |||
30 | /** | 42 | /** |
31 | * struct ps3_device_id - HV bus device identifier from the system repository | 43 | * struct ps3_device_id - HV bus device identifier from the system repository |
32 | * @bus_id: HV bus id, {1..} (zero invalid) | 44 | * @bus_id: HV bus id, {1..} (zero invalid) |