public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: geoffrey.levand@am•sony.com
To: paulus@samba•org
Cc: linuxppc-dev@ozlabs•org
Subject: [patch 2/6] PS3: Remove unused os-area params
Date: Sat, 06 Oct 2007 14:35:44 -0700	[thread overview]
Message-ID: <20071006213542.595771597@am.sony.com> (raw)
In-Reply-To: 20071006213542.311447584@am.sony.com

Updates for PS3 os-area startup params
o Remove some unused PS3 os-area startup params from struct saved_params.
o Rename ps3_os_area_init() to ps3_os_area_save_params().
o Zero mirrored header after saving params.

Signed-off-by: Geoff Levand <geoffrey.levand@am•sony.com>
---
 arch/powerpc/platforms/ps3/os-area.c  |   44 ++++++++++++++--------------------
 arch/powerpc/platforms/ps3/platform.h |    2 -
 arch/powerpc/platforms/ps3/setup.c    |    2 -
 3 files changed, 21 insertions(+), 27 deletions(-)

--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -114,27 +114,12 @@ struct os_area_params {
 #define SECONDS_FROM_1970_TO_2000 946684800LL
 
 /**
- * struct saved_params - Static working copies of data from the 'Other OS' area.
- *
- * For the convinience of the guest, the HV makes a copy of the 'Other OS' area
- * in flash to a high address in the boot memory region and then puts that RAM
- * address and the byte count into the repository for retreval by the guest.
- * We copy the data we want into a static variable and allow the memory setup
- * by the HV to be claimed by the lmb manager.
+ * struct saved_params - Static working copies of data from the PS3 'os area'.
  */
 
 struct saved_params {
-	/* param 0 */
 	s64 rtc_diff;
 	unsigned int av_multi_out;
-	unsigned int ctrl_button;
-	/* param 1 */
-	u8 static_ip_addr[4];
-	u8 network_mask[4];
-	u8 default_gateway[4];
-	/* param 2 */
-	u8 dns_primary[4];
-	u8 dns_secondary[4];
 } static saved_params;
 
 #define dump_header(_a) _dump_header(_a, __func__, __LINE__)
@@ -201,7 +186,17 @@ static int __init verify_header(const st
 	return 0;
 }
 
-int __init ps3_os_area_init(void)
+/**
+ * ps3_os_area_save_params - Copy data from os area mirror to @saved_params.
+ *
+ * For the convenience of the guest, the HV makes a copy of the os area in
+ * flash to a high address in the boot memory region and then puts that RAM
+ * address and the byte count into the repository for retreval by the guest.
+ * We copy the data we want into a static variable and allow the memory setup
+ * by the HV to be claimed by the lmb manager.
+ */
+
+void __init ps3_os_area_save_params(void)
 {
 	int result;
 	u64 lpar_addr;
@@ -209,12 +204,14 @@ int __init ps3_os_area_init(void)
 	struct os_area_header *header;
 	struct os_area_params *params;
 
+	pr_debug(" -> %s:%d\n", __func__, __LINE__);
+
 	result = ps3_repository_read_boot_dat_info(&lpar_addr, &size);
 
 	if (result) {
 		pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n",
 			__func__, __LINE__);
-		return result;
+		return;
 	}
 
 	header = (struct os_area_header *)__va(lpar_addr);
@@ -226,7 +223,7 @@ int __init ps3_os_area_init(void)
 	if (result) {
 		pr_debug("%s:%d verify_header failed\n", __func__, __LINE__);
 		dump_header(header);
-		return -EIO;
+		return;
 	}
 
 	dump_header(header);
@@ -234,13 +231,10 @@ int __init ps3_os_area_init(void)
 
 	saved_params.rtc_diff = params->rtc_diff;
 	saved_params.av_multi_out = params->av_multi_out;
-	saved_params.ctrl_button = params->ctrl_button;
-	memcpy(saved_params.static_ip_addr, params->static_ip_addr, 4);
-	memcpy(saved_params.network_mask, params->network_mask, 4);
-	memcpy(saved_params.default_gateway, params->default_gateway, 4);
-	memcpy(saved_params.dns_secondary, params->dns_secondary, 4);
 
-	return result;
+	memset(header, 0, sizeof(*header));
+
+	pr_debug(" <- %s:%d\n", __func__, __LINE__);
 }
 
 /**
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -62,7 +62,7 @@ int ps3_set_rtc_time(struct rtc_time *ti
 
 /* os area */
 
-int __init ps3_os_area_init(void);
+void __init ps3_os_area_save_params(void);
 u64 ps3_os_area_rtc_diff(void);
 
 /* spu */
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -228,7 +228,7 @@ static int __init ps3_probe(void)
 
 	powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;
 
-	ps3_os_area_init();
+	ps3_os_area_save_params();
 	ps3_mm_init();
 	ps3_mm_vas_create(&htab_size);
 	ps3_hpte_init(htab_size);

-- 

  parent reply	other threads:[~2007-10-06 21:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-06 21:35 [patch 0/6] PS3 os area patches for 2.6.24 geoffrey.levand
2007-10-06 21:35 ` [patch 1/6] PS3: Cleanup of os-area.c geoffrey.levand
2007-10-06 21:35 ` geoffrey.levand [this message]
2007-10-08 14:00   ` [patch 2/6] PS3: Remove unused os-area params Ranulf Doswell
2007-10-08 17:53     ` Geoff Levand
2007-10-08 22:38       ` Ranulf Doswell
2007-10-08 22:50         ` Geoff Levand
2007-10-06 21:35 ` [patch 3/6] PS3: os-area workqueue processing geoffrey.levand
2007-10-06 21:35 ` [patch 4/6] PS3: Add os-area rtc_diff set/get routines geoffrey.levand
2007-10-06 21:35 ` [patch 5/6] PS3: Save os-area params to device tree geoffrey.levand
2007-10-06 21:35 ` [patch 6/6] PS3: Add os-area database routines geoffrey.levand
2007-10-08  8:27   ` Geert Uytterhoeven
2007-10-09  1:08     ` Geoff Levand
2007-10-08 12:16   ` Geert Uytterhoeven
2007-10-09  1:12     ` Geoff Levand
2007-10-08 13:48   ` Ranulf Doswell
2007-10-08 17:52     ` Geoff Levand
2007-10-08 22:59       ` Ranulf Doswell
2007-10-08 23:36         ` Geoff Levand
2007-10-09  9:35         ` Geert Uytterhoeven
2007-10-09 12:23           ` Ranulf Doswell
2007-10-09  1:07   ` [patch v2] " Geoff Levand
2007-10-09 11:38     ` Geert Uytterhoeven
2007-10-09 17:15     ` Linas Vepstas

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=20071006213542.595771597@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