aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorVaidyanathan Srinivasan <svaidy@linux.ibm.com>2021-08-04 12:51:35 +0530
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2021-08-06 12:33:58 +0530
commit4ed9a073fd3c3af776af643fa021e145e08ef55e (patch)
tree3b5c7a7f7e0f1c0168486d299b63ae642a217890 /hw
parent545391ffd6b791474e5e7b1231738a1cb19a6cf8 (diff)
downloadskiboot-4ed9a073fd3c3af776af643fa021e145e08ef55e.zip
skiboot-4ed9a073fd3c3af776af643fa021e145e08ef55e.tar.gz
skiboot-4ed9a073fd3c3af776af643fa021e145e08ef55e.tar.bz2
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 <svaidy@linux.ibm.com> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xive2.c27
1 files changed, 24 insertions, 3 deletions
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 <bitmap.h>
#include <buddy.h>
#include <phys-map.h>
+#include <p10_stop_api.H>
/* 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)