Skip to content

Commit

Permalink
[POWERPC] PS3: Compare firmware version
Browse files Browse the repository at this point in the history
Add a utility routine ps3_compare_firmware_version() to compare system
firmware versions.  Uses the existing ps3_get_firmware_version() routine.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Masakazu Mokuno authored and Paul Mackerras committed Jun 28, 2007
1 parent 848cfdc commit 1322810
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
32 changes: 20 additions & 12 deletions arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,26 @@
static void smp_send_stop(void) {}
#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) {
v->raw = 0;
return -1;
}
int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev)
{
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)
{
Expand Down Expand Up @@ -146,13 +154,13 @@ static int ps3_set_dabr(u64 dabr)

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);
lv1_get_version_info(&ps3_firmware_version.raw);
printk(KERN_INFO "PS3 firmware version %u.%u.%u\n",
ps3_firmware_version.major, ps3_firmware_version.minor,
ps3_firmware_version.rev);

ps3_spu_set_platform();
ps3_map_htab();
Expand Down
3 changes: 2 additions & 1 deletion include/asm-powerpc/ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 1322810

Please sign in to comment.