aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2014-11-22 00:09:17 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-11-25 17:34:23 +1100
commit94c28c57e04df684c9c09b651937d7fbc7868b84 (patch)
tree19f45f62d103fcb1eec5a0d4890cf7cfd5e0bb98
parent73cd106cdfd9f6629e8ab720792f68d70ddf5b72 (diff)
downloadskiboot-94c28c57e04df684c9c09b651937d7fbc7868b84.zip
skiboot-94c28c57e04df684c9c09b651937d7fbc7868b84.tar.gz
skiboot-94c28c57e04df684c9c09b651937d7fbc7868b84.tar.bz2
occ/hbrt: Call stopOCC() for implementing reset OCC command from FSP
OPAL is expected to leave OCC stopped after receiving reset OCC message from FSP. FSP will send this either at boot before a load/start, or during runtime before load/start. If there is no subsequent load/start command, the OCC can be left stopped. After few attempts (runtime reset), FSP can just send reset and expect OPAL to leave OCC in stopped state. Call HBRT to stop OCC on FSP reset OCC command and acknowledge. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/hostservices.c29
-rw-r--r--hw/occ.c9
-rw-r--r--include/hostservices.h1
3 files changed, 37 insertions, 2 deletions
diff --git a/core/hostservices.c b/core/hostservices.c
index 85e62e3..0cd4b6a 100644
--- a/core/hostservices.c
+++ b/core/hostservices.c
@@ -758,6 +758,35 @@ int host_services_occ_start(void)
return rc;
}
+int host_services_occ_stop(void)
+{
+ struct proc_chip *chip;
+ int i, rc = 0, nr_chips=0;
+ uint64_t chipids[MAX_CHIPS];
+
+ prlog(PR_INFO, "HBRT: OCC Stop requested\n");
+
+ if (!(hservice_runtime && hservice_runtime->stopOCCs)) {
+ prerror("HBRT: No hservice_runtime->stopOCCs\n");
+ return -ENOENT;
+ }
+
+ for_each_chip(chip) {
+ chipids[nr_chips++] = chip->id;
+ }
+
+ for (i = 0; i < nr_chips; i++)
+ prlog(PR_TRACE, "HBRT: Calling stopOCC() for %04llx ",
+ chipids[i]);
+
+ /* Lets STOP all OCC */
+ rc = hservice_runtime->stopOCCs(chipids, nr_chips);
+ hservice_mark();
+ prlog(PR_DEBUG, "HBRT: stopOCCs() rc = %d\n", rc);
+ return rc;
+}
+
+
void host_services_occ_base_setup(void)
{
struct proc_chip *chip;
diff --git a/hw/occ.c b/hw/occ.c
index d54e206..c3c61e3 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -388,8 +388,13 @@ static void occ_do_reset(u8 scope, u32 dbob_id, u32 seq_id)
if (err)
return;
- /* Call HBRT... */
- rc = host_services_occ_start();
+ /*
+ * Call HBRT to stop OCC and leave it stopped. FSP will send load/start
+ * request subsequently. Also after few runtime restarts (currently 3),
+ * FSP will request OCC to left in stopped state.
+ */
+
+ rc = host_services_occ_stop();
/* Handle fallback to preload */
if (rc == -ENOENT && chip->homer_base) {
diff --git a/include/hostservices.h b/include/hostservices.h
index 23e2a83..7279c8e 100644
--- a/include/hostservices.h
+++ b/include/hostservices.h
@@ -21,6 +21,7 @@ bool hservices_init(void);
int host_services_occ_load(void);
int host_services_occ_start(void);
+int host_services_occ_stop(void);
void host_services_occ_base_setup(void);
/* No LID can be larger than 16M, but OCC lid is less than 1 MB */