* [patch 1/6] PS3: Fix lpm set bookmark
[not found] <20080208224723.029462363@am.sony.com>
@ 2008-02-08 22:52 ` Geoff Levand
2008-02-08 22:52 ` [patch 2/6] PS3: Fix lpm read pm interval Geoff Levand
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, Takashi Yamamoto
From: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Fix the ps3_set_bookmark() routine of the PS3 logical performance
monitor driver.
To properly set a performance monitor bookmark the Cell processor
requires no instruction branches near the setting of the bookmark
SPR. Testing showed that the use of the db10cyc instruction did
not work correctly. This change replaces the db10cyc instruction
with 10 nop instructions.
Signed-off-by: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/ps3/ps3-lpm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/ps3/ps3-lpm.c
+++ b/drivers/ps3/ps3-lpm.c
@@ -181,9 +181,9 @@ void ps3_set_bookmark(u64 bookmark)
* includes cycles before the call.
*/
- asm volatile("or 29, 29, 29;"); /* db10cyc */
+ asm volatile("nop;nop;nop;nop;nop;nop;nop;nop;nop;");
mtspr(SPRN_BKMK, bookmark);
- asm volatile("or 29, 29, 29;"); /* db10cyc */
+ asm volatile("nop;nop;nop;nop;nop;nop;nop;nop;nop;");
}
EXPORT_SYMBOL_GPL(ps3_set_bookmark);
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 2/6] PS3: Fix lpm read pm interval
[not found] <20080208224723.029462363@am.sony.com>
2008-02-08 22:52 ` [patch 1/6] PS3: Fix lpm set bookmark Geoff Levand
@ 2008-02-08 22:52 ` Geoff Levand
2008-02-08 22:52 ` [patch 3/6] PS3: Fix bootwrapper hang bug Geoff Levand
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, Takashi Yamamoto
From: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
ps3_read_pm (pm_interval) should return an actual HW register value
because the pm_interval register is a counter register.
This patch removes the shadow pm_interval register.
Signed-off-by: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/ps3/ps3-lpm.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
--- a/drivers/ps3/ps3-lpm.c
+++ b/drivers/ps3/ps3-lpm.c
@@ -76,7 +76,6 @@
*
* @pm_control: Shadow of the processor's pm_control register.
* @pm_start_stop: Shadow of the processor's pm_start_stop register.
- * @pm_interval: Shadow of the processor's pm_interval register.
* @group_control: Shadow of the processor's group_control register.
* @debug_bus_control: Shadow of the processor's debug_bus_control register.
*
@@ -91,7 +90,6 @@
struct ps3_lpm_shadow_regs {
u64 pm_control;
u64 pm_start_stop;
- u64 pm_interval;
u64 group_control;
u64 debug_bus_control;
};
@@ -408,7 +406,14 @@ u32 ps3_read_pm(u32 cpu, enum pm_reg_nam
case pm_start_stop:
return lpm_priv->shadow.pm_start_stop;
case pm_interval:
- return lpm_priv->shadow.pm_interval;
+ result = lv1_set_lpm_interval(lpm_priv->lpm_id, 0, 0, &val);
+ if (result) {
+ val = 0;
+ dev_dbg(sbd_core(), "%s:%u: lv1 set_inteval failed: "
+ "reg %u, %s\n", __func__, __LINE__, reg,
+ ps3_result(result));
+ }
+ return (u32)val;
case group_control:
return lpm_priv->shadow.group_control;
case debug_bus_control:
@@ -475,10 +480,8 @@ void ps3_write_pm(u32 cpu, enum pm_reg_n
lpm_priv->shadow.pm_control = val;
break;
case pm_interval:
- if (val != lpm_priv->shadow.pm_interval)
- result = lv1_set_lpm_interval(lpm_priv->lpm_id, val,
- PS3_WRITE_PM_MASK, &dummy);
- lpm_priv->shadow.pm_interval = val;
+ result = lv1_set_lpm_interval(lpm_priv->lpm_id, val,
+ PS3_WRITE_PM_MASK, &dummy);
break;
case pm_start_stop:
if (val != lpm_priv->shadow.pm_start_stop)
@@ -1140,7 +1143,6 @@ int ps3_lpm_open(enum ps3_lpm_tb_type tb
lpm_priv->shadow.pm_control = PS3_LPM_SHADOW_REG_INIT;
lpm_priv->shadow.pm_start_stop = PS3_LPM_SHADOW_REG_INIT;
- lpm_priv->shadow.pm_interval = PS3_LPM_SHADOW_REG_INIT;
lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT;
lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT;
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 3/6] PS3: Fix bootwrapper hang bug
[not found] <20080208224723.029462363@am.sony.com>
2008-02-08 22:52 ` [patch 1/6] PS3: Fix lpm set bookmark Geoff Levand
2008-02-08 22:52 ` [patch 2/6] PS3: Fix lpm read pm interval Geoff Levand
@ 2008-02-08 22:52 ` Geoff Levand
2008-02-08 22:52 ` [patch 4/6] PS3: Use system reboot on restart Geoff Levand
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Fix a bug in the lv1_get_repository_node_value() routine of the PS3
bootwrapper. Changes in the PS3 system firmware 2.20 cause this bug
to hang the system when branching from the bootwrapper to the kernel
_start.
Since the video system has not yet been enabled at the time
the bug is hit, the system hangs with a blank screen. Earlier
firmwares don't cause such a catastrophic failure, and so this
bug went undetected.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/boot/ps3-hvcall.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/boot/ps3-hvcall.S
+++ b/arch/powerpc/boot/ps3-hvcall.S
@@ -145,7 +145,7 @@
.macro STORE_REGS_5_2
lwz r11, 16(r1)
std r4, 0(r11)
- lwz r11, 24(r1)
+ lwz r11, 20(r1)
std r5, 0(r11)
.endm
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 4/6] PS3: Use system reboot on restart
[not found] <20080208224723.029462363@am.sony.com>
` (2 preceding siblings ...)
2008-02-08 22:52 ` [patch 3/6] PS3: Fix bootwrapper hang bug Geoff Levand
@ 2008-02-08 22:52 ` Geoff Levand
2008-02-08 22:53 ` [patch 5/6] PS3: Sys-manager code cleanup Geoff Levand
2008-02-08 22:53 ` [patch 6/6] PS3: Update sys-manager button events Geoff Levand
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
The PS3 Other OS boot flag is not checked when an LPAR reboot is done,
so the ps3-boot-game-os utility fails to reboot the system into the
Game OS. This fix changes the PS3 restart handler from requesting an
PS3_SM_NEXT_OP_LPAR_REBOOT to requesting an PS3_SM_NEXT_OP_SYS_REBOOT.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/ps3/ps3-sys-manager.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -622,7 +622,7 @@ static void ps3_sys_manager_final_restar
ps3_vuart_cancel_async(dev);
ps3_sys_manager_send_attr(dev, 0);
- ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_LPAR_REBOOT,
+ ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
PS3_SM_WAKE_DEFAULT);
ps3_sys_manager_send_request_shutdown(dev);
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 5/6] PS3: Sys-manager code cleanup
[not found] <20080208224723.029462363@am.sony.com>
` (3 preceding siblings ...)
2008-02-08 22:52 ` [patch 4/6] PS3: Use system reboot on restart Geoff Levand
@ 2008-02-08 22:53 ` Geoff Levand
2008-02-08 22:53 ` [patch 6/6] PS3: Update sys-manager button events Geoff Levand
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:53 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
General code cleanups for PS3 system-manager:
o Move all MODULE_ macros to bottom.
o Correct PS3_SM_WAKE_P_O_R value.
o Enhance comment on wakeup source values.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/ps3/ps3-sys-manager.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -28,10 +28,6 @@
#include "vuart.h"
-MODULE_AUTHOR("Sony Corporation");
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("PS3 System Manager");
-
/**
* ps3_sys_manager - PS3 system manager driver.
*
@@ -181,7 +177,9 @@ enum ps3_sys_manager_next_op {
* @PS3_SM_WAKE_P_O_R: Power on reset.
*
* Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN.
- * System will always wake from the PS3_SM_WAKE_DEFAULT sources.
+ * The system will always wake from the PS3_SM_WAKE_DEFAULT sources.
+ * Sources listed here are the only ones available to guests in the
+ * other-os lpar.
*/
enum ps3_sys_manager_wake_source {
@@ -189,7 +187,7 @@ enum ps3_sys_manager_wake_source {
PS3_SM_WAKE_DEFAULT = 0,
PS3_SM_WAKE_RTC = 0x00000040,
PS3_SM_WAKE_RTC_ERROR = 0x00000080,
- PS3_SM_WAKE_P_O_R = 0x10000000,
+ PS3_SM_WAKE_P_O_R = 0x80000000,
};
/**
@@ -699,4 +697,7 @@ static int __init ps3_sys_manager_init(v
module_init(ps3_sys_manager_init);
/* Module remove not supported. */
+MODULE_AUTHOR("Sony Corporation");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 System Manager");
MODULE_ALIAS(PS3_MODULE_ALIAS_SYSTEM_MANAGER);
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 6/6] PS3: Update sys-manager button events
[not found] <20080208224723.029462363@am.sony.com>
` (4 preceding siblings ...)
2008-02-08 22:53 ` [patch 5/6] PS3: Sys-manager code cleanup Geoff Levand
@ 2008-02-08 22:53 ` Geoff Levand
5 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2008-02-08 22:53 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
PS3 firmware 1.94 added the source of power and reset events to the
payload of the system manager POWER_PRESSED and RESET_PRESSED events.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
drivers/ps3/ps3-sys-manager.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -138,9 +138,11 @@ enum ps3_sys_manager_attr {
/**
* enum ps3_sys_manager_event - External event type, reported by system manager.
- * @PS3_SM_EVENT_POWER_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_POWER_PRESSED: payload.value =
+ * enum ps3_sys_manager_button_event.
* @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec.
- * @PS3_SM_EVENT_RESET_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_RESET_PRESSED: payload.value =
+ * enum ps3_sys_manager_button_event.
* @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec.
* @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id.
* @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id.
@@ -158,6 +160,17 @@ enum ps3_sys_manager_event {
};
/**
+ * enum ps3_sys_manager_button_event - Button event payload values.
+ * @PS3_SM_BUTTON_EVENT_HARD: Hardware generated event.
+ * @PS3_SM_BUTTON_EVENT_SOFT: Software generated event.
+ */
+
+enum ps3_sys_manager_button_event {
+ PS3_SM_BUTTON_EVENT_HARD = 0,
+ PS3_SM_BUTTON_EVENT_SOFT = 1,
+};
+
+/**
* enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed.
*/
@@ -416,8 +429,10 @@ static int ps3_sys_manager_handle_event(
switch (event.type) {
case PS3_SM_EVENT_POWER_PRESSED:
- dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n",
- __func__, __LINE__);
+ dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n",
+ __func__, __LINE__,
+ (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
+ : "hard"));
ps3_sm_force_power_off = 1;
/*
* A memory barrier is use here to sync memory since
@@ -432,8 +447,10 @@ static int ps3_sys_manager_handle_event(
__func__, __LINE__, event.value);
break;
case PS3_SM_EVENT_RESET_PRESSED:
- dev_dbg(&dev->core, "%s:%d: RESET_PRESSED\n",
- __func__, __LINE__);
+ dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n",
+ __func__, __LINE__,
+ (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
+ : "hard"));
ps3_sm_force_power_off = 0;
/*
* A memory barrier is use here to sync memory since
--
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-08 23:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080208224723.029462363@am.sony.com>
2008-02-08 22:52 ` [patch 1/6] PS3: Fix lpm set bookmark Geoff Levand
2008-02-08 22:52 ` [patch 2/6] PS3: Fix lpm read pm interval Geoff Levand
2008-02-08 22:52 ` [patch 3/6] PS3: Fix bootwrapper hang bug Geoff Levand
2008-02-08 22:52 ` [patch 4/6] PS3: Use system reboot on restart Geoff Levand
2008-02-08 22:53 ` [patch 5/6] PS3: Sys-manager code cleanup Geoff Levand
2008-02-08 22:53 ` [patch 6/6] PS3: Update sys-manager button events Geoff Levand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).