09 Nov, 2013

1 commit


24 Oct, 2013

4 commits

  • All the users of of_irq_parse_raw pass in a raw interrupt specifier from
    the device tree and expect it to be returned (possibly modified) in an
    of_phandle_args structure. However, the primary function of
    of_irq_parse_raw() is to check for translations due to the presence of
    one or more interrupt-map properties. The actual placing of the data
    into an of_phandle_args structure is trivial. If it is refactored to
    accept an of_phandle_args structure directly, then it becomes possible
    to consume of_phandle_args from other sources. This is important for an
    upcoming patch that allows a device to be connected to more than one
    interrupt parent. It also simplifies the code a bit.

    The biggest complication with this patch is that the old version works
    on the interrupt specifiers in __be32 form, but the of_phandle_args
    structure is intended to carry it in the cpu-native version. A bit of
    churn was required to make this work. In the end it results in tighter
    code, so the churn is worth it.

    Signed-off-by: Grant Likely
    Acked-by: Tony Lindgren
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • All the callers of irq_create_of_mapping() pass the contents of a struct
    of_phandle_args structure to the function. Since all the callers already
    have an of_phandle_args pointer, why not pass it directly to
    irq_create_of_mapping()?

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Thomas Gleixner
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • struct of_irq and struct of_phandle_args are exactly the same structure.
    This patch makes the kernel use of_phandle_args everywhere. This in
    itself isn't a big deal, but it makes some follow-on patches simpler.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • The OF irq handling code has been overloading the term 'map' to refer to
    both parsing the data in the device tree and mapping it to the internal
    linux irq system. This is probably because the device tree does have the
    concept of an 'interrupt-map' function for translating interrupt
    references from one node to another, but 'map' is still confusing when
    the primary purpose of some of the functions are to parse the DT data.

    This patch renames all the of_irq_map_* functions to of_irq_parse_*
    which makes it clear that there is a difference between the parsing
    phase and the mapping phase. Kernel code can make use of just the
    parsing or just the mapping support as needed by the subsystem.

    The patch was generated mechanically with a handful of sed commands.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     

25 Sep, 2013

1 commit

  • Much of of_irq.h is needlessly ifdef'ed. Clean this up and minimize the
    amount ifdef'ed code. This fixes some build warnings when CONFIG_OF
    is not enabled (seen on i386 and x86_64):

    include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default]
    include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
    include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]

    Compile tested on i386, sparc and arm.

    Reported-by: Randy Dunlap
    Cc: Grant Likely
    Signed-off-by: Rob Herring

    Rob Herring
     

18 Oct, 2012

1 commit

  • drivers/of/irq.c:195:57: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:196:51: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:199:57: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:201:58: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:470:37: warning: incorrect type in assignment (different modifiers)
    drivers/of/irq.c:470:37: expected int ( *[usertype] irq_init_cb )( ... )
    drivers/of/irq.c:470:37: got void const *const data
    drivers/of/irq.c:96:5: error: symbol 'of_irq_map_raw' redeclared with different type (originally declared at include/linux/of_irq.h:61) - incompatible argument 2 (different base types)

    drivers/of/of_pci_irq.c:91:40: warning: incorrect type in argument 2 (different base types)
    drivers/of/of_pci_irq.c:91:40: expected unsigned int const [usertype] *intspec
    drivers/of/of_pci_irq.c:91:40: got restricted __be32 *
    drivers/of/of_pci_irq.c:91:53: warning: incorrect type in argument 4 (different base types)
    drivers/of/of_pci_irq.c:91:53: expected unsigned int const [usertype] *addr
    drivers/of/of_pci_irq.c:91:53: got restricted __be32 *

    Signed-off-by: Kim Phillips
    Signed-off-by: Rob Herring

    Kim Phillips
     

20 Sep, 2012

1 commit

  • of_irq_find_parent is a handy function to use outside the confines of
    the Open Firmware subsystem. One such use-case is when the IRQ Domain
    wishes to find an IRQ domain for a given device node. Currently it can
    not take any notice of the 'interrupt-parent' property. Instead it
    just uses the first IRQ controller as it climbs the Device Tree. If
    we were to use this as a precursor the resultant controller is more
    likely to be correct.

    Acked-by: Rob Herring
    Acked-by: Linus Walleij
    Signed-off-by: Lee Jones

    Lee Jones
     

18 Apr, 2012

1 commit

  • Add a empty irq_of_parse_and_map() function that returns 0 for non-dt
    builds and avoid having #ifdef CONFIG_OF around all calls to
    irq_of_parse_and_map(). In addition to that, the irq_of_parse_and_map()
    function declaration is made available only if CONFIG_OF_IRQ is defined,
    which is the same config option that makes the irq_of_parse_and_map()
    function definition available. While at it, fix a typo as well.

    Changes since v1:
    - Moved irq_of_parse_and_map() function declaration under CONFIG_OF_IRQ.
    - Fix a minor typo in comments.

    Suggested-by: Grant Likely
    Signed-off-by: Thomas Abraham
    Acked-by: Rob Herring
    [grant.likely: fix bug causing SPARC to break]
    Signed-off-by: Grant Likely

    Thomas Abraham
     

27 Feb, 2012

1 commit

  • Several architectures define their own empty irq_dispose_mapping(). Since
    the irq_domain code is centralized now, there is little need to do so. This
    patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
    selected.

    The patch also means that IRQ_DOMAIN becomes selectable on all architectures.

    Signed-off-by: Grant Likely
    Cc: Rob Herring
    Cc: "David S. Miller"
    Cc: Jonas Bonn
    Cc: sparclinux@vger.kernel.org
    Cc: linux@lists.openrisc.net

    Grant Likely
     

31 Oct, 2011

1 commit

  • of_irq_init will scan the devicetree for matching interrupt controller
    nodes. Then it calls an initialization function for each found controller
    in the proper order with parent nodes initialized before child nodes.

    Based on initial pseudo code from Grant Likely.

    Changes in v4:
    - Drop unnecessary empty list check
    - Be more verbose on errors
    - Simplify "if (!desc) WARN_ON(1)" to "if (WARN_ON(!desc))"

    Changes in v3:
    - add missing kfree's found by Jamie
    - Implement Grant's comments to simplify the init loop
    - fix function comments

    Changes in v2:
    - Complete re-write of list searching code from Grant Likely

    Signed-off-by: Rob Herring
    Reviewed-by: Jamie Iles
    Tested-by: Thomas Abraham
    Acked-by: Grant Likely

    Rob Herring
     

28 Jul, 2011

1 commit

  • This patch adds irq_domain infrastructure for translating from
    hardware irq numbers to linux irqs. This is particularly important
    for architectures adding device tree support because the current
    implementation (excluding PowerPC and SPARC) cannot handle
    translation for more than a single interrupt controller. irq_domain
    supports device tree translation for any number of interrupt
    controllers.

    This patch converts x86, Microblaze, ARM and MIPS to use irq_domain
    for device tree irq translation. x86 is untested beyond compiling it,
    irq_domain is enabled for MIPS and Microblaze, but the old behaviour is
    preserved until the core code is modified to actually register an
    irq_domain yet. On ARM it works and is required for much of the new
    ARM device tree board support.

    PowerPC has /not/ been converted to use this new infrastructure. It
    is still missing some features before it can replace the virq
    infrastructure already in powerpc (see documentation on
    irq_domain_map/unmap for details). Followup patches will add the
    missing pieces and migrate PowerPC to use irq_domain.

    SPARC has its own method of managing interrupts from the device tree
    and is unaffected by this change.

    Acked-by: Ralf Baechle
    Signed-off-by: Grant Likely

    Grant Likely
     

20 Apr, 2011

1 commit


22 Oct, 2010

1 commit


13 Oct, 2010

1 commit


06 Jul, 2010

1 commit

  • Merge common irq mapping code between PowerPC and Microblaze.

    This patch merges of_irq_find_parent(), of_irq_map_raw() and
    of_irq_map_one(). The functions are dependent on one another, so all
    three are merged in a single patch. Other than cosmetic difference
    (ie. DBG() vs. pr_debug()), the implementations are identical.

    of_irq_to_resource() is also merged, but in this case the
    implementations are different. This patch drops the microblaze version
    and uses the powerpc implementation unchanged. The microblaze version
    essentially open-coded irq_of_parse_and_map() which it does not need
    to do. Therefore the powerpc version is safe to adopt.

    Signed-off-by: Grant Likely
    CC: Michal Simek
    CC: Benjamin Herrenschmidt
    CC: Stephen Rothwell

    Grant Likely
     

29 Jun, 2010

1 commit

  • Merge common code between PowerPC and Microblaze. SPARC implements
    irq_of_parse_and_map(), but the implementation is different, so it
    does not use this code.

    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    Cc: Michal Simek
    Cc: "David S. Miller"
    Cc: Stephen Rothwell
    Cc: Jeremy Kerr

    Grant Likely