From: Geoff Levand <geoffrey.levand@am•sony.com>
To: Paul Mackerras <paulus@samba•org>
Cc: linuxppc-dev@ozlabs•org
Subject: [PATCH 13/16] ps3: get firmware version
Date: Fri, 26 Jan 2007 19:08:21 -0800 [thread overview]
Message-ID: <45BAC225.7020209@am.sony.com> (raw)
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>
---
Changed from a struct to a union and got rid of the output to /proc/cpuinfo.
I'll look into arranging something in /proc/device-tree that userspace utils
can query.
arch/powerpc/platforms/ps3/setup.c | 20 ++++++++++++++++++++
include/asm-powerpc/ps3.h | 12 ++++++++++++
2 files changed, 32 insertions(+)
--- ps3-linux-dev.orig/arch/powerpc/platforms/ps3/setup.c
+++ ps3-linux-dev/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();
--- ps3-linux-dev.orig/include/asm-powerpc/ps3.h
+++ ps3-linux-dev/include/asm-powerpc/ps3.h
@@ -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)
next reply other threads:[~2007-01-27 3:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-27 3:08 Geoff Levand [this message]
2007-01-27 11:30 ` [PATCH 13/16] ps3: get firmware version Arnd Bergmann
2007-01-29 19:13 ` Geoff Levand
2007-01-29 21:22 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45BAC225.7020209@am.sony.com \
--to=geoffrey.levand@am$(echo .)sony.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox