All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: vijay.kilari@gmail.com
Cc: stefano.stabellini@eu.citrix.com,
	Prasun.Kapoor@caviumnetworks.com,
	vijaya.kumar@caviumnetworks.com, julien.grall@linaro.org,
	tim@xen.org, xen-devel@lists.xen.org,
	stefano.stabellini@citrix.com, manish.jaggi@caviumnetworks.com
Subject: Re: [PATCH v2 2/4] xen/arm: Add GSER region to ThunderX platform mapping
Date: Thu, 5 Mar 2015 16:46:53 +0000	[thread overview]
Message-ID: <1425574013.25940.263.camel@citrix.com> (raw)
In-Reply-To: <1425449185-19017-3-git-send-email-vijay.kilari@gmail.com>

On Wed, 2015-03-04 at 11:36 +0530, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
> 
> Add GSER region to thunderx platfrom specific mappings.
> This region is not mentioned in DT. This is required by
> PCI driver to detect and configure pci devices attached.
> 
> In future we can remove this mapping, if pci driver
> in Dom does not require this.

How do we know what the PCI driver in dom0 needs? I don't think we can,
so we can in effect never remove this specific mapping, which is a
shame.

Unless you have some scheme in mind which would allow us to do so?

IMHO by far the best solution would be to add this device to the DTB so
that it is correctly mapped. I'm not quite sure what that will look like
since thne mainline DTB doesn't have the PCI node at all.

> 
> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
> ---
>  xen/arch/arm/platforms/thunderx.c |   26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/xen/arch/arm/platforms/thunderx.c b/xen/arch/arm/platforms/thunderx.c
> index be6f24f..563d01b 100644
> --- a/xen/arch/arm/platforms/thunderx.c
> +++ b/xen/arch/arm/platforms/thunderx.c
> @@ -19,6 +19,31 @@
>  
>  #include <asm/platform.h>
>  
> +static int thunderx_specific_mapping(struct domain *d)
> +{
> +    paddr_t addr;
> +    u64 size;
> +    int res;
> +
> +    /* Mapping GSER region required for Dom0 */
> +    addr = 0x87e090000000;
> +    size = 0xd000000;
> +
> +    res = map_mmio_regions(d,
> +                           paddr_to_pfn(addr & PAGE_MASK),
> +                           DIV_ROUND_UP(size, PAGE_SIZE),
> +                           paddr_to_pfn(addr & PAGE_MASK));
> +    if ( res )
> +    {
> +         printk(XENLOG_ERR "Unable to map GSER region to dom%d"
> +                " 0x%"PRIpaddr" - 0x%"PRIpaddr"\n",
> +                d->domain_id,
> +                addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
> +    }
> +
> +    return 0;
> +}
> +
>  static const char * const thunderx_dt_compat[] __initconst =
>  {
>      "cavium,thunder-88xx",
> @@ -27,6 +52,7 @@ static const char * const thunderx_dt_compat[] __initconst =
>  
>  PLATFORM_START(thunderx, "THUNDERX")
>      .compatible = thunderx_dt_compat,
> +    .specific_mapping = thunderx_specific_mapping,
>      .dom0_gnttab_start = 0x40000000000,
>      .dom0_gnttab_size = 0x20000,
>  PLATFORM_END

  reply	other threads:[~2015-03-05 16:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04  6:06 [PATCH v3 0/4] Add ThunderX platform support vijay.kilari
2015-03-04  6:06 ` [PATCH v3 1/4] xen/arm: " vijay.kilari
2015-03-04  6:06 ` [PATCH v2 2/4] xen/arm: Add GSER region to ThunderX platform mapping vijay.kilari
2015-03-05 16:46   ` Ian Campbell [this message]
2015-03-05 17:10     ` Ian Campbell
2015-03-17 13:02       ` Vijay Kilari
2015-03-17 13:53         ` Ian Campbell
2015-03-04  6:06 ` [PATCH v3 3/4] xen/arm: Add early printk support for ThunderX platform vijay.kilari
2015-03-05  9:15   ` Julien Grall
2015-03-05 16:40     ` Ian Campbell
2015-03-04  6:06 ` [PATCH v3 4/4] xen/arm: Don't pass the PSCI-0.2 node to DOM0 vijay.kilari
2015-03-05 17:26 ` [PATCH v3 0/4] Add ThunderX platform support 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=1425574013.25940.263.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.com \
    --cc=vijaya.kumar@caviumnetworks.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 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.