aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/ps3/setup.c20
-rw-r--r--include/asm-powerpc/ps3.h12
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
45int 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}
56EXPORT_SYMBOL_GPL(ps3_get_firmware_version);
57
44static void ps3_power_save(void) 58static void ps3_power_save(void)
45{ 59{
46 /* 60 /*
@@ -69,8 +83,14 @@ static void ps3_panic(char *str)
69 83
70static void __init ps3_setup_arch(void) 84static 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
30union ps3_firmware_version {
31 u64 raw;
32 struct {
33 u16 pad;
34 u16 major;
35 u16 minor;
36 u16 rev;
37 };
38};
39
40int 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)