diff options
-rw-r--r-- | arch/arm/configs/ixp4xx_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/Kconfig | 22 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/common-pci.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/dsmg600-pci.c | 74 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/dsmg600-power.c | 125 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/dsmg600-setup.c | 175 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/ixdp425-pci.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/ixdp425-setup.c | 18 | ||||
-rw-r--r-- | arch/arm/mm/proc-xscale.S | 28 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/cpu.h | 31 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/dsmg600.h | 57 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/entry-macro.S | 4 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/gpio.h | 73 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/hardware.h | 12 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/io.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/irqs.h | 16 | ||||
-rw-r--r-- | include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | 15 |
19 files changed, 656 insertions, 35 deletions
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig index fabf74c51a88..db850a5689eb 100644 --- a/arch/arm/configs/ixp4xx_defconfig +++ b/arch/arm/configs/ixp4xx_defconfig | |||
@@ -117,11 +117,13 @@ CONFIG_ARCH_ADI_COYOTE=y | |||
117 | CONFIG_ARCH_IXDP425=y | 117 | CONFIG_ARCH_IXDP425=y |
118 | CONFIG_MACH_IXDPG425=y | 118 | CONFIG_MACH_IXDPG425=y |
119 | CONFIG_MACH_IXDP465=y | 119 | CONFIG_MACH_IXDP465=y |
120 | CONFIG_MACH_KIXRP435=y | ||
120 | CONFIG_ARCH_IXCDP1100=y | 121 | CONFIG_ARCH_IXCDP1100=y |
121 | CONFIG_ARCH_PRPMC1100=y | 122 | CONFIG_ARCH_PRPMC1100=y |
122 | CONFIG_MACH_NAS100D=y | 123 | CONFIG_MACH_NAS100D=y |
123 | CONFIG_ARCH_IXDP4XX=y | 124 | CONFIG_ARCH_IXDP4XX=y |
124 | CONFIG_CPU_IXP46X=y | 125 | CONFIG_CPU_IXP46X=y |
126 | CONFIG_CPU_IXP43X=y | ||
125 | # CONFIG_MACH_GTWX5715 is not set | 127 | # CONFIG_MACH_GTWX5715 is not set |
126 | 128 | ||
127 | # | 129 | # |
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 8a339cdfe222..9715ef506c24 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig | |||
@@ -62,6 +62,12 @@ config MACH_IXDP465 | |||
62 | IXDP465 Development Platform (Also known as BMP). | 62 | IXDP465 Development Platform (Also known as BMP). |
63 | For more information on this platform, see <file:Documentation/arm/IXP4xx>. | 63 | For more information on this platform, see <file:Documentation/arm/IXP4xx>. |
64 | 64 | ||
65 | config MACH_KIXRP435 | ||
66 | bool "KIXRP435" | ||
67 | help | ||
68 | Say 'Y' here if you want your kernel to support Intel's | ||
69 | KIXRP435 Reference Platform. | ||
70 | For more information on this platform, see <file:Documentation/arm/IXP4xx>. | ||
65 | 71 | ||
66 | # | 72 | # |
67 | # IXCDP1100 is the exact same HW as IXDP425, but with a different machine | 73 | # IXCDP1100 is the exact same HW as IXDP425, but with a different machine |
@@ -89,12 +95,21 @@ config MACH_NAS100D | |||
89 | NAS 100d device. For more information on this platform, | 95 | NAS 100d device. For more information on this platform, |
90 | see http://www.nslu2-linux.org/wiki/NAS100d/HomePage | 96 | see http://www.nslu2-linux.org/wiki/NAS100d/HomePage |
91 | 97 | ||
98 | config MACH_DSMG600 | ||
99 | bool | ||
100 | prompt "D-Link DSM-G600 RevA" | ||
101 | select PCI | ||
102 | help | ||
103 | Say 'Y' here if you want your kernel to support D-Link's | ||
104 | DSM-G600 RevA device. For more information on this platform, | ||
105 | see http://www.nslu2-linux.org/wiki/DSMG600/HomePage | ||
106 | |||
92 | # | 107 | # |
93 | # Avila and IXDP share the same source for now. Will change in future | 108 | # Avila and IXDP share the same source for now. Will change in future |
94 | # | 109 | # |
95 | config ARCH_IXDP4XX | 110 | config ARCH_IXDP4XX |
96 | bool | 111 | bool |
97 | depends on ARCH_IXDP425 || MACH_IXDP465 | 112 | depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435 |
98 | default y | 113 | default y |
99 | 114 | ||
100 | # | 115 | # |
@@ -105,6 +120,11 @@ config CPU_IXP46X | |||
105 | depends on MACH_IXDP465 | 120 | depends on MACH_IXDP465 |
106 | default y | 121 | default y |
107 | 122 | ||
123 | config CPU_IXP43X | ||
124 | bool | ||
125 | depends on MACH_KIXRP435 | ||
126 | default y | ||
127 | |||
108 | config MACH_GTWX5715 | 128 | config MACH_GTWX5715 |
109 | bool "Gemtek WX5715 (Linksys WRV54G)" | 129 | bool "Gemtek WX5715 (Linksys WRV54G)" |
110 | depends on ARCH_IXP4XX | 130 | depends on ARCH_IXP4XX |
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile index 746e297284ed..3b87c47e06cf 100644 --- a/arch/arm/mach-ixp4xx/Makefile +++ b/arch/arm/mach-ixp4xx/Makefile | |||
@@ -12,6 +12,7 @@ obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o | |||
12 | obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o | 12 | obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o |
13 | obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o | 13 | obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o |
14 | obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o | 14 | obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o |
15 | obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o | ||
15 | 16 | ||
16 | obj-y += common.o | 17 | obj-y += common.o |
17 | 18 | ||
@@ -22,5 +23,6 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o | |||
22 | obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o | 23 | obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o |
23 | obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o | 24 | obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o |
24 | obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o | 25 | obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o |
26 | obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o | ||
25 | 27 | ||
26 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o | 28 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o |
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index 9562177b5fe1..bf04121d1a31 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c | |||
@@ -374,7 +374,7 @@ void __init ixp4xx_pci_preinit(void) | |||
374 | * Determine which PCI read method to use. | 374 | * Determine which PCI read method to use. |
375 | * Rev 0 IXP425 requires workaround. | 375 | * Rev 0 IXP425 requires workaround. |
376 | */ | 376 | */ |
377 | if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { | 377 | if (!(processor_id & 0xf) && cpu_is_ixp42x()) { |
378 | printk("PCI: IXP42x A0 silicon detected - " | 378 | printk("PCI: IXP42x A0 silicon detected - " |
379 | "PCI Non-Prefetch Workaround Enabled\n"); | 379 | "PCI Non-Prefetch Workaround Enabled\n"); |
380 | ixp4xx_pci_read = ixp4xx_pci_read_errata; | 380 | ixp4xx_pci_read = ixp4xx_pci_read_errata; |
@@ -480,7 +480,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys) | |||
480 | res[0].flags = IORESOURCE_IO; | 480 | res[0].flags = IORESOURCE_IO; |
481 | 481 | ||
482 | res[1].name = "PCI Memory Space"; | 482 | res[1].name = "PCI Memory Space"; |
483 | res[1].start = 0x48000000; | 483 | res[1].start = PCIBIOS_MIN_MEM; |
484 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 484 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
485 | res[1].end = 0x4bffffff; | 485 | res[1].end = 0x4bffffff; |
486 | #else | 486 | #else |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 09edea9779e6..f5cae1e46b7e 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -105,6 +105,29 @@ static signed char irq2gpio[32] = { | |||
105 | 7, 8, 9, 10, 11, 12, -1, -1, | 105 | 7, 8, 9, 10, 11, 12, -1, -1, |
106 | }; | 106 | }; |
107 | 107 | ||
108 | int gpio_to_irq(int gpio) | ||
109 | { | ||
110 | int irq; | ||
111 | |||
112 | for (irq = 0; irq < 32; irq++) { | ||
113 | if (irq2gpio[irq] == gpio) | ||
114 | return irq; | ||
115 | } | ||
116 | return -EINVAL; | ||
117 | } | ||
118 | EXPORT_SYMBOL(gpio_to_irq); | ||
119 | |||
120 | int irq_to_gpio(int irq) | ||
121 | { | ||
122 | int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL; | ||
123 | |||
124 | if (gpio == -1) | ||
125 | return -EINVAL; | ||
126 | |||
127 | return gpio; | ||
128 | } | ||
129 | EXPORT_SYMBOL(irq_to_gpio); | ||
130 | |||
108 | static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) | 131 | static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) |
109 | { | 132 | { |
110 | int line = irq2gpio[irq]; | 133 | int line = irq2gpio[irq]; |
@@ -172,7 +195,7 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) | |||
172 | 195 | ||
173 | static void ixp4xx_irq_mask(unsigned int irq) | 196 | static void ixp4xx_irq_mask(unsigned int irq) |
174 | { | 197 | { |
175 | if (cpu_is_ixp46x() && irq >= 32) | 198 | if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) |
176 | *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); | 199 | *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); |
177 | else | 200 | else |
178 | *IXP4XX_ICMR &= ~(1 << irq); | 201 | *IXP4XX_ICMR &= ~(1 << irq); |
@@ -195,7 +218,7 @@ static void ixp4xx_irq_unmask(unsigned int irq) | |||
195 | if (!(ixp4xx_irq_edge & (1 << irq))) | 218 | if (!(ixp4xx_irq_edge & (1 << irq))) |
196 | ixp4xx_irq_ack(irq); | 219 | ixp4xx_irq_ack(irq); |
197 | 220 | ||
198 | if (cpu_is_ixp46x() && irq >= 32) | 221 | if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) |
199 | *IXP4XX_ICMR2 |= (1 << (irq - 32)); | 222 | *IXP4XX_ICMR2 |= (1 << (irq - 32)); |
200 | else | 223 | else |
201 | *IXP4XX_ICMR |= (1 << irq); | 224 | *IXP4XX_ICMR |= (1 << irq); |
@@ -219,7 +242,7 @@ void __init ixp4xx_init_irq(void) | |||
219 | /* Disable all interrupt */ | 242 | /* Disable all interrupt */ |
220 | *IXP4XX_ICMR = 0x0; | 243 | *IXP4XX_ICMR = 0x0; |
221 | 244 | ||
222 | if (cpu_is_ixp46x()) { | 245 | if (cpu_is_ixp46x() || cpu_is_ixp43x()) { |
223 | /* Route upper 32 sources to IRQ instead of FIQ */ | 246 | /* Route upper 32 sources to IRQ instead of FIQ */ |
224 | *IXP4XX_ICLR2 = 0x00; | 247 | *IXP4XX_ICLR2 = 0x00; |
225 | 248 | ||
diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c b/arch/arm/mach-ixp4xx/dsmg600-pci.c new file mode 100644 index 000000000000..9db7e1f42011 --- /dev/null +++ b/arch/arm/mach-ixp4xx/dsmg600-pci.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * DSM-G600 board-level PCI initialization | ||
3 | * | ||
4 | * Copyright (C) 2006 Tower Technologies | ||
5 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
6 | * | ||
7 | * based on ixdp425-pci.c: | ||
8 | * Copyright (C) 2002 Intel Corporation. | ||
9 | * Copyright (C) 2003-2004 MontaVista Software, Inc. | ||
10 | * | ||
11 | * Maintainer: http://www.nslu2-linux.org/ | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #include <linux/pci.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/irq.h> | ||
22 | |||
23 | #include <asm/mach/pci.h> | ||
24 | #include <asm/mach-types.h> | ||
25 | |||
26 | void __init dsmg600_pci_preinit(void) | ||
27 | { | ||
28 | set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW); | ||
29 | set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW); | ||
30 | set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW); | ||
31 | set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW); | ||
32 | set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW); | ||
33 | set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW); | ||
34 | |||
35 | ixp4xx_pci_preinit(); | ||
36 | } | ||
37 | |||
38 | static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
39 | { | ||
40 | static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] = | ||
41 | { | ||
42 | { IRQ_DSMG600_PCI_INTE, -1, -1 }, | ||
43 | { IRQ_DSMG600_PCI_INTA, -1, -1 }, | ||
44 | { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD }, | ||
45 | { IRQ_DSMG600_PCI_INTF, -1, -1 }, | ||
46 | }; | ||
47 | |||
48 | int irq = -1; | ||
49 | |||
50 | if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV && | ||
51 | pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES) | ||
52 | irq = pci_irq_table[slot-1][pin-1]; | ||
53 | |||
54 | return irq; | ||
55 | } | ||
56 | |||
57 | struct hw_pci __initdata dsmg600_pci = { | ||
58 | .nr_controllers = 1, | ||
59 | .preinit = dsmg600_pci_preinit, | ||
60 | .swizzle = pci_std_swizzle, | ||
61 | .setup = ixp4xx_setup, | ||
62 | .scan = ixp4xx_scan_bus, | ||
63 | .map_irq = dsmg600_map_irq, | ||
64 | }; | ||
65 | |||
66 | int __init dsmg600_pci_init(void) | ||
67 | { | ||
68 | if (machine_is_dsmg600()) | ||
69 | pci_common_init(&dsmg600_pci); | ||
70 | |||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | subsys_initcall(dsmg600_pci_init); | ||
diff --git a/arch/arm/mach-ixp4xx/dsmg600-power.c b/arch/arm/mach-ixp4xx/dsmg600-power.c new file mode 100644 index 000000000000..34717872d076 --- /dev/null +++ b/arch/arm/mach-ixp4xx/dsmg600-power.c | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp4xx/dsmg600-power.c | ||
3 | * | ||
4 | * DSM-G600 Power/Reset driver | ||
5 | * Author: Michael Westerhof <mwester@dls.net> | ||
6 | * | ||
7 | * Based on nslu2-power.c | ||
8 | * Copyright (C) 2005 Tower Technologies | ||
9 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
10 | * | ||
11 | * which was based on nslu2-io.c | ||
12 | * Copyright (C) 2004 Karen Spearel | ||
13 | * | ||
14 | * Maintainers: http://www.nslu2-linux.org/ | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License version 2 as | ||
18 | * published by the Free Software Foundation. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/reboot.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/irq.h> | ||
26 | #include <linux/jiffies.h> | ||
27 | #include <linux/timer.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | |||
31 | extern void ctrl_alt_del(void); | ||
32 | |||
33 | /* This is used to make sure the power-button pusher is serious. The button | ||
34 | * must be held until the value of this counter reaches zero. | ||
35 | */ | ||
36 | static volatile int power_button_countdown; | ||
37 | |||
38 | /* Must hold the button down for at least this many counts to be processed */ | ||
39 | #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */ | ||
40 | |||
41 | static void dsmg600_power_handler(unsigned long data); | ||
42 | static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0); | ||
43 | |||
44 | static void dsmg600_power_handler(unsigned long data) | ||
45 | { | ||
46 | /* This routine is called twice per second to check the | ||
47 | * state of the power button. | ||
48 | */ | ||
49 | |||
50 | if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) { | ||
51 | |||
52 | /* IO Pin is 1 (button pushed) */ | ||
53 | if (power_button_countdown == 0) { | ||
54 | /* Signal init to do the ctrlaltdel action, this will bypass | ||
55 | * init if it hasn't started and do a kernel_restart. | ||
56 | */ | ||
57 | ctrl_alt_del(); | ||
58 | |||
59 | /* Change the state of the power LED to "blink" */ | ||
60 | gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW); | ||
61 | } | ||
62 | power_button_countdown--; | ||
63 | |||
64 | } else { | ||
65 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
66 | } | ||
67 | |||
68 | mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); | ||
69 | } | ||
70 | |||
71 | static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id) | ||
72 | { | ||
73 | /* This is the paper-clip reset, it shuts the machine down directly. */ | ||
74 | machine_power_off(); | ||
75 | |||
76 | return IRQ_HANDLED; | ||
77 | } | ||
78 | |||
79 | static int __init dsmg600_power_init(void) | ||
80 | { | ||
81 | if (!(machine_is_dsmg600())) | ||
82 | return 0; | ||
83 | |||
84 | if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler, | ||
85 | IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button", | ||
86 | NULL) < 0) { | ||
87 | |||
88 | printk(KERN_DEBUG "Reset Button IRQ %d not available\n", | ||
89 | DSMG600_RB_IRQ); | ||
90 | |||
91 | return -EIO; | ||
92 | } | ||
93 | |||
94 | /* The power button on the D-Link DSM-G600 is on GPIO 15, but | ||
95 | * it cannot handle interrupts on that GPIO line. So we'll | ||
96 | * have to poll it with a kernel timer. | ||
97 | */ | ||
98 | |||
99 | /* Make sure that the power button GPIO is set up as an input */ | ||
100 | gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN); | ||
101 | |||
102 | /* Set the initial value for the power button IRQ handler */ | ||
103 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
104 | |||
105 | mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static void __exit dsmg600_power_exit(void) | ||
111 | { | ||
112 | if (!(machine_is_dsmg600())) | ||
113 | return; | ||
114 | |||
115 | del_timer_sync(&dsmg600_power_timer); | ||
116 | |||
117 | free_irq(DSMG600_RB_IRQ, NULL); | ||
118 | } | ||
119 | |||
120 | module_init(dsmg600_power_init); | ||
121 | module_exit(dsmg600_power_exit); | ||
122 | |||
123 | MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>"); | ||
124 | MODULE_DESCRIPTION("DSM-G600 Power/Reset driver"); | ||
125 | MODULE_LICENSE("GPL"); | ||
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c new file mode 100644 index 000000000000..1caff65e22cc --- /dev/null +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c | |||
@@ -0,0 +1,175 @@ | |||
1 | /* | ||
2 | * DSM-G600 board-setup | ||
3 | * | ||
4 | * Copyright (C) 2006 Tower Technologies | ||
5 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
6 | * | ||
7 | * based ixdp425-setup.c: | ||
8 | * Copyright (C) 2003-2004 MontaVista Software, Inc. | ||
9 | * | ||
10 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
11 | * Maintainers: http://www.nslu2-linux.org/ | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/serial.h> | ||
16 | #include <linux/serial_8250.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | #include <asm/mach/flash.h> | ||
21 | |||
22 | static struct flash_platform_data dsmg600_flash_data = { | ||
23 | .map_name = "cfi_probe", | ||
24 | .width = 2, | ||
25 | }; | ||
26 | |||
27 | static struct resource dsmg600_flash_resource = { | ||
28 | .flags = IORESOURCE_MEM, | ||
29 | }; | ||
30 | |||
31 | static struct platform_device dsmg600_flash = { | ||
32 | .name = "IXP4XX-Flash", | ||
33 | .id = 0, | ||
34 | .dev.platform_data = &dsmg600_flash_data, | ||
35 | .num_resources = 1, | ||
36 | .resource = &dsmg600_flash_resource, | ||
37 | }; | ||
38 | |||
39 | static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = { | ||
40 | .sda_pin = DSMG600_SDA_PIN, | ||
41 | .scl_pin = DSMG600_SCL_PIN, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device dsmg600_i2c_controller = { | ||
45 | .name = "IXP4XX-I2C", | ||
46 | .id = 0, | ||
47 | .dev.platform_data = &dsmg600_i2c_gpio_pins, | ||
48 | }; | ||
49 | |||
50 | #ifdef CONFIG_LEDS_CLASS | ||
51 | static struct resource dsmg600_led_resources[] = { | ||
52 | { | ||
53 | .name = "power", | ||
54 | .start = DSMG600_LED_PWR_GPIO, | ||
55 | .end = DSMG600_LED_PWR_GPIO, | ||
56 | .flags = IXP4XX_GPIO_HIGH, | ||
57 | }, | ||
58 | { | ||
59 | .name = "wlan", | ||
60 | .start = DSMG600_LED_WLAN_GPIO, | ||
61 | .end = DSMG600_LED_WLAN_GPIO, | ||
62 | .flags = IXP4XX_GPIO_LOW, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | static struct platform_device dsmg600_leds = { | ||
67 | .name = "IXP4XX-GPIO-LED", | ||
68 | .id = -1, | ||
69 | .num_resources = ARRAY_SIZE(dsmg600_led_resources), | ||
70 | .resource = dsmg600_led_resources, | ||
71 | }; | ||
72 | #endif | ||
73 | |||
74 | static struct resource dsmg600_uart_resources[] = { | ||
75 | { | ||
76 | .start = IXP4XX_UART1_BASE_PHYS, | ||
77 | .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, | ||
80 | { | ||
81 | .start = IXP4XX_UART2_BASE_PHYS, | ||
82 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | } | ||
85 | }; | ||
86 | |||
87 | static struct plat_serial8250_port dsmg600_uart_data[] = { | ||
88 | { | ||
89 | .mapbase = IXP4XX_UART1_BASE_PHYS, | ||
90 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, | ||
91 | .irq = IRQ_IXP4XX_UART1, | ||
92 | .flags = UPF_BOOT_AUTOCONF, | ||
93 | .iotype = UPIO_MEM, | ||
94 | .regshift = 2, | ||
95 | .uartclk = IXP4XX_UART_XTAL, | ||
96 | }, | ||
97 | { | ||
98 | .mapbase = IXP4XX_UART2_BASE_PHYS, | ||
99 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | ||
100 | .irq = IRQ_IXP4XX_UART2, | ||
101 | .flags = UPF_BOOT_AUTOCONF, | ||
102 | .iotype = UPIO_MEM, | ||
103 | .regshift = 2, | ||
104 | .uartclk = IXP4XX_UART_XTAL, | ||
105 | }, | ||
106 | { } | ||
107 | }; | ||
108 | |||
109 | static struct platform_device dsmg600_uart = { | ||
110 | .name = "serial8250", | ||
111 | .id = PLAT8250_DEV_PLATFORM, | ||
112 | .dev.platform_data = dsmg600_uart_data, | ||
113 | .num_resources = ARRAY_SIZE(dsmg600_uart_resources), | ||
114 | .resource = dsmg600_uart_resources, | ||
115 | }; | ||
116 | |||
117 | static struct platform_device *dsmg600_devices[] __initdata = { | ||
118 | &dsmg600_i2c_controller, | ||
119 | &dsmg600_flash, | ||
120 | }; | ||
121 | |||
122 | static void dsmg600_power_off(void) | ||
123 | { | ||
124 | /* enable the pwr cntl gpio */ | ||
125 | gpio_line_config(DSMG600_PO_GPIO, IXP4XX_GPIO_OUT); | ||
126 | |||
127 | /* poweroff */ | ||
128 | gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
129 | } | ||
130 | |||
131 | static void __init dsmg600_init(void) | ||
132 | { | ||
133 | ixp4xx_sys_init(); | ||
134 | |||
135 | /* Make sure that GPIO14 and GPIO15 are not used as clocks */ | ||
136 | *IXP4XX_GPIO_GPCLKR = 0; | ||
137 | |||
138 | dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); | ||
139 | dsmg600_flash_resource.end = | ||
140 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; | ||
141 | |||
142 | pm_power_off = dsmg600_power_off; | ||
143 | |||
144 | /* The UART is required on the DSM-G600 (Redboot cannot use the | ||
145 | * NIC) -- do it here so that it does *not* get removed if | ||
146 | * platform_add_devices fails! | ||
147 | */ | ||
148 | (void)platform_device_register(&dsmg600_uart); | ||
149 | |||
150 | platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); | ||
151 | |||
152 | #ifdef CONFIG_LEDS_CLASS | ||
153 | /* We don't care whether or not this works. */ | ||
154 | (void)platform_device_register(&dsmg600_leds); | ||
155 | #endif | ||
156 | } | ||
157 | |||
158 | static void __init dsmg600_fixup(struct machine_desc *desc, | ||
159 | struct tag *tags, char **cmdline, struct meminfo *mi) | ||
160 | { | ||
161 | /* The xtal on this machine is non-standard. */ | ||
162 | ixp4xx_timer_freq = DSMG600_FREQ; | ||
163 | } | ||
164 | |||
165 | MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") | ||
166 | /* Maintainer: www.nslu2-linux.org */ | ||
167 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, | ||
168 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, | ||
169 | .boot_params = 0x00000100, | ||
170 | .fixup = dsmg600_fixup, | ||
171 | .map_io = ixp4xx_map_io, | ||
172 | .init_irq = ixp4xx_init_irq, | ||
173 | .timer = &ixp4xx_timer, | ||
174 | .init_machine = dsmg600_init, | ||
175 | MACHINE_END | ||
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c index 99c1dc8033c8..408796004812 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c | |||
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = { | |||
66 | int __init ixdp425_pci_init(void) | 66 | int __init ixdp425_pci_init(void) |
67 | { | 67 | { |
68 | if (machine_is_ixdp425() || machine_is_ixcdp1100() || | 68 | if (machine_is_ixdp425() || machine_is_ixcdp1100() || |
69 | machine_is_ixdp465()) | 69 | machine_is_ixdp465() || machine_is_kixrp435()) |
70 | pci_common_init(&ixdp425_pci); | 70 | pci_common_init(&ixdp425_pci); |
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 04b1d56396a0..ec4f07950ec6 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -115,6 +115,11 @@ static void __init ixdp425_init(void) | |||
115 | ixdp425_flash_resource.end = | 115 | ixdp425_flash_resource.end = |
116 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; | 116 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; |
117 | 117 | ||
118 | if (cpu_is_ixp43x()) { | ||
119 | ixdp425_uart.num_resources = 1; | ||
120 | ixdp425_uart_data[1].flags = 0; | ||
121 | } | ||
122 | |||
118 | platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); | 123 | platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); |
119 | } | 124 | } |
120 | 125 | ||
@@ -156,3 +161,16 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") | |||
156 | .init_machine = ixdp425_init, | 161 | .init_machine = ixdp425_init, |
157 | MACHINE_END | 162 | MACHINE_END |
158 | #endif | 163 | #endif |
164 | |||
165 | #ifdef CONFIG_MACH_KIXRP435 | ||
166 | MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform") | ||
167 | /* Maintainer: MontaVista Software, Inc. */ | ||
168 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, | ||
169 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, | ||
170 | .map_io = ixp4xx_map_io, | ||
171 | .init_irq = ixp4xx_init_irq, | ||
172 | .timer = &ixp4xx_timer, | ||
173 | .boot_params = 0x0100, | ||
174 | .init_machine = ixdp425_init, | ||
175 | MACHINE_END | ||
176 | #endif | ||
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index d29fe927ee9e..c156ddab9a2d 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S | |||
@@ -584,6 +584,11 @@ cpu_ixp42x_name: | |||
584 | .asciz "XScale-IXP42x Family" | 584 | .asciz "XScale-IXP42x Family" |
585 | .size cpu_ixp42x_name, . - cpu_ixp42x_name | 585 | .size cpu_ixp42x_name, . - cpu_ixp42x_name |
586 | 586 | ||
587 | .type cpu_ixp43x_name, #object | ||
588 | cpu_ixp43x_name: | ||
589 | .asciz "XScale-IXP43x Family" | ||
590 | .size cpu_ixp43x_name, . - cpu_ixp43x_name | ||
591 | |||
587 | .type cpu_ixp46x_name, #object | 592 | .type cpu_ixp46x_name, #object |
588 | cpu_ixp46x_name: | 593 | cpu_ixp46x_name: |
589 | .asciz "XScale-IXP46x Family" | 594 | .asciz "XScale-IXP46x Family" |
@@ -843,6 +848,29 @@ __ixp42x_proc_info: | |||
843 | .long xscale_cache_fns | 848 | .long xscale_cache_fns |
844 | .size __ixp42x_proc_info, . - __ixp42x_proc_info | 849 | .size __ixp42x_proc_info, . - __ixp42x_proc_info |
845 | 850 | ||
851 | .type __ixp43x_proc_info, #object | ||
852 | __ixp43x_proc_info: | ||
853 | .long 0x69054040 | ||
854 | .long 0xfffffff0 | ||
855 | .long PMD_TYPE_SECT | \ | ||
856 | PMD_SECT_BUFFERABLE | \ | ||
857 | PMD_SECT_CACHEABLE | \ | ||
858 | PMD_SECT_AP_WRITE | \ | ||
859 | PMD_SECT_AP_READ | ||
860 | .long PMD_TYPE_SECT | \ | ||
861 | PMD_SECT_AP_WRITE | \ | ||
862 | PMD_SECT_AP_READ | ||
863 | b __xscale_setup | ||
864 | .long cpu_arch_name | ||
865 | .long cpu_elf_name | ||
866 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP | ||
867 | .long cpu_ixp43x_name | ||
868 | .long xscale_processor_functions | ||
869 | .long v4wbi_tlb_fns | ||
870 | .long xscale_mc_user_fns | ||
871 | .long xscale_cache_fns | ||
872 | .size __ixp43x_proc_info, . - __ixp43x_proc_info | ||
873 | |||
846 | .type __ixp46x_proc_info, #object | 874 | .type __ixp46x_proc_info, #object |
847 | __ixp46x_proc_info: | 875 | __ixp46x_proc_info: |
848 | .long 0x69054200 | 876 | .long 0x69054200 |
diff --git a/include/asm-arm/arch-ixp4xx/cpu.h b/include/asm-arm/arch-ixp4xx/cpu.h new file mode 100644 index 000000000000..d2523b326c6c --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/cpu.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ixp4xx/cpu.h | ||
3 | * | ||
4 | * IXP4XX cpu type detection | ||
5 | * | ||
6 | * Copyright (C) 2007 MontaVista Software, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_CPU_H__ | ||
15 | #define __ASM_ARCH_CPU_H__ | ||
16 | |||
17 | extern unsigned int processor_id; | ||
18 | /* Processor id value in CP15 Register 0 */ | ||
19 | #define IXP425_PROCESSOR_ID_VALUE 0x690541c0 | ||
20 | #define IXP435_PROCESSOR_ID_VALUE 0x69054040 | ||
21 | #define IXP465_PROCESSOR_ID_VALUE 0x69054200 | ||
22 | #define IXP4XX_PROCESSOR_ID_MASK 0xfffffff0 | ||
23 | |||
24 | #define cpu_is_ixp42x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \ | ||
25 | IXP425_PROCESSOR_ID_VALUE) | ||
26 | #define cpu_is_ixp43x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \ | ||
27 | IXP435_PROCESSOR_ID_VALUE) | ||
28 | #define cpu_is_ixp46x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \ | ||
29 | IXP465_PROCESSOR_ID_VALUE) | ||
30 | |||
31 | #endif /* _ASM_ARCH_CPU_H */ | ||
diff --git a/include/asm-arm/arch-ixp4xx/dsmg600.h b/include/asm-arm/arch-ixp4xx/dsmg600.h new file mode 100644 index 000000000000..a19605ad240d --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/dsmg600.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * DSM-G600 platform specific definitions | ||
3 | * | ||
4 | * Copyright (C) 2006 Tower Technologies | ||
5 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
6 | * | ||
7 | * based on ixdp425.h: | ||
8 | * Copyright 2004 (C) MontaVista, Software, Inc. | ||
9 | * | ||
10 | * This file is licensed under the terms of the GNU General Public | ||
11 | * License version 2. This program is licensed "as is" without any | ||
12 | * warranty of any kind, whether express or implied. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_HARDWARE_H__ | ||
16 | #error "Do not include this directly, instead #include <asm/hardware.h>" | ||
17 | #endif | ||
18 | |||
19 | #define DSMG600_SDA_PIN 5 | ||
20 | #define DSMG600_SCL_PIN 4 | ||
21 | |||
22 | /* | ||
23 | * DSMG600 PCI IRQs | ||
24 | */ | ||
25 | #define DSMG600_PCI_MAX_DEV 4 | ||
26 | #define DSMG600_PCI_IRQ_LINES 3 | ||
27 | |||
28 | |||
29 | /* PCI controller GPIO to IRQ pin mappings */ | ||
30 | #define DSMG600_PCI_INTA_PIN 11 | ||
31 | #define DSMG600_PCI_INTB_PIN 10 | ||
32 | #define DSMG600_PCI_INTC_PIN 9 | ||
33 | #define DSMG600_PCI_INTD_PIN 8 | ||
34 | #define DSMG600_PCI_INTE_PIN 7 | ||
35 | #define DSMG600_PCI_INTF_PIN 6 | ||
36 | |||
37 | /* DSM-G600 Timer Setting */ | ||
38 | #define DSMG600_FREQ 66000000 | ||
39 | |||
40 | /* Buttons */ | ||
41 | |||
42 | #define DSMG600_PB_GPIO 15 /* power button */ | ||
43 | #define DSMG600_PB_BM (1L << DSMG600_PB_GPIO) | ||
44 | |||
45 | #define DSMG600_RB_GPIO 3 /* reset button */ | ||
46 | |||
47 | #define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3 | ||
48 | |||
49 | #define DSMG600_PO_GPIO 2 /* power off */ | ||
50 | |||
51 | /* LEDs */ | ||
52 | |||
53 | #define DSMG600_LED_PWR_GPIO 0 | ||
54 | #define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO) | ||
55 | |||
56 | #define DSMG600_LED_WLAN_GPIO 14 | ||
57 | #define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO) | ||
diff --git a/include/asm-arm/arch-ixp4xx/entry-macro.S b/include/asm-arm/arch-ixp4xx/entry-macro.S index dadb568b7ef0..f144a005ed95 100644 --- a/include/asm-arm/arch-ixp4xx/entry-macro.S +++ b/include/asm-arm/arch-ixp4xx/entry-macro.S | |||
@@ -31,9 +31,9 @@ | |||
31 | 31 | ||
32 | 1001: | 32 | 1001: |
33 | /* | 33 | /* |
34 | * IXP465 has an upper IRQ status register | 34 | * IXP465/IXP435 has an upper IRQ status register |
35 | */ | 35 | */ |
36 | #if defined(CONFIG_CPU_IXP46X) | 36 | #if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X) |
37 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) | 37 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) |
38 | ldr \irqstat, [\irqstat] @ get upper interrupts | 38 | ldr \irqstat, [\irqstat] @ get upper interrupts |
39 | mov \irqnr, #63 | 39 | mov \irqnr, #63 |
diff --git a/include/asm-arm/arch-ixp4xx/gpio.h b/include/asm-arm/arch-ixp4xx/gpio.h new file mode 100644 index 000000000000..3a4c5b8ae9e1 --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/gpio.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-ixp4xx/gpio.h | ||
3 | * | ||
4 | * IXP4XX GPIO wrappers for arch-neutral GPIO calls | ||
5 | * | ||
6 | * Written by Milan Svoboda <msvoboda@ra.rockwell.com> | ||
7 | * Based on PXA implementation by Philipp Zabel <philipp.zabel@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __ASM_ARCH_IXP4XX_GPIO_H | ||
26 | #define __ASM_ARCH_IXP4XX_GPIO_H | ||
27 | |||
28 | #include <asm/hardware.h> | ||
29 | |||
30 | static inline int gpio_request(unsigned gpio, const char *label) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | static inline void gpio_free(unsigned gpio) | ||
36 | { | ||
37 | return; | ||
38 | } | ||
39 | |||
40 | static inline int gpio_direction_input(unsigned gpio) | ||
41 | { | ||
42 | gpio_line_config(gpio, IXP4XX_GPIO_IN); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static inline int gpio_direction_output(unsigned gpio, int level) | ||
47 | { | ||
48 | gpio_line_set(gpio, level); | ||
49 | gpio_line_config(gpio, IXP4XX_GPIO_OUT); | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static inline int gpio_get_value(unsigned gpio) | ||
54 | { | ||
55 | int value; | ||
56 | |||
57 | gpio_line_get(gpio, &value); | ||
58 | |||
59 | return value; | ||
60 | } | ||
61 | |||
62 | static inline void gpio_set_value(unsigned gpio, int value) | ||
63 | { | ||
64 | gpio_line_set(gpio, value); | ||
65 | } | ||
66 | |||
67 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
68 | |||
69 | extern int gpio_to_irq(int gpio); | ||
70 | extern int irq_to_gpio(int gpio); | ||
71 | |||
72 | #endif | ||
73 | |||
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h index 88fd0877dcc1..297ceda08b61 100644 --- a/include/asm-arm/arch-ixp4xx/hardware.h +++ b/include/asm-arm/arch-ixp4xx/hardware.h | |||
@@ -17,8 +17,8 @@ | |||
17 | #ifndef __ASM_ARCH_HARDWARE_H__ | 17 | #ifndef __ASM_ARCH_HARDWARE_H__ |
18 | #define __ASM_ARCH_HARDWARE_H__ | 18 | #define __ASM_ARCH_HARDWARE_H__ |
19 | 19 | ||
20 | #define PCIBIOS_MIN_IO 0x00001000 | 20 | #define PCIBIOS_MIN_IO 0x00001000 |
21 | #define PCIBIOS_MIN_MEM 0x48000000 | 21 | #define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000) |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * We override the standard dma-mask routines for bouncing. | 24 | * We override the standard dma-mask routines for bouncing. |
@@ -27,11 +27,8 @@ | |||
27 | 27 | ||
28 | #define pcibios_assign_all_busses() 1 | 28 | #define pcibios_assign_all_busses() 1 |
29 | 29 | ||
30 | #if defined(CONFIG_CPU_IXP46X) && !defined(__ASSEMBLY__) | 30 | #ifndef __ASSEMBLER__ |
31 | extern unsigned int processor_id; | 31 | #include <asm/arch/cpu.h> |
32 | #define cpu_is_ixp465() ((processor_id & 0xffffffc0) == 0x69054200) | ||
33 | #else | ||
34 | #define cpu_is_ixp465() (0) | ||
35 | #endif | 32 | #endif |
36 | 33 | ||
37 | /* Register locations and bits */ | 34 | /* Register locations and bits */ |
@@ -47,5 +44,6 @@ extern unsigned int processor_id; | |||
47 | #include "prpmc1100.h" | 44 | #include "prpmc1100.h" |
48 | #include "nslu2.h" | 45 | #include "nslu2.h" |
49 | #include "nas100d.h" | 46 | #include "nas100d.h" |
47 | #include "dsmg600.h" | ||
50 | 48 | ||
51 | #endif /* _ASM_ARCH_HARDWARE_H */ | 49 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index b27c910adf9d..c72f9d79417c 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -61,7 +61,7 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); | |||
61 | static inline void __iomem * | 61 | static inline void __iomem * |
62 | __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype) | 62 | __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype) |
63 | { | 63 | { |
64 | if((addr < 0x48000000) || (addr > 0x4fffffff)) | 64 | if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff)) |
65 | return __arm_ioremap(addr, size, mtype); | 65 | return __arm_ioremap(addr, size, mtype); |
66 | 66 | ||
67 | return (void *)addr; | 67 | return (void *)addr; |
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h index e44a563d00ff..11801605047b 100644 --- a/include/asm-arm/arch-ixp4xx/irqs.h +++ b/include/asm-arm/arch-ixp4xx/irqs.h | |||
@@ -62,10 +62,10 @@ | |||
62 | /* | 62 | /* |
63 | * Only first 32 sources are valid if running on IXP42x systems | 63 | * Only first 32 sources are valid if running on IXP42x systems |
64 | */ | 64 | */ |
65 | #ifndef CONFIG_CPU_IXP46X | 65 | #if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X) |
66 | #define NR_IRQS 32 | ||
67 | #else | ||
68 | #define NR_IRQS 64 | 66 | #define NR_IRQS 64 |
67 | #else | ||
68 | #define NR_IRQS 32 | ||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) | 71 | #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) |
@@ -118,4 +118,14 @@ | |||
118 | #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 | 118 | #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 |
119 | #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 | 119 | #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 |
120 | 120 | ||
121 | /* | ||
122 | * D-Link DSM-G600 RevA board IRQs | ||
123 | */ | ||
124 | #define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11 | ||
125 | #define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10 | ||
126 | #define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9 | ||
127 | #define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8 | ||
128 | #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 | ||
129 | #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 | ||
130 | |||
121 | #endif | 131 | #endif |
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h index ed35e5c94f40..5d949d763a91 100644 --- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h +++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | |||
@@ -607,19 +607,4 @@ | |||
607 | 607 | ||
608 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | 608 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ |
609 | 609 | ||
610 | #ifndef __ASSEMBLY__ | ||
611 | static inline int cpu_is_ixp46x(void) | ||
612 | { | ||
613 | #ifdef CONFIG_CPU_IXP46X | ||
614 | unsigned int processor_id; | ||
615 | |||
616 | asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :); | ||
617 | |||
618 | if ((processor_id & 0xffffff00) == 0x69054200) | ||
619 | return 1; | ||
620 | #endif | ||
621 | return 0; | ||
622 | } | ||
623 | #endif | ||
624 | |||
625 | #endif | 610 | #endif |