Commit 1322810c authored by Masakazu Mokuno's avatar Masakazu Mokuno Committed by Paul Mackerras

[POWERPC] PS3: Compare firmware version

Add a utility routine ps3_compare_firmware_version() to compare system
firmware versions.  Uses the existing ps3_get_firmware_version() routine.
Signed-off-by: default avatarMasakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 848cfdc5
...@@ -46,18 +46,26 @@ ...@@ -46,18 +46,26 @@
static void smp_send_stop(void) {} static void smp_send_stop(void) {}
#endif #endif
int ps3_get_firmware_version(union ps3_firmware_version *v) static union ps3_firmware_version ps3_firmware_version;
void ps3_get_firmware_version(union ps3_firmware_version *v)
{ {
int result = lv1_get_version_info(&v->raw); *v = ps3_firmware_version;
}
EXPORT_SYMBOL_GPL(ps3_get_firmware_version);
if (result) { int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev)
v->raw = 0; {
return -1; union ps3_firmware_version x;
}
x.pad = 0;
x.major = major;
x.minor = minor;
x.rev = rev;
return result; return (ps3_firmware_version.raw - x.raw);
} }
EXPORT_SYMBOL_GPL(ps3_get_firmware_version); EXPORT_SYMBOL_GPL(ps3_compare_firmware_version);
static void ps3_power_save(void) static void ps3_power_save(void)
{ {
...@@ -146,13 +154,13 @@ static int ps3_set_dabr(u64 dabr) ...@@ -146,13 +154,13 @@ static int ps3_set_dabr(u64 dabr)
static void __init ps3_setup_arch(void) static void __init ps3_setup_arch(void)
{ {
union ps3_firmware_version v;
DBG(" -> %s:%d\n", __func__, __LINE__); DBG(" -> %s:%d\n", __func__, __LINE__);
ps3_get_firmware_version(&v); lv1_get_version_info(&ps3_firmware_version.raw);
printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", v.major, v.minor, printk(KERN_INFO "PS3 firmware version %u.%u.%u\n",
v.rev); ps3_firmware_version.major, ps3_firmware_version.minor,
ps3_firmware_version.rev);
ps3_spu_set_platform(); ps3_spu_set_platform();
ps3_map_htab(); ps3_map_htab();
......
...@@ -35,7 +35,8 @@ union ps3_firmware_version { ...@@ -35,7 +35,8 @@ union ps3_firmware_version {
}; };
}; };
int ps3_get_firmware_version(union ps3_firmware_version *v); void ps3_get_firmware_version(union ps3_firmware_version *v);
int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev);
/* 'Other OS' area */ /* 'Other OS' area */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment