Skip to contentSkip to conversation

ppc/pnv: Add dummy MMIO support for OCMB chips

PATCH In review Caleb Schlossin 2 participants 4 messages Dec 24, 2025 – Jan 5 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc/pnv: Add dummy MMIO support for OCMB chips

The Power Hypervisor for P10 expects to be able to access certain Open CAPI Memory Buffer (OCMB) chip registers. Since QEMU does not currently support these registers, several access errors are being posted. The hypervisor is able to progress despite these errors, but it does create unwanted noise on the console. Adding some dummy MMIO support for this IO region in order to suppress the error messages.

---
 hw/ppc/meson.build        |   1 +
 hw/ppc/pnv.c              |  10 ++++
 hw/ppc/pnv_ocmb.c         | 103 ++++++++++++++++++++++++++++++++++++++
 include/hw/ppc/pnv.h      |   3 ++
 include/hw/ppc/pnv_chip.h |   2 +
 include/hw/ppc/pnv_ocmb.h |  38 ++++++++++++++
 6 files changed, 157 insertions(+)
 create mode 100644 hw/ppc/pnv_ocmb.c
 create mode 100644 include/hw/ppc/pnv_ocmb.h
hw/ppc/meson.build +1 -0
index f7dac87a2a..b3924119ae 100644
@@ -56,6 +56,7 @@ ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files(
   'pnv_pnor.c',
   'pnv_nest_pervasive.c',
   'pnv_n1_chiplet.c',
+  'pnv_ocmb.c',
 ))
 # PowerPC 4xx boards
 ppc_ss.add(when: 'CONFIG_PPC405', if_true: files(
hw/ppc/pnv.c +10 -0
index 895132da91..670c28fed2 100644
@@ -2187,6 +2187,7 @@ static void pnv_chip_power10_instance_init(Object *obj)
     object_initialize_child(obj, "homer", &chip10->homer, TYPE_PNV10_HOMER);
     object_initialize_child(obj, "n1-chiplet", &chip10->n1_chiplet,
                             TYPE_PNV_N1_CHIPLET);
+    object_initialize_child(obj, "ocmb", &chip10->ocmb, TYPE_PNV10_OCMB);
 
     chip->num_pecs = pcc->num_pecs;
 
@@ -2409,6 +2410,15 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
     pnv_xscom_add_subregion(chip, PNV10_XSCOM_N1_PB_SCOM_ES_BASE,
                            &chip10->n1_chiplet.xscom_pb_es_mr);
 
+    /* Memory Controller OCMB CFG/MMIO space */
+    object_property_set_link(OBJECT(&chip10->ocmb), "chip", OBJECT(chip),
+                             &error_abort);
+    if (!qdev_realize(DEVICE(&chip10->ocmb), NULL, errp)) {
+        return;
+    }
+    memory_region_add_subregion(get_system_memory(), PNV10_OCMB_BASE(chip),
+                                &chip10->ocmb.regs);
+
     /* PHBs */
     pnv_chip_power10_phb_realize(chip, &local_err);
     if (local_err) {
hw/ppc/pnv_ocmb.c new file +103 -0

103 lines not on this page · raw message

include/hw/ppc/pnv.h +3 -0
index cbdddfc73c..cf28f23843 100644
@@ -240,6 +240,9 @@ void pnv_bmc_set_pnor(IPMIBmc *bmc, PnvPnor *pnor);
 #define PNV10_XIVE2_NVC_SIZE        0x0000000008000000ull
 #define PNV10_XIVE2_NVC_BASE(chip)  PNV10_CHIP_BASE(chip, 0x0006030208000000ull)
 
+#define PNV10_OCMB_SIZE             0x0000001000000000ull
+#define PNV10_OCMB_BASE(chip)       PNV10_CHIP_BASE(chip, 0x0006030400000000ull)
+
 #define PNV10_XIVE2_NVPG_SIZE       0x0000010000000000ull
 #define PNV10_XIVE2_NVPG_BASE(chip) PNV10_CHIP_BASE(chip, 0x0006040000000000ull)
 
include/hw/ppc/pnv_chip.h +2 -0
index a5b8c49680..1d7077207a 100644
@@ -7,6 +7,7 @@
 #include "hw/ppc/pnv_core.h"
 #include "hw/ppc/pnv_homer.h"
 #include "hw/ppc/pnv_n1_chiplet.h"
+#include "hw/ppc/pnv_ocmb.h"
 #include "hw/ssi/pnv_spi.h"
 #include "hw/ppc/pnv_lpc.h"
 #include "hw/ppc/pnv_occ.h"
@@ -124,6 +125,7 @@ struct Pnv10Chip {
     PnvSBE       sbe;
     PnvHomer     homer;
     PnvN1Chiplet     n1_chiplet;
+    PnvOcmb      ocmb;
 #define PNV10_CHIP_MAX_PIB_SPIC 6
     PnvSpi pib_spic[PNV10_CHIP_MAX_PIB_SPIC];
 
include/hw/ppc/pnv_ocmb.h new file +38 -0
new file mode 100644
index 0000000000..c16ae4e477
@@ -0,0 +1,38 @@
+/*
+ * QEMU PowerPC PowerNV Emulation of OCMB related registers
+ *
+ * Copyright (c) 2025, IBM Corporation.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ */
+
+#ifndef PPC_PNV_OCMB_H
+#define PPC_PNV_OCMB_H
+
+#include "hw/ppc/pnv.h"
+#include "qom/object.h"
+
+#define TYPE_PNV_OCMB "pnv-ocmb"
+OBJECT_DECLARE_TYPE(PnvOcmb, PnvOcmbClass,
+                    PNV_OCMB)
+#define TYPE_PNV10_OCMB TYPE_PNV_OCMB "-POWER10"
+DECLARE_INSTANCE_CHECKER(PnvOcmb, PNV10_OCMB,
+                         TYPE_PNV10_OCMB)
+
+struct PnvOcmb {
+    DeviceState parent;
+
+    PnvChip *chip;
+    MemoryRegion regs;
+};
+
+
+struct PnvOcmbClass {
+    DeviceClass parent_class;
+
+    uint64_t ocmb_size;
+    const MemoryRegionOps *ocmb_ops;
+};
+
+#endif /* PPC_PNV_OCMB_H */
Signature · 1 line
2.47.3
#1 lore raw
Quoted 7 lines · Caleb Schlossin

The Power Hypervisor for P10 expects to be able to access certain Open CAPI Memory Buffer (OCMB) chip registers. Since QEMU does not currently support these registers, several access errors are being posted. The hypervisor is able to progress despite these errors, but it does create unwanted noise on the console. Adding some dummy MMIO support for this IO region in order to suppress the error messages.

Hi Caleb,

If there any public document/spec available that documents these registers ? Can you please point me to it.

I don't find any 'ocmb' mention in any docs here: https://computeexpresslink.org/resource/opencapi-specification-archive/

Since a new TODO is getting introduced here to implement those register accesses, it can only be done if some public information is available.

Thanks,
- Aditya G

Quoted 13 lines
---
  hw/ppc/meson.build        |   1 +
  hw/ppc/pnv.c              |  10 ++++
  hw/ppc/pnv_ocmb.c         | 103 ++++++++++++++++++++++++++++++++++++++
  include/hw/ppc/pnv.h      |   3 ++
  include/hw/ppc/pnv_chip.h |   2 +
  include/hw/ppc/pnv_ocmb.h |  38 ++++++++++++++
  6 files changed, 157 insertions(+)

create mode 100644 hw/ppc/pnv_ocmb.c
create mode 100644 include/hw/ppc/pnv_ocmb.h

#2 lore raw
Quoted 14 lines · Aditya Gupta
Quoted 7 lines · Caleb Schlossin

The Power Hypervisor for P10 expects to be able to access certain Open CAPI Memory Buffer (OCMB) chip registers.  Since QEMU does not currently support these registers, several access errors are being posted.  The hypervisor is able to progress despite these errors, but it does create unwanted noise on the console.  Adding some dummy MMIO support for this IO region in order to suppress the error messages.

Hi Caleb,

If there any public document/spec available that documents these registers ? Can you please point me to it.

Quoted 7 lines

I don't find any 'ocmb' mention in any docs here: https://computeexpresslink.org/resource/opencapi-specification-archive/

Since a new TODO is getting introduced here to implement those register accesses, it can only be done if some public information is available.

Thanks,
- Aditya G

Aditya,
I did some searching and couldn't seem to find the registers used in any of the public OpenCAPI documentation. I think the registers being accessed are Vendor-specific and likely not publicly defined. If that is a new requirement, we don't have to proceed with upstreaming of this patch and can keep it private.

Thanks,
Caleb

Quoted 15 lines
Quoted 15 lines

---
  hw/ppc/meson.build        |   1 +
  hw/ppc/pnv.c              |  10 ++++
  hw/ppc/pnv_ocmb.c         | 103 ++++++++++++++++++++++++++++++++++++++ include/hw/ppc/pnv.h      |   3 ++ include/hw/ppc/pnv_chip.h |   2 + include/hw/ppc/pnv_ocmb.h |  38 ++++++++++++++

  6 files changed, 157 insertions(+)

  create mode 100644 hw/ppc/pnv_ocmb.c
  create mode 100644 include/hw/ppc/pnv_ocmb.h

#3 lore raw
Quoted 17 lines · Caleb Schlossin
Quoted 15 lines · Aditya Gupta
Quoted 7 lines · Caleb Schlossin

The Power Hypervisor for P10 expects to be able to access certain Open CAPI Memory Buffer (OCMB) chip registers.  Since QEMU does not currently support these registers, several access errors are being posted.  The hypervisor is able to progress despite these errors, but it does create unwanted noise on the console.  Adding some dummy MMIO support for this IO region in order to suppress the error messages.

Hi Caleb,

If there any public document/spec available that documents these registers ? Can you please point me to it.

I don't find any 'ocmb' mention in any docs here: https://computeexpresslink.org/resource/opencapi-specification-archive/

Quoted 7 lines
Quoted 5 lines

Since a new TODO is getting introduced here to implement those register accesses, it can only be done if some public information is available.

Thanks,
- Aditya G

Aditya,
I did some searching and couldn't seem to find the registers used in any of the public OpenCAPI documentation. I think the registers being accessed are Vendor-specific and likely not publicly defined. If that is a new requirement, we don't have to proceed with upstreaming of this patch and can keep it private.

Yes makes sense.

Having TODOs which cannot be implemented, until information is made public, won't be good.

Thanks for clarifying Caleb.

- Aditya G

Quoted 18 lines

Thanks,
Caleb

Quoted 14 lines
Quoted 14 lines
---
   hw/ppc/meson.build        |   1 +
   hw/ppc/pnv.c              |  10 ++++
   hw/ppc/pnv_ocmb.c         | 103 ++++++++++++++++++++++++++++++++++++++
   include/hw/ppc/pnv.h      |   3 ++
   include/hw/ppc/pnv_chip.h |   2 +
   include/hw/ppc/pnv_ocmb.h |  38 ++++++++++++++
   6 files changed, 157 insertions(+)

  create mode 100644 hw/ppc/pnv_ocmb.c
  create mode 100644 include/hw/ppc/pnv_ocmb.h