Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62864
b: refs/heads/master
c: 3620fc1
h: refs/heads/master
v: v3
  • Loading branch information
Randy Vinson authored and Kumar Gala committed Jul 24, 2007
1 parent f0fe9a0 commit ff07be4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb12af43333dd9d54158f35147a79628c41152db
refs/heads/master: 3620fc1da28ad32d10d7c83eab33f48ec5b1da54
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/85xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config MPC8560_ADS
config MPC85xx_CDS
bool "Freescale MPC85xx CDS"
select DEFAULT_UIMAGE
select PPC_I8259
help
This option enables support for the MPC85xx CDS board

Expand Down
37 changes: 31 additions & 6 deletions trunk/arch/powerpc/platforms/85xx/mpc85xx_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/seq_file.h>
#include <linux/initrd.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/fsl_devices.h>

#include <asm/system.h>
Expand Down Expand Up @@ -119,16 +120,30 @@ DECLARE_PCI_FIXUP_EARLY(0x3fff, 0x1957, skip_fake_bridge);
DECLARE_PCI_FIXUP_EARLY(0xff3f, 0x5719, skip_fake_bridge);

#ifdef CONFIG_PPC_I8259
#warning The i8259 PIC support is currently broken
static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
static void mpc85xx_8259_cascade_handler(unsigned int irq,
struct irq_desc *desc)
{
unsigned int cascade_irq = i8259_irq();

if (cascade_irq != NO_IRQ)
/* handle an interrupt from the 8259 */
generic_handle_irq(cascade_irq);

desc->chip->eoi(irq);
/* check for any interrupts from the shared IRQ line */
handle_fasteoi_irq(irq, desc);
}

static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
{
return IRQ_HANDLED;
}

static struct irqaction mpc85xxcds_8259_irqaction = {
.handler = mpc85xx_8259_cascade_action,
.flags = IRQF_SHARED,
.mask = CPU_MASK_NONE,
.name = "8259 cascade",
};
#endif /* PPC_I8259 */
#endif /* CONFIG_PCI */

Expand All @@ -137,7 +152,7 @@ static void __init mpc85xx_cds_pic_init(void)
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
#ifdef CONFIG_PPC_I8259
#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
struct device_node *cascade_node = NULL;
int cascade_irq;
#endif
Expand Down Expand Up @@ -165,7 +180,7 @@ static void __init mpc85xx_cds_pic_init(void)

mpic_init(mpic);

#ifdef CONFIG_PPC_I8259
#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
/* Initialize the i8259 controller */
for_each_node_by_type(np, "interrupt-controller")
if (of_device_is_compatible(np, "chrp,iic")) {
Expand All @@ -187,7 +202,17 @@ static void __init mpc85xx_cds_pic_init(void)
i8259_init(cascade_node, 0);
of_node_put(cascade_node);

set_irq_chained_handler(cascade_irq, mpc85xx_8259_cascade);
/*
* Hook the interrupt to make sure desc->action is never NULL.
* This is required to ensure that the interrupt does not get
* disabled when the last user of the shared IRQ line frees their
* interrupt.
*/
if (setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))
printk(KERN_ERR "Failed to setup cascade interrupt\n");
else
/* Success. Connect our low-level cascade handler. */
set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler);
#endif /* CONFIG_PPC_I8259 */
}

Expand Down

0 comments on commit ff07be4

Please sign in to comment.