-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc/85xx: separate cpm2 pic init
Separate handling of CPM2 PIC initialization to mpc85xx_cpm2_pic_init() function. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
- Loading branch information
Dmitry Eremin-Solenikov
authored and
Kumar Gala
committed
Nov 24, 2011
1 parent
5d71349
commit 543a07b
Showing
16 changed files
with
89 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef MPC85xx_H | ||
#define MPC85xx_H | ||
#ifdef CONFIG_CPM2 | ||
extern void mpc85xx_cpm2_pic_init(void); | ||
#else | ||
static inline void __init mpc85xx_cpm2_pic_init(void) {} | ||
#endif /* CONFIG_CPM2 */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Routines common to most mpc85xx-based boards. | ||
* | ||
* This is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/of_platform.h> | ||
|
||
#include <sysdev/cpm2_pic.h> | ||
|
||
#include "mpc85xx.h" | ||
|
||
#ifdef CONFIG_CPM2 | ||
static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
{ | ||
struct irq_chip *chip = irq_desc_get_chip(desc); | ||
int cascade_irq; | ||
|
||
while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
generic_handle_irq(cascade_irq); | ||
|
||
chip->irq_eoi(&desc->irq_data); | ||
} | ||
|
||
|
||
void __init mpc85xx_cpm2_pic_init(void) | ||
{ | ||
struct device_node *np; | ||
int irq; | ||
|
||
/* Setup CPM2 PIC */ | ||
np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
if (np == NULL) { | ||
printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
return; | ||
} | ||
irq = irq_of_parse_and_map(np, 0); | ||
if (irq == NO_IRQ) { | ||
of_node_put(np); | ||
printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | ||
return; | ||
} | ||
|
||
cpm2_pic_init(np); | ||
of_node_put(np); | ||
irq_set_chained_handler(irq, cpm2_cascade); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.