[Skiboot] [PATCH] fsp/tpo: Provide support for disabling TPO alarm

Vaibhav Jain vaibhav at linux.vnet.ibm.com
Fri May 19 19:49:09 AEST 2017


This patch adds support for disabling a preconfigured
Timed-Power-On(TPO) alarm on FSP based systems. Presently once a TPO alarm
is configured from the kernel it will be triggered even if its
subsequently disabled.

With this patch a TPO alarm can be disabled by passing
y_m_d==hr_min==0 to fsp_opal_tpo_write(). A branch is added to the
function to handle this case by sending FSP_CMD_TPO_DISABLE message to
the FSP instead of usual FSP_CMD_TPO_WRITE message. The kernel is
expected to call opal_tpo_write() with y_m_d==hr_min==0 to request
opal to disable TPO alarm.

Signed-off-by: Vaibhav Jain <vaibhav at linux.vnet.ibm.com>
---
 hw/fsp/fsp-rtc.c | 10 ++++++++--
 include/fsp.h    |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/fsp/fsp-rtc.c b/hw/fsp/fsp-rtc.c
index df0f679..2c8e663 100644
--- a/hw/fsp/fsp-rtc.c
+++ b/hw/fsp/fsp-rtc.c
@@ -427,9 +427,15 @@ static int64_t fsp_opal_tpo_write(uint64_t async_token, uint32_t y_m_d,
 	/* Create a request and send it.*/
 	attr->tpo_async_token = async_token;
 
-	prlog(PR_TRACE, "Sending TPO write request...\n");
+	/* check if this is a disable tpo request */
+	if (y_m_d == 0 && hr_min == 0) {
+		prlog(PR_TRACE, "Sending TPO disable request...\n");
+		msg = fsp_mkmsg(FSP_CMD_TPO_DISABLE, 0);
+	} else {
+		prlog(PR_TRACE, "Sending TPO write request...\n");
+		msg = fsp_mkmsg(FSP_CMD_TPO_WRITE, 2, y_m_d, hr_min);
+	}
 
-	msg = fsp_mkmsg(FSP_CMD_TPO_WRITE, 2, y_m_d, hr_min);
 	if (!msg) {
 		prerror("TPO: Failed to create message for WRITE to FSP\n");
 		free(attr);
diff --git a/include/fsp.h b/include/fsp.h
index e7f6a7b..1d877d8 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -350,6 +350,7 @@
 #define FSP_CMD_HYP_MDST_TABLE	0x1ce2600 /* HV->FSP: Sapphire MDST table */
 #define FSP_CMD_TPO_READ	0x1ce4201 /* FSP->HV */
 #define FSP_CMD_TPO_WRITE	0x1ce4301 /* HV->FSP */
+#define FSP_CMD_TPO_DISABLE	0x1ce4400 /* HV->FSP */
 #define FSP_CMD_STATUS_REQ	0x1ce4800 /* HV->FSP: Request normal panel status */
 #define FSP_CMD_STATUS_EX1_REQ	0x1ce4802 /* HV->FSP: Request extended 1 panel status */
 #define FSP_CMD_STATUS_EX2_REQ	0x1ce4803 /* HV->FSP: Request extended 2 panel status */
-- 
2.9.3



More information about the Skiboot mailing list