From: Julien Grall <julien.grall@linaro.org>
To: Frediano Ziglio <frediano.ziglio@huawei.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Tim Deegan <tim@xen.org>
Cc: zoltan.kiss@huawei.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v6 3/5] xen/arm: Make gic-v2 code handle hip04-d01 platform
Date: Thu, 26 Feb 2015 13:23:29 +0000 [thread overview]
Message-ID: <54EF1E51.1060108@linaro.org> (raw)
In-Reply-To: <5342925d55a667f7073f66a57194e46060d2e66e.1424954171.git.frediano.ziglio@huawei.com>
Hi Frediano,
On 26/02/15 12:40, Frediano Ziglio wrote:
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index c2dcb49..0834053 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1038,6 +1038,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
> static const struct dt_device_match gic_matches[] __initconst =
> {
> DT_MATCH_GIC_V2,
> + DT_MATCH_GIC_HIP04,
> DT_MATCH_GIC_V3,
> { /* sentinel */ },
> };
I think this is the perfect time to introduce a callback to check if the
node is a GIC.
This would avoid to grow up this structure.
[..]
> -static const char * const gicv2_dt_compat[] __initconst =
> +static const char * const hip04gic_dt_compat[] __initconst =
> {
> - DT_COMPAT_GIC_CORTEX_A15,
> - DT_COMPAT_GIC_CORTEX_A7,
> - DT_COMPAT_GIC_400,
> + DT_COMPAT_GIC_HIP04,
> NULL
> };
>
> -DT_DEVICE_START(gicv2, "GICv2:", DEVICE_GIC)
> - .compatible = gicv2_dt_compat,
> - .init = gicv2_init,
> +DT_DEVICE_START(hip04gic, "GIC-HIP04:", DEVICE_GIC)
The ":" was a mistake in the GICv2. Please don't reproduce it here.
> + .compatible = hip04gic_dt_compat,
> + .init = hip04gic_init,
> DT_DEVICE_END
>
> /*
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 390c8b0..e4512a8 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -565,12 +565,13 @@ static void do_sgi(struct cpu_user_regs *regs, enum gic_sgi sgi)
> void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
> {
> unsigned int irq;
> + unsigned int max_irq = gic_hw_ops->info->nr_lines;
>
> do {
> /* Reading IRQ will ACK it */
> irq = gic_hw_ops->read_irq();
>
> - if ( likely(irq >= 16 && irq < 1021) )
> + if ( likely(irq >= 16 && irq < max_irq) )
> {
> local_irq_enable();
> do_IRQ(regs, irq, is_fiq);
This change should belong to a separate patch.
> diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
> index 187dc46..a36f486 100644
> --- a/xen/include/asm-arm/gic.h
> +++ b/xen/include/asm-arm/gic.h
> @@ -160,6 +160,10 @@
> DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7), \
> DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_400)
>
> +#define DT_COMPAT_GIC_HIP04 "hisilicon,hip04-intc"
> +
> +#define DT_MATCH_GIC_HIP04 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_HIP04)
> +
> #define DT_COMPAT_GIC_V3 "arm,gic-v3"
>
> #define DT_MATCH_GIC_V3 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_V3)
I would prefer if we avoid to add more compatibles like that in gic.h.
I have a patch to drop a part of this mess. I would advise your to use
cherry-pick the commit [1] in your branch.
[1]
http://xenbits.xen.org/gitweb/?p=people/julieng/xen-unstable.git;a=commit;h=7ba87910e557b06c589c3c0fbc6757fa664d029e
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-02-26 13:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 12:40 [PATCH v6 0/5] xen/arm: Add support for Huawei hip04-d01 platform Frediano Ziglio
2015-02-26 12:40 ` [PATCH v6 1/5] xen/arm: Duplicate gic-v2.c file to support hip04 platform version Frediano Ziglio
2015-02-26 13:14 ` Julien Grall
2015-02-26 14:31 ` Frediano Ziglio
2015-02-26 15:19 ` Julien Grall
2015-02-26 15:31 ` Frediano Ziglio
2015-02-26 12:40 ` [PATCH v6 2/5] xen/arm: Add HAS_NON_STANDARD_DRIVERS build option to arm Frediano Ziglio
2015-02-26 12:40 ` [PATCH v6 3/5] xen/arm: Make gic-v2 code handle hip04-d01 platform Frediano Ziglio
2015-02-26 13:23 ` Julien Grall [this message]
2015-02-26 14:45 ` Frediano Ziglio
2015-02-26 15:20 ` Julien Grall
2015-02-26 16:40 ` Frediano Ziglio
2015-02-26 12:40 ` [PATCH v6 4/5] xen/arm: handle GICH register changes for " Frediano Ziglio
2015-02-26 12:40 ` [PATCH v6 5/5] xen/arm: Force dom0 to use normal GICv2 driver on Hip04 platform Frediano Ziglio
2015-02-26 13:24 ` [PATCH v6 0/5] xen/arm: Add support for Huawei hip04-d01 platform Julien Grall
2015-02-27 16:09 ` Frediano Ziglio
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=54EF1E51.1060108@linaro.org \
--to=julien.grall@linaro.org \
--cc=frediano.ziglio@huawei.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
--cc=zoltan.kiss@huawei.com \
/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.