summaryrefslogtreecommitdiff
path: root/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2005-11-10 09:43:10 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-11-10 09:43:10 +0000
commit840957918e8bc5ba84904b876daefde836a53c69 (patch)
tree2f02c5f4bc5eeb4450e12925001499345a35ca6a /packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c
parent9771ba7e50e279c8f6757b4354634d568be0b23f (diff)
nas100d-kernel: Added machine-specific files and patches.
Diffstat (limited to 'packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c')
-rw-r--r--packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c b/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c
new file mode 100644
index 0000000000..7a319179c3
--- /dev/null
+++ b/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c
@@ -0,0 +1,77 @@
+/*
+ * arch/arm/mach-ixp4xx/nas100d-pci.c
+ *
+ * NAS 100d board-level PCI initialization
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Maintainer: http://www.nslu2-linux.org/
+ *
+ * This program 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/config.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init nas100d_pci_preinit(void)
+{
+ set_irq_type(IRQ_NAS100D_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_NAS100D_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_NAS100D_PCI_INTC, IRQT_LOW);
+
+ gpio_line_isr_clear(NAS100D_PCI_INTA_PIN);
+ gpio_line_isr_clear(NAS100D_PCI_INTB_PIN);
+ gpio_line_isr_clear(NAS100D_PCI_INTC_PIN);
+
+ /* INTD is not configured as GPIO is used
+ * for the power input button.
+ */
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init nas100d_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[NAS100D_PCI_IRQ_LINES] = {
+ IRQ_NAS100D_PCI_INTA,
+ IRQ_NAS100D_PCI_INTB,
+ IRQ_NAS100D_PCI_INTC,
+ };
+
+ int irq = -1;
+
+ if (slot >= 1 && slot <= NAS100D_PCI_MAX_DEV &&
+ pin >= 1 && pin <= NAS100D_PCI_IRQ_LINES) {
+ irq = pci_irq_table[(slot + pin - 2) % NAS100D_PCI_IRQ_LINES];
+ }
+
+ return irq;
+}
+
+struct hw_pci __initdata nas100d_pci = {
+ .nr_controllers = 1,
+ .preinit = nas100d_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = nas100d_map_irq,
+};
+
+int __init nas100d_pci_init(void) /* monkey see, monkey do */
+{
+ if (machine_is_nas100d())
+ pci_common_init(&nas100d_pci);
+
+ return 0;
+}
+
+subsys_initcall(nas100d_pci_init);