Skip to content

Commit

Permalink
ppc/pnv: Set P10 core xscom region size to match hardware
Browse files Browse the repository at this point in the history
The P10 core xscom memory regions overlap because the size is wrong.
The P10 core+L2 xscom region size is allocated as 0x1000 (with some
unused ranges). "EC" is used as a closer match, as "EX" includes L3
which has a disjoint xscom range that would require a different
region if it were implemented.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>
Message-ID: <20230706053923.115003-2-npiggin@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
npiggin authored and danielhb committed Jul 7, 2023
1 parent b0afb57 commit aa2addf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions hw/ppc/pnv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,8 @@ static void pnv_core_realize(DeviceState *dev, Error **errp)
}

snprintf(name, sizeof(name), "xscom-core.%d", cc->core_id);
/* TODO: check PNV_XSCOM_EX_SIZE for p10 */
pnv_xscom_region_init(&pc->xscom_regs, OBJECT(dev), pcc->xscom_ops,
pc, name, PNV_XSCOM_EX_SIZE);
pc, name, pcc->xscom_size);

qemu_register_reset(pnv_core_reset, pc);
return;
Expand Down Expand Up @@ -352,20 +351,23 @@ static void pnv_core_power8_class_init(ObjectClass *oc, void *data)
PnvCoreClass *pcc = PNV_CORE_CLASS(oc);

pcc->xscom_ops = &pnv_core_power8_xscom_ops;
pcc->xscom_size = PNV_XSCOM_EX_SIZE;
}

static void pnv_core_power9_class_init(ObjectClass *oc, void *data)
{
PnvCoreClass *pcc = PNV_CORE_CLASS(oc);

pcc->xscom_ops = &pnv_core_power9_xscom_ops;
pcc->xscom_size = PNV_XSCOM_EX_SIZE;
}

static void pnv_core_power10_class_init(ObjectClass *oc, void *data)
{
PnvCoreClass *pcc = PNV_CORE_CLASS(oc);

pcc->xscom_ops = &pnv_core_power10_xscom_ops;
pcc->xscom_size = PNV10_XSCOM_EC_SIZE;
}

static void pnv_core_class_init(ObjectClass *oc, void *data)
Expand Down
1 change: 1 addition & 0 deletions include/hw/ppc/pnv_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct PnvCoreClass {
DeviceClass parent_class;

const MemoryRegionOps *xscom_ops;
uint64_t xscom_size;
};

#define PNV_CORE_TYPE_SUFFIX "-" TYPE_PNV_CORE
Expand Down
2 changes: 1 addition & 1 deletion include/hw/ppc/pnv_xscom.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct PnvXScomInterfaceClass {

#define PNV10_XSCOM_EC_BASE(core) \
((uint64_t) PNV10_XSCOM_EQ_BASE(core) | PNV10_XSCOM_EC(core & 0x3))
#define PNV10_XSCOM_EC_SIZE 0x100000
#define PNV10_XSCOM_EC_SIZE 0x1000

#define PNV10_XSCOM_PSIHB_BASE 0x3011D00
#define PNV10_XSCOM_PSIHB_SIZE 0x100
Expand Down

0 comments on commit aa2addf

Please sign in to comment.