aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-09-21 19:49:47 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-09-27 23:02:52 -0500
commite2ab540ac169cac9737ff09605182a333086f848 (patch)
tree21ab89d480276a6881cb33bdce2da9f003fbb4fe /external
parentcb99c9d8bb8b59d2d10fe4088f50a2893643a94d (diff)
downloadskiboot-e2ab540ac169cac9737ff09605182a333086f848.zip
skiboot-e2ab540ac169cac9737ff09605182a333086f848.tar.gz
skiboot-e2ab540ac169cac9737ff09605182a333086f848.tar.bz2
opal-prd: Fix occ_reset call
HBRT OCC reset interface depends on service processor type. FSP -> reset_pm_complex() BMC -> process_occ_reset() This patch adds logic to detect service processor type and then make appropriate occ reset call. CC: Jeremy Kerr <jk@ozlabs.org> CC: Daniel M Crowell <dcrowell@us.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/opal-prd/opal-prd.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index a09a636..20ce5da 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -246,6 +246,21 @@ static void pr_log_daemon_init(void)
}
}
+/* Check service processor type */
+static bool is_fsp_system(void)
+{
+ char *path;
+ int rc;
+
+ rc = asprintf(&path, "%s/fsps", devicetree_base);
+ if (rc < 0) {
+ pr_log(LOG_ERR, "FW: error creating '/fsps' path %m");
+ return false;
+ }
+
+ return access(path, F_OK) ? false : true;
+}
+
/**
* ABI check that we can't perform at build-time: we want to ensure that the
* layout of struct host_interfaces matches that defined in the thunk.
@@ -1336,18 +1351,27 @@ static int pm_complex_reset(uint64_t chip)
{
int rc;
- if (hservice_runtime->reset_pm_complex) {
+ /*
+ * FSP system -> reset_pm_complex
+ * BMC system -> process_occ_reset
+ */
+ if (is_fsp_system()) {
+ if (!hservice_runtime->reset_pm_complex) {
+ pr_log_nocall("reset_pm_complex");
+ return -1;
+ }
+
pr_debug("PM: calling pm_complex_reset(%ld)", chip);
rc = call_reset_pm_complex(chip);
+ } else {
+ if (!hservice_runtime->process_occ_reset) {
+ pr_log_nocall("process_occ_reset");
+ return -1;
+ }
- } else if (hservice_runtime->process_occ_reset) {
pr_debug("PM: calling process_occ_reset(%ld)", chip);
call_process_occ_reset(chip);
rc = 0;
-
- } else {
- pr_log_nocall("reset_pm_complex/process_occ_reset");
- rc = -1;
}
return rc;