aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-05-06 15:58:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-06 15:58:29 -0400
commit5cd47155155a32e5b944ac9fc3f3dc578e429aa0 (patch)
treeea05bfdbae04eb5ffbafa2c58fc68897a3f541d6
parent6f95416ebe81b3ad63884538555efb81cb05749f (diff)
parent28bd3a0dcce11bea6f99a351cc64053dff00196e (diff)
Merge branch 'ixp4xx' into devel
Conflicts: include/asm-arm/arch-ixp4xx/io.h
-rw-r--r--arch/arm/configs/ixp4xx_defconfig2
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig22
-rw-r--r--arch/arm/mach-ixp4xx/Makefile2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c4
-rw-r--r--arch/arm/mach-ixp4xx/common.c29
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-pci.c74
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-power.c125
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c175
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c18
-rw-r--r--arch/arm/mm/proc-xscale.S28
-rw-r--r--include/asm-arm/arch-ixp4xx/cpu.h31
-rw-r--r--include/asm-arm/arch-ixp4xx/dsmg600.h57
-rw-r--r--include/asm-arm/arch-ixp4xx/entry-macro.S4
-rw-r--r--include/asm-arm/arch-ixp4xx/gpio.h73
-rw-r--r--include/asm-arm/arch-ixp4xx/hardware.h12
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/irqs.h16
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h15
19 files changed, 656 insertions, 35 deletions
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index fabf74c51a8..db850a5689e 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -117,11 +117,13 @@ CONFIG_ARCH_ADI_COYOTE=y
117CONFIG_ARCH_IXDP425=y 117CONFIG_ARCH_IXDP425=y
118CONFIG_MACH_IXDPG425=y 118CONFIG_MACH_IXDPG425=y
119CONFIG_MACH_IXDP465=y 119CONFIG_MACH_IXDP465=y
120CONFIG_MACH_KIXRP435=y
120CONFIG_ARCH_IXCDP1100=y 121CONFIG_ARCH_IXCDP1100=y
121CONFIG_ARCH_PRPMC1100=y 122CONFIG_ARCH_PRPMC1100=y
122CONFIG_MACH_NAS100D=y 123CONFIG_MACH_NAS100D=y
123CONFIG_ARCH_IXDP4XX=y 124CONFIG_ARCH_IXDP4XX=y
124CONFIG_CPU_IXP46X=y 125CONFIG_CPU_IXP46X=y
126CONFIG_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 8a339cdfe22..9715ef506c2 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
65config 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
98config 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#
95config ARCH_IXDP4XX 110config 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
123config CPU_IXP43X
124 bool
125 depends on MACH_KIXRP435
126 default y
127
108config MACH_GTWX5715 128config 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 746e297284e..3b87c47e06c 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
12obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o 12obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
13obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o 13obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
14obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o 14obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
15obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
15 16
16obj-y += common.o 17obj-y += common.o
17 18
@@ -22,5 +23,6 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
22obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o 23obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
23obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o 24obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
24obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o 25obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
26obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
25 27
26obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o 28obj-$(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 9562177b5fe..bf04121d1a3 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 09edea9779e..f5cae1e46b7 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
108int 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}
118EXPORT_SYMBOL(gpio_to_irq);
119
120int 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}
129EXPORT_SYMBOL(irq_to_gpio);
130
108static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) 131static 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
173static void ixp4xx_irq_mask(unsigned int irq) 196static 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 00000000000..9db7e1f4201
--- /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
26void __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
38static 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
57struct 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
66int __init dsmg600_pci_init(void)
67{
68 if (machine_is_dsmg600())
69 pci_common_init(&dsmg600_pci);
70
71 return 0;
72}
73
74subsys_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 00000000000..34717872d07
--- /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
31extern 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 */
36static 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
41static void dsmg600_power_handler(unsigned long data);
42static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
43
44static 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
71static 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
79static 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
110static 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
120module_init(dsmg600_power_init);
121module_exit(dsmg600_power_exit);
122
123MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>");
124MODULE_DESCRIPTION("DSM-G600 Power/Reset driver");
125MODULE_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 00000000000..1caff65e22c
--- /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
22static struct flash_platform_data dsmg600_flash_data = {
23 .map_name = "cfi_probe",
24 .width = 2,
25};
26
27static struct resource dsmg600_flash_resource = {
28 .flags = IORESOURCE_MEM,
29};
30
31static 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
39static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
40 .sda_pin = DSMG600_SDA_PIN,
41 .scl_pin = DSMG600_SCL_PIN,
42};
43
44static 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
51static 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
66static 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
74static 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
87static 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
109static 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
117static struct platform_device *dsmg600_devices[] __initdata = {
118 &dsmg600_i2c_controller,
119 &dsmg600_flash,
120};
121
122static 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
131static 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
158static 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
165MACHINE_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,
175MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
index 99c1dc8033c..40879600481 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 = {
66int __init ixdp425_pci_init(void) 66int __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 04b1d56396a..ec4f07950ec 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,
157MACHINE_END 162MACHINE_END
158#endif 163#endif
164
165#ifdef CONFIG_MACH_KIXRP435
166MACHINE_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,
175MACHINE_END
176#endif
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index d29fe927ee9..c156ddab9a2 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
588cpu_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
588cpu_ixp46x_name: 593cpu_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 00000000000..d2523b326c6
--- /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
17extern 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 00000000000..a19605ad240
--- /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 dadb568b7ef..f144a005ed9 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
321001: 321001:
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 00000000000..3a4c5b8ae9e
--- /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
30static inline int gpio_request(unsigned gpio, const char *label)
31{
32 return 0;
33}
34
35static inline void gpio_free(unsigned gpio)
36{
37 return;
38}
39
40static inline int gpio_direction_input(unsigned gpio)
41{
42 gpio_line_config(gpio, IXP4XX_GPIO_IN);
43 return 0;
44}
45
46static 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
53static inline int gpio_get_value(unsigned gpio)
54{
55 int value;
56
57 gpio_line_get(gpio, &value);
58
59 return value;
60}
61
62static 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
69extern int gpio_to_irq(int gpio);
70extern 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 88fd0877dcc..297ceda08b6 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__
31extern 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 b27c910adf9..c72f9d79417 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);
61static inline void __iomem * 61static 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 e44a563d00f..11801605047 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 ed35e5c94f4..5d949d763a9 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__
611static 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