From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: figlesia@xilinx.com, peter.maydell@linaro.org,
sstabellini@kernel.org, edgar.iglesias@xilinx.com,
sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com,
alistair@alistair23.me, richard.henderson@linaro.org,
frederic.konrad@adacore.com, qemu-arm@nongnu.org,
philmd@redhat.com, luc.michel@greensocs.com
Subject: [PATCH v1 2/2] hw/arm: versal: Generate xlnx-versal-virt zdma FDT nodes
Date: Thu, 27 Feb 2020 16:44:24 +0100 [thread overview]
Message-ID: <20200227154424.6849-3-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20200227154424.6849-1-edgar.iglesias@gmail.com>
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
Generate xlnx-versal-virt zdma FDT nodes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
hw/arm/xlnx-versal-virt.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index e7f4ca8bf9..878a275140 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -229,6 +229,33 @@ static void fdt_add_gem_nodes(VersalVirt *s)
}
}
+static void fdt_add_zdma_nodes(VersalVirt *s)
+{
+ const char clocknames[] = "clk_main\0clk_apb";
+ const char compat[] = "xlnx,zynqmp-dma-1.0";
+ int i;
+
+ for (i = XLNX_VERSAL_NR_ADMAS - 1; i >= 0; i--) {
+ uint64_t addr = MM_ADMA_CH0 + MM_ADMA_CH0_SIZE * i;
+ char *name = g_strdup_printf("/dma@%" PRIx64, addr);
+
+ qemu_fdt_add_subnode(s->fdt, name);
+
+ qemu_fdt_setprop_cell(s->fdt, name, "xlnx,bus-width", 64);
+ qemu_fdt_setprop_cells(s->fdt, name, "clocks",
+ s->phandle.clk_25Mhz, s->phandle.clk_25Mhz);
+ qemu_fdt_setprop(s->fdt, name, "clock-names",
+ clocknames, sizeof(clocknames));
+ qemu_fdt_setprop_cells(s->fdt, name, "interrupts",
+ GIC_FDT_IRQ_TYPE_SPI, VERSAL_ADMA_IRQ_0 + i,
+ GIC_FDT_IRQ_FLAGS_LEVEL_HI);
+ qemu_fdt_setprop_sized_cells(s->fdt, name, "reg",
+ 2, addr, 2, 0x1000);
+ qemu_fdt_setprop(s->fdt, name, "compatible", compat, sizeof(compat));
+ g_free(name);
+ }
+}
+
static void fdt_nop_memory_nodes(void *fdt, Error **errp)
{
Error *err = NULL;
@@ -427,6 +454,7 @@ static void versal_virt_init(MachineState *machine)
fdt_add_uart_nodes(s);
fdt_add_gic_nodes(s);
fdt_add_timer_nodes(s);
+ fdt_add_zdma_nodes(s);
fdt_add_cpu_nodes(s, psci_conduit);
fdt_add_clk_node(s, "/clk125", 125000000, s->phandle.clk_125Mhz);
fdt_add_clk_node(s, "/clk25", 25000000, s->phandle.clk_25Mhz);
--
2.20.1
next prev parent reply other threads:[~2020-02-27 3:19 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
2020-02-27 15:44 ` Edgar E. Iglesias [this message]
2020-02-27 9:04 ` [PATCH v1 2/2] hw/arm: versal: Generate xlnx-versal-virt zdma FDT nodes 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=20200227154424.6849-3-edgar.iglesias@gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=alistair@alistair23.me \
--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=peter.maydell@linaro.org \
--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).