From: Kumar Gala <galak@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev@ozlabs.org
Subject: [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
Date: Mon, 23 Jul 2007 15:50:06 -0500 [thread overview]
Message-ID: <11852238411823-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <11852238392809-git-send-email-galak@kernel.crashing.org>
From: Randy Vinson <rvinson@mvista.com>
The Freescale MPC8555CDS and MPC8548CDS reference hardware has a legacy
8259 interrupt controller pair contained within a VIA VT82C686B Southbridge
on the main carrier board. The processor complex plugs into the carrier
card using a PCI slot which limits the available interrupts to the
INTA-INTD PCI interrupts. The output of the 8259 cascade pair is routed
through a gate array and connected to the PCI INTA interrupt line.
The normal interrupt chaining hook (set_irq_chained_handler) does
not allow sharing of the chained interrupt which prevents the
use of PCI INTA by PCI devices. This patch allows the 8259 cascade
pair to share their interrupt line with PCI devices.
NOTE: The addition of the .end routine for the MPIC is not strictly
necessary for this patch. It's there so this code will run from within
the threaded interrupt context used by the Real Time patch.
Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/85xx/Kconfig | 1 +
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 37 ++++++++++++++++++++++++----
arch/powerpc/sysdev/mpic.c | 1 +
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 99bb74d..f581840 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -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
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 71200bd..81b7062 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -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>
@@ -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 */
@@ -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
@@ -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")) {
@@ -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 */
}
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 74c64c0..17ece50 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -836,6 +836,7 @@ static struct irq_chip mpic_irq_chip = {
.mask = mpic_mask_irq,
.unmask = mpic_unmask_irq,
.eoi = mpic_end_irq,
+ .end = mpic_unmask_irq,
.set_type = mpic_set_irq_type,
};
--
1.5.2.2
next prev parent reply other threads:[~2007-07-23 20:51 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 20:49 [PATCH 00/25] Freescale PCI/PCIe support/fixup/cleanup Kumar Gala
2007-07-23 20:49 ` [PATCH 01/25] [POWERPC] Create common fsl pci/e files based on 86xx platforms Kumar Gala
2007-07-23 20:49 ` [PATCH 02/25] [POWERPC] Rewrite Freescale PCI/PCIe support for 8{3, 5, 6}xx Kumar Gala
2007-07-23 20:49 ` [PATCH 03/25] [POWERPC] Add the ability to find PCI capabilities early on Kumar Gala
2007-07-23 20:49 ` [PATCH 04/25] [POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link Kumar Gala
2007-07-23 20:49 ` [PATCH 05/25] [POWERPC] FSL: Cleanup how we detect if we are a PCIe controller Kumar Gala
2007-07-23 20:49 ` [PATCH 06/25] [POWERPC] Add 8548 CDS PCI express controller node and PCI-X device node Kumar Gala
2007-07-23 20:49 ` [PATCH 07/25] [POWERPC] Update PCI nodes in the 83xx/85xx boards device tree Kumar Gala
2007-07-23 20:49 ` [PATCH 08/25] [POWERPC] Use Freescale pci/pcie common code for 85xx boards Kumar Gala
2007-07-23 20:49 ` [PATCH 09/25] [POWERPC] Add basic PCI node for mpc8568mds board Kumar Gala
2007-07-23 20:49 ` [PATCH 10/25] [POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected Kumar Gala
2007-07-23 20:49 ` [PATCH 11/25] [POWERPC] 85xx: Added 8568 PCIe support Kumar Gala
2007-07-23 20:49 ` [PATCH 12/25] [POWERPC] 85xx: Add quirk to ignore bogus FPGA on CDS Kumar Gala
2007-07-23 20:50 ` [PATCH 13/25] [POWERPC] Removed setup_indirect_pci_nomap Kumar Gala
2007-07-23 20:50 ` [PATCH 14/25] [POWERPC] Make endianess of cfg_addr for indirect pci ops runtime Kumar Gala
2007-07-23 20:50 ` [PATCH 15/25] [POWERPC] Add basic PCI/PCI Express support for 8544DS board Kumar Gala
2007-07-23 20:50 ` [PATCH 16/25] [POWERPC] Provide ability to setup P2P bridge registers from struct resource Kumar Gala
2007-07-23 20:50 ` [PATCH 17/25] [POWERPC] Make sure virtual P2P bridge registers are setup on PCIe PHB Kumar Gala
2007-07-23 20:50 ` [PATCH 18/25] [POWERPC] FSL: Add support for PCI-X controllers Kumar Gala
2007-07-23 20:50 ` Kumar Gala [this message]
2007-07-23 20:50 ` [PATCH 20/25] [POWERPC] 85xxCDS: Make sure restart resets the PCI bus Kumar Gala
2007-07-23 20:50 ` [PATCH 21/25] [POWERPC] 85xxCDS: Delay 8259 cascade hookup Kumar Gala
2007-07-23 20:50 ` [PATCH 22/25] [POWERPC] 85xxCDS: Misc 8548 PCI Corrections Kumar Gala
2007-07-23 20:50 ` [PATCH 23/25] [POWERPC] 85xxCDS: MPC8548 DTS cleanup Kumar Gala
2007-07-23 20:50 ` [PATCH 24/25] [POWERPC] Add Freescale PCI VENDOR ID and 8641 device IDs Kumar Gala
2007-07-23 20:50 ` [PATCH 25/25] [POWERPC] 85xx: Added needed MPC85xx PCI " Kumar Gala
2007-07-23 21:30 ` [PATCH 23/25] [POWERPC] 85xxCDS: MPC8548 DTS cleanup Scott Wood
2007-07-24 11:52 ` [PATCH 21/25] [POWERPC] 85xxCDS: Delay 8259 cascade hookup Paul Mackerras
2007-07-24 15:34 ` Kumar Gala
2007-07-24 1:48 ` [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line Benjamin Herrenschmidt
2007-07-24 2:47 ` Kumar Gala
2007-07-24 3:41 ` Kumar Gala
2007-07-24 1:45 ` [PATCH 16/25] [POWERPC] Provide ability to setup P2P bridge registers from struct resource Benjamin Herrenschmidt
2007-07-24 1:43 ` [PATCH 14/25] [POWERPC] Make endianess of cfg_addr for indirect pci ops runtime Benjamin Herrenschmidt
2007-07-24 2:30 ` Kumar Gala
2007-07-24 1:40 ` [PATCH 13/25] [POWERPC] Removed setup_indirect_pci_nomap Benjamin Herrenschmidt
2007-07-24 1:39 ` [PATCH 04/25] [POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link Benjamin Herrenschmidt
2007-07-24 2:28 ` Kumar Gala
2007-07-24 1:37 ` [PATCH 03/25] [POWERPC] Add the ability to find PCI capabilities early on Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11852238411823-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).