From 4ed9a073fd3c3af776af643fa021e145e08ef55e Mon Sep 17 00:00:00 2001 From: Vaidyanathan Srinivasan Date: Wed, 4 Aug 2021 12:51:35 +0530 Subject: xive2: Add NCU_SPEC_BAR to stop engine for restore P10 Stop engines have apis similar to P9 to set xscom restores after wakeup from deep-sleep states. This xscom restore will be used to support STOP11 on P10. Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Pratik Rajesh Sampat Signed-off-by: Vasant Hegde --- hw/xive2.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'hw') diff --git a/hw/xive2.c b/hw/xive2.c index 05c5273..d5814bc 100644 --- a/hw/xive2.c +++ b/hw/xive2.c @@ -20,6 +20,7 @@ #include #include #include +#include /* Verbose debug */ @@ -3013,10 +3014,30 @@ static void xive_configure_ex_special_bar(struct xive *x, struct cpu_thread *c) void xive2_late_init(void) { + struct cpu_thread *c; + prlog(PR_INFO, "SLW: Configuring self-restore for NCU_SPEC_BAR\n"); - /* - * TODO (p10): need P10 stop state engine and fix for STOP11 - */ + 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_P10_NCU(pir_to_core_id(c->pir), P10_NCU_SPEC_BAR); + val = (uint64_t)x->tm_base | P10_NCU_SPEC_BAR_ENABLE; + /* Bail out if wakeup engine has already failed */ + if (wakeup_engine_state != WAKEUP_ENGINE_PRESENT) { + prlog(PR_ERR, "XIVE proc_stop_api fail detected\n"); + break; + } + rc = proc_stop_save_scom((void *)chip->homer_base, xa, val, + PROC_STOP_SCOM_REPLACE, PROC_STOP_SECTION_L3); + if (rc) { + xive_cpu_err(c, "proc_stop_save_scom 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) -- cgit v1.1