summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-01-26 19:08:21 -0800
committerPaul Mackerras <paulus@samba.org>2007-02-07 14:03:18 +1100
commit66b44954f8f2129a39d145991c8e635046a71be6 (patch)
tree609b4fde791008196ba8b2e2701ecabe04193b75 /arch/powerpc/platforms
parent73d976b33998bca9aa7300e59f5d6c756be38b87 (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>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/ps3/setup.c20
1 files changed, 20 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 @@
#include <asm/udbg.h>
#include <asm/prom.h>
#include <asm/lv1call.h>
+#include <asm/ps3.h>
#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();