From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin()
Date: Mon, 01 Apr 2013 12:44:17 +0000 [thread overview]
Message-ID: <51598121.9010005@cogentembedded.com> (raw)
In-Reply-To: <87d2uf56kt.wl%kuninori.morimoto.gx@renesas.com>
Hello.
On 01-04-2013 6:27, Kuninori Morimoto wrote:
> This patch adds r8a7778_init_irq_extpin() for IRQ0 - IRQ3.
> But this patch doesn't enable DT settings on r8a7778.dts,
> because R8A7778 chip external IRQ depends on
> IRQ0 - IRQ3 pin encoding which came from platform board
> implementation.
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[...]
> diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
> index 57d6b0e..2882305 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7778.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7778.c
[...]
> @@ -110,6 +111,49 @@ void __init r8a7778_add_standard_devices(void)
> r8a7778_register_tmu(1);
> }
>
> +static struct renesas_intc_irqpin_config irqpin_platform_data = {
> + .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
> + .sense_bitfield_width = 2,
> +};
> +
> +static struct resource irqpin_resources[] = {
> + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
> + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
> + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
> + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
> + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
Hm, why this can't be passed as a single large memory resource?
> + DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */
> + DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */
> + DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */
> + DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */
> +};
> +
> +void __init r8a7778_init_irq_extpin(int irlm)
> +{
> + void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
4 bytes seems enough.
> + unsigned long tmp;
> +
> + if (!icr0) {
> + pr_warn("r8a7778: unable to setup external irq pin mode\n");
> + return;
> + }
> +
> + tmp = ioread32(icr0);
> + if (irlm)
> + tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
> + else
> + tmp &= ~(1 << 23); /* IRL mode - not supported */
> + tmp |= (1 << 21); /* LVLMODE = 1 */
() not needed here.
WBR, Sergei
next prev parent reply other threads:[~2013-04-01 12:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto
2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto
2013-03-29 8:37 ` Magnus Damm
2013-04-01 0:41 ` Kuninori Morimoto
2013-03-22 7:14 ` [RFC][PATCH 2/3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto
2013-03-22 7:15 ` [RFC][PATCH 3/3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto
2013-03-27 5:34 ` [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Simon Horman
2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto
2013-04-01 2:26 ` [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto
2013-04-01 2:27 ` [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto
2013-04-01 12:44 ` Sergei Shtylyov [this message]
2013-04-02 0:11 ` Kuninori Morimoto
2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto
2013-04-01 12:50 ` Sergei Shtylyov
2013-04-02 0:13 ` Kuninori Morimoto
2013-04-02 2:24 ` Simon Horman
2013-04-02 3:25 ` Kuninori Morimoto
2013-04-10 9:33 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add pinctrl support Kuninori Morimoto
2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto
2013-04-02 4:19 ` [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto
2013-04-02 4:19 ` [PATCH 2/5 v3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto
2013-04-02 4:20 ` [PATCH 3/5 v3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto
2013-04-02 4:20 ` [PATCH 4/5 v3] ARM: shmobile: bockw: enable network settings on bootargs Kuninori Morimoto
2013-04-02 4:20 ` [PATCH 5/5 v3] ARM: shmobile: bockw: enable SMSC ethernet on defconfig Kuninori Morimoto
2013-04-03 8:19 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Magnus Damm
2013-04-04 6:52 ` Simon Horman
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=51598121.9010005@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-arm-kernel@lists.infradead.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).