diff options
author | Alessandro Zummo <azummo-armlinux@towertech.it> | 2005-11-10 09:05:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-10 09:05:04 -0500 |
commit | a7918f39bbe59fe76f43743bdb6bb8b0bdefd94a (patch) | |
tree | a958184b769c8c4f4622627d92ff9fa44f4ee4c4 /arch/arm/mach-ixp4xx/nslu2-pci.c | |
parent | af36bef0c5bb82f361ebb2f106f11d0f63dac887 (diff) |
[ARM] 3140/1: NSLU2 machine support
Patch from Alessandro Zummo
This patch adds support for the LinkSys NSLU2 running with
both big and little-endian kernels. The LinkSys NSLU2 is
a cost engineered ARM, XScale 420 based system similar to
the the Intel IXDP425 evaluation board. It uses the
IXP4XX ARCH.
While this patch applies independently of other patches
the resultant kernel requires further patches to successfully
use onboard devices, including the onboard flash. Since these
patches are independent of this one they will be submitted
separately.
A defconfig is not included here because not all of
the required drivers are actually in the kernel.
We intend to provide one as soon as the patches
will be incorporated in mainstream.
This patch is the combined work of nslu2-linux.org
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx/nslu2-pci.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/nslu2-pci.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/nslu2-pci.c b/arch/arm/mach-ixp4xx/nslu2-pci.c new file mode 100644 index 000000000000..a575f2e0b2c8 --- /dev/null +++ b/arch/arm/mach-ixp4xx/nslu2-pci.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp4xx/nslu2-pci.c | ||
3 | * | ||
4 | * NSLU2 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 | |||
25 | void __init nslu2_pci_preinit(void) | ||
26 | { | ||
27 | set_irq_type(IRQ_NSLU2_PCI_INTA, IRQT_LOW); | ||
28 | set_irq_type(IRQ_NSLU2_PCI_INTB, IRQT_LOW); | ||
29 | set_irq_type(IRQ_NSLU2_PCI_INTC, IRQT_LOW); | ||
30 | |||
31 | gpio_line_isr_clear(NSLU2_PCI_INTA_PIN); | ||
32 | gpio_line_isr_clear(NSLU2_PCI_INTB_PIN); | ||
33 | gpio_line_isr_clear(NSLU2_PCI_INTC_PIN); | ||
34 | |||
35 | /* INTD is not configured as GPIO is used | ||
36 | * for the power input button. | ||
37 | */ | ||
38 | |||
39 | ixp4xx_pci_preinit(); | ||
40 | } | ||
41 | |||
42 | static int __init nslu2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
43 | { | ||
44 | static int pci_irq_table[NSLU2_PCI_IRQ_LINES] = { | ||
45 | IRQ_NSLU2_PCI_INTA, | ||
46 | IRQ_NSLU2_PCI_INTB, | ||
47 | IRQ_NSLU2_PCI_INTC, | ||
48 | }; | ||
49 | |||
50 | int irq = -1; | ||
51 | |||
52 | if (slot >= 1 && slot <= NSLU2_PCI_MAX_DEV && | ||
53 | pin >= 1 && pin <= NSLU2_PCI_IRQ_LINES) { | ||
54 | irq = pci_irq_table[(slot + pin - 2) % NSLU2_PCI_IRQ_LINES]; | ||
55 | } | ||
56 | |||
57 | return irq; | ||
58 | } | ||
59 | |||
60 | struct hw_pci __initdata nslu2_pci = { | ||
61 | .nr_controllers = 1, | ||
62 | .preinit = nslu2_pci_preinit, | ||
63 | .swizzle = pci_std_swizzle, | ||
64 | .setup = ixp4xx_setup, | ||
65 | .scan = ixp4xx_scan_bus, | ||
66 | .map_irq = nslu2_map_irq, | ||
67 | }; | ||
68 | |||
69 | int __init nslu2_pci_init(void) /* monkey see, monkey do */ | ||
70 | { | ||
71 | if (machine_is_nslu2()) | ||
72 | pci_common_init(&nslu2_pci); | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | subsys_initcall(nslu2_pci_init); | ||