Skip to content

Commit

Permalink
irq_domain/mips: Allow irq_domain on MIPS
Browse files Browse the repository at this point in the history
This patch makes IRQ_DOMAIN usable on MIPS.  It uses an ugly workaround
to preserve current behaviour so that MIPS has time to add irq_domain
registration to the irq controller drivers.  The workaround will be
removed in Linux v3.6

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
  • Loading branch information
Grant Likely committed Feb 24, 2012
1 parent b4e5185 commit abd2363
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
1 change: 1 addition & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2327,6 +2327,7 @@ config USE_OF
bool "Flattened Device Tree support"
select OF
select OF_EARLY_FLATTREE
select IRQ_DOMAIN
help
Include support for flattened device tree machine descriptions.

Expand Down
5 changes: 1 addition & 4 deletions arch/mips/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@

#include <linux/linkage.h>
#include <linux/smp.h>
#include <linux/irqdomain.h>

#include <asm/mipsmtregs.h>

#include <irq.h>

static inline void irq_dispose_mapping(unsigned int virq)
{
}

#ifdef CONFIG_I8259
static inline int irq_canonicalize(int irq)
{
Expand Down
14 changes: 0 additions & 14 deletions arch/mips/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,6 @@ void __init early_init_dt_setup_initrd_arch(unsigned long start,
}
#endif

/*
* irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
*
* Currently the mapping mechanism is trivial; simple flat hwirq numbers are
* mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
* supported.
*/
unsigned int irq_create_of_mapping(struct device_node *controller,
const u32 *intspec, unsigned int intsize)
{
return intspec[0];
}
EXPORT_SYMBOL_GPL(irq_create_of_mapping);

void __init early_init_devtree(void *params)
{
/* Setup flat device-tree pointer */
Expand Down
12 changes: 12 additions & 0 deletions kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ unsigned int irq_create_of_mapping(struct device_node *controller,

domain = controller ? irq_find_host(controller) : irq_default_domain;
if (!domain) {
#ifdef CONFIG_MIPS
/*
* Workaround to avoid breaking interrupt controller drivers
* that don't yet register an irq_domain. This is temporary
* code. ~~~gcl, Feb 24, 2012
*
* Scheduled for removal in Linux v3.6. That should be enough
* time.
*/
if (intsize > 0)
return intspec[0];
#endif
printk(KERN_WARNING "irq: no irq domain found for %s !\n",
controller->full_name);
return 0;
Expand Down

0 comments on commit abd2363

Please sign in to comment.