[Skiboot] [PATCH v2 3/6] plat/qemu: add support for Power11 platform
Mahesh J Salgaonkar
mahesh at linux.ibm.com
Tue Feb 4 00:48:24 AEDT 2025
On 2025-02-03 08:19:22 Mon, Cédric Le Goater wrote:
> 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 ?
It is there in if case. It is moved there by upstream commit 3abb2f4f70
("platforms/qemu: QEMU now has support for direct controls on Power10")
/* Detect Qemu */
if (dt_node_is_compatible(dt_root, "qemu,powernv10")) {
/* POWER10 has direct controls */
proc_chip_quirks |= QUIRK_QEMU | QUIRK_NO_RNG;
prlog(PR_NOTICE, "CHIP: Detected QEMU simulator\n");
} 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 could move powernv11 check also in if case, but I need to test direct
controls for qemu powernv11 before I move it there.
>
>
> > 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.
Sure, will add.
Thanks Cedric for your review.
Thanks,
-Mahesh.
More information about the Skiboot
mailing list