From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: pranavkumar@linaro.org, tim@xen.org,
Anup Patel <anup.patel@linaro.org>,
stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2 06/15] xen: arm64: Map xgene PCI memory regions and interrupts to dom0.
Date: Fri, 22 Nov 2013 16:59:55 +0000 [thread overview]
Message-ID: <528F8D8B.2070808@linaro.org> (raw)
In-Reply-To: <1385137474-31245-6-git-send-email-ian.campbell@citrix.com>
Can you add a comment to specify that for the future we plan to support
PCI for all platforms ? (ie this patch a kind of "WORKAROUND" for now)
On 11/22/2013 04:24 PM, Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: This replaces "HACK: xen: arm: map PCI controller ranges region MMIOs to
> dom0."
> ---
> xen/arch/arm/platforms/xgene-storm.c | 76 ++++++++++++++++++++++++++++++++++
> 1 file changed, 76 insertions(+)
>
> diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
> index 8658996..f3cc51b 100644
> --- a/xen/arch/arm/platforms/xgene-storm.c
> +++ b/xen/arch/arm/platforms/xgene-storm.c
> @@ -24,12 +24,87 @@
> #include <xen/mm.h>
> #include <xen/vmap.h>
> #include <asm/platform.h>
> +#include <asm/gic.h>
>
> static uint32_t xgene_storm_quirks(void)
> {
> return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
> }
>
> +static int map_one_mmio(struct domain *d, const char *what,
> + paddr_t start, paddr_t end)
> +{
> + int ret;
> +
> + printk("Additional MMIO %"PRIpaddr"-%"PRIpaddr" (%s)\n",
> + start, end, what);
> + ret = map_mmio_regions(d, start, end, start);
> + if ( ret )
> + printk("Failed to map %s @ %"PRIpaddr" to dom%d\n",
> + what, start, d->domain_id);
> + return ret;
> +}
> +
> +static int map_one_spi(struct domain *d, const char *what,
> + unsigned int spi, unsigned int type)
> +{
> + struct dt_irq irq;
> + int ret;
> +
> + irq.type = type;
> +
> + irq.irq = spi + 32; /* SPIs start at IRQ 32 */
> +
> + printk("Additional IRQ %u (%s)\n", irq.irq, what);
> +
> + ret = gic_route_irq_to_guest(d, &irq, what);
> + if ( ret )
> + printk("Failed to route %s to dom%d\n", what, d->domain_id);
> +
> + return ret;
> +}
> +
> +static int xgene_storm_specific_mapping(struct domain *d)
> +{
> + int ret;
> +
> + /* Map the PCIe bus resources */
> + ret = map_one_mmio(d, "PCI MEM REGION", 0xe000000000UL, 0xe010000000UL);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_mmio(d, "PCI IO REGION", 0xe080000000UL, 0xe080010000UL);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_mmio(d, "PCI CFG REGION", 0xe0d0000000UL, 0xe0d0200000UL);
> + if ( ret )
> + goto err;
> + ret = map_one_mmio(d, "PCI MSI REGION", 0xe010000000UL, 0xe010800000UL);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_spi(d, "PCI#INTA", 0xc2, DT_IRQ_TYPE_LEVEL_HIGH);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_spi(d, "PCI#INTB", 0xc3, DT_IRQ_TYPE_LEVEL_HIGH);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_spi(d, "PCI#INTC", 0xc4, DT_IRQ_TYPE_LEVEL_HIGH);
> + if ( ret )
> + goto err;
> +
> + ret = map_one_spi(d, "PCI#INTD", 0xc5, DT_IRQ_TYPE_LEVEL_HIGH);
> + if ( ret )
> + goto err;
> +
> + ret = 0;
> +err:
> + return ret;
> +}
> +
>
> static const char const *xgene_storm_dt_compat[] __initdata =
> {
> @@ -40,6 +115,7 @@ static const char const *xgene_storm_dt_compat[] __initdata =
> PLATFORM_START(xgene_storm, "APM X-GENE STORM")
> .compatible = xgene_storm_dt_compat,
> .quirks = xgene_storm_quirks,
> + .specific_mapping = xgene_storm_specific_mapping,
> .dom0_evtchn_ppi = 24,
> PLATFORM_END
>
>
--
Julien Grall
next prev parent reply other threads:[~2013-11-22 16:59 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <foo>
2013-11-22 16:24 ` [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support Ian Campbell
2013-11-22 16:27 ` [PATCH 00/15] xen: arm initial support for xgene arm64 platform Ian Campbell
2013-11-22 17:02 ` George Dunlap
2013-11-22 17:09 ` Ian Campbell
2013-11-29 10:30 ` Ian Campbell
2013-11-22 16:29 ` [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support Julien Grall
2013-11-22 16:24 ` [PATCH v2 02/15] xen: arm64: Add Basic Platform support for APM X-Gene Storm Ian Campbell
2013-11-22 16:35 ` Julien Grall
2013-11-22 16:43 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 03/15] xen: arm64: Add APM implementor id to processor implementers Ian Campbell
2013-11-22 16:24 ` [PATCH v2 04/15] xen: arm: add a quirk to handle platforms with unusual GIC layout Ian Campbell
2013-11-22 16:46 ` Julien Grall
2013-11-22 17:03 ` Ian Campbell
2013-11-22 17:10 ` Julien Grall
2013-11-22 17:16 ` Ian Campbell
2013-11-22 16:46 ` George Dunlap
2013-11-22 16:24 ` [PATCH v2 05/15] xen: arm: allow platform code to select dom0 event channel irq Ian Campbell
2013-11-22 16:48 ` George Dunlap
2013-11-22 17:01 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 06/15] xen: arm64: Map xgene PCI memory regions and interrupts to dom0 Ian Campbell
2013-11-22 16:50 ` George Dunlap
2013-11-22 16:59 ` Julien Grall [this message]
2013-11-22 17:13 ` Ian Campbell
2013-11-22 17:17 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 07/15] xen: arm: include ns16550 driver on arm64 too Ian Campbell
2013-11-22 16:24 ` [PATCH v2 08/15] xen: arm: early logging of command line Ian Campbell
2013-11-22 17:04 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 09/15] xen: arm: Handle cpus nodes with #address-cells > 1 Ian Campbell
2013-11-22 16:59 ` George Dunlap
2013-11-22 17:22 ` Julien Grall
2013-11-22 17:50 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 10/15] xen: arm: Make register bit definitions unsigned Ian Campbell
2013-11-22 17:23 ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 11/15] xen: arm: explicitly map 64 bit release address Ian Campbell
2013-11-22 16:24 ` [PATCH v2 12/15] xen: arm: enable synchronous console while starting secondary CPUs Ian Campbell
2013-11-22 17:36 ` Julien Grall
2013-11-22 17:49 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 13/15] xen: arm: Add debug keyhandler to dump the physical GIC state Ian Campbell
2013-11-22 16:37 ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 14/15] xen: arm: improve early memory map readability Ian Campbell
2013-11-22 16:24 ` [PATCH v2 15/15] xen: arm: handle 40-bit addresses in the p2m Ian Campbell
2013-11-28 17:41 ` Stefano Stabellini
2013-11-28 17:45 ` Ian Campbell
2015-01-22 11:11 ` [U-Boot] [PATCH] sunxi: Add support for Mele M5 Ian Campbell
2015-01-22 11:28 ` Hans de Goede
2015-01-22 11:29 ` Ian Campbell
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=528F8D8B.2070808@linaro.org \
--to=julien.grall@linaro.org \
--cc=anup.patel@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=pranavkumar@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.