[Skiboot] [PATCH] hw/sbe: Add SBE quirk for mambo and awan
Nicholas Piggin
npiggin at gmail.com
Wed Jan 15 12:50:08 AEDT 2025
There appears to be no device-tree test for the P9 SBE presence like
there is for P8. The P9 device tree test looks for the "primary"
property, but this doesn't really test SBE presence because all chips
have an SBE. It just happens to work because mambo must not add that
property.
So add a platform quirk, and mark mambo and awan as not having SBE.
This is needed for a later change that runs a health check on every
SBE in the system.
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
This should be applied before the sbe timers series, and solves the
mambo crash.
Thanks,
Nick
core/chip.c | 4 ++--
hw/sbe-p8.c | 3 +++
hw/sbe-p9.c | 5 ++++-
include/chip.h | 1 +
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/core/chip.c b/core/chip.c
index 73c6f3077..e20370bdb 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -148,7 +148,7 @@ void init_chips(void)
if (dt_find_by_path(dt_root, "/mambo")) {
proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_MAMBO_CALLOUTS
| QUIRK_NO_F000F | QUIRK_NO_PBA | QUIRK_NO_OCC_IRQ
- | QUIRK_NO_RNG | QUIRK_NO_DIRECT_CTL;
+ | QUIRK_NO_RNG | QUIRK_NO_DIRECT_CTL | QUIRK_NO_SBE;
enable_mambo_console();
@@ -176,7 +176,7 @@ void init_chips(void)
model_type = dt_prop_get_def(xn, "device_type", (void *)"core");
if (strcmp(model_type, "core") == 0) {
proc_chip_quirks |= QUIRK_NO_RNG | QUIRK_NO_CHIPTOD
- | QUIRK_NO_F000F;
+ | QUIRK_NO_F000F | QUIRK_NO_SBE;
}
prlog(PR_NOTICE, "CHIP: Detected Awan emulator %s model\n",
model_type);
diff --git a/hw/sbe-p8.c b/hw/sbe-p8.c
index 70edec65e..2ec86ce2a 100644
--- a/hw/sbe-p8.c
+++ b/hw/sbe-p8.c
@@ -168,6 +168,9 @@ void p8_sbe_init_timer(void)
int64_t rc;
uint32_t tick_us;
+ if (proc_gen != proc_gen_p8 || chip_quirk(QUIRK_NO_SBE))
+ return;
+
np = dt_find_compatible_node(dt_root, NULL, "ibm,power8-sbe-timer");
if (!np)
return;
diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c
index 3b0f8b06e..7a5f53912 100644
--- a/hw/sbe-p9.c
+++ b/hw/sbe-p9.c
@@ -928,7 +928,7 @@ void p9_sbe_init(void)
struct proc_chip *chip;
struct p9_sbe *sbe;
- if (proc_gen < proc_gen_p9)
+ if (proc_gen < proc_gen_p9 || chip_quirk(QUIRK_NO_SBE))
return;
dt_for_each_compatible(dt_root, xn, "ibm,xscom") {
@@ -970,6 +970,9 @@ void p9_sbe_terminate(void)
u64 wait_tb;
struct proc_chip *chip;
+ if (proc_gen < proc_gen_p9 || chip_quirk(QUIRK_NO_SBE))
+ return;
+
/* Return if MPIPL is not supported */
if (!is_mpipl_enabled())
return;
diff --git a/include/chip.h b/include/chip.h
index c90b8a7fe..92e026545 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -188,6 +188,7 @@ enum proc_chip_quirks {
QUIRK_QEMU = 0x00000200,
QUIRK_AWAN = 0x00000400,
QUIRK_BML = 0x00000800,
+ QUIRK_NO_SBE = 0x00001000,
};
extern enum proc_chip_quirks proc_chip_quirks;
--
2.45.2
More information about the Skiboot
mailing list