[Skiboot] [PATCH v2 3/6] plat/qemu: add support for Power11 platform
Cédric Le Goater
clg at kaod.org
Mon Feb 3 18:19:22 AEDT 2025
Hello Mahesh,
On 2/3/25 07:16, Mahesh Salgaonkar wrote:
> From: Aditya Gupta <adityag at linux.ibm.com>
>
> 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 c4a30de40e..4bccdc3ea4 100644
> --- a/core/chip.c
> +++ b/core/chip.c
> @@ -206,6 +206,7 @@ void init_chips(void)
> } else if (dt_node_is_compatible(dt_root, "qemu,powernv") ||
> dt_node_is_compatible(dt_root, "qemu,powernv8") ||
> dt_node_is_compatible(dt_root, "qemu,powernv9") ||
> + dt_node_is_compatible(dt_root, "qemu,powernv11") ||
I am surprised here. Why isn't there a "qemu,powernv10" case ?
> 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 c39e70c5fc..22f1d1c8c2 100644
> --- a/hw/psi.c
> +++ b/hw/psi.c
> @@ -1045,6 +1045,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;
> + }
> +
This could be a little helper.
Thanks,
C.
> 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,
> +};
More information about the Skiboot
mailing list