hw/sbe: Add SBE quirk for mambo and awan
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@gmail.com>
[arbab: Add #include <chip.h>]
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
diff --git a/core/chip.c b/core/chip.c
index 73c6f30..e20370b 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -148,7 +148,7 @@
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 @@
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 70edec6..c2cf5d2 100644
--- a/hw/sbe-p8.c
+++ b/hw/sbe-p8.c
@@ -5,6 +5,7 @@
* Copyright 2013-2018 IBM Corp.
*/
+#include <chip.h>
#include <device.h>
#include <sbe.h>
#include <sbe-p8.h>
@@ -168,6 +169,9 @@
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 3b0f8b0..7a5f539 100644
--- a/hw/sbe-p9.c
+++ b/hw/sbe-p9.c
@@ -928,7 +928,7 @@
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 @@
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 c90b8a7..92e0265 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -188,6 +188,7 @@
QUIRK_QEMU = 0x00000200,
QUIRK_AWAN = 0x00000400,
QUIRK_BML = 0x00000800,
+ QUIRK_NO_SBE = 0x00001000,
};
extern enum proc_chip_quirks proc_chip_quirks;