Skip to contentSkip to conversation

PCI-related cleanup for ppc/powernv

PATCH Applied Frederic Barrat 3 participants 10 messages Jan 27, 2023 – Jan 28, 2023

lore
Share & tools
lore
#0 lore raw

cover PCI-related cleanup for ppc/powernv

Pretty simple PCI-related cleanup for powernv

Frederic Barrat (4):
ppc/pnv/pci: Cleanup PnvPHBPecState structure ppc/pnv/pci: Remove duplicate definition of PNV_PHB5_DEVICE_ID ppc/pnv/pci: Update PHB5 version register ppc/pnv/pci: Fix PHB xscom registers memory region name

 hw/pci-host/pnv_phb4.c         | 2 +-
 include/hw/pci-host/pnv_phb4.h | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.1
#1 lore raw

PATCH 1/4 ppc/pnv/pci: Cleanup PnvPHBPecState structure

Remove unused structure member 'system_memory'.

---
 include/hw/pci-host/pnv_phb4.h | 2 --
 1 file changed, 2 deletions(-)
include/hw/pci-host/pnv_phb4.h +0 -2
index 1f3237c9d5..17aef08f91 100644
@@ -173,8 +173,6 @@ struct PnvPhb4PecState {
     uint32_t index;
     uint32_t chip_id;
 
-    MemoryRegion *system_memory;
-
     /* Nest registers, excuding per-stack */
 #define PHB4_PEC_NEST_REGS_COUNT    0xf
     uint64_t nest_regs[PHB4_PEC_NEST_REGS_COUNT];
Signature · 1 line
2.39.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] ppc/pnv/pci: Cleanup PnvPHBPecState structure

Quoted 3 lines · Frederic Barrat

Remove unused structure member 'system_memory'.

Thanks,

C.

Quoted 17 lines
---
  include/hw/pci-host/pnv_phb4.h | 2 --
  1 file changed, 2 deletions(-)
include/hw/pci-host/pnv_phb4.h +0 -2
index 1f3237c9d5..17aef08f91 100644
@@ -173,8 +173,6 @@ struct PnvPhb4PecState {
      uint32_t index;
      uint32_t chip_id;
 
-    MemoryRegion *system_memory;
-
      /* Nest registers, excuding per-stack */
  #define PHB4_PEC_NEST_REGS_COUNT    0xf
      uint64_t nest_regs[PHB4_PEC_NEST_REGS_COUNT];
#3 lore raw

PATCH 2/4 ppc/pnv/pci: Remove duplicate definition of PNV_PHB5_DEVICE_ID

In reply to Frederic Barrat

PNV_PHB5_DEVICE_ID is defined in two different headers. The definition in hw/pci-host/pnv_phb4.h was left out in a previous rework.

Remaining definition is in hw/pci-host/pnv_phb.h.

---
 include/hw/pci-host/pnv_phb4.h | 1 -
 1 file changed, 1 deletion(-)
include/hw/pci-host/pnv_phb4.h +0 -1
index 17aef08f91..761525686e 100644
@@ -215,7 +215,6 @@ struct PnvPhb4PecClass {
     OBJECT_CHECK(PnvPhb4, (obj), TYPE_PNV_PHB5)
 
 #define PNV_PHB5_VERSION           0x000000a500000001ull
-#define PNV_PHB5_DEVICE_ID         0x0652
 
 #define TYPE_PNV_PHB5_PEC "pnv-phb5-pec"
 #define PNV_PHB5_PEC(obj) \
Signature · 1 line
2.39.1
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] ppc/pnv/pci: Remove duplicate definition of PNV_PHB5_DEVICE_ID

Quoted 5 lines · Frederic Barrat

PNV_PHB5_DEVICE_ID is defined in two different headers. The definition in hw/pci-host/pnv_phb4.h was left out in a previous rework.

Remaining definition is in hw/pci-host/pnv_phb.h.

Quoted 1 line

Thanks,

C.

Quoted 16 lines
---
  include/hw/pci-host/pnv_phb4.h | 1 -
  1 file changed, 1 deletion(-)
include/hw/pci-host/pnv_phb4.h +0 -1
index 17aef08f91..761525686e 100644
@@ -215,7 +215,6 @@ struct PnvPhb4PecClass {
      OBJECT_CHECK(PnvPhb4, (obj), TYPE_PNV_PHB5)
 
  #define PNV_PHB5_VERSION           0x000000a500000001ull
-#define PNV_PHB5_DEVICE_ID         0x0652
 
  #define TYPE_PNV_PHB5_PEC "pnv-phb5-pec"
  #define PNV_PHB5_PEC(obj) \
#5 lore raw

PATCH 3/4 ppc/pnv/pci: Update PHB5 version register

In reply to Frederic Barrat

Update register value per its P10 DD2 definition.

---
 include/hw/pci-host/pnv_phb4.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/pci-host/pnv_phb4.h +1 -1
index 761525686e..28d61b96c7 100644
@@ -214,7 +214,7 @@ struct PnvPhb4PecClass {
 #define PNV_PHB5(obj) \
     OBJECT_CHECK(PnvPhb4, (obj), TYPE_PNV_PHB5)
 
-#define PNV_PHB5_VERSION           0x000000a500000001ull
+#define PNV_PHB5_VERSION           0x000000a500000002ull
 
 #define TYPE_PNV_PHB5_PEC "pnv-phb5-pec"
 #define PNV_PHB5_PEC(obj) \
Signature · 1 line
2.39.1
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH 3/4] ppc/pnv/pci: Update PHB5 version register

Quoted 3 lines · Frederic Barrat

Update register value per its P10 DD2 definition.

Indeed :

  mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power10_v2.0");

Thanks,

C.

Quoted 17 lines
---
  include/hw/pci-host/pnv_phb4.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/pci-host/pnv_phb4.h +1 -1
index 761525686e..28d61b96c7 100644
@@ -214,7 +214,7 @@ struct PnvPhb4PecClass {
  #define PNV_PHB5(obj) \
      OBJECT_CHECK(PnvPhb4, (obj), TYPE_PNV_PHB5)
 
-#define PNV_PHB5_VERSION           0x000000a500000001ull
+#define PNV_PHB5_VERSION           0x000000a500000002ull
 
  #define TYPE_PNV_PHB5_PEC "pnv-phb5-pec"
  #define PNV_PHB5_PEC(obj) \
#7 lore raw

PATCH 4/4 ppc/pnv/pci: Fix PHB xscom registers memory region name

In reply to Frederic Barrat

The name is for the region mapping the PHB xscom registers. It was apparently a bad cut-and-paste from the per-stack pci xscom area just above, so we had two regions with the same name.

---
 hw/pci-host/pnv_phb4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-host/pnv_phb4.c +1 -1
index ccbde841fc..542f9e2932 100644
@@ -1497,7 +1497,7 @@ static void pnv_phb4_xscom_realize(PnvPHB4 *phb)
                           PHB4_PEC_PCI_STK_REGS_COUNT);
 
     /* PHB pass-through */
-    snprintf(name, sizeof(name), "xscom-pec-%d.%d-pci-phb-%d",
+    snprintf(name, sizeof(name), "xscom-pec-%d.%d-phb-%d",
              pec->chip_id, pec->index, stack_no);
     pnv_xscom_region_init(&phb->phb_regs_mr, OBJECT(phb),
                           &pnv_phb4_xscom_ops, phb, name, 0x40);
Signature · 1 line
2.39.1
Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH 4/4] ppc/pnv/pci: Fix PHB xscom registers memory region name

Quoted 5 lines · Frederic Barrat

The name is for the region mapping the PHB xscom registers. It was apparently a bad cut-and-paste from the per-stack pci xscom area just above, so we had two regions with the same name.

Thanks,

C.

Quoted 17 lines
---
  hw/pci-host/pnv_phb4.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-host/pnv_phb4.c +1 -1
index ccbde841fc..542f9e2932 100644
@@ -1497,7 +1497,7 @@ static void pnv_phb4_xscom_realize(PnvPHB4 *phb)
                            PHB4_PEC_PCI_STK_REGS_COUNT);
 
      /* PHB pass-through */
-    snprintf(name, sizeof(name), "xscom-pec-%d.%d-pci-phb-%d",
+    snprintf(name, sizeof(name), "xscom-pec-%d.%d-phb-%d",
               pec->chip_id, pec->index, stack_no);
      pnv_xscom_region_init(&phb->phb_regs_mr, OBJECT(phb),
                            &pnv_phb4_xscom_ops, phb, name, 0x40);
#9 lore raw
In reply to Frederic Barrat
Quoted 7 lines · Frederic Barrat

Pretty simple PCI-related cleanup for powernv

Frederic Barrat (4):
ppc/pnv/pci: Cleanup PnvPHBPecState structure ppc/pnv/pci: Remove duplicate definition of PNV_PHB5_DEVICE_ID ppc/pnv/pci: Update PHB5 version register ppc/pnv/pci: Fix PHB xscom registers memory region name

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,

Daniel

Quoted 5 lines
  hw/pci-host/pnv_phb4.c         | 2 +-
  include/hw/pci-host/pnv_phb4.h | 5 +----
  2 files changed, 2 insertions(+), 5 deletions(-)