aboutsummaryrefslogtreecommitdiff
path: root/hw/xive.c
diff options
context:
space:
mode:
authorAkshay Adiga <akshay.adiga@linux.vnet.ibm.com>2018-01-04 16:58:05 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-01-14 21:05:51 -0600
commitc613c2fb9b826b0eff2d28c23f3ec47a2ab3c410 (patch)
treeb16c1f09e316d338b9ef23bf9d4c97aa306a73a0 /hw/xive.c
parente5c663c3f6debd5164cfced486fa926ab57b3656 (diff)
downloadskiboot-c613c2fb9b826b0eff2d28c23f3ec47a2ab3c410.zip
skiboot-c613c2fb9b826b0eff2d28c23f3ec47a2ab3c410.tar.gz
skiboot-c613c2fb9b826b0eff2d28c23f3ec47a2ab3c410.tar.bz2
SCOM restore for DARN and XIVE
While waking up from stop11, we want NCU_DARN_BAR to have enable bit set. Without this stop_api call, the value restored is without enable bit set. We loose NCU_SPEC_BAR when the quad goes into stop11, stop_api will restore while waking up from stop11. Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/xive.c')
-rw-r--r--hw/xive.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/hw/xive.c b/hw/xive.c
index dff94ab..271256b 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -24,6 +24,7 @@
#include <bitmap.h>
#include <buddy.h>
#include <phys-map.h>
+#include <p9_stop_api.H>
/* Use Block group mode to move chip_id into block .... */
#define USE_BLOCK_GROUP_MODE
@@ -3215,6 +3216,35 @@ static void xive_configure_ex_special_bar(struct xive *x, struct cpu_thread *c)
}
}
+void xive_late_init(void)
+{
+ struct cpu_thread *c;
+
+ prlog(PR_NOTICE, "SLW: Configuring self-restore for NCU_SPEC_BAR\n");
+ for_each_present_cpu(c) {
+ if(cpu_is_thread0(c)) {
+ struct proc_chip *chip = get_chip(c->chip_id);
+ struct xive *x = chip->xive;
+ uint64_t xa, val, rc;
+ xa = XSCOM_ADDR_P9_EX(pir_to_core_id(c->pir),
+ P9X_EX_NCU_SPEC_BAR);
+ val = (uint64_t)x->tm_base | P9X_EX_NCU_SPEC_BAR_ENABLE;
+ /* Bail out if wakeup engine has already failed */
+ if ( wakeup_engine_state != WAKEUP_ENGINE_PRESENT) {
+ prlog(PR_ERR, "XIVE p9_stop_api fail detected\n");
+ break;
+ }
+ rc = p9_stop_save_scom((void *)chip->homer_base, xa, val,
+ P9_STOP_SCOM_REPLACE, P9_STOP_SECTION_EQ_SCOM);
+ if (rc) {
+ xive_cpu_err(c, "p9_stop_api failed for NCU_SPEC_BAR rc=%lld\n",
+ rc);
+ wakeup_engine_state = WAKEUP_ENGINE_FAILED;
+ }
+ }
+ }
+
+}
static void xive_provision_cpu(struct xive_cpu_state *xs, struct cpu_thread *c)
{
struct xive *x;