From: Grant Likely <grant.likely@secretlab.ca>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 06/12] MIPS: Octeon: Add a irq_create_of_mapping() implementation.
Date: Fri, 4 Mar 2011 18:07:46 -0700 [thread overview]
Message-ID: <20110305010746.GD7579@angua.secretlab.ca> (raw)
In-Reply-To: <1299267744-17278-7-git-send-email-ddaney@caviumnetworks.com>
On Fri, Mar 04, 2011 at 11:42:18AM -0800, David Daney wrote:
> This is needed for Octeon to use the Device Tree.
>
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> ---
> arch/mips/cavium-octeon/octeon-irq.c | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
> index b365710..b0a9261 100644
> --- a/arch/mips/cavium-octeon/octeon-irq.c
> +++ b/arch/mips/cavium-octeon/octeon-irq.c
> @@ -8,7 +8,9 @@
>
> #include <linux/interrupt.h>
> #include <linux/bitops.h>
> +#include <linux/module.h>
> #include <linux/percpu.h>
> +#include <linux/of_irq.h>
> #include <linux/irq.h>
> #include <linux/smp.h>
>
> @@ -64,6 +66,29 @@ static void __init octeon_irq_set_ciu_mapping(int irq, int line, int bit,
> octeon_irq_ciu_to_irq[line][bit] = irq;
> }
>
> +/*
> + * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
> + *
> + * Octeon irq maps are a pair of indexes. The first selects either
> + * ciu0 or ciu1, the second is the bit within the ciu register.
> + */
Is each 'ciu' an interrupt controller, or a 'bank' within the
controller? Also, it is typical to have another cell for specifying
flags if there is any kind of configuration for each irq line, like
edge vs. level and active high or active low. (the counter example is
PCI which doesn't use a flags cell because all PCI irqs are level
active.
You'll need to supply documentation for the ciu binding to
Documentation/devicetree/bindings before this patch gets merged.
> +unsigned int irq_create_of_mapping(struct device_node *controller,
> + const u32 *intspec, unsigned int intsize)
> +{
> + int ciu, bit;
> + unsigned int irq = 0;
> +
> + ciu = be32_to_cpup(intspec);
> + bit = be32_to_cpup(intspec + 1);
> +
> + if (ciu < 8 && bit < 64)
> + irq = octeon_irq_ciu_to_irq[ciu][bit];
> +
> + return irq;
> +}
> +EXPORT_SYMBOL_GPL(irq_create_of_mapping);
> +
> +
> static int octeon_coreid_for_cpu(int cpu)
> {
> #ifdef CONFIG_SMP
> --
> 1.7.2.3
>
next prev parent reply other threads:[~2011-03-05 1:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 19:42 [RFC PATCH v2 00/12] MIPS: Octeon: Use Device Tree David Daney
2011-03-04 19:42 ` [RFC PATCH v2 01/12] MIPS: Octeon: Move some Ethernet support files out of staging David Daney
2011-03-04 19:42 ` [RFC PATCH v2 02/12] of: Allow scripts/dtc/libfdt to be used from kernel code David Daney
[not found] ` <1299267744-17278-3-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2011-03-05 0:57 ` Grant Likely
[not found] ` <20110305005750.GC7579-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-03-05 0:59 ` Grant Likely
2011-03-05 22:04 ` Sam Ravnborg
2011-03-05 8:24 ` David Gibson
[not found] ` <1299267744-17278-1-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2011-03-04 19:42 ` [RFC PATCH v2 03/12] of: Make of_find_node_by_path() traverse /aliases for relative paths David Daney
2011-03-04 21:55 ` Grant Likely
2011-03-04 19:42 ` [RFC PATCH v2 04/12] MIPS: Octeon: Add device tree source files David Daney
[not found] ` <1299267744-17278-5-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2011-03-05 1:15 ` Grant Likely
2011-03-04 19:42 ` [RFC PATCH v2 05/12] MIPS: Prune some target specific code out of prom.c David Daney
2011-03-04 19:42 ` [RFC PATCH v2 06/12] MIPS: Octeon: Add a irq_create_of_mapping() implementation David Daney
2011-03-05 1:07 ` Grant Likely [this message]
2011-03-11 18:27 ` David Daney
2011-03-04 19:42 ` [RFC PATCH v2 08/12] MIPS: Octeon: Initialize and fixup device tree David Daney
[not found] ` <1299267744-17278-9-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2011-03-05 3:05 ` Grant Likely
2011-03-04 19:42 ` [RFC PATCH v2 09/12] i2c: Convert i2c-octeon.c to use " David Daney
2011-03-04 19:42 ` [RFC PATCH v2 10/12] netdev: mdio-octeon.c: Convert " David Daney
2011-03-04 21:10 ` David Miller
2011-03-04 19:42 ` [RFC PATCH v2 11/12] netdev: octeon_mgmt: " David Daney
2011-03-04 21:10 ` David Miller
2011-03-04 19:42 ` [RFC PATCH v2 12/12] staging: octeon_ethernet: " David Daney
2011-03-04 21:10 ` David Miller
2011-03-04 19:42 ` [RFC PATCH v2 07/12] MIPS: Octeon: Rearrance CVMX files in preperation for " David Daney
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=20110305010746.GD7579@angua.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=ddaney@caviumnetworks.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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).