From: Peter Maydell <peter.maydell@linaro.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: figlesia@xilinx.com, "Edgar Iglesias" <edgar.iglesias@xilinx.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"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 Developers" <qemu-devel@nongnu.org>,
"KONRAD Frederic" <frederic.konrad@adacore.com>,
qemu-arm <qemu-arm@nongnu.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Luc Michel" <luc.michel@greensocs.com>
Subject: Re: [PATCH v1 1/2] hw/arm: versal: Add support for the LPD ADMAs
Date: Mon, 2 Mar 2020 11:22:56 +0000 [thread overview]
Message-ID: <CAFEAcA9ap6MLmQvdD82HaioDeQj3vxtsyLaTN-OGEu0BDygBCg@mail.gmail.com> (raw)
In-Reply-To: <20200227154424.6849-2-edgar.iglesias@gmail.com>
On Thu, 27 Feb 2020 at 03:17, Edgar E. Iglesias
<edgar.iglesias@gmail.com> wrote:
>
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>
> Add support for the Versal LPD ADMAs.
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
> hw/arm/xlnx-versal.c | 24 ++++++++++++++++++++++++
> include/hw/arm/xlnx-versal.h | 6 ++++++
> 2 files changed, 30 insertions(+)
>
> diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
> index 1cf3daaf4f..f9beba07ed 100644
> --- a/hw/arm/xlnx-versal.c
> +++ b/hw/arm/xlnx-versal.c
> @@ -193,6 +193,29 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
> }
> }
>
> +static void versal_create_admas(Versal *s, qemu_irq *pic)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(s->lpd.iou.adma); i++) {
> + char *name = g_strdup_printf("adma%d", i);
> + DeviceState *dev;
> + MemoryRegion *mr;
> +
> + dev = qdev_create(NULL, "xlnx.zdma");
> + s->lpd.iou.adma[i] = SYS_BUS_DEVICE(dev);
> + object_property_add_child(OBJECT(s), name, OBJECT(dev), &error_fatal);
> + qdev_init_nofail(dev);
> +
> + mr = sysbus_mmio_get_region(s->lpd.iou.adma[i], 0);
> + memory_region_add_subregion(&s->mr_ps,
> + MM_ADMA_CH0 + i * MM_ADMA_CH0_SIZE, mr);
> +
> + sysbus_connect_irq(s->lpd.iou.adma[i], 0, pic[VERSAL_ADMA_IRQ_0 + i]);
> + g_free(name);
> + }
> +}
It would be more in the modern style to write it with the child device
struct embedded in the parent struct, object_initialize_child() in the
parent init, and object_property_set_bool(..., true, "realized", ...)
in the parent realized, but I guess this fits with the way the
rest of the existing device is written.
Series applied to target-arm.next, thanks.
thanks
-- PMM
next prev parent reply other threads:[~2020-03-02 11:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 15:44 [PATCH v1 0/2] hw/arm: versal: Add the LPD zDMAs Edgar E. Iglesias
2020-02-27 15:44 ` [PATCH v1 1/2] hw/arm: versal: Add support for the LPD ADMAs Edgar E. Iglesias
2020-02-27 9:02 ` KONRAD Frederic
2020-02-27 9:48 ` Francisco Iglesias
2020-03-02 11:06 ` Luc Michel
2020-03-02 11:22 ` Peter Maydell [this message]
2020-02-27 15:44 ` [PATCH v1 2/2] hw/arm: versal: Generate xlnx-versal-virt zdma FDT nodes Edgar E. Iglesias
2020-02-27 9:04 ` KONRAD Frederic
2020-02-27 9:48 ` Francisco Iglesias
2020-03-02 11:07 ` Luc Michel
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=CAFEAcA9ap6MLmQvdD82HaioDeQj3vxtsyLaTN-OGEu0BDygBCg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=figlesia@xilinx.com \
--cc=frasse.iglesias@gmail.com \
--cc=frederic.konrad@adacore.com \
--cc=luc.michel@greensocs.com \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sai.pavan.boddu@xilinx.com \
--cc=sstabellini@kernel.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).