aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-18 17:15:48 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-18 17:15:48 -0500
commit0bd5292f5883d24b9416ba32a2a137482d7f380b (patch)
tree8bd6eeb95445d1372f5735bccc22e8e4417a2cf4 /arch
parentfdb0a1a67e131f07a308730c80d07e330211d2e0 (diff)
parenta2449091522990e9746a3f1420b9041d9669590c (diff)
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx1/devices.c8
-rw-r--r--arch/arm/mach-mx2/devices.c12
-rw-r--r--arch/arm/mach-mx2/mx27ads.c2
-rw-r--r--arch/arm/mach-mx3/clock.c1
-rw-r--r--arch/arm/mach-mx3/devices.c6
-rw-r--r--arch/arm/plat-mxc/Kconfig1
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c7
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/entry-macro.S2
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/io.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h11
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h12
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h25
-rw-r--r--arch/arm/plat-mxc/include/mach/timex.h8
-rw-r--r--arch/arm/plat-mxc/irq.c9
21 files changed, 77 insertions, 80 deletions
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
index ad4679b90870..686d8d2dbb24 100644
--- a/arch/arm/mach-mx1/devices.c
+++ b/arch/arm/mach-mx1/devices.c
@@ -232,25 +232,25 @@ static struct mxc_gpio_port imx_gpio_ports[] = {
232 .chip.label = "gpio-0", 232 .chip.label = "gpio-0",
233 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR), 233 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR),
234 .irq = GPIO_INT_PORTA, 234 .irq = GPIO_INT_PORTA,
235 .virtual_irq_start = MXC_MAX_INT_LINES 235 .virtual_irq_start = MXC_GPIO_IRQ_START
236 }, 236 },
237 [1] = { 237 [1] = {
238 .chip.label = "gpio-1", 238 .chip.label = "gpio-1",
239 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100), 239 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
240 .irq = GPIO_INT_PORTB, 240 .irq = GPIO_INT_PORTB,
241 .virtual_irq_start = MXC_MAX_INT_LINES + 32 241 .virtual_irq_start = MXC_GPIO_IRQ_START + 32
242 }, 242 },
243 [2] = { 243 [2] = {
244 .chip.label = "gpio-2", 244 .chip.label = "gpio-2",
245 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200), 245 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
246 .irq = GPIO_INT_PORTC, 246 .irq = GPIO_INT_PORTC,
247 .virtual_irq_start = MXC_MAX_INT_LINES + 64 247 .virtual_irq_start = MXC_GPIO_IRQ_START + 64
248 }, 248 },
249 [3] = { 249 [3] = {
250 .chip.label = "gpio-3", 250 .chip.label = "gpio-3",
251 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300), 251 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
252 .irq = GPIO_INT_PORTD, 252 .irq = GPIO_INT_PORTD,
253 .virtual_irq_start = MXC_MAX_INT_LINES + 96 253 .virtual_irq_start = MXC_GPIO_IRQ_START + 96
254 } 254 }
255}; 255};
256 256
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 0bad86527743..af121f5ab710 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -230,32 +230,32 @@ static struct mxc_gpio_port imx_gpio_ports[] = {
230 .chip.label = "gpio-0", 230 .chip.label = "gpio-0",
231 .irq = MXC_INT_GPIO, 231 .irq = MXC_INT_GPIO,
232 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 0), 232 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 0),
233 .virtual_irq_start = MXC_MAX_INT_LINES, 233 .virtual_irq_start = MXC_GPIO_IRQ_START,
234 }, 234 },
235 [1] = { 235 [1] = {
236 .chip.label = "gpio-1", 236 .chip.label = "gpio-1",
237 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 1), 237 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 1),
238 .virtual_irq_start = MXC_MAX_INT_LINES + 32, 238 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
239 }, 239 },
240 [2] = { 240 [2] = {
241 .chip.label = "gpio-2", 241 .chip.label = "gpio-2",
242 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 2), 242 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 2),
243 .virtual_irq_start = MXC_MAX_INT_LINES + 64, 243 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
244 }, 244 },
245 [3] = { 245 [3] = {
246 .chip.label = "gpio-3", 246 .chip.label = "gpio-3",
247 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 3), 247 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 3),
248 .virtual_irq_start = MXC_MAX_INT_LINES + 96, 248 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
249 }, 249 },
250 [4] = { 250 [4] = {
251 .chip.label = "gpio-4", 251 .chip.label = "gpio-4",
252 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 4), 252 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 4),
253 .virtual_irq_start = MXC_MAX_INT_LINES + 128, 253 .virtual_irq_start = MXC_GPIO_IRQ_START + 128,
254 }, 254 },
255 [5] = { 255 [5] = {
256 .chip.label = "gpio-5", 256 .chip.label = "gpio-5",
257 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 5), 257 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 5),
258 .virtual_irq_start = MXC_MAX_INT_LINES + 160, 258 .virtual_irq_start = MXC_GPIO_IRQ_START + 160,
259 } 259 }
260}; 260};
261 261
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c
index a06497674436..2b5c67f54571 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mx27ads.c
@@ -93,7 +93,7 @@ static int uart_mxc_port1_init(struct platform_device *pdev)
93 93
94static int uart_mxc_port1_exit(struct platform_device *pdev) 94static int uart_mxc_port1_exit(struct platform_device *pdev)
95{ 95{
96 mxc_gpio_setup_release_pins(mxc_uart1_pins, 96 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
97 ARRAY_SIZE(mxc_uart1_pins)); 97 ARRAY_SIZE(mxc_uart1_pins));
98 return 0; 98 return 0;
99} 99}
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 9f14a871ee7c..b1746aae1f89 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -24,6 +24,7 @@
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <mach/clock.h> 26#include <mach/clock.h>
27#include <mach/hardware.h>
27#include <asm/div64.h> 28#include <asm/div64.h>
28 29
29#include "crm_regs.h" 30#include "crm_regs.h"
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 3e61ff4646fe..1d46cb4adf96 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -125,19 +125,19 @@ static struct mxc_gpio_port imx_gpio_ports[] = {
125 .chip.label = "gpio-0", 125 .chip.label = "gpio-0",
126 .base = IO_ADDRESS(GPIO1_BASE_ADDR), 126 .base = IO_ADDRESS(GPIO1_BASE_ADDR),
127 .irq = MXC_INT_GPIO1, 127 .irq = MXC_INT_GPIO1,
128 .virtual_irq_start = MXC_GPIO_INT_BASE 128 .virtual_irq_start = MXC_GPIO_IRQ_START,
129 }, 129 },
130 [1] = { 130 [1] = {
131 .chip.label = "gpio-1", 131 .chip.label = "gpio-1",
132 .base = IO_ADDRESS(GPIO2_BASE_ADDR), 132 .base = IO_ADDRESS(GPIO2_BASE_ADDR),
133 .irq = MXC_INT_GPIO2, 133 .irq = MXC_INT_GPIO2,
134 .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN 134 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
135 }, 135 },
136 [2] = { 136 [2] = {
137 .chip.label = "gpio-2", 137 .chip.label = "gpio-2",
138 .base = IO_ADDRESS(GPIO3_BASE_ADDR), 138 .base = IO_ADDRESS(GPIO3_BASE_ADDR),
139 .irq = MXC_INT_GPIO3, 139 .irq = MXC_INT_GPIO3,
140 .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN * 2 140 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
141 } 141 }
142}; 142};
143 143
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 16cb07cd9162..9cc2b16fdf79 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -8,6 +8,7 @@ choice
8 8
9config ARCH_MX1 9config ARCH_MX1
10 bool "MX1-based" 10 bool "MX1-based"
11 select CPU_ARM920T
11 help 12 help
12 This enables support for systems based on the Freescale i.MX1 family 13 This enables support for systems based on the Freescale i.MX1 family
13 14
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index e1c2eb497fbc..2905ec758758 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -511,6 +511,7 @@ void imx_dma_disable(int channel)
511} 511}
512EXPORT_SYMBOL(imx_dma_disable); 512EXPORT_SYMBOL(imx_dma_disable);
513 513
514#ifdef CONFIG_ARCH_MX2
514static void imx_dma_watchdog(unsigned long chno) 515static void imx_dma_watchdog(unsigned long chno)
515{ 516{
516 struct imx_dma_channel *imxdma = &imx_dma_channels[chno]; 517 struct imx_dma_channel *imxdma = &imx_dma_channels[chno];
@@ -522,6 +523,7 @@ static void imx_dma_watchdog(unsigned long chno)
522 if (imxdma->err_handler) 523 if (imxdma->err_handler)
523 imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT); 524 imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT);
524} 525}
526#endif
525 527
526static irqreturn_t dma_err_handler(int irq, void *dev_id) 528static irqreturn_t dma_err_handler(int irq, void *dev_id)
527{ 529{
@@ -674,7 +676,7 @@ int imx_dma_request(int channel, const char *name)
674{ 676{
675 struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; 677 struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
676 unsigned long flags; 678 unsigned long flags;
677 int ret; 679 int ret = 0;
678 680
679 /* basic sanity checks */ 681 /* basic sanity checks */
680 if (!name) 682 if (!name)
@@ -696,6 +698,7 @@ int imx_dma_request(int channel, const char *name)
696 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", 698 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA",
697 NULL); 699 NULL);
698 if (ret) { 700 if (ret) {
701 local_irq_restore(flags);
699 printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", 702 printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n",
700 MXC_INT_DMACH0 + channel, channel); 703 MXC_INT_DMACH0 + channel, channel);
701 return ret; 704 return ret;
@@ -712,7 +715,7 @@ int imx_dma_request(int channel, const char *name)
712 imxdma->sg = NULL; 715 imxdma->sg = NULL;
713 716
714 local_irq_restore(flags); 717 local_irq_restore(flags);
715 return 0; 718 return ret;
716} 719}
717EXPORT_SYMBOL(imx_dma_request); 720EXPORT_SYMBOL(imx_dma_request);
718 721
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27ads.h b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
index 0c748a8e157b..8f34a05afc87 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
@@ -15,7 +15,7 @@
15#define __ASM_ARCH_MXC_BOARD_MX27ADS_H__ 15#define __ASM_ARCH_MXC_BOARD_MX27ADS_H__
16 16
17/* external interrupt multiplexer */ 17/* external interrupt multiplexer */
18#define MXC_EXP_IO_BASE (MXC_GPIO_BASE + MXC_MAX_GPIO_LINES) 18#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
19 19
20#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES) 20#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
21#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE 21#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 745b48864f93..451d510d08c3 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -90,7 +90,7 @@
90#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) 90#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
91#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4) 91#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
92 92
93#define MXC_EXP_IO_BASE (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES) 93#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
94#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) 94#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
95 95
96#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0) 96#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
diff --git a/arch/arm/plat-mxc/include/mach/entry-macro.S b/arch/arm/plat-mxc/include/mach/entry-macro.S
index 11632028f7d1..5f01d60da845 100644
--- a/arch/arm/plat-mxc/include/mach/entry-macro.S
+++ b/arch/arm/plat-mxc/include/mach/entry-macro.S
@@ -9,6 +9,8 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <mach/hardware.h>
13
12#define AVIC_NIMASK 0x04 14#define AVIC_NIMASK 0x04
13 15
14 @ this macro disables fast irq (not implemented) 16 @ this macro disables fast irq (not implemented)
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 65eedc0d196f..ea509f1090fb 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -27,8 +27,8 @@
27#define gpio_set_value __gpio_set_value 27#define gpio_set_value __gpio_set_value
28#define gpio_cansleep __gpio_cansleep 28#define gpio_cansleep __gpio_cansleep
29 29
30#define gpio_to_irq(gpio) (MXC_MAX_INT_LINES + (gpio)) 30#define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio))
31#define irq_to_gpio(irq) ((irq) - MXC_MAX_INT_LINES) 31#define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
32 32
33struct mxc_gpio_port { 33struct mxc_gpio_port {
34 void __iomem *base; 34 void __iomem *base;
diff --git a/arch/arm/plat-mxc/include/mach/io.h b/arch/arm/plat-mxc/include/mach/io.h
index c0cb267e7403..b4f2de769466 100644
--- a/arch/arm/plat-mxc/include/mach/io.h
+++ b/arch/arm/plat-mxc/include/mach/io.h
@@ -25,8 +25,8 @@ __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
25 /* Access all peripherals below 0x80000000 as nonshared device 25 /* Access all peripherals below 0x80000000 as nonshared device
26 * but leave l2cc alone. 26 * but leave l2cc alone.
27 */ 27 */
28 if ((phys_addr < 0x80000000) && ((phys_addr < L2CC_BASE_ADDR) || 28 if ((phys_addr < 0x80000000) && ((phys_addr < 0x30000000) ||
29 (phys_addr >= L2CC_BASE_ADDR + L2CC_SIZE))) 29 (phys_addr >= 0x30000000 + SZ_1M)))
30 mtype = MT_DEVICE_NONSHARED; 30 mtype = MT_DEVICE_NONSHARED;
31 } 31 }
32 32
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
index 60b3c9b6ef7d..95a383be628e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
@@ -405,9 +405,9 @@ extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
405#endif 405#endif
406 406
407/* decode irq number to use with IMR(x), ISR(x) and friends */ 407/* decode irq number to use with IMR(x), ISR(x) and friends */
408#define IRQ_TO_REG(irq) ((irq - MXC_MAX_INT_LINES) >> 5) 408#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
409 409
410#define IRQ_GPIOA(x) (MXC_MAX_INT_LINES + x) 410#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
411#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x) 411#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
412#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) 412#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
413#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) 413#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 20e5c4c63314..c9198c0aea18 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -141,7 +141,7 @@ void mxc_iomux_set_gpr(enum iomux_gp_func, bool);
141 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) 141 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT)
142#define IOMUX_TO_IRQ(iomux_pin) \ 142#define IOMUX_TO_IRQ(iomux_pin) \
143 (((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) + \ 143 (((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) + \
144 MXC_GPIO_INT_BASE) 144 MXC_GPIO_IRQ_START)
145 145
146/* 146/*
147 * This enumeration is constructed based on the Section 147 * This enumeration is constructed based on the Section
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index b8ac91608a4f..e06d3cb0ee11 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -11,7 +11,32 @@
11#ifndef __ASM_ARCH_MXC_IRQS_H__ 11#ifndef __ASM_ARCH_MXC_IRQS_H__
12#define __ASM_ARCH_MXC_IRQS_H__ 12#define __ASM_ARCH_MXC_IRQS_H__
13 13
14#include <mach/hardware.h> 14/*
15 * So far all i.MX SoCs have 64 internal interrupts
16 */
17#define MXC_INTERNAL_IRQS 64
18
19#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
20
21#if defined CONFIG_ARCH_MX1
22#define MXC_GPIO_IRQS (32 * 4)
23#elif defined CONFIG_ARCH_MX2
24#define MXC_GPIO_IRQS (32 * 6)
25#elif defined CONFIG_ARCH_MX3
26#define MXC_GPIO_IRQS (32 * 3)
27#endif
28
29/*
30 * The next 16 interrupts are for board specific purposes. Since
31 * the kernel can only run on one machine at a time, we can re-use
32 * these. If you need more, increase MXC_BOARD_IRQS, but keep it
33 * within sensible limits.
34 */
35#define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + MXC_GPIO_IRQS)
36#define MXC_BOARD_IRQS 16
37
38#define NR_IRQS (MXC_BOARD_IRQ_START + MXC_BOARD_IRQS)
39
15extern void imx_irq_set_priority(unsigned char irq, unsigned char prio); 40extern void imx_irq_set_priority(unsigned char irq, unsigned char prio);
16 41
17/* all normal IRQs can be FIQs */ 42/* all normal IRQs can be FIQs */
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index 203688e6164e..0b808399097f 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -11,6 +11,12 @@
11#ifndef __ASM_ARCH_MXC_MEMORY_H__ 11#ifndef __ASM_ARCH_MXC_MEMORY_H__
12#define __ASM_ARCH_MXC_MEMORY_H__ 12#define __ASM_ARCH_MXC_MEMORY_H__
13 13
14#include <mach/hardware.h> 14#if defined CONFIG_ARCH_MX1
15#define PHYS_OFFSET UL(0x08000000)
16#elif defined CONFIG_ARCH_MX2
17#define PHYS_OFFSET UL(0xA0000000)
18#elif defined CONFIG_ARCH_MX3
19#define PHYS_OFFSET UL(0x80000000)
20#endif
15 21
16#endif /* __ASM_ARCH_MXC_MEMORY_H__ */ 22#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index e7f6d00009a7..b92e02324d8e 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -19,13 +19,6 @@
19#include <mach/vmalloc.h> 19#include <mach/vmalloc.h>
20 20
21/* 21/*
22 * defines the hardware clock tick rate
23 */
24#define CLOCK_TICK_RATE 16000000
25
26#define PHYS_OFFSET UL(0x08000000)
27
28/*
29 * Memory map 22 * Memory map
30 */ 23 */
31#define IMX_IO_PHYS 0x00200000 24#define IMX_IO_PHYS 0x00200000
@@ -145,10 +138,6 @@
145#define GPIO_INT_PORTD 62 138#define GPIO_INT_PORTD 62
146#define WDT_INT 63 139#define WDT_INT 63
147 140
148#define MXC_MAX_INT_LINES 64
149
150#define NR_IRQS 256
151
152/* gpio and gpio based interrupt handling */ 141/* gpio and gpio based interrupt handling */
153#define GPIO_DR 0x1C 142#define GPIO_DR 0x1C
154#define GPIO_GDIR 0x00 143#define GPIO_GDIR 0x00
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index aade46d90e73..0313be720552 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -289,16 +289,4 @@ extern int mx27_revision(void);
289/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */ 289/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */
290#define ARCH_NR_GPIOS (192 + 16) 290#define ARCH_NR_GPIOS (192 + 16)
291 291
292/* OS clock tick rate */
293#define CLOCK_TICK_RATE 13300000
294
295/* Start of RAM */
296#define PHYS_OFFSET SDRAM_BASE_ADDR
297
298/* max interrupt lines count */
299#define NR_IRQS 256
300
301/* count of internal interrupt sources */
302#define MXC_MAX_INT_LINES 64
303
304#endif /* __ASM_ARCH_MXC_MX27_H__ */ 292#endif /* __ASM_ARCH_MXC_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 0536f8917bc0..de026654b00e 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -15,11 +15,6 @@
15#error "Do not include directly." 15#error "Do not include directly."
16#endif 16#endif
17 17
18/*!
19 * defines the hardware clock tick rate
20 */
21#define CLOCK_TICK_RATE 16625000
22
23/* 18/*
24 * MX31 memory map: 19 * MX31 memory map:
25 * 20 *
@@ -244,9 +239,6 @@
244#define PCMCIA_IO_ADDRESS(x) \ 239#define PCMCIA_IO_ADDRESS(x) \
245 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) 240 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
246 241
247/* Start of physical RAM - On many MX31 platforms, this is the first SDRAM bank (CSD0) */
248#define PHYS_OFFSET CSD0_BASE_ADDR
249
250/* 242/*
251 * Interrupt numbers 243 * Interrupt numbers
252 */ 244 */
@@ -315,23 +307,6 @@
315#define MXC_INT_EXT_WDOG 62 307#define MXC_INT_EXT_WDOG 62
316#define MXC_INT_EXT_TV 63 308#define MXC_INT_EXT_TV 63
317 309
318#define MXC_MAX_INT_LINES 64
319
320#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
321#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
322#define MXC_MAX_VIRTUAL_INTS 16
323
324#define NR_IRQS (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES + MXC_MAX_VIRTUAL_INTS)
325
326/*!
327 * Number of GPIO port as defined in the IC Spec
328 */
329#define GPIO_PORT_NUM 3
330/*!
331 * Number of GPIO pins per port
332 */
333#define GPIO_NUM_PIN 32
334
335#define PROD_SIGNATURE 0x1 /* For MX31 */ 310#define PROD_SIGNATURE 0x1 /* For MX31 */
336 311
337/* silicon revisions specific to i.MX31 */ 312/* silicon revisions specific to i.MX31 */
diff --git a/arch/arm/plat-mxc/include/mach/timex.h b/arch/arm/plat-mxc/include/mach/timex.h
index 0b0af0253e91..07b4a73c9d2f 100644
--- a/arch/arm/plat-mxc/include/mach/timex.h
+++ b/arch/arm/plat-mxc/include/mach/timex.h
@@ -20,6 +20,12 @@
20#ifndef __ASM_ARCH_MXC_TIMEX_H__ 20#ifndef __ASM_ARCH_MXC_TIMEX_H__
21#define __ASM_ARCH_MXC_TIMEX_H__ 21#define __ASM_ARCH_MXC_TIMEX_H__
22 22
23#include <mach/hardware.h> /* for CLOCK_TICK_RATE */ 23#if defined CONFIG_ARCH_MX1
24#define CLOCK_TICK_RATE 16000000
25#elif defined CONFIG_ARCH_MX2
26#define CLOCK_TICK_RATE 13300000
27#elif defined CONFIG_ARCH_MX3
28#define CLOCK_TICK_RATE 16625000
29#endif
24 30
25#endif /* __ASM_ARCH_MXC_TIMEX_H__ */ 31#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
index e937c8759a97..6e7578a3514b 100644
--- a/arch/arm/plat-mxc/irq.c
+++ b/arch/arm/plat-mxc/irq.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <mach/common.h> 23#include <mach/common.h>
24#include <asm/mach/irq.h> 24#include <asm/mach/irq.h>
25#include <mach/hardware.h>
25 26
26#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR) 27#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
27#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */ 28#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
@@ -72,14 +73,14 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type)
72{ 73{
73 unsigned int irqt; 74 unsigned int irqt;
74 75
75 if (irq >= MXC_MAX_INT_LINES) 76 if (irq >= MXC_INTERNAL_IRQS)
76 return -EINVAL; 77 return -EINVAL;
77 78
78 if (irq < MXC_MAX_INT_LINES / 2) { 79 if (irq < MXC_INTERNAL_IRQS / 2) {
79 irqt = __raw_readl(AVIC_INTTYPEL) & ~(1 << irq); 80 irqt = __raw_readl(AVIC_INTTYPEL) & ~(1 << irq);
80 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEL); 81 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEL);
81 } else { 82 } else {
82 irq -= MXC_MAX_INT_LINES / 2; 83 irq -= MXC_INTERNAL_IRQS / 2;
83 irqt = __raw_readl(AVIC_INTTYPEH) & ~(1 << irq); 84 irqt = __raw_readl(AVIC_INTTYPEH) & ~(1 << irq);
84 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEH); 85 __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEH);
85 } 86 }
@@ -129,7 +130,7 @@ void __init mxc_init_irq(void)
129 /* all IRQ no FIQ */ 130 /* all IRQ no FIQ */
130 __raw_writel(0, AVIC_INTTYPEH); 131 __raw_writel(0, AVIC_INTTYPEH);
131 __raw_writel(0, AVIC_INTTYPEL); 132 __raw_writel(0, AVIC_INTTYPEL);
132 for (i = 0; i < MXC_MAX_INT_LINES; i++) { 133 for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
133 set_irq_chip(i, &mxc_avic_chip); 134 set_irq_chip(i, &mxc_avic_chip);
134 set_irq_handler(i, handle_level_irq); 135 set_irq_handler(i, handle_level_irq);
135 set_irq_flags(i, IRQF_VALID); 136 set_irq_flags(i, IRQF_VALID);