[Skiboot] [PATCH 3/4] plat/qemu: add support for Power11 platform

Mahesh Salgaonkar mahesh at linux.ibm.com
Thu Apr 4 16:56:17 AEDT 2024


Add support for QEMU simulator for Power11 when it starts supporting
"qemu,powernv11" machines.

Signed-off-by: Aditya Gupta <adityag at linux.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh at linux.ibm.com>
---
 core/chip.c           |  1 +
 hw/psi.c              |  2 ++
 hw/xscom.c            | 16 ++++++++++++++--
 platforms/qemu/qemu.c | 23 +++++++++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/core/chip.c b/core/chip.c
index 2576e27a34..b38bb21d6d 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -203,6 +203,7 @@ void init_chips(void)
 	    dt_node_is_compatible(dt_root, "qemu,powernv8") ||
 	    dt_node_is_compatible(dt_root, "qemu,powernv9") ||
 	    dt_node_is_compatible(dt_root, "qemu,powernv10") ||
+	    dt_node_is_compatible(dt_root, "qemu,powernv11") ||
 	    dt_find_by_path(dt_root, "/qemu")) {
 		proc_chip_quirks |= QUIRK_QEMU | QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
 		prlog(PR_NOTICE, "CHIP: Detected QEMU simulator\n");
diff --git a/hw/psi.c b/hw/psi.c
index 75a123948d..dde8e7ef34 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -1027,6 +1027,8 @@ static bool psi_init_psihb(struct dt_node *psihb)
 		psi = psi_probe_p9(chip, base);
 	else if (dt_node_is_compatible(psihb, "ibm,power10-psihb-x"))
 		psi = psi_probe_p10(chip, base);
+	else if (dt_node_is_compatible(psihb, "ibm,power11-psihb-x"))
+		psi = psi_probe_p10(chip, base);
 	else {
 		prerror("PSI: Unknown processor type\n");
 		return false;
diff --git a/hw/xscom.c b/hw/xscom.c
index ca8ebe557e..3f9a238be4 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -846,6 +846,7 @@ static uint8_t xscom_get_ec_rev(struct proc_chip *chip)
 {
 	uint64_t ecid2 = 0;
 	int8_t rev;
+	int8_t proc_gen_num;
 	const int8_t *table;
 	/*                             0   1   2   3   4   5   6   7 */
 	const int8_t p9table[8] =     {0,  1, -1,  2, -1, -1, -1,  3};
@@ -876,8 +877,19 @@ static uint8_t xscom_get_ec_rev(struct proc_chip *chip)
 	if (rev < 0)
 		return 0;
 
+	switch (proc_gen) {
+	case proc_gen_p9:
+		proc_gen_num = 9; break;
+	case proc_gen_p10:
+		proc_gen_num = 10; break;
+	case proc_gen_p11:
+		proc_gen_num = 11; break;
+	default:
+		proc_gen_num = -1; break;
+	}
+
 	prlog(PR_INFO, "P%d DD%i.%i%d detected\n",
-			proc_gen == proc_gen_p9 ? 9 : 10,
+			proc_gen_num,
 			0xf & (chip->ec_level >> 4),
 			chip->ec_level & 0xf,
 			rev);
@@ -980,7 +992,7 @@ void xscom_init(void)
 		const char *chip_name;
 		static const char *chip_names[] = {
 			"UNKNOWN", "P8E", "P8", "P8NVL", "P9N", "P9C", "P9P",
-			"P10",
+			"P10", "P11",
 		};
 
 		chip = get_chip(gcid);
diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c
index 0f6e089fa7..c6c6a50072 100644
--- a/platforms/qemu/qemu.c
+++ b/platforms/qemu/qemu.c
@@ -76,6 +76,11 @@ static bool qemu_probe_powernv10(void)
 	return qemu_probe_common("qemu,powernv10");
 }
 
+static bool qemu_probe_powernv11(void)
+{
+	return qemu_probe_common("qemu,powernv11");
+}
+
 static void qemu_init(void)
 {
 	if (!bt_device_present) {
@@ -156,3 +161,21 @@ DECLARE_PLATFORM(qemu_powernv10) = {
 	.exit			= astbmc_exit,
 	.terminate	= ipmi_terminate,
 };
+
+/*
+ * For a QEMU PowerNV machine using Power11 CPUs
+ */
+DECLARE_PLATFORM(qemu_powernv11) = {
+	.name		= "QEMU Power11",
+	.probe		= qemu_probe_powernv11,
+	.bmc		= &bmc_plat_ast2600_openbmc,
+	.init		= qemu_init,
+	.external_irq   = astbmc_ext_irq_serirq_cpld,
+	.cec_power_down = astbmc_ipmi_power_down,
+	.cec_reboot     = astbmc_ipmi_reboot,
+	.pci_get_slot_info = slot_table_get_slot_info,
+	.start_preload_resource	= flash_start_preload_resource,
+	.resource_loaded	= flash_resource_loaded,
+	.exit			= astbmc_exit,
+	.terminate	= ipmi_terminate,
+};
-- 
2.44.0



More information about the Skiboot mailing list