[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-8.2 3/3] HACK: pnv/lpc: Set up XSCOM dt for P9
From: |
Joel Stanley |
Subject: |
[PATCH for-8.2 3/3] HACK: pnv/lpc: Set up XSCOM dt for P9 |
Date: |
Tue, 8 Aug 2023 18:04:45 +0930 |
To test qemu's model of the xscom interface, apply this patch to qemu
and the following change to skiboot:
--- a/hw/lpc.c
+++ b/hw/lpc.c
@@ -1266,7 +1266,7 @@ static void lpc_init_chip_p9(struct dt_node *opb_node)
lpc = zalloc(sizeof(struct lpcm));
assert(lpc);
lpc->chip_id = gcid;
- lpc->mbase = (void *)addr;
+ lpc->xbase = dt_get_address(lpc_node, 0, NULL);
lpc->fw_idsel = 0xff;
lpc->fw_rdsz = 0xff;
lpc->node = lpc_node;
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
hw/ppc/pnv_lpc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index 6c6a3134087f..62ab688407a3 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -218,6 +218,11 @@ int pnv_dt_lpc(PnvChip *chip, void *fdt, int root_offset,
uint64_t lpcm_addr,
offset = fdt_add_subnode(fdt, lpcm_offset, name);
_FDT(offset);
g_free(name);
+ uint32_t lpc_pcba = PNV9_XSCOM_LPC_BASE;
+ reg[0] = cpu_to_be32(lpc_pcba);
+ reg[1] = cpu_to_be32(PNV_XSCOM_LPC_SIZE);
+
+ _FDT((fdt_setprop(fdt, offset, "reg", reg, sizeof(reg))));
_FDT((fdt_setprop_cell(fdt, offset, "#address-cells", 2)));
_FDT((fdt_setprop_cell(fdt, offset, "#size-cells", 1)));
_FDT((fdt_setprop(fdt, offset, "compatible", lpc_compat,
--
2.40.1