aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/nas100d-pci.c
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2006-01-04 12:17:11 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-04 12:17:11 -0500
commit3145d8a6cc83ee15adf18f598873e53a54cd1841 (patch)
tree9b314c3ad06350f4839fc17a2119fb18428123fe /arch/arm/mach-ixp4xx/nas100d-pci.c
parentf7e8bbb8207c17afbd716e7e5fc785b78fa08571 (diff)
[ARM] 3215/1: Iomega NAS 100d (MACH_NAS100D) machine support
Patch from Rod Whitby This patch adds support for a new arm/ixp4xx machine - the Iomega NAS 100d network attached storage product. The NAS100D is a consumer device containing a 266MHz Intel IXP420 processor, 16MB of flash, 64MB of RAM, a 160Gb internal IDE hard disk, and 802.11b/g wireless on an Atheros mini-PCI card. Work on porting the latest 2.6.x kernel to this device is being done by the NSLU2-Linux project (the same team who maintains the port to the Linksys NSLU2 device). In particular, the majority of this patch was authored by Alessandro Zummo, based on the work done for MACH_NSLU2 support by the NSLU2-Linux core team of developers. MACH_NAS100D (as implemented by this patch) can be enabled in jumbo ixp4xx kernels without any affect on the other machines supported by that kernel. This patch applies cleanly against 2.6.15-rc7 and should be trivial to apply to later kernel versions. It does not depend upon any other patches. Modified files (and number of lines inserted): arch/arm/mach-ixp4xx/Kconfig | 8 arch/arm/mach-ixp4xx/Makefile | 1 include/asm-arm/arch-ixp4xx/hardware.h | 1 include/asm-arm/arch-ixp4xx/irqs.h | 9 include/asm-arm/arch-ixp4xx/nas100d.h | 75 arch/arm/mach-ixp4xx/nas100d-pci.c | 77 arch/arm/mach-ixp4xx/nas100d-power.c | 69 arch/arm/mach-ixp4xx/nas100d-setup.c | 133 -- Rod Whitby (NSLU2-Linux project lead) Signed-off-by: Rod Whitby <rod@whitby.id.au> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx/nas100d-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-pci.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/nas100d-pci.c b/arch/arm/mach-ixp4xx/nas100d-pci.c
new file mode 100644
index 000000000000..9bd029462359
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/nas100d-pci.c
@@ -0,0 +1,77 @@
1/*
2 * arch/arm/mach-ixp4xx/nas100d-pci.c
3 *
4 * NAS 100d board-level PCI initialization
5 *
6 * based on ixdp425-pci.c:
7 * Copyright (C) 2002 Intel Corporation.
8 * Copyright (C) 2003-2004 MontaVista Software, Inc.
9 *
10 * Maintainer: http://www.nslu2-linux.org/
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 */
17
18#include <linux/config.h>
19#include <linux/pci.h>
20#include <linux/init.h>
21
22#include <asm/mach/pci.h>
23#include <asm/mach-types.h>
24
25void __init nas100d_pci_preinit(void)
26{
27 set_irq_type(IRQ_NAS100D_PCI_INTA, IRQT_LOW);
28 set_irq_type(IRQ_NAS100D_PCI_INTB, IRQT_LOW);
29 set_irq_type(IRQ_NAS100D_PCI_INTC, IRQT_LOW);
30 set_irq_type(IRQ_NAS100D_PCI_INTD, IRQT_LOW);
31 set_irq_type(IRQ_NAS100D_PCI_INTE, IRQT_LOW);
32
33 gpio_line_isr_clear(NAS100D_PCI_INTA_PIN);
34 gpio_line_isr_clear(NAS100D_PCI_INTB_PIN);
35 gpio_line_isr_clear(NAS100D_PCI_INTC_PIN);
36 gpio_line_isr_clear(NAS100D_PCI_INTD_PIN);
37 gpio_line_isr_clear(NAS100D_PCI_INTE_PIN);
38
39 ixp4xx_pci_preinit();
40}
41
42static int __init nas100d_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
43{
44 static int pci_irq_table[NAS100D_PCI_MAX_DEV][NAS100D_PCI_IRQ_LINES] =
45 {
46 { IRQ_NAS100D_PCI_INTA, -1, -1 },
47 { IRQ_NAS100D_PCI_INTB, -1, -1 },
48 { IRQ_NAS100D_PCI_INTC, IRQ_NAS100D_PCI_INTD, IRQ_NAS100D_PCI_INTE },
49 };
50
51 int irq = -1;
52
53 if (slot >= 1 && slot <= NAS100D_PCI_MAX_DEV &&
54 pin >= 1 && pin <= NAS100D_PCI_IRQ_LINES)
55 irq = pci_irq_table[slot-1][pin-1];
56
57 return irq;
58}
59
60struct hw_pci __initdata nas100d_pci = {
61 .nr_controllers = 1,
62 .preinit = nas100d_pci_preinit,
63 .swizzle = pci_std_swizzle,
64 .setup = ixp4xx_setup,
65 .scan = ixp4xx_scan_bus,
66 .map_irq = nas100d_map_irq,
67};
68
69int __init nas100d_pci_init(void)
70{
71 if (machine_is_nas100d())
72 pci_common_init(&nas100d_pci);
73
74 return 0;
75}
76
77subsys_initcall(nas100d_pci_init);