qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kowal <kowal@linux.ibm.com>
To: "Aditya Gupta" <adityag@linux.ibm.com>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Gautam Menghani <gautam@linux.ibm.com>,
	Miles Glenn <milesg@linux.ibm.com>,
	Ganesh Goudar <ganeshgr@linux.ibm.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [PATCH v10 5/8] ppc/pnv: Add PHB5 PCIe Host bridge to Power11
Date: Mon, 6 Oct 2025 10:47:21 -0500	[thread overview]
Message-ID: <6b3127a8-7fe6-4eb5-9c77-0b0138fb2505@linux.ibm.com> (raw)
In-Reply-To: <20250925173049.891406-6-adityag@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 4900 bytes --]


On 9/25/2025 12:30 PM, Aditya Gupta wrote:
> Power11 also uses PHB5, same as Power10.
>
> Add Power11 PHBs with similar code as the corresponding Power10 implementation.

Reviewed-by: Michael Kowal<kowal@linux.ibm.com>

> Reviewed-by: Cédric Le Goater<clg@redhat.com>
> Signed-off-by: Aditya Gupta<adityag@linux.ibm.com>
> ---
>   hw/ppc/pnv.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 8097d3c09a2f..2b4df6076c4c 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -978,6 +978,8 @@ static void pnv_chip_power11_pic_print_info(PnvChip *chip, GString *buf)
>   
>       pnv_xive2_pic_print_info(&chip11->xive, buf);
>       pnv_psi_pic_print_info(&chip11->psi, buf);
> +    object_child_foreach_recursive(OBJECT(chip),
> +                         pnv_chip_power9_pic_print_info_child, buf);
>   }
>   
>   /* Always give the first 1GB to chip 0 else we won't boot */
> @@ -2473,6 +2475,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
>   
>   static void pnv_chip_power11_instance_init(Object *obj)
>   {
> +    PnvChip *chip = PNV_CHIP(obj);
>       Pnv11Chip *chip11 = PNV11_CHIP(obj);
>       PnvChipClass *pcc = PNV_CHIP_GET_CLASS(obj);
>       int i;
> @@ -2495,6 +2498,13 @@ static void pnv_chip_power11_instance_init(Object *obj)
>       object_initialize_child(obj, "n1-chiplet", &chip11->n1_chiplet,
>                               TYPE_PNV_N1_CHIPLET);
>   
> +    chip->num_pecs = pcc->num_pecs;
> +
> +    for (i = 0; i < chip->num_pecs; i++) {
> +        object_initialize_child(obj, "pec[*]", &chip11->pecs[i],
> +                                TYPE_PNV_PHB5_PEC);
> +    }
> +
>       for (i = 0; i < pcc->i2c_num_engines; i++) {
>           object_initialize_child(obj, "i2c[*]", &chip11->i2c[i], TYPE_PNV_I2C);
>       }
> @@ -2527,6 +2537,38 @@ static void pnv_chip_power11_quad_realize(Pnv11Chip *chip11, Error **errp)
>       }
>   }
>   
> +static void pnv_chip_power11_phb_realize(PnvChip *chip, Error **errp)
> +{
> +    Pnv11Chip *chip11 = PNV11_CHIP(chip);
> +    int i;
> +
> +    for (i = 0; i < chip->num_pecs; i++) {
> +        PnvPhb4PecState *pec = &chip11->pecs[i];
> +        PnvPhb4PecClass *pecc = PNV_PHB4_PEC_GET_CLASS(pec);
> +        uint32_t pec_cplt_base;
> +        uint32_t pec_nest_base;
> +        uint32_t pec_pci_base;
> +
> +        object_property_set_int(OBJECT(pec), "index", i, &error_fatal);
> +        object_property_set_int(OBJECT(pec), "chip-id", chip->chip_id,
> +                                &error_fatal);
> +        object_property_set_link(OBJECT(pec), "chip", OBJECT(chip),
> +                                 &error_fatal);
> +        if (!qdev_realize(DEVICE(pec), NULL, errp)) {
> +            return;
> +        }
> +
> +        pec_cplt_base = pecc->xscom_cplt_base(pec);
> +        pec_nest_base = pecc->xscom_nest_base(pec);
> +        pec_pci_base = pecc->xscom_pci_base(pec);
> +
> +        pnv_xscom_add_subregion(chip, pec_cplt_base,
> +                 &pec->nest_pervasive.xscom_ctrl_regs_mr);
> +        pnv_xscom_add_subregion(chip, pec_nest_base, &pec->nest_regs_mr);
> +        pnv_xscom_add_subregion(chip, pec_pci_base, &pec->pci_regs_mr);
> +    }
> +}
> +
>   static void pnv_chip_power11_realize(DeviceState *dev, Error **errp)
>   {
>       PnvChipClass *pcc = PNV_CHIP_GET_CLASS(dev);
> @@ -2664,7 +2706,12 @@ static void pnv_chip_power11_realize(DeviceState *dev, Error **errp)
>       pnv_xscom_add_subregion(chip, PNV11_XSCOM_N1_PB_SCOM_ES_BASE,
>                              &chip11->n1_chiplet.xscom_pb_es_mr);
>   
> -    /* WIP: PHB added in future patch */
> +    /* PHBs */
> +    pnv_chip_power11_phb_realize(chip, &local_err);
> +    if (local_err) {
> +        error_propagate(errp, local_err);
> +        return;
> +    }
>   
>       /*
>        * I2C
> @@ -2799,6 +2846,7 @@ static void pnv_chip_power11_class_init(ObjectClass *klass, const void *data)
>       k->xscom_core_base = pnv_chip_power11_xscom_core_base;
>       k->xscom_pcba = pnv_chip_power11_xscom_pcba;
>       dc->desc = "PowerNV Chip Power11";
> +    k->num_pecs = PNV10_CHIP_MAX_PEC;
>       k->i2c_num_engines = PNV10_CHIP_MAX_I2C;
>       k->i2c_ports_per_engine = i2c_ports_per_engine;
>   
> @@ -3365,6 +3413,13 @@ static void pnv_machine_power11_class_init(ObjectClass *oc, const void *data)
>       XiveFabricClass *xfc = XIVE_FABRIC_CLASS(oc);
>       static const char compat[] = "qemu,powernv11\0ibm,powernv";
>   
> +    static GlobalProperty phb_compat[] = {
> +        { TYPE_PNV_PHB, "version", "5" },
> +        { TYPE_PNV_PHB_ROOT_PORT, "version", "5" },
> +    };
> +
> +    compat_props_add(mc->compat_props, phb_compat, G_N_ELEMENTS(phb_compat));
> +
>       pmc->compat = compat;
>       pmc->compat_size = sizeof(compat);
>       pmc->max_smt_threads = 4;

[-- Attachment #2: Type: text/html, Size: 5558 bytes --]

  reply	other threads:[~2025-10-06 15:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 17:30 [PATCH v10 0/8] Power11 support for QEMU [PowerNV] Aditya Gupta
2025-09-25 17:30 ` [PATCH v10 1/8] ppc/pnv: Introduce Pnv11Chip Aditya Gupta
2025-10-06 15:45   ` Mike Kowal
2025-10-06 18:24     ` Aditya Gupta
2025-10-07  5:40       ` Cédric Le Goater
2025-09-25 17:30 ` [PATCH v10 2/8] ppc/pnv: Introduce Power11 PowerNV machine Aditya Gupta
2025-10-06 15:45   ` Mike Kowal
2025-09-25 17:30 ` [PATCH v10 3/8] ppc/pnv: Add PnvChipClass handler to get reference to interrupt controller Aditya Gupta
2025-09-25 21:02   ` Cédric Le Goater
2025-09-27 13:25     ` Aditya Gupta
2025-10-06 15:46   ` Mike Kowal
2025-09-25 17:30 ` [PATCH v10 4/8] ppc/pnv: Add XIVE2 controller to Power11 Aditya Gupta
2025-10-06 15:46   ` Mike Kowal
2025-09-25 17:30 ` [PATCH v10 5/8] ppc/pnv: Add PHB5 PCIe Host bridge " Aditya Gupta
2025-10-06 15:47   ` Mike Kowal [this message]
2025-09-25 17:30 ` [PATCH v10 6/8] ppc/pnv: Add ChipTOD model for Power11 Aditya Gupta
2025-10-06 15:47   ` Mike Kowal
2025-09-25 17:30 ` [PATCH v10 7/8] tests/powernv: Switch to buildroot images instead of op-build Aditya Gupta
2025-09-25 17:30 ` [PATCH v10 8/8] tests/powernv: Add PowerNV test for Power11 Aditya Gupta
2025-09-25 21:12 ` [PATCH v10 0/8] Power11 support for QEMU [PowerNV] Cédric Le Goater
2025-09-27 13:28   ` Aditya Gupta
2025-09-28 16:34 ` Amit Machhiwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b3127a8-7fe6-4eb5-9c77-0b0138fb2505@linux.ibm.com \
    --to=kowal@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=ganeshgr@linux.ibm.com \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).