Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46837
b: refs/heads/master
c: 66b4495
h: refs/heads/master
i:
  46835: 66b0d9e
v: v3
  • Loading branch information
Geoff Levand authored and Paul Mackerras committed Feb 7, 2007
1 parent 939c646 commit d4c0693
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73d976b33998bca9aa7300e59f5d6c756be38b87
refs/heads/master: 66b44954f8f2129a39d145991c8e635046a71be6
20 changes: 20 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/udbg.h>
#include <asm/prom.h>
#include <asm/lv1call.h>
#include <asm/ps3.h>

#include "platform.h"

Expand All @@ -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)
{
/*
Expand Down Expand Up @@ -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();

Expand Down
12 changes: 12 additions & 0 deletions trunk/include/asm-powerpc/ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
#include <linux/device.h>
#include <scsi/scsi.h>

union ps3_firmware_version {
u64 raw;
struct {
u16 pad;
u16 major;
u16 minor;
u16 rev;
};
};

int ps3_get_firmware_version(union ps3_firmware_version *v);

/**
* struct ps3_device_id - HV bus device identifier from the system repository
* @bus_id: HV bus id, {1..} (zero invalid)
Expand Down

0 comments on commit d4c0693

Please sign in to comment.