From: vijay.kilari@gmail.com
To: Ian.Campbell@citrix.com, julien.grall@linaro.org,
stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com,
xen-devel@lists.xen.org
Cc: Prasun.Kapoor@caviumnetworks.com,
Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>,
vijay.kilari@gmail.com
Subject: [RFC PATCH v1 10/10] xen/arm: GICv3 device tree parsing
Date: Wed, 19 Mar 2014 19:47:11 +0530 [thread overview]
Message-ID: <1395238631-2024-11-git-send-email-vijay.kilari@gmail.com> (raw)
In-Reply-To: <1395238631-2024-1-git-send-email-vijay.kilari@gmail.com>
From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
GICv3 supports system register access to GIC cpu interface.
So no need to read device tree for cpu interface.
GICv3 adds Re-distributor region and redistributor stride
which are parsed.
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
xen/arch/arm/domain_build.c | 41 +++++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 5ca2f15..c88c5ae 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -532,6 +532,8 @@ static int make_gic_node(const struct domain *d, void *fdt,
u32 len;
__be32 *new_cells, *tmp;
int res = 0;
+ int hw_type = GIC_VERSION_V2;
+ u32 rd_stride = 0;
/*
* Xen currently supports only a single GIC. Discard any secondary
@@ -545,6 +547,8 @@ static int make_gic_node(const struct domain *d, void *fdt,
DPRINT("Create gic node\n");
+ hw_type = gic_hw_version();
+
compatible = dt_get_property(gic, "compatible", &len);
if ( !compatible )
{
@@ -552,6 +556,12 @@ static int make_gic_node(const struct domain *d, void *fdt,
return -FDT_ERR_XEN(ENOENT);
}
+ if (hw_type == GIC_VERSION_V3)
+ {
+ res = dt_property_read_u32(gic, "redistributor-stride", &rd_stride);
+ if ( !res )
+ rd_stride = 0;
+ }
res = fdt_begin_node(fdt, "interrupt-controller");
if ( res )
return res;
@@ -569,6 +579,13 @@ static int make_gic_node(const struct domain *d, void *fdt,
if ( res )
return res;
+ if (hw_type == GIC_VERSION_V3)
+ {
+ res = fdt_property_cell(fdt, "redistributor-stride", rd_stride);
+ if ( res )
+ return res;
+ DPRINT(" gicv3 rd stride 0x%x\n", rd_stride);
+ }
len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
len *= 2; /* GIC has two memory regions: Distributor + CPU interface */
new_cells = xzalloc_bytes(len);
@@ -576,14 +593,26 @@ static int make_gic_node(const struct domain *d, void *fdt,
return -FDT_ERR_XEN(ENOMEM);
tmp = new_cells;
- DPRINT(" Set Distributor Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
- d->arch.vgic.dbase, d->arch.vgic.dbase + PAGE_SIZE - 1);
- dt_set_range(&tmp, node, d->arch.vgic.dbase, PAGE_SIZE);
+ if (hw_type == GIC_VERSION_V3)
+ {
+ DPRINT(" Set Distributor Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+ d->arch.vgic.dbase, d->arch.vgic.dbase + d->arch.vgic.dbase_size - 1);
+ dt_set_range(&tmp, node, d->arch.vgic.dbase, d->arch.vgic.dbase_size);
- DPRINT(" Set Cpu Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
- d->arch.vgic.cbase, d->arch.vgic.cbase + (PAGE_SIZE * 2) - 1);
- dt_set_range(&tmp, node, d->arch.vgic.cbase, PAGE_SIZE * 2);
+ DPRINT(" Set Re-distributor Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+ d->arch.vgic.cbase, d->arch.vgic.rbase + d->arch.vgic.rbase_size - 1);
+ dt_set_range(&tmp, node, d->arch.vgic.rbase, d->arch.vgic.rbase_size);
+ }
+ else
+ {
+ DPRINT(" Set Distributor Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+ d->arch.vgic.dbase, d->arch.vgic.dbase + PAGE_SIZE - 1);
+ dt_set_range(&tmp, node, d->arch.vgic.dbase, PAGE_SIZE);
+ DPRINT(" Set Cpu Base 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+ d->arch.vgic.cbase, d->arch.vgic.cbase + (PAGE_SIZE * 2) - 1);
+ dt_set_range(&tmp, node, d->arch.vgic.cbase, PAGE_SIZE * 2);
+ }
res = fdt_property(fdt, "reg", new_cells, len);
xfree(new_cells);
--
1.7.9.5
next prev parent reply other threads:[~2014-03-19 14:17 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 14:17 [RFC PATCH v1 00/10] xen/arm: Add GICv3 support vijay.kilari
2014-03-19 14:17 ` [RFC PATCH v1 01/10] xen/arm: make secondary gic init as notifier call vijay.kilari
2014-03-20 12:48 ` Julien Grall
2014-03-22 8:16 ` Vijay Kilari
2014-03-23 14:38 ` Julien Grall
2014-03-26 11:27 ` Vijay Kilari
2014-03-26 14:41 ` Julien Grall
2014-03-26 17:22 ` George Dunlap
2014-03-21 17:15 ` Ian Campbell
2014-03-22 8:32 ` Vijay Kilari
2014-03-22 13:54 ` Julien Grall
2014-03-24 10:53 ` Ian Campbell
2014-03-19 14:17 ` [RFC PATCH v1 02/10] xen/arm: register mmio handler at runtime vijay.kilari
2014-03-20 13:18 ` Julien Grall
2014-03-21 13:19 ` Andrii Tseglytskyi
2014-03-21 17:17 ` Ian Campbell
2014-03-21 17:23 ` Julien Grall
2014-03-26 12:29 ` Vijay Kilari
2014-03-26 14:47 ` Julien Grall
2014-03-27 5:40 ` Vijay Kilari
2014-03-27 15:02 ` Julien Grall
2014-04-01 9:34 ` Vijay Kilari
2014-04-01 11:00 ` Julien Grall
2014-04-01 12:32 ` Vijay Kilari
2014-04-01 12:44 ` Ian Campbell
2014-04-01 12:51 ` Julien Grall
2014-04-01 13:05 ` Vijay Kilari
2014-04-01 13:56 ` Julien Grall
2014-03-19 14:17 ` [RFC PATCH v1 03/10] xen/arm: move vgic data to vgic driver vijay.kilari
2014-03-20 13:51 ` Julien Grall
2014-03-21 17:23 ` Ian Campbell
2014-03-22 9:20 ` Vijay Kilari
2014-03-24 10:57 ` Ian Campbell
2014-03-26 11:44 ` Vijay Kilari
2014-03-26 12:00 ` Ian Campbell
2014-03-26 12:42 ` Vijay Kilari
2014-03-22 9:17 ` Vijay Kilari
2014-03-20 17:14 ` Stefano Stabellini
2014-03-20 17:56 ` Julien Grall
2014-03-20 18:11 ` Stefano Stabellini
2014-03-21 9:22 ` Ian Campbell
2014-03-19 14:17 ` [RFC PATCH v1 04/10] arm/xen: move gic save and restore registers to gic driver vijay.kilari
2014-03-20 15:22 ` Julien Grall
2014-03-21 17:26 ` Ian Campbell
2014-03-22 9:22 ` Vijay Kilari
2014-03-20 17:23 ` Stefano Stabellini
2014-03-21 17:28 ` Ian Campbell
2014-03-22 9:27 ` Vijay Kilari
2014-03-19 14:17 ` [RFC PATCH v1 05/10] xen/arm: move gic definitions to seperate file vijay.kilari
2014-03-20 15:13 ` Julien Grall
2014-03-19 14:17 ` [RFC PATCH v1 06/10] xen/arm: split gic driver into generic and gicv2 driver vijay.kilari
2014-03-20 11:55 ` Stefano Stabellini
2014-03-22 9:32 ` Vijay Kilari
2014-03-23 14:43 ` Julien Grall
2014-03-24 11:01 ` Ian Campbell
2014-03-20 16:02 ` Julien Grall
2014-03-21 17:32 ` Ian Campbell
2014-03-21 17:37 ` Julien Grall
2014-03-22 9:40 ` Vijay Kilari
2014-03-23 15:05 ` Julien Grall
2014-03-20 16:39 ` Stefano Stabellini
2014-03-21 17:38 ` Ian Campbell
2014-03-22 9:59 ` Vijay Kilari
2014-03-24 11:06 ` Ian Campbell
2014-03-19 14:17 ` [RFC PATCH v1 07/10] xen/arm: split vgic into generic and GIC v2 specific drivers vijay.kilari
2014-03-19 14:17 ` [RFC PATCH v1 08/10] xen/arm: Add support for GIC v3 vijay.kilari
2014-03-20 12:37 ` Stefano Stabellini
2014-03-22 10:07 ` Vijay Kilari
2014-03-24 11:28 ` Ian Campbell
2014-03-24 17:01 ` Stefano Stabellini
2014-03-26 13:16 ` Vijay Kilari
2014-03-26 17:22 ` Stefano Stabellini
2014-03-20 16:40 ` Julien Grall
2014-03-22 10:21 ` Vijay Kilari
2014-03-23 14:49 ` Julien Grall
2014-03-24 11:26 ` Ian Campbell
2014-03-24 11:50 ` Julien Grall
2014-03-24 17:02 ` Stefano Stabellini
2014-03-19 14:17 ` [RFC PATCH v1 09/10] xen/arm: Add vgic " vijay.kilari
2014-03-20 12:38 ` Stefano Stabellini
2014-03-19 14:17 ` vijay.kilari [this message]
2014-03-20 16:08 ` [RFC PATCH v1 10/10] xen/arm: GICv3 device tree parsing Julien Grall
2014-03-22 10:30 ` Vijay Kilari
2014-03-24 11:43 ` Ian Campbell
2014-03-24 12:03 ` Julien Grall
2014-03-24 12:07 ` Ian Campbell
2014-03-24 12:08 ` Julien Grall
2014-03-24 17:34 ` Stefano Stabellini
2014-03-24 18:00 ` Julien Grall
2014-03-25 11:04 ` Stefano Stabellini
2014-03-25 12:33 ` Julien Grall
2014-03-25 12:34 ` Julien Grall
2014-04-01 12:59 ` Ian Campbell
2014-04-01 13:07 ` Julien Grall
2014-03-20 11:55 ` [RFC PATCH v1 00/10] xen/arm: Add GICv3 support Stefano Stabellini
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=1395238631-2024-11-git-send-email-vijay.kilari@gmail.com \
--to=vijay.kilari@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=Vijaya.Kumar@caviumnetworks.com \
--cc=julien.grall@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.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).