lkml.org 
[lkml]   [2011]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 04/10] MIPS: Octeon: Add a irq_create_of_mapping() implementation.
    Date
    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.
    + */
    +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


    \
     
     \ /
      Last update: 2011-02-22 22:03    [W:4.083 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site