1
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
2
index 09dd8f4..a1e7947 100644
3
--- a/arch/arm/mach-mx3/mx31ads.c
4
+++ b/arch/arm/mach-mx3/mx31ads.c
6
#include <linux/init.h>
8
#include <linux/serial_8250.h>
9
+#include <linux/irq.h>
11
#include <mach/hardware.h>
12
#include <asm/mach-types.h>
13
@@ -106,6 +107,88 @@ static inline void mxc_init_imx_uart(void)
15
#endif /* !SERIAL_IMX */
17
+static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
23
+ imr_val = __raw_readw(PBC_INTMASK_SET_REG);
24
+ int_valid = __raw_readw(PBC_INTSTATUS_REG) & imr_val;
26
+ expio_irq = MXC_EXP_IO_BASE;
27
+ for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
28
+ if ((int_valid & 1) == 0)
31
+ generic_handle_irq(expio_irq);
36
+ * Disable an expio pin's interrupt by setting the bit in the imr.
37
+ * @param irq an expio virtual irq number
39
+static void expio_mask_irq(u32 irq)
41
+ u32 expio = MXC_IRQ_TO_EXPIO(irq);
42
+ /* mask the interrupt */
43
+ __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG);
44
+ __raw_readw(PBC_INTMASK_CLEAR_REG);
48
+ * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr.
49
+ * @param irq an expanded io virtual irq number
51
+static void expio_ack_irq(u32 irq)
53
+ u32 expio = MXC_IRQ_TO_EXPIO(irq);
54
+ /* clear the interrupt status */
55
+ __raw_writew(1 << expio, PBC_INTSTATUS_REG);
59
+ * Enable a expio pin's interrupt by clearing the bit in the imr.
60
+ * @param irq a expio virtual irq number
62
+static void expio_unmask_irq(u32 irq)
64
+ u32 expio = MXC_IRQ_TO_EXPIO(irq);
65
+ /* unmask the interrupt */
66
+ __raw_writew(1 << expio, PBC_INTMASK_SET_REG);
69
+static struct irq_chip expio_irq_chip = {
70
+ .ack = expio_ack_irq,
71
+ .mask = expio_mask_irq,
72
+ .unmask = expio_unmask_irq,
75
+static void __init mx31ads_init_expio(void)
79
+ printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n");
82
+ * Configure INT line as GPIO input
84
+ mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO));
86
+ /* disable the interrupt and clear the status */
87
+ __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
88
+ __raw_writew(0xFFFF, PBC_INTSTATUS_REG);
89
+ for (i = MXC_EXP_IO_BASE; i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES);
91
+ set_irq_chip(i, &expio_irq_chip);
92
+ set_irq_handler(i, handle_level_irq);
93
+ set_irq_flags(i, IRQF_VALID);
95
+ set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_HIGH);
96
+ set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler);
100
* This structure defines static mappings for the i.MX31ADS board.
102
@@ -142,6 +225,12 @@ void __init mx31ads_map_io(void)
103
iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
106
+void __init mx31ads_init_irq(void)
109
+ mx31ads_init_expio();
113
* Board specific initialization.
115
@@ -171,7 +260,7 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
116
.io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
117
.boot_params = PHYS_OFFSET + 0x100,
118
.map_io = mx31ads_map_io,
119
- .init_irq = mxc_init_irq,
120
+ .init_irq = mx31ads_init_irq,
121
.init_machine = mxc_board_init,
122
.timer = &mx31ads_timer,
124
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
125
index 1bc6fb0..745b488 100644
126
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
127
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
129
#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
130
#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
132
+#define MXC_EXP_IO_BASE (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES)
133
+#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
135
#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
136
#define EXPIO_INT_PB_IRQ (MXC_EXP_IO_BASE + 1)
137
#define EXPIO_INT_OTG_FS_OVR (MXC_EXP_IO_BASE + 2)
138
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
139
index 60fb4e0..09dd8f4 100644
140
--- a/arch/arm/mach-mx3/mx31ads.c
141
+++ b/arch/arm/mach-mx3/mx31ads.c
143
#include <asm/mach/map.h>
144
#include <mach/common.h>
145
#include <mach/board-mx31ads.h>
146
+#include <mach/imx-uart.h>
147
+#include <mach/iomux-mx3.h>
151
@@ -84,6 +86,26 @@ static inline int mxc_init_extuart(void)
155
+#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
156
+static struct imxuart_platform_data uart_pdata = {
157
+ .flags = IMXUART_HAVE_RTSCTS,
160
+static inline void mxc_init_imx_uart(void)
162
+ mxc_iomux_mode(MX31_PIN_CTS1__CTS1);
163
+ mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
164
+ mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
165
+ mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
167
+ imx_init_uart(0, &uart_pdata);
169
+#else /* !SERIAL_IMX */
170
+static inline void mxc_init_imx_uart(void)
173
+#endif /* !SERIAL_IMX */
176
* This structure defines static mappings for the i.MX31ADS board.
178
@@ -126,6 +148,7 @@ void __init mx31ads_map_io(void)
179
static void __init mxc_board_init(void)
182
+ mxc_init_imx_uart();
185
static void __init mx31ads_timer_init(void)
186
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
187
index 4a11296..9df7bb9 100644
188
--- a/drivers/net/Kconfig
189
+++ b/drivers/net/Kconfig
190
@@ -1386,7 +1386,8 @@ config FORCEDETH_NAPI
193
tristate "CS89x0 support"
194
- depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X)
195
+ depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \
196
+ || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_MX31ADS)
198
Support for CS89x0 chipset based Ethernet cards. If you have a
199
network (Ethernet) card of this type, say Y and read the
200
@@ -1397,6 +1398,11 @@ config CS89x0
201
To compile this driver as a module, choose M here. The module
202
will be called cs89x0.
204
+config CS89x0_NONISA_IRQ
206
+ depends on CS89x0 != n
207
+ depends on MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_MX31ADS
210
tristate "TOSHIBA TC35815 Ethernet support"
211
depends on NET_PCI && PCI && MIPS
212
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
213
index ea6144a..5890a91 100644
214
--- a/drivers/net/cs89x0.c
215
+++ b/drivers/net/cs89x0.c
216
@@ -194,6 +194,12 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
217
#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */
218
static unsigned int netcard_portlist[] __used __initdata = {CIRRUS_DEFAULT_BASE, 0};
219
static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
220
+#elif defined(CONFIG_MACH_MX31ADS)
221
+#include <mach/board-mx31ads.h>
222
+static unsigned int netcard_portlist[] __used __initdata = {
223
+ PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
225
+static unsigned cs8900_irq_map[] = {EXPIO_INT_ENET_INT, 0, 0, 0};
227
static unsigned int netcard_portlist[] __used __initdata =
228
{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
229
@@ -802,7 +808,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
231
i = lp->isa_config & INT_NO_MASK;
232
if (lp->chip_type == CS8900) {
233
-#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X)
234
+#ifdef CONFIG_CS89x0_NONISA_IRQ
235
i = cs8900_irq_map[0];
237
/* Translate the IRQ using the IRQ mapping table. */
238
@@ -1029,6 +1035,7 @@ skip_this_frame:
240
void __init reset_chip(struct net_device *dev)
242
+#if !defined(CONFIG_MACH_MX31ADS)
243
#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01)
244
struct net_local *lp = netdev_priv(dev);
245
int ioaddr = dev->base_addr;
246
@@ -1057,6 +1064,7 @@ void __init reset_chip(struct net_device *dev)
247
reset_start_time = jiffies;
248
while( (readreg(dev, PP_SelfST) & INIT_DONE) == 0 && jiffies - reset_start_time < 2)
250
+#endif /* !CONFIG_MACH_MX31ADS */
254
@@ -1304,7 +1312,7 @@ net_open(struct net_device *dev)
258
-#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X)
259
+#ifndef CONFIG_CS89x0_NONISA_IRQ
260
if (((1 << dev->irq) & lp->irq_map) == 0) {
261
printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
262
dev->name, dev->irq, lp->irq_map);