From: Alistair Francis <alistair23@gmail.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: "Edgar Iglesias" <edgar.iglesias@xilinx.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Luc Michel" <luc@lmichel.fr>,
asifsiddiqui120@gmail.com, edgar.iglesias@amd.com,
"Sai Pavan Boddu" <sai.pavan.boddu@xilinx.com>,
"Francisco Iglesias" <frasse.iglesias@gmail.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Richard Henderson" <richard.henderson@linaro.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Francisco Iglesias" <francisco.iglesias@xilinx.com>,
"KONRAD Frederic" <frederic.konrad@adacore.com>,
qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [PATCH v1 2/2] hw/arm/xlnx-zynqmp: Connect 4 TTC timers
Date: Fri, 1 Apr 2022 15:04:13 +1000 [thread overview]
Message-ID: <CAKmqyKPjMh2-MBhc3G+inh=7hCfn2FxQcoQNz0Gi5B85+qzA1g@mail.gmail.com> (raw)
In-Reply-To: <20220331222017.2914409-3-edgar.iglesias@gmail.com>
On Fri, Apr 1, 2022 at 8:26 AM Edgar E. Iglesias
<edgar.iglesias@gmail.com> wrote:
>
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Connect the 4 TTC timers on the ZynqMP.
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> include/hw/arm/xlnx-zynqmp.h | 4 ++++
> hw/arm/xlnx-zynqmp.c | 22 ++++++++++++++++++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> index 9d9a9d0bf9..85fd9f53da 100644
> --- a/include/hw/arm/xlnx-zynqmp.h
> +++ b/include/hw/arm/xlnx-zynqmp.h
> @@ -41,6 +41,7 @@
> #include "hw/or-irq.h"
> #include "hw/misc/xlnx-zynqmp-apu-ctrl.h"
> #include "hw/misc/xlnx-zynqmp-crf.h"
> +#include "hw/timer/cadence_ttc.h"
>
> #define TYPE_XLNX_ZYNQMP "xlnx-zynqmp"
> OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, XLNX_ZYNQMP)
> @@ -84,6 +85,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, XLNX_ZYNQMP)
> #define XLNX_ZYNQMP_MAX_RAM_SIZE (XLNX_ZYNQMP_MAX_LOW_RAM_SIZE + \
> XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE)
>
> +#define XLNX_ZYNQMP_NUM_TTC 4
> +
> /*
> * Unimplemented mmio regions needed to boot some images.
> */
> @@ -128,6 +131,7 @@ struct XlnxZynqMPState {
> qemu_or_irq qspi_irq_orgate;
> XlnxZynqMPAPUCtrl apu_ctrl;
> XlnxZynqMPCRF crf;
> + CadenceTTCState ttc[XLNX_ZYNQMP_NUM_TTC];
>
> char *boot_cpu;
> ARMCPU *boot_cpu_ptr;
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 5bfe285a19..375309e68e 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -68,6 +68,9 @@
> #define APU_ADDR 0xfd5c0000
> #define APU_IRQ 153
>
> +#define TTC0_ADDR 0xFF110000
> +#define TTC0_IRQ 36
> +
> #define IPI_ADDR 0xFF300000
> #define IPI_IRQ 64
>
> @@ -316,6 +319,24 @@ static void xlnx_zynqmp_create_crf(XlnxZynqMPState *s, qemu_irq *gic)
> sysbus_connect_irq(sbd, 0, gic[CRF_IRQ]);
> }
>
> +static void xlnx_zynqmp_create_ttc(XlnxZynqMPState *s, qemu_irq *gic)
> +{
> + SysBusDevice *sbd;
> + int i, irq;
> +
> + for (i = 0; i < XLNX_ZYNQMP_NUM_TTC; i++) {
> + object_initialize_child(OBJECT(s), "ttc[*]", &s->ttc[i],
> + TYPE_CADENCE_TTC);
> + sbd = SYS_BUS_DEVICE(&s->ttc[i]);
> +
> + sysbus_realize(sbd, &error_fatal);
> + sysbus_mmio_map(sbd, 0, TTC0_ADDR + i * 0x10000);
> + for (irq = 0; irq < 3; irq++) {
> + sysbus_connect_irq(sbd, irq, gic[TTC0_IRQ + i * 3 + irq]);
> + }
> + }
> +}
> +
> static void xlnx_zynqmp_create_unimp_mmio(XlnxZynqMPState *s)
> {
> static const struct UnimpInfo {
> @@ -721,6 +742,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
> xlnx_zynqmp_create_efuse(s, gic_spi);
> xlnx_zynqmp_create_apu_ctrl(s, gic_spi);
> xlnx_zynqmp_create_crf(s, gic_spi);
> + xlnx_zynqmp_create_ttc(s, gic_spi);
> xlnx_zynqmp_create_unimp_mmio(s);
>
> for (i = 0; i < XLNX_ZYNQMP_NUM_GDMA_CH; i++) {
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2022-04-01 5:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 22:20 [PATCH v1 0/2] hw/arm: zynqmp: Add the 4 TTC timers Edgar E. Iglesias
2022-03-31 22:20 ` [PATCH v1 1/2] timer: cadence_ttc: Break out header file to allow embedding Edgar E. Iglesias
2022-04-01 5:00 ` Alistair Francis
2022-04-01 7:11 ` Luc Michel
2022-04-01 8:11 ` Francisco Iglesias
2022-03-31 22:20 ` [PATCH v1 2/2] hw/arm/xlnx-zynqmp: Connect 4 TTC timers Edgar E. Iglesias
2022-04-01 5:04 ` Alistair Francis [this message]
2022-04-01 7:11 ` Luc Michel
2022-04-01 8:12 ` Francisco Iglesias
2022-04-11 10:45 ` [PATCH v1 0/2] hw/arm: zynqmp: Add the " Peter Maydell
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='CAKmqyKPjMh2-MBhc3G+inh=7hCfn2FxQcoQNz0Gi5B85+qzA1g@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair@alistair23.me \
--cc=asifsiddiqui120@gmail.com \
--cc=edgar.iglesias@amd.com \
--cc=edgar.iglesias@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=f4bug@amsat.org \
--cc=francisco.iglesias@xilinx.com \
--cc=frasse.iglesias@gmail.com \
--cc=frederic.konrad@adacore.com \
--cc=luc@lmichel.fr \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sai.pavan.boddu@xilinx.com \
/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).