~ubuntu-branches/ubuntu/lucid/xenomai/lucid

« back to all changes in this revision

Viewing changes to ksrc/arch/arm/patches/ipipe-2.6.27-mx31ads.diff

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-06-24 22:17:01 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090624221701-mwnah8aj90zmp6uj
Tags: 2.4.8-2ubuntu1
* Merge from debian unstable (LP: #391918), remaining changes:
  - Add lpia to supported architectures.
  - debian/rules: Create file for debhelper to pick up, use debhelper to
    install it.
  - debian/libxenomai1.dirs: Do not create directory.
  - debian/libxenomai1.preinst: Remove symlink on upgrade, remove old udev.
    rule unless modified in which case move to new name.
  - debian/libxenomai1.postinst: Do not create symlink.
  - debian/libxenomai1.postrm: No symlink to remove.
  - Bump build-depend on debhelper to install udev rules into
    /lib/udev/rules.d, add Breaks on udev to get correct version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
@@ -22,6 +22,7 @@
 
6
 #include <linux/init.h>
 
7
 #include <linux/clk.h>
 
8
 #include <linux/serial_8250.h>
 
9
+#include <linux/irq.h>
 
10
 
 
11
 #include <mach/hardware.h>
 
12
 #include <asm/mach-types.h>
 
13
@@ -106,6 +107,88 @@ static inline void mxc_init_imx_uart(void)
 
14
 }
 
15
 #endif /* !SERIAL_IMX */
 
16
 
 
17
+static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
 
18
+{
 
19
+       u32 imr_val;
 
20
+       u32 int_valid;
 
21
+       u32 expio_irq;
 
22
+
 
23
+       imr_val = __raw_readw(PBC_INTMASK_SET_REG);
 
24
+       int_valid = __raw_readw(PBC_INTSTATUS_REG) & imr_val;
 
25
+
 
26
+       expio_irq = MXC_EXP_IO_BASE;
 
27
+       for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
 
28
+               if ((int_valid & 1) == 0)
 
29
+                       continue;
 
30
+
 
31
+               generic_handle_irq(expio_irq);
 
32
+       }
 
33
+}
 
34
+
 
35
+/*
 
36
+ * Disable an expio pin's interrupt by setting the bit in the imr.
 
37
+ * @param irq           an expio virtual irq number
 
38
+ */
 
39
+static void expio_mask_irq(u32 irq)
 
40
+{
 
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);
 
45
+}
 
46
+
 
47
+/*
 
48
+ * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr.
 
49
+ * @param irq           an expanded io virtual irq number
 
50
+ */
 
51
+static void expio_ack_irq(u32 irq)
 
52
+{
 
53
+       u32 expio = MXC_IRQ_TO_EXPIO(irq);
 
54
+       /* clear the interrupt status */
 
55
+       __raw_writew(1 << expio, PBC_INTSTATUS_REG);
 
56
+}
 
57
+
 
58
+/*
 
59
+ * Enable a expio pin's interrupt by clearing the bit in the imr.
 
60
+ * @param irq           a expio virtual irq number
 
61
+ */
 
62
+static void expio_unmask_irq(u32 irq)
 
63
+{
 
64
+       u32 expio = MXC_IRQ_TO_EXPIO(irq);
 
65
+       /* unmask the interrupt */
 
66
+       __raw_writew(1 << expio, PBC_INTMASK_SET_REG);
 
67
+}
 
68
+
 
69
+static struct irq_chip expio_irq_chip = {
 
70
+       .ack = expio_ack_irq,
 
71
+       .mask = expio_mask_irq,
 
72
+       .unmask = expio_unmask_irq,
 
73
+};
 
74
+
 
75
+static void __init mx31ads_init_expio(void)
 
76
+{
 
77
+       int i;
 
78
+
 
79
+       printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n");
 
80
+
 
81
+       /*
 
82
+        * Configure INT line as GPIO input
 
83
+        */
 
84
+       mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO));
 
85
+
 
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);
 
90
+            i++) {
 
91
+               set_irq_chip(i, &expio_irq_chip);
 
92
+               set_irq_handler(i, handle_level_irq);
 
93
+               set_irq_flags(i, IRQF_VALID);
 
94
+       }
 
95
+       set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_HIGH);
 
96
+       set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler);
 
97
+}
 
98
+
 
99
 /*!
 
100
  * This structure defines static mappings for the i.MX31ADS board.
 
101
  */
 
102
@@ -142,6 +225,12 @@ void __init mx31ads_map_io(void)
 
103
        iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
 
104
 }
 
105
 
 
106
+void __init mx31ads_init_irq(void)
 
107
+{
 
108
+       mxc_init_irq();
 
109
+       mx31ads_init_expio();
 
110
+}
 
111
+
 
112
 /*!
 
113
  * Board specific initialization.
 
114
  */
 
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,
 
123
 MACHINE_END
 
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
 
128
@@ -90,6 +90,9 @@
 
129
 #define PBC_INTMASK_CLEAR_REG  (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
 
130
 #define EXPIO_PARENT_INT       IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
 
131
 
 
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)
 
134
+
 
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
 
142
@@ -31,6 +31,8 @@
 
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>
 
148
 
 
149
 /*!
 
150
  * @file mx31ads.c
 
151
@@ -84,6 +86,26 @@ static inline int mxc_init_extuart(void)
 
152
 }
 
153
 #endif
 
154
 
 
155
+#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
 
156
+static struct imxuart_platform_data uart_pdata = {
 
157
+       .flags = IMXUART_HAVE_RTSCTS,
 
158
+};
 
159
+
 
160
+static inline void mxc_init_imx_uart(void)
 
161
+{
 
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);
 
166
+
 
167
+       imx_init_uart(0, &uart_pdata);
 
168
+}
 
169
+#else /* !SERIAL_IMX */
 
170
+static inline void mxc_init_imx_uart(void)
 
171
+{
 
172
+}
 
173
+#endif /* !SERIAL_IMX */
 
174
+
 
175
 /*!
 
176
  * This structure defines static mappings for the i.MX31ADS board.
 
177
  */
 
178
@@ -126,6 +148,7 @@ void __init mx31ads_map_io(void)
 
179
 static void __init mxc_board_init(void)
 
180
 {
 
181
        mxc_init_extuart();
 
182
+       mxc_init_imx_uart();
 
183
 }
 
184
 
 
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
 
191
 
 
192
 config CS89x0
 
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)
 
197
        ---help---
 
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.
 
203
 
 
204
+config CS89x0_NONISA_IRQ
 
205
+       def_bool y
 
206
+       depends on CS89x0 != n
 
207
+       depends on MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_MX31ADS
 
208
+
 
209
 config TC35815
 
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
 
224
+};
 
225
+static unsigned cs8900_irq_map[] = {EXPIO_INT_ENET_INT, 0, 0, 0};
 
226
 #else
 
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)
 
230
        } else {
 
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];
 
236
 #else
 
237
                        /* Translate the IRQ using the IRQ mapping table. */
 
238
@@ -1029,6 +1035,7 @@ skip_this_frame:
 
239
 
 
240
 void  __init reset_chip(struct net_device *dev)
 
241
 {
 
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)
 
249
                ;
 
250
+#endif /* !CONFIG_MACH_MX31ADS */
 
251
 }
 
252
 
 
253
 
 
254
@@ -1304,7 +1312,7 @@ net_open(struct net_device *dev)
 
255
        else
 
256
 #endif
 
257
        {
 
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);