[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/34] pnv_phb4_pec: use pnv_phb4_pec_get_phb_id() in pnv_pec_dt_x
From: |
Cédric Le Goater |
Subject: |
[PULL 28/34] pnv_phb4_pec: use pnv_phb4_pec_get_phb_id() in pnv_pec_dt_xscom() |
Date: |
Wed, 12 Jan 2022 12:55:45 +0100 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
Relying on stack->phb to write the xscom DT of the PEC is something that
we won't be able to do with user creatable pnv-phb4 devices.
Hopefully, this can be done by using pnv_phb4_pec_get_phb_id(), which is
already used by pnv_pec_realize() to set the phb-id of the stack. Use
the same idea in pnv_pec_dt_xscom() to write ibm,phb-index without the
need to accessing stack->phb, since stack->phb is not granted to be !=
NULL when user creatable phbs are introduced.
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220110143346.455901-4-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/pci-host/pnv_phb4_pec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 49360de8c858..d64310e7db1e 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -449,8 +449,7 @@ static int pnv_pec_dt_xscom(PnvXScomInterface *dev, void
*fdt,
pecc->compat_size)));
for (i = 0; i < pec->num_stacks; i++) {
- PnvPhb4PecStack *stack = &pec->stacks[i];
- PnvPHB4 *phb = &stack->phb;
+ int phb_id = pnv_phb4_pec_get_phb_id(pec, i);
int stk_offset;
name = g_strdup_printf("stack@%x", i);
@@ -460,7 +459,7 @@ static int pnv_pec_dt_xscom(PnvXScomInterface *dev, void
*fdt,
_FDT((fdt_setprop(fdt, stk_offset, "compatible", pecc->stk_compat,
pecc->stk_compat_size)));
_FDT((fdt_setprop_cell(fdt, stk_offset, "reg", i)));
- _FDT((fdt_setprop_cell(fdt, stk_offset, "ibm,phb-index",
phb->phb_id)));
+ _FDT((fdt_setprop_cell(fdt, stk_offset, "ibm,phb-index", phb_id)));
}
return 0;
--
2.31.1
- [PULL 27/34] pnv_phb4_pec.c: move pnv_pec_phb_offset() to pnv_phb4.c, (continued)
- [PULL 27/34] pnv_phb4_pec.c: move pnv_pec_phb_offset() to pnv_phb4.c, Cédric Le Goater, 2022/01/12
- [PULL 12/34] target/ppc: Add MSR_ILE support to ppc_interrupts_little_endian, Cédric Le Goater, 2022/01/12
- [PULL 11/34] target/ppc: Add HV support to ppc_interrupts_little_endian, Cédric Le Goater, 2022/01/12
- [PULL 21/34] ppc/pnv: Introduce support for user created PHB3 devices, Cédric Le Goater, 2022/01/12
- [PULL 32/34] ppc/pnv: Introduce user creatable pnv-phb4 devices, Cédric Le Goater, 2022/01/12
- [PULL 29/34] ppc/pnv: set phb4 properties in stk_realize(), Cédric Le Goater, 2022/01/12
- [PULL 26/34] pnv_phb4.c: change TYPE_PNV_PHB4_ROOT_BUS name, Cédric Le Goater, 2022/01/12
- [PULL 22/34] ppc/pnv: Reparent user created PHB3 devices to the PnvChip, Cédric Le Goater, 2022/01/12
- [PULL 19/34] pnv_phb4.c: make pnv-phb4-root-port user creatable, Cédric Le Goater, 2022/01/12
- [PULL 33/34] ppc/pnv: turn pnv_phb4_update_regions() into static, Cédric Le Goater, 2022/01/12
- [PULL 28/34] pnv_phb4_pec: use pnv_phb4_pec_get_phb_id() in pnv_pec_dt_xscom(),
Cédric Le Goater <=
- [PULL 34/34] ppc/pnv: use stack->pci_regs[] in pnv_pec_stk_pci_xscom_write(), Cédric Le Goater, 2022/01/12
- [PULL 31/34] ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack, Cédric Le Goater, 2022/01/12
- [PULL 08/34] target/ppc: powerpc_excp: Extract software TLB logging into a function, Cédric Le Goater, 2022/01/12
- [PULL 06/34] MAINTAINERS: Improve the PowerPC machines section, Cédric Le Goater, 2022/01/12
- Re: [PULL 00/34] ppc queue, Peter Maydell, 2022/01/13