All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org,
	julien.grall@linaro.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/2] xen/arm: gic: Refactor the code for creating gic node
Date: Fri, 8 May 2015 16:15:38 +0100	[thread overview]
Message-ID: <1431098138.2660.502.camel@citrix.com> (raw)
In-Reply-To: <1429764720-2866-2-git-send-email-Suravee.Suthikulpanit@amd.com>

On Wed, 2015-04-22 at 23:51 -0500, Suravee Suthikulpanit wrote:
> Since fdt_begin_node() is called by all gicXX_make_dt_node() to create
> the interrupt-controller devicetree node, this patch refactors the call
> and moves it inside make_gic_node(). This also matches the fdt_end_node()
> call at the end of make_gic_node().
> 
> This patch also move the call to gic_make_node() wrapper to be after all
> other generic properties are setup. This allows creating sub-node inside
> gic_make_node() in order to support v2m sub-node.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  xen/arch/arm/domain_build.c | 18 +++++++++++++++---
>  xen/arch/arm/gic-hip04.c    |  4 ----
>  xen/arch/arm/gic-v2.c       |  4 ----
>  xen/arch/arm/gic-v3.c       |  4 ----
>  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 987ee1e..a2cd471 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -808,8 +808,8 @@ static int make_gic_node(const struct domain *d, void *fdt,
>  {
>      const struct dt_device_node *gic = dt_interrupt_controller;
>      int res = 0;
> -    const void *addrcells;
> -    u32 addrcells_len;
> +    const void *addrcells, *sizecells;
> +    u32 addrcells_len, sizecells_len;
>  
>      /*
>       * Xen currently supports only a single GIC. Discard any secondary
> @@ -823,7 +823,7 @@ static int make_gic_node(const struct domain *d, void *fdt,
>  
>      DPRINT("Create gic node\n");
>  
> -    res = gic_make_node(d, node, fdt);
> +    res = fdt_begin_node(fdt, "interrupt-controller");
>      if ( res )
>          return res;
>  
> @@ -847,6 +847,14 @@ static int make_gic_node(const struct domain *d, void *fdt,
>              return res;
>      }
>  
> +    sizecells = dt_get_property(gic, "#size-cells", &sizecells_len);
> +    if ( sizecells )
> +    {
> +        res = fdt_property(fdt, "#size-cells", sizecells, sizecells_len);
> +        if ( res )
> +            return res;
> +    }
> +
>      res = fdt_property_cell(fdt, "#interrupt-cells", 3);
>      if ( res )
>          return res;
> @@ -855,6 +863,10 @@ static int make_gic_node(const struct domain *d, void *fdt,
>      if ( res )
>          return res;
>  
> +    res = gic_make_node(d, node, fdt);
> +    if ( res )
> +        return res;
> +
>      res = fdt_end_node(fdt);
>  
>      return res;
> diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c
> index 223c414..6d527f1 100644
> --- a/xen/arch/arm/gic-hip04.c
> +++ b/xen/arch/arm/gic-hip04.c
> @@ -628,10 +628,6 @@ static int hip04gic_make_dt_node(const struct domain *d,
>      compatible = DT_COMPAT_GIC_CORTEX_A15;
>      len = strlen((char*) compatible) + 1;
>  
> -    res = fdt_begin_node(fdt, "interrupt-controller");
> -    if ( res )
> -        return res;
> -
>      res = fdt_property(fdt, "compatible", compatible, len);
>      if ( res )
>          return res;
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index 073fec2..80acc62 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -616,10 +616,6 @@ static int gicv2_make_dt_node(const struct domain *d,
>          return -FDT_ERR_XEN(ENOENT);
>      }
>  
> -    res = fdt_begin_node(fdt, "interrupt-controller");
> -    if ( res )
> -        return res;
> -
>      res = fdt_property(fdt, "compatible", compatible, len);
>      if ( res )
>          return res;
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index e9a8eda..db498ed 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -1098,10 +1098,6 @@ static int gicv3_make_dt_node(const struct domain *d,
>          return -FDT_ERR_XEN(ENOENT);
>      }
>  
> -    res = fdt_begin_node(fdt, "interrupt-controller");
> -    if ( res )
> -        return res;
> -
>      res = fdt_property(fdt, "compatible", compatible, len);
>      if ( res )
>          return res;

  reply	other threads:[~2015-05-08 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  4:51 [PATCH 0/2] Introducing GICv2m Supports Suravee Suthikulpanit
2015-04-23  4:51 ` [PATCH 1/2] xen/arm: gic: Refactor the code for creating gic node Suravee Suthikulpanit
2015-05-08 15:15   ` Ian Campbell [this message]
2015-04-23  4:52 ` [PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0 Suravee Suthikulpanit
2015-05-08 15:37   ` Ian Campbell
2015-04-25 16:24 ` [PATCH 0/2] Introducing GICv2m Supports Julien Grall

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=1431098138.2660.502.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=julien.grall@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.