From: Frederic Barrat <fbarrat@linux.ibm.com>
To: "Joel Stanley" <joel@jms.id.au>,
"Cédric Le Goater" <clg@kaod.org>,
"Nicholas Piggin" <npiggin@gmail.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH for-8.2 2/3] pnv/lpc: Hook up xscom region for P9/P10
Date: Wed, 9 Aug 2023 16:56:38 +0200 [thread overview]
Message-ID: <61cf0069-e845-3a07-2a55-659594e886be@linux.ibm.com> (raw)
In-Reply-To: <20230808083445.4613-3-joel@jms.id.au>
Hello Joel,
So we're re-using the same xscom ops as on P8. A quick look at the
definition of those 4 registers on P8 (0xb0020) and on P9/P10
(0x00090040) seem to show they are not the same though. Am i missing
something?
Fred
On 08/08/2023 10:34, Joel Stanley wrote:
> From P9 on the LPC bus is memory mapped. However the xscom access still
> is possible, so add it too.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> include/hw/ppc/pnv_xscom.h | 6 ++++++
> hw/ppc/pnv.c | 4 ++++
> hw/ppc/pnv_lpc.c | 6 ++++++
> 3 files changed, 16 insertions(+)
>
> diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
> index 9bc64635471e..42601bdf419d 100644
> --- a/include/hw/ppc/pnv_xscom.h
> +++ b/include/hw/ppc/pnv_xscom.h
> @@ -96,6 +96,9 @@ struct PnvXScomInterfaceClass {
> #define PNV9_XSCOM_SBE_CTRL_BASE 0x00050008
> #define PNV9_XSCOM_SBE_CTRL_SIZE 0x1
>
> +#define PNV9_XSCOM_LPC_BASE 0x00090040
> +#define PNV9_XSCOM_LPC_SIZE PNV_XSCOM_LPC_SIZE
> +
> #define PNV9_XSCOM_SBE_MBOX_BASE 0x000D0050
> #define PNV9_XSCOM_SBE_MBOX_SIZE 0x16
>
> @@ -155,6 +158,9 @@ struct PnvXScomInterfaceClass {
> #define PNV10_XSCOM_SBE_CTRL_BASE PNV9_XSCOM_SBE_CTRL_BASE
> #define PNV10_XSCOM_SBE_CTRL_SIZE PNV9_XSCOM_SBE_CTRL_SIZE
>
> +#define PNV10_XSCOM_LPC_BASE PNV9_XSCOM_LPC_BASE
> +#define PNV10_XSCOM_LPC_SIZE PNV9_XSCOM_LPC_SIZE
> +
> #define PNV10_XSCOM_SBE_MBOX_BASE PNV9_XSCOM_SBE_MBOX_BASE
> #define PNV10_XSCOM_SBE_MBOX_SIZE PNV9_XSCOM_SBE_MBOX_SIZE
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index afdaa25c2b26..a5db655b41b6 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1566,6 +1566,8 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
> }
> memory_region_add_subregion(get_system_memory(), PNV9_LPCM_BASE(chip),
> &chip9->lpc.mmio_regs);
> + pnv_xscom_add_subregion(chip, PNV9_XSCOM_LPC_BASE,
> + &chip9->lpc.xscom_regs);
>
> chip->fw_mr = &chip9->lpc.isa_fw;
> chip->dt_isa_nodename = g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0",
> @@ -1785,6 +1787,8 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
> }
> memory_region_add_subregion(get_system_memory(), PNV10_LPCM_BASE(chip),
> &chip10->lpc.mmio_regs);
> + pnv_xscom_add_subregion(chip, PNV10_XSCOM_LPC_BASE,
> + &chip10->lpc.xscom_regs);
>
> chip->fw_mr = &chip10->lpc.isa_fw;
> chip->dt_isa_nodename = g_strdup_printf("/lpcm-opb@%" PRIx64 "/lpc@0",
> diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
> index caf5e10a5f96..6c6a3134087f 100644
> --- a/hw/ppc/pnv_lpc.c
> +++ b/hw/ppc/pnv_lpc.c
> @@ -666,6 +666,12 @@ static void pnv_lpc_power9_realize(DeviceState *dev, Error **errp)
> /* P9 uses a MMIO region */
> memory_region_init_io(&lpc->mmio_regs, OBJECT(lpc), &pnv_lpc_mmio_ops,
> lpc, "lpcm", PNV9_LPCM_SIZE);
> +
> + /* but the XSCOM region still exists */
> + pnv_xscom_region_init(&lpc->xscom_regs, OBJECT(lpc),
> + &pnv_lpc_xscom_ops, lpc, "xscom-lpc",
> + PNV_XSCOM_LPC_SIZE);
> +
> }
>
> static void pnv_lpc_power9_class_init(ObjectClass *klass, void *data)
next prev parent reply other threads:[~2023-08-09 14:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 8:34 [PATCH for-8.2 0/3] pnv/lpc: Hook up xscoms for LPC Joel Stanley
2023-08-08 8:34 ` [PATCH for-8.2 1/3] pnv/lpc: Place mmio regs in their own memory region Joel Stanley
2023-08-08 8:34 ` [PATCH for-8.2 2/3] pnv/lpc: Hook up xscom region for P9/P10 Joel Stanley
2023-08-09 14:56 ` Frederic Barrat [this message]
2023-08-29 14:45 ` Cédric Le Goater
2023-08-31 12:57 ` Joel Stanley
2023-08-08 8:34 ` [PATCH for-8.2 3/3] HACK: pnv/lpc: Set up XSCOM dt for P9 Joel Stanley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61cf0069-e845-3a07-2a55-659594e886be@linux.ibm.com \
--to=fbarrat@linux.ibm.com \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).