Change default ssid to "OpenWrt", and disable lazywds by default
[openwrt.git] / openwrt / package / linux / kernel-patches / 000-linux-mips-cvs
1 diff -Nur linux-2.4.29/arch/i386/kernel/acpi.c linux-mips/arch/i386/kernel/acpi.c
2 --- linux-2.4.29/arch/i386/kernel/acpi.c 2004-11-17 12:54:21.000000000 +0100
3 +++ linux-mips/arch/i386/kernel/acpi.c 2005-03-26 11:47:12.638577463 +0100
4 @@ -55,6 +55,7 @@
5
6 acpi_interrupt_flags acpi_sci_flags __initdata;
7 int acpi_sci_override_gsi __initdata;
8 +int acpi_skip_timer_override __initdata;
9 /* --------------------------------------------------------------------------
10 Boot-time Configuration
11 -------------------------------------------------------------------------- */
12 @@ -320,6 +321,12 @@
13 return 0;
14 }
15
16 + if (acpi_skip_timer_override &&
17 + intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
18 + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
19 + return 0;
20 + }
21 +
22 mp_override_legacy_irq (
23 intsrc->bus_irq,
24 intsrc->flags.polarity,
25 @@ -433,6 +440,10 @@
26 return result;
27 }
28
29 +#ifdef CONFIG_X86_IOAPIC
30 + check_acpi_pci();
31 +#endif
32 +
33 result = acpi_blacklisted();
34 if (result) {
35 printk(KERN_NOTICE PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
36 diff -Nur linux-2.4.29/arch/i386/kernel/earlyquirk.c linux-mips/arch/i386/kernel/earlyquirk.c
37 --- linux-2.4.29/arch/i386/kernel/earlyquirk.c 1970-01-01 01:00:00.000000000 +0100
38 +++ linux-mips/arch/i386/kernel/earlyquirk.c 2005-03-18 13:13:20.000000000 +0100
39 @@ -0,0 +1,53 @@
40 +/*
41 + * Do early PCI probing for bug detection when the main PCI subsystem is
42 + * not up yet.
43 + */
44 +#include <linux/init.h>
45 +#include <linux/kernel.h>
46 +#include <linux/pci.h>
47 +#include <asm/pci-direct.h>
48 +#include <asm/acpi.h>
49 +
50 +#ifdef CONFIG_ACPI
51 +static int __init check_bridge(int vendor, int device)
52 +{
53 + /* According to Nvidia all timer overrides are bogus. Just ignore
54 + them all. */
55 + if (vendor == PCI_VENDOR_ID_NVIDIA) {
56 + acpi_skip_timer_override = 1;
57 + }
58 + return 0;
59 +}
60 +
61 +void __init check_acpi_pci(void)
62 +{
63 + int num,slot,func;
64 +
65 + /* Assume the machine supports type 1. If not it will
66 + always read ffffffff and should not have any side effect. */
67 +
68 + /* Poor man's PCI discovery */
69 + for (num = 0; num < 32; num++) {
70 + for (slot = 0; slot < 32; slot++) {
71 + for (func = 0; func < 8; func++) {
72 + u32 class;
73 + u32 vendor;
74 + class = read_pci_config(num,slot,func,
75 + PCI_CLASS_REVISION);
76 + if (class == 0xffffffff)
77 + break;
78 +
79 + if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
80 + continue;
81 +
82 + vendor = read_pci_config(num, slot, func,
83 + PCI_VENDOR_ID);
84 +
85 + if (check_bridge(vendor&0xffff, vendor >> 16))
86 + return;
87 + }
88 +
89 + }
90 + }
91 +}
92 +#endif /* CONFIG_ACPI */
93 diff -Nur linux-2.4.29/arch/i386/kernel/Makefile linux-mips/arch/i386/kernel/Makefile
94 --- linux-2.4.29/arch/i386/kernel/Makefile 2003-11-28 19:26:19.000000000 +0100
95 +++ linux-mips/arch/i386/kernel/Makefile 2005-03-26 11:47:12.567589113 +0100
96 @@ -40,7 +40,7 @@
97 obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o
98 obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
99 obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o
100 -obj-$(CONFIG_X86_IO_APIC) += io_apic.o
101 +obj-$(CONFIG_X86_IO_APIC) += io_apic.o earlyquirk.o
102 obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
103 obj-$(CONFIG_EDD) += edd.o
104
105 diff -Nur linux-2.4.29/arch/i386/kernel/pci-irq.c linux-mips/arch/i386/kernel/pci-irq.c
106 --- linux-2.4.29/arch/i386/kernel/pci-irq.c 2005-01-19 15:09:25.000000000 +0100
107 +++ linux-mips/arch/i386/kernel/pci-irq.c 2005-03-26 11:47:12.808549566 +0100
108 @@ -1120,13 +1120,15 @@
109 void pcibios_enable_irq(struct pci_dev *dev)
110 {
111 u8 pin;
112 - extern int interrupt_line_quirk;
113 + extern int via_interrupt_line_quirk;
114 struct pci_dev *temp_dev;
115
116 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
117 if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
118 char *msg;
119
120 + pin--; /* interrupt pins are numbered starting from 1 */
121 +
122 /* With IDE legacy devices the IRQ lookup failure is not a problem.. */
123 if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE && !(dev->class & 0x5))
124 return;
125 @@ -1134,46 +1136,43 @@
126 if (io_apic_assign_pci_irqs) {
127 int irq;
128
129 - if (pin) {
130 - pin--; /* interrupt pins are numbered starting from 1 */
131 - irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
132 - /*
133 - * Busses behind bridges are typically not listed in the MP-table.
134 - * In this case we have to look up the IRQ based on the parent bus,
135 - * parent slot, and pin number. The SMP code detects such bridged
136 - * busses itself so we should get into this branch reliably.
137 - */
138 - temp_dev = dev;
139 - while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
140 - struct pci_dev * bridge = dev->bus->self;
141 + irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
142 + /*
143 + * Busses behind bridges are typically not listed in the MP-table.
144 + * In this case we have to look up the IRQ based on the parent bus,
145 + * parent slot, and pin number. The SMP code detects such bridged
146 + * busses itself so we should get into this branch reliably.
147 + */
148 + temp_dev = dev;
149 + while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
150 + struct pci_dev * bridge = dev->bus->self;
151
152 - pin = (pin + PCI_SLOT(dev->devfn)) % 4;
153 - irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
154 - PCI_SLOT(bridge->devfn), pin);
155 - if (irq >= 0)
156 - printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n",
157 - bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq);
158 - dev = bridge;
159 - }
160 - dev = temp_dev;
161 - if (irq >= 0) {
162 - printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
163 - dev->bus->number, PCI_SLOT(dev->devfn), pin, irq);
164 - dev->irq = irq;
165 - return;
166 - } else
167 - msg = " Probably buggy MP table.";
168 + pin = (pin + PCI_SLOT(dev->devfn)) % 4;
169 + irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
170 + PCI_SLOT(bridge->devfn), pin);
171 + if (irq >= 0)
172 + printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n",
173 + bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq);
174 + dev = bridge;
175 }
176 + dev = temp_dev;
177 + if (irq >= 0) {
178 + printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
179 + dev->bus->number, PCI_SLOT(dev->devfn), pin, irq);
180 + dev->irq = irq;
181 + return;
182 + } else
183 + msg = " Probably buggy MP table.";
184 } else if (pci_probe & PCI_BIOS_IRQ_SCAN)
185 msg = "";
186 else
187 msg = " Please try using pci=biosirq.";
188 printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n",
189 - 'A' + pin - 1, dev->slot_name, msg);
190 + 'A' + pin, dev->slot_name, msg);
191 }
192 /* VIA bridges use interrupt line for apic/pci steering across
193 the V-Link */
194 - else if (interrupt_line_quirk)
195 + else if (via_interrupt_line_quirk)
196 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15);
197
198 }
199 diff -Nur linux-2.4.29/arch/i386/kernel/setup.c linux-mips/arch/i386/kernel/setup.c
200 --- linux-2.4.29/arch/i386/kernel/setup.c 2004-08-08 01:26:04.000000000 +0200
201 +++ linux-mips/arch/i386/kernel/setup.c 2005-03-26 11:47:12.810549238 +0100
202 @@ -354,7 +354,8 @@
203 struct resource standard_io_resources[] = {
204 { "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
205 { "pic1", 0x20, 0x3f, IORESOURCE_BUSY },
206 - { "timer", 0x40, 0x5f, IORESOURCE_BUSY },
207 + { "timer0", 0x40, 0x43, IORESOURCE_BUSY },
208 + { "timer1", 0x50, 0x53, IORESOURCE_BUSY },
209 { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY },
210 { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
211 { "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },
212 diff -Nur linux-2.4.29/arch/i386/lib/usercopy.c linux-mips/arch/i386/lib/usercopy.c
213 --- linux-2.4.29/arch/i386/lib/usercopy.c 2003-06-13 16:51:29.000000000 +0200
214 +++ linux-mips/arch/i386/lib/usercopy.c 2005-03-26 11:47:12.859541197 +0100
215 @@ -14,6 +14,7 @@
216 unsigned long
217 __generic_copy_to_user(void *to, const void *from, unsigned long n)
218 {
219 + BUG_ON((long) n < 0);
220 if (access_ok(VERIFY_WRITE, to, n))
221 {
222 if(n<512)
223 @@ -27,6 +28,7 @@
224 unsigned long
225 __generic_copy_from_user(void *to, const void *from, unsigned long n)
226 {
227 + BUG_ON((long) n < 0);
228 if (access_ok(VERIFY_READ, from, n))
229 {
230 if(n<512)
231 @@ -44,6 +46,7 @@
232 unsigned long
233 __generic_copy_to_user(void *to, const void *from, unsigned long n)
234 {
235 + BUG_ON((long) n < 0);
236 prefetch(from);
237 if (access_ok(VERIFY_WRITE, to, n))
238 __copy_user(to,from,n);
239 @@ -53,6 +56,7 @@
240 unsigned long
241 __generic_copy_from_user(void *to, const void *from, unsigned long n)
242 {
243 + BUG_ON((long) n < 0);
244 prefetchw(to);
245 if (access_ok(VERIFY_READ, from, n))
246 __copy_user_zeroing(to,from,n);
247 diff -Nur linux-2.4.29/arch/ia64/ia32/sys_ia32.c linux-mips/arch/ia64/ia32/sys_ia32.c
248 --- linux-2.4.29/arch/ia64/ia32/sys_ia32.c 2005-01-19 15:09:26.000000000 +0100
249 +++ linux-mips/arch/ia64/ia32/sys_ia32.c 2005-03-26 11:47:12.934528890 +0100
250 @@ -1649,7 +1649,8 @@
251 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
252 */
253 static void
254 -cmsg32_recvmsg_fixup (struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
255 +cmsg32_recvmsg_fixup (struct msghdr *kmsg, unsigned long orig_cmsg_uptr,
256 + __kernel_size_t orig_cmsg_len)
257 {
258 unsigned char *workbuf, *wp;
259 unsigned long bufsz, space_avail;
260 @@ -1683,6 +1684,9 @@
261 goto fail2;
262
263 clen64 = kcmsg32->cmsg_len;
264 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
265 + (clen64 > (orig_cmsg_len + wp - workbuf)))
266 + break;
267 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
268 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
269 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
270 @@ -1812,6 +1816,7 @@
271 struct iovec *iov=iovstack;
272 struct msghdr msg_sys;
273 unsigned long cmsg_ptr;
274 + __kernel_size_t cmsg_len;
275 int err, iov_size, total_len, len;
276 struct scm_cookie scm;
277
278 @@ -1856,6 +1861,7 @@
279 total_len=err;
280
281 cmsg_ptr = (unsigned long)msg_sys.msg_control;
282 + cmsg_len = msg_sys.msg_controllen;
283 msg_sys.msg_flags = 0;
284
285 if (sock->file->f_flags & O_NONBLOCK)
286 @@ -1882,7 +1888,8 @@
287 * fix it up before we tack on more stuff.
288 */
289 if ((unsigned long) msg_sys.msg_control != cmsg_ptr)
290 - cmsg32_recvmsg_fixup(&msg_sys, cmsg_ptr);
291 + cmsg32_recvmsg_fixup(&msg_sys, cmsg_ptr,
292 + cmsg_len);
293
294 /* Wheee... */
295 if (sock->passcred)
296 diff -Nur linux-2.4.29/arch/mips/au1000/common/au1xxx_irqmap.c linux-mips/arch/mips/au1000/common/au1xxx_irqmap.c
297 --- linux-2.4.29/arch/mips/au1000/common/au1xxx_irqmap.c 2005-01-19 15:09:26.000000000 +0100
298 +++ linux-mips/arch/mips/au1000/common/au1xxx_irqmap.c 2005-01-31 12:59:30.000000000 +0100
299 @@ -172,14 +172,14 @@
300 { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
301 { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0},
302 { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0},
303 - { AU1550_TOY_INT, INTC_INT_RISE_EDGE, 0 },
304 - { AU1550_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
305 - { AU1550_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
306 - { AU1550_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
307 - { AU1550_RTC_INT, INTC_INT_RISE_EDGE, 0 },
308 - { AU1550_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
309 - { AU1550_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
310 - { AU1550_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
311 + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
312 + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
313 + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
314 + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
315 + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
316 + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
317 + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
318 + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
319 { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0},
320 { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
321 { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
322 @@ -200,14 +200,14 @@
323 { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
324 { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0},
325 { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0},
326 - { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 },
327 - { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
328 - { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
329 - { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
330 - { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 },
331 - { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
332 - { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
333 - { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
334 + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
335 + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
336 + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
337 + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
338 + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
339 + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
340 + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
341 + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
342 { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0},
343 { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 },
344 { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
345 diff -Nur linux-2.4.29/arch/mips/au1000/common/cputable.c linux-mips/arch/mips/au1000/common/cputable.c
346 --- linux-2.4.29/arch/mips/au1000/common/cputable.c 2005-01-19 15:09:26.000000000 +0100
347 +++ linux-mips/arch/mips/au1000/common/cputable.c 2005-01-31 12:59:30.000000000 +0100
348 @@ -39,7 +39,8 @@
349 { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
350 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
351 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
352 - { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 },
353 + { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
354 + { 0xffffffff, 0x04030201, "Au1200 AC", 0, 0 },
355 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
356 };
357
358 diff -Nur linux-2.4.29/arch/mips/au1000/common/dbdma.c linux-mips/arch/mips/au1000/common/dbdma.c
359 --- linux-2.4.29/arch/mips/au1000/common/dbdma.c 2005-01-19 15:09:26.000000000 +0100
360 +++ linux-mips/arch/mips/au1000/common/dbdma.c 2005-03-26 11:47:17.214826394 +0100
361 @@ -41,6 +41,8 @@
362 #include <asm/au1xxx_dbdma.h>
363 #include <asm/system.h>
364
365 +#include <linux/module.h>
366 +
367 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
368
369 /*
370 @@ -60,37 +62,10 @@
371 */
372 #define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1))
373
374 -static volatile dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
375 -static int dbdma_initialized;
376 +static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
377 +static int dbdma_initialized=0;
378 static void au1xxx_dbdma_init(void);
379
380 -typedef struct dbdma_device_table {
381 - u32 dev_id;
382 - u32 dev_flags;
383 - u32 dev_tsize;
384 - u32 dev_devwidth;
385 - u32 dev_physaddr; /* If FIFO */
386 - u32 dev_intlevel;
387 - u32 dev_intpolarity;
388 -} dbdev_tab_t;
389 -
390 -typedef struct dbdma_chan_config {
391 - u32 chan_flags;
392 - u32 chan_index;
393 - dbdev_tab_t *chan_src;
394 - dbdev_tab_t *chan_dest;
395 - au1x_dma_chan_t *chan_ptr;
396 - au1x_ddma_desc_t *chan_desc_base;
397 - au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
398 - void *chan_callparam;
399 - void (*chan_callback)(int, void *, struct pt_regs *);
400 -} chan_tab_t;
401 -
402 -#define DEV_FLAGS_INUSE (1 << 0)
403 -#define DEV_FLAGS_ANYUSE (1 << 1)
404 -#define DEV_FLAGS_OUT (1 << 2)
405 -#define DEV_FLAGS_IN (1 << 3)
406 -
407 static dbdev_tab_t dbdev_tab[] = {
408 #ifdef CONFIG_SOC_AU1550
409 /* UARTS */
410 @@ -156,13 +131,13 @@
411 { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
412 { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
413
414 - { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
415 - { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
416 - { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
417 - { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
418 + { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 },
419 + { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 },
420 + { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 },
421 + { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 },
422
423 - { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
424 - { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
425 + { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 },
426 + { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 },
427
428 { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 },
429 { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 },
430 @@ -172,9 +147,9 @@
431 { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 },
432 { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
433
434 - { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
435 - { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
436 - { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
437 + { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 },
438 + { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 },
439 + { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 },
440 { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
441
442 { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
443 @@ -183,6 +158,24 @@
444
445 { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
446 { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
447 +
448 + /* Provide 16 user definable device types */
449 + { 0, 0, 0, 0, 0, 0, 0 },
450 + { 0, 0, 0, 0, 0, 0, 0 },
451 + { 0, 0, 0, 0, 0, 0, 0 },
452 + { 0, 0, 0, 0, 0, 0, 0 },
453 + { 0, 0, 0, 0, 0, 0, 0 },
454 + { 0, 0, 0, 0, 0, 0, 0 },
455 + { 0, 0, 0, 0, 0, 0, 0 },
456 + { 0, 0, 0, 0, 0, 0, 0 },
457 + { 0, 0, 0, 0, 0, 0, 0 },
458 + { 0, 0, 0, 0, 0, 0, 0 },
459 + { 0, 0, 0, 0, 0, 0, 0 },
460 + { 0, 0, 0, 0, 0, 0, 0 },
461 + { 0, 0, 0, 0, 0, 0, 0 },
462 + { 0, 0, 0, 0, 0, 0, 0 },
463 + { 0, 0, 0, 0, 0, 0, 0 },
464 + { 0, 0, 0, 0, 0, 0, 0 },
465 };
466
467 #define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t))
468 @@ -202,6 +195,30 @@
469 return NULL;
470 }
471
472 +u32
473 +au1xxx_ddma_add_device(dbdev_tab_t *dev)
474 +{
475 + u32 ret = 0;
476 + dbdev_tab_t *p=NULL;
477 + static u16 new_id=0x1000;
478 +
479 + p = find_dbdev_id(0);
480 + if ( NULL != p )
481 + {
482 + memcpy(p, dev, sizeof(dbdev_tab_t));
483 + p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
484 + ret = p->dev_id;
485 + new_id++;
486 +#if 0
487 + printk("add_device: id:%x flags:%x padd:%x\n",
488 + p->dev_id, p->dev_flags, p->dev_physaddr );
489 +#endif
490 + }
491 +
492 + return ret;
493 +}
494 +EXPORT_SYMBOL(au1xxx_ddma_add_device);
495 +
496 /* Allocate a channel and return a non-zero descriptor if successful.
497 */
498 u32
499 @@ -214,7 +231,7 @@
500 int i;
501 dbdev_tab_t *stp, *dtp;
502 chan_tab_t *ctp;
503 - volatile au1x_dma_chan_t *cp;
504 + au1x_dma_chan_t *cp;
505
506 /* We do the intialization on the first channel allocation.
507 * We have to wait because of the interrupt handler initialization
508 @@ -224,9 +241,6 @@
509 au1xxx_dbdma_init();
510 dbdma_initialized = 1;
511
512 - if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS))
513 - return 0;
514 -
515 if ((stp = find_dbdev_id(srcid)) == NULL) return 0;
516 if ((dtp = find_dbdev_id(destid)) == NULL) return 0;
517
518 @@ -268,9 +282,9 @@
519 /* If kmalloc fails, it is caught below same
520 * as a channel not available.
521 */
522 - ctp = (chan_tab_t *)kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
523 + ctp = (chan_tab_t *)
524 + kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
525 chan_tab_ptr[i] = ctp;
526 - ctp->chan_index = chan = i;
527 break;
528 }
529 }
530 @@ -278,10 +292,11 @@
531
532 if (ctp != NULL) {
533 memset(ctp, 0, sizeof(chan_tab_t));
534 + ctp->chan_index = chan = i;
535 dcp = DDMA_CHANNEL_BASE;
536 dcp += (0x0100 * chan);
537 ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
538 - cp = (volatile au1x_dma_chan_t *)dcp;
539 + cp = (au1x_dma_chan_t *)dcp;
540 ctp->chan_src = stp;
541 ctp->chan_dest = dtp;
542 ctp->chan_callback = callback;
543 @@ -298,6 +313,9 @@
544 i |= DDMA_CFG_DED;
545 if (dtp->dev_intpolarity)
546 i |= DDMA_CFG_DP;
547 + if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
548 + (dtp->dev_flags & DEV_FLAGS_SYNC))
549 + i |= DDMA_CFG_SYNC;
550 cp->ddma_cfg = i;
551 au_sync();
552
553 @@ -308,14 +326,14 @@
554 rv = (u32)(&chan_tab_ptr[chan]);
555 }
556 else {
557 - /* Release devices.
558 - */
559 + /* Release devices */
560 stp->dev_flags &= ~DEV_FLAGS_INUSE;
561 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
562 }
563 }
564 return rv;
565 }
566 +EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
567
568 /* Set the device width if source or destination is a FIFO.
569 * Should be 8, 16, or 32 bits.
570 @@ -343,6 +361,7 @@
571
572 return rv;
573 }
574 +EXPORT_SYMBOL(au1xxx_dbdma_set_devwidth);
575
576 /* Allocate a descriptor ring, initializing as much as possible.
577 */
578 @@ -369,7 +388,8 @@
579 * and if we try that first we are likely to not waste larger
580 * slabs of memory.
581 */
582 - desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t), GFP_KERNEL);
583 + desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t),
584 + GFP_KERNEL|GFP_DMA);
585 if (desc_base == 0)
586 return 0;
587
588 @@ -380,7 +400,7 @@
589 kfree((const void *)desc_base);
590 i = entries * sizeof(au1x_ddma_desc_t);
591 i += (sizeof(au1x_ddma_desc_t) - 1);
592 - if ((desc_base = (u32)kmalloc(i, GFP_KERNEL)) == 0)
593 + if ((desc_base = (u32)kmalloc(i, GFP_KERNEL|GFP_DMA)) == 0)
594 return 0;
595
596 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
597 @@ -460,9 +480,14 @@
598 /* If source input is fifo, set static address.
599 */
600 if (stp->dev_flags & DEV_FLAGS_IN) {
601 - src0 = stp->dev_physaddr;
602 - src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
603 + if ( stp->dev_flags & DEV_FLAGS_BURSTABLE )
604 + src1 |= DSCR_SRC1_SAM(DSCR_xAM_BURST);
605 + else
606 + src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
607 +
608 }
609 + if (stp->dev_physaddr)
610 + src0 = stp->dev_physaddr;
611
612 /* Set up dest1. For now, assume no stride and increment.
613 * A channel attribute update can change this later.
614 @@ -486,10 +511,18 @@
615 /* If destination output is fifo, set static address.
616 */
617 if (dtp->dev_flags & DEV_FLAGS_OUT) {
618 - dest0 = dtp->dev_physaddr;
619 + if ( dtp->dev_flags & DEV_FLAGS_BURSTABLE )
620 + dest1 |= DSCR_DEST1_DAM(DSCR_xAM_BURST);
621 + else
622 dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC);
623 }
624 + if (dtp->dev_physaddr)
625 + dest0 = dtp->dev_physaddr;
626
627 +#if 0
628 + printk("did:%x sid:%x cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
629 + dtp->dev_id, stp->dev_id, cmd0, cmd1, src0, src1, dest0, dest1 );
630 +#endif
631 for (i=0; i<entries; i++) {
632 dp->dscr_cmd0 = cmd0;
633 dp->dscr_cmd1 = cmd1;
634 @@ -498,6 +531,7 @@
635 dp->dscr_dest0 = dest0;
636 dp->dscr_dest1 = dest1;
637 dp->dscr_stat = 0;
638 + dp->sw_context = dp->sw_status = 0;
639 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
640 dp++;
641 }
642 @@ -510,13 +544,14 @@
643
644 return (u32)(ctp->chan_desc_base);
645 }
646 +EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
647
648 /* Put a source buffer into the DMA ring.
649 * This updates the source pointer and byte count. Normally used
650 * for memory to fifo transfers.
651 */
652 u32
653 -au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
654 +_au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
655 {
656 chan_tab_t *ctp;
657 au1x_ddma_desc_t *dp;
658 @@ -543,24 +578,40 @@
659 */
660 dp->dscr_source0 = virt_to_phys(buf);
661 dp->dscr_cmd1 = nbytes;
662 - dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
663 - ctp->chan_ptr->ddma_dbell = 0xffffffff; /* Make it go */
664 -
665 + /* Check flags */
666 + if (flags & DDMA_FLAGS_IE)
667 + dp->dscr_cmd0 |= DSCR_CMD0_IE;
668 + if (flags & DDMA_FLAGS_NOIE)
669 + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
670 /* Get next descriptor pointer.
671 */
672 ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
673
674 + /*
675 + * There is an errata on the Au1200/Au1550 parts that could result
676 + * in "stale" data being DMA'd. It has to do with the snoop logic on
677 + * the dache eviction buffer. NONCOHERENT_IO is on by default for
678 + * these parts. If it is fixedin the future, these dma_cache_inv will
679 + * just be nothing more than empty macros. See io.h.
680 + * */
681 + dma_cache_wback_inv(buf,nbytes);
682 + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
683 + au_sync();
684 + dma_cache_wback_inv(dp, sizeof(dp));
685 + ctp->chan_ptr->ddma_dbell = 0;
686 +
687 /* return something not zero.
688 */
689 return nbytes;
690 }
691 +EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
692
693 /* Put a destination buffer into the DMA ring.
694 * This updates the destination pointer and byte count. Normally used
695 * to place an empty buffer into the ring for fifo to memory transfers.
696 */
697 u32
698 -au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
699 +_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
700 {
701 chan_tab_t *ctp;
702 au1x_ddma_desc_t *dp;
703 @@ -582,11 +633,33 @@
704 if (dp->dscr_cmd0 & DSCR_CMD0_V)
705 return 0;
706
707 - /* Load up buffer address and byte count.
708 - */
709 + /* Load up buffer address and byte count */
710 +
711 + /* Check flags */
712 + if (flags & DDMA_FLAGS_IE)
713 + dp->dscr_cmd0 |= DSCR_CMD0_IE;
714 + if (flags & DDMA_FLAGS_NOIE)
715 + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
716 +
717 dp->dscr_dest0 = virt_to_phys(buf);
718 dp->dscr_cmd1 = nbytes;
719 +#if 0
720 + printk("cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
721 + dp->dscr_cmd0, dp->dscr_cmd1, dp->dscr_source0,
722 + dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1 );
723 +#endif
724 + /*
725 + * There is an errata on the Au1200/Au1550 parts that could result in
726 + * "stale" data being DMA'd. It has to do with the snoop logic on the
727 + * dache eviction buffer. NONCOHERENT_IO is on by default for these
728 + * parts. If it is fixedin the future, these dma_cache_inv will just
729 + * be nothing more than empty macros. See io.h.
730 + * */
731 + dma_cache_inv(buf,nbytes);
732 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
733 + au_sync();
734 + dma_cache_wback_inv(dp, sizeof(dp));
735 + ctp->chan_ptr->ddma_dbell = 0;
736
737 /* Get next descriptor pointer.
738 */
739 @@ -596,6 +669,7 @@
740 */
741 return nbytes;
742 }
743 +EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
744
745 /* Get a destination buffer into the DMA ring.
746 * Normally used to get a full buffer from the ring during fifo
747 @@ -645,7 +719,7 @@
748 au1xxx_dbdma_stop(u32 chanid)
749 {
750 chan_tab_t *ctp;
751 - volatile au1x_dma_chan_t *cp;
752 + au1x_dma_chan_t *cp;
753 int halt_timeout = 0;
754
755 ctp = *((chan_tab_t **)chanid);
756 @@ -665,6 +739,7 @@
757 cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V);
758 au_sync();
759 }
760 +EXPORT_SYMBOL(au1xxx_dbdma_stop);
761
762 /* Start using the current descriptor pointer. If the dbdma encounters
763 * a not valid descriptor, it will stop. In this case, we can just
764 @@ -674,17 +749,17 @@
765 au1xxx_dbdma_start(u32 chanid)
766 {
767 chan_tab_t *ctp;
768 - volatile au1x_dma_chan_t *cp;
769 + au1x_dma_chan_t *cp;
770
771 ctp = *((chan_tab_t **)chanid);
772 -
773 cp = ctp->chan_ptr;
774 cp->ddma_desptr = virt_to_phys(ctp->cur_ptr);
775 cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */
776 au_sync();
777 - cp->ddma_dbell = 0xffffffff; /* Make it go */
778 + cp->ddma_dbell = 0;
779 au_sync();
780 }
781 +EXPORT_SYMBOL(au1xxx_dbdma_start);
782
783 void
784 au1xxx_dbdma_reset(u32 chanid)
785 @@ -703,15 +778,21 @@
786
787 do {
788 dp->dscr_cmd0 &= ~DSCR_CMD0_V;
789 + /* reset our SW status -- this is used to determine
790 + * if a descriptor is in use by upper level SW. Since
791 + * posting can reset 'V' bit.
792 + */
793 + dp->sw_status = 0;
794 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
795 } while (dp != ctp->chan_desc_base);
796 }
797 +EXPORT_SYMBOL(au1xxx_dbdma_reset);
798
799 u32
800 au1xxx_get_dma_residue(u32 chanid)
801 {
802 chan_tab_t *ctp;
803 - volatile au1x_dma_chan_t *cp;
804 + au1x_dma_chan_t *cp;
805 u32 rv;
806
807 ctp = *((chan_tab_t **)chanid);
808 @@ -746,15 +827,16 @@
809
810 kfree(ctp);
811 }
812 +EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
813
814 static void
815 dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
816 {
817 - u32 intstat;
818 + u32 intstat, flags;
819 u32 chan_index;
820 chan_tab_t *ctp;
821 au1x_ddma_desc_t *dp;
822 - volatile au1x_dma_chan_t *cp;
823 + au1x_dma_chan_t *cp;
824
825 intstat = dbdma_gptr->ddma_intstat;
826 au_sync();
827 @@ -773,18 +855,26 @@
828 (ctp->chan_callback)(irq, ctp->chan_callparam, regs);
829
830 ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
831 -
832 }
833
834 -static void
835 -au1xxx_dbdma_init(void)
836 +static void au1xxx_dbdma_init(void)
837 {
838 + int irq_nr;
839 +
840 dbdma_gptr->ddma_config = 0;
841 dbdma_gptr->ddma_throttle = 0;
842 dbdma_gptr->ddma_inten = 0xffff;
843 au_sync();
844
845 - if (request_irq(AU1550_DDMA_INT, dbdma_interrupt, SA_INTERRUPT,
846 +#if defined(CONFIG_SOC_AU1550)
847 + irq_nr = AU1550_DDMA_INT;
848 +#elif defined(CONFIG_SOC_AU1200)
849 + irq_nr = AU1200_DDMA_INT;
850 +#else
851 + #error Unknown Au1x00 SOC
852 +#endif
853 +
854 + if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
855 "Au1xxx dbdma", (void *)dbdma_gptr))
856 printk("Can't get 1550 dbdma irq");
857 }
858 @@ -795,7 +885,8 @@
859 chan_tab_t *ctp;
860 au1x_ddma_desc_t *dp;
861 dbdev_tab_t *stp, *dtp;
862 - volatile au1x_dma_chan_t *cp;
863 + au1x_dma_chan_t *cp;
864 + u32 i = 0;
865
866 ctp = *((chan_tab_t **)chanid);
867 stp = ctp->chan_src;
868 @@ -820,15 +911,64 @@
869 dp = ctp->chan_desc_base;
870
871 do {
872 - printk("dp %08x, cmd0 %08x, cmd1 %08x\n",
873 - (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
874 - printk("src0 %08x, src1 %08x, dest0 %08x\n",
875 - dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0);
876 - printk("dest1 %08x, stat %08x, nxtptr %08x\n",
877 - dp->dscr_dest1, dp->dscr_stat, dp->dscr_nxtptr);
878 + printk("Dp[%d]= %08x, cmd0 %08x, cmd1 %08x\n",
879 + i++, (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
880 + printk("src0 %08x, src1 %08x, dest0 %08x, dest1 %08x\n",
881 + dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
882 + printk("stat %08x, nxtptr %08x\n",
883 + dp->dscr_stat, dp->dscr_nxtptr);
884 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
885 } while (dp != ctp->chan_desc_base);
886 }
887
888 +/* Put a descriptor into the DMA ring.
889 + * This updates the source/destination pointers and byte count.
890 + */
891 +u32
892 +au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr )
893 +{
894 + chan_tab_t *ctp;
895 + au1x_ddma_desc_t *dp;
896 + u32 nbytes=0;
897 +
898 + /* I guess we could check this to be within the
899 + * range of the table......
900 + */
901 + ctp = *((chan_tab_t **)chanid);
902 +
903 + /* We should have multiple callers for a particular channel,
904 + * an interrupt doesn't affect this pointer nor the descriptor,
905 + * so no locking should be needed.
906 + */
907 + dp = ctp->put_ptr;
908 +
909 + /* If the descriptor is valid, we are way ahead of the DMA
910 + * engine, so just return an error condition.
911 + */
912 + if (dp->dscr_cmd0 & DSCR_CMD0_V)
913 + return 0;
914 +
915 + /* Load up buffer addresses and byte count.
916 + */
917 + dp->dscr_dest0 = dscr->dscr_dest0;
918 + dp->dscr_source0 = dscr->dscr_source0;
919 + dp->dscr_dest1 = dscr->dscr_dest1;
920 + dp->dscr_source1 = dscr->dscr_source1;
921 + dp->dscr_cmd1 = dscr->dscr_cmd1;
922 + nbytes = dscr->dscr_cmd1;
923 + /* Allow the caller to specifiy if an interrupt is generated */
924 + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
925 + dp->dscr_cmd0 |= dscr->dscr_cmd0 | DSCR_CMD0_V;
926 + ctp->chan_ptr->ddma_dbell = 0;
927 +
928 + /* Get next descriptor pointer.
929 + */
930 + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
931 +
932 + /* return something not zero.
933 + */
934 + return nbytes;
935 +}
936 +
937 #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
938
939 diff -Nur linux-2.4.29/arch/mips/au1000/common/gpio.c linux-mips/arch/mips/au1000/common/gpio.c
940 --- linux-2.4.29/arch/mips/au1000/common/gpio.c 1970-01-01 01:00:00.000000000 +0100
941 +++ linux-mips/arch/mips/au1000/common/gpio.c 2005-01-30 09:01:27.000000000 +0100
942 @@ -0,0 +1,118 @@
943 +/*
944 + * This program is free software; you can redistribute it and/or modify it
945 + * under the terms of the GNU General Public License as published by the
946 + * Free Software Foundation; either version 2 of the License, or (at your
947 + * option) any later version.
948 + *
949 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
950 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
951 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
952 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
953 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
954 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
955 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
956 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
957 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
958 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
959 + *
960 + * You should have received a copy of the GNU General Public License along
961 + * with this program; if not, write to the Free Software Foundation, Inc.,
962 + * 675 Mass Ave, Cambridge, MA 02139, USA.
963 + */
964 +
965 +#include <asm/au1000.h>
966 +#include <asm/au1xxx_gpio.h>
967 +
968 +#define gpio1 sys
969 +#if !defined(CONFIG_SOC_AU1000)
970 +static AU1X00_GPIO2 * const gpio2 = (AU1X00_GPIO2 *)GPIO2_BASE;
971 +
972 +#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
973 +
974 +int au1xxx_gpio2_read(int signal)
975 +{
976 + signal -= 200;
977 +/* gpio2->dir &= ~(0x01 << signal); //Set GPIO to input */
978 + return ((gpio2->pinstate >> signal) & 0x01);
979 +}
980 +
981 +void au1xxx_gpio2_write(int signal, int value)
982 +{
983 + signal -= 200;
984 +
985 + gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << signal) |
986 + (value << signal);
987 +}
988 +
989 +void au1xxx_gpio2_tristate(int signal)
990 +{
991 + signal -= 200;
992 + gpio2->dir &= ~(0x01 << signal); /* Set GPIO to input */
993 +}
994 +#endif
995 +
996 +int au1xxx_gpio1_read(int signal)
997 +{
998 +/* gpio1->trioutclr |= (0x01 << signal); */
999 + return ((gpio1->pinstaterd >> signal) & 0x01);
1000 +}
1001 +
1002 +void au1xxx_gpio1_write(int signal, int value)
1003 +{
1004 + if(value)
1005 + gpio1->outputset = (0x01 << signal);
1006 + else
1007 + gpio1->outputclr = (0x01 << signal); /* Output a Zero */
1008 +}
1009 +
1010 +void au1xxx_gpio1_tristate(int signal)
1011 +{
1012 + gpio1->trioutclr = (0x01 << signal); /* Tristate signal */
1013 +}
1014 +
1015 +
1016 +int au1xxx_gpio_read(int signal)
1017 +{
1018 + if(signal >= 200)
1019 +#if defined(CONFIG_SOC_AU1000)
1020 + return 0;
1021 +#else
1022 + return au1xxx_gpio2_read(signal);
1023 +#endif
1024 + else
1025 + return au1xxx_gpio1_read(signal);
1026 +}
1027 +
1028 +void au1xxx_gpio_write(int signal, int value)
1029 +{
1030 + if(signal >= 200)
1031 +#if defined(CONFIG_SOC_AU1000)
1032 + ;
1033 +#else
1034 + au1xxx_gpio2_write(signal, value);
1035 +#endif
1036 + else
1037 + au1xxx_gpio1_write(signal, value);
1038 +}
1039 +
1040 +void au1xxx_gpio_tristate(int signal)
1041 +{
1042 + if(signal >= 200)
1043 +#if defined(CONFIG_SOC_AU1000)
1044 + ;
1045 +#else
1046 + au1xxx_gpio2_tristate(signal);
1047 +#endif
1048 + else
1049 + au1xxx_gpio1_tristate(signal);
1050 +}
1051 +
1052 +void au1xxx_gpio1_set_inputs(void)
1053 +{
1054 + gpio1->pininputen = 0;
1055 +}
1056 +
1057 +EXPORT_SYMBOL(au1xxx_gpio1_set_inputs);
1058 +EXPORT_SYMBOL(au1xxx_gpio_tristate);
1059 +EXPORT_SYMBOL(au1xxx_gpio_write);
1060 +EXPORT_SYMBOL(au1xxx_gpio_read);
1061 diff -Nur linux-2.4.29/arch/mips/au1000/common/irq.c linux-mips/arch/mips/au1000/common/irq.c
1062 --- linux-2.4.29/arch/mips/au1000/common/irq.c 2005-01-19 15:09:26.000000000 +0100
1063 +++ linux-mips/arch/mips/au1000/common/irq.c 2005-03-26 11:47:17.215826230 +0100
1064 @@ -303,8 +303,30 @@
1065 };
1066
1067 #ifdef CONFIG_PM
1068 -void startup_match20_interrupt(void)
1069 +void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *))
1070 {
1071 + static struct irqaction action;
1072 + /* This is a big problem.... since we didn't use request_irq
1073 + when kernel/irq.c calls probe_irq_xxx this interrupt will
1074 + be probed for usage. This will end up disabling the device :(
1075 +
1076 + Give it a bogus "action" pointer -- this will keep it from
1077 + getting auto-probed!
1078 +
1079 + By setting the status to match that of request_irq() we
1080 + can avoid it. --cgray
1081 + */
1082 + action.dev_id = handler;
1083 + action.flags = 0;
1084 + action.mask = 0;
1085 + action.name = "Au1xxx TOY";
1086 + action.handler = handler;
1087 + action.next = NULL;
1088 +
1089 + irq_desc[AU1000_TOY_MATCH2_INT].action = &action;
1090 + irq_desc[AU1000_TOY_MATCH2_INT].status
1091 + &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
1092 +
1093 local_enable_irq(AU1000_TOY_MATCH2_INT);
1094 }
1095 #endif
1096 @@ -508,6 +530,7 @@
1097
1098 if (!intc0_req0) return;
1099
1100 +#ifdef AU1000_USB_DEV_REQ_INT
1101 /*
1102 * Because of the tight timing of SETUP token to reply
1103 * transactions, the USB devices-side packet complete
1104 @@ -518,6 +541,7 @@
1105 do_IRQ(AU1000_USB_DEV_REQ_INT, regs);
1106 return;
1107 }
1108 +#endif
1109
1110 irq = au_ffs(intc0_req0) - 1;
1111 intc0_req0 &= ~(1<<irq);
1112 @@ -536,17 +560,7 @@
1113
1114 irq = au_ffs(intc0_req1) - 1;
1115 intc0_req1 &= ~(1<<irq);
1116 -#ifdef CONFIG_PM
1117 - if (irq == AU1000_TOY_MATCH2_INT) {
1118 - mask_and_ack_rise_edge_irq(irq);
1119 - counter0_irq(irq, NULL, regs);
1120 - local_enable_irq(irq);
1121 - }
1122 - else
1123 -#endif
1124 - {
1125 - do_IRQ(irq, regs);
1126 - }
1127 + do_IRQ(irq, regs);
1128 }
1129
1130
1131 diff -Nur linux-2.4.29/arch/mips/au1000/common/Makefile linux-mips/arch/mips/au1000/common/Makefile
1132 --- linux-2.4.29/arch/mips/au1000/common/Makefile 2005-01-19 15:09:26.000000000 +0100
1133 +++ linux-mips/arch/mips/au1000/common/Makefile 2005-01-31 12:59:30.000000000 +0100
1134 @@ -19,9 +19,9 @@
1135 export-objs = prom.o clocks.o power.o usbdev.o
1136
1137 obj-y := prom.o int-handler.o irq.o puts.o time.o reset.o cputable.o \
1138 - au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o
1139 + au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o gpio.o
1140
1141 -export-objs += dma.o dbdma.o
1142 +export-objs += dma.o dbdma.o gpio.o
1143
1144 obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o
1145 obj-$(CONFIG_KGDB) += dbg_io.o
1146 diff -Nur linux-2.4.29/arch/mips/au1000/common/pci_fixup.c linux-mips/arch/mips/au1000/common/pci_fixup.c
1147 --- linux-2.4.29/arch/mips/au1000/common/pci_fixup.c 2005-01-19 15:09:26.000000000 +0100
1148 +++ linux-mips/arch/mips/au1000/common/pci_fixup.c 2004-12-03 09:00:32.000000000 +0100
1149 @@ -75,9 +75,13 @@
1150
1151 #ifdef CONFIG_NONCOHERENT_IO
1152 /*
1153 - * Set the NC bit in controller for pre-AC silicon
1154 + * Set the NC bit in controller for Au1500 pre-AC silicon
1155 */
1156 - au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
1157 + u32 prid = read_c0_prid();
1158 + if ( (prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) {
1159 + au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
1160 + printk("Non-coherent PCI accesses enabled\n");
1161 + }
1162 printk("Non-coherent PCI accesses enabled\n");
1163 #endif
1164
1165 diff -Nur linux-2.4.29/arch/mips/au1000/common/pci_ops.c linux-mips/arch/mips/au1000/common/pci_ops.c
1166 --- linux-2.4.29/arch/mips/au1000/common/pci_ops.c 2004-02-18 14:36:30.000000000 +0100
1167 +++ linux-mips/arch/mips/au1000/common/pci_ops.c 2005-03-26 11:47:17.258819174 +0100
1168 @@ -162,6 +162,7 @@
1169 static int config_access(unsigned char access_type, struct pci_dev *dev,
1170 unsigned char where, u32 * data)
1171 {
1172 + int error = PCIBIOS_SUCCESSFUL;
1173 #if defined( CONFIG_SOC_AU1500 ) || defined( CONFIG_SOC_AU1550 )
1174 unsigned char bus = dev->bus->number;
1175 unsigned int dev_fn = dev->devfn;
1176 @@ -170,7 +171,6 @@
1177 unsigned long offset, status;
1178 unsigned long cfg_base;
1179 unsigned long flags;
1180 - int error = PCIBIOS_SUCCESSFUL;
1181 unsigned long entryLo0, entryLo1;
1182
1183 if (device > 19) {
1184 @@ -205,9 +205,8 @@
1185 last_entryLo0 = last_entryLo1 = 0xffffffff;
1186 }
1187
1188 - /* Since the Au1xxx doesn't do the idsel timing exactly to spec,
1189 - * many board vendors implement their own off-chip idsel, so call
1190 - * it now. If it doesn't succeed, may as well bail out at this point.
1191 + /* Allow board vendors to implement their own off-chip idsel.
1192 + * If it doesn't succeed, may as well bail out at this point.
1193 */
1194 if (board_pci_idsel) {
1195 if (board_pci_idsel(device, 1) == 0) {
1196 @@ -271,8 +270,11 @@
1197 }
1198
1199 local_irq_restore(flags);
1200 - return error;
1201 +#else
1202 + /* Fake out Config space access with no responder */
1203 + *data = 0xFFFFFFFF;
1204 #endif
1205 + return error;
1206 }
1207 #endif
1208
1209 diff -Nur linux-2.4.29/arch/mips/au1000/common/power.c linux-mips/arch/mips/au1000/common/power.c
1210 --- linux-2.4.29/arch/mips/au1000/common/power.c 2005-01-19 15:09:26.000000000 +0100
1211 +++ linux-mips/arch/mips/au1000/common/power.c 2005-01-31 12:59:30.000000000 +0100
1212 @@ -50,7 +50,6 @@
1213
1214 static void calibrate_delay(void);
1215
1216 -extern void set_au1x00_speed(unsigned int new_freq);
1217 extern unsigned int get_au1x00_speed(void);
1218 extern unsigned long get_au1x00_uart_baud_base(void);
1219 extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
1220 @@ -116,6 +115,7 @@
1221 sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK);
1222 sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL);
1223
1224 +#ifndef CONFIG_SOC_AU1200
1225 /* Shutdown USB host/device.
1226 */
1227 sleep_usbhost_enable = au_readl(USB_HOST_CONFIG);
1228 @@ -127,6 +127,7 @@
1229
1230 sleep_usbdev_enable = au_readl(USBD_ENABLE);
1231 au_writel(0, USBD_ENABLE); au_sync();
1232 +#endif
1233
1234 /* Save interrupt controller state.
1235 */
1236 @@ -212,14 +213,12 @@
1237 int au_sleep(void)
1238 {
1239 unsigned long wakeup, flags;
1240 - extern void save_and_sleep(void);
1241 + extern unsigned int save_and_sleep(void);
1242
1243 spin_lock_irqsave(&pm_lock,flags);
1244
1245 save_core_regs();
1246
1247 - flush_cache_all();
1248 -
1249 /** The code below is all system dependent and we should probably
1250 ** have a function call out of here to set this up. You need
1251 ** to configure the GPIO or timer interrupts that will bring
1252 @@ -227,27 +226,26 @@
1253 ** For testing, the TOY counter wakeup is useful.
1254 **/
1255
1256 -#if 0
1257 +#if 1
1258 au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
1259
1260 /* gpio 6 can cause a wake up event */
1261 wakeup = au_readl(SYS_WAKEMSK);
1262 wakeup &= ~(1 << 8); /* turn off match20 wakeup */
1263 - wakeup |= 1 << 6; /* turn on gpio 6 wakeup */
1264 + wakeup = 1 << 5; /* turn on gpio 6 wakeup */
1265 #else
1266 - /* For testing, allow match20 to wake us up.
1267 - */
1268 + /* For testing, allow match20 to wake us up. */
1269 #ifdef SLEEP_TEST_TIMEOUT
1270 wakeup_counter0_set(sleep_ticks);
1271 #endif
1272 wakeup = 1 << 8; /* turn on match20 wakeup */
1273 wakeup = 0;
1274 #endif
1275 - au_writel(1, SYS_WAKESRC); /* clear cause */
1276 + au_writel(0, SYS_WAKESRC); /* clear cause */
1277 au_sync();
1278 au_writel(wakeup, SYS_WAKEMSK);
1279 au_sync();
1280 -
1281 + DPRINTK("Entering sleep!\n");
1282 save_and_sleep();
1283
1284 /* after a wakeup, the cpu vectors back to 0x1fc00000 so
1285 @@ -255,6 +253,7 @@
1286 */
1287 restore_core_regs();
1288 spin_unlock_irqrestore(&pm_lock, flags);
1289 + DPRINTK("Leaving sleep!\n");
1290 return 0;
1291 }
1292
1293 @@ -285,7 +284,6 @@
1294
1295 if (retval)
1296 return retval;
1297 -
1298 au_sleep();
1299 retval = pm_send_all(PM_RESUME, (void *) 0);
1300 }
1301 @@ -312,120 +310,9 @@
1302 }
1303
1304
1305 -static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
1306 - void *buffer, size_t * len)
1307 -{
1308 - int retval = 0, i;
1309 - unsigned long val, pll;
1310 -#define TMPBUFLEN 64
1311 -#define MAX_CPU_FREQ 396
1312 - char buf[TMPBUFLEN], *p;
1313 - unsigned long flags, intc0_mask, intc1_mask;
1314 - unsigned long old_baud_base, old_cpu_freq, baud_rate, old_clk,
1315 - old_refresh;
1316 - unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
1317 -
1318 - spin_lock_irqsave(&pm_lock, flags);
1319 - if (!write) {
1320 - *len = 0;
1321 - } else {
1322 - /* Parse the new frequency */
1323 - if (*len > TMPBUFLEN - 1) {
1324 - spin_unlock_irqrestore(&pm_lock, flags);
1325 - return -EFAULT;
1326 - }
1327 - if (copy_from_user(buf, buffer, *len)) {
1328 - spin_unlock_irqrestore(&pm_lock, flags);
1329 - return -EFAULT;
1330 - }
1331 - buf[*len] = 0;
1332 - p = buf;
1333 - val = simple_strtoul(p, &p, 0);
1334 - if (val > MAX_CPU_FREQ) {
1335 - spin_unlock_irqrestore(&pm_lock, flags);
1336 - return -EFAULT;
1337 - }
1338 -
1339 - pll = val / 12;
1340 - if ((pll > 33) || (pll < 7)) { /* 396 MHz max, 84 MHz min */
1341 - /* revisit this for higher speed cpus */
1342 - spin_unlock_irqrestore(&pm_lock, flags);
1343 - return -EFAULT;
1344 - }
1345 -
1346 - old_baud_base = get_au1x00_uart_baud_base();
1347 - old_cpu_freq = get_au1x00_speed();
1348 -
1349 - new_cpu_freq = pll * 12 * 1000000;
1350 - new_baud_base = (new_cpu_freq / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
1351 - set_au1x00_speed(new_cpu_freq);
1352 - set_au1x00_uart_baud_base(new_baud_base);
1353 -
1354 - old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
1355 - new_refresh =
1356 - ((old_refresh * new_cpu_freq) /
1357 - old_cpu_freq) | (au_readl(MEM_SDREFCFG) & ~0x1ffffff);
1358 -
1359 - au_writel(pll, SYS_CPUPLL);
1360 - au_sync_delay(1);
1361 - au_writel(new_refresh, MEM_SDREFCFG);
1362 - au_sync_delay(1);
1363 -
1364 - for (i = 0; i < 4; i++) {
1365 - if (au_readl
1366 - (UART_BASE + UART_MOD_CNTRL +
1367 - i * 0x00100000) == 3) {
1368 - old_clk =
1369 - au_readl(UART_BASE + UART_CLK +
1370 - i * 0x00100000);
1371 - // baud_rate = baud_base/clk
1372 - baud_rate = old_baud_base / old_clk;
1373 - /* we won't get an exact baud rate and the error
1374 - * could be significant enough that our new
1375 - * calculation will result in a clock that will
1376 - * give us a baud rate that's too far off from
1377 - * what we really want.
1378 - */
1379 - if (baud_rate > 100000)
1380 - baud_rate = 115200;
1381 - else if (baud_rate > 50000)
1382 - baud_rate = 57600;
1383 - else if (baud_rate > 30000)
1384 - baud_rate = 38400;
1385 - else if (baud_rate > 17000)
1386 - baud_rate = 19200;
1387 - else
1388 - (baud_rate = 9600);
1389 - // new_clk = new_baud_base/baud_rate
1390 - new_clk = new_baud_base / baud_rate;
1391 - au_writel(new_clk,
1392 - UART_BASE + UART_CLK +
1393 - i * 0x00100000);
1394 - au_sync_delay(10);
1395 - }
1396 - }
1397 - }
1398 -
1399 -
1400 - /* We don't want _any_ interrupts other than
1401 - * match20. Otherwise our calibrate_delay()
1402 - * calculation will be off, potentially a lot.
1403 - */
1404 - intc0_mask = save_local_and_disable(0);
1405 - intc1_mask = save_local_and_disable(1);
1406 - local_enable_irq(AU1000_TOY_MATCH2_INT);
1407 - spin_unlock_irqrestore(&pm_lock, flags);
1408 - calibrate_delay();
1409 - restore_local_and_enable(0, intc0_mask);
1410 - restore_local_and_enable(1, intc1_mask);
1411 - return retval;
1412 -}
1413 -
1414 -
1415 static struct ctl_table pm_table[] = {
1416 {ACPI_S1_SLP_TYP, "suspend", NULL, 0, 0600, NULL, &pm_do_suspend},
1417 {ACPI_SLEEP, "sleep", NULL, 0, 0600, NULL, &pm_do_sleep},
1418 - {CTL_ACPI, "freq", NULL, 0, 0600, NULL, &pm_do_freq},
1419 {0}
1420 };
1421
1422 diff -Nur linux-2.4.29/arch/mips/au1000/common/reset.c linux-mips/arch/mips/au1000/common/reset.c
1423 --- linux-2.4.29/arch/mips/au1000/common/reset.c 2005-01-19 15:09:26.000000000 +0100
1424 +++ linux-mips/arch/mips/au1000/common/reset.c 2005-03-26 11:47:17.264818189 +0100
1425 @@ -37,8 +37,6 @@
1426 #include <asm/system.h>
1427 #include <asm/au1000.h>
1428
1429 -extern int au_sleep(void);
1430 -
1431 void au1000_restart(char *command)
1432 {
1433 /* Set all integrated peripherals to disabled states */
1434 @@ -144,6 +142,26 @@
1435 au_writel(0x00, 0xb1900064); /* sys_auxpll */
1436 au_writel(0x00, 0xb1900100); /* sys_pininputen */
1437 break;
1438 + case 0x04000000: /* Au1200 */
1439 + au_writel(0x00, 0xb400300c); /* ddma */
1440 + au_writel(0x00, 0xb1a00004); /* psc 0 */
1441 + au_writel(0x00, 0xb1b00004); /* psc 1 */
1442 + au_writel(0x00d02000, 0xb4020004); /* ehci, ohci, udc, otg */
1443 + au_writel(0x00, 0xb5000004); /* lcd */
1444 + au_writel(0x00, 0xb060000c); /* sd0 */
1445 + au_writel(0x00, 0xb068000c); /* sd1 */
1446 + au_writel(0x00, 0xb1100100); /* swcnt */
1447 + au_writel(0x00, 0xb0300000); /* aes */
1448 + au_writel(0x00, 0xb4004000); /* cim */
1449 + au_writel(0x00, 0xb1100100); /* uart0_enable */
1450 + au_writel(0x00, 0xb1200100); /* uart1_enable */
1451 + au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
1452 + au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
1453 + au_writel(0x00, 0xb1900028); /* sys_clksrc */
1454 + au_writel(0x10, 0xb1900060); /* sys_cpupll */
1455 + au_writel(0x00, 0xb1900064); /* sys_auxpll */
1456 + au_writel(0x00, 0xb1900100); /* sys_pininputen */
1457 + break;
1458
1459 default:
1460 break;
1461 @@ -163,32 +181,23 @@
1462
1463 void au1000_halt(void)
1464 {
1465 -#if defined(CONFIG_MIPS_PB1550)
1466 - /* power off system */
1467 - printk("\n** Powering off Pb1550\n");
1468 - au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
1469 - au_sync();
1470 - while(1); /* should not get here */
1471 -#endif
1472 - printk(KERN_NOTICE "\n** You can safely turn off the power\n");
1473 -#ifdef CONFIG_MIPS_MIRAGE
1474 - au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
1475 -#endif
1476 -#ifdef CONFIG_PM
1477 - au_sleep();
1478 -
1479 - /* should not get here */
1480 - printk(KERN_ERR "Unable to put cpu in sleep mode\n");
1481 - while(1);
1482 -#else
1483 - while (1)
1484 + /* Use WAIT in a low-power infinite spin loop */
1485 + while (1) {
1486 __asm__(".set\tmips3\n\t"
1487 "wait\n\t"
1488 ".set\tmips0");
1489 -#endif
1490 + }
1491 }
1492
1493 void au1000_power_off(void)
1494 {
1495 + extern void board_power_off (void);
1496 +
1497 + printk(KERN_NOTICE "\n** You can safely turn off the power\n");
1498 +
1499 + /* Give board a chance to power-off */
1500 + board_power_off();
1501 +
1502 + /* If board can't power-off, spin forever */
1503 au1000_halt();
1504 }
1505 diff -Nur linux-2.4.29/arch/mips/au1000/common/setup.c linux-mips/arch/mips/au1000/common/setup.c
1506 --- linux-2.4.29/arch/mips/au1000/common/setup.c 2005-01-19 15:09:26.000000000 +0100
1507 +++ linux-mips/arch/mips/au1000/common/setup.c 2005-01-31 12:59:30.000000000 +0100
1508 @@ -174,6 +174,40 @@
1509 initrd_end = (unsigned long)&__rd_end;
1510 #endif
1511
1512 +#if defined(CONFIG_SOC_AU1200)
1513 +#ifdef CONFIG_USB_EHCI_HCD
1514 + if ((argptr = strstr(argptr, "usb_ehci=")) == NULL) {
1515 + char usb_args[80];
1516 + argptr = prom_getcmdline();
1517 + memset(usb_args, 0, sizeof(usb_args));
1518 + sprintf(usb_args, " usb_ehci=base:0x%x,len:0x%x,irq:%d",
1519 + USB_EHCI_BASE, USB_EHCI_LEN, AU1000_USB_HOST_INT);
1520 + strcat(argptr, usb_args);
1521 + }
1522 +#ifdef CONFIG_USB_AMD5536UDC
1523 + /* enable EHC + OHC + UDC clocks, memory and bus mastering */
1524 +/* au_writel( 0x00DF207F, USB_MSR_BASE + 4); */
1525 + au_writel( 0xC0DF207F, USB_MSR_BASE + 4); // incl. prefetch
1526 +#else
1527 + /* enable EHC + OHC clocks, memory and bus mastering */
1528 +/* au_writel( 0x00DB200F, USB_MSR_BASE + 4); */
1529 + au_writel( 0xC0DB200F, USB_MSR_BASE + 4); /* incl. prefetch */
1530 +#endif
1531 + udelay(1000);
1532 +
1533 +#else /* CONFIG_USB_EHCI_HCD */
1534 +
1535 +#ifdef CONFIG_USB_AMD5536UDC
1536 +#ifndef CONFIG_USB_OHCI
1537 + /* enable UDC clocks, memory and bus mastering */
1538 +/* au_writel( 0x00DC2070, USB_MSR_BASE + 4); */
1539 + au_writel( 0xC0DC2070, USB_MSR_BASE + 4); // incl. prefetch
1540 + udelay(1000);
1541 +#endif
1542 +#endif
1543 +#endif /* CONFIG_USB_EHCI_HCD */
1544 +#endif /* CONFIG_SOC_AU1200 */
1545 +
1546 #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
1547 #ifdef CONFIG_USB_OHCI
1548 if ((argptr = strstr(argptr, "usb_ohci=")) == NULL) {
1549 @@ -187,19 +221,38 @@
1550 #endif
1551
1552 #ifdef CONFIG_USB_OHCI
1553 - // enable host controller and wait for reset done
1554 +#if defined(CONFIG_SOC_AU1200)
1555 +#ifndef CONFIG_USB_EHCI_HCD
1556 +#ifdef CONFIG_USB_AMD5536UDC
1557 + /* enable OHC + UDC clocks, memory and bus mastering */
1558 +/* au_writel( 0x00DD2073, USB_MSR_BASE + 4); */
1559 + au_writel( 0xC0DD2073, USB_MSR_BASE + 4); // incl. prefetch
1560 +#else
1561 + /* enable OHC clocks, memory and bus mastering */
1562 + au_writel( 0x00D12003, USB_MSR_BASE + 4);
1563 +#endif
1564 + udelay(1000);
1565 +printk("DEBUG: Reading Au1200 USB2 reg 0x%x\n", au_readl(USB_MSR_BASE + 4));
1566 +#endif
1567 +#else
1568 + /* Au1000, Au1500, Au1100, Au1550 */
1569 + /* enable host controller and wait for reset done */
1570 au_writel(0x08, USB_HOST_CONFIG);
1571 udelay(1000);
1572 au_writel(0x0E, USB_HOST_CONFIG);
1573 udelay(1000);
1574 - au_readl(USB_HOST_CONFIG); // throw away first read
1575 + au_readl(USB_HOST_CONFIG); /* throw away first read */
1576 while (!(au_readl(USB_HOST_CONFIG) & 0x10))
1577 au_readl(USB_HOST_CONFIG);
1578 +#endif /* CONFIG_SOC_AU1200 */
1579 #endif
1580 -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
1581 +#else
1582 +
1583 +#endif /* defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) */
1584 +
1585
1586 #ifdef CONFIG_FB
1587 - // Needed if PCI video card in use
1588 + /* Needed if PCI video card in use */
1589 conswitchp = &dummy_con;
1590 #endif
1591
1592 @@ -209,8 +262,7 @@
1593 #endif
1594
1595 #ifdef CONFIG_BLK_DEV_IDE
1596 - /* Board setup takes precedence for unique devices.
1597 - */
1598 + /* Board setup takes precedence for unique devices. */
1599 if ((ide_ops == NULL) || (ide_ops == &no_ide_ops))
1600 ide_ops = &std_ide_ops;
1601 #endif
1602 diff -Nur linux-2.4.29/arch/mips/au1000/common/sleeper.S linux-mips/arch/mips/au1000/common/sleeper.S
1603 --- linux-2.4.29/arch/mips/au1000/common/sleeper.S 2004-02-18 14:36:30.000000000 +0100
1604 +++ linux-mips/arch/mips/au1000/common/sleeper.S 2005-01-31 12:59:30.000000000 +0100
1605 @@ -15,17 +15,48 @@
1606 #include <asm/addrspace.h>
1607 #include <asm/regdef.h>
1608 #include <asm/stackframe.h>
1609 +#include <asm/au1000.h>
1610 +
1611 +/*
1612 + * Note: This file is *not* conditional on CONFIG_PM since Alchemy sleep
1613 + * need not be tied to any particular power management scheme.
1614 + */
1615 +
1616 + .extern ___flush_cache_all
1617
1618 .text
1619 - .set macro
1620 - .set noat
1621 .align 5
1622
1623 -/* Save all of the processor general registers and go to sleep.
1624 - * A wakeup condition will get us back here to restore the registers.
1625 +/*
1626 + * Save the processor general registers and go to sleep. A wakeup
1627 + * condition will get us back here to restore the registers.
1628 */
1629 -LEAF(save_and_sleep)
1630
1631 +/* still need to fix alignment issues here */
1632 +save_and_sleep_frmsz = 48
1633 +NESTED(save_and_sleep, save_and_sleep_frmsz, ra)
1634 + .set noreorder
1635 + .set nomacro
1636 + .set noat
1637 + subu sp, save_and_sleep_frmsz
1638 + sw ra, save_and_sleep_frmsz-4(sp)
1639 + sw s0, save_and_sleep_frmsz-8(sp)
1640 + sw s1, save_and_sleep_frmsz-12(sp)
1641 + sw s2, save_and_sleep_frmsz-16(sp)
1642 + sw s3, save_and_sleep_frmsz-20(sp)
1643 + sw s4, save_and_sleep_frmsz-24(sp)
1644 + sw s5, save_and_sleep_frmsz-28(sp)
1645 + sw s6, save_and_sleep_frmsz-32(sp)
1646 + sw s7, save_and_sleep_frmsz-36(sp)
1647 + sw s8, save_and_sleep_frmsz-40(sp)
1648 + sw gp, save_and_sleep_frmsz-44(sp)
1649 +
1650 + /* We only need to save the registers that the calling function
1651 + * hasn't saved for us. 0 is always zero. 8 - 15, 24 and 25 are
1652 + * temporaries and can be used without saving. 26 and 27 are reserved
1653 + * for interrupt/trap handling and expected to change. 29 is the
1654 + * stack pointer which is handled as a special case here.
1655 + */
1656 subu sp, PT_SIZE
1657 sw $1, PT_R1(sp)
1658 sw $2, PT_R2(sp)
1659 @@ -34,14 +65,6 @@
1660 sw $5, PT_R5(sp)
1661 sw $6, PT_R6(sp)
1662 sw $7, PT_R7(sp)
1663 - sw $8, PT_R8(sp)
1664 - sw $9, PT_R9(sp)
1665 - sw $10, PT_R10(sp)
1666 - sw $11, PT_R11(sp)
1667 - sw $12, PT_R12(sp)
1668 - sw $13, PT_R13(sp)
1669 - sw $14, PT_R14(sp)
1670 - sw $15, PT_R15(sp)
1671 sw $16, PT_R16(sp)
1672 sw $17, PT_R17(sp)
1673 sw $18, PT_R18(sp)
1674 @@ -50,32 +73,47 @@
1675 sw $21, PT_R21(sp)
1676 sw $22, PT_R22(sp)
1677 sw $23, PT_R23(sp)
1678 - sw $24, PT_R24(sp)
1679 - sw $25, PT_R25(sp)
1680 - sw $26, PT_R26(sp)
1681 - sw $27, PT_R27(sp)
1682 sw $28, PT_R28(sp)
1683 - sw $29, PT_R29(sp)
1684 sw $30, PT_R30(sp)
1685 sw $31, PT_R31(sp)
1686 +#define PT_C0STATUS PT_LO
1687 +#define PT_CONTEXT PT_HI
1688 +#define PT_PAGEMASK PT_EPC
1689 +#define PT_CONFIG PT_BVADDR
1690 mfc0 k0, CP0_STATUS
1691 - sw k0, 0x20(sp)
1692 + sw k0, PT_C0STATUS(sp) // 0x20
1693 mfc0 k0, CP0_CONTEXT
1694 - sw k0, 0x1c(sp)
1695 + sw k0, PT_CONTEXT(sp) // 0x1c
1696 mfc0 k0, CP0_PAGEMASK
1697 - sw k0, 0x18(sp)
1698 + sw k0, PT_PAGEMASK(sp) // 0x18
1699 mfc0 k0, CP0_CONFIG
1700 - sw k0, 0x14(sp)
1701 + sw k0, PT_CONFIG(sp) // 0x14
1702 +
1703 + .set macro
1704 + .set at
1705 +
1706 + li t0, SYS_SLPPWR
1707 + sw zero, 0(t0) /* Get the processor ready to sleep */
1708 + sync
1709
1710 /* Now set up the scratch registers so the boot rom will
1711 * return to this point upon wakeup.
1712 + * sys_scratch0 : SP
1713 + * sys_scratch1 : RA
1714 + */
1715 + li t0, SYS_SCRATCH0
1716 + li t1, SYS_SCRATCH1
1717 + sw sp, 0(t0)
1718 + la k0, resume_from_sleep
1719 + sw k0, 0(t1)
1720 +
1721 +/*
1722 + * Flush DCACHE to make sure context is in memory
1723 */
1724 - la k0, 1f
1725 - lui k1, 0xb190
1726 - ori k1, 0x18
1727 - sw sp, 0(k1)
1728 - ori k1, 0x1c
1729 - sw k0, 0(k1)
1730 + la t1,___flush_cache_all /* _flush_cache_all is a function pointer */
1731 + lw t0,0(t1)
1732 + jal t0
1733 + nop
1734
1735 /* Put SDRAM into self refresh. Preload instructions into cache,
1736 * issue a precharge, then auto refresh, then sleep commands to it.
1737 @@ -88,30 +126,65 @@
1738 cache 0x14, 96(t0)
1739 .set mips0
1740
1741 + /* Put SDRAM to sleep */
1742 sdsleep:
1743 - lui k0, 0xb400
1744 - sw zero, 0x001c(k0) /* Precharge */
1745 - sw zero, 0x0020(k0) /* Auto refresh */
1746 - sw zero, 0x0030(k0) /* SDRAM sleep */
1747 + li a0, MEM_PHYS_ADDR
1748 + or a0, a0, 0xA0000000
1749 +#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
1750 + lw k0, MEM_SDMODE0(a0)
1751 + sw zero, MEM_SDPRECMD(a0) /* Precharge */
1752 + sw zero, MEM_SDAUTOREF(a0) /* Auto Refresh */
1753 + sw zero, MEM_SDSLEEP(a0) /* Sleep */
1754 sync
1755 -
1756 - lui k1, 0xb190
1757 - sw zero, 0x0078(k1) /* get ready to sleep */
1758 +#endif
1759 +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
1760 + sw zero, MEM_SDPRECMD(a0) /* Precharge */
1761 + sw zero, MEM_SDSREF(a0)
1762 +
1763 + #lw t0, MEM_SDSTAT(a0)
1764 + #and t0, t0, 0x01000000
1765 + li t0, 0x01000000
1766 +refresh_not_set:
1767 + lw t1, MEM_SDSTAT(a0)
1768 + and t2, t1, t0
1769 + beq zero, t2, refresh_not_set
1770 + nop
1771 +
1772 + li t0, ~0x30000000
1773 + lw t1, MEM_SDCONFIGA(a0)
1774 + and t1, t0, t1
1775 + sw t1, MEM_SDCONFIGA(a0)
1776 sync
1777 - sw zero, 0x007c(k1) /* Put processor to sleep */
1778 +#endif
1779 +
1780 + li t0, SYS_SLEEP
1781 + sw zero, 0(t0) /* Put processor to sleep */
1782 sync
1783 + nop
1784 + nop
1785 + nop
1786 + nop
1787 + nop
1788 + nop
1789 + nop
1790 + nop
1791 +
1792
1793 /* This is where we return upon wakeup.
1794 * Reload all of the registers and return.
1795 */
1796 -1: nop
1797 - lw k0, 0x20(sp)
1798 +resume_from_sleep:
1799 + nop
1800 + .set nomacro
1801 + .set noat
1802 +
1803 + lw k0, PT_C0STATUS(sp) // 0x20
1804 mtc0 k0, CP0_STATUS
1805 - lw k0, 0x1c(sp)
1806 + lw k0, PT_CONTEXT(sp) // 0x1c
1807 mtc0 k0, CP0_CONTEXT
1808 - lw k0, 0x18(sp)
1809 + lw k0, PT_PAGEMASK(sp) // 0x18
1810 mtc0 k0, CP0_PAGEMASK
1811 - lw k0, 0x14(sp)
1812 + lw k0, PT_CONFIG(sp) // 0x14
1813 mtc0 k0, CP0_CONFIG
1814 lw $1, PT_R1(sp)
1815 lw $2, PT_R2(sp)
1816 @@ -120,14 +193,6 @@
1817 lw $5, PT_R5(sp)
1818 lw $6, PT_R6(sp)
1819 lw $7, PT_R7(sp)
1820 - lw $8, PT_R8(sp)
1821 - lw $9, PT_R9(sp)
1822 - lw $10, PT_R10(sp)
1823 - lw $11, PT_R11(sp)
1824 - lw $12, PT_R12(sp)
1825 - lw $13, PT_R13(sp)
1826 - lw $14, PT_R14(sp)
1827 - lw $15, PT_R15(sp)
1828 lw $16, PT_R16(sp)
1829 lw $17, PT_R17(sp)
1830 lw $18, PT_R18(sp)
1831 @@ -136,15 +201,36 @@
1832 lw $21, PT_R21(sp)
1833 lw $22, PT_R22(sp)
1834 lw $23, PT_R23(sp)
1835 - lw $24, PT_R24(sp)
1836 - lw $25, PT_R25(sp)
1837 - lw $26, PT_R26(sp)
1838 - lw $27, PT_R27(sp)
1839 lw $28, PT_R28(sp)
1840 - lw $29, PT_R29(sp)
1841 lw $30, PT_R30(sp)
1842 lw $31, PT_R31(sp)
1843 +
1844 + .set macro
1845 + .set at
1846 +
1847 + /* clear the wake source, but save it as the return value of the function */
1848 + li t0, SYS_WAKESRC
1849 + lw v0, 0(t0)
1850 + sw v0, PT_R2(sp)
1851 + sw zero, 0(t0)
1852 +
1853 addiu sp, PT_SIZE
1854
1855 + lw gp, save_and_sleep_frmsz-44(sp)
1856 + lw s8, save_and_sleep_frmsz-40(sp)
1857 + lw s7, save_and_sleep_frmsz-36(sp)
1858 + lw s6, save_and_sleep_frmsz-32(sp)
1859 + lw s5, save_and_sleep_frmsz-28(sp)
1860 + lw s4, save_and_sleep_frmsz-24(sp)
1861 + lw s3, save_and_sleep_frmsz-20(sp)
1862 + lw s2, save_and_sleep_frmsz-16(sp)
1863 + lw s1, save_and_sleep_frmsz-12(sp)
1864 + lw s0, save_and_sleep_frmsz-8(sp)
1865 + lw ra, save_and_sleep_frmsz-4(sp)
1866 +
1867 + addu sp, save_and_sleep_frmsz
1868 jr ra
1869 + nop
1870 + .set reorder
1871 END(save_and_sleep)
1872 +
1873 diff -Nur linux-2.4.29/arch/mips/au1000/common/time.c linux-mips/arch/mips/au1000/common/time.c
1874 --- linux-2.4.29/arch/mips/au1000/common/time.c 2005-01-19 15:09:26.000000000 +0100
1875 +++ linux-mips/arch/mips/au1000/common/time.c 2005-03-26 11:47:17.265818025 +0100
1876 @@ -50,7 +50,6 @@
1877 #include <linux/mc146818rtc.h>
1878 #include <linux/timex.h>
1879
1880 -extern void startup_match20_interrupt(void);
1881 extern void do_softirq(void);
1882 extern volatile unsigned long wall_jiffies;
1883 unsigned long missed_heart_beats = 0;
1884 @@ -66,7 +65,7 @@
1885
1886 #ifdef CONFIG_PM
1887 #define MATCH20_INC 328
1888 -extern void startup_match20_interrupt(void);
1889 +extern void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *));
1890 static unsigned long last_pc0, last_match20;
1891 #endif
1892
1893 @@ -437,9 +436,6 @@
1894 au_writel(0, SYS_TOYWRITE);
1895 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
1896
1897 - au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
1898 - au_writel(~0, SYS_WAKESRC);
1899 - au_sync();
1900 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
1901
1902 /* setup match20 to interrupt once every 10ms */
1903 @@ -447,7 +443,7 @@
1904 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
1905 au_sync();
1906 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
1907 - startup_match20_interrupt();
1908 + startup_match20_interrupt(counter0_irq);
1909
1910 do_gettimeoffset = do_fast_pm_gettimeoffset;
1911
1912 diff -Nur linux-2.4.29/arch/mips/au1000/db1x00/board_setup.c linux-mips/arch/mips/au1000/db1x00/board_setup.c
1913 --- linux-2.4.29/arch/mips/au1000/db1x00/board_setup.c 2005-01-19 15:09:26.000000000 +0100
1914 +++ linux-mips/arch/mips/au1000/db1x00/board_setup.c 2005-03-26 11:47:17.271817041 +0100
1915 @@ -46,10 +46,22 @@
1916 #include <asm/au1000.h>
1917 #include <asm/db1x00.h>
1918
1919 -extern struct rtc_ops no_rtc_ops;
1920 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
1921 +#include <asm/au1xxx_dbdma.h>
1922 +extern struct ide_ops *ide_ops;
1923 +extern struct ide_ops au1xxx_ide_ops;
1924 +extern u32 au1xxx_ide_virtbase;
1925 +extern u64 au1xxx_ide_physbase;
1926 +extern int au1xxx_ide_irq;
1927 +
1928 +/* Ddma */
1929 +chan_tab_t *ide_read_ch, *ide_write_ch;
1930 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
1931 +
1932 +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
1933 +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
1934
1935 -/* not correct for db1550 */
1936 -static BCSR * const bcsr = (BCSR *)0xAE000000;
1937 +extern struct rtc_ops no_rtc_ops;
1938
1939 void board_reset (void)
1940 {
1941 @@ -57,6 +69,13 @@
1942 au_writel(0x00000000, 0xAE00001C);
1943 }
1944
1945 +void board_power_off (void)
1946 +{
1947 +#ifdef CONFIG_MIPS_MIRAGE
1948 + au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
1949 +#endif
1950 +}
1951 +
1952 void __init board_setup(void)
1953 {
1954 u32 pin_func;
1955 @@ -108,8 +127,42 @@
1956 au_writel(0x02000200, GPIO2_OUTPUT);
1957 #endif
1958
1959 +#if defined(CONFIG_AU1XXX_SMC91111)
1960 +#define CPLD_CONTROL (0xAF00000C)
1961 + {
1962 + extern uint32_t au1xxx_smc91111_base;
1963 + extern unsigned int au1xxx_smc91111_irq;
1964 + extern int au1xxx_smc91111_nowait;
1965 +
1966 + au1xxx_smc91111_base = 0xAC000300;
1967 + au1xxx_smc91111_irq = AU1000_GPIO_8;
1968 + au1xxx_smc91111_nowait = 1;
1969 +
1970 + /* set up the Static Bus timing - only 396Mhz */
1971 + bcsr->resets |= 0x7;
1972 + au_writel(0x00010003, MEM_STCFG0);
1973 + au_writel(0x000c00c0, MEM_STCFG2);
1974 + au_writel(0x85E1900D, MEM_STTIME2);
1975 + }
1976 +#endif /* end CONFIG_SMC91111 */
1977 au_sync();
1978
1979 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
1980 + /*
1981 + * Iniz IDE parameters
1982 + */
1983 + ide_ops = &au1xxx_ide_ops;
1984 + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;
1985 + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
1986 + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
1987 +
1988 + /*
1989 + * change PIO or PIO+Ddma
1990 + * check the GPIO-6 pin condition. db1550:s6_dot
1991 + */
1992 + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
1993 +#endif
1994 +
1995 #ifdef CONFIG_MIPS_DB1000
1996 printk("AMD Alchemy Au1000/Db1000 Board\n");
1997 #endif
1998 diff -Nur linux-2.4.29/arch/mips/au1000/db1x00/irqmap.c linux-mips/arch/mips/au1000/db1x00/irqmap.c
1999 --- linux-2.4.29/arch/mips/au1000/db1x00/irqmap.c 2005-01-19 15:09:26.000000000 +0100
2000 +++ linux-mips/arch/mips/au1000/db1x00/irqmap.c 2005-01-31 12:59:30.000000000 +0100
2001 @@ -53,6 +53,7 @@
2002 #ifdef CONFIG_MIPS_DB1550
2003 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 IRQ#
2004 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 1 IRQ#
2005 + { AU1000_GPIO_8, INTC_INT_LOW_LEVEL, 0 }, // Daughtercard IRQ#
2006 #else
2007 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 Fully_Interted#
2008 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 STSCHG#
2009 diff -Nur linux-2.4.29/arch/mips/au1000/db1x00/Makefile linux-mips/arch/mips/au1000/db1x00/Makefile
2010 --- linux-2.4.29/arch/mips/au1000/db1x00/Makefile 2005-01-19 15:09:26.000000000 +0100
2011 +++ linux-mips/arch/mips/au1000/db1x00/Makefile 2005-01-31 12:59:30.000000000 +0100
2012 @@ -17,4 +17,11 @@
2013 obj-y := init.o board_setup.o irqmap.o
2014 obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
2015
2016 +ifdef CONFIG_MIPS_DB1100
2017 +ifdef CONFIG_MMC
2018 +obj-y += mmc_support.o
2019 +export-objs += mmc_support.o
2020 +endif
2021 +endif
2022 +
2023 include $(TOPDIR)/Rules.make
2024 diff -Nur linux-2.4.29/arch/mips/au1000/db1x00/mmc_support.c linux-mips/arch/mips/au1000/db1x00/mmc_support.c
2025 --- linux-2.4.29/arch/mips/au1000/db1x00/mmc_support.c 1970-01-01 01:00:00.000000000 +0100
2026 +++ linux-mips/arch/mips/au1000/db1x00/mmc_support.c 2005-01-30 09:07:01.000000000 +0100
2027 @@ -0,0 +1,126 @@
2028 +/*
2029 + * BRIEF MODULE DESCRIPTION
2030 + *
2031 + * MMC support routines for DB1100.
2032 + *
2033 + *
2034 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
2035 + * Author: Embedded Edge, LLC.
2036 + * Contact: dan@embeddededge.com
2037 + *
2038 + * This program is free software; you can redistribute it and/or modify it
2039 + * under the terms of the GNU General Public License as published by the
2040 + * Free Software Foundation; either version 2 of the License, or (at your
2041 + * option) any later version.
2042 + *
2043 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2044 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2045 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2046 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2047 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2048 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2049 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2050 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2051 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2052 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2053 + *
2054 + * You should have received a copy of the GNU General Public License along
2055 + * with this program; if not, write to the Free Software Foundation, Inc.,
2056 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2057 + *
2058 + */
2059 +
2060 +
2061 +#include <linux/config.h>
2062 +#include <linux/kernel.h>
2063 +#include <linux/module.h>
2064 +#include <linux/init.h>
2065 +
2066 +#include <asm/irq.h>
2067 +#include <asm/au1000.h>
2068 +#include <asm/au1100_mmc.h>
2069 +#include <asm/db1x00.h>
2070 +
2071 +
2072 +/* SD/MMC controller support functions */
2073 +
2074 +/*
2075 + * Detect card.
2076 + */
2077 +void mmc_card_inserted(int _n_, int *_res_)
2078 +{
2079 + u32 gpios = au_readl(SYS_PINSTATERD);
2080 + u32 emptybit = (_n_) ? (1<<20) : (1<<19);
2081 + *_res_ = ((gpios & emptybit) == 0);
2082 +}
2083 +
2084 +/*
2085 + * Check card write protection.
2086 + */
2087 +void mmc_card_writable(int _n_, int *_res_)
2088 +{
2089 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2090 + unsigned long mmc_wp, board_specific;
2091 +
2092 + if (_n_) {
2093 + mmc_wp = BCSR_BOARD_SD1_WP;
2094 + } else {
2095 + mmc_wp = BCSR_BOARD_SD0_WP;
2096 + }
2097 +
2098 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2099 +
2100 + if (!(board_specific & mmc_wp)) {/* low means card writable */
2101 + *_res_ = 1;
2102 + } else {
2103 + *_res_ = 0;
2104 + }
2105 +}
2106 +
2107 +/*
2108 + * Apply power to card slot.
2109 + */
2110 +void mmc_power_on(int _n_)
2111 +{
2112 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2113 + unsigned long mmc_pwr, board_specific;
2114 +
2115 + if (_n_) {
2116 + mmc_pwr = BCSR_BOARD_SD1_PWR;
2117 + } else {
2118 + mmc_pwr = BCSR_BOARD_SD0_PWR;
2119 + }
2120 +
2121 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2122 + board_specific |= mmc_pwr;
2123 +
2124 + au_writel(board_specific, (int)(&bcsr->specific));
2125 + au_sync_delay(1);
2126 +}
2127 +
2128 +/*
2129 + * Remove power from card slot.
2130 + */
2131 +void mmc_power_off(int _n_)
2132 +{
2133 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2134 + unsigned long mmc_pwr, board_specific;
2135 +
2136 + if (_n_) {
2137 + mmc_pwr = BCSR_BOARD_SD1_PWR;
2138 + } else {
2139 + mmc_pwr = BCSR_BOARD_SD0_PWR;
2140 + }
2141 +
2142 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2143 + board_specific &= ~mmc_pwr;
2144 +
2145 + au_writel(board_specific, (int)(&bcsr->specific));
2146 + au_sync_delay(1);
2147 +}
2148 +
2149 +EXPORT_SYMBOL(mmc_card_inserted);
2150 +EXPORT_SYMBOL(mmc_card_writable);
2151 +EXPORT_SYMBOL(mmc_power_on);
2152 +EXPORT_SYMBOL(mmc_power_off);
2153 +
2154 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/au1200_ibutton.c linux-mips/arch/mips/au1000/ficmmp/au1200_ibutton.c
2155 --- linux-2.4.29/arch/mips/au1000/ficmmp/au1200_ibutton.c 1970-01-01 01:00:00.000000000 +0100
2156 +++ linux-mips/arch/mips/au1000/ficmmp/au1200_ibutton.c 2005-02-03 07:35:29.000000000 +0100
2157 @@ -0,0 +1,270 @@
2158 +/* ----------------------------------------------------------------------
2159 + * mtwilson_keys.c
2160 + *
2161 + * Copyright (C) 2003 Intrinsyc Software Inc.
2162 + *
2163 + * Intel Personal Media Player buttons
2164 + *
2165 + * This program is free software; you can redistribute it and/or modify
2166 + * it under the terms of the GNU General Public License version 2 as
2167 + * published by the Free Software Foundation.
2168 + *
2169 + * May 02, 2003 : Initial version [FB]
2170 + *
2171 + ------------------------------------------------------------------------*/
2172 +
2173 +#include <linux/config.h>
2174 +#include <linux/module.h>
2175 +#include <linux/kernel.h>
2176 +#include <linux/init.h>
2177 +#include <linux/fs.h>
2178 +#include <linux/sched.h>
2179 +#include <linux/miscdevice.h>
2180 +#include <linux/errno.h>
2181 +#include <linux/poll.h>
2182 +#include <linux/delay.h>
2183 +#include <linux/input.h>
2184 +
2185 +#include <asm/au1000.h>
2186 +#include <asm/uaccess.h>
2187 +#include <asm/au1xxx_gpio.h>
2188 +#include <asm/irq.h>
2189 +#include <asm/keyboard.h>
2190 +#include <linux/time.h>
2191 +
2192 +#define DRIVER_VERSION "V1.0"
2193 +#define DRIVER_AUTHOR "FIC"
2194 +#define DRIVER_DESC "FIC Travis Media Player Button Driver"
2195 +#define DRIVER_NAME "Au1200Button"
2196 +
2197 +#define BUTTON_MAIN (1<<1)
2198 +#define BUTTON_SELECT (1<<6)
2199 +#define BUTTON_GUIDE (1<<12)
2200 +#define BUTTON_DOWN (1<<17)
2201 +#define BUTTON_LEFT (1<<19)
2202 +#define BUTTON_RIGHT (1<<26)
2203 +#define BUTTON_UP (1<<28)
2204 +
2205 +#define BUTTON_MASK (\
2206 + BUTTON_MAIN \
2207 + | BUTTON_SELECT \
2208 + | BUTTON_GUIDE \
2209 + | BUTTON_DOWN \
2210 + | BUTTON_LEFT \
2211 + | BUTTON_RIGHT \
2212 + | BUTTON_UP \
2213 + )
2214 +
2215 +#define BUTTON_INVERT (\
2216 + BUTTON_MAIN \
2217 + | 0 \
2218 + | BUTTON_GUIDE \
2219 + | 0 \
2220 + | 0 \
2221 + | 0 \
2222 + | 0 \
2223 + )
2224 +
2225 +char button_map[32]={0,KEY_S,0,0,0,0,KEY_ENTER,0,0,0,0,0,KEY_G,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
2226 +//char button_map[32]={0,0,0,0,0,0,KEY_ENTER,0,0,0,0,0,KEY_G,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
2227 +
2228 +//char button_map[32]={0,KEY_TAB,0,0,0,0,KEY_M,0,0,0,0,0,KEY_S,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
2229 +//char button_map[32]={0,0,0,0,0,0,KEY_M,0,0,0,0,0,KEY_S,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
2230 +
2231 +#define BUTTON_COUNT (sizeof (button_map) / sizeof (button_map[0]))
2232 +
2233 +struct input_dev dev;
2234 +struct timeval cur_tv;
2235 +
2236 +static unsigned int old_tv_usec = 0;
2237 +
2238 +static unsigned int read_button_state(void)
2239 +{
2240 + unsigned int state;
2241 +
2242 + state = au_readl(SYS_PINSTATERD) & BUTTON_MASK; /* get gpio status */
2243 +
2244 + state ^= BUTTON_INVERT; /* invert main & guide button */
2245 +
2246 + /* printk("au1200_ibutton.c: button state [0x%X]\r\n",state); */
2247 + return state;
2248 +}
2249 +
2250 +//This function returns 0 if the allowed microseconds have elapsed since the last call to ths function, otherwise it returns 1 to indicate a bounce condition
2251 +static unsigned int bounce()
2252 +{
2253 +
2254 + unsigned int elapsed_time;
2255 +
2256 + do_gettimeofday (&cur_tv);
2257 +
2258 + if (!old_tv_usec) {
2259 + old_tv_usec = cur_tv.tv_usec;
2260 + return 0;
2261 + }
2262 +
2263 + if(cur_tv.tv_usec > old_tv_usec) {
2264 + /* If there hasn't been rollover */
2265 + elapsed_time = ((cur_tv.tv_usec - old_tv_usec));
2266 + }
2267 + else {
2268 + /* Accounting for rollover */
2269 + elapsed_time = ((1000000 - old_tv_usec + cur_tv.tv_usec));
2270 + }
2271 +
2272 + if (elapsed_time > 250000) {
2273 + old_tv_usec = 0; /* reset the bounce time */
2274 + return 0;
2275 + }
2276 +
2277 + return 1;
2278 +}
2279 +
2280 +/* button interrupt handler */
2281 +static void button_interrupt(int irq, void *dev, struct pt_regs *regs)
2282 +{
2283 +
2284 + unsigned int i,bit_mask, key_choice;
2285 + u32 button_state;
2286 +
2287 + /* Report state to upper level */
2288 +
2289 + button_state = read_button_state() & BUTTON_MASK; /* get new gpio status */
2290 +
2291 + /* Return if this is a repeated (bouncing) event */
2292 + if(bounce())
2293 + return;
2294 +
2295 + /* we want to make keystrokes */
2296 + for( i=0; i< BUTTON_COUNT; i++) {
2297 + bit_mask = 1<<i;
2298 + if (button_state & bit_mask) {
2299 + key_choice = button_map[i];
2300 + /* toggle key down */
2301 + input_report_key(dev, key_choice, 1);
2302 + /* toggle key up */
2303 + input_report_key(dev, key_choice, 0);
2304 + printk("ibutton gpio %d stat %x scan code %d\r\n",
2305 + i, button_state, key_choice);
2306 + /* Only report the first key event; it doesn't make
2307 + * sense for two keys to be pressed at the same time,
2308 + * and causes problems with the directional keys
2309 + * return;
2310 + */
2311 + }
2312 + }
2313 +}
2314 +
2315 +static int
2316 +button_translate(unsigned char scancode, unsigned char *keycode, char raw_mode)
2317 +{
2318 + static int prev_scancode;
2319 +
2320 + printk( "ibutton.c: translate: scancode=%x raw_mode=%x\n",
2321 + scancode, raw_mode);
2322 +
2323 + if (scancode == 0xe0 || scancode == 0xe1) {
2324 + prev_scancode = scancode;
2325 + return 0;
2326 + }
2327 +
2328 + if (scancode == 0x00 || scancode == 0xff) {
2329 + prev_scancode = 0;
2330 + return 0;
2331 + }
2332 +
2333 + *keycode = scancode;
2334 +
2335 + return 1;
2336 +}
2337 +
2338 +/* init button hardware */
2339 +static int button_hw_init(void)
2340 +{
2341 + unsigned int ipinfunc=0;
2342 +
2343 + printk("au1200_ibutton.c: Initializing buttons hardware\n");
2344 +
2345 + // initialize GPIO pin function assignments
2346 +
2347 + ipinfunc = au_readl(SYS_PINFUNC);
2348 +
2349 + ipinfunc &= ~(SYS_PINFUNC_DMA | SYS_PINFUNC_S0A | SYS_PINFUNC_S0B);
2350 + au_writel( ipinfunc ,SYS_PINFUNC);
2351 +
2352 + ipinfunc |= (SYS_PINFUNC_S0C);
2353 + au_writel( ipinfunc ,SYS_PINFUNC);
2354 +
2355 + return 0;
2356 +}
2357 +
2358 +/* button driver init */
2359 +static int __init button_init(void)
2360 +{
2361 + int ret, i;
2362 + unsigned int flag=0;
2363 +
2364 + printk("au1200_ibutton.c: button_init()\r\n");
2365 +
2366 + button_hw_init();
2367 +
2368 + /* register all button irq handler */
2369 +
2370 + for(i=0; i< sizeof(button_map)/sizeof(button_map[0]); i++)
2371 + {
2372 + /* register irq <-- gpio 1 ,6 ,12 , 17 ,19 , 26 ,28 */
2373 + if(button_map[i] != 0)
2374 + {
2375 + ret = request_irq(AU1000_GPIO_0 + i ,
2376 + &button_interrupt , SA_INTERRUPT ,
2377 + DRIVER_NAME , &dev);
2378 + if(ret) flag |= 1<<i;
2379 + }
2380 + }
2381 +
2382 + printk("au1200_ibutton.c: request_irq,ret:0x%x\r\n",ret);
2383 +
2384 + if (ret) {
2385 + printk("au1200_ibutton.c: request_irq:%X failed\r\n",flag);
2386 + return ret;
2387 + }
2388 +
2389 + dev.name = DRIVER_NAME;
2390 + dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
2391 +
2392 + for (i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
2393 + {
2394 + dev.keybit[LONG(button_map[i])] |= BIT(button_map[i]);
2395 + }
2396 +
2397 + input_register_device(&dev);
2398 +
2399 + /* ready to receive interrupts */
2400 +
2401 + return 0;
2402 +}
2403 +
2404 +/* button driver exit */
2405 +static void __exit button_exit(void)
2406 +{
2407 + int i;
2408 +
2409 + for(i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
2410 + {
2411 + if(button_map[i] != 0)
2412 + {
2413 + free_irq( AU1000_GPIO_0 + i, &dev);
2414 + }
2415 + }
2416 +
2417 + input_unregister_device(&dev);
2418 +
2419 + printk("au1200_ibutton.c: button_exit()\r\n");
2420 +}
2421 +
2422 +module_init(button_init);
2423 +module_exit(button_exit);
2424 +
2425 +MODULE_AUTHOR( DRIVER_AUTHOR );
2426 +MODULE_DESCRIPTION( DRIVER_DESC );
2427 +MODULE_LICENSE("GPL");
2428 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/au1xxx_dock.c linux-mips/arch/mips/au1000/ficmmp/au1xxx_dock.c
2429 --- linux-2.4.29/arch/mips/au1000/ficmmp/au1xxx_dock.c 1970-01-01 01:00:00.000000000 +0100
2430 +++ linux-mips/arch/mips/au1000/ficmmp/au1xxx_dock.c 2005-01-30 09:01:27.000000000 +0100
2431 @@ -0,0 +1,261 @@
2432 +/*
2433 + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
2434 + *
2435 + * This program is free software; you can redistribute it and/or modify
2436 + * it under the terms of the GNU General Public License version 2 as
2437 + * published by the Free Software Foundation.
2438 + */
2439 +
2440 +#include <linux/config.h>
2441 +#include <linux/module.h>
2442 +#include <linux/init.h>
2443 +#include <linux/fs.h>
2444 +#include <linux/sched.h>
2445 +#include <linux/miscdevice.h>
2446 +#include <linux/errno.h>
2447 +#include <linux/poll.h>
2448 +#include <asm/au1000.h>
2449 +#include <asm/uaccess.h>
2450 +#include <asm/au1xxx_gpio.h>
2451 +
2452 +
2453 +#if defined(CONFIG_MIPS_FICMMP)
2454 + #define DOCK_GPIO 215
2455 +#else
2456 + #error Unsupported Au1xxx Platform
2457 +#endif
2458 +
2459 +#define MAKE_FLAG 0x20
2460 +
2461 +#undef DEBUG
2462 +
2463 +#define DEBUG 0
2464 +//#define DEBUG 1
2465 +
2466 +#if DEBUG
2467 +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
2468 +#else
2469 +#define DPRINTK(format, args...) do { } while (0)
2470 +#endif
2471 +
2472 +/* Please note that this driver is based on a timer and is not interrupt
2473 + * driven. If you are going to make use of this driver, you will need to have
2474 + * your application open the dock listing from the /dev directory first.
2475 + */
2476 +
2477 +struct au1xxx_dock {
2478 + struct fasync_struct *fasync;
2479 + wait_queue_head_t read_wait;
2480 + int open_count;
2481 + unsigned int debounce;
2482 + unsigned int current;
2483 + unsigned int last;
2484 +};
2485 +
2486 +static struct au1xxx_dock dock_info;
2487 +
2488 +
2489 +static void dock_timer_periodic(void *data);
2490 +
2491 +static struct tq_struct dock_task = {
2492 + routine: dock_timer_periodic,
2493 + data: NULL
2494 +};
2495 +
2496 +static int cleanup_flag = 0;
2497 +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
2498 +
2499 +
2500 +static unsigned int read_dock_state(void)
2501 +{
2502 + u32 state;
2503 +
2504 + state = au1xxx_gpio_read(DOCK_GPIO);
2505 +
2506 + /* printk( "Current Dock State: %d\n", state ); */
2507 +
2508 + return state;
2509 +}
2510 +
2511 +
2512 +static void dock_timer_periodic(void *data)
2513 +{
2514 + struct au1xxx_dock *dock = (struct au1xxx_dock *)data;
2515 + unsigned long dock_state;
2516 +
2517 + /* If cleanup wants us to die */
2518 + if (cleanup_flag) {
2519 + /* now cleanup_module can return */
2520 + wake_up(&cleanup_wait_queue);
2521 + } else {
2522 + /* put ourselves back in the task queue */
2523 + queue_task(&dock_task, &tq_timer);
2524 + }
2525 +
2526 + /* read current dock */
2527 + dock_state = read_dock_state();
2528 +
2529 + /* if dock states hasn't changed */
2530 + /* save time and be done. */
2531 + if (dock_state == dock->current) {
2532 + return;
2533 + }
2534 +
2535 + if (dock_state == dock->debounce) {
2536 + dock->current = dock_state;
2537 + } else {
2538 + dock->debounce = dock_state;
2539 + }
2540 + if (dock->current != dock->last) {
2541 + if (waitqueue_active(&dock->read_wait)) {
2542 + wake_up_interruptible(&dock->read_wait);
2543 + }
2544 + }
2545 +}
2546 +
2547 +
2548 +static ssize_t au1xxx_dock_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
2549 +{
2550 + struct au1xxx_dock *dock = filp->private_data;
2551 + char event[3];
2552 + int last;
2553 + int cur;
2554 + int err;
2555 +
2556 +try_again:
2557 +
2558 + while (dock->current == dock->last) {
2559 + if (filp->f_flags & O_NONBLOCK) {
2560 + return -EAGAIN;
2561 + }
2562 + interruptible_sleep_on(&dock->read_wait);
2563 + if (signal_pending(current)) {
2564 + return -ERESTARTSYS;
2565 + }
2566 + }
2567 +
2568 + cur = dock->current;
2569 + last = dock->last;
2570 +
2571 + if(cur != last)
2572 + {
2573 + event[0] = cur ? 'D' : 'U';
2574 + event[1] = '\r';
2575 + event[2] = '\n';
2576 + }
2577 + else
2578 + goto try_again;
2579 +
2580 + dock->last = cur;
2581 + err = copy_to_user(buffer, &event, 3);
2582 + if (err) {
2583 + return err;
2584 + }
2585 +
2586 + return 3;
2587 +}
2588 +
2589 +
2590 +static int au1xxx_dock_open(struct inode *inode, struct file *filp)
2591 +{
2592 + struct au1xxx_dock *dock = &dock_info;
2593 +
2594 + MOD_INC_USE_COUNT;
2595 +
2596 + filp->private_data = dock;
2597 +
2598 + if (dock->open_count++ == 0) {
2599 + dock_task.data = dock;
2600 + cleanup_flag = 0;
2601 + queue_task(&dock_task, &tq_timer);
2602 + }
2603 +
2604 + return 0;
2605 +}
2606 +
2607 +
2608 +static unsigned int au1xxx_dock_poll(struct file *filp, poll_table *wait)
2609 +{
2610 + struct au1xxx_dock *dock = filp->private_data;
2611 + int ret = 0;
2612 +
2613 + DPRINTK("start\n");
2614 + poll_wait(filp, &dock->read_wait, wait);
2615 + if (dock->current != dock->last) {
2616 + ret = POLLIN | POLLRDNORM;
2617 + }
2618 + return ret;
2619 +}
2620 +
2621 +
2622 +static int au1xxx_dock_release(struct inode *inode, struct file *filp)
2623 +{
2624 + struct au1xxx_dock *dock = filp->private_data;
2625 +
2626 + DPRINTK("start\n");
2627 +
2628 + if (--dock->open_count == 0) {
2629 + cleanup_flag = 1;
2630 + sleep_on(&cleanup_wait_queue);
2631 + }
2632 + MOD_DEC_USE_COUNT;
2633 +
2634 + return 0;
2635 +}
2636 +
2637 +
2638 +
2639 +static struct file_operations au1xxx_dock_fops = {
2640 + owner: THIS_MODULE,
2641 + read: au1xxx_dock_read,
2642 + poll: au1xxx_dock_poll,
2643 + open: au1xxx_dock_open,
2644 + release: au1xxx_dock_release,
2645 +};
2646 +
2647 +/*
2648 + * The au1xxx dock is a misc device:
2649 + * Major 10 char
2650 + * Minor 22 /dev/dock
2651 + *
2652 + * This is /dev/misc/dock if devfs is used.
2653 + */
2654 +
2655 +static struct miscdevice au1xxx_dock_dev = {
2656 + minor: 23,
2657 + name: "dock",
2658 + fops: &au1xxx_dock_fops,
2659 +};
2660 +
2661 +static int __init au1xxx_dock_init(void)
2662 +{
2663 + struct au1xxx_dock *dock = &dock_info;
2664 + int ret;
2665 +
2666 + DPRINTK("Initializing dock driver\n");
2667 + dock->open_count = 0;
2668 + cleanup_flag = 0;
2669 + init_waitqueue_head(&dock->read_wait);
2670 +
2671 +
2672 + /* yamon configures GPIO pins for the dock
2673 + * no initialization needed
2674 + */
2675 +
2676 + ret = misc_register(&au1xxx_dock_dev);
2677 +
2678 + DPRINTK("dock driver fully initialized.\n");
2679 +
2680 + return ret;
2681 +}
2682 +
2683 +
2684 +static void __exit au1xxx_dock_exit(void)
2685 +{
2686 + DPRINTK("unloading dock driver\n");
2687 + misc_deregister(&au1xxx_dock_dev);
2688 +}
2689 +
2690 +
2691 +module_init(au1xxx_dock_init);
2692 +module_exit(au1xxx_dock_exit);
2693 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/board_setup.c linux-mips/arch/mips/au1000/ficmmp/board_setup.c
2694 --- linux-2.4.29/arch/mips/au1000/ficmmp/board_setup.c 1970-01-01 01:00:00.000000000 +0100
2695 +++ linux-mips/arch/mips/au1000/ficmmp/board_setup.c 2005-03-19 08:17:51.000000000 +0100
2696 @@ -0,0 +1,226 @@
2697 +/*
2698 + *
2699 + * BRIEF MODULE DESCRIPTION
2700 + * Alchemy Pb1200 board setup.
2701 + *
2702 + * This program is free software; you can redistribute it and/or modify it
2703 + * under the terms of the GNU General Public License as published by the
2704 + * Free Software Foundation; either version 2 of the License, or (at your
2705 + * option) any later version.
2706 + *
2707 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2708 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2709 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2710 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2711 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2712 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2713 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2714 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2715 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2716 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2717 + *
2718 + * You should have received a copy of the GNU General Public License along
2719 + * with this program; if not, write to the Free Software Foundation, Inc.,
2720 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2721 + */
2722 +#include <linux/config.h>
2723 +#include <linux/init.h>
2724 +#include <linux/sched.h>
2725 +#include <linux/ioport.h>
2726 +#include <linux/mm.h>
2727 +#include <linux/console.h>
2728 +#include <linux/mc146818rtc.h>
2729 +#include <linux/delay.h>
2730 +#include <linux/ide.h>
2731 +
2732 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
2733 +#include <linux/ide.h>
2734 +#endif
2735 +
2736 +#include <asm/cpu.h>
2737 +#include <asm/bootinfo.h>
2738 +#include <asm/irq.h>
2739 +#include <asm/keyboard.h>
2740 +#include <asm/mipsregs.h>
2741 +#include <asm/reboot.h>
2742 +#include <asm/pgtable.h>
2743 +#include <asm/au1000.h>
2744 +#include <asm/ficmmp.h>
2745 +#include <asm/au1xxx_dbdma.h>
2746 +#include <asm/au1xxx_gpio.h>
2747 +
2748 +extern struct rtc_ops no_rtc_ops;
2749 +
2750 +/* value currently in the board configuration register */
2751 +u16 ficmmp_config = 0;
2752 +
2753 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
2754 +extern struct ide_ops *ide_ops;
2755 +extern struct ide_ops au1xxx_ide_ops;
2756 +extern u32 au1xxx_ide_virtbase;
2757 +extern u64 au1xxx_ide_physbase;
2758 +extern int au1xxx_ide_irq;
2759 +
2760 +u32 led_base_addr;
2761 +/* Ddma */
2762 +chan_tab_t *ide_read_ch, *ide_write_ch;
2763 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
2764 +
2765 +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
2766 +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
2767 +
2768 +void board_reset (void)
2769 +{
2770 + au_writel(0, 0xAD80001C);
2771 +}
2772 +
2773 +void board_power_off (void)
2774 +{
2775 +}
2776 +
2777 +void __init board_setup(void)
2778 +{
2779 + char *argptr = NULL;
2780 + u32 pin_func;
2781 + rtc_ops = &no_rtc_ops;
2782 +
2783 + ficmmp_config_init(); //Initialize FIC control register
2784 +
2785 +#if 0
2786 + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
2787 + * but it is board specific code, so put it here.
2788 + */
2789 + pin_func = au_readl(SYS_PINFUNC);
2790 + au_sync();
2791 + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
2792 + au_writel(pin_func, SYS_PINFUNC);
2793 +
2794 + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
2795 + au_sync();
2796 +#endif
2797 +
2798 +#if defined( CONFIG_I2C_ALGO_AU1550 )
2799 + {
2800 + u32 freq0, clksrc;
2801 +
2802 + /* Select SMBUS in CPLD */
2803 + /* bcsr->resets &= ~(BCSR_RESETS_PCS0MUX); */
2804 +
2805 + pin_func = au_readl(SYS_PINFUNC);
2806 + au_sync();
2807 + pin_func &= ~(3<<17 | 1<<4);
2808 + /* Set GPIOs correctly */
2809 + pin_func |= 2<<17;
2810 + au_writel(pin_func, SYS_PINFUNC);
2811 + au_sync();
2812 +
2813 + /* The i2c driver depends on 50Mhz clock */
2814 + freq0 = au_readl(SYS_FREQCTRL0);
2815 + au_sync();
2816 + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
2817 + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
2818 + /* 396Mhz / (3+1)*2 == 49.5Mhz */
2819 + au_writel(freq0, SYS_FREQCTRL0);
2820 + au_sync();
2821 + freq0 |= SYS_FC_FE1;
2822 + au_writel(freq0, SYS_FREQCTRL0);
2823 + au_sync();
2824 +
2825 + clksrc = au_readl(SYS_CLKSRC);
2826 + au_sync();
2827 + clksrc &= ~0x01f00000;
2828 + /* bit 22 is EXTCLK0 for PSC0 */
2829 + clksrc |= (0x3 << 22);
2830 + au_writel(clksrc, SYS_CLKSRC);
2831 + au_sync();
2832 + }
2833 +#endif
2834 +
2835 +#ifdef CONFIG_FB_AU1200
2836 + argptr = prom_getcmdline();
2837 + strcat(argptr, " video=au1200fb:");
2838 +#endif
2839 +
2840 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
2841 + /*
2842 + * Iniz IDE parameters
2843 + */
2844 + ide_ops = &au1xxx_ide_ops;
2845 + au1xxx_ide_irq = FICMMP_IDE_INT;
2846 + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
2847 + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
2848 + switch4ddma = 0;
2849 + /*
2850 + ide_ops = &au1xxx_ide_ops;
2851 + au1xxx_ide_irq = FICMMP_IDE_INT;
2852 + au1xxx_ide_base = KSEG1ADDR(AU1XXX_ATA_BASE);
2853 + */
2854 + au1xxx_gpio_write(9, 1);
2855 + printk("B4001010: %X\n", *((u32*)0xB4001010));
2856 + printk("B4001014: %X\n", *((u32*)0xB4001014));
2857 + printk("B4001018: %X\n", *((u32*)0xB4001018));
2858 + printk("B1900100: %X\n", *((u32*)0xB1900100));
2859 +
2860 +#if 0
2861 + ficmmp_config_clear(FICMMP_CONFIG_IDERST);
2862 + mdelay(100);
2863 + ficmmp_config_set(FICMMP_CONFIG_IDERST);
2864 + mdelay(100);
2865 +#endif
2866 + /*
2867 + * change PIO or PIO+Ddma
2868 + * check the GPIO-5 pin condition. pb1200:s18_dot
2869 + */
2870 +/* switch4ddma = 0; //(au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0; */
2871 +#endif
2872 +
2873 + /* The Pb1200 development board uses external MUX for PSC0 to
2874 + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
2875 + */
2876 +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
2877 + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
2878 + Refer to Pb1200 documentation.
2879 +#elif defined( CONFIG_AU1550_PSC_SPI )
2880 + //bcsr->resets |= BCSR_RESETS_PCS0MUX;
2881 +#elif defined( CONFIG_I2C_ALGO_AU1550 )
2882 + //bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
2883 +#endif
2884 + au_sync();
2885 +
2886 + printk("FIC Multimedia Player Board\n");
2887 + au1xxx_gpio_tristate(5);
2888 + printk("B1900100: %X\n", *((volatile u32*)0xB1900100));
2889 + printk("B190002C: %X\n", *((volatile u32*)0xB190002C));
2890 +}
2891 +
2892 +int
2893 +board_au1200fb_panel (void)
2894 +{
2895 + au1xxx_gpio_tristate(6);
2896 +
2897 + if (au1xxx_gpio_read(12) == 0)
2898 + return 9; /* FS453_640x480 (Composite/S-Video) */
2899 + else
2900 + return 7; /* Sharp 320x240 TFT */
2901 +}
2902 +
2903 +int
2904 +board_au1200fb_panel_init (void)
2905 +{
2906 + /*Enable data buffers*/
2907 + ficmmp_config_clear(FICMMP_CONFIG_LCMDATAOUT);
2908 + /*Take LCD out of reset*/
2909 + ficmmp_config_set(FICMMP_CONFIG_LCMPWREN | FICMMP_CONFIG_LCMEN);
2910 + return 0;
2911 +}
2912 +
2913 +int
2914 +board_au1200fb_panel_shutdown (void)
2915 +{
2916 + /*Disable data buffers*/
2917 + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT);
2918 + /*Put LCD in reset, remove power*/
2919 + ficmmp_config_clear(FICMMP_CONFIG_LCMEN | FICMMP_CONFIG_LCMPWREN);
2920 + return 0;
2921 +}
2922 +
2923 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/init.c linux-mips/arch/mips/au1000/ficmmp/init.c
2924 --- linux-2.4.29/arch/mips/au1000/ficmmp/init.c 1970-01-01 01:00:00.000000000 +0100
2925 +++ linux-mips/arch/mips/au1000/ficmmp/init.c 2005-01-30 09:01:27.000000000 +0100
2926 @@ -0,0 +1,76 @@
2927 +/*
2928 + *
2929 + * BRIEF MODULE DESCRIPTION
2930 + * PB1200 board setup
2931 + *
2932 + * This program is free software; you can redistribute it and/or modify it
2933 + * under the terms of the GNU General Public License as published by the
2934 + * Free Software Foundation; either version 2 of the License, or (at your
2935 + * option) any later version.
2936 + *
2937 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2938 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2939 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2940 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2941 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2942 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2943 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2944 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2945 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2946 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2947 + *
2948 + * You should have received a copy of the GNU General Public License along
2949 + * with this program; if not, write to the Free Software Foundation, Inc.,
2950 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2951 + */
2952 +
2953 +#include <linux/init.h>
2954 +#include <linux/mm.h>
2955 +#include <linux/sched.h>
2956 +#include <linux/bootmem.h>
2957 +#include <asm/addrspace.h>
2958 +#include <asm/bootinfo.h>
2959 +#include <linux/config.h>
2960 +#include <linux/string.h>
2961 +#include <linux/kernel.h>
2962 +#include <linux/sched.h>
2963 +
2964 +int prom_argc;
2965 +char **prom_argv, **prom_envp;
2966 +extern void __init prom_init_cmdline(void);
2967 +extern char *prom_getenv(char *envname);
2968 +
2969 +const char *get_system_type(void)
2970 +{
2971 + return "FIC Multimedia Player (Au1200)";
2972 +}
2973 +
2974 +u32 mae_memsize = 0;
2975 +
2976 +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
2977 +{
2978 + unsigned char *memsize_str;
2979 + unsigned long memsize;
2980 +
2981 + prom_argc = argc;
2982 + prom_argv = argv;
2983 + prom_envp = envp;
2984 +
2985 + mips_machgroup = MACH_GROUP_ALCHEMY;
2986 + mips_machtype = MACH_PB1000; /* set the platform # */
2987 + prom_init_cmdline();
2988 +
2989 + memsize_str = prom_getenv("memsize");
2990 + if (!memsize_str) {
2991 + memsize = 0x08000000;
2992 + } else {
2993 + memsize = simple_strtol(memsize_str, NULL, 0);
2994 + }
2995 +
2996 + /* reserved 32MB for MAE driver */
2997 + memsize -= (32 * 1024 * 1024);
2998 + add_memory_region(0, memsize, BOOT_MEM_RAM);
2999 + mae_memsize = memsize; /* for drivers/char/au1xxx_mae.c */
3000 + return 0;
3001 +}
3002 +
3003 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/irqmap.c linux-mips/arch/mips/au1000/ficmmp/irqmap.c
3004 --- linux-2.4.29/arch/mips/au1000/ficmmp/irqmap.c 1970-01-01 01:00:00.000000000 +0100
3005 +++ linux-mips/arch/mips/au1000/ficmmp/irqmap.c 2005-01-30 09:01:27.000000000 +0100
3006 @@ -0,0 +1,61 @@
3007 +/*
3008 + * BRIEF MODULE DESCRIPTION
3009 + * Au1xxx irq map table
3010 + *
3011 + * This program is free software; you can redistribute it and/or modify it
3012 + * under the terms of the GNU General Public License as published by the
3013 + * Free Software Foundation; either version 2 of the License, or (at your
3014 + * option) any later version.
3015 + *
3016 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3017 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3018 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3019 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3020 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3021 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3022 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3023 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3024 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3025 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3026 + *
3027 + * You should have received a copy of the GNU General Public License along
3028 + * with this program; if not, write to the Free Software Foundation, Inc.,
3029 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3030 + */
3031 +#include <linux/errno.h>
3032 +#include <linux/init.h>
3033 +#include <linux/irq.h>
3034 +#include <linux/kernel_stat.h>
3035 +#include <linux/module.h>
3036 +#include <linux/signal.h>
3037 +#include <linux/sched.h>
3038 +#include <linux/types.h>
3039 +#include <linux/interrupt.h>
3040 +#include <linux/ioport.h>
3041 +#include <linux/timex.h>
3042 +#include <linux/slab.h>
3043 +#include <linux/random.h>
3044 +#include <linux/delay.h>
3045 +
3046 +#include <asm/bitops.h>
3047 +#include <asm/bootinfo.h>
3048 +#include <asm/io.h>
3049 +#include <asm/mipsregs.h>
3050 +#include <asm/system.h>
3051 +#include <asm/au1000.h>
3052 +#include <asm/ficmmp.h>
3053 +
3054 +au1xxx_irq_map_t au1xxx_irq_map[] = {
3055 + { FICMMP_IDE_INT, INTC_INT_HIGH_LEVEL, 0 },
3056 + { AU1XXX_SMC91111_IRQ, INTC_INT_HIGH_LEVEL, 0 },
3057 + { AU1000_GPIO_1 , INTC_INT_FALL_EDGE, 0 }, // main button
3058 + { AU1000_GPIO_6 , INTC_INT_RISE_EDGE, 0 }, // select button
3059 + { AU1000_GPIO_12, INTC_INT_FALL_EDGE, 0 }, // guide button
3060 + { AU1000_GPIO_17, INTC_INT_RISE_EDGE, 0 }, // down button
3061 + { AU1000_GPIO_19, INTC_INT_RISE_EDGE, 0 }, // left button
3062 + { AU1000_GPIO_26, INTC_INT_RISE_EDGE, 0 }, // right button
3063 + { AU1000_GPIO_28, INTC_INT_RISE_EDGE, 0 }, // up button
3064 +};
3065 +
3066 +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
3067 +
3068 diff -Nur linux-2.4.29/arch/mips/au1000/ficmmp/Makefile linux-mips/arch/mips/au1000/ficmmp/Makefile
3069 --- linux-2.4.29/arch/mips/au1000/ficmmp/Makefile 1970-01-01 01:00:00.000000000 +0100
3070 +++ linux-mips/arch/mips/au1000/ficmmp/Makefile 2005-01-30 09:01:27.000000000 +0100
3071 @@ -0,0 +1,25 @@
3072 +#
3073 +# Copyright 2000 MontaVista Software Inc.
3074 +# Author: MontaVista Software, Inc.
3075 +# ppopov@mvista.com or source@mvista.com
3076 +#
3077 +# Makefile for the Alchemy Semiconductor FIC board.
3078 +#
3079 +# Note! Dependencies are done automagically by 'make dep', which also
3080 +# removes any old dependencies. DON'T put your own dependencies here
3081 +# unless it's something special (ie not a .c file).
3082 +#
3083 +
3084 +USE_STANDARD_AS_RULE := true
3085 +
3086 +O_TARGET := ficmmp.o
3087 +
3088 +obj-y := init.o board_setup.o irqmap.o au1200_ibutton.o au1xxx_dock.o
3089 +
3090 +ifdef CONFIG_MMC
3091 +obj-y += mmc_support.o
3092 +export-objs +=mmc_support.o
3093 +endif
3094 +
3095 +
3096 +include $(TOPDIR)/Rules.make
3097 diff -Nur linux-2.4.29/arch/mips/au1000/hydrogen3/board_setup.c linux-mips/arch/mips/au1000/hydrogen3/board_setup.c
3098 --- linux-2.4.29/arch/mips/au1000/hydrogen3/board_setup.c 2005-01-19 15:09:26.000000000 +0100
3099 +++ linux-mips/arch/mips/au1000/hydrogen3/board_setup.c 2005-03-26 11:47:17.377799647 +0100
3100 @@ -51,12 +51,19 @@
3101 {
3102 }
3103
3104 +void board_power_off (void)
3105 +{
3106 +}
3107 +
3108 void __init board_setup(void)
3109 {
3110 u32 pin_func;
3111
3112 rtc_ops = &no_rtc_ops;
3113
3114 + /* Set GPIO14 high to make CD/DAT1 high for MMC to work */
3115 + au_writel(1<<14, SYS_OUTPUTSET);
3116 +
3117 #ifdef CONFIG_AU1X00_USB_DEVICE
3118 // 2nd USB port is USB device
3119 pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
3120 diff -Nur linux-2.4.29/arch/mips/au1000/hydrogen3/buttons.c linux-mips/arch/mips/au1000/hydrogen3/buttons.c
3121 --- linux-2.4.29/arch/mips/au1000/hydrogen3/buttons.c 1970-01-01 01:00:00.000000000 +0100
3122 +++ linux-mips/arch/mips/au1000/hydrogen3/buttons.c 2005-02-11 22:09:55.000000000 +0100
3123 @@ -0,0 +1,308 @@
3124 +/*
3125 + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
3126 + *
3127 + * This program is free software; you can redistribute it and/or modify
3128 + * it under the terms of the GNU General Public License version 2 as
3129 + * published by the Free Software Foundation.
3130 + */
3131 +
3132 +#include <linux/config.h>
3133 +#include <linux/module.h>
3134 +#include <linux/init.h>
3135 +#include <linux/fs.h>
3136 +#include <linux/sched.h>
3137 +#include <linux/miscdevice.h>
3138 +#include <linux/errno.h>
3139 +#include <linux/poll.h>
3140 +#include <asm/au1000.h>
3141 +#include <asm/uaccess.h>
3142 +
3143 +#define BUTTON_SELECT (1<<1)
3144 +#define BUTTON_1 (1<<2)
3145 +#define BUTTON_2 (1<<3)
3146 +#define BUTTON_ONOFF (1<<6)
3147 +#define BUTTON_3 (1<<7)
3148 +#define BUTTON_4 (1<<8)
3149 +#define BUTTON_LEFT (1<<9)
3150 +#define BUTTON_DOWN (1<<10)
3151 +#define BUTTON_RIGHT (1<<11)
3152 +#define BUTTON_UP (1<<12)
3153 +
3154 +#define BUTTON_MASK (\
3155 + BUTTON_SELECT \
3156 + | BUTTON_1 \
3157 + | BUTTON_2 \
3158 + | BUTTON_ONOFF \
3159 + | BUTTON_3 \
3160 + | BUTTON_4 \
3161 + | BUTTON_LEFT \
3162 + | BUTTON_DOWN \
3163 + | BUTTON_RIGHT \
3164 + | BUTTON_UP \
3165 + )
3166 +
3167 +#define BUTTON_INVERT (\
3168 + BUTTON_SELECT \
3169 + | BUTTON_1 \
3170 + | BUTTON_2 \
3171 + | BUTTON_3 \
3172 + | BUTTON_4 \
3173 + | BUTTON_LEFT \
3174 + | BUTTON_DOWN \
3175 + | BUTTON_RIGHT \
3176 + | BUTTON_UP \
3177 + )
3178 +
3179 +
3180 +
3181 +#define MAKE_FLAG 0x20
3182 +
3183 +#undef DEBUG
3184 +
3185 +#define DEBUG 0
3186 +//#define DEBUG 1
3187 +
3188 +#if DEBUG
3189 +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
3190 +#else
3191 +#define DPRINTK(format, args...) do { } while (0)
3192 +#endif
3193 +
3194 +/* Please note that this driver is based on a timer and is not interrupt
3195 + * driven. If you are going to make use of this driver, you will need to have
3196 + * your application open the buttons listing from the /dev directory first.
3197 + */
3198 +
3199 +struct hydrogen3_buttons {
3200 + struct fasync_struct *fasync;
3201 + wait_queue_head_t read_wait;
3202 + int open_count;
3203 + unsigned int debounce;
3204 + unsigned int current;
3205 + unsigned int last;
3206 +};
3207 +
3208 +static struct hydrogen3_buttons buttons_info;
3209 +
3210 +
3211 +static void button_timer_periodic(void *data);
3212 +
3213 +static struct tq_struct button_task = {
3214 + routine: button_timer_periodic,
3215 + data: NULL
3216 +};
3217 +
3218 +static int cleanup_flag = 0;
3219 +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
3220 +
3221 +
3222 +static unsigned int read_button_state(void)
3223 +{
3224 + unsigned long state;
3225 +
3226 + state = inl(SYS_PINSTATERD) & BUTTON_MASK;
3227 + state ^= BUTTON_INVERT;
3228 +
3229 + DPRINTK( "Current Button State: %d\n", state );
3230 +
3231 + return state;
3232 +}
3233 +
3234 +
3235 +static void button_timer_periodic(void *data)
3236 +{
3237 + struct hydrogen3_buttons *buttons = (struct hydrogen3_buttons *)data;
3238 + unsigned long button_state;
3239 +
3240 + // If cleanup wants us to die
3241 + if (cleanup_flag) {
3242 + wake_up(&cleanup_wait_queue); // now cleanup_module can return
3243 + } else {
3244 + queue_task(&button_task, &tq_timer); // put ourselves back in the task queue
3245 + }
3246 +
3247 + // read current buttons
3248 + button_state = read_button_state();
3249 +
3250 + // if no buttons are down and nothing to do then
3251 + // save time and be done.
3252 + if ((button_state == 0) && (buttons->current == 0)) {
3253 + return;
3254 + }
3255 +
3256 + if (button_state == buttons->debounce) {
3257 + buttons->current = button_state;
3258 + } else {
3259 + buttons->debounce = button_state;
3260 + }
3261 +// printk("0x%04x\n", button_state);
3262 + if (buttons->current != buttons->last) {
3263 + if (waitqueue_active(&buttons->read_wait)) {
3264 + wake_up_interruptible(&buttons->read_wait);
3265 + }
3266 + }
3267 +}
3268 +
3269 +
3270 +static ssize_t hydrogen3_buttons_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
3271 +{
3272 + struct hydrogen3_buttons *buttons = filp->private_data;
3273 + char events[16];
3274 + int index;
3275 + int last;
3276 + int cur;
3277 + int bit;
3278 + int bit_mask;
3279 + int err;
3280 +
3281 + DPRINTK("start\n");
3282 +
3283 +try_again:
3284 +
3285 + while (buttons->current == buttons->last) {
3286 + if (filp->f_flags & O_NONBLOCK) {
3287 + return -EAGAIN;
3288 + }
3289 + interruptible_sleep_on(&buttons->read_wait);
3290 + if (signal_pending(current)) {
3291 + return -ERESTARTSYS;
3292 + }
3293 + }
3294 +
3295 + cur = buttons->current;
3296 + last = buttons->last;
3297 +
3298 + index = 0;
3299 + bit_mask = 1;
3300 + for (bit = 0; (bit < 16) && count; bit++) {
3301 + if ((cur ^ last) & bit_mask) {
3302 + if (cur & bit_mask) {
3303 + events[index] = (bit | MAKE_FLAG) + 'A';
3304 + last |= bit_mask;
3305 + } else {
3306 + events[index] = bit + 'A';
3307 + last &= ~bit_mask;
3308 + }
3309 + index++;
3310 + count--;
3311 + }
3312 + bit_mask <<= 1;
3313 + }
3314 + buttons->last = last;
3315 +
3316 + if (index == 0) {
3317 + goto try_again;
3318 + }
3319 +
3320 + err = copy_to_user(buffer, events, index);
3321 + if (err) {
3322 + return err;
3323 + }
3324 +
3325 + return index;
3326 +}
3327 +
3328 +
3329 +static int hydrogen3_buttons_open(struct inode *inode, struct file *filp)
3330 +{
3331 + struct hydrogen3_buttons *buttons = &buttons_info;
3332 +
3333 + DPRINTK("start\n");
3334 + MOD_INC_USE_COUNT;
3335 +
3336 + filp->private_data = buttons;
3337 +
3338 + if (buttons->open_count++ == 0) {
3339 + button_task.data = buttons;
3340 + cleanup_flag = 0;
3341 + queue_task(&button_task, &tq_timer);
3342 + }
3343 +
3344 + return 0;
3345 +}
3346 +
3347 +
3348 +static unsigned int hydrogen3_buttons_poll(struct file *filp, poll_table *wait)
3349 +{
3350 + struct hydrogen3_buttons *buttons = filp->private_data;
3351 + int ret = 0;
3352 +
3353 + DPRINTK("start\n");
3354 + poll_wait(filp, &buttons->read_wait, wait);
3355 + if (buttons->current != buttons->last) {
3356 + ret = POLLIN | POLLRDNORM;
3357 + }
3358 + return ret;
3359 +}
3360 +
3361 +
3362 +static int hydrogen3_buttons_release(struct inode *inode, struct file *filp)
3363 +{
3364 + struct hydrogen3_buttons *buttons = filp->private_data;
3365 +
3366 + DPRINTK("start\n");
3367 +
3368 + if (--buttons->open_count == 0) {
3369 + cleanup_flag = 1;
3370 + sleep_on(&cleanup_wait_queue);
3371 + }
3372 + MOD_DEC_USE_COUNT;
3373 +
3374 + return 0;
3375 +}
3376 +
3377 +
3378 +
3379 +static struct file_operations hydrogen3_buttons_fops = {
3380 + owner: THIS_MODULE,
3381 + read: hydrogen3_buttons_read,
3382 + poll: hydrogen3_buttons_poll,
3383 + open: hydrogen3_buttons_open,
3384 + release: hydrogen3_buttons_release,
3385 +};
3386 +
3387 +/*
3388 + * The hydrogen3 buttons is a misc device:
3389 + * Major 10 char
3390 + * Minor 22 /dev/buttons
3391 + *
3392 + * This is /dev/misc/buttons if devfs is used.
3393 + */
3394 +
3395 +static struct miscdevice hydrogen3_buttons_dev = {
3396 + minor: 22,
3397 + name: "buttons",
3398 + fops: &hydrogen3_buttons_fops,
3399 +};
3400 +
3401 +static int __init hydrogen3_buttons_init(void)
3402 +{
3403 + struct hydrogen3_buttons *buttons = &buttons_info;
3404 + int ret;
3405 +
3406 + DPRINTK("Initializing buttons driver\n");
3407 + buttons->open_count = 0;
3408 + cleanup_flag = 0;
3409 + init_waitqueue_head(&buttons->read_wait);
3410 +
3411 +
3412 + // yamon configures GPIO pins for the buttons
3413 + // no initialization needed
3414 +
3415 + ret = misc_register(&hydrogen3_buttons_dev);
3416 +
3417 + DPRINTK("Buttons driver fully initialized.\n");
3418 +
3419 + return ret;
3420 +}
3421 +
3422 +
3423 +static void __exit hydrogen3_buttons_exit(void)
3424 +{
3425 + DPRINTK("unloading buttons driver\n");
3426 + misc_deregister(&hydrogen3_buttons_dev);
3427 +}
3428 +
3429 +
3430 +module_init(hydrogen3_buttons_init);
3431 +module_exit(hydrogen3_buttons_exit);
3432 diff -Nur linux-2.4.29/arch/mips/au1000/hydrogen3/Makefile linux-mips/arch/mips/au1000/hydrogen3/Makefile
3433 --- linux-2.4.29/arch/mips/au1000/hydrogen3/Makefile 2005-01-19 15:09:26.000000000 +0100
3434 +++ linux-mips/arch/mips/au1000/hydrogen3/Makefile 2005-03-26 11:47:17.372800467 +0100
3435 @@ -14,6 +14,11 @@
3436
3437 O_TARGET := hydrogen3.o
3438
3439 -obj-y := init.o board_setup.o irqmap.o
3440 +obj-y := init.o board_setup.o irqmap.o buttons.o
3441 +
3442 +ifdef CONFIG_MMC
3443 +obj-y += mmc_support.o
3444 +export-objs +=mmc_support.o
3445 +endif
3446
3447 include $(TOPDIR)/Rules.make
3448 diff -Nur linux-2.4.29/arch/mips/au1000/hydrogen3/mmc_support.c linux-mips/arch/mips/au1000/hydrogen3/mmc_support.c
3449 --- linux-2.4.29/arch/mips/au1000/hydrogen3/mmc_support.c 1970-01-01 01:00:00.000000000 +0100
3450 +++ linux-mips/arch/mips/au1000/hydrogen3/mmc_support.c 2005-02-02 05:27:06.000000000 +0100
3451 @@ -0,0 +1,89 @@
3452 +/*
3453 + * BRIEF MODULE DESCRIPTION
3454 + *
3455 + * MMC support routines for Hydrogen3.
3456 + *
3457 + *
3458 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
3459 + * Author: Embedded Edge, LLC.
3460 + * Contact: dan@embeddededge.com
3461 + *
3462 + * This program is free software; you can redistribute it and/or modify it
3463 + * under the terms of the GNU General Public License as published by the
3464 + * Free Software Foundation; either version 2 of the License, or (at your
3465 + * option) any later version.
3466 + *
3467 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3468 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3469 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3470 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3471 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3472 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3473 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3474 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3475 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3476 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3477 + *
3478 + * You should have received a copy of the GNU General Public License along
3479 + * with this program; if not, write to the Free Software Foundation, Inc.,
3480 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3481 + *
3482 + */
3483 +
3484 +
3485 +#include <linux/config.h>
3486 +#include <linux/kernel.h>
3487 +#include <linux/module.h>
3488 +#include <linux/init.h>
3489 +
3490 +#include <asm/irq.h>
3491 +#include <asm/au1000.h>
3492 +#include <asm/au1100_mmc.h>
3493 +
3494 +#define GPIO_17_WP 0x20000
3495 +
3496 +/* SD/MMC controller support functions */
3497 +
3498 +/*
3499 + * Detect card.
3500 + */
3501 +void mmc_card_inserted(int _n_, int *_res_)
3502 +{
3503 + u32 gpios = au_readl(SYS_PINSTATERD);
3504 + u32 emptybit = (1<<16);
3505 + *_res_ = ((gpios & emptybit) == 0);
3506 +}
3507 +
3508 +/*
3509 + * Check card write protection.
3510 + */
3511 +void mmc_card_writable(int _n_, int *_res_)
3512 +{
3513 + unsigned long mmc_wp, board_specific;
3514 + board_specific = au_readl(SYS_OUTPUTSET);
3515 + mmc_wp=GPIO_17_WP;
3516 + if (!(board_specific & mmc_wp)) {/* low means card writable */
3517 + *_res_ = 1;
3518 + } else {
3519 + *_res_ = 0;
3520 + }
3521 +}
3522 +/*
3523 + * Apply power to card slot.
3524 + */
3525 +void mmc_power_on(int _n_)
3526 +{
3527 +}
3528 +
3529 +/*
3530 + * Remove power from card slot.
3531 + */
3532 +void mmc_power_off(int _n_)
3533 +{
3534 +}
3535 +
3536 +EXPORT_SYMBOL(mmc_card_inserted);
3537 +EXPORT_SYMBOL(mmc_card_writable);
3538 +EXPORT_SYMBOL(mmc_power_on);
3539 +EXPORT_SYMBOL(mmc_power_off);
3540 +
3541 diff -Nur linux-2.4.29/arch/mips/au1000/mtx-1/board_setup.c linux-mips/arch/mips/au1000/mtx-1/board_setup.c
3542 --- linux-2.4.29/arch/mips/au1000/mtx-1/board_setup.c 2004-02-18 14:36:30.000000000 +0100
3543 +++ linux-mips/arch/mips/au1000/mtx-1/board_setup.c 2004-11-26 09:37:16.000000000 +0100
3544 @@ -48,6 +48,12 @@
3545
3546 extern struct rtc_ops no_rtc_ops;
3547
3548 +void board_reset (void)
3549 +{
3550 + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
3551 + au_writel(0x00000000, 0xAE00001C);
3552 +}
3553 +
3554 void __init board_setup(void)
3555 {
3556 rtc_ops = &no_rtc_ops;
3557 diff -Nur linux-2.4.29/arch/mips/au1000/mtx-1/irqmap.c linux-mips/arch/mips/au1000/mtx-1/irqmap.c
3558 --- linux-2.4.29/arch/mips/au1000/mtx-1/irqmap.c 2005-01-19 15:09:26.000000000 +0100
3559 +++ linux-mips/arch/mips/au1000/mtx-1/irqmap.c 2004-11-26 09:37:16.000000000 +0100
3560 @@ -72,10 +72,10 @@
3561 * A B C D
3562 */
3563 {
3564 - {INTA, INTB, INTC, INTD}, /* IDSEL 0 */
3565 - {INTA, INTB, INTC, INTD}, /* IDSEL 1 */
3566 - {INTA, INTB, INTC, INTD}, /* IDSEL 2 */
3567 - {INTA, INTB, INTC, INTD}, /* IDSEL 3 */
3568 + {INTA, INTB, INTX, INTX}, /* IDSEL 0 */
3569 + {INTB, INTA, INTX, INTX}, /* IDSEL 1 */
3570 + {INTC, INTD, INTX, INTX}, /* IDSEL 2 */
3571 + {INTD, INTC, INTX, INTX}, /* IDSEL 3 */
3572 };
3573 const long min_idsel = 0, max_idsel = 3, irqs_per_slot = 4;
3574 return PCI_IRQ_TABLE_LOOKUP;
3575 diff -Nur linux-2.4.29/arch/mips/au1000/pb1000/board_setup.c linux-mips/arch/mips/au1000/pb1000/board_setup.c
3576 --- linux-2.4.29/arch/mips/au1000/pb1000/board_setup.c 2005-01-19 15:09:26.000000000 +0100
3577 +++ linux-mips/arch/mips/au1000/pb1000/board_setup.c 2005-03-26 11:47:17.413793739 +0100
3578 @@ -58,6 +58,10 @@
3579 {
3580 }
3581
3582 +void board_power_off (void)
3583 +{
3584 +}
3585 +
3586 void __init board_setup(void)
3587 {
3588 u32 pin_func, static_cfg0;
3589 diff -Nur linux-2.4.29/arch/mips/au1000/pb1100/board_setup.c linux-mips/arch/mips/au1000/pb1100/board_setup.c
3590 --- linux-2.4.29/arch/mips/au1000/pb1100/board_setup.c 2005-01-19 15:09:26.000000000 +0100
3591 +++ linux-mips/arch/mips/au1000/pb1100/board_setup.c 2005-03-26 11:47:17.418792919 +0100
3592 @@ -62,6 +62,10 @@
3593 au_writel(0x00000000, 0xAE00001C);
3594 }
3595
3596 +void board_power_off (void)
3597 +{
3598 +}
3599 +
3600 void __init board_setup(void)
3601 {
3602 u32 pin_func;
3603 diff -Nur linux-2.4.29/arch/mips/au1000/pb1100/Makefile linux-mips/arch/mips/au1000/pb1100/Makefile
3604 --- linux-2.4.29/arch/mips/au1000/pb1100/Makefile 2003-08-25 13:44:39.000000000 +0200
3605 +++ linux-mips/arch/mips/au1000/pb1100/Makefile 2005-01-31 12:59:30.000000000 +0100
3606 @@ -16,4 +16,10 @@
3607
3608 obj-y := init.o board_setup.o irqmap.o
3609
3610 +
3611 +ifdef CONFIG_MMC
3612 +obj-y += mmc_support.o
3613 +export-objs += mmc_support.o
3614 +endif
3615 +
3616 include $(TOPDIR)/Rules.make
3617 diff -Nur linux-2.4.29/arch/mips/au1000/pb1100/mmc_support.c linux-mips/arch/mips/au1000/pb1100/mmc_support.c
3618 --- linux-2.4.29/arch/mips/au1000/pb1100/mmc_support.c 1970-01-01 01:00:00.000000000 +0100
3619 +++ linux-mips/arch/mips/au1000/pb1100/mmc_support.c 2005-01-30 09:10:29.000000000 +0100
3620 @@ -0,0 +1,126 @@
3621 +/*
3622 + * BRIEF MODULE DESCRIPTION
3623 + *
3624 + * MMC support routines for PB1100.
3625 + *
3626 + *
3627 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
3628 + * Author: Embedded Edge, LLC.
3629 + * Contact: dan@embeddededge.com
3630 + *
3631 + * This program is free software; you can redistribute it and/or modify it
3632 + * under the terms of the GNU General Public License as published by the
3633 + * Free Software Foundation; either version 2 of the License, or (at your
3634 + * option) any later version.
3635 + *
3636 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3637 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3638 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3639 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3640 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3641 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3642 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3643 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3644 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3645 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3646 + *
3647 + * You should have received a copy of the GNU General Public License along
3648 + * with this program; if not, write to the Free Software Foundation, Inc.,
3649 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3650 + *
3651 + */
3652 +
3653 +
3654 +#include <linux/config.h>
3655 +#include <linux/kernel.h>
3656 +#include <linux/module.h>
3657 +#include <linux/init.h>
3658 +
3659 +#include <asm/irq.h>
3660 +#include <asm/au1000.h>
3661 +#include <asm/au1100_mmc.h>
3662 +#include <asm/pb1100.h>
3663 +
3664 +
3665 +/* SD/MMC controller support functions */
3666 +
3667 +/*
3668 + * Detect card.
3669 + */
3670 +void mmc_card_inserted(int _n_, int *_res_)
3671 +{
3672 + u32 gpios = au_readl(SYS_PINSTATERD);
3673 + u32 emptybit = (_n_) ? (1<<15) : (1<<14);
3674 + *_res_ = ((gpios & emptybit) == 0);
3675 +}
3676 +
3677 +/*
3678 + * Check card write protection.
3679 + */
3680 +void mmc_card_writable(int _n_, int *_res_)
3681 +{
3682 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3683 + unsigned long mmc_wp, board_specific;
3684 +
3685 + if (_n_) {
3686 + mmc_wp = BCSR_PCMCIA_SD1_WP;
3687 + } else {
3688 + mmc_wp = BCSR_PCMCIA_SD0_WP;
3689 + }
3690 +
3691 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3692 +
3693 + if (!(board_specific & mmc_wp)) {/* low means card writable */
3694 + *_res_ = 1;
3695 + } else {
3696 + *_res_ = 0;
3697 + }
3698 +}
3699 +
3700 +/*
3701 + * Apply power to card slot.
3702 + */
3703 +void mmc_power_on(int _n_)
3704 +{
3705 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3706 + unsigned long mmc_pwr, board_specific;
3707 +
3708 + if (_n_) {
3709 + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
3710 + } else {
3711 + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
3712 + }
3713 +
3714 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3715 + board_specific |= mmc_pwr;
3716 +
3717 + au_writel(board_specific, (int)(&bcsr->pcmcia));
3718 + au_sync_delay(1);
3719 +}
3720 +
3721 +/*
3722 + * Remove power from card slot.
3723 + */
3724 +void mmc_power_off(int _n_)
3725 +{
3726 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3727 + unsigned long mmc_pwr, board_specific;
3728 +
3729 + if (_n_) {
3730 + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
3731 + } else {
3732 + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
3733 + }
3734 +
3735 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3736 + board_specific &= ~mmc_pwr;
3737 +
3738 + au_writel(board_specific, (int)(&bcsr->pcmcia));
3739 + au_sync_delay(1);
3740 +}
3741 +
3742 +EXPORT_SYMBOL(mmc_card_inserted);
3743 +EXPORT_SYMBOL(mmc_card_writable);
3744 +EXPORT_SYMBOL(mmc_power_on);
3745 +EXPORT_SYMBOL(mmc_power_off);
3746 +
3747 diff -Nur linux-2.4.29/arch/mips/au1000/pb1200/board_setup.c linux-mips/arch/mips/au1000/pb1200/board_setup.c
3748 --- linux-2.4.29/arch/mips/au1000/pb1200/board_setup.c 1970-01-01 01:00:00.000000000 +0100
3749 +++ linux-mips/arch/mips/au1000/pb1200/board_setup.c 2005-03-19 08:17:51.000000000 +0100
3750 @@ -0,0 +1,221 @@
3751 +/*
3752 + *
3753 + * BRIEF MODULE DESCRIPTION
3754 + * Alchemy Pb1200 board setup.
3755 + *
3756 + * This program is free software; you can redistribute it and/or modify it
3757 + * under the terms of the GNU General Public License as published by the
3758 + * Free Software Foundation; either version 2 of the License, or (at your
3759 + * option) any later version.
3760 + *
3761 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3762 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3763 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3764 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3765 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3766 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3767 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3768 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3769 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3770 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3771 + *
3772 + * You should have received a copy of the GNU General Public License along
3773 + * with this program; if not, write to the Free Software Foundation, Inc.,
3774 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3775 + */
3776 +#include <linux/config.h>
3777 +#include <linux/init.h>
3778 +#include <linux/sched.h>
3779 +#include <linux/ioport.h>
3780 +#include <linux/mm.h>
3781 +#include <linux/console.h>
3782 +#include <linux/mc146818rtc.h>
3783 +#include <linux/delay.h>
3784 +
3785 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
3786 +#include <linux/ide.h>
3787 +#endif
3788 +
3789 +#include <asm/cpu.h>
3790 +#include <asm/bootinfo.h>
3791 +#include <asm/irq.h>
3792 +#include <asm/keyboard.h>
3793 +#include <asm/mipsregs.h>
3794 +#include <asm/reboot.h>
3795 +#include <asm/pgtable.h>
3796 +#include <asm/au1000.h>
3797 +#include <asm/au1xxx_dbdma.h>
3798 +
3799 +#ifdef CONFIG_MIPS_PB1200
3800 +#include <asm/pb1200.h>
3801 +#endif
3802 +
3803 +#ifdef CONFIG_MIPS_DB1200
3804 +#include <asm/db1200.h>
3805 +#define PB1200_ETH_INT DB1200_ETH_INT
3806 +#define PB1200_IDE_INT DB1200_IDE_INT
3807 +#endif
3808 +
3809 +extern struct rtc_ops no_rtc_ops;
3810 +
3811 +extern void _board_init_irq(void);
3812 +extern void (*board_init_irq)(void);
3813 +
3814 +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX
3815 +extern struct ide_ops *ide_ops;
3816 +extern struct ide_ops au1xxx_ide_ops;
3817 +extern u32 au1xxx_ide_virtbase;
3818 +extern u64 au1xxx_ide_physbase;
3819 +extern int au1xxx_ide_irq;
3820 +
3821 +u32 led_base_addr;
3822 +/* Ddma */
3823 +chan_tab_t *ide_read_ch, *ide_write_ch;
3824 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
3825 +
3826 +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
3827 +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
3828 +
3829 +void board_reset (void)
3830 +{
3831 + bcsr->resets = 0;
3832 +}
3833 +
3834 +void board_power_off (void)
3835 +{
3836 + bcsr->resets = 0xC000;
3837 +}
3838 +
3839 +void __init board_setup(void)
3840 +{
3841 + char *argptr = NULL;
3842 + u32 pin_func;
3843 + rtc_ops = &no_rtc_ops;
3844 +
3845 +#if 0
3846 + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
3847 + * but it is board specific code, so put it here.
3848 + */
3849 + pin_func = au_readl(SYS_PINFUNC);
3850 + au_sync();
3851 + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
3852 + au_writel(pin_func, SYS_PINFUNC);
3853 +
3854 + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
3855 + au_sync();
3856 +#endif
3857 +
3858 +#if defined( CONFIG_I2C_ALGO_AU1550 )
3859 + {
3860 + u32 freq0, clksrc;
3861 +
3862 + /* Select SMBUS in CPLD */
3863 + bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
3864 +
3865 + pin_func = au_readl(SYS_PINFUNC);
3866 + au_sync();
3867 + pin_func &= ~(3<<17 | 1<<4);
3868 + /* Set GPIOs correctly */
3869 + pin_func |= 2<<17;
3870 + au_writel(pin_func, SYS_PINFUNC);
3871 + au_sync();
3872 +
3873 + /* The i2c driver depends on 50Mhz clock */
3874 + freq0 = au_readl(SYS_FREQCTRL0);
3875 + au_sync();
3876 + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
3877 + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
3878 + /* 396Mhz / (3+1)*2 == 49.5Mhz */
3879 + au_writel(freq0, SYS_FREQCTRL0);
3880 + au_sync();
3881 + freq0 |= SYS_FC_FE1;
3882 + au_writel(freq0, SYS_FREQCTRL0);
3883 + au_sync();
3884 +
3885 + clksrc = au_readl(SYS_CLKSRC);
3886 + au_sync();
3887 + clksrc &= ~0x01f00000;
3888 + /* bit 22 is EXTCLK0 for PSC0 */
3889 + clksrc |= (0x3 << 22);
3890 + au_writel(clksrc, SYS_CLKSRC);
3891 + au_sync();
3892 + }
3893 +#endif
3894 +
3895 +#ifdef CONFIG_FB_AU1200
3896 + argptr = prom_getcmdline();
3897 + strcat(argptr, " video=au1200fb:");
3898 +#endif
3899 +
3900 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
3901 + /*
3902 + * Iniz IDE parameters
3903 + */
3904 + ide_ops = &au1xxx_ide_ops;
3905 + au1xxx_ide_irq = PB1200_IDE_INT;
3906 + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
3907 + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
3908 + /*
3909 + * change PIO or PIO+Ddma
3910 + * check the GPIO-5 pin condition. pb1200:s18_dot */
3911 + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0;
3912 +#endif
3913 +
3914 + /* The Pb1200 development board uses external MUX for PSC0 to
3915 + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
3916 + */
3917 +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
3918 + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
3919 + Refer to Pb1200/Db1200 documentation.
3920 +#elif defined( CONFIG_AU1550_PSC_SPI )
3921 + bcsr->resets |= BCSR_RESETS_PCS0MUX;
3922 +#elif defined( CONFIG_I2C_ALGO_AU1550 )
3923 + bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
3924 +#endif
3925 + au_sync();
3926 +
3927 +#ifdef CONFIG_MIPS_PB1200
3928 + printk("AMD Alchemy Pb1200 Board\n");
3929 +#endif
3930 +#ifdef CONFIG_MIPS_DB1200
3931 + printk("AMD Alchemy Db1200 Board\n");
3932 +#endif
3933 +
3934 + /* Setup Pb1200 External Interrupt Controller */
3935 + {
3936 + extern void (*board_init_irq)(void);
3937 + extern void _board_init_irq(void);
3938 + board_init_irq = _board_init_irq;
3939 + }
3940 +}
3941 +
3942 +int
3943 +board_au1200fb_panel (void)
3944 +{
3945 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3946 + int p;
3947 +
3948 + p = bcsr->switches;
3949 + p >>= 8;
3950 + p &= 0x0F;
3951 + return p;
3952 +}
3953 +
3954 +int
3955 +board_au1200fb_panel_init (void)
3956 +{
3957 + /* Apply power */
3958 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3959 + bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
3960 + return 0;
3961 +}
3962 +
3963 +int
3964 +board_au1200fb_panel_shutdown (void)
3965 +{
3966 + /* Remove power */
3967 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3968 + bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
3969 + return 0;
3970 +}
3971 +
3972 diff -Nur linux-2.4.29/arch/mips/au1000/pb1200/init.c linux-mips/arch/mips/au1000/pb1200/init.c
3973 --- linux-2.4.29/arch/mips/au1000/pb1200/init.c 1970-01-01 01:00:00.000000000 +0100
3974 +++ linux-mips/arch/mips/au1000/pb1200/init.c 2005-01-30 09:01:28.000000000 +0100
3975 @@ -0,0 +1,72 @@
3976 +/*
3977 + *
3978 + * BRIEF MODULE DESCRIPTION
3979 + * PB1200 board setup
3980 + *
3981 + * This program is free software; you can redistribute it and/or modify it
3982 + * under the terms of the GNU General Public License as published by the
3983 + * Free Software Foundation; either version 2 of the License, or (at your
3984 + * option) any later version.
3985 + *
3986 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3987 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3988 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3989 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3990 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3991 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3992 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3993 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3994 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3995 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3996 + *
3997 + * You should have received a copy of the GNU General Public License along
3998 + * with this program; if not, write to the Free Software Foundation, Inc.,
3999 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4000 + */
4001 +
4002 +#include <linux/init.h>
4003 +#include <linux/mm.h>
4004 +#include <linux/sched.h>
4005 +#include <linux/bootmem.h>
4006 +#include <asm/addrspace.h>
4007 +#include <asm/bootinfo.h>
4008 +#include <linux/config.h>
4009 +#include <linux/string.h>
4010 +#include <linux/kernel.h>
4011 +#include <linux/sched.h>
4012 +
4013 +int prom_argc;
4014 +char **prom_argv, **prom_envp;
4015 +extern void __init prom_init_cmdline(void);
4016 +extern char *prom_getenv(char *envname);
4017 +
4018 +const char *get_system_type(void)
4019 +{
4020 + return "AMD Alchemy Au1200/Pb1200";
4021 +}
4022 +
4023 +u32 mae_memsize = 0;
4024 +
4025 +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
4026 +{
4027 + unsigned char *memsize_str;
4028 + unsigned long memsize;
4029 +
4030 + prom_argc = argc;
4031 + prom_argv = argv;
4032 + prom_envp = envp;
4033 +
4034 + mips_machgroup = MACH_GROUP_ALCHEMY;
4035 + mips_machtype = MACH_PB1000; /* set the platform # */
4036 + prom_init_cmdline();
4037 +
4038 + memsize_str = prom_getenv("memsize");
4039 + if (!memsize_str) {
4040 + memsize = 0x08000000;
4041 + } else {
4042 + memsize = simple_strtol(memsize_str, NULL, 0);
4043 + }
4044 + add_memory_region(0, memsize, BOOT_MEM_RAM);
4045 + return 0;
4046 +}
4047 +
4048 diff -Nur linux-2.4.29/arch/mips/au1000/pb1200/irqmap.c linux-mips/arch/mips/au1000/pb1200/irqmap.c
4049 --- linux-2.4.29/arch/mips/au1000/pb1200/irqmap.c 1970-01-01 01:00:00.000000000 +0100
4050 +++ linux-mips/arch/mips/au1000/pb1200/irqmap.c 2005-01-30 09:01:28.000000000 +0100
4051 @@ -0,0 +1,180 @@
4052 +/*
4053 + * BRIEF MODULE DESCRIPTION
4054 + * Au1xxx irq map table
4055 + *
4056 + * This program is free software; you can redistribute it and/or modify it
4057 + * under the terms of the GNU General Public License as published by the
4058 + * Free Software Foundation; either version 2 of the License, or (at your
4059 + * option) any later version.
4060 + *
4061 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4062 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4063 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4064 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4065 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4066 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4067 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4068 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4069 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4070 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4071 + *
4072 + * You should have received a copy of the GNU General Public License along
4073 + * with this program; if not, write to the Free Software Foundation, Inc.,
4074 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4075 + */
4076 +#include <linux/errno.h>
4077 +#include <linux/init.h>
4078 +#include <linux/irq.h>
4079 +#include <linux/kernel_stat.h>
4080 +#include <linux/module.h>
4081 +#include <linux/signal.h>
4082 +#include <linux/sched.h>
4083 +#include <linux/types.h>
4084 +#include <linux/interrupt.h>
4085 +#include <linux/ioport.h>
4086 +#include <linux/timex.h>
4087 +#include <linux/slab.h>
4088 +#include <linux/random.h>
4089 +#include <linux/delay.h>
4090 +
4091 +#include <asm/bitops.h>
4092 +#include <asm/bootinfo.h>
4093 +#include <asm/io.h>
4094 +#include <asm/mipsregs.h>
4095 +#include <asm/system.h>
4096 +#include <asm/au1000.h>
4097 +
4098 +#ifdef CONFIG_MIPS_PB1200
4099 +#include <asm/pb1200.h>
4100 +#endif
4101 +
4102 +#ifdef CONFIG_MIPS_DB1200
4103 +#include <asm/db1200.h>
4104 +#define PB1200_INT_BEGIN DB1200_INT_BEGIN
4105 +#define PB1200_INT_END DB1200_INT_END
4106 +#endif
4107 +
4108 +au1xxx_irq_map_t au1xxx_irq_map[] = {
4109 + { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade
4110 +};
4111 +
4112 +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
4113 +
4114 +/*
4115 + * Support for External interrupts on the PbAu1200 Development platform.
4116 + */
4117 +static volatile int pb1200_cascade_en=0;
4118 +
4119 +void pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
4120 +{
4121 + unsigned short bisr = bcsr->int_status;
4122 + int extirq_nr = 0;
4123 +
4124 + /* Clear all the edge interrupts. This has no effect on level */
4125 + bcsr->int_status = bisr;
4126 + for( ; bisr; bisr &= (bisr-1) )
4127 + {
4128 + extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
4129 + /* Ack and dispatch IRQ */
4130 + do_IRQ(extirq_nr,regs);
4131 + }
4132 +}
4133 +
4134 +inline void pb1200_enable_irq(unsigned int irq_nr)
4135 +{
4136 + bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
4137 + bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN);
4138 +}
4139 +
4140 +inline void pb1200_disable_irq(unsigned int irq_nr)
4141 +{
4142 + bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
4143 + bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
4144 +}
4145 +
4146 +static unsigned int pb1200_startup_irq( unsigned int irq_nr )
4147 +{
4148 + if (++pb1200_cascade_en == 1)
4149 + {
4150 + request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
4151 + 0, "Pb1200 Cascade", &pb1200_cascade_handler );
4152 +#ifdef CONFIG_MIPS_PB1200
4153 + /* We have a problem with CPLD rev3. Enable a workaround */
4154 + if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)
4155 + {
4156 + printk("\nWARNING!!!\n");
4157 + printk("\nWARNING!!!\n");
4158 + printk("\nWARNING!!!\n");
4159 + printk("\nWARNING!!!\n");
4160 + printk("\nWARNING!!!\n");
4161 + printk("\nWARNING!!!\n");
4162 + printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
4163 + printk("updated to latest revision. This software will not\n");
4164 + printk("work on anything less than CPLD rev4\n");
4165 + printk("\nWARNING!!!\n");
4166 + printk("\nWARNING!!!\n");
4167 + printk("\nWARNING!!!\n");
4168 + printk("\nWARNING!!!\n");
4169 + printk("\nWARNING!!!\n");
4170 + printk("\nWARNING!!!\n");
4171 + while(1);
4172 + }
4173 +#endif
4174 + }
4175 + pb1200_enable_irq(irq_nr);
4176 + return 0;
4177 +}
4178 +
4179 +static void pb1200_shutdown_irq( unsigned int irq_nr )
4180 +{
4181 + pb1200_disable_irq(irq_nr);
4182 + if (--pb1200_cascade_en == 0)
4183 + {
4184 + free_irq(AU1000_GPIO_7,&pb1200_cascade_handler );
4185 + }
4186 + return;
4187 +}
4188 +
4189 +static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
4190 +{
4191 + pb1200_disable_irq( irq_nr );
4192 +}
4193 +
4194 +static void pb1200_end_irq(unsigned int irq_nr)
4195 +{
4196 + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
4197 + pb1200_enable_irq(irq_nr);
4198 + }
4199 +}
4200 +
4201 +static struct hw_interrupt_type external_irq_type =
4202 +{
4203 +#ifdef CONFIG_MIPS_PB1200
4204 + "Pb1200 Ext",
4205 +#endif
4206 +#ifdef CONFIG_MIPS_DB1200
4207 + "Db1200 Ext",
4208 +#endif
4209 + pb1200_startup_irq,
4210 + pb1200_shutdown_irq,
4211 + pb1200_enable_irq,
4212 + pb1200_disable_irq,
4213 + pb1200_mask_and_ack_irq,
4214 + pb1200_end_irq,
4215 + NULL
4216 +};
4217 +
4218 +void _board_init_irq(void)
4219 +{
4220 + int irq_nr;
4221 +
4222 + for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
4223 + {
4224 + irq_desc[irq_nr].handler = &external_irq_type;
4225 + pb1200_disable_irq(irq_nr);
4226 + }
4227 +
4228 + /* GPIO_7 can not be hooked here, so it is hooked upon first
4229 + request of any source attached to the cascade */
4230 +}
4231 +
4232 diff -Nur linux-2.4.29/arch/mips/au1000/pb1200/Makefile linux-mips/arch/mips/au1000/pb1200/Makefile
4233 --- linux-2.4.29/arch/mips/au1000/pb1200/Makefile 1970-01-01 01:00:00.000000000 +0100
4234 +++ linux-mips/arch/mips/au1000/pb1200/Makefile 2005-01-30 09:01:27.000000000 +0100
4235 @@ -0,0 +1,25 @@
4236 +#
4237 +# Copyright 2000 MontaVista Software Inc.
4238 +# Author: MontaVista Software, Inc.
4239 +# ppopov@mvista.com or source@mvista.com
4240 +#
4241 +# Makefile for the Alchemy Semiconductor PB1000 board.
4242 +#
4243 +# Note! Dependencies are done automagically by 'make dep', which also
4244 +# removes any old dependencies. DON'T put your own dependencies here
4245 +# unless it's something special (ie not a .c file).
4246 +#
4247 +
4248 +USE_STANDARD_AS_RULE := true
4249 +
4250 +O_TARGET := pb1200.o
4251 +
4252 +obj-y := init.o board_setup.o irqmap.o
4253 +
4254 +ifdef CONFIG_MMC
4255 +obj-y += mmc_support.o
4256 +export-objs +=mmc_support.o
4257 +endif
4258 +
4259 +
4260 +include $(TOPDIR)/Rules.make
4261 diff -Nur linux-2.4.29/arch/mips/au1000/pb1200/mmc_support.c linux-mips/arch/mips/au1000/pb1200/mmc_support.c
4262 --- linux-2.4.29/arch/mips/au1000/pb1200/mmc_support.c 1970-01-01 01:00:00.000000000 +0100
4263 +++ linux-mips/arch/mips/au1000/pb1200/mmc_support.c 2005-01-30 09:01:28.000000000 +0100
4264 @@ -0,0 +1,141 @@
4265 +/*
4266 + * BRIEF MODULE DESCRIPTION
4267 + *
4268 + * MMC support routines for PB1200.
4269 + *
4270 + *
4271 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
4272 + * Author: Embedded Edge, LLC.
4273 + * Contact: dan@embeddededge.com
4274 + *
4275 + * This program is free software; you can redistribute it and/or modify it
4276 + * under the terms of the GNU General Public License as published by the
4277 + * Free Software Foundation; either version 2 of the License, or (at your
4278 + * option) any later version.
4279 + *
4280 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4281 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4282 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4283 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4284 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4285 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4286 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4287 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4288 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4289 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4290 + *
4291 + * You should have received a copy of the GNU General Public License along
4292 + * with this program; if not, write to the Free Software Foundation, Inc.,
4293 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4294 + *
4295 + */
4296 +
4297 +
4298 +#include <linux/config.h>
4299 +#include <linux/kernel.h>
4300 +#include <linux/module.h>
4301 +#include <linux/init.h>
4302 +
4303 +#include <asm/irq.h>
4304 +#include <asm/au1000.h>
4305 +#include <asm/au1100_mmc.h>
4306 +
4307 +#ifdef CONFIG_MIPS_PB1200
4308 +#include <asm/pb1200.h>
4309 +#endif
4310 +
4311 +#ifdef CONFIG_MIPS_DB1200
4312 +/* NOTE: DB1200 only has SD0 pinned out and usable */
4313 +#include <asm/db1200.h>
4314 +#endif
4315 +
4316 +/* SD/MMC controller support functions */
4317 +
4318 +/*
4319 + * Detect card.
4320 + */
4321 +void mmc_card_inserted(int socket, int *result)
4322 +{
4323 + u16 mask;
4324 +
4325 + if (socket)
4326 +#ifdef CONFIG_MIPS_DB1200
4327 + mask = 0;
4328 +#else
4329 + mask = BCSR_INT_SD1INSERT;
4330 +#endif
4331 + else
4332 + mask = BCSR_INT_SD0INSERT;
4333 +
4334 + *result = ((bcsr->sig_status & mask) != 0);
4335 +}
4336 +
4337 +/*
4338 + * Check card write protection.
4339 + */
4340 +void mmc_card_writable(int socket, int *result)
4341 +{
4342 + u16 mask;
4343 +
4344 + if (socket)
4345 +#ifdef CONFIG_MIPS_DB1200
4346 + mask = 0;
4347 +#else
4348 + mask = BCSR_STATUS_SD1WP;
4349 +#endif
4350 + else
4351 + mask = BCSR_STATUS_SD0WP;
4352 +
4353 + /* low means card writable */
4354 + if (!(bcsr->status & mask)) {
4355 + *result = 1;
4356 + } else {
4357 + *result = 0;
4358 + }
4359 +}
4360 +
4361 +/*
4362 + * Apply power to card slot.
4363 + */
4364 +void mmc_power_on(int socket)
4365 +{
4366 + u16 mask;
4367 +
4368 + if (socket)
4369 +#ifdef CONFIG_MIPS_DB1200
4370 + mask = 0;
4371 +#else
4372 + mask = BCSR_BOARD_SD1PWR;
4373 +#endif
4374 + else
4375 + mask = BCSR_BOARD_SD0PWR;
4376 +
4377 + bcsr->board |= mask;
4378 + au_sync_delay(1);
4379 +}
4380 +
4381 +/*
4382 + * Remove power from card slot.
4383 + */
4384 +void mmc_power_off(int socket)
4385 +{
4386 + u16 mask;
4387 +
4388 + if (socket)
4389 +#ifdef CONFIG_MIPS_DB1200
4390 + mask = 0;
4391 +#else
4392 + mask = BCSR_BOARD_SD1PWR;
4393 +#endif
4394 + else
4395 + mask = BCSR_BOARD_SD0PWR;
4396 +
4397 + bcsr->board &= ~mask;
4398 + au_sync_delay(1);
4399 +}
4400 +
4401 +EXPORT_SYMBOL(mmc_card_inserted);
4402 +EXPORT_SYMBOL(mmc_card_writable);
4403 +EXPORT_SYMBOL(mmc_power_on);
4404 +EXPORT_SYMBOL(mmc_power_off);
4405 +
4406 diff -Nur linux-2.4.29/arch/mips/au1000/pb1500/board_setup.c linux-mips/arch/mips/au1000/pb1500/board_setup.c
4407 --- linux-2.4.29/arch/mips/au1000/pb1500/board_setup.c 2005-01-19 15:09:26.000000000 +0100
4408 +++ linux-mips/arch/mips/au1000/pb1500/board_setup.c 2005-03-26 11:47:17.496780119 +0100
4409 @@ -62,6 +62,10 @@
4410 au_writel(0x00000000, 0xAE00001C);
4411 }
4412
4413 +void board_power_off (void)
4414 +{
4415 +}
4416 +
4417 void __init board_setup(void)
4418 {
4419 u32 pin_func;
4420 diff -Nur linux-2.4.29/arch/mips/au1000/pb1550/board_setup.c linux-mips/arch/mips/au1000/pb1550/board_setup.c
4421 --- linux-2.4.29/arch/mips/au1000/pb1550/board_setup.c 2005-01-19 15:09:26.000000000 +0100
4422 +++ linux-mips/arch/mips/au1000/pb1550/board_setup.c 2005-03-26 11:47:17.496780119 +0100
4423 @@ -48,12 +48,31 @@
4424
4425 extern struct rtc_ops no_rtc_ops;
4426
4427 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
4428 +extern struct ide_ops *ide_ops;
4429 +extern struct ide_ops au1xxx_ide_ops;
4430 +extern u32 au1xxx_ide_virtbase;
4431 +extern u64 au1xxx_ide_physbase;
4432 +extern unsigned int au1xxx_ide_irq;
4433 +
4434 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
4435 +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
4436 +
4437 void board_reset (void)
4438 {
4439 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
4440 au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
4441 }
4442
4443 +void board_power_off (void)
4444 +{
4445 + /* power off system */
4446 + printk("\n** Powering off Pb1550\n");
4447 + au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
4448 + au_sync();
4449 + while(1); /* should not get here */
4450 +}
4451 +
4452 void __init board_setup(void)
4453 {
4454 u32 pin_func;
4455 @@ -78,5 +97,36 @@
4456 au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
4457 au_sync();
4458
4459 +#if defined(CONFIG_AU1XXX_SMC91111)
4460 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
4461 +#error "Resource conflict occured. Disable either Ethernet or IDE daughter card."
4462 +#else
4463 +#define CPLD_CONTROL (0xAF00000C)
4464 + {
4465 + /* set up the Static Bus timing */
4466 + /* only 396Mhz */
4467 + /* reset the DC */
4468 + au_writew(au_readw(CPLD_CONTROL) | 0x0f, CPLD_CONTROL);
4469 + au_writel(0x00010003, MEM_STCFG0);
4470 + au_writel(0x000c00c0, MEM_STCFG2);
4471 + au_writel(0x85E1900D, MEM_STTIME2);
4472 + }
4473 +#endif
4474 +#endif /* end CONFIG_SMC91111 */
4475 +
4476 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
4477 + /*
4478 + * Iniz IDE parameters
4479 + */
4480 + ide_ops = &au1xxx_ide_ops;
4481 + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;;
4482 + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
4483 + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
4484 + /*
4485 + * change PIO or PIO+Ddma
4486 + * check the GPIO-6 pin condition. pb1550:s15_dot
4487 + */
4488 + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
4489 +#endif
4490 printk("AMD Alchemy Pb1550 Board\n");
4491 }
4492 diff -Nur linux-2.4.29/arch/mips/au1000/pb1550/irqmap.c linux-mips/arch/mips/au1000/pb1550/irqmap.c
4493 --- linux-2.4.29/arch/mips/au1000/pb1550/irqmap.c 2005-01-19 15:09:26.000000000 +0100
4494 +++ linux-mips/arch/mips/au1000/pb1550/irqmap.c 2005-01-31 12:59:30.000000000 +0100
4495 @@ -50,6 +50,9 @@
4496 au1xxx_irq_map_t au1xxx_irq_map[] = {
4497 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
4498 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
4499 +#ifdef CONFIG_AU1XXX_SMC91111
4500 + { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 },
4501 +#endif
4502 };
4503
4504 int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
4505 diff -Nur linux-2.4.29/arch/mips/config-shared.in linux-mips/arch/mips/config-shared.in
4506 --- linux-2.4.29/arch/mips/config-shared.in 2005-01-19 15:09:27.000000000 +0100
4507 +++ linux-mips/arch/mips/config-shared.in 2005-01-31 12:59:28.000000000 +0100
4508 @@ -21,16 +21,19 @@
4509 comment 'Machine selection'
4510 dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL
4511 dep_bool 'Support for Alchemy Bosporus board' CONFIG_MIPS_BOSPORUS $CONFIG_MIPS32
4512 +dep_bool 'Support for FIC Multimedia Player board' CONFIG_MIPS_FICMMP $CONFIG_MIPS32
4513 dep_bool 'Support for Alchemy Mirage board' CONFIG_MIPS_MIRAGE $CONFIG_MIPS32
4514 dep_bool 'Support for Alchemy Db1000 board' CONFIG_MIPS_DB1000 $CONFIG_MIPS32
4515 dep_bool 'Support for Alchemy Db1100 board' CONFIG_MIPS_DB1100 $CONFIG_MIPS32
4516 dep_bool 'Support for Alchemy Db1500 board' CONFIG_MIPS_DB1500 $CONFIG_MIPS32
4517 dep_bool 'Support for Alchemy Db1550 board' CONFIG_MIPS_DB1550 $CONFIG_MIPS32
4518 +dep_bool 'Support for Alchemy Db1200 board' CONFIG_MIPS_DB1200 $CONFIG_MIPS32
4519 dep_bool 'Support for Alchemy PB1000 board' CONFIG_MIPS_PB1000 $CONFIG_MIPS32
4520 dep_bool 'Support for Alchemy PB1100 board' CONFIG_MIPS_PB1100 $CONFIG_MIPS32
4521 dep_bool 'Support for Alchemy PB1500 board' CONFIG_MIPS_PB1500 $CONFIG_MIPS32
4522 -dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
4523 dep_bool 'Support for Alchemy PB1550 board' CONFIG_MIPS_PB1550 $CONFIG_MIPS32
4524 +dep_bool 'Support for Alchemy PB1200 board' CONFIG_MIPS_PB1200 $CONFIG_MIPS32
4525 +dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
4526 dep_bool 'Support for MyCable XXS1500 board' CONFIG_MIPS_XXS1500 $CONFIG_MIPS32
4527 dep_bool 'Support for 4G Systems MTX-1 board' CONFIG_MIPS_MTX1 $CONFIG_MIPS32
4528 dep_bool 'Support for Cogent CSB250 board' CONFIG_COGENT_CSB250 $CONFIG_MIPS32
4529 @@ -249,6 +252,12 @@
4530 define_bool CONFIG_PC_KEYB y
4531 define_bool CONFIG_NONCOHERENT_IO y
4532 fi
4533 +if [ "$CONFIG_MIPS_FICMMP" = "y" ]; then
4534 + define_bool CONFIG_SOC_AU1X00 y
4535 + define_bool CONFIG_SOC_AU1200 y
4536 + define_bool CONFIG_NONCOHERENT_IO y
4537 + define_bool CONFIG_PC_KEYB y
4538 +fi
4539 if [ "$CONFIG_MIPS_BOSPORUS" = "y" ]; then
4540 define_bool CONFIG_SOC_AU1X00 y
4541 define_bool CONFIG_SOC_AU1500 y
4542 @@ -263,6 +272,12 @@
4543 define_bool CONFIG_SWAP_IO_SPACE_W y
4544 define_bool CONFIG_SWAP_IO_SPACE_L y
4545 fi
4546 +if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
4547 + define_bool CONFIG_SOC_AU1X00 y
4548 + define_bool CONFIG_SOC_AU1500 y
4549 + define_bool CONFIG_NONCOHERENT_IO y
4550 + define_bool CONFIG_PC_KEYB y
4551 +fi
4552 if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
4553 define_bool CONFIG_SOC_AU1X00 y
4554 define_bool CONFIG_SOC_AU1100 y
4555 @@ -271,9 +286,15 @@
4556 define_bool CONFIG_SWAP_IO_SPACE_W y
4557 define_bool CONFIG_SWAP_IO_SPACE_L y
4558 fi
4559 -if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
4560 +if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
4561 define_bool CONFIG_SOC_AU1X00 y
4562 - define_bool CONFIG_SOC_AU1500 y
4563 + define_bool CONFIG_SOC_AU1550 y
4564 + define_bool CONFIG_NONCOHERENT_IO n
4565 + define_bool CONFIG_PC_KEYB y
4566 +fi
4567 +if [ "$CONFIG_MIPS_PB1200" = "y" ]; then
4568 + define_bool CONFIG_SOC_AU1X00 y
4569 + define_bool CONFIG_SOC_AU1200 y
4570 define_bool CONFIG_NONCOHERENT_IO y
4571 define_bool CONFIG_PC_KEYB y
4572 fi
4573 @@ -290,18 +311,24 @@
4574 define_bool CONFIG_NONCOHERENT_IO y
4575 define_bool CONFIG_PC_KEYB y
4576 fi
4577 +if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
4578 + define_bool CONFIG_SOC_AU1X00 y
4579 + define_bool CONFIG_SOC_AU1100 y
4580 + define_bool CONFIG_NONCOHERENT_IO y
4581 + define_bool CONFIG_PC_KEYB y
4582 + define_bool CONFIG_SWAP_IO_SPACE y
4583 +fi
4584 if [ "$CONFIG_MIPS_DB1550" = "y" ]; then
4585 define_bool CONFIG_SOC_AU1X00 y
4586 define_bool CONFIG_SOC_AU1550 y
4587 define_bool CONFIG_NONCOHERENT_IO y
4588 define_bool CONFIG_PC_KEYB y
4589 fi
4590 -if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
4591 +if [ "$CONFIG_MIPS_DB1200" = "y" ]; then
4592 define_bool CONFIG_SOC_AU1X00 y
4593 - define_bool CONFIG_SOC_AU1100 y
4594 + define_bool CONFIG_SOC_AU1200 y
4595 define_bool CONFIG_NONCOHERENT_IO y
4596 define_bool CONFIG_PC_KEYB y
4597 - define_bool CONFIG_SWAP_IO_SPACE y
4598 fi
4599 if [ "$CONFIG_MIPS_HYDROGEN3" = "y" ]; then
4600 define_bool CONFIG_SOC_AU1X00 y
4601 @@ -327,12 +354,6 @@
4602 define_bool CONFIG_NONCOHERENT_IO y
4603 define_bool CONFIG_PC_KEYB y
4604 fi
4605 -if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
4606 - define_bool CONFIG_SOC_AU1X00 y
4607 - define_bool CONFIG_SOC_AU1550 y
4608 - define_bool CONFIG_NONCOHERENT_IO n
4609 - define_bool CONFIG_PC_KEYB y
4610 -fi
4611 if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
4612 define_bool CONFIG_BOOT_ELF32 y
4613 define_bool CONFIG_COBALT_LCD y
4614 @@ -729,6 +750,13 @@
4615 "$CONFIG_MIPS_PB1000" = "y" -o \
4616 "$CONFIG_MIPS_PB1100" = "y" -o \
4617 "$CONFIG_MIPS_PB1500" = "y" -o \
4618 + "$CONFIG_MIPS_PB1550" = "y" -o \
4619 + "$CONFIG_MIPS_PB1200" = "y" -o \
4620 + "$CONFIG_MIPS_DB1000" = "y" -o \
4621 + "$CONFIG_MIPS_DB1100" = "y" -o \
4622 + "$CONFIG_MIPS_DB1500" = "y" -o \
4623 + "$CONFIG_MIPS_DB1550" = "y" -o \
4624 + "$CONFIG_MIPS_DB1200" = "y" -o \
4625 "$CONFIG_NEC_OSPREY" = "y" -o \
4626 "$CONFIG_NEC_EAGLE" = "y" -o \
4627 "$CONFIG_NINO" = "y" -o \
4628 diff -Nur linux-2.4.29/arch/mips/defconfig linux-mips/arch/mips/defconfig
4629 --- linux-2.4.29/arch/mips/defconfig 2005-01-19 15:09:27.000000000 +0100
4630 +++ linux-mips/arch/mips/defconfig 2005-03-26 11:47:13.509434535 +0100
4631 @@ -30,8 +30,8 @@
4632 # CONFIG_MIPS_PB1000 is not set
4633 # CONFIG_MIPS_PB1100 is not set
4634 # CONFIG_MIPS_PB1500 is not set
4635 -# CONFIG_MIPS_HYDROGEN3 is not set
4636 # CONFIG_MIPS_PB1550 is not set
4637 +# CONFIG_MIPS_HYDROGEN3 is not set
4638 # CONFIG_MIPS_XXS1500 is not set
4639 # CONFIG_MIPS_MTX1 is not set
4640 # CONFIG_COGENT_CSB250 is not set
4641 @@ -235,11 +235,6 @@
4642 #
4643 # CONFIG_IPX is not set
4644 # CONFIG_ATALK is not set
4645 -
4646 -#
4647 -# Appletalk devices
4648 -#
4649 -# CONFIG_DEV_APPLETALK is not set
4650 # CONFIG_DECNET is not set
4651 # CONFIG_BRIDGE is not set
4652 # CONFIG_X25 is not set
4653 @@ -319,9 +314,11 @@
4654 # CONFIG_SCSI_MEGARAID is not set
4655 # CONFIG_SCSI_MEGARAID2 is not set
4656 # CONFIG_SCSI_SATA is not set
4657 +# CONFIG_SCSI_SATA_AHCI is not set
4658 # CONFIG_SCSI_SATA_SVW is not set
4659 # CONFIG_SCSI_ATA_PIIX is not set
4660 # CONFIG_SCSI_SATA_NV is not set
4661 +# CONFIG_SCSI_SATA_QSTOR is not set
4662 # CONFIG_SCSI_SATA_PROMISE is not set
4663 # CONFIG_SCSI_SATA_SX4 is not set
4664 # CONFIG_SCSI_SATA_SIL is not set
4665 @@ -465,7 +462,6 @@
4666 # CONFIG_SERIAL is not set
4667 # CONFIG_SERIAL_EXTENDED is not set
4668 # CONFIG_SERIAL_NONSTANDARD is not set
4669 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4670 CONFIG_UNIX98_PTYS=y
4671 CONFIG_UNIX98_PTY_COUNT=256
4672
4673 diff -Nur linux-2.4.29/arch/mips/defconfig-atlas linux-mips/arch/mips/defconfig-atlas
4674 --- linux-2.4.29/arch/mips/defconfig-atlas 2005-01-19 15:09:27.000000000 +0100
4675 +++ linux-mips/arch/mips/defconfig-atlas 2005-03-26 11:47:13.579423048 +0100
4676 @@ -28,8 +28,8 @@
4677 # CONFIG_MIPS_PB1000 is not set
4678 # CONFIG_MIPS_PB1100 is not set
4679 # CONFIG_MIPS_PB1500 is not set
4680 -# CONFIG_MIPS_HYDROGEN3 is not set
4681 # CONFIG_MIPS_PB1550 is not set
4682 +# CONFIG_MIPS_HYDROGEN3 is not set
4683 # CONFIG_MIPS_XXS1500 is not set
4684 # CONFIG_MIPS_MTX1 is not set
4685 # CONFIG_COGENT_CSB250 is not set
4686 @@ -235,11 +235,6 @@
4687 #
4688 # CONFIG_IPX is not set
4689 # CONFIG_ATALK is not set
4690 -
4691 -#
4692 -# Appletalk devices
4693 -#
4694 -# CONFIG_DEV_APPLETALK is not set
4695 # CONFIG_DECNET is not set
4696 # CONFIG_BRIDGE is not set
4697 # CONFIG_X25 is not set
4698 @@ -317,9 +312,11 @@
4699 # CONFIG_SCSI_MEGARAID is not set
4700 # CONFIG_SCSI_MEGARAID2 is not set
4701 # CONFIG_SCSI_SATA is not set
4702 +# CONFIG_SCSI_SATA_AHCI is not set
4703 # CONFIG_SCSI_SATA_SVW is not set
4704 # CONFIG_SCSI_ATA_PIIX is not set
4705 # CONFIG_SCSI_SATA_NV is not set
4706 +# CONFIG_SCSI_SATA_QSTOR is not set
4707 # CONFIG_SCSI_SATA_PROMISE is not set
4708 # CONFIG_SCSI_SATA_SX4 is not set
4709 # CONFIG_SCSI_SATA_SIL is not set
4710 @@ -528,7 +525,6 @@
4711 CONFIG_SERIAL_CONSOLE=y
4712 # CONFIG_SERIAL_EXTENDED is not set
4713 # CONFIG_SERIAL_NONSTANDARD is not set
4714 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4715 CONFIG_UNIX98_PTYS=y
4716 CONFIG_UNIX98_PTY_COUNT=256
4717
4718 diff -Nur linux-2.4.29/arch/mips/defconfig-bosporus linux-mips/arch/mips/defconfig-bosporus
4719 --- linux-2.4.29/arch/mips/defconfig-bosporus 2005-01-19 15:09:27.000000000 +0100
4720 +++ linux-mips/arch/mips/defconfig-bosporus 2005-03-26 11:47:13.674407459 +0100
4721 @@ -30,8 +30,8 @@
4722 # CONFIG_MIPS_PB1000 is not set
4723 # CONFIG_MIPS_PB1100 is not set
4724 # CONFIG_MIPS_PB1500 is not set
4725 -# CONFIG_MIPS_HYDROGEN3 is not set
4726 # CONFIG_MIPS_PB1550 is not set
4727 +# CONFIG_MIPS_HYDROGEN3 is not set
4728 # CONFIG_MIPS_XXS1500 is not set
4729 # CONFIG_MIPS_MTX1 is not set
4730 # CONFIG_COGENT_CSB250 is not set
4731 @@ -208,9 +208,7 @@
4732 CONFIG_MTD_BOSPORUS=y
4733 # CONFIG_MTD_XXS1500 is not set
4734 # CONFIG_MTD_MTX1 is not set
4735 -# CONFIG_MTD_DB1X00 is not set
4736 # CONFIG_MTD_PB1550 is not set
4737 -# CONFIG_MTD_HYDROGEN3 is not set
4738 # CONFIG_MTD_MIRAGE is not set
4739 # CONFIG_MTD_CSTM_MIPS_IXX is not set
4740 # CONFIG_MTD_OCELOT is not set
4741 @@ -229,7 +227,6 @@
4742 #
4743 # Disk-On-Chip Device Drivers
4744 #
4745 -# CONFIG_MTD_DOC1000 is not set
4746 # CONFIG_MTD_DOC2000 is not set
4747 # CONFIG_MTD_DOC2001 is not set
4748 # CONFIG_MTD_DOCPROBE is not set
4749 @@ -373,11 +370,6 @@
4750 #
4751 # CONFIG_IPX is not set
4752 # CONFIG_ATALK is not set
4753 -
4754 -#
4755 -# Appletalk devices
4756 -#
4757 -# CONFIG_DEV_APPLETALK is not set
4758 # CONFIG_DECNET is not set
4759 # CONFIG_BRIDGE is not set
4760 # CONFIG_X25 is not set
4761 @@ -457,9 +449,11 @@
4762 # CONFIG_SCSI_MEGARAID is not set
4763 # CONFIG_SCSI_MEGARAID2 is not set
4764 # CONFIG_SCSI_SATA is not set
4765 +# CONFIG_SCSI_SATA_AHCI is not set
4766 # CONFIG_SCSI_SATA_SVW is not set
4767 # CONFIG_SCSI_ATA_PIIX is not set
4768 # CONFIG_SCSI_SATA_NV is not set
4769 +# CONFIG_SCSI_SATA_QSTOR is not set
4770 # CONFIG_SCSI_SATA_PROMISE is not set
4771 # CONFIG_SCSI_SATA_SX4 is not set
4772 # CONFIG_SCSI_SATA_SIL is not set
4773 @@ -681,7 +675,6 @@
4774 # CONFIG_AU1X00_USB_TTY is not set
4775 # CONFIG_AU1X00_USB_RAW is not set
4776 # CONFIG_TXX927_SERIAL is not set
4777 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4778 CONFIG_UNIX98_PTYS=y
4779 CONFIG_UNIX98_PTY_COUNT=256
4780
4781 diff -Nur linux-2.4.29/arch/mips/defconfig-capcella linux-mips/arch/mips/defconfig-capcella
4782 --- linux-2.4.29/arch/mips/defconfig-capcella 2005-01-19 15:09:27.000000000 +0100
4783 +++ linux-mips/arch/mips/defconfig-capcella 2005-03-26 11:47:13.739396793 +0100
4784 @@ -30,8 +30,8 @@
4785 # CONFIG_MIPS_PB1000 is not set
4786 # CONFIG_MIPS_PB1100 is not set
4787 # CONFIG_MIPS_PB1500 is not set
4788 -# CONFIG_MIPS_HYDROGEN3 is not set
4789 # CONFIG_MIPS_PB1550 is not set
4790 +# CONFIG_MIPS_HYDROGEN3 is not set
4791 # CONFIG_MIPS_XXS1500 is not set
4792 # CONFIG_MIPS_MTX1 is not set
4793 # CONFIG_COGENT_CSB250 is not set
4794 @@ -228,11 +228,6 @@
4795 #
4796 # CONFIG_IPX is not set
4797 # CONFIG_ATALK is not set
4798 -
4799 -#
4800 -# Appletalk devices
4801 -#
4802 -# CONFIG_DEV_APPLETALK is not set
4803 # CONFIG_DECNET is not set
4804 # CONFIG_BRIDGE is not set
4805 # CONFIG_X25 is not set
4806 @@ -472,7 +467,6 @@
4807 CONFIG_SERIAL_CONSOLE=y
4808 # CONFIG_SERIAL_EXTENDED is not set
4809 # CONFIG_SERIAL_NONSTANDARD is not set
4810 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4811 # CONFIG_VR41XX_KIU is not set
4812 CONFIG_UNIX98_PTYS=y
4813 CONFIG_UNIX98_PTY_COUNT=256
4814 diff -Nur linux-2.4.29/arch/mips/defconfig-cobalt linux-mips/arch/mips/defconfig-cobalt
4815 --- linux-2.4.29/arch/mips/defconfig-cobalt 2005-01-19 15:09:28.000000000 +0100
4816 +++ linux-mips/arch/mips/defconfig-cobalt 2005-03-26 11:47:13.804386126 +0100
4817 @@ -28,8 +28,8 @@
4818 # CONFIG_MIPS_PB1000 is not set
4819 # CONFIG_MIPS_PB1100 is not set
4820 # CONFIG_MIPS_PB1500 is not set
4821 -# CONFIG_MIPS_HYDROGEN3 is not set
4822 # CONFIG_MIPS_PB1550 is not set
4823 +# CONFIG_MIPS_HYDROGEN3 is not set
4824 # CONFIG_MIPS_XXS1500 is not set
4825 # CONFIG_MIPS_MTX1 is not set
4826 # CONFIG_COGENT_CSB250 is not set
4827 @@ -222,11 +222,6 @@
4828 #
4829 # CONFIG_IPX is not set
4830 # CONFIG_ATALK is not set
4831 -
4832 -#
4833 -# Appletalk devices
4834 -#
4835 -# CONFIG_DEV_APPLETALK is not set
4836 # CONFIG_DECNET is not set
4837 # CONFIG_BRIDGE is not set
4838 # CONFIG_X25 is not set
4839 @@ -505,7 +500,6 @@
4840 CONFIG_SERIAL_CONSOLE=y
4841 # CONFIG_SERIAL_EXTENDED is not set
4842 # CONFIG_SERIAL_NONSTANDARD is not set
4843 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4844 CONFIG_UNIX98_PTYS=y
4845 CONFIG_UNIX98_PTY_COUNT=16
4846
4847 diff -Nur linux-2.4.29/arch/mips/defconfig-csb250 linux-mips/arch/mips/defconfig-csb250
4848 --- linux-2.4.29/arch/mips/defconfig-csb250 2005-01-19 15:09:28.000000000 +0100
4849 +++ linux-mips/arch/mips/defconfig-csb250 2005-03-26 11:47:13.887372506 +0100
4850 @@ -30,8 +30,8 @@
4851 # CONFIG_MIPS_PB1000 is not set
4852 # CONFIG_MIPS_PB1100 is not set
4853 # CONFIG_MIPS_PB1500 is not set
4854 -# CONFIG_MIPS_HYDROGEN3 is not set
4855 # CONFIG_MIPS_PB1550 is not set
4856 +# CONFIG_MIPS_HYDROGEN3 is not set
4857 # CONFIG_MIPS_XXS1500 is not set
4858 # CONFIG_MIPS_MTX1 is not set
4859 CONFIG_COGENT_CSB250=y
4860 @@ -268,11 +268,6 @@
4861 #
4862 # CONFIG_IPX is not set
4863 # CONFIG_ATALK is not set
4864 -
4865 -#
4866 -# Appletalk devices
4867 -#
4868 -# CONFIG_DEV_APPLETALK is not set
4869 # CONFIG_DECNET is not set
4870 # CONFIG_BRIDGE is not set
4871 # CONFIG_X25 is not set
4872 @@ -556,7 +551,6 @@
4873 # CONFIG_AU1X00_USB_TTY is not set
4874 # CONFIG_AU1X00_USB_RAW is not set
4875 # CONFIG_TXX927_SERIAL is not set
4876 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4877 CONFIG_UNIX98_PTYS=y
4878 CONFIG_UNIX98_PTY_COUNT=256
4879
4880 diff -Nur linux-2.4.29/arch/mips/defconfig-db1000 linux-mips/arch/mips/defconfig-db1000
4881 --- linux-2.4.29/arch/mips/defconfig-db1000 2005-01-19 15:09:28.000000000 +0100
4882 +++ linux-mips/arch/mips/defconfig-db1000 2005-03-26 11:47:13.987356097 +0100
4883 @@ -30,8 +30,8 @@
4884 # CONFIG_MIPS_PB1000 is not set
4885 # CONFIG_MIPS_PB1100 is not set
4886 # CONFIG_MIPS_PB1500 is not set
4887 -# CONFIG_MIPS_HYDROGEN3 is not set
4888 # CONFIG_MIPS_PB1550 is not set
4889 +# CONFIG_MIPS_HYDROGEN3 is not set
4890 # CONFIG_MIPS_XXS1500 is not set
4891 # CONFIG_MIPS_MTX1 is not set
4892 # CONFIG_COGENT_CSB250 is not set
4893 @@ -214,11 +214,7 @@
4894 # CONFIG_MTD_BOSPORUS is not set
4895 # CONFIG_MTD_XXS1500 is not set
4896 # CONFIG_MTD_MTX1 is not set
4897 -CONFIG_MTD_DB1X00=y
4898 -CONFIG_MTD_DB1X00_BOOT=y
4899 -CONFIG_MTD_DB1X00_USER=y
4900 # CONFIG_MTD_PB1550 is not set
4901 -# CONFIG_MTD_HYDROGEN3 is not set
4902 # CONFIG_MTD_MIRAGE is not set
4903 # CONFIG_MTD_CSTM_MIPS_IXX is not set
4904 # CONFIG_MTD_OCELOT is not set
4905 @@ -237,7 +233,6 @@
4906 #
4907 # Disk-On-Chip Device Drivers
4908 #
4909 -# CONFIG_MTD_DOC1000 is not set
4910 # CONFIG_MTD_DOC2000 is not set
4911 # CONFIG_MTD_DOC2001 is not set
4912 # CONFIG_MTD_DOCPROBE is not set
4913 @@ -342,11 +337,6 @@
4914 #
4915 # CONFIG_IPX is not set
4916 # CONFIG_ATALK is not set
4917 -
4918 -#
4919 -# Appletalk devices
4920 -#
4921 -# CONFIG_DEV_APPLETALK is not set
4922 # CONFIG_DECNET is not set
4923 # CONFIG_BRIDGE is not set
4924 # CONFIG_X25 is not set
4925 @@ -636,7 +626,6 @@
4926 # CONFIG_AU1X00_USB_TTY is not set
4927 # CONFIG_AU1X00_USB_RAW is not set
4928 # CONFIG_TXX927_SERIAL is not set
4929 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4930 CONFIG_UNIX98_PTYS=y
4931 CONFIG_UNIX98_PTY_COUNT=256
4932
4933 diff -Nur linux-2.4.29/arch/mips/defconfig-db1100 linux-mips/arch/mips/defconfig-db1100
4934 --- linux-2.4.29/arch/mips/defconfig-db1100 2005-01-19 15:09:28.000000000 +0100
4935 +++ linux-mips/arch/mips/defconfig-db1100 2005-03-26 11:47:14.088339523 +0100
4936 @@ -30,8 +30,8 @@
4937 # CONFIG_MIPS_PB1000 is not set
4938 # CONFIG_MIPS_PB1100 is not set
4939 # CONFIG_MIPS_PB1500 is not set
4940 -# CONFIG_MIPS_HYDROGEN3 is not set
4941 # CONFIG_MIPS_PB1550 is not set
4942 +# CONFIG_MIPS_HYDROGEN3 is not set
4943 # CONFIG_MIPS_XXS1500 is not set
4944 # CONFIG_MIPS_MTX1 is not set
4945 # CONFIG_COGENT_CSB250 is not set
4946 @@ -214,11 +214,7 @@
4947 # CONFIG_MTD_BOSPORUS is not set
4948 # CONFIG_MTD_XXS1500 is not set
4949 # CONFIG_MTD_MTX1 is not set
4950 -CONFIG_MTD_DB1X00=y
4951 -# CONFIG_MTD_DB1X00_BOOT is not set
4952 -CONFIG_MTD_DB1X00_USER=y
4953 # CONFIG_MTD_PB1550 is not set
4954 -# CONFIG_MTD_HYDROGEN3 is not set
4955 # CONFIG_MTD_MIRAGE is not set
4956 # CONFIG_MTD_CSTM_MIPS_IXX is not set
4957 # CONFIG_MTD_OCELOT is not set
4958 @@ -237,7 +233,6 @@
4959 #
4960 # Disk-On-Chip Device Drivers
4961 #
4962 -# CONFIG_MTD_DOC1000 is not set
4963 # CONFIG_MTD_DOC2000 is not set
4964 # CONFIG_MTD_DOC2001 is not set
4965 # CONFIG_MTD_DOCPROBE is not set
4966 @@ -342,11 +337,6 @@
4967 #
4968 # CONFIG_IPX is not set
4969 # CONFIG_ATALK is not set
4970 -
4971 -#
4972 -# Appletalk devices
4973 -#
4974 -# CONFIG_DEV_APPLETALK is not set
4975 # CONFIG_DECNET is not set
4976 # CONFIG_BRIDGE is not set
4977 # CONFIG_X25 is not set
4978 @@ -636,7 +626,6 @@
4979 # CONFIG_AU1X00_USB_TTY is not set
4980 # CONFIG_AU1X00_USB_RAW is not set
4981 # CONFIG_TXX927_SERIAL is not set
4982 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
4983 CONFIG_UNIX98_PTYS=y
4984 CONFIG_UNIX98_PTY_COUNT=256
4985
4986 @@ -884,6 +873,7 @@
4987 # CONFIG_FB_PM2 is not set
4988 # CONFIG_FB_PM3 is not set
4989 # CONFIG_FB_CYBER2000 is not set
4990 +CONFIG_FB_AU1100=y
4991 # CONFIG_FB_MATROX is not set
4992 # CONFIG_FB_ATY is not set
4993 # CONFIG_FB_RADEON is not set
4994 @@ -895,7 +885,6 @@
4995 # CONFIG_FB_VOODOO1 is not set
4996 # CONFIG_FB_TRIDENT is not set
4997 # CONFIG_FB_E1356 is not set
4998 -CONFIG_FB_AU1100=y
4999 # CONFIG_FB_IT8181 is not set
5000 # CONFIG_FB_VIRTUAL is not set
5001 CONFIG_FBCON_ADVANCED=y
5002 diff -Nur linux-2.4.29/arch/mips/defconfig-db1200 linux-mips/arch/mips/defconfig-db1200
5003 --- linux-2.4.29/arch/mips/defconfig-db1200 1970-01-01 01:00:00.000000000 +0100
5004 +++ linux-mips/arch/mips/defconfig-db1200 2005-03-26 11:47:14.182324098 +0100
5005 @@ -0,0 +1,1032 @@
5006 +#
5007 +# Automatically generated make config: don't edit
5008 +#
5009 +CONFIG_MIPS=y
5010 +CONFIG_MIPS32=y
5011 +# CONFIG_MIPS64 is not set
5012 +
5013 +#
5014 +# Code maturity level options
5015 +#
5016 +CONFIG_EXPERIMENTAL=y
5017 +
5018 +#
5019 +# Loadable module support
5020 +#
5021 +CONFIG_MODULES=y
5022 +# CONFIG_MODVERSIONS is not set
5023 +CONFIG_KMOD=y
5024 +
5025 +#
5026 +# Machine selection
5027 +#
5028 +# CONFIG_ACER_PICA_61 is not set
5029 +# CONFIG_MIPS_BOSPORUS is not set
5030 +# CONFIG_MIPS_MIRAGE is not set
5031 +# CONFIG_MIPS_DB1000 is not set
5032 +# CONFIG_MIPS_DB1100 is not set
5033 +# CONFIG_MIPS_DB1500 is not set
5034 +# CONFIG_MIPS_DB1550 is not set
5035 +# CONFIG_MIPS_PB1000 is not set
5036 +# CONFIG_MIPS_PB1100 is not set
5037 +# CONFIG_MIPS_PB1500 is not set
5038 +# CONFIG_MIPS_PB1550 is not set
5039 +# CONFIG_MIPS_HYDROGEN3 is not set
5040 +# CONFIG_MIPS_XXS1500 is not set
5041 +# CONFIG_MIPS_MTX1 is not set
5042 +# CONFIG_COGENT_CSB250 is not set
5043 +# CONFIG_BAGET_MIPS is not set
5044 +# CONFIG_CASIO_E55 is not set
5045 +# CONFIG_MIPS_COBALT is not set
5046 +# CONFIG_DECSTATION is not set
5047 +# CONFIG_MIPS_EV64120 is not set
5048 +# CONFIG_MIPS_EV96100 is not set
5049 +# CONFIG_MIPS_IVR is not set
5050 +# CONFIG_HP_LASERJET is not set
5051 +# CONFIG_IBM_WORKPAD is not set
5052 +# CONFIG_LASAT is not set
5053 +# CONFIG_MIPS_ITE8172 is not set
5054 +# CONFIG_MIPS_ATLAS is not set
5055 +# CONFIG_MIPS_MAGNUM_4000 is not set
5056 +# CONFIG_MIPS_MALTA is not set
5057 +# CONFIG_MIPS_SEAD is not set
5058 +# CONFIG_MOMENCO_OCELOT is not set
5059 +# CONFIG_MOMENCO_OCELOT_G is not set
5060 +# CONFIG_MOMENCO_OCELOT_C is not set
5061 +# CONFIG_MOMENCO_JAGUAR_ATX is not set
5062 +# CONFIG_PMC_BIG_SUR is not set
5063 +# CONFIG_PMC_STRETCH is not set
5064 +# CONFIG_PMC_YOSEMITE is not set
5065 +# CONFIG_DDB5074 is not set
5066 +# CONFIG_DDB5476 is not set
5067 +# CONFIG_DDB5477 is not set
5068 +# CONFIG_NEC_OSPREY is not set
5069 +# CONFIG_NEC_EAGLE is not set
5070 +# CONFIG_OLIVETTI_M700 is not set
5071 +# CONFIG_NINO is not set
5072 +# CONFIG_SGI_IP22 is not set
5073 +# CONFIG_SGI_IP27 is not set
5074 +# CONFIG_SIBYTE_SB1xxx_SOC is not set
5075 +# CONFIG_SNI_RM200_PCI is not set
5076 +# CONFIG_TANBAC_TB0226 is not set
5077 +# CONFIG_TANBAC_TB0229 is not set
5078 +# CONFIG_TOSHIBA_JMR3927 is not set
5079 +# CONFIG_TOSHIBA_RBTX4927 is not set
5080 +# CONFIG_VICTOR_MPC30X is not set
5081 +# CONFIG_ZAO_CAPCELLA is not set
5082 +# CONFIG_HIGHMEM is not set
5083 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
5084 +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
5085 +# CONFIG_MIPS_AU1000 is not set
5086 +
5087 +#
5088 +# CPU selection
5089 +#
5090 +CONFIG_CPU_MIPS32=y
5091 +# CONFIG_CPU_MIPS64 is not set
5092 +# CONFIG_CPU_R3000 is not set
5093 +# CONFIG_CPU_TX39XX is not set
5094 +# CONFIG_CPU_VR41XX is not set
5095 +# CONFIG_CPU_R4300 is not set
5096 +# CONFIG_CPU_R4X00 is not set
5097 +# CONFIG_CPU_TX49XX is not set
5098 +# CONFIG_CPU_R5000 is not set
5099 +# CONFIG_CPU_R5432 is not set
5100 +# CONFIG_CPU_R6000 is not set
5101 +# CONFIG_CPU_NEVADA is not set
5102 +# CONFIG_CPU_R8000 is not set
5103 +# CONFIG_CPU_R10000 is not set
5104 +# CONFIG_CPU_RM7000 is not set
5105 +# CONFIG_CPU_RM9000 is not set
5106 +# CONFIG_CPU_SB1 is not set
5107 +CONFIG_PAGE_SIZE_4KB=y
5108 +# CONFIG_PAGE_SIZE_16KB is not set
5109 +# CONFIG_PAGE_SIZE_64KB is not set
5110 +CONFIG_CPU_HAS_PREFETCH=y
5111 +# CONFIG_VTAG_ICACHE is not set
5112 +CONFIG_64BIT_PHYS_ADDR=y
5113 +# CONFIG_CPU_ADVANCED is not set
5114 +CONFIG_CPU_HAS_LLSC=y
5115 +# CONFIG_CPU_HAS_LLDSCD is not set
5116 +# CONFIG_CPU_HAS_WB is not set
5117 +CONFIG_CPU_HAS_SYNC=y
5118 +
5119 +#
5120 +# General setup
5121 +#
5122 +CONFIG_CPU_LITTLE_ENDIAN=y
5123 +# CONFIG_BUILD_ELF64 is not set
5124 +CONFIG_NET=y
5125 +CONFIG_PCI=y
5126 +CONFIG_PCI_NEW=y
5127 +CONFIG_PCI_AUTO=y
5128 +# CONFIG_PCI_NAMES is not set
5129 +# CONFIG_ISA is not set
5130 +# CONFIG_TC is not set
5131 +# CONFIG_MCA is not set
5132 +# CONFIG_SBUS is not set
5133 +CONFIG_HOTPLUG=y
5134 +
5135 +#
5136 +# PCMCIA/CardBus support
5137 +#
5138 +CONFIG_PCMCIA=m
5139 +# CONFIG_CARDBUS is not set
5140 +# CONFIG_TCIC is not set
5141 +# CONFIG_I82092 is not set
5142 +# CONFIG_I82365 is not set
5143 +
5144 +#
5145 +# PCI Hotplug Support
5146 +#
5147 +# CONFIG_HOTPLUG_PCI is not set
5148 +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
5149 +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
5150 +# CONFIG_HOTPLUG_PCI_SHPC is not set
5151 +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
5152 +# CONFIG_HOTPLUG_PCI_PCIE is not set
5153 +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
5154 +CONFIG_SYSVIPC=y
5155 +# CONFIG_BSD_PROCESS_ACCT is not set
5156 +CONFIG_SYSCTL=y
5157 +CONFIG_KCORE_ELF=y
5158 +# CONFIG_KCORE_AOUT is not set
5159 +# CONFIG_BINFMT_AOUT is not set
5160 +CONFIG_BINFMT_ELF=y
5161 +# CONFIG_MIPS32_COMPAT is not set
5162 +# CONFIG_MIPS32_O32 is not set
5163 +# CONFIG_MIPS32_N32 is not set
5164 +# CONFIG_BINFMT_ELF32 is not set
5165 +# CONFIG_BINFMT_MISC is not set
5166 +# CONFIG_OOM_KILLER is not set
5167 +CONFIG_CMDLINE_BOOL=y
5168 +CONFIG_CMDLINE="mem=96M"
5169 +
5170 +#
5171 +# Memory Technology Devices (MTD)
5172 +#
5173 +# CONFIG_MTD is not set
5174 +
5175 +#
5176 +# Parallel port support
5177 +#
5178 +# CONFIG_PARPORT is not set
5179 +
5180 +#
5181 +# Plug and Play configuration
5182 +#
5183 +# CONFIG_PNP is not set
5184 +# CONFIG_ISAPNP is not set
5185 +
5186 +#
5187 +# Block devices
5188 +#
5189 +# CONFIG_BLK_DEV_FD is not set
5190 +# CONFIG_BLK_DEV_XD is not set
5191 +# CONFIG_PARIDE is not set
5192 +# CONFIG_BLK_CPQ_DA is not set
5193 +# CONFIG_BLK_CPQ_CISS_DA is not set
5194 +# CONFIG_CISS_SCSI_TAPE is not set
5195 +# CONFIG_CISS_MONITOR_THREAD is not set
5196 +# CONFIG_BLK_DEV_DAC960 is not set
5197 +# CONFIG_BLK_DEV_UMEM is not set
5198 +# CONFIG_BLK_DEV_SX8 is not set
5199 +CONFIG_BLK_DEV_LOOP=y
5200 +# CONFIG_BLK_DEV_NBD is not set
5201 +# CONFIG_BLK_DEV_RAM is not set
5202 +# CONFIG_BLK_DEV_INITRD is not set
5203 +# CONFIG_BLK_STATS is not set
5204 +
5205 +#
5206 +# Multi-device support (RAID and LVM)
5207 +#
5208 +# CONFIG_MD is not set
5209 +# CONFIG_BLK_DEV_MD is not set
5210 +# CONFIG_MD_LINEAR is not set
5211 +# CONFIG_MD_RAID0 is not set
5212 +# CONFIG_MD_RAID1 is not set
5213 +# CONFIG_MD_RAID5 is not set
5214 +# CONFIG_MD_MULTIPATH is not set
5215 +# CONFIG_BLK_DEV_LVM is not set
5216 +
5217 +#
5218 +# Networking options
5219 +#
5220 +CONFIG_PACKET=y
5221 +# CONFIG_PACKET_MMAP is not set
5222 +# CONFIG_NETLINK_DEV is not set
5223 +CONFIG_NETFILTER=y
5224 +# CONFIG_NETFILTER_DEBUG is not set
5225 +CONFIG_FILTER=y
5226 +CONFIG_UNIX=y
5227 +CONFIG_INET=y
5228 +CONFIG_IP_MULTICAST=y
5229 +# CONFIG_IP_ADVANCED_ROUTER is not set
5230 +CONFIG_IP_PNP=y
5231 +# CONFIG_IP_PNP_DHCP is not set
5232 +CONFIG_IP_PNP_BOOTP=y
5233 +# CONFIG_IP_PNP_RARP is not set
5234 +# CONFIG_NET_IPIP is not set
5235 +# CONFIG_NET_IPGRE is not set
5236 +# CONFIG_IP_MROUTE is not set
5237 +# CONFIG_ARPD is not set
5238 +# CONFIG_INET_ECN is not set
5239 +# CONFIG_SYN_COOKIES is not set
5240 +
5241 +#
5242 +# IP: Netfilter Configuration
5243 +#
5244 +# CONFIG_IP_NF_CONNTRACK is not set
5245 +# CONFIG_IP_NF_QUEUE is not set
5246 +# CONFIG_IP_NF_IPTABLES is not set
5247 +# CONFIG_IP_NF_ARPTABLES is not set
5248 +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
5249 +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
5250 +
5251 +#
5252 +# IP: Virtual Server Configuration
5253 +#
5254 +# CONFIG_IP_VS is not set
5255 +# CONFIG_IPV6 is not set
5256 +# CONFIG_KHTTPD is not set
5257 +
5258 +#
5259 +# SCTP Configuration (EXPERIMENTAL)
5260 +#
5261 +# CONFIG_IP_SCTP is not set
5262 +# CONFIG_ATM is not set
5263 +# CONFIG_VLAN_8021Q is not set
5264 +
5265 +#
5266 +#
5267 +#
5268 +# CONFIG_IPX is not set
5269 +# CONFIG_ATALK is not set
5270 +# CONFIG_DECNET is not set
5271 +# CONFIG_BRIDGE is not set
5272 +# CONFIG_X25 is not set
5273 +# CONFIG_LAPB is not set
5274 +# CONFIG_LLC is not set
5275 +# CONFIG_NET_DIVERT is not set
5276 +# CONFIG_ECONET is not set
5277 +# CONFIG_WAN_ROUTER is not set
5278 +# CONFIG_NET_FASTROUTE is not set
5279 +# CONFIG_NET_HW_FLOWCONTROL is not set
5280 +
5281 +#
5282 +# QoS and/or fair queueing
5283 +#
5284 +# CONFIG_NET_SCHED is not set
5285 +
5286 +#
5287 +# Network testing
5288 +#
5289 +# CONFIG_NET_PKTGEN is not set
5290 +
5291 +#
5292 +# Telephony Support
5293 +#
5294 +# CONFIG_PHONE is not set
5295 +# CONFIG_PHONE_IXJ is not set
5296 +# CONFIG_PHONE_IXJ_PCMCIA is not set
5297 +
5298 +#
5299 +# ATA/IDE/MFM/RLL support
5300 +#
5301 +CONFIG_IDE=y
5302 +
5303 +#
5304 +# IDE, ATA and ATAPI Block devices
5305 +#
5306 +CONFIG_BLK_DEV_IDE=y
5307 +
5308 +#
5309 +# Please see Documentation/ide.txt for help/info on IDE drives
5310 +#
5311 +# CONFIG_BLK_DEV_HD_IDE is not set
5312 +# CONFIG_BLK_DEV_HD is not set
5313 +# CONFIG_BLK_DEV_IDE_SATA is not set
5314 +CONFIG_BLK_DEV_IDEDISK=y
5315 +CONFIG_IDEDISK_MULTI_MODE=y
5316 +CONFIG_IDEDISK_STROKE=y
5317 +CONFIG_BLK_DEV_IDECS=m
5318 +# CONFIG_BLK_DEV_DELKIN is not set
5319 +# CONFIG_BLK_DEV_IDECD is not set
5320 +# CONFIG_BLK_DEV_IDETAPE is not set
5321 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
5322 +# CONFIG_BLK_DEV_IDESCSI is not set
5323 +# CONFIG_IDE_TASK_IOCTL is not set
5324 +
5325 +#
5326 +# IDE chipset support/bugfixes
5327 +#
5328 +# CONFIG_BLK_DEV_CMD640 is not set
5329 +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
5330 +# CONFIG_BLK_DEV_ISAPNP is not set
5331 +# CONFIG_BLK_DEV_IDEPCI is not set
5332 +# CONFIG_IDE_CHIPSETS is not set
5333 +# CONFIG_IDEDMA_AUTO is not set
5334 +# CONFIG_DMA_NONPCI is not set
5335 +# CONFIG_BLK_DEV_ATARAID is not set
5336 +# CONFIG_BLK_DEV_ATARAID_PDC is not set
5337 +# CONFIG_BLK_DEV_ATARAID_HPT is not set
5338 +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
5339 +# CONFIG_BLK_DEV_ATARAID_SII is not set
5340 +
5341 +#
5342 +# SCSI support
5343 +#
5344 +CONFIG_SCSI=y
5345 +
5346 +#
5347 +# SCSI support type (disk, tape, CD-ROM)
5348 +#
5349 +CONFIG_BLK_DEV_SD=y
5350 +CONFIG_SD_EXTRA_DEVS=40
5351 +CONFIG_CHR_DEV_ST=y
5352 +# CONFIG_CHR_DEV_OSST is not set
5353 +CONFIG_BLK_DEV_SR=y
5354 +# CONFIG_BLK_DEV_SR_VENDOR is not set
5355 +CONFIG_SR_EXTRA_DEVS=2
5356 +# CONFIG_CHR_DEV_SG is not set
5357 +
5358 +#
5359 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
5360 +#
5361 +# CONFIG_SCSI_DEBUG_QUEUES is not set
5362 +# CONFIG_SCSI_MULTI_LUN is not set
5363 +CONFIG_SCSI_CONSTANTS=y
5364 +# CONFIG_SCSI_LOGGING is not set
5365 +
5366 +#
5367 +# SCSI low-level drivers
5368 +#
5369 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
5370 +# CONFIG_SCSI_7000FASST is not set
5371 +# CONFIG_SCSI_ACARD is not set
5372 +# CONFIG_SCSI_AHA152X is not set
5373 +# CONFIG_SCSI_AHA1542 is not set
5374 +# CONFIG_SCSI_AHA1740 is not set
5375 +# CONFIG_SCSI_AACRAID is not set
5376 +# CONFIG_SCSI_AIC7XXX is not set
5377 +# CONFIG_SCSI_AIC79XX is not set
5378 +# CONFIG_SCSI_AIC7XXX_OLD is not set
5379 +# CONFIG_SCSI_DPT_I2O is not set
5380 +# CONFIG_SCSI_ADVANSYS is not set
5381 +# CONFIG_SCSI_IN2000 is not set
5382 +# CONFIG_SCSI_AM53C974 is not set
5383 +# CONFIG_SCSI_MEGARAID is not set
5384 +# CONFIG_SCSI_MEGARAID2 is not set
5385 +# CONFIG_SCSI_SATA is not set
5386 +# CONFIG_SCSI_SATA_AHCI is not set
5387 +# CONFIG_SCSI_SATA_SVW is not set
5388 +# CONFIG_SCSI_ATA_PIIX is not set
5389 +# CONFIG_SCSI_SATA_NV is not set
5390 +# CONFIG_SCSI_SATA_QSTOR is not set
5391 +# CONFIG_SCSI_SATA_PROMISE is not set
5392 +# CONFIG_SCSI_SATA_SX4 is not set
5393 +# CONFIG_SCSI_SATA_SIL is not set
5394 +# CONFIG_SCSI_SATA_SIS is not set
5395 +# CONFIG_SCSI_SATA_ULI is not set
5396 +# CONFIG_SCSI_SATA_VIA is not set
5397 +# CONFIG_SCSI_SATA_VITESSE is not set
5398 +# CONFIG_SCSI_BUSLOGIC is not set
5399 +# CONFIG_SCSI_CPQFCTS is not set
5400 +# CONFIG_SCSI_DMX3191D is not set
5401 +# CONFIG_SCSI_DTC3280 is not set
5402 +# CONFIG_SCSI_EATA is not set
5403 +# CONFIG_SCSI_EATA_DMA is not set
5404 +# CONFIG_SCSI_EATA_PIO is not set
5405 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
5406 +# CONFIG_SCSI_GDTH is not set
5407 +# CONFIG_SCSI_GENERIC_NCR5380 is not set
5408 +# CONFIG_SCSI_INITIO is not set
5409 +# CONFIG_SCSI_INIA100 is not set
5410 +# CONFIG_SCSI_NCR53C406A is not set
5411 +# CONFIG_SCSI_NCR53C7xx is not set
5412 +# CONFIG_SCSI_SYM53C8XX_2 is not set
5413 +# CONFIG_SCSI_NCR53C8XX is not set
5414 +# CONFIG_SCSI_SYM53C8XX is not set
5415 +# CONFIG_SCSI_PAS16 is not set
5416 +# CONFIG_SCSI_PCI2000 is not set
5417 +# CONFIG_SCSI_PCI2220I is not set
5418 +# CONFIG_SCSI_PSI240I is not set
5419 +# CONFIG_SCSI_QLOGIC_FAS is not set
5420 +# CONFIG_SCSI_QLOGIC_ISP is not set
5421 +# CONFIG_SCSI_QLOGIC_FC is not set
5422 +# CONFIG_SCSI_QLOGIC_1280 is not set
5423 +# CONFIG_SCSI_SIM710 is not set
5424 +# CONFIG_SCSI_SYM53C416 is not set
5425 +# CONFIG_SCSI_DC390T is not set
5426 +# CONFIG_SCSI_T128 is not set
5427 +# CONFIG_SCSI_U14_34F is not set
5428 +# CONFIG_SCSI_NSP32 is not set
5429 +# CONFIG_SCSI_DEBUG is not set
5430 +
5431 +#
5432 +# PCMCIA SCSI adapter support
5433 +#
5434 +# CONFIG_SCSI_PCMCIA is not set
5435 +
5436 +#
5437 +# Fusion MPT device support
5438 +#
5439 +# CONFIG_FUSION is not set
5440 +# CONFIG_FUSION_BOOT is not set
5441 +# CONFIG_FUSION_ISENSE is not set
5442 +# CONFIG_FUSION_CTL is not set
5443 +# CONFIG_FUSION_LAN is not set
5444 +
5445 +#
5446 +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
5447 +#
5448 +# CONFIG_IEEE1394 is not set
5449 +
5450 +#
5451 +# I2O device support
5452 +#
5453 +# CONFIG_I2O is not set
5454 +# CONFIG_I2O_PCI is not set
5455 +# CONFIG_I2O_BLOCK is not set
5456 +# CONFIG_I2O_LAN is not set
5457 +# CONFIG_I2O_SCSI is not set
5458 +# CONFIG_I2O_PROC is not set
5459 +
5460 +#
5461 +# Network device support
5462 +#
5463 +CONFIG_NETDEVICES=y
5464 +
5465 +#
5466 +# ARCnet devices
5467 +#
5468 +# CONFIG_ARCNET is not set
5469 +# CONFIG_DUMMY is not set
5470 +# CONFIG_BONDING is not set
5471 +# CONFIG_EQUALIZER is not set
5472 +# CONFIG_TUN is not set
5473 +# CONFIG_ETHERTAP is not set
5474 +
5475 +#
5476 +# Ethernet (10 or 100Mbit)
5477 +#
5478 +CONFIG_NET_ETHERNET=y
5479 +# CONFIG_SUNLANCE is not set
5480 +# CONFIG_HAPPYMEAL is not set
5481 +# CONFIG_SUNBMAC is not set
5482 +# CONFIG_SUNQE is not set
5483 +# CONFIG_SUNGEM is not set
5484 +# CONFIG_NET_VENDOR_3COM is not set
5485 +# CONFIG_LANCE is not set
5486 +# CONFIG_NET_VENDOR_SMC is not set
5487 +# CONFIG_NET_VENDOR_RACAL is not set
5488 +# CONFIG_HP100 is not set
5489 +# CONFIG_NET_ISA is not set
5490 +# CONFIG_NET_PCI is not set
5491 +# CONFIG_NET_POCKET is not set
5492 +
5493 +#
5494 +# Ethernet (1000 Mbit)
5495 +#
5496 +# CONFIG_ACENIC is not set
5497 +# CONFIG_DL2K is not set
5498 +# CONFIG_E1000 is not set
5499 +# CONFIG_MYRI_SBUS is not set
5500 +# CONFIG_NS83820 is not set
5501 +# CONFIG_HAMACHI is not set
5502 +# CONFIG_YELLOWFIN is not set
5503 +# CONFIG_R8169 is not set
5504 +# CONFIG_SK98LIN is not set
5505 +# CONFIG_TIGON3 is not set
5506 +# CONFIG_FDDI is not set
5507 +# CONFIG_HIPPI is not set
5508 +# CONFIG_PLIP is not set
5509 +# CONFIG_PPP is not set
5510 +# CONFIG_SLIP is not set
5511 +
5512 +#
5513 +# Wireless LAN (non-hamradio)
5514 +#
5515 +# CONFIG_NET_RADIO is not set
5516 +
5517 +#
5518 +# Token Ring devices
5519 +#
5520 +# CONFIG_TR is not set
5521 +# CONFIG_NET_FC is not set
5522 +# CONFIG_RCPCI is not set
5523 +# CONFIG_SHAPER is not set
5524 +
5525 +#
5526 +# Wan interfaces
5527 +#
5528 +# CONFIG_WAN is not set
5529 +
5530 +#
5531 +# PCMCIA network device support
5532 +#
5533 +# CONFIG_NET_PCMCIA is not set
5534 +
5535 +#
5536 +# Amateur Radio support
5537 +#
5538 +# CONFIG_HAMRADIO is not set
5539 +
5540 +#
5541 +# IrDA (infrared) support
5542 +#
5543 +# CONFIG_IRDA is not set
5544 +
5545 +#
5546 +# ISDN subsystem
5547 +#
5548 +# CONFIG_ISDN is not set
5549 +
5550 +#
5551 +# Input core support
5552 +#
5553 +CONFIG_INPUT=y
5554 +CONFIG_INPUT_KEYBDEV=y
5555 +CONFIG_INPUT_MOUSEDEV=y
5556 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
5557 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
5558 +# CONFIG_INPUT_JOYDEV is not set
5559 +CONFIG_INPUT_EVDEV=y
5560 +# CONFIG_INPUT_UINPUT is not set
5561 +
5562 +#
5563 +# Character devices
5564 +#
5565 +CONFIG_VT=y
5566 +# CONFIG_VT_CONSOLE is not set
5567 +# CONFIG_SERIAL is not set
5568 +# CONFIG_SERIAL_EXTENDED is not set
5569 +CONFIG_SERIAL_NONSTANDARD=y
5570 +# CONFIG_COMPUTONE is not set
5571 +# CONFIG_ROCKETPORT is not set
5572 +# CONFIG_CYCLADES is not set
5573 +# CONFIG_DIGIEPCA is not set
5574 +# CONFIG_DIGI is not set
5575 +# CONFIG_ESPSERIAL is not set
5576 +# CONFIG_MOXA_INTELLIO is not set
5577 +# CONFIG_MOXA_SMARTIO is not set
5578 +# CONFIG_ISI is not set
5579 +# CONFIG_SYNCLINK is not set
5580 +# CONFIG_SYNCLINKMP is not set
5581 +# CONFIG_N_HDLC is not set
5582 +# CONFIG_RISCOM8 is not set
5583 +# CONFIG_SPECIALIX is not set
5584 +# CONFIG_SX is not set
5585 +# CONFIG_RIO is not set
5586 +# CONFIG_STALDRV is not set
5587 +# CONFIG_SERIAL_TX3912 is not set
5588 +# CONFIG_SERIAL_TX3912_CONSOLE is not set
5589 +# CONFIG_SERIAL_TXX9 is not set
5590 +# CONFIG_SERIAL_TXX9_CONSOLE is not set
5591 +# CONFIG_TXX927_SERIAL is not set
5592 +CONFIG_UNIX98_PTYS=y
5593 +CONFIG_UNIX98_PTY_COUNT=256
5594 +
5595 +#
5596 +# I2C support
5597 +#
5598 +# CONFIG_I2C is not set
5599 +
5600 +#
5601 +# Mice
5602 +#
5603 +# CONFIG_BUSMOUSE is not set
5604 +# CONFIG_MOUSE is not set
5605 +
5606 +#
5607 +# Joysticks
5608 +#
5609 +# CONFIG_INPUT_GAMEPORT is not set
5610 +# CONFIG_INPUT_NS558 is not set
5611 +# CONFIG_INPUT_LIGHTNING is not set
5612 +# CONFIG_INPUT_PCIGAME is not set
5613 +# CONFIG_INPUT_CS461X is not set
5614 +# CONFIG_INPUT_EMU10K1 is not set
5615 +# CONFIG_INPUT_SERIO is not set
5616 +# CONFIG_INPUT_SERPORT is not set
5617 +
5618 +#
5619 +# Joysticks
5620 +#
5621 +# CONFIG_INPUT_ANALOG is not set
5622 +# CONFIG_INPUT_A3D is not set
5623 +# CONFIG_INPUT_ADI is not set
5624 +# CONFIG_INPUT_COBRA is not set
5625 +# CONFIG_INPUT_GF2K is not set
5626 +# CONFIG_INPUT_GRIP is not set
5627 +# CONFIG_INPUT_INTERACT is not set
5628 +# CONFIG_INPUT_TMDC is not set
5629 +# CONFIG_INPUT_SIDEWINDER is not set
5630 +# CONFIG_INPUT_IFORCE_USB is not set
5631 +# CONFIG_INPUT_IFORCE_232 is not set
5632 +# CONFIG_INPUT_WARRIOR is not set
5633 +# CONFIG_INPUT_MAGELLAN is not set
5634 +# CONFIG_INPUT_SPACEORB is not set
5635 +# CONFIG_INPUT_SPACEBALL is not set
5636 +# CONFIG_INPUT_STINGER is not set
5637 +# CONFIG_INPUT_DB9 is not set
5638 +# CONFIG_INPUT_GAMECON is not set
5639 +# CONFIG_INPUT_TURBOGRAFX is not set
5640 +# CONFIG_QIC02_TAPE is not set
5641 +# CONFIG_IPMI_HANDLER is not set
5642 +# CONFIG_IPMI_PANIC_EVENT is not set
5643 +# CONFIG_IPMI_DEVICE_INTERFACE is not set
5644 +# CONFIG_IPMI_KCS is not set
5645 +# CONFIG_IPMI_WATCHDOG is not set
5646 +
5647 +#
5648 +# Watchdog Cards
5649 +#
5650 +# CONFIG_WATCHDOG is not set
5651 +# CONFIG_SCx200 is not set
5652 +# CONFIG_SCx200_GPIO is not set
5653 +# CONFIG_AMD_PM768 is not set
5654 +# CONFIG_NVRAM is not set
5655 +# CONFIG_RTC is not set
5656 +# CONFIG_DTLK is not set
5657 +# CONFIG_R3964 is not set
5658 +# CONFIG_APPLICOM is not set
5659 +
5660 +#
5661 +# Ftape, the floppy tape device driver
5662 +#
5663 +# CONFIG_FTAPE is not set
5664 +# CONFIG_AGP is not set
5665 +
5666 +#
5667 +# Direct Rendering Manager (XFree86 DRI support)
5668 +#
5669 +# CONFIG_DRM is not set
5670 +
5671 +#
5672 +# PCMCIA character devices
5673 +#
5674 +# CONFIG_PCMCIA_SERIAL_CS is not set
5675 +# CONFIG_SYNCLINK_CS is not set
5676 +
5677 +#
5678 +# File systems
5679 +#
5680 +# CONFIG_QUOTA is not set
5681 +# CONFIG_QFMT_V2 is not set
5682 +CONFIG_AUTOFS_FS=y
5683 +# CONFIG_AUTOFS4_FS is not set
5684 +# CONFIG_REISERFS_FS is not set
5685 +# CONFIG_REISERFS_CHECK is not set
5686 +# CONFIG_REISERFS_PROC_INFO is not set
5687 +# CONFIG_ADFS_FS is not set
5688 +# CONFIG_ADFS_FS_RW is not set
5689 +# CONFIG_AFFS_FS is not set
5690 +# CONFIG_HFS_FS is not set
5691 +# CONFIG_HFSPLUS_FS is not set
5692 +# CONFIG_BEFS_FS is not set
5693 +# CONFIG_BEFS_DEBUG is not set
5694 +# CONFIG_BFS_FS is not set
5695 +CONFIG_EXT3_FS=y
5696 +CONFIG_JBD=y
5697 +# CONFIG_JBD_DEBUG is not set
5698 +CONFIG_FAT_FS=y
5699 +CONFIG_MSDOS_FS=y
5700 +# CONFIG_UMSDOS_FS is not set
5701 +CONFIG_VFAT_FS=y
5702 +# CONFIG_EFS_FS is not set
5703 +# CONFIG_JFFS_FS is not set
5704 +# CONFIG_JFFS2_FS is not set
5705 +# CONFIG_CRAMFS is not set
5706 +CONFIG_TMPFS=y
5707 +CONFIG_RAMFS=y
5708 +# CONFIG_ISO9660_FS is not set
5709 +# CONFIG_JOLIET is not set
5710 +# CONFIG_ZISOFS is not set
5711 +# CONFIG_JFS_FS is not set
5712 +# CONFIG_JFS_DEBUG is not set
5713 +# CONFIG_JFS_STATISTICS is not set
5714 +# CONFIG_MINIX_FS is not set
5715 +# CONFIG_VXFS_FS is not set
5716 +# CONFIG_NTFS_FS is not set
5717 +# CONFIG_NTFS_RW is not set
5718 +# CONFIG_HPFS_FS is not set
5719 +CONFIG_PROC_FS=y
5720 +# CONFIG_DEVFS_FS is not set
5721 +# CONFIG_DEVFS_MOUNT is not set
5722 +# CONFIG_DEVFS_DEBUG is not set
5723 +CONFIG_DEVPTS_FS=y
5724 +# CONFIG_QNX4FS_FS is not set
5725 +# CONFIG_QNX4FS_RW is not set
5726 +# CONFIG_ROMFS_FS is not set
5727 +CONFIG_EXT2_FS=y
5728 +# CONFIG_SYSV_FS is not set
5729 +# CONFIG_UDF_FS is not set
5730 +# CONFIG_UDF_RW is not set
5731 +# CONFIG_UFS_FS is not set
5732 +# CONFIG_UFS_FS_WRITE is not set
5733 +# CONFIG_XFS_FS is not set
5734 +# CONFIG_XFS_QUOTA is not set
5735 +# CONFIG_XFS_RT is not set
5736 +# CONFIG_XFS_TRACE is not set
5737 +# CONFIG_XFS_DEBUG is not set
5738 +
5739 +#
5740 +# Network File Systems
5741 +#
5742 +# CONFIG_CODA_FS is not set
5743 +# CONFIG_INTERMEZZO_FS is not set
5744 +CONFIG_NFS_FS=y
5745 +CONFIG_NFS_V3=y
5746 +# CONFIG_NFS_DIRECTIO is not set
5747 +CONFIG_ROOT_NFS=y
5748 +# CONFIG_NFSD is not set
5749 +# CONFIG_NFSD_V3 is not set
5750 +# CONFIG_NFSD_TCP is not set
5751 +CONFIG_SUNRPC=y
5752 +CONFIG_LOCKD=y
5753 +CONFIG_LOCKD_V4=y
5754 +# CONFIG_SMB_FS is not set
5755 +# CONFIG_NCP_FS is not set
5756 +# CONFIG_NCPFS_PACKET_SIGNING is not set
5757 +# CONFIG_NCPFS_IOCTL_LOCKING is not set
5758 +# CONFIG_NCPFS_STRONG is not set
5759 +# CONFIG_NCPFS_NFS_NS is not set
5760 +# CONFIG_NCPFS_OS2_NS is not set
5761 +# CONFIG_NCPFS_SMALLDOS is not set
5762 +# CONFIG_NCPFS_NLS is not set
5763 +# CONFIG_NCPFS_EXTRAS is not set
5764 +# CONFIG_ZISOFS_FS is not set
5765 +
5766 +#
5767 +# Partition Types
5768 +#
5769 +# CONFIG_PARTITION_ADVANCED is not set
5770 +CONFIG_MSDOS_PARTITION=y
5771 +# CONFIG_SMB_NLS is not set
5772 +CONFIG_NLS=y
5773 +
5774 +#
5775 +# Native Language Support
5776 +#
5777 +CONFIG_NLS_DEFAULT="iso8859-1"
5778 +# CONFIG_NLS_CODEPAGE_437 is not set
5779 +# CONFIG_NLS_CODEPAGE_737 is not set
5780 +# CONFIG_NLS_CODEPAGE_775 is not set
5781 +# CONFIG_NLS_CODEPAGE_850 is not set
5782 +# CONFIG_NLS_CODEPAGE_852 is not set
5783 +# CONFIG_NLS_CODEPAGE_855 is not set
5784 +# CONFIG_NLS_CODEPAGE_857 is not set
5785 +# CONFIG_NLS_CODEPAGE_860 is not set
5786 +# CONFIG_NLS_CODEPAGE_861 is not set
5787 +# CONFIG_NLS_CODEPAGE_862 is not set
5788 +# CONFIG_NLS_CODEPAGE_863 is not set
5789 +# CONFIG_NLS_CODEPAGE_864 is not set
5790 +# CONFIG_NLS_CODEPAGE_865 is not set
5791 +# CONFIG_NLS_CODEPAGE_866 is not set
5792 +# CONFIG_NLS_CODEPAGE_869 is not set
5793 +# CONFIG_NLS_CODEPAGE_936 is not set
5794 +# CONFIG_NLS_CODEPAGE_950 is not set
5795 +# CONFIG_NLS_CODEPAGE_932 is not set
5796 +# CONFIG_NLS_CODEPAGE_949 is not set
5797 +# CONFIG_NLS_CODEPAGE_874 is not set
5798 +# CONFIG_NLS_ISO8859_8 is not set
5799 +# CONFIG_NLS_CODEPAGE_1250 is not set
5800 +# CONFIG_NLS_CODEPAGE_1251 is not set
5801 +# CONFIG_NLS_ISO8859_1 is not set
5802 +# CONFIG_NLS_ISO8859_2 is not set
5803 +# CONFIG_NLS_ISO8859_3 is not set
5804 +# CONFIG_NLS_ISO8859_4 is not set
5805 +# CONFIG_NLS_ISO8859_5 is not set
5806 +# CONFIG_NLS_ISO8859_6 is not set
5807 +# CONFIG_NLS_ISO8859_7 is not set
5808 +# CONFIG_NLS_ISO8859_9 is not set
5809 +# CONFIG_NLS_ISO8859_13 is not set
5810 +# CONFIG_NLS_ISO8859_14 is not set
5811 +# CONFIG_NLS_ISO8859_15 is not set
5812 +# CONFIG_NLS_KOI8_R is not set
5813 +# CONFIG_NLS_KOI8_U is not set
5814 +# CONFIG_NLS_UTF8 is not set
5815 +
5816 +#
5817 +# Multimedia devices
5818 +#
5819 +# CONFIG_VIDEO_DEV is not set
5820 +
5821 +#
5822 +# Console drivers
5823 +#
5824 +# CONFIG_VGA_CONSOLE is not set
5825 +# CONFIG_MDA_CONSOLE is not set
5826 +
5827 +#
5828 +# Frame-buffer support
5829 +#
5830 +CONFIG_FB=y
5831 +CONFIG_DUMMY_CONSOLE=y
5832 +# CONFIG_FB_RIVA is not set
5833 +# CONFIG_FB_CLGEN is not set
5834 +# CONFIG_FB_PM2 is not set
5835 +# CONFIG_FB_PM3 is not set
5836 +# CONFIG_FB_CYBER2000 is not set
5837 +# CONFIG_FB_MATROX is not set
5838 +# CONFIG_FB_ATY is not set
5839 +# CONFIG_FB_RADEON is not set
5840 +# CONFIG_FB_ATY128 is not set
5841 +# CONFIG_FB_INTEL is not set
5842 +# CONFIG_FB_SIS is not set
5843 +# CONFIG_FB_NEOMAGIC is not set
5844 +# CONFIG_FB_3DFX is not set
5845 +# CONFIG_FB_VOODOO1 is not set
5846 +# CONFIG_FB_TRIDENT is not set
5847 +# CONFIG_FB_E1356 is not set
5848 +# CONFIG_FB_IT8181 is not set
5849 +# CONFIG_FB_VIRTUAL is not set
5850 +CONFIG_FBCON_ADVANCED=y
5851 +# CONFIG_FBCON_MFB is not set
5852 +# CONFIG_FBCON_CFB2 is not set
5853 +# CONFIG_FBCON_CFB4 is not set
5854 +# CONFIG_FBCON_CFB8 is not set
5855 +CONFIG_FBCON_CFB16=y
5856 +# CONFIG_FBCON_CFB24 is not set
5857 +CONFIG_FBCON_CFB32=y
5858 +# CONFIG_FBCON_AFB is not set
5859 +# CONFIG_FBCON_ILBM is not set
5860 +# CONFIG_FBCON_IPLAN2P2 is not set
5861 +# CONFIG_FBCON_IPLAN2P4 is not set
5862 +# CONFIG_FBCON_IPLAN2P8 is not set
5863 +# CONFIG_FBCON_MAC is not set
5864 +# CONFIG_FBCON_VGA_PLANES is not set
5865 +# CONFIG_FBCON_VGA is not set
5866 +# CONFIG_FBCON_HGA is not set
5867 +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
5868 +CONFIG_FBCON_FONTS=y
5869 +CONFIG_FONT_8x8=y
5870 +CONFIG_FONT_8x16=y
5871 +# CONFIG_FONT_SUN8x16 is not set
5872 +# CONFIG_FONT_SUN12x22 is not set
5873 +# CONFIG_FONT_6x11 is not set
5874 +# CONFIG_FONT_PEARL_8x8 is not set
5875 +# CONFIG_FONT_ACORN_8x8 is not set
5876 +
5877 +#
5878 +# Sound
5879 +#
5880 +CONFIG_SOUND=y
5881 +# CONFIG_SOUND_ALI5455 is not set
5882 +# CONFIG_SOUND_BT878 is not set
5883 +# CONFIG_SOUND_CMPCI is not set
5884 +# CONFIG_SOUND_EMU10K1 is not set
5885 +# CONFIG_MIDI_EMU10K1 is not set
5886 +# CONFIG_SOUND_FUSION is not set
5887 +# CONFIG_SOUND_CS4281 is not set
5888 +# CONFIG_SOUND_ES1370 is not set
5889 +# CONFIG_SOUND_ES1371 is not set
5890 +# CONFIG_SOUND_ESSSOLO1 is not set
5891 +# CONFIG_SOUND_MAESTRO is not set
5892 +# CONFIG_SOUND_MAESTRO3 is not set
5893 +# CONFIG_SOUND_FORTE is not set
5894 +# CONFIG_SOUND_ICH is not set
5895 +# CONFIG_SOUND_RME96XX is not set
5896 +# CONFIG_SOUND_SONICVIBES is not set
5897 +# CONFIG_SOUND_TRIDENT is not set
5898 +# CONFIG_SOUND_MSNDCLAS is not set
5899 +# CONFIG_SOUND_MSNDPIN is not set
5900 +# CONFIG_SOUND_VIA82CXXX is not set
5901 +# CONFIG_MIDI_VIA82CXXX is not set
5902 +# CONFIG_SOUND_OSS is not set
5903 +# CONFIG_SOUND_TVMIXER is not set
5904 +# CONFIG_SOUND_AD1980 is not set
5905 +# CONFIG_SOUND_WM97XX is not set
5906 +
5907 +#
5908 +# USB support
5909 +#
5910 +CONFIG_USB=y
5911 +# CONFIG_USB_DEBUG is not set
5912 +
5913 +#
5914 +# Miscellaneous USB options
5915 +#
5916 +CONFIG_USB_DEVICEFS=y
5917 +# CONFIG_USB_BANDWIDTH is not set
5918 +
5919 +#
5920 +# USB Host Controller Drivers
5921 +#
5922 +# CONFIG_USB_EHCI_HCD is not set
5923 +# CONFIG_USB_UHCI is not set
5924 +# CONFIG_USB_UHCI_ALT is not set
5925 +CONFIG_USB_OHCI=y
5926 +
5927 +#
5928 +# USB Device Class drivers
5929 +#
5930 +# CONFIG_USB_AUDIO is not set
5931 +# CONFIG_USB_EMI26 is not set
5932 +# CONFIG_USB_BLUETOOTH is not set
5933 +# CONFIG_USB_MIDI is not set
5934 +CONFIG_USB_STORAGE=y
5935 +# CONFIG_USB_STORAGE_DEBUG is not set
5936 +# CONFIG_USB_STORAGE_DATAFAB is not set
5937 +# CONFIG_USB_STORAGE_FREECOM is not set
5938 +# CONFIG_USB_STORAGE_ISD200 is not set
5939 +# CONFIG_USB_STORAGE_DPCM is not set
5940 +# CONFIG_USB_STORAGE_HP8200e is not set
5941 +# CONFIG_USB_STORAGE_SDDR09 is not set
5942 +# CONFIG_USB_STORAGE_SDDR55 is not set
5943 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
5944 +# CONFIG_USB_ACM is not set
5945 +# CONFIG_USB_PRINTER is not set
5946 +
5947 +#
5948 +# USB Human Interface Devices (HID)
5949 +#
5950 +CONFIG_USB_HID=y
5951 +CONFIG_USB_HIDINPUT=y
5952 +CONFIG_USB_HIDDEV=y
5953 +# CONFIG_USB_AIPTEK is not set
5954 +# CONFIG_USB_WACOM is not set
5955 +# CONFIG_USB_KBTAB is not set
5956 +# CONFIG_USB_POWERMATE is not set
5957 +
5958 +#
5959 +# USB Imaging devices
5960 +#
5961 +# CONFIG_USB_DC2XX is not set
5962 +# CONFIG_USB_MDC800 is not set
5963 +# CONFIG_USB_SCANNER is not set
5964 +# CONFIG_USB_MICROTEK is not set
5965 +# CONFIG_USB_HPUSBSCSI is not set
5966 +
5967 +#
5968 +# USB Multimedia devices
5969 +#
5970 +
5971 +#
5972 +# Video4Linux support is needed for USB Multimedia device support
5973 +#
5974 +
5975 +#
5976 +# USB Network adaptors
5977 +#
5978 +# CONFIG_USB_PEGASUS is not set
5979 +# CONFIG_USB_RTL8150 is not set
5980 +# CONFIG_USB_KAWETH is not set
5981 +# CONFIG_USB_CATC is not set
5982 +# CONFIG_USB_CDCETHER is not set
5983 +# CONFIG_USB_USBNET is not set
5984 +
5985 +#
5986 +# USB port drivers
5987 +#
5988 +# CONFIG_USB_USS720 is not set
5989 +
5990 +#
5991 +# USB Serial Converter support
5992 +#
5993 +# CONFIG_USB_SERIAL is not set
5994 +
5995 +#
5996 +# USB Miscellaneous drivers
5997 +#
5998 +# CONFIG_USB_RIO500 is not set
5999 +# CONFIG_USB_AUERSWALD is not set
6000 +# CONFIG_USB_TIGL is not set
6001 +# CONFIG_USB_BRLVGER is not set
6002 +# CONFIG_USB_LCD is not set
6003 +
6004 +#
6005 +# Support for USB gadgets
6006 +#
6007 +# CONFIG_USB_GADGET is not set
6008 +
6009 +#
6010 +# Bluetooth support
6011 +#
6012 +# CONFIG_BLUEZ is not set
6013 +
6014 +#
6015 +# Kernel hacking
6016 +#
6017 +CONFIG_CROSSCOMPILE=y
6018 +# CONFIG_RUNTIME_DEBUG is not set
6019 +# CONFIG_KGDB is not set
6020 +# CONFIG_GDB_CONSOLE is not set
6021 +# CONFIG_DEBUG_INFO is not set
6022 +# CONFIG_MAGIC_SYSRQ is not set
6023 +# CONFIG_MIPS_UNCACHED is not set
6024 +CONFIG_LOG_BUF_SHIFT=0
6025 +
6026 +#
6027 +# Cryptographic options
6028 +#
6029 +# CONFIG_CRYPTO is not set
6030 +
6031 +#
6032 +# Library routines
6033 +#
6034 +# CONFIG_CRC32 is not set
6035 +CONFIG_ZLIB_INFLATE=m
6036 +CONFIG_ZLIB_DEFLATE=m
6037 +# CONFIG_FW_LOADER is not set
6038 diff -Nur linux-2.4.29/arch/mips/defconfig-db1500 linux-mips/arch/mips/defconfig-db1500
6039 --- linux-2.4.29/arch/mips/defconfig-db1500 2005-01-19 15:09:28.000000000 +0100
6040 +++ linux-mips/arch/mips/defconfig-db1500 2005-03-26 11:47:14.271309493 +0100
6041 @@ -30,8 +30,8 @@
6042 # CONFIG_MIPS_PB1000 is not set
6043 # CONFIG_MIPS_PB1100 is not set
6044 # CONFIG_MIPS_PB1500 is not set
6045 -# CONFIG_MIPS_HYDROGEN3 is not set
6046 # CONFIG_MIPS_PB1550 is not set
6047 +# CONFIG_MIPS_HYDROGEN3 is not set
6048 # CONFIG_MIPS_XXS1500 is not set
6049 # CONFIG_MIPS_MTX1 is not set
6050 # CONFIG_COGENT_CSB250 is not set
6051 @@ -267,11 +267,6 @@
6052 #
6053 # CONFIG_IPX is not set
6054 # CONFIG_ATALK is not set
6055 -
6056 -#
6057 -# Appletalk devices
6058 -#
6059 -# CONFIG_DEV_APPLETALK is not set
6060 # CONFIG_DECNET is not set
6061 # CONFIG_BRIDGE is not set
6062 # CONFIG_X25 is not set
6063 @@ -555,7 +550,6 @@
6064 # CONFIG_AU1X00_USB_TTY is not set
6065 # CONFIG_AU1X00_USB_RAW is not set
6066 # CONFIG_TXX927_SERIAL is not set
6067 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6068 CONFIG_UNIX98_PTYS=y
6069 CONFIG_UNIX98_PTY_COUNT=256
6070
6071 diff -Nur linux-2.4.29/arch/mips/defconfig-db1550 linux-mips/arch/mips/defconfig-db1550
6072 --- linux-2.4.29/arch/mips/defconfig-db1550 2005-01-19 15:09:28.000000000 +0100
6073 +++ linux-mips/arch/mips/defconfig-db1550 2005-03-26 11:47:14.372292920 +0100
6074 @@ -30,8 +30,8 @@
6075 # CONFIG_MIPS_PB1000 is not set
6076 # CONFIG_MIPS_PB1100 is not set
6077 # CONFIG_MIPS_PB1500 is not set
6078 -# CONFIG_MIPS_HYDROGEN3 is not set
6079 # CONFIG_MIPS_PB1550 is not set
6080 +# CONFIG_MIPS_HYDROGEN3 is not set
6081 # CONFIG_MIPS_XXS1500 is not set
6082 # CONFIG_MIPS_MTX1 is not set
6083 # CONFIG_COGENT_CSB250 is not set
6084 @@ -213,11 +213,9 @@
6085 # CONFIG_MTD_BOSPORUS is not set
6086 # CONFIG_MTD_XXS1500 is not set
6087 # CONFIG_MTD_MTX1 is not set
6088 -# CONFIG_MTD_DB1X00 is not set
6089 CONFIG_MTD_PB1550=y
6090 CONFIG_MTD_PB1550_BOOT=y
6091 CONFIG_MTD_PB1550_USER=y
6092 -# CONFIG_MTD_HYDROGEN3 is not set
6093 # CONFIG_MTD_MIRAGE is not set
6094 # CONFIG_MTD_CSTM_MIPS_IXX is not set
6095 # CONFIG_MTD_OCELOT is not set
6096 @@ -236,7 +234,6 @@
6097 #
6098 # Disk-On-Chip Device Drivers
6099 #
6100 -# CONFIG_MTD_DOC1000 is not set
6101 # CONFIG_MTD_DOC2000 is not set
6102 # CONFIG_MTD_DOC2001 is not set
6103 # CONFIG_MTD_DOCPROBE is not set
6104 @@ -343,11 +340,6 @@
6105 #
6106 # CONFIG_IPX is not set
6107 # CONFIG_ATALK is not set
6108 -
6109 -#
6110 -# Appletalk devices
6111 -#
6112 -# CONFIG_DEV_APPLETALK is not set
6113 # CONFIG_DECNET is not set
6114 # CONFIG_BRIDGE is not set
6115 # CONFIG_X25 is not set
6116 @@ -633,7 +625,6 @@
6117 # CONFIG_AU1X00_USB_TTY is not set
6118 # CONFIG_AU1X00_USB_RAW is not set
6119 # CONFIG_TXX927_SERIAL is not set
6120 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6121 CONFIG_UNIX98_PTYS=y
6122 CONFIG_UNIX98_PTY_COUNT=256
6123
6124 diff -Nur linux-2.4.29/arch/mips/defconfig-ddb5476 linux-mips/arch/mips/defconfig-ddb5476
6125 --- linux-2.4.29/arch/mips/defconfig-ddb5476 2005-01-19 15:09:28.000000000 +0100
6126 +++ linux-mips/arch/mips/defconfig-ddb5476 2005-03-26 11:47:14.442281433 +0100
6127 @@ -28,8 +28,8 @@
6128 # CONFIG_MIPS_PB1000 is not set
6129 # CONFIG_MIPS_PB1100 is not set
6130 # CONFIG_MIPS_PB1500 is not set
6131 -# CONFIG_MIPS_HYDROGEN3 is not set
6132 # CONFIG_MIPS_PB1550 is not set
6133 +# CONFIG_MIPS_HYDROGEN3 is not set
6134 # CONFIG_MIPS_XXS1500 is not set
6135 # CONFIG_MIPS_MTX1 is not set
6136 # CONFIG_COGENT_CSB250 is not set
6137 @@ -226,11 +226,6 @@
6138 #
6139 # CONFIG_IPX is not set
6140 # CONFIG_ATALK is not set
6141 -
6142 -#
6143 -# Appletalk devices
6144 -#
6145 -# CONFIG_DEV_APPLETALK is not set
6146 # CONFIG_DECNET is not set
6147 # CONFIG_BRIDGE is not set
6148 # CONFIG_X25 is not set
6149 @@ -517,7 +512,6 @@
6150 CONFIG_SERIAL_CONSOLE=y
6151 # CONFIG_SERIAL_EXTENDED is not set
6152 # CONFIG_SERIAL_NONSTANDARD is not set
6153 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6154 CONFIG_UNIX98_PTYS=y
6155 CONFIG_UNIX98_PTY_COUNT=256
6156
6157 diff -Nur linux-2.4.29/arch/mips/defconfig-ddb5477 linux-mips/arch/mips/defconfig-ddb5477
6158 --- linux-2.4.29/arch/mips/defconfig-ddb5477 2005-01-19 15:09:28.000000000 +0100
6159 +++ linux-mips/arch/mips/defconfig-ddb5477 2005-03-26 11:47:14.507270767 +0100
6160 @@ -28,8 +28,8 @@
6161 # CONFIG_MIPS_PB1000 is not set
6162 # CONFIG_MIPS_PB1100 is not set
6163 # CONFIG_MIPS_PB1500 is not set
6164 -# CONFIG_MIPS_HYDROGEN3 is not set
6165 # CONFIG_MIPS_PB1550 is not set
6166 +# CONFIG_MIPS_HYDROGEN3 is not set
6167 # CONFIG_MIPS_XXS1500 is not set
6168 # CONFIG_MIPS_MTX1 is not set
6169 # CONFIG_COGENT_CSB250 is not set
6170 @@ -226,11 +226,6 @@
6171 #
6172 # CONFIG_IPX is not set
6173 # CONFIG_ATALK is not set
6174 -
6175 -#
6176 -# Appletalk devices
6177 -#
6178 -# CONFIG_DEV_APPLETALK is not set
6179 # CONFIG_DECNET is not set
6180 # CONFIG_BRIDGE is not set
6181 # CONFIG_X25 is not set
6182 @@ -434,7 +429,6 @@
6183 CONFIG_SERIAL_CONSOLE=y
6184 # CONFIG_SERIAL_EXTENDED is not set
6185 # CONFIG_SERIAL_NONSTANDARD is not set
6186 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6187 CONFIG_UNIX98_PTYS=y
6188 CONFIG_UNIX98_PTY_COUNT=256
6189
6190 diff -Nur linux-2.4.29/arch/mips/defconfig-decstation linux-mips/arch/mips/defconfig-decstation
6191 --- linux-2.4.29/arch/mips/defconfig-decstation 2005-01-19 15:09:28.000000000 +0100
6192 +++ linux-mips/arch/mips/defconfig-decstation 2005-03-26 11:47:14.573259936 +0100
6193 @@ -30,8 +30,8 @@
6194 # CONFIG_MIPS_PB1000 is not set
6195 # CONFIG_MIPS_PB1100 is not set
6196 # CONFIG_MIPS_PB1500 is not set
6197 -# CONFIG_MIPS_HYDROGEN3 is not set
6198 # CONFIG_MIPS_PB1550 is not set
6199 +# CONFIG_MIPS_HYDROGEN3 is not set
6200 # CONFIG_MIPS_XXS1500 is not set
6201 # CONFIG_MIPS_MTX1 is not set
6202 # CONFIG_COGENT_CSB250 is not set
6203 @@ -223,11 +223,6 @@
6204 #
6205 # CONFIG_IPX is not set
6206 # CONFIG_ATALK is not set
6207 -
6208 -#
6209 -# Appletalk devices
6210 -#
6211 -# CONFIG_DEV_APPLETALK is not set
6212 # CONFIG_DECNET is not set
6213 # CONFIG_BRIDGE is not set
6214 # CONFIG_X25 is not set
6215 @@ -306,9 +301,11 @@
6216 # CONFIG_SCSI_MEGARAID is not set
6217 # CONFIG_SCSI_MEGARAID2 is not set
6218 # CONFIG_SCSI_SATA is not set
6219 +# CONFIG_SCSI_SATA_AHCI is not set
6220 # CONFIG_SCSI_SATA_SVW is not set
6221 # CONFIG_SCSI_ATA_PIIX is not set
6222 # CONFIG_SCSI_SATA_NV is not set
6223 +# CONFIG_SCSI_SATA_QSTOR is not set
6224 # CONFIG_SCSI_SATA_PROMISE is not set
6225 # CONFIG_SCSI_SATA_SX4 is not set
6226 # CONFIG_SCSI_SATA_SIL is not set
6227 @@ -477,7 +474,6 @@
6228 CONFIG_SERIAL_DEC_CONSOLE=y
6229 CONFIG_DZ=y
6230 CONFIG_ZS=y
6231 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6232 CONFIG_UNIX98_PTYS=y
6233 CONFIG_UNIX98_PTY_COUNT=256
6234
6235 diff -Nur linux-2.4.29/arch/mips/defconfig-e55 linux-mips/arch/mips/defconfig-e55
6236 --- linux-2.4.29/arch/mips/defconfig-e55 2005-01-19 15:09:28.000000000 +0100
6237 +++ linux-mips/arch/mips/defconfig-e55 2005-03-26 11:47:14.632250255 +0100
6238 @@ -30,8 +30,8 @@
6239 # CONFIG_MIPS_PB1000 is not set
6240 # CONFIG_MIPS_PB1100 is not set
6241 # CONFIG_MIPS_PB1500 is not set
6242 -# CONFIG_MIPS_HYDROGEN3 is not set
6243 # CONFIG_MIPS_PB1550 is not set
6244 +# CONFIG_MIPS_HYDROGEN3 is not set
6245 # CONFIG_MIPS_XXS1500 is not set
6246 # CONFIG_MIPS_MTX1 is not set
6247 # CONFIG_COGENT_CSB250 is not set
6248 @@ -222,11 +222,6 @@
6249 #
6250 # CONFIG_IPX is not set
6251 # CONFIG_ATALK is not set
6252 -
6253 -#
6254 -# Appletalk devices
6255 -#
6256 -# CONFIG_DEV_APPLETALK is not set
6257 # CONFIG_DECNET is not set
6258 # CONFIG_BRIDGE is not set
6259 # CONFIG_X25 is not set
6260 @@ -426,7 +421,6 @@
6261 # CONFIG_SERIAL_MULTIPORT is not set
6262 # CONFIG_HUB6 is not set
6263 # CONFIG_SERIAL_NONSTANDARD is not set
6264 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6265 # CONFIG_VR41XX_KIU is not set
6266 CONFIG_UNIX98_PTYS=y
6267 CONFIG_UNIX98_PTY_COUNT=256
6268 diff -Nur linux-2.4.29/arch/mips/defconfig-eagle linux-mips/arch/mips/defconfig-eagle
6269 --- linux-2.4.29/arch/mips/defconfig-eagle 2005-01-19 15:09:28.000000000 +0100
6270 +++ linux-mips/arch/mips/defconfig-eagle 2005-03-26 11:47:14.721235650 +0100
6271 @@ -30,8 +30,8 @@
6272 # CONFIG_MIPS_PB1000 is not set
6273 # CONFIG_MIPS_PB1100 is not set
6274 # CONFIG_MIPS_PB1500 is not set
6275 -# CONFIG_MIPS_HYDROGEN3 is not set
6276 # CONFIG_MIPS_PB1550 is not set
6277 +# CONFIG_MIPS_HYDROGEN3 is not set
6278 # CONFIG_MIPS_XXS1500 is not set
6279 # CONFIG_MIPS_MTX1 is not set
6280 # CONFIG_COGENT_CSB250 is not set
6281 @@ -208,8 +208,8 @@
6282 # Mapping drivers for chip access
6283 #
6284 CONFIG_MTD_PHYSMAP=y
6285 -CONFIG_MTD_PHYSMAP_START=1c000000
6286 -CONFIG_MTD_PHYSMAP_LEN=2000000
6287 +CONFIG_MTD_PHYSMAP_START=0x1c000000
6288 +CONFIG_MTD_PHYSMAP_LEN=0x2000000
6289 CONFIG_MTD_PHYSMAP_BUSWIDTH=4
6290 # CONFIG_MTD_PB1000 is not set
6291 # CONFIG_MTD_PB1500 is not set
6292 @@ -217,9 +217,7 @@
6293 # CONFIG_MTD_BOSPORUS is not set
6294 # CONFIG_MTD_XXS1500 is not set
6295 # CONFIG_MTD_MTX1 is not set
6296 -# CONFIG_MTD_DB1X00 is not set
6297 # CONFIG_MTD_PB1550 is not set
6298 -# CONFIG_MTD_HYDROGEN3 is not set
6299 # CONFIG_MTD_MIRAGE is not set
6300 # CONFIG_MTD_CSTM_MIPS_IXX is not set
6301 # CONFIG_MTD_OCELOT is not set
6302 @@ -238,7 +236,6 @@
6303 #
6304 # Disk-On-Chip Device Drivers
6305 #
6306 -# CONFIG_MTD_DOC1000 is not set
6307 # CONFIG_MTD_DOC2000 is not set
6308 # CONFIG_MTD_DOC2001 is not set
6309 # CONFIG_MTD_DOCPROBE is not set
6310 @@ -327,11 +324,6 @@
6311 #
6312 # CONFIG_IPX is not set
6313 # CONFIG_ATALK is not set
6314 -
6315 -#
6316 -# Appletalk devices
6317 -#
6318 -# CONFIG_DEV_APPLETALK is not set
6319 # CONFIG_DECNET is not set
6320 # CONFIG_BRIDGE is not set
6321 # CONFIG_X25 is not set
6322 @@ -587,7 +579,6 @@
6323 CONFIG_SERIAL_CONSOLE=y
6324 # CONFIG_SERIAL_EXTENDED is not set
6325 # CONFIG_SERIAL_NONSTANDARD is not set
6326 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6327 # CONFIG_VR41XX_KIU is not set
6328 CONFIG_UNIX98_PTYS=y
6329 CONFIG_UNIX98_PTY_COUNT=256
6330 diff -Nur linux-2.4.29/arch/mips/defconfig-ev64120 linux-mips/arch/mips/defconfig-ev64120
6331 --- linux-2.4.29/arch/mips/defconfig-ev64120 2005-01-19 15:09:28.000000000 +0100
6332 +++ linux-mips/arch/mips/defconfig-ev64120 2005-03-26 11:47:14.780225968 +0100
6333 @@ -30,8 +30,8 @@
6334 # CONFIG_MIPS_PB1000 is not set
6335 # CONFIG_MIPS_PB1100 is not set
6336 # CONFIG_MIPS_PB1500 is not set
6337 -# CONFIG_MIPS_HYDROGEN3 is not set
6338 # CONFIG_MIPS_PB1550 is not set
6339 +# CONFIG_MIPS_HYDROGEN3 is not set
6340 # CONFIG_MIPS_XXS1500 is not set
6341 # CONFIG_MIPS_MTX1 is not set
6342 # CONFIG_COGENT_CSB250 is not set
6343 @@ -230,11 +230,6 @@
6344 #
6345 # CONFIG_IPX is not set
6346 # CONFIG_ATALK is not set
6347 -
6348 -#
6349 -# Appletalk devices
6350 -#
6351 -# CONFIG_DEV_APPLETALK is not set
6352 # CONFIG_DECNET is not set
6353 # CONFIG_BRIDGE is not set
6354 # CONFIG_X25 is not set
6355 @@ -443,7 +438,6 @@
6356 # CONFIG_SERIAL_CONSOLE is not set
6357 # CONFIG_SERIAL_EXTENDED is not set
6358 # CONFIG_SERIAL_NONSTANDARD is not set
6359 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6360 CONFIG_UNIX98_PTYS=y
6361 CONFIG_UNIX98_PTY_COUNT=256
6362
6363 diff -Nur linux-2.4.29/arch/mips/defconfig-ev96100 linux-mips/arch/mips/defconfig-ev96100
6364 --- linux-2.4.29/arch/mips/defconfig-ev96100 2005-01-19 15:09:28.000000000 +0100
6365 +++ linux-mips/arch/mips/defconfig-ev96100 2005-03-26 11:47:14.833217271 +0100
6366 @@ -30,8 +30,8 @@
6367 # CONFIG_MIPS_PB1000 is not set
6368 # CONFIG_MIPS_PB1100 is not set
6369 # CONFIG_MIPS_PB1500 is not set
6370 -# CONFIG_MIPS_HYDROGEN3 is not set
6371 # CONFIG_MIPS_PB1550 is not set
6372 +# CONFIG_MIPS_HYDROGEN3 is not set
6373 # CONFIG_MIPS_XXS1500 is not set
6374 # CONFIG_MIPS_MTX1 is not set
6375 # CONFIG_COGENT_CSB250 is not set
6376 @@ -232,11 +232,6 @@
6377 #
6378 # CONFIG_IPX is not set
6379 # CONFIG_ATALK is not set
6380 -
6381 -#
6382 -# Appletalk devices
6383 -#
6384 -# CONFIG_DEV_APPLETALK is not set
6385 # CONFIG_DECNET is not set
6386 # CONFIG_BRIDGE is not set
6387 # CONFIG_X25 is not set
6388 @@ -441,7 +436,6 @@
6389 CONFIG_SERIAL_CONSOLE=y
6390 # CONFIG_SERIAL_EXTENDED is not set
6391 # CONFIG_SERIAL_NONSTANDARD is not set
6392 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6393 CONFIG_UNIX98_PTYS=y
6394 CONFIG_UNIX98_PTY_COUNT=256
6395
6396 diff -Nur linux-2.4.29/arch/mips/defconfig-ficmmp linux-mips/arch/mips/defconfig-ficmmp
6397 --- linux-2.4.29/arch/mips/defconfig-ficmmp 1970-01-01 01:00:00.000000000 +0100
6398 +++ linux-mips/arch/mips/defconfig-ficmmp 2005-03-26 11:47:14.922202667 +0100
6399 @@ -0,0 +1,862 @@
6400 +#
6401 +# Automatically generated make config: don't edit
6402 +#
6403 +CONFIG_MIPS=y
6404 +CONFIG_MIPS32=y
6405 +# CONFIG_MIPS64 is not set
6406 +
6407 +#
6408 +# Code maturity level options
6409 +#
6410 +CONFIG_EXPERIMENTAL=y
6411 +
6412 +#
6413 +# Loadable module support
6414 +#
6415 +CONFIG_MODULES=y
6416 +# CONFIG_MODVERSIONS is not set
6417 +CONFIG_KMOD=y
6418 +
6419 +#
6420 +# Machine selection
6421 +#
6422 +# CONFIG_ACER_PICA_61 is not set
6423 +# CONFIG_MIPS_BOSPORUS is not set
6424 +# CONFIG_MIPS_MIRAGE is not set
6425 +# CONFIG_MIPS_DB1000 is not set
6426 +# CONFIG_MIPS_DB1100 is not set
6427 +# CONFIG_MIPS_DB1500 is not set
6428 +# CONFIG_MIPS_DB1550 is not set
6429 +# CONFIG_MIPS_PB1000 is not set
6430 +# CONFIG_MIPS_PB1100 is not set
6431 +# CONFIG_MIPS_PB1500 is not set
6432 +# CONFIG_MIPS_PB1550 is not set
6433 +# CONFIG_MIPS_HYDROGEN3 is not set
6434 +# CONFIG_MIPS_XXS1500 is not set
6435 +# CONFIG_MIPS_MTX1 is not set
6436 +# CONFIG_COGENT_CSB250 is not set
6437 +# CONFIG_BAGET_MIPS is not set
6438 +# CONFIG_CASIO_E55 is not set
6439 +# CONFIG_MIPS_COBALT is not set
6440 +# CONFIG_DECSTATION is not set
6441 +# CONFIG_MIPS_EV64120 is not set
6442 +# CONFIG_MIPS_EV96100 is not set
6443 +# CONFIG_MIPS_IVR is not set
6444 +# CONFIG_HP_LASERJET is not set
6445 +# CONFIG_IBM_WORKPAD is not set
6446 +# CONFIG_LASAT is not set
6447 +# CONFIG_MIPS_ITE8172 is not set
6448 +# CONFIG_MIPS_ATLAS is not set
6449 +# CONFIG_MIPS_MAGNUM_4000 is not set
6450 +# CONFIG_MIPS_MALTA is not set
6451 +# CONFIG_MIPS_SEAD is not set
6452 +# CONFIG_MOMENCO_OCELOT is not set
6453 +# CONFIG_MOMENCO_OCELOT_G is not set
6454 +# CONFIG_MOMENCO_OCELOT_C is not set
6455 +# CONFIG_MOMENCO_JAGUAR_ATX is not set
6456 +# CONFIG_PMC_BIG_SUR is not set
6457 +# CONFIG_PMC_STRETCH is not set
6458 +# CONFIG_PMC_YOSEMITE is not set
6459 +# CONFIG_DDB5074 is not set
6460 +# CONFIG_DDB5476 is not set
6461 +# CONFIG_DDB5477 is not set
6462 +# CONFIG_NEC_OSPREY is not set
6463 +# CONFIG_NEC_EAGLE is not set
6464 +# CONFIG_OLIVETTI_M700 is not set
6465 +# CONFIG_NINO is not set
6466 +# CONFIG_SGI_IP22 is not set
6467 +# CONFIG_SGI_IP27 is not set
6468 +# CONFIG_SIBYTE_SB1xxx_SOC is not set
6469 +# CONFIG_SNI_RM200_PCI is not set
6470 +# CONFIG_TANBAC_TB0226 is not set
6471 +# CONFIG_TANBAC_TB0229 is not set
6472 +# CONFIG_TOSHIBA_JMR3927 is not set
6473 +# CONFIG_TOSHIBA_RBTX4927 is not set
6474 +# CONFIG_VICTOR_MPC30X is not set
6475 +# CONFIG_ZAO_CAPCELLA is not set
6476 +# CONFIG_HIGHMEM is not set
6477 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
6478 +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
6479 +# CONFIG_MIPS_AU1000 is not set
6480 +
6481 +#
6482 +# CPU selection
6483 +#
6484 +CONFIG_CPU_MIPS32=y
6485 +# CONFIG_CPU_MIPS64 is not set
6486 +# CONFIG_CPU_R3000 is not set
6487 +# CONFIG_CPU_TX39XX is not set
6488 +# CONFIG_CPU_VR41XX is not set
6489 +# CONFIG_CPU_R4300 is not set
6490 +# CONFIG_CPU_R4X00 is not set
6491 +# CONFIG_CPU_TX49XX is not set
6492 +# CONFIG_CPU_R5000 is not set
6493 +# CONFIG_CPU_R5432 is not set
6494 +# CONFIG_CPU_R6000 is not set
6495 +# CONFIG_CPU_NEVADA is not set
6496 +# CONFIG_CPU_R8000 is not set
6497 +# CONFIG_CPU_R10000 is not set
6498 +# CONFIG_CPU_RM7000 is not set
6499 +# CONFIG_CPU_RM9000 is not set
6500 +# CONFIG_CPU_SB1 is not set
6501 +CONFIG_PAGE_SIZE_4KB=y
6502 +# CONFIG_PAGE_SIZE_16KB is not set
6503 +# CONFIG_PAGE_SIZE_64KB is not set
6504 +CONFIG_CPU_HAS_PREFETCH=y
6505 +# CONFIG_VTAG_ICACHE is not set
6506 +CONFIG_64BIT_PHYS_ADDR=y
6507 +# CONFIG_CPU_ADVANCED is not set
6508 +CONFIG_CPU_HAS_LLSC=y
6509 +# CONFIG_CPU_HAS_LLDSCD is not set
6510 +# CONFIG_CPU_HAS_WB is not set
6511 +CONFIG_CPU_HAS_SYNC=y
6512 +
6513 +#
6514 +# General setup
6515 +#
6516 +CONFIG_CPU_LITTLE_ENDIAN=y
6517 +# CONFIG_BUILD_ELF64 is not set
6518 +CONFIG_NET=y
6519 +# CONFIG_PCI is not set
6520 +# CONFIG_PCI_NEW is not set
6521 +CONFIG_PCI_AUTO=y
6522 +# CONFIG_ISA is not set
6523 +# CONFIG_TC is not set
6524 +# CONFIG_MCA is not set
6525 +# CONFIG_SBUS is not set
6526 +# CONFIG_HOTPLUG is not set
6527 +# CONFIG_PCMCIA is not set
6528 +# CONFIG_HOTPLUG_PCI is not set
6529 +CONFIG_SYSVIPC=y
6530 +# CONFIG_BSD_PROCESS_ACCT is not set
6531 +CONFIG_SYSCTL=y
6532 +CONFIG_KCORE_ELF=y
6533 +# CONFIG_KCORE_AOUT is not set
6534 +# CONFIG_BINFMT_AOUT is not set
6535 +CONFIG_BINFMT_ELF=y
6536 +# CONFIG_MIPS32_COMPAT is not set
6537 +# CONFIG_MIPS32_O32 is not set
6538 +# CONFIG_MIPS32_N32 is not set
6539 +# CONFIG_BINFMT_ELF32 is not set
6540 +# CONFIG_BINFMT_MISC is not set
6541 +# CONFIG_OOM_KILLER is not set
6542 +CONFIG_CMDLINE_BOOL=y
6543 +CONFIG_CMDLINE="ide3=dma mem=96M root=/dev/hda2 rootflags=data=journal"
6544 +
6545 +#
6546 +# Memory Technology Devices (MTD)
6547 +#
6548 +# CONFIG_MTD is not set
6549 +
6550 +#
6551 +# Parallel port support
6552 +#
6553 +# CONFIG_PARPORT is not set
6554 +
6555 +#
6556 +# Plug and Play configuration
6557 +#
6558 +# CONFIG_PNP is not set
6559 +# CONFIG_ISAPNP is not set
6560 +
6561 +#
6562 +# Block devices
6563 +#
6564 +# CONFIG_BLK_DEV_FD is not set
6565 +# CONFIG_BLK_DEV_XD is not set
6566 +# CONFIG_PARIDE is not set
6567 +# CONFIG_BLK_CPQ_DA is not set
6568 +# CONFIG_BLK_CPQ_CISS_DA is not set
6569 +# CONFIG_CISS_SCSI_TAPE is not set
6570 +# CONFIG_CISS_MONITOR_THREAD is not set
6571 +# CONFIG_BLK_DEV_DAC960 is not set
6572 +# CONFIG_BLK_DEV_UMEM is not set
6573 +# CONFIG_BLK_DEV_SX8 is not set
6574 +CONFIG_BLK_DEV_LOOP=y
6575 +# CONFIG_BLK_DEV_NBD is not set
6576 +# CONFIG_BLK_DEV_RAM is not set
6577 +# CONFIG_BLK_DEV_INITRD is not set
6578 +# CONFIG_BLK_STATS is not set
6579 +
6580 +#
6581 +# Multi-device support (RAID and LVM)
6582 +#
6583 +# CONFIG_MD is not set
6584 +# CONFIG_BLK_DEV_MD is not set
6585 +# CONFIG_MD_LINEAR is not set
6586 +# CONFIG_MD_RAID0 is not set
6587 +# CONFIG_MD_RAID1 is not set
6588 +# CONFIG_MD_RAID5 is not set
6589 +# CONFIG_MD_MULTIPATH is not set
6590 +# CONFIG_BLK_DEV_LVM is not set
6591 +
6592 +#
6593 +# Networking options
6594 +#
6595 +CONFIG_PACKET=y
6596 +# CONFIG_PACKET_MMAP is not set
6597 +# CONFIG_NETLINK_DEV is not set
6598 +CONFIG_NETFILTER=y
6599 +# CONFIG_NETFILTER_DEBUG is not set
6600 +CONFIG_FILTER=y
6601 +CONFIG_UNIX=y
6602 +CONFIG_INET=y
6603 +CONFIG_IP_MULTICAST=y
6604 +# CONFIG_IP_ADVANCED_ROUTER is not set
6605 +# CONFIG_IP_PNP is not set
6606 +# CONFIG_NET_IPIP is not set
6607 +# CONFIG_NET_IPGRE is not set
6608 +# CONFIG_IP_MROUTE is not set
6609 +# CONFIG_ARPD is not set
6610 +# CONFIG_INET_ECN is not set
6611 +# CONFIG_SYN_COOKIES is not set
6612 +
6613 +#
6614 +# IP: Netfilter Configuration
6615 +#
6616 +# CONFIG_IP_NF_CONNTRACK is not set
6617 +# CONFIG_IP_NF_QUEUE is not set
6618 +# CONFIG_IP_NF_IPTABLES is not set
6619 +# CONFIG_IP_NF_ARPTABLES is not set
6620 +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
6621 +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
6622 +
6623 +#
6624 +# IP: Virtual Server Configuration
6625 +#
6626 +# CONFIG_IP_VS is not set
6627 +# CONFIG_IPV6 is not set
6628 +# CONFIG_KHTTPD is not set
6629 +
6630 +#
6631 +# SCTP Configuration (EXPERIMENTAL)
6632 +#
6633 +# CONFIG_IP_SCTP is not set
6634 +# CONFIG_ATM is not set
6635 +# CONFIG_VLAN_8021Q is not set
6636 +
6637 +#
6638 +#
6639 +#
6640 +# CONFIG_IPX is not set
6641 +# CONFIG_ATALK is not set
6642 +# CONFIG_DECNET is not set
6643 +# CONFIG_BRIDGE is not set
6644 +# CONFIG_X25 is not set
6645 +# CONFIG_LAPB is not set
6646 +# CONFIG_LLC is not set
6647 +# CONFIG_NET_DIVERT is not set
6648 +# CONFIG_ECONET is not set
6649 +# CONFIG_WAN_ROUTER is not set
6650 +# CONFIG_NET_FASTROUTE is not set
6651 +# CONFIG_NET_HW_FLOWCONTROL is not set
6652 +
6653 +#
6654 +# QoS and/or fair queueing
6655 +#
6656 +# CONFIG_NET_SCHED is not set
6657 +
6658 +#
6659 +# Network testing
6660 +#
6661 +# CONFIG_NET_PKTGEN is not set
6662 +
6663 +#
6664 +# Telephony Support
6665 +#
6666 +# CONFIG_PHONE is not set
6667 +# CONFIG_PHONE_IXJ is not set
6668 +# CONFIG_PHONE_IXJ_PCMCIA is not set
6669 +
6670 +#
6671 +# ATA/IDE/MFM/RLL support
6672 +#
6673 +CONFIG_IDE=y
6674 +
6675 +#
6676 +# IDE, ATA and ATAPI Block devices
6677 +#
6678 +CONFIG_BLK_DEV_IDE=y
6679 +
6680 +#
6681 +# Please see Documentation/ide.txt for help/info on IDE drives
6682 +#
6683 +CONFIG_BLK_DEV_HD_IDE=y
6684 +CONFIG_BLK_DEV_HD=y
6685 +# CONFIG_BLK_DEV_IDE_SATA is not set
6686 +CONFIG_BLK_DEV_IDEDISK=y
6687 +CONFIG_IDEDISK_MULTI_MODE=y
6688 +CONFIG_IDEDISK_STROKE=y
6689 +# CONFIG_BLK_DEV_IDECS is not set
6690 +# CONFIG_BLK_DEV_DELKIN is not set
6691 +# CONFIG_BLK_DEV_IDECD is not set
6692 +# CONFIG_BLK_DEV_IDETAPE is not set
6693 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
6694 +# CONFIG_BLK_DEV_IDESCSI is not set
6695 +# CONFIG_IDE_TASK_IOCTL is not set
6696 +
6697 +#
6698 +# IDE chipset support/bugfixes
6699 +#
6700 +# CONFIG_BLK_DEV_CMD640 is not set
6701 +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
6702 +# CONFIG_BLK_DEV_ISAPNP is not set
6703 +# CONFIG_IDE_CHIPSETS is not set
6704 +# CONFIG_IDEDMA_AUTO is not set
6705 +# CONFIG_DMA_NONPCI is not set
6706 +# CONFIG_BLK_DEV_ATARAID is not set
6707 +# CONFIG_BLK_DEV_ATARAID_PDC is not set
6708 +# CONFIG_BLK_DEV_ATARAID_HPT is not set
6709 +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
6710 +# CONFIG_BLK_DEV_ATARAID_SII is not set
6711 +
6712 +#
6713 +# SCSI support
6714 +#
6715 +CONFIG_SCSI=y
6716 +
6717 +#
6718 +# SCSI support type (disk, tape, CD-ROM)
6719 +#
6720 +CONFIG_BLK_DEV_SD=y
6721 +CONFIG_SD_EXTRA_DEVS=40
6722 +CONFIG_CHR_DEV_ST=y
6723 +# CONFIG_CHR_DEV_OSST is not set
6724 +CONFIG_BLK_DEV_SR=y
6725 +# CONFIG_BLK_DEV_SR_VENDOR is not set
6726 +CONFIG_SR_EXTRA_DEVS=2
6727 +# CONFIG_CHR_DEV_SG is not set
6728 +
6729 +#
6730 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
6731 +#
6732 +# CONFIG_SCSI_DEBUG_QUEUES is not set
6733 +# CONFIG_SCSI_MULTI_LUN is not set
6734 +CONFIG_SCSI_CONSTANTS=y
6735 +# CONFIG_SCSI_LOGGING is not set
6736 +
6737 +#
6738 +# SCSI low-level drivers
6739 +#
6740 +# CONFIG_SCSI_7000FASST is not set
6741 +# CONFIG_SCSI_ACARD is not set
6742 +# CONFIG_SCSI_AHA152X is not set
6743 +# CONFIG_SCSI_AHA1542 is not set
6744 +# CONFIG_SCSI_AHA1740 is not set
6745 +# CONFIG_SCSI_AACRAID is not set
6746 +# CONFIG_SCSI_AIC7XXX is not set
6747 +# CONFIG_SCSI_AIC79XX is not set
6748 +# CONFIG_SCSI_AIC7XXX_OLD is not set
6749 +# CONFIG_SCSI_DPT_I2O is not set
6750 +# CONFIG_SCSI_ADVANSYS is not set
6751 +# CONFIG_SCSI_IN2000 is not set
6752 +# CONFIG_SCSI_AM53C974 is not set
6753 +# CONFIG_SCSI_MEGARAID is not set
6754 +# CONFIG_SCSI_MEGARAID2 is not set
6755 +# CONFIG_SCSI_SATA is not set
6756 +# CONFIG_SCSI_SATA_AHCI is not set
6757 +# CONFIG_SCSI_SATA_SVW is not set
6758 +# CONFIG_SCSI_ATA_PIIX is not set
6759 +# CONFIG_SCSI_SATA_NV is not set
6760 +# CONFIG_SCSI_SATA_QSTOR is not set
6761 +# CONFIG_SCSI_SATA_PROMISE is not set
6762 +# CONFIG_SCSI_SATA_SX4 is not set
6763 +# CONFIG_SCSI_SATA_SIL is not set
6764 +# CONFIG_SCSI_SATA_SIS is not set
6765 +# CONFIG_SCSI_SATA_ULI is not set
6766 +# CONFIG_SCSI_SATA_VIA is not set
6767 +# CONFIG_SCSI_SATA_VITESSE is not set
6768 +# CONFIG_SCSI_BUSLOGIC is not set
6769 +# CONFIG_SCSI_DMX3191D is not set
6770 +# CONFIG_SCSI_DTC3280 is not set
6771 +# CONFIG_SCSI_EATA is not set
6772 +# CONFIG_SCSI_EATA_DMA is not set
6773 +# CONFIG_SCSI_EATA_PIO is not set
6774 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
6775 +# CONFIG_SCSI_GDTH is not set
6776 +# CONFIG_SCSI_GENERIC_NCR5380 is not set
6777 +# CONFIG_SCSI_INITIO is not set
6778 +# CONFIG_SCSI_INIA100 is not set
6779 +# CONFIG_SCSI_NCR53C406A is not set
6780 +# CONFIG_SCSI_NCR53C7xx is not set
6781 +# CONFIG_SCSI_PAS16 is not set
6782 +# CONFIG_SCSI_PCI2000 is not set
6783 +# CONFIG_SCSI_PCI2220I is not set
6784 +# CONFIG_SCSI_PSI240I is not set
6785 +# CONFIG_SCSI_QLOGIC_FAS is not set
6786 +# CONFIG_SCSI_SIM710 is not set
6787 +# CONFIG_SCSI_SYM53C416 is not set
6788 +# CONFIG_SCSI_T128 is not set
6789 +# CONFIG_SCSI_U14_34F is not set
6790 +# CONFIG_SCSI_NSP32 is not set
6791 +# CONFIG_SCSI_DEBUG is not set
6792 +
6793 +#
6794 +# Fusion MPT device support
6795 +#
6796 +# CONFIG_FUSION is not set
6797 +# CONFIG_FUSION_BOOT is not set
6798 +# CONFIG_FUSION_ISENSE is not set
6799 +# CONFIG_FUSION_CTL is not set
6800 +# CONFIG_FUSION_LAN is not set
6801 +
6802 +#
6803 +# Network device support
6804 +#
6805 +CONFIG_NETDEVICES=y
6806 +
6807 +#
6808 +# ARCnet devices
6809 +#
6810 +# CONFIG_ARCNET is not set
6811 +# CONFIG_DUMMY is not set
6812 +# CONFIG_BONDING is not set
6813 +# CONFIG_EQUALIZER is not set
6814 +# CONFIG_TUN is not set
6815 +# CONFIG_ETHERTAP is not set
6816 +
6817 +#
6818 +# Ethernet (10 or 100Mbit)
6819 +#
6820 +CONFIG_NET_ETHERNET=y
6821 +# CONFIG_SUNLANCE is not set
6822 +# CONFIG_SUNBMAC is not set
6823 +# CONFIG_SUNQE is not set
6824 +# CONFIG_SUNGEM is not set
6825 +# CONFIG_NET_VENDOR_3COM is not set
6826 +# CONFIG_LANCE is not set
6827 +# CONFIG_NET_VENDOR_SMC is not set
6828 +# CONFIG_NET_VENDOR_RACAL is not set
6829 +# CONFIG_NET_ISA is not set
6830 +# CONFIG_NET_PCI is not set
6831 +# CONFIG_NET_POCKET is not set
6832 +
6833 +#
6834 +# Ethernet (1000 Mbit)
6835 +#
6836 +# CONFIG_ACENIC is not set
6837 +# CONFIG_DL2K is not set
6838 +# CONFIG_E1000 is not set
6839 +# CONFIG_MYRI_SBUS is not set
6840 +# CONFIG_NS83820 is not set
6841 +# CONFIG_HAMACHI is not set
6842 +# CONFIG_YELLOWFIN is not set
6843 +# CONFIG_R8169 is not set
6844 +# CONFIG_SK98LIN is not set
6845 +# CONFIG_TIGON3 is not set
6846 +# CONFIG_FDDI is not set
6847 +# CONFIG_HIPPI is not set
6848 +# CONFIG_PLIP is not set
6849 +# CONFIG_PPP is not set
6850 +# CONFIG_SLIP is not set
6851 +
6852 +#
6853 +# Wireless LAN (non-hamradio)
6854 +#
6855 +# CONFIG_NET_RADIO is not set
6856 +
6857 +#
6858 +# Token Ring devices
6859 +#
6860 +# CONFIG_TR is not set
6861 +# CONFIG_NET_FC is not set
6862 +# CONFIG_RCPCI is not set
6863 +# CONFIG_SHAPER is not set
6864 +
6865 +#
6866 +# Wan interfaces
6867 +#
6868 +# CONFIG_WAN is not set
6869 +
6870 +#
6871 +# Amateur Radio support
6872 +#
6873 +# CONFIG_HAMRADIO is not set
6874 +
6875 +#
6876 +# IrDA (infrared) support
6877 +#
6878 +# CONFIG_IRDA is not set
6879 +
6880 +#
6881 +# ISDN subsystem
6882 +#
6883 +# CONFIG_ISDN is not set
6884 +
6885 +#
6886 +# Input core support
6887 +#
6888 +CONFIG_INPUT=y
6889 +CONFIG_INPUT_KEYBDEV=y
6890 +CONFIG_INPUT_MOUSEDEV=y
6891 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
6892 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
6893 +# CONFIG_INPUT_JOYDEV is not set
6894 +CONFIG_INPUT_EVDEV=y
6895 +# CONFIG_INPUT_UINPUT is not set
6896 +
6897 +#
6898 +# Character devices
6899 +#
6900 +CONFIG_VT=y
6901 +CONFIG_VT_CONSOLE=y
6902 +# CONFIG_SERIAL is not set
6903 +# CONFIG_SERIAL_EXTENDED is not set
6904 +CONFIG_SERIAL_NONSTANDARD=y
6905 +# CONFIG_COMPUTONE is not set
6906 +# CONFIG_ROCKETPORT is not set
6907 +# CONFIG_CYCLADES is not set
6908 +# CONFIG_DIGIEPCA is not set
6909 +# CONFIG_DIGI is not set
6910 +# CONFIG_ESPSERIAL is not set
6911 +# CONFIG_MOXA_INTELLIO is not set
6912 +# CONFIG_MOXA_SMARTIO is not set
6913 +# CONFIG_ISI is not set
6914 +# CONFIG_SYNCLINK is not set
6915 +# CONFIG_SYNCLINKMP is not set
6916 +# CONFIG_N_HDLC is not set
6917 +# CONFIG_RISCOM8 is not set
6918 +# CONFIG_SPECIALIX is not set
6919 +# CONFIG_SX is not set
6920 +# CONFIG_RIO is not set
6921 +# CONFIG_STALDRV is not set
6922 +# CONFIG_SERIAL_TX3912 is not set
6923 +# CONFIG_SERIAL_TX3912_CONSOLE is not set
6924 +# CONFIG_SERIAL_TXX9 is not set
6925 +# CONFIG_SERIAL_TXX9_CONSOLE is not set
6926 +# CONFIG_TXX927_SERIAL is not set
6927 +CONFIG_UNIX98_PTYS=y
6928 +CONFIG_UNIX98_PTY_COUNT=256
6929 +
6930 +#
6931 +# I2C support
6932 +#
6933 +CONFIG_I2C=y
6934 +# CONFIG_I2C_ALGOBIT is not set
6935 +# CONFIG_SCx200_ACB is not set
6936 +# CONFIG_I2C_ALGOPCF is not set
6937 +# CONFIG_I2C_CHARDEV is not set
6938 +# CONFIG_I2C_PROC is not set
6939 +
6940 +#
6941 +# Mice
6942 +#
6943 +# CONFIG_BUSMOUSE is not set
6944 +# CONFIG_MOUSE is not set
6945 +
6946 +#
6947 +# Joysticks
6948 +#
6949 +# CONFIG_INPUT_GAMEPORT is not set
6950 +# CONFIG_INPUT_NS558 is not set
6951 +# CONFIG_INPUT_LIGHTNING is not set
6952 +# CONFIG_INPUT_PCIGAME is not set
6953 +# CONFIG_INPUT_CS461X is not set
6954 +# CONFIG_INPUT_EMU10K1 is not set
6955 +# CONFIG_INPUT_SERIO is not set
6956 +# CONFIG_INPUT_SERPORT is not set
6957 +
6958 +#
6959 +# Joysticks
6960 +#
6961 +# CONFIG_INPUT_ANALOG is not set
6962 +# CONFIG_INPUT_A3D is not set
6963 +# CONFIG_INPUT_ADI is not set
6964 +# CONFIG_INPUT_COBRA is not set
6965 +# CONFIG_INPUT_GF2K is not set
6966 +# CONFIG_INPUT_GRIP is not set
6967 +# CONFIG_INPUT_INTERACT is not set
6968 +# CONFIG_INPUT_TMDC is not set
6969 +# CONFIG_INPUT_SIDEWINDER is not set
6970 +# CONFIG_INPUT_IFORCE_USB is not set
6971 +# CONFIG_INPUT_IFORCE_232 is not set
6972 +# CONFIG_INPUT_WARRIOR is not set
6973 +# CONFIG_INPUT_MAGELLAN is not set
6974 +# CONFIG_INPUT_SPACEORB is not set
6975 +# CONFIG_INPUT_SPACEBALL is not set
6976 +# CONFIG_INPUT_STINGER is not set
6977 +# CONFIG_INPUT_DB9 is not set
6978 +# CONFIG_INPUT_GAMECON is not set
6979 +# CONFIG_INPUT_TURBOGRAFX is not set
6980 +# CONFIG_QIC02_TAPE is not set
6981 +# CONFIG_IPMI_HANDLER is not set
6982 +# CONFIG_IPMI_PANIC_EVENT is not set
6983 +# CONFIG_IPMI_DEVICE_INTERFACE is not set
6984 +# CONFIG_IPMI_KCS is not set
6985 +# CONFIG_IPMI_WATCHDOG is not set
6986 +
6987 +#
6988 +# Watchdog Cards
6989 +#
6990 +# CONFIG_WATCHDOG is not set
6991 +# CONFIG_SCx200 is not set
6992 +# CONFIG_SCx200_GPIO is not set
6993 +# CONFIG_AMD_PM768 is not set
6994 +# CONFIG_NVRAM is not set
6995 +# CONFIG_RTC is not set
6996 +# CONFIG_DTLK is not set
6997 +# CONFIG_R3964 is not set
6998 +# CONFIG_APPLICOM is not set
6999 +
7000 +#
7001 +# Ftape, the floppy tape device driver
7002 +#
7003 +# CONFIG_FTAPE is not set
7004 +# CONFIG_AGP is not set
7005 +
7006 +#
7007 +# Direct Rendering Manager (XFree86 DRI support)
7008 +#
7009 +# CONFIG_DRM is not set
7010 +
7011 +#
7012 +# File systems
7013 +#
7014 +# CONFIG_QUOTA is not set
7015 +# CONFIG_QFMT_V2 is not set
7016 +CONFIG_AUTOFS_FS=y
7017 +# CONFIG_AUTOFS4_FS is not set
7018 +# CONFIG_REISERFS_FS is not set
7019 +# CONFIG_REISERFS_CHECK is not set
7020 +# CONFIG_REISERFS_PROC_INFO is not set
7021 +# CONFIG_ADFS_FS is not set
7022 +# CONFIG_ADFS_FS_RW is not set
7023 +# CONFIG_AFFS_FS is not set
7024 +# CONFIG_HFS_FS is not set
7025 +# CONFIG_HFSPLUS_FS is not set
7026 +# CONFIG_BEFS_FS is not set
7027 +# CONFIG_BEFS_DEBUG is not set
7028 +# CONFIG_BFS_FS is not set
7029 +CONFIG_EXT3_FS=y
7030 +CONFIG_JBD=y
7031 +# CONFIG_JBD_DEBUG is not set
7032 +CONFIG_FAT_FS=y
7033 +CONFIG_MSDOS_FS=y
7034 +# CONFIG_UMSDOS_FS is not set
7035 +CONFIG_VFAT_FS=y
7036 +# CONFIG_EFS_FS is not set
7037 +# CONFIG_JFFS_FS is not set
7038 +# CONFIG_JFFS2_FS is not set
7039 +# CONFIG_CRAMFS is not set
7040 +# CONFIG_TMPFS is not set
7041 +CONFIG_RAMFS=y
7042 +# CONFIG_ISO9660_FS is not set
7043 +# CONFIG_JOLIET is not set
7044 +# CONFIG_ZISOFS is not set
7045 +# CONFIG_JFS_FS is not set
7046 +# CONFIG_JFS_DEBUG is not set
7047 +# CONFIG_JFS_STATISTICS is not set
7048 +# CONFIG_MINIX_FS is not set
7049 +# CONFIG_VXFS_FS is not set
7050 +# CONFIG_NTFS_FS is not set
7051 +# CONFIG_NTFS_RW is not set
7052 +# CONFIG_HPFS_FS is not set
7053 +CONFIG_PROC_FS=y
7054 +# CONFIG_DEVFS_FS is not set
7055 +# CONFIG_DEVFS_MOUNT is not set
7056 +# CONFIG_DEVFS_DEBUG is not set
7057 +CONFIG_DEVPTS_FS=y
7058 +# CONFIG_QNX4FS_FS is not set
7059 +# CONFIG_QNX4FS_RW is not set
7060 +# CONFIG_ROMFS_FS is not set
7061 +CONFIG_EXT2_FS=y
7062 +# CONFIG_SYSV_FS is not set
7063 +# CONFIG_UDF_FS is not set
7064 +# CONFIG_UDF_RW is not set
7065 +# CONFIG_UFS_FS is not set
7066 +# CONFIG_UFS_FS_WRITE is not set
7067 +# CONFIG_XFS_FS is not set
7068 +# CONFIG_XFS_QUOTA is not set
7069 +# CONFIG_XFS_RT is not set
7070 +# CONFIG_XFS_TRACE is not set
7071 +# CONFIG_XFS_DEBUG is not set
7072 +
7073 +#
7074 +# Network File Systems
7075 +#
7076 +# CONFIG_CODA_FS is not set
7077 +# CONFIG_INTERMEZZO_FS is not set
7078 +# CONFIG_NFS_FS is not set
7079 +# CONFIG_NFS_V3 is not set
7080 +# CONFIG_NFS_DIRECTIO is not set
7081 +# CONFIG_ROOT_NFS is not set
7082 +# CONFIG_NFSD is not set
7083 +# CONFIG_NFSD_V3 is not set
7084 +# CONFIG_NFSD_TCP is not set
7085 +# CONFIG_SUNRPC is not set
7086 +# CONFIG_LOCKD is not set
7087 +# CONFIG_SMB_FS is not set
7088 +# CONFIG_NCP_FS is not set
7089 +# CONFIG_NCPFS_PACKET_SIGNING is not set
7090 +# CONFIG_NCPFS_IOCTL_LOCKING is not set
7091 +# CONFIG_NCPFS_STRONG is not set
7092 +# CONFIG_NCPFS_NFS_NS is not set
7093 +# CONFIG_NCPFS_OS2_NS is not set
7094 +# CONFIG_NCPFS_SMALLDOS is not set
7095 +# CONFIG_NCPFS_NLS is not set
7096 +# CONFIG_NCPFS_EXTRAS is not set
7097 +# CONFIG_ZISOFS_FS is not set
7098 +
7099 +#
7100 +# Partition Types
7101 +#
7102 +# CONFIG_PARTITION_ADVANCED is not set
7103 +CONFIG_MSDOS_PARTITION=y
7104 +# CONFIG_SMB_NLS is not set
7105 +CONFIG_NLS=y
7106 +
7107 +#
7108 +# Native Language Support
7109 +#
7110 +CONFIG_NLS_DEFAULT="iso8859-1"
7111 +# CONFIG_NLS_CODEPAGE_437 is not set
7112 +# CONFIG_NLS_CODEPAGE_737 is not set
7113 +# CONFIG_NLS_CODEPAGE_775 is not set
7114 +# CONFIG_NLS_CODEPAGE_850 is not set
7115 +# CONFIG_NLS_CODEPAGE_852 is not set
7116 +# CONFIG_NLS_CODEPAGE_855 is not set
7117 +# CONFIG_NLS_CODEPAGE_857 is not set
7118 +# CONFIG_NLS_CODEPAGE_860 is not set
7119 +# CONFIG_NLS_CODEPAGE_861 is not set
7120 +# CONFIG_NLS_CODEPAGE_862 is not set
7121 +# CONFIG_NLS_CODEPAGE_863 is not set
7122 +# CONFIG_NLS_CODEPAGE_864 is not set
7123 +# CONFIG_NLS_CODEPAGE_865 is not set
7124 +# CONFIG_NLS_CODEPAGE_866 is not set
7125 +# CONFIG_NLS_CODEPAGE_869 is not set
7126 +# CONFIG_NLS_CODEPAGE_936 is not set
7127 +# CONFIG_NLS_CODEPAGE_950 is not set
7128 +# CONFIG_NLS_CODEPAGE_932 is not set
7129 +# CONFIG_NLS_CODEPAGE_949 is not set
7130 +# CONFIG_NLS_CODEPAGE_874 is not set
7131 +# CONFIG_NLS_ISO8859_8 is not set
7132 +# CONFIG_NLS_CODEPAGE_1250 is not set
7133 +# CONFIG_NLS_CODEPAGE_1251 is not set
7134 +# CONFIG_NLS_ISO8859_1 is not set
7135 +# CONFIG_NLS_ISO8859_2 is not set
7136 +# CONFIG_NLS_ISO8859_3 is not set
7137 +# CONFIG_NLS_ISO8859_4 is not set
7138 +# CONFIG_NLS_ISO8859_5 is not set
7139 +# CONFIG_NLS_ISO8859_6 is not set
7140 +# CONFIG_NLS_ISO8859_7 is not set
7141 +# CONFIG_NLS_ISO8859_9 is not set
7142 +# CONFIG_NLS_ISO8859_13 is not set
7143 +# CONFIG_NLS_ISO8859_14 is not set
7144 +# CONFIG_NLS_ISO8859_15 is not set
7145 +# CONFIG_NLS_KOI8_R is not set
7146 +# CONFIG_NLS_KOI8_U is not set
7147 +# CONFIG_NLS_UTF8 is not set
7148 +
7149 +#
7150 +# Multimedia devices
7151 +#
7152 +# CONFIG_VIDEO_DEV is not set
7153 +
7154 +#
7155 +# Console drivers
7156 +#
7157 +# CONFIG_VGA_CONSOLE is not set
7158 +# CONFIG_MDA_CONSOLE is not set
7159 +
7160 +#
7161 +# Frame-buffer support
7162 +#
7163 +CONFIG_FB=y
7164 +CONFIG_DUMMY_CONSOLE=y
7165 +# CONFIG_FB_CYBER2000 is not set
7166 +# CONFIG_FB_VIRTUAL is not set
7167 +CONFIG_FBCON_ADVANCED=y
7168 +# CONFIG_FBCON_MFB is not set
7169 +# CONFIG_FBCON_CFB2 is not set
7170 +# CONFIG_FBCON_CFB4 is not set
7171 +# CONFIG_FBCON_CFB8 is not set
7172 +CONFIG_FBCON_CFB16=y
7173 +# CONFIG_FBCON_CFB24 is not set
7174 +# CONFIG_FBCON_CFB32 is not set
7175 +# CONFIG_FBCON_AFB is not set
7176 +# CONFIG_FBCON_ILBM is not set
7177 +# CONFIG_FBCON_IPLAN2P2 is not set
7178 +# CONFIG_FBCON_IPLAN2P4 is not set
7179 +# CONFIG_FBCON_IPLAN2P8 is not set
7180 +# CONFIG_FBCON_MAC is not set
7181 +# CONFIG_FBCON_VGA_PLANES is not set
7182 +# CONFIG_FBCON_VGA is not set
7183 +# CONFIG_FBCON_HGA is not set
7184 +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
7185 +CONFIG_FBCON_FONTS=y
7186 +CONFIG_FONT_8x8=y
7187 +CONFIG_FONT_8x16=y
7188 +# CONFIG_FONT_SUN8x16 is not set
7189 +# CONFIG_FONT_SUN12x22 is not set
7190 +# CONFIG_FONT_6x11 is not set
7191 +# CONFIG_FONT_PEARL_8x8 is not set
7192 +# CONFIG_FONT_ACORN_8x8 is not set
7193 +
7194 +#
7195 +# Sound
7196 +#
7197 +CONFIG_SOUND=y
7198 +# CONFIG_SOUND_ALI5455 is not set
7199 +# CONFIG_SOUND_BT878 is not set
7200 +# CONFIG_SOUND_CMPCI is not set
7201 +# CONFIG_SOUND_EMU10K1 is not set
7202 +# CONFIG_MIDI_EMU10K1 is not set
7203 +# CONFIG_SOUND_FUSION is not set
7204 +# CONFIG_SOUND_CS4281 is not set
7205 +# CONFIG_SOUND_ES1370 is not set
7206 +# CONFIG_SOUND_ES1371 is not set
7207 +# CONFIG_SOUND_ESSSOLO1 is not set
7208 +# CONFIG_SOUND_MAESTRO is not set
7209 +# CONFIG_SOUND_MAESTRO3 is not set
7210 +# CONFIG_SOUND_FORTE is not set
7211 +# CONFIG_SOUND_ICH is not set
7212 +# CONFIG_SOUND_RME96XX is not set
7213 +# CONFIG_SOUND_SONICVIBES is not set
7214 +# CONFIG_SOUND_TRIDENT is not set
7215 +# CONFIG_SOUND_MSNDCLAS is not set
7216 +# CONFIG_SOUND_MSNDPIN is not set
7217 +# CONFIG_SOUND_VIA82CXXX is not set
7218 +# CONFIG_MIDI_VIA82CXXX is not set
7219 +# CONFIG_SOUND_OSS is not set
7220 +# CONFIG_SOUND_TVMIXER is not set
7221 +# CONFIG_SOUND_AD1980 is not set
7222 +# CONFIG_SOUND_WM97XX is not set
7223 +
7224 +#
7225 +# USB support
7226 +#
7227 +# CONFIG_USB is not set
7228 +
7229 +#
7230 +# Support for USB gadgets
7231 +#
7232 +# CONFIG_USB_GADGET is not set
7233 +
7234 +#
7235 +# Bluetooth support
7236 +#
7237 +# CONFIG_BLUEZ is not set
7238 +
7239 +#
7240 +# Kernel hacking
7241 +#
7242 +CONFIG_CROSSCOMPILE=y
7243 +# CONFIG_RUNTIME_DEBUG is not set
7244 +# CONFIG_KGDB is not set
7245 +# CONFIG_GDB_CONSOLE is not set
7246 +# CONFIG_DEBUG_INFO is not set
7247 +# CONFIG_MAGIC_SYSRQ is not set
7248 +# CONFIG_MIPS_UNCACHED is not set
7249 +CONFIG_LOG_BUF_SHIFT=0
7250 +
7251 +#
7252 +# Cryptographic options
7253 +#
7254 +# CONFIG_CRYPTO is not set
7255 +
7256 +#
7257 +# Library routines
7258 +#
7259 +# CONFIG_CRC32 is not set
7260 +CONFIG_ZLIB_INFLATE=m
7261 +CONFIG_ZLIB_DEFLATE=m
7262 diff -Nur linux-2.4.29/arch/mips/defconfig-hp-lj linux-mips/arch/mips/defconfig-hp-lj
7263 --- linux-2.4.29/arch/mips/defconfig-hp-lj 2005-01-19 15:09:28.000000000 +0100
7264 +++ linux-mips/arch/mips/defconfig-hp-lj 2005-03-26 11:47:14.993191016 +0100
7265 @@ -30,8 +30,8 @@
7266 # CONFIG_MIPS_PB1000 is not set
7267 # CONFIG_MIPS_PB1100 is not set
7268 # CONFIG_MIPS_PB1500 is not set
7269 -# CONFIG_MIPS_HYDROGEN3 is not set
7270 # CONFIG_MIPS_PB1550 is not set
7271 +# CONFIG_MIPS_HYDROGEN3 is not set
7272 # CONFIG_MIPS_XXS1500 is not set
7273 # CONFIG_MIPS_MTX1 is not set
7274 # CONFIG_COGENT_CSB250 is not set
7275 @@ -184,8 +184,8 @@
7276 # Mapping drivers for chip access
7277 #
7278 CONFIG_MTD_PHYSMAP=y
7279 -CONFIG_MTD_PHYSMAP_START=10040000
7280 -CONFIG_MTD_PHYSMAP_LEN=00fc0000
7281 +CONFIG_MTD_PHYSMAP_START=0x10040000
7282 +CONFIG_MTD_PHYSMAP_LEN=0x00fc0000
7283 CONFIG_MTD_PHYSMAP_BUSWIDTH=4
7284 # CONFIG_MTD_PB1000 is not set
7285 # CONFIG_MTD_PB1500 is not set
7286 @@ -193,9 +193,7 @@
7287 # CONFIG_MTD_BOSPORUS is not set
7288 # CONFIG_MTD_XXS1500 is not set
7289 # CONFIG_MTD_MTX1 is not set
7290 -# CONFIG_MTD_DB1X00 is not set
7291 # CONFIG_MTD_PB1550 is not set
7292 -# CONFIG_MTD_HYDROGEN3 is not set
7293 # CONFIG_MTD_MIRAGE is not set
7294 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7295 # CONFIG_MTD_OCELOT is not set
7296 @@ -214,7 +212,6 @@
7297 #
7298 # Disk-On-Chip Device Drivers
7299 #
7300 -# CONFIG_MTD_DOC1000 is not set
7301 # CONFIG_MTD_DOC2000 is not set
7302 # CONFIG_MTD_DOC2001 is not set
7303 # CONFIG_MTD_DOCPROBE is not set
7304 @@ -304,11 +301,6 @@
7305 #
7306 # CONFIG_IPX is not set
7307 # CONFIG_ATALK is not set
7308 -
7309 -#
7310 -# Appletalk devices
7311 -#
7312 -# CONFIG_DEV_APPLETALK is not set
7313 # CONFIG_DECNET is not set
7314 # CONFIG_BRIDGE is not set
7315 # CONFIG_X25 is not set
7316 @@ -604,7 +596,6 @@
7317 CONFIG_SERIAL_CONSOLE=y
7318 # CONFIG_SERIAL_EXTENDED is not set
7319 # CONFIG_SERIAL_NONSTANDARD is not set
7320 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7321 # CONFIG_UNIX98_PTYS is not set
7322
7323 #
7324 diff -Nur linux-2.4.29/arch/mips/defconfig-hydrogen3 linux-mips/arch/mips/defconfig-hydrogen3
7325 --- linux-2.4.29/arch/mips/defconfig-hydrogen3 2005-01-19 15:09:28.000000000 +0100
7326 +++ linux-mips/arch/mips/defconfig-hydrogen3 2005-03-26 11:47:15.093174606 +0100
7327 @@ -30,8 +30,8 @@
7328 # CONFIG_MIPS_PB1000 is not set
7329 # CONFIG_MIPS_PB1100 is not set
7330 # CONFIG_MIPS_PB1500 is not set
7331 -CONFIG_MIPS_HYDROGEN3=y
7332 # CONFIG_MIPS_PB1550 is not set
7333 +CONFIG_MIPS_HYDROGEN3=y
7334 # CONFIG_MIPS_XXS1500 is not set
7335 # CONFIG_MIPS_MTX1 is not set
7336 # CONFIG_COGENT_CSB250 is not set
7337 @@ -214,9 +214,7 @@
7338 # CONFIG_MTD_BOSPORUS is not set
7339 # CONFIG_MTD_XXS1500 is not set
7340 # CONFIG_MTD_MTX1 is not set
7341 -# CONFIG_MTD_DB1X00 is not set
7342 # CONFIG_MTD_PB1550 is not set
7343 -CONFIG_MTD_HYDROGEN3=y
7344 # CONFIG_MTD_MIRAGE is not set
7345 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7346 # CONFIG_MTD_OCELOT is not set
7347 @@ -235,7 +233,6 @@
7348 #
7349 # Disk-On-Chip Device Drivers
7350 #
7351 -# CONFIG_MTD_DOC1000 is not set
7352 # CONFIG_MTD_DOC2000 is not set
7353 # CONFIG_MTD_DOC2001 is not set
7354 # CONFIG_MTD_DOCPROBE is not set
7355 @@ -340,11 +337,6 @@
7356 #
7357 # CONFIG_IPX is not set
7358 # CONFIG_ATALK is not set
7359 -
7360 -#
7361 -# Appletalk devices
7362 -#
7363 -# CONFIG_DEV_APPLETALK is not set
7364 # CONFIG_DECNET is not set
7365 # CONFIG_BRIDGE is not set
7366 # CONFIG_X25 is not set
7367 @@ -590,7 +582,6 @@
7368 # CONFIG_AU1X00_USB_TTY is not set
7369 # CONFIG_AU1X00_USB_RAW is not set
7370 # CONFIG_TXX927_SERIAL is not set
7371 -CONFIG_MIPS_HYDROGEN3_BUTTONS=y
7372 CONFIG_UNIX98_PTYS=y
7373 CONFIG_UNIX98_PTY_COUNT=256
7374
7375 @@ -838,6 +829,7 @@
7376 # CONFIG_FB_PM2 is not set
7377 # CONFIG_FB_PM3 is not set
7378 # CONFIG_FB_CYBER2000 is not set
7379 +CONFIG_FB_AU1100=y
7380 # CONFIG_FB_MATROX is not set
7381 # CONFIG_FB_ATY is not set
7382 # CONFIG_FB_RADEON is not set
7383 @@ -849,7 +841,6 @@
7384 # CONFIG_FB_VOODOO1 is not set
7385 # CONFIG_FB_TRIDENT is not set
7386 # CONFIG_FB_E1356 is not set
7387 -CONFIG_FB_AU1100=y
7388 # CONFIG_FB_IT8181 is not set
7389 # CONFIG_FB_VIRTUAL is not set
7390 CONFIG_FBCON_ADVANCED=y
7391 diff -Nur linux-2.4.29/arch/mips/defconfig-ip22 linux-mips/arch/mips/defconfig-ip22
7392 --- linux-2.4.29/arch/mips/defconfig-ip22 2005-01-19 15:09:28.000000000 +0100
7393 +++ linux-mips/arch/mips/defconfig-ip22 2005-03-26 11:47:15.165162791 +0100
7394 @@ -30,8 +30,8 @@
7395 # CONFIG_MIPS_PB1000 is not set
7396 # CONFIG_MIPS_PB1100 is not set
7397 # CONFIG_MIPS_PB1500 is not set
7398 -# CONFIG_MIPS_HYDROGEN3 is not set
7399 # CONFIG_MIPS_PB1550 is not set
7400 +# CONFIG_MIPS_HYDROGEN3 is not set
7401 # CONFIG_MIPS_XXS1500 is not set
7402 # CONFIG_MIPS_MTX1 is not set
7403 # CONFIG_COGENT_CSB250 is not set
7404 @@ -235,11 +235,6 @@
7405 #
7406 # CONFIG_IPX is not set
7407 # CONFIG_ATALK is not set
7408 -
7409 -#
7410 -# Appletalk devices
7411 -#
7412 -# CONFIG_DEV_APPLETALK is not set
7413 # CONFIG_DECNET is not set
7414 # CONFIG_BRIDGE is not set
7415 # CONFIG_X25 is not set
7416 @@ -319,9 +314,11 @@
7417 # CONFIG_SCSI_MEGARAID is not set
7418 # CONFIG_SCSI_MEGARAID2 is not set
7419 # CONFIG_SCSI_SATA is not set
7420 +# CONFIG_SCSI_SATA_AHCI is not set
7421 # CONFIG_SCSI_SATA_SVW is not set
7422 # CONFIG_SCSI_ATA_PIIX is not set
7423 # CONFIG_SCSI_SATA_NV is not set
7424 +# CONFIG_SCSI_SATA_QSTOR is not set
7425 # CONFIG_SCSI_SATA_PROMISE is not set
7426 # CONFIG_SCSI_SATA_SX4 is not set
7427 # CONFIG_SCSI_SATA_SIL is not set
7428 @@ -465,7 +462,6 @@
7429 # CONFIG_SERIAL is not set
7430 # CONFIG_SERIAL_EXTENDED is not set
7431 # CONFIG_SERIAL_NONSTANDARD is not set
7432 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7433 CONFIG_UNIX98_PTYS=y
7434 CONFIG_UNIX98_PTY_COUNT=256
7435
7436 diff -Nur linux-2.4.29/arch/mips/defconfig-it8172 linux-mips/arch/mips/defconfig-it8172
7437 --- linux-2.4.29/arch/mips/defconfig-it8172 2005-01-19 15:09:28.000000000 +0100
7438 +++ linux-mips/arch/mips/defconfig-it8172 2005-03-26 11:47:15.242150156 +0100
7439 @@ -30,8 +30,8 @@
7440 # CONFIG_MIPS_PB1000 is not set
7441 # CONFIG_MIPS_PB1100 is not set
7442 # CONFIG_MIPS_PB1500 is not set
7443 -# CONFIG_MIPS_HYDROGEN3 is not set
7444 # CONFIG_MIPS_PB1550 is not set
7445 +# CONFIG_MIPS_HYDROGEN3 is not set
7446 # CONFIG_MIPS_XXS1500 is not set
7447 # CONFIG_MIPS_MTX1 is not set
7448 # CONFIG_COGENT_CSB250 is not set
7449 @@ -186,8 +186,8 @@
7450 # Mapping drivers for chip access
7451 #
7452 CONFIG_MTD_PHYSMAP=y
7453 -CONFIG_MTD_PHYSMAP_START=8000000
7454 -CONFIG_MTD_PHYSMAP_LEN=2000000
7455 +CONFIG_MTD_PHYSMAP_START=0x8000000
7456 +CONFIG_MTD_PHYSMAP_LEN=0x2000000
7457 CONFIG_MTD_PHYSMAP_BUSWIDTH=4
7458 # CONFIG_MTD_PB1000 is not set
7459 # CONFIG_MTD_PB1500 is not set
7460 @@ -195,9 +195,7 @@
7461 # CONFIG_MTD_BOSPORUS is not set
7462 # CONFIG_MTD_XXS1500 is not set
7463 # CONFIG_MTD_MTX1 is not set
7464 -# CONFIG_MTD_DB1X00 is not set
7465 # CONFIG_MTD_PB1550 is not set
7466 -# CONFIG_MTD_HYDROGEN3 is not set
7467 # CONFIG_MTD_MIRAGE is not set
7468 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7469 # CONFIG_MTD_OCELOT is not set
7470 @@ -216,7 +214,6 @@
7471 #
7472 # Disk-On-Chip Device Drivers
7473 #
7474 -# CONFIG_MTD_DOC1000 is not set
7475 # CONFIG_MTD_DOC2000 is not set
7476 # CONFIG_MTD_DOC2001 is not set
7477 # CONFIG_MTD_DOCPROBE is not set
7478 @@ -304,11 +301,6 @@
7479 #
7480 # CONFIG_IPX is not set
7481 # CONFIG_ATALK is not set
7482 -
7483 -#
7484 -# Appletalk devices
7485 -#
7486 -# CONFIG_DEV_APPLETALK is not set
7487 # CONFIG_DECNET is not set
7488 # CONFIG_BRIDGE is not set
7489 # CONFIG_X25 is not set
7490 @@ -592,7 +584,6 @@
7491 CONFIG_PC_KEYB=y
7492 # CONFIG_IT8172_SCR0 is not set
7493 # CONFIG_IT8172_SCR1 is not set
7494 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7495 CONFIG_UNIX98_PTYS=y
7496 CONFIG_UNIX98_PTY_COUNT=256
7497
7498 diff -Nur linux-2.4.29/arch/mips/defconfig-ivr linux-mips/arch/mips/defconfig-ivr
7499 --- linux-2.4.29/arch/mips/defconfig-ivr 2005-01-19 15:09:28.000000000 +0100
7500 +++ linux-mips/arch/mips/defconfig-ivr 2005-03-26 11:47:15.318137685 +0100
7501 @@ -30,8 +30,8 @@
7502 # CONFIG_MIPS_PB1000 is not set
7503 # CONFIG_MIPS_PB1100 is not set
7504 # CONFIG_MIPS_PB1500 is not set
7505 -# CONFIG_MIPS_HYDROGEN3 is not set
7506 # CONFIG_MIPS_PB1550 is not set
7507 +# CONFIG_MIPS_HYDROGEN3 is not set
7508 # CONFIG_MIPS_XXS1500 is not set
7509 # CONFIG_MIPS_MTX1 is not set
7510 # CONFIG_COGENT_CSB250 is not set
7511 @@ -226,11 +226,6 @@
7512 #
7513 # CONFIG_IPX is not set
7514 # CONFIG_ATALK is not set
7515 -
7516 -#
7517 -# Appletalk devices
7518 -#
7519 -# CONFIG_DEV_APPLETALK is not set
7520 # CONFIG_DECNET is not set
7521 # CONFIG_BRIDGE is not set
7522 # CONFIG_X25 is not set
7523 @@ -516,7 +511,6 @@
7524 CONFIG_QTRONIX_KEYBOARD=y
7525 CONFIG_IT8172_CIR=y
7526 # CONFIG_IT8172_SCR0 is not set
7527 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7528 CONFIG_UNIX98_PTYS=y
7529 CONFIG_UNIX98_PTY_COUNT=256
7530
7531 diff -Nur linux-2.4.29/arch/mips/defconfig-jmr3927 linux-mips/arch/mips/defconfig-jmr3927
7532 --- linux-2.4.29/arch/mips/defconfig-jmr3927 2005-01-19 15:09:28.000000000 +0100
7533 +++ linux-mips/arch/mips/defconfig-jmr3927 2005-03-26 11:47:15.384126854 +0100
7534 @@ -28,8 +28,8 @@
7535 # CONFIG_MIPS_PB1000 is not set
7536 # CONFIG_MIPS_PB1100 is not set
7537 # CONFIG_MIPS_PB1500 is not set
7538 -# CONFIG_MIPS_HYDROGEN3 is not set
7539 # CONFIG_MIPS_PB1550 is not set
7540 +# CONFIG_MIPS_HYDROGEN3 is not set
7541 # CONFIG_MIPS_XXS1500 is not set
7542 # CONFIG_MIPS_MTX1 is not set
7543 # CONFIG_COGENT_CSB250 is not set
7544 @@ -225,11 +225,6 @@
7545 #
7546 # CONFIG_IPX is not set
7547 # CONFIG_ATALK is not set
7548 -
7549 -#
7550 -# Appletalk devices
7551 -#
7552 -# CONFIG_DEV_APPLETALK is not set
7553 # CONFIG_DECNET is not set
7554 # CONFIG_BRIDGE is not set
7555 # CONFIG_X25 is not set
7556 @@ -454,7 +449,6 @@
7557 # CONFIG_SERIAL_TXX9_CONSOLE is not set
7558 CONFIG_TXX927_SERIAL=y
7559 CONFIG_TXX927_SERIAL_CONSOLE=y
7560 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7561 # CONFIG_UNIX98_PTYS is not set
7562
7563 #
7564 diff -Nur linux-2.4.29/arch/mips/defconfig-lasat linux-mips/arch/mips/defconfig-lasat
7565 --- linux-2.4.29/arch/mips/defconfig-lasat 2005-01-19 15:09:28.000000000 +0100
7566 +++ linux-mips/arch/mips/defconfig-lasat 2005-03-26 11:47:15.455115204 +0100
7567 @@ -30,8 +30,8 @@
7568 # CONFIG_MIPS_PB1000 is not set
7569 # CONFIG_MIPS_PB1100 is not set
7570 # CONFIG_MIPS_PB1500 is not set
7571 -# CONFIG_MIPS_HYDROGEN3 is not set
7572 # CONFIG_MIPS_PB1550 is not set
7573 +# CONFIG_MIPS_HYDROGEN3 is not set
7574 # CONFIG_MIPS_XXS1500 is not set
7575 # CONFIG_MIPS_MTX1 is not set
7576 # CONFIG_COGENT_CSB250 is not set
7577 @@ -198,9 +198,7 @@
7578 # CONFIG_MTD_BOSPORUS is not set
7579 # CONFIG_MTD_XXS1500 is not set
7580 # CONFIG_MTD_MTX1 is not set
7581 -# CONFIG_MTD_DB1X00 is not set
7582 # CONFIG_MTD_PB1550 is not set
7583 -# CONFIG_MTD_HYDROGEN3 is not set
7584 # CONFIG_MTD_MIRAGE is not set
7585 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7586 # CONFIG_MTD_OCELOT is not set
7587 @@ -219,7 +217,6 @@
7588 #
7589 # Disk-On-Chip Device Drivers
7590 #
7591 -# CONFIG_MTD_DOC1000 is not set
7592 # CONFIG_MTD_DOC2000 is not set
7593 # CONFIG_MTD_DOC2001 is not set
7594 # CONFIG_MTD_DOCPROBE is not set
7595 @@ -303,11 +300,6 @@
7596 #
7597 # CONFIG_IPX is not set
7598 # CONFIG_ATALK is not set
7599 -
7600 -#
7601 -# Appletalk devices
7602 -#
7603 -# CONFIG_DEV_APPLETALK is not set
7604 # CONFIG_DECNET is not set
7605 # CONFIG_BRIDGE is not set
7606 # CONFIG_X25 is not set
7607 @@ -584,7 +576,6 @@
7608 CONFIG_SERIAL_CONSOLE=y
7609 # CONFIG_SERIAL_EXTENDED is not set
7610 # CONFIG_SERIAL_NONSTANDARD is not set
7611 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7612 CONFIG_UNIX98_PTYS=y
7613 CONFIG_UNIX98_PTY_COUNT=256
7614
7615 diff -Nur linux-2.4.29/arch/mips/defconfig-malta linux-mips/arch/mips/defconfig-malta
7616 --- linux-2.4.29/arch/mips/defconfig-malta 2005-01-19 15:09:28.000000000 +0100
7617 +++ linux-mips/arch/mips/defconfig-malta 2005-03-26 11:47:15.526103553 +0100
7618 @@ -30,8 +30,8 @@
7619 # CONFIG_MIPS_PB1000 is not set
7620 # CONFIG_MIPS_PB1100 is not set
7621 # CONFIG_MIPS_PB1500 is not set
7622 -# CONFIG_MIPS_HYDROGEN3 is not set
7623 # CONFIG_MIPS_PB1550 is not set
7624 +# CONFIG_MIPS_HYDROGEN3 is not set
7625 # CONFIG_MIPS_XXS1500 is not set
7626 # CONFIG_MIPS_MTX1 is not set
7627 # CONFIG_COGENT_CSB250 is not set
7628 @@ -237,11 +237,6 @@
7629 #
7630 # CONFIG_IPX is not set
7631 # CONFIG_ATALK is not set
7632 -
7633 -#
7634 -# Appletalk devices
7635 -#
7636 -# CONFIG_DEV_APPLETALK is not set
7637 # CONFIG_DECNET is not set
7638 # CONFIG_BRIDGE is not set
7639 # CONFIG_X25 is not set
7640 @@ -319,9 +314,11 @@
7641 # CONFIG_SCSI_MEGARAID is not set
7642 # CONFIG_SCSI_MEGARAID2 is not set
7643 # CONFIG_SCSI_SATA is not set
7644 +# CONFIG_SCSI_SATA_AHCI is not set
7645 # CONFIG_SCSI_SATA_SVW is not set
7646 # CONFIG_SCSI_ATA_PIIX is not set
7647 # CONFIG_SCSI_SATA_NV is not set
7648 +# CONFIG_SCSI_SATA_QSTOR is not set
7649 # CONFIG_SCSI_SATA_PROMISE is not set
7650 # CONFIG_SCSI_SATA_SX4 is not set
7651 # CONFIG_SCSI_SATA_SIL is not set
7652 @@ -524,7 +521,6 @@
7653 CONFIG_SERIAL_CONSOLE=y
7654 # CONFIG_SERIAL_EXTENDED is not set
7655 # CONFIG_SERIAL_NONSTANDARD is not set
7656 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7657 CONFIG_UNIX98_PTYS=y
7658 CONFIG_UNIX98_PTY_COUNT=256
7659
7660 diff -Nur linux-2.4.29/arch/mips/defconfig-mirage linux-mips/arch/mips/defconfig-mirage
7661 --- linux-2.4.29/arch/mips/defconfig-mirage 2005-01-19 15:09:28.000000000 +0100
7662 +++ linux-mips/arch/mips/defconfig-mirage 2005-03-26 11:47:15.615088948 +0100
7663 @@ -30,8 +30,8 @@
7664 # CONFIG_MIPS_PB1000 is not set
7665 # CONFIG_MIPS_PB1100 is not set
7666 # CONFIG_MIPS_PB1500 is not set
7667 -# CONFIG_MIPS_HYDROGEN3 is not set
7668 # CONFIG_MIPS_PB1550 is not set
7669 +# CONFIG_MIPS_HYDROGEN3 is not set
7670 # CONFIG_MIPS_XXS1500 is not set
7671 # CONFIG_MIPS_MTX1 is not set
7672 # CONFIG_COGENT_CSB250 is not set
7673 @@ -209,9 +209,7 @@
7674 # CONFIG_MTD_BOSPORUS is not set
7675 # CONFIG_MTD_XXS1500 is not set
7676 # CONFIG_MTD_MTX1 is not set
7677 -# CONFIG_MTD_DB1X00 is not set
7678 # CONFIG_MTD_PB1550 is not set
7679 -# CONFIG_MTD_HYDROGEN3 is not set
7680 CONFIG_MTD_MIRAGE=y
7681 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7682 # CONFIG_MTD_OCELOT is not set
7683 @@ -230,7 +228,6 @@
7684 #
7685 # Disk-On-Chip Device Drivers
7686 #
7687 -# CONFIG_MTD_DOC1000 is not set
7688 # CONFIG_MTD_DOC2000 is not set
7689 # CONFIG_MTD_DOC2001 is not set
7690 # CONFIG_MTD_DOCPROBE is not set
7691 @@ -335,11 +332,6 @@
7692 #
7693 # CONFIG_IPX is not set
7694 # CONFIG_ATALK is not set
7695 -
7696 -#
7697 -# Appletalk devices
7698 -#
7699 -# CONFIG_DEV_APPLETALK is not set
7700 # CONFIG_DECNET is not set
7701 # CONFIG_BRIDGE is not set
7702 # CONFIG_X25 is not set
7703 @@ -560,7 +552,6 @@
7704 # CONFIG_AU1X00_USB_TTY is not set
7705 # CONFIG_AU1X00_USB_RAW is not set
7706 # CONFIG_TXX927_SERIAL is not set
7707 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7708 CONFIG_UNIX98_PTYS=y
7709 CONFIG_UNIX98_PTY_COUNT=256
7710
7711 diff -Nur linux-2.4.29/arch/mips/defconfig-mpc30x linux-mips/arch/mips/defconfig-mpc30x
7712 --- linux-2.4.29/arch/mips/defconfig-mpc30x 2005-01-19 15:09:28.000000000 +0100
7713 +++ linux-mips/arch/mips/defconfig-mpc30x 2005-03-26 11:47:15.680078282 +0100
7714 @@ -30,8 +30,8 @@
7715 # CONFIG_MIPS_PB1000 is not set
7716 # CONFIG_MIPS_PB1100 is not set
7717 # CONFIG_MIPS_PB1500 is not set
7718 -# CONFIG_MIPS_HYDROGEN3 is not set
7719 # CONFIG_MIPS_PB1550 is not set
7720 +# CONFIG_MIPS_HYDROGEN3 is not set
7721 # CONFIG_MIPS_XXS1500 is not set
7722 # CONFIG_MIPS_MTX1 is not set
7723 # CONFIG_COGENT_CSB250 is not set
7724 @@ -228,11 +228,6 @@
7725 #
7726 # CONFIG_IPX is not set
7727 # CONFIG_ATALK is not set
7728 -
7729 -#
7730 -# Appletalk devices
7731 -#
7732 -# CONFIG_DEV_APPLETALK is not set
7733 # CONFIG_DECNET is not set
7734 # CONFIG_BRIDGE is not set
7735 # CONFIG_X25 is not set
7736 @@ -400,7 +395,6 @@
7737 CONFIG_SERIAL_CONSOLE=y
7738 # CONFIG_SERIAL_EXTENDED is not set
7739 # CONFIG_SERIAL_NONSTANDARD is not set
7740 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7741 # CONFIG_VR41XX_KIU is not set
7742 CONFIG_UNIX98_PTYS=y
7743 CONFIG_UNIX98_PTY_COUNT=256
7744 diff -Nur linux-2.4.29/arch/mips/defconfig-mtx-1 linux-mips/arch/mips/defconfig-mtx-1
7745 --- linux-2.4.29/arch/mips/defconfig-mtx-1 2005-01-19 15:09:28.000000000 +0100
7746 +++ linux-mips/arch/mips/defconfig-mtx-1 2005-03-26 11:47:15.793059739 +0100
7747 @@ -30,8 +30,8 @@
7748 # CONFIG_MIPS_PB1000 is not set
7749 # CONFIG_MIPS_PB1100 is not set
7750 # CONFIG_MIPS_PB1500 is not set
7751 -# CONFIG_MIPS_HYDROGEN3 is not set
7752 # CONFIG_MIPS_PB1550 is not set
7753 +# CONFIG_MIPS_HYDROGEN3 is not set
7754 # CONFIG_MIPS_XXS1500 is not set
7755 CONFIG_MIPS_MTX1=y
7756 # CONFIG_COGENT_CSB250 is not set
7757 @@ -193,9 +193,7 @@
7758 # CONFIG_MTD_BOSPORUS is not set
7759 # CONFIG_MTD_XXS1500 is not set
7760 CONFIG_MTD_MTX1=y
7761 -# CONFIG_MTD_DB1X00 is not set
7762 # CONFIG_MTD_PB1550 is not set
7763 -# CONFIG_MTD_HYDROGEN3 is not set
7764 # CONFIG_MTD_MIRAGE is not set
7765 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7766 # CONFIG_MTD_OCELOT is not set
7767 @@ -214,7 +212,6 @@
7768 #
7769 # Disk-On-Chip Device Drivers
7770 #
7771 -# CONFIG_MTD_DOC1000 is not set
7772 # CONFIG_MTD_DOC2000 is not set
7773 # CONFIG_MTD_DOC2001 is not set
7774 # CONFIG_MTD_DOCPROBE is not set
7775 @@ -371,11 +368,6 @@
7776 #
7777 # CONFIG_IPX is not set
7778 # CONFIG_ATALK is not set
7779 -
7780 -#
7781 -# Appletalk devices
7782 -#
7783 -# CONFIG_DEV_APPLETALK is not set
7784 # CONFIG_DECNET is not set
7785 CONFIG_BRIDGE=m
7786 # CONFIG_X25 is not set
7787 @@ -479,9 +471,11 @@
7788 # CONFIG_SCSI_MEGARAID is not set
7789 # CONFIG_SCSI_MEGARAID2 is not set
7790 # CONFIG_SCSI_SATA is not set
7791 +# CONFIG_SCSI_SATA_AHCI is not set
7792 # CONFIG_SCSI_SATA_SVW is not set
7793 # CONFIG_SCSI_ATA_PIIX is not set
7794 # CONFIG_SCSI_SATA_NV is not set
7795 +# CONFIG_SCSI_SATA_QSTOR is not set
7796 # CONFIG_SCSI_SATA_PROMISE is not set
7797 # CONFIG_SCSI_SATA_SX4 is not set
7798 # CONFIG_SCSI_SATA_SIL is not set
7799 @@ -700,7 +694,6 @@
7800 # CONFIG_AU1X00_USB_TTY is not set
7801 # CONFIG_AU1X00_USB_RAW is not set
7802 # CONFIG_TXX927_SERIAL is not set
7803 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7804 CONFIG_UNIX98_PTYS=y
7805 CONFIG_UNIX98_PTY_COUNT=256
7806
7807 diff -Nur linux-2.4.29/arch/mips/defconfig-nino linux-mips/arch/mips/defconfig-nino
7808 --- linux-2.4.29/arch/mips/defconfig-nino 2005-01-19 15:09:28.000000000 +0100
7809 +++ linux-mips/arch/mips/defconfig-nino 2005-03-26 11:47:15.849050550 +0100
7810 @@ -30,8 +30,8 @@
7811 # CONFIG_MIPS_PB1000 is not set
7812 # CONFIG_MIPS_PB1100 is not set
7813 # CONFIG_MIPS_PB1500 is not set
7814 -# CONFIG_MIPS_HYDROGEN3 is not set
7815 # CONFIG_MIPS_PB1550 is not set
7816 +# CONFIG_MIPS_HYDROGEN3 is not set
7817 # CONFIG_MIPS_XXS1500 is not set
7818 # CONFIG_MIPS_MTX1 is not set
7819 # CONFIG_COGENT_CSB250 is not set
7820 @@ -226,11 +226,6 @@
7821 #
7822 # CONFIG_IPX is not set
7823 # CONFIG_ATALK is not set
7824 -
7825 -#
7826 -# Appletalk devices
7827 -#
7828 -# CONFIG_DEV_APPLETALK is not set
7829 # CONFIG_DECNET is not set
7830 # CONFIG_BRIDGE is not set
7831 # CONFIG_X25 is not set
7832 @@ -339,7 +334,6 @@
7833 # CONFIG_SERIAL_TXX9 is not set
7834 # CONFIG_SERIAL_TXX9_CONSOLE is not set
7835 # CONFIG_TXX927_SERIAL is not set
7836 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7837 # CONFIG_UNIX98_PTYS is not set
7838
7839 #
7840 diff -Nur linux-2.4.29/arch/mips/defconfig-ocelot linux-mips/arch/mips/defconfig-ocelot
7841 --- linux-2.4.29/arch/mips/defconfig-ocelot 2005-01-19 15:09:28.000000000 +0100
7842 +++ linux-mips/arch/mips/defconfig-ocelot 2005-03-26 11:47:15.909040704 +0100
7843 @@ -28,8 +28,8 @@
7844 # CONFIG_MIPS_PB1000 is not set
7845 # CONFIG_MIPS_PB1100 is not set
7846 # CONFIG_MIPS_PB1500 is not set
7847 -# CONFIG_MIPS_HYDROGEN3 is not set
7848 # CONFIG_MIPS_PB1550 is not set
7849 +# CONFIG_MIPS_HYDROGEN3 is not set
7850 # CONFIG_MIPS_XXS1500 is not set
7851 # CONFIG_MIPS_MTX1 is not set
7852 # CONFIG_COGENT_CSB250 is not set
7853 @@ -194,9 +194,7 @@
7854 # CONFIG_MTD_BOSPORUS is not set
7855 # CONFIG_MTD_XXS1500 is not set
7856 # CONFIG_MTD_MTX1 is not set
7857 -# CONFIG_MTD_DB1X00 is not set
7858 # CONFIG_MTD_PB1550 is not set
7859 -# CONFIG_MTD_HYDROGEN3 is not set
7860 # CONFIG_MTD_MIRAGE is not set
7861 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7862 CONFIG_MTD_OCELOT=y
7863 @@ -215,7 +213,6 @@
7864 #
7865 # Disk-On-Chip Device Drivers
7866 #
7867 -# CONFIG_MTD_DOC1000 is not set
7868 CONFIG_MTD_DOC2000=y
7869 # CONFIG_MTD_DOC2001 is not set
7870 CONFIG_MTD_DOCPROBE=y
7871 @@ -307,11 +304,6 @@
7872 #
7873 # CONFIG_IPX is not set
7874 # CONFIG_ATALK is not set
7875 -
7876 -#
7877 -# Appletalk devices
7878 -#
7879 -# CONFIG_DEV_APPLETALK is not set
7880 # CONFIG_DECNET is not set
7881 # CONFIG_BRIDGE is not set
7882 # CONFIG_X25 is not set
7883 @@ -513,7 +505,6 @@
7884 CONFIG_SERIAL_CONSOLE=y
7885 # CONFIG_SERIAL_EXTENDED is not set
7886 # CONFIG_SERIAL_NONSTANDARD is not set
7887 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7888 CONFIG_UNIX98_PTYS=y
7889 CONFIG_UNIX98_PTY_COUNT=256
7890
7891 diff -Nur linux-2.4.29/arch/mips/defconfig-osprey linux-mips/arch/mips/defconfig-osprey
7892 --- linux-2.4.29/arch/mips/defconfig-osprey 2005-01-19 15:09:28.000000000 +0100
7893 +++ linux-mips/arch/mips/defconfig-osprey 2005-03-26 11:47:15.963031843 +0100
7894 @@ -30,8 +30,8 @@
7895 # CONFIG_MIPS_PB1000 is not set
7896 # CONFIG_MIPS_PB1100 is not set
7897 # CONFIG_MIPS_PB1500 is not set
7898 -# CONFIG_MIPS_HYDROGEN3 is not set
7899 # CONFIG_MIPS_PB1550 is not set
7900 +# CONFIG_MIPS_HYDROGEN3 is not set
7901 # CONFIG_MIPS_XXS1500 is not set
7902 # CONFIG_MIPS_MTX1 is not set
7903 # CONFIG_COGENT_CSB250 is not set
7904 @@ -227,11 +227,6 @@
7905 #
7906 # CONFIG_IPX is not set
7907 # CONFIG_ATALK is not set
7908 -
7909 -#
7910 -# Appletalk devices
7911 -#
7912 -# CONFIG_DEV_APPLETALK is not set
7913 # CONFIG_DECNET is not set
7914 # CONFIG_BRIDGE is not set
7915 # CONFIG_X25 is not set
7916 @@ -388,7 +383,6 @@
7917 # CONFIG_SERIAL_MULTIPORT is not set
7918 # CONFIG_HUB6 is not set
7919 # CONFIG_SERIAL_NONSTANDARD is not set
7920 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7921 # CONFIG_VR41XX_KIU is not set
7922 CONFIG_UNIX98_PTYS=y
7923 CONFIG_UNIX98_PTY_COUNT=256
7924 diff -Nur linux-2.4.29/arch/mips/defconfig-pb1000 linux-mips/arch/mips/defconfig-pb1000
7925 --- linux-2.4.29/arch/mips/defconfig-pb1000 2005-01-19 15:09:28.000000000 +0100
7926 +++ linux-mips/arch/mips/defconfig-pb1000 2005-03-26 11:47:16.057016418 +0100
7927 @@ -30,8 +30,8 @@
7928 CONFIG_MIPS_PB1000=y
7929 # CONFIG_MIPS_PB1100 is not set
7930 # CONFIG_MIPS_PB1500 is not set
7931 -# CONFIG_MIPS_HYDROGEN3 is not set
7932 # CONFIG_MIPS_PB1550 is not set
7933 +# CONFIG_MIPS_HYDROGEN3 is not set
7934 # CONFIG_MIPS_XXS1500 is not set
7935 # CONFIG_MIPS_MTX1 is not set
7936 # CONFIG_COGENT_CSB250 is not set
7937 @@ -215,9 +215,7 @@
7938 # CONFIG_MTD_BOSPORUS is not set
7939 # CONFIG_MTD_XXS1500 is not set
7940 # CONFIG_MTD_MTX1 is not set
7941 -# CONFIG_MTD_DB1X00 is not set
7942 # CONFIG_MTD_PB1550 is not set
7943 -# CONFIG_MTD_HYDROGEN3 is not set
7944 # CONFIG_MTD_MIRAGE is not set
7945 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7946 # CONFIG_MTD_OCELOT is not set
7947 @@ -236,7 +234,6 @@
7948 #
7949 # Disk-On-Chip Device Drivers
7950 #
7951 -# CONFIG_MTD_DOC1000 is not set
7952 # CONFIG_MTD_DOC2000 is not set
7953 # CONFIG_MTD_DOC2001 is not set
7954 # CONFIG_MTD_DOCPROBE is not set
7955 @@ -324,11 +321,6 @@
7956 #
7957 # CONFIG_IPX is not set
7958 # CONFIG_ATALK is not set
7959 -
7960 -#
7961 -# Appletalk devices
7962 -#
7963 -# CONFIG_DEV_APPLETALK is not set
7964 # CONFIG_DECNET is not set
7965 # CONFIG_BRIDGE is not set
7966 # CONFIG_X25 is not set
7967 @@ -622,7 +614,6 @@
7968 # CONFIG_AU1X00_USB_TTY is not set
7969 # CONFIG_AU1X00_USB_RAW is not set
7970 # CONFIG_TXX927_SERIAL is not set
7971 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
7972 CONFIG_UNIX98_PTYS=y
7973 CONFIG_UNIX98_PTY_COUNT=256
7974
7975 @@ -707,7 +698,7 @@
7976 #
7977 # CONFIG_PCMCIA_SERIAL_CS is not set
7978 # CONFIG_SYNCLINK_CS is not set
7979 -CONFIG_AU1X00_GPIO=m
7980 +CONFIG_AU1X00_GPIO=y
7981 # CONFIG_TS_AU1X00_ADS7846 is not set
7982
7983 #
7984 diff -Nur linux-2.4.29/arch/mips/defconfig-pb1100 linux-mips/arch/mips/defconfig-pb1100
7985 --- linux-2.4.29/arch/mips/defconfig-pb1100 2005-01-19 15:09:28.000000000 +0100
7986 +++ linux-mips/arch/mips/defconfig-pb1100 2005-03-26 11:47:16.158999680 +0100
7987 @@ -30,8 +30,8 @@
7988 # CONFIG_MIPS_PB1000 is not set
7989 CONFIG_MIPS_PB1100=y
7990 # CONFIG_MIPS_PB1500 is not set
7991 -# CONFIG_MIPS_HYDROGEN3 is not set
7992 # CONFIG_MIPS_PB1550 is not set
7993 +# CONFIG_MIPS_HYDROGEN3 is not set
7994 # CONFIG_MIPS_XXS1500 is not set
7995 # CONFIG_MIPS_MTX1 is not set
7996 # CONFIG_COGENT_CSB250 is not set
7997 @@ -198,9 +198,7 @@
7998 # CONFIG_MTD_MTX1 is not set
7999 CONFIG_MTD_PB1500_BOOT=y
8000 CONFIG_MTD_PB1500_USER=y
8001 -# CONFIG_MTD_DB1X00 is not set
8002 # CONFIG_MTD_PB1550 is not set
8003 -# CONFIG_MTD_HYDROGEN3 is not set
8004 # CONFIG_MTD_MIRAGE is not set
8005 # CONFIG_MTD_CSTM_MIPS_IXX is not set
8006 # CONFIG_MTD_OCELOT is not set
8007 @@ -219,7 +217,6 @@
8008 #
8009 # Disk-On-Chip Device Drivers
8010 #
8011 -# CONFIG_MTD_DOC1000 is not set
8012 # CONFIG_MTD_DOC2000 is not set
8013 # CONFIG_MTD_DOC2001 is not set
8014 # CONFIG_MTD_DOCPROBE is not set
8015 @@ -324,11 +321,6 @@
8016 #
8017 # CONFIG_IPX is not set
8018 # CONFIG_ATALK is not set
8019 -
8020 -#
8021 -# Appletalk devices
8022 -#
8023 -# CONFIG_DEV_APPLETALK is not set
8024 # CONFIG_DECNET is not set
8025 # CONFIG_BRIDGE is not set
8026 # CONFIG_X25 is not set
8027 @@ -613,7 +605,6 @@
8028 # CONFIG_AU1X00_USB_TTY is not set
8029 # CONFIG_AU1X00_USB_RAW is not set
8030 # CONFIG_TXX927_SERIAL is not set
8031 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
8032 CONFIG_UNIX98_PTYS=y
8033 CONFIG_UNIX98_PTY_COUNT=256
8034
8035 @@ -859,6 +850,7 @@
8036 # CONFIG_FB_PM2 is not set
8037 # CONFIG_FB_PM3 is not set
8038 # CONFIG_FB_CYBER2000 is not set
8039 +CONFIG_FB_AU1100=y
8040 # CONFIG_FB_MATROX is not set
8041 # CONFIG_FB_ATY is not set
8042 # CONFIG_FB_RADEON is not set
8043 @@ -870,7 +862,6 @@
8044 # CONFIG_FB_VOODOO1 is not set
8045 # CONFIG_FB_TRIDENT is not set
8046 # CONFIG_FB_E1356 is not set
8047 -CONFIG_FB_AU1100=y
8048 # CONFIG_FB_IT8181 is not set
8049 # CONFIG_FB_VIRTUAL is not set
8050 CONFIG_FBCON_ADVANCED=y
8051 diff -Nur linux-2.4.29/arch/mips/defconfig-pb1200 linux-mips/arch/mips/defconfig-pb1200
8052 --- linux-2.4.29/arch/mips/defconfig-pb1200 1970-01-01 01:00:00.000000000 +0100
8053 +++ linux-mips/arch/mips/defconfig-pb1200 2005-03-26 11:47:16.258983270 +0100
8054 @@ -0,0 +1,1060 @@
8055 +#
8056 +# Automatically generated make config: don't edit
8057 +#
8058 +CONFIG_MIPS=y
8059 +CONFIG_MIPS32=y
8060 +# CONFIG_MIPS64 is not set
8061 +
8062 +#
8063 +# Code maturity level options
8064 +#
8065 +CONFIG_EXPERIMENTAL=y
8066 +
8067 +#
8068 +# Loadable module support
8069 +#
8070 +CONFIG_MODULES=y
8071 +# CONFIG_MODVERSIONS is not set
8072 +CONFIG_KMOD=y
8073 +
8074 +#
8075 +# Machine selection
8076 +#
8077 +# CONFIG_ACER_PICA_61 is not set
8078 +# CONFIG_MIPS_BOSPORUS is not set
8079 +# CONFIG_MIPS_MIRAGE is not set
8080 +# CONFIG_MIPS_DB1000 is not set
8081 +# CONFIG_MIPS_DB1100 is not set
8082 +# CONFIG_MIPS_DB1500 is not set
8083 +# CONFIG_MIPS_DB1550 is not set
8084 +# CONFIG_MIPS_PB1000 is not set
8085 +# CONFIG_MIPS_PB1100 is not set
8086 +# CONFIG_MIPS_PB1500 is not set
8087 +# CONFIG_MIPS_PB1550 is not set
8088 +# CONFIG_MIPS_HYDROGEN3 is not set
8089 +# CONFIG_MIPS_XXS1500 is not set
8090 +# CONFIG_MIPS_MTX1 is not set
8091 +# CONFIG_COGENT_CSB250 is not set
8092 +# CONFIG_BAGET_MIPS is not set
8093 +# CONFIG_CASIO_E55 is not set
8094 +# CONFIG_MIPS_COBALT is not set
8095 +# CONFIG_DECSTATION is not set
8096 +# CONFIG_MIPS_EV64120 is not set
8097 +# CONFIG_MIPS_EV96100 is not set
8098 +# CONFIG_MIPS_IVR is not set
8099 +# CONFIG_HP_LASERJET is not set
8100 +# CONFIG_IBM_WORKPAD is not set
8101 +# CONFIG_LASAT is not set
8102 +# CONFIG_MIPS_ITE8172 is not set
8103 +# CONFIG_MIPS_ATLAS is not set
8104 +# CONFIG_MIPS_MAGNUM_4000 is not set
8105 +# CONFIG_MIPS_MALTA is not set
8106 +# CONFIG_MIPS_SEAD is not set
8107 +# CONFIG_MOMENCO_OCELOT is not set
8108 +# CONFIG_MOMENCO_OCELOT_G is not set
8109 +# CONFIG_MOMENCO_OCELOT_C is not set
8110 +# CONFIG_MOMENCO_JAGUAR_ATX is not set
8111 +# CONFIG_PMC_BIG_SUR is not set
8112 +# CONFIG_PMC_STRETCH is not set
8113 +# CONFIG_PMC_YOSEMITE is not set
8114 +# CONFIG_DDB5074 is not set
8115 +# CONFIG_DDB5476 is not set
8116 +# CONFIG_DDB5477 is not set
8117 +# CONFIG_NEC_OSPREY is not set
8118 +# CONFIG_NEC_EAGLE is not set
8119 +# CONFIG_OLIVETTI_M700 is not set
8120 +# CONFIG_NINO is not set
8121 +# CONFIG_SGI_IP22 is not set
8122 +# CONFIG_SGI_IP27 is not set
8123 +# CONFIG_SIBYTE_SB1xxx_SOC is not set
8124 +# CONFIG_SNI_RM200_PCI is not set
8125 +# CONFIG_TANBAC_TB0226 is not set
8126 +# CONFIG_TANBAC_TB0229 is not set
8127 +# CONFIG_TOSHIBA_JMR3927 is not set
8128 +# CONFIG_TOSHIBA_RBTX4927 is not set
8129 +# CONFIG_VICTOR_MPC30X is not set
8130 +# CONFIG_ZAO_CAPCELLA is not set
8131 +# CONFIG_HIGHMEM is not set
8132 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
8133 +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
8134 +CONFIG_SOC_AU1X00=y
8135 +CONFIG_SOC_AU1200=y
8136 +CONFIG_NONCOHERENT_IO=y
8137 +CONFIG_PC_KEYB=y
8138 +# CONFIG_MIPS_AU1000 is not set
8139 +
8140 +#
8141 +# CPU selection
8142 +#
8143 +CONFIG_CPU_MIPS32=y
8144 +# CONFIG_CPU_MIPS64 is not set
8145 +# CONFIG_CPU_R3000 is not set
8146 +# CONFIG_CPU_TX39XX is not set
8147 +# CONFIG_CPU_VR41XX is not set
8148 +# CONFIG_CPU_R4300 is not set
8149 +# CONFIG_CPU_R4X00 is not set
8150 +# CONFIG_CPU_TX49XX is not set
8151 +# CONFIG_CPU_R5000 is not set
8152 +# CONFIG_CPU_R5432 is not set
8153 +# CONFIG_CPU_R6000 is not set
8154 +# CONFIG_CPU_NEVADA is not set
8155 +# CONFIG_CPU_R8000 is not set
8156 +# CONFIG_CPU_R10000 is not set
8157 +# CONFIG_CPU_RM7000 is not set
8158 +# CONFIG_CPU_RM9000 is not set
8159 +# CONFIG_CPU_SB1 is not set
8160 +CONFIG_PAGE_SIZE_4KB=y
8161 +# CONFIG_PAGE_SIZE_16KB is not set
8162 +# CONFIG_PAGE_SIZE_64KB is not set
8163 +CONFIG_CPU_HAS_PREFETCH=y
8164 +# CONFIG_VTAG_ICACHE is not set
8165 +CONFIG_64BIT_PHYS_ADDR=y
8166 +# CONFIG_CPU_ADVANCED is not set
8167 +CONFIG_CPU_HAS_LLSC=y
8168 +# CONFIG_CPU_HAS_LLDSCD is not set
8169 +# CONFIG_CPU_HAS_WB is not set
8170 +CONFIG_CPU_HAS_SYNC=y
8171 +
8172 +#
8173 +# General setup
8174 +#
8175 +CONFIG_CPU_LITTLE_ENDIAN=y
8176 +# CONFIG_BUILD_ELF64 is not set
8177 +CONFIG_NET=y
8178 +CONFIG_PCI=y
8179 +CONFIG_PCI_NEW=y
8180 +CONFIG_PCI_AUTO=y
8181 +# CONFIG_PCI_NAMES is not set
8182 +# CONFIG_ISA is not set
8183 +# CONFIG_TC is not set
8184 +# CONFIG_MCA is not set
8185 +# CONFIG_SBUS is not set
8186 +CONFIG_HOTPLUG=y
8187 +
8188 +#
8189 +# PCMCIA/CardBus support
8190 +#
8191 +CONFIG_PCMCIA=m
8192 +# CONFIG_CARDBUS is not set
8193 +# CONFIG_TCIC is not set
8194 +# CONFIG_I82092 is not set
8195 +# CONFIG_I82365 is not set
8196 +CONFIG_PCMCIA_AU1X00=m
8197 +
8198 +#
8199 +# PCI Hotplug Support
8200 +#
8201 +# CONFIG_HOTPLUG_PCI is not set
8202 +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
8203 +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
8204 +# CONFIG_HOTPLUG_PCI_SHPC is not set
8205 +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
8206 +# CONFIG_HOTPLUG_PCI_PCIE is not set
8207 +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
8208 +CONFIG_SYSVIPC=y
8209 +# CONFIG_BSD_PROCESS_ACCT is not set
8210 +CONFIG_SYSCTL=y
8211 +CONFIG_KCORE_ELF=y
8212 +# CONFIG_KCORE_AOUT is not set
8213 +# CONFIG_BINFMT_AOUT is not set
8214 +CONFIG_BINFMT_ELF=y
8215 +# CONFIG_MIPS32_COMPAT is not set
8216 +# CONFIG_MIPS32_O32 is not set
8217 +# CONFIG_MIPS32_N32 is not set
8218 +# CONFIG_BINFMT_ELF32 is not set
8219 +# CONFIG_BINFMT_MISC is not set
8220 +# CONFIG_OOM_KILLER is not set
8221 +CONFIG_CMDLINE_BOOL=y
8222 +CONFIG_CMDLINE="mem=96M"
8223 +# CONFIG_PM is not set
8224 +
8225 +#
8226 +# Memory Technology Devices (MTD)
8227 +#
8228 +# CONFIG_MTD is not set
8229 +
8230 +#
8231 +# Parallel port support
8232 +#
8233 +# CONFIG_PARPORT is not set
8234 +
8235 +#
8236 +# Plug and Play configuration
8237 +#
8238 +# CONFIG_PNP is not set
8239 +# CONFIG_ISAPNP is not set
8240 +
8241 +#
8242 +# Block devices
8243 +#
8244 +# CONFIG_BLK_DEV_FD is not set
8245 +# CONFIG_BLK_DEV_XD is not set
8246 +# CONFIG_PARIDE is not set
8247 +# CONFIG_BLK_CPQ_DA is not set
8248 +# CONFIG_BLK_CPQ_CISS_DA is not set
8249 +# CONFIG_CISS_SCSI_TAPE is not set
8250 +# CONFIG_CISS_MONITOR_THREAD is not set
8251 +# CONFIG_BLK_DEV_DAC960 is not set
8252 +# CONFIG_BLK_DEV_UMEM is not set
8253 +# CONFIG_BLK_DEV_SX8 is not set
8254 +CONFIG_BLK_DEV_LOOP=y
8255 +# CONFIG_BLK_DEV_NBD is not set
8256 +# CONFIG_BLK_DEV_RAM is not set
8257 +# CONFIG_BLK_DEV_INITRD is not set
8258 +# CONFIG_BLK_STATS is not set
8259 +
8260 +#
8261 +# Multi-device support (RAID and LVM)
8262 +#
8263 +# CONFIG_MD is not set
8264 +# CONFIG_BLK_DEV_MD is not set
8265 +# CONFIG_MD_LINEAR is not set
8266 +# CONFIG_MD_RAID0 is not set
8267 +# CONFIG_MD_RAID1 is not set
8268 +# CONFIG_MD_RAID5 is not set
8269 +# CONFIG_MD_MULTIPATH is not set
8270 +# CONFIG_BLK_DEV_LVM is not set
8271 +
8272 +#
8273 +# Networking options
8274 +#
8275 +CONFIG_PACKET=y
8276 +# CONFIG_PACKET_MMAP is not set
8277 +# CONFIG_NETLINK_DEV is not set
8278 +CONFIG_NETFILTER=y
8279 +# CONFIG_NETFILTER_DEBUG is not set
8280 +CONFIG_FILTER=y
8281 +CONFIG_UNIX=y
8282 +CONFIG_INET=y
8283 +CONFIG_IP_MULTICAST=y
8284 +# CONFIG_IP_ADVANCED_ROUTER is not set
8285 +CONFIG_IP_PNP=y
8286 +# CONFIG_IP_PNP_DHCP is not set
8287 +CONFIG_IP_PNP_BOOTP=y
8288 +# CONFIG_IP_PNP_RARP is not set
8289 +# CONFIG_NET_IPIP is not set
8290 +# CONFIG_NET_IPGRE is not set
8291 +# CONFIG_IP_MROUTE is not set
8292 +# CONFIG_ARPD is not set
8293 +# CONFIG_INET_ECN is not set
8294 +# CONFIG_SYN_COOKIES is not set
8295 +
8296 +#
8297 +# IP: Netfilter Configuration
8298 +#
8299 +# CONFIG_IP_NF_CONNTRACK is not set
8300 +# CONFIG_IP_NF_QUEUE is not set
8301 +# CONFIG_IP_NF_IPTABLES is not set
8302 +# CONFIG_IP_NF_ARPTABLES is not set
8303 +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
8304 +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
8305 +
8306 +#
8307 +# IP: Virtual Server Configuration
8308 +#
8309 +# CONFIG_IP_VS is not set
8310 +# CONFIG_IPV6 is not set
8311 +# CONFIG_KHTTPD is not set
8312 +
8313 +#
8314 +# SCTP Configuration (EXPERIMENTAL)
8315 +#
8316 +# CONFIG_IP_SCTP is not set
8317 +# CONFIG_ATM is not set
8318 +# CONFIG_VLAN_8021Q is not set
8319 +
8320 +#
8321 +#
8322 +#
8323 +# CONFIG_IPX is not set
8324 +# CONFIG_ATALK is not set
8325 +# CONFIG_DECNET is not set
8326 +# CONFIG_BRIDGE is not set
8327 +# CONFIG_X25 is not set
8328 +# CONFIG_LAPB is not set
8329 +# CONFIG_LLC is not set
8330 +# CONFIG_NET_DIVERT is not set
8331 +# CONFIG_ECONET is not set
8332 +# CONFIG_WAN_ROUTER is not set
8333 +# CONFIG_NET_FASTROUTE is not set
8334 +# CONFIG_NET_HW_FLOWCONTROL is not set
8335 +
8336 +#
8337 +# QoS and/or fair queueing
8338 +#
8339 +# CONFIG_NET_SCHED is not set
8340 +
8341 +#
8342 +# Network testing
8343 +#
8344 +# CONFIG_NET_PKTGEN is not set
8345 +
8346 +#
8347 +# Telephony Support
8348 +#
8349 +# CONFIG_PHONE is not set
8350 +# CONFIG_PHONE_IXJ is not set
8351 +# CONFIG_PHONE_IXJ_PCMCIA is not set
8352 +
8353 +#
8354 +# ATA/IDE/MFM/RLL support
8355 +#
8356 +CONFIG_IDE=y
8357 +
8358 +#
8359 +# IDE, ATA and ATAPI Block devices
8360 +#
8361 +CONFIG_BLK_DEV_IDE=y
8362 +
8363 +#
8364 +# Please see Documentation/ide.txt for help/info on IDE drives
8365 +#
8366 +# CONFIG_BLK_DEV_HD_IDE is not set
8367 +# CONFIG_BLK_DEV_HD is not set
8368 +# CONFIG_BLK_DEV_IDE_SATA is not set
8369 +CONFIG_BLK_DEV_IDEDISK=y
8370 +CONFIG_IDEDISK_MULTI_MODE=y
8371 +CONFIG_IDEDISK_STROKE=y
8372 +CONFIG_BLK_DEV_IDECS=m
8373 +# CONFIG_BLK_DEV_DELKIN is not set
8374 +# CONFIG_BLK_DEV_IDECD is not set
8375 +# CONFIG_BLK_DEV_IDETAPE is not set
8376 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
8377 +# CONFIG_BLK_DEV_IDESCSI is not set
8378 +# CONFIG_IDE_TASK_IOCTL is not set
8379 +
8380 +#
8381 +# IDE chipset support/bugfixes
8382 +#
8383 +# CONFIG_BLK_DEV_CMD640 is not set
8384 +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
8385 +# CONFIG_BLK_DEV_ISAPNP is not set
8386 +# CONFIG_BLK_DEV_IDEPCI is not set
8387 +# CONFIG_IDE_CHIPSETS is not set
8388 +# CONFIG_IDEDMA_AUTO is not set
8389 +# CONFIG_DMA_NONPCI is not set
8390 +# CONFIG_BLK_DEV_ATARAID is not set
8391 +# CONFIG_BLK_DEV_ATARAID_PDC is not set
8392 +# CONFIG_BLK_DEV_ATARAID_HPT is not set
8393 +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
8394 +# CONFIG_BLK_DEV_ATARAID_SII is not set
8395 +
8396 +#
8397 +# SCSI support
8398 +#
8399 +CONFIG_SCSI=y
8400 +
8401 +#
8402 +# SCSI support type (disk, tape, CD-ROM)
8403 +#
8404 +CONFIG_BLK_DEV_SD=y
8405 +CONFIG_SD_EXTRA_DEVS=40
8406 +CONFIG_CHR_DEV_ST=y
8407 +# CONFIG_CHR_DEV_OSST is not set
8408 +CONFIG_BLK_DEV_SR=y
8409 +# CONFIG_BLK_DEV_SR_VENDOR is not set
8410 +CONFIG_SR_EXTRA_DEVS=2
8411 +# CONFIG_CHR_DEV_SG is not set
8412 +
8413 +#
8414 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
8415 +#
8416 +# CONFIG_SCSI_DEBUG_QUEUES is not set
8417 +# CONFIG_SCSI_MULTI_LUN is not set
8418 +CONFIG_SCSI_CONSTANTS=y
8419 +# CONFIG_SCSI_LOGGING is not set
8420 +
8421 +#
8422 +# SCSI low-level drivers
8423 +#
8424 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
8425 +# CONFIG_SCSI_7000FASST is not set
8426 +# CONFIG_SCSI_ACARD is not set
8427 +# CONFIG_SCSI_AHA152X is not set
8428 +# CONFIG_SCSI_AHA1542 is not set
8429 +# CONFIG_SCSI_AHA1740 is not set
8430 +# CONFIG_SCSI_AACRAID is not set
8431 +# CONFIG_SCSI_AIC7XXX is not set
8432 +# CONFIG_SCSI_AIC79XX is not set
8433 +# CONFIG_SCSI_AIC7XXX_OLD is not set
8434 +# CONFIG_SCSI_DPT_I2O is not set
8435 +# CONFIG_SCSI_ADVANSYS is not set
8436 +# CONFIG_SCSI_IN2000 is not set
8437 +# CONFIG_SCSI_AM53C974 is not set
8438 +# CONFIG_SCSI_MEGARAID is not set
8439 +# CONFIG_SCSI_MEGARAID2 is not set
8440 +# CONFIG_SCSI_SATA is not set
8441 +# CONFIG_SCSI_SATA_AHCI is not set
8442 +# CONFIG_SCSI_SATA_SVW is not set
8443 +# CONFIG_SCSI_ATA_PIIX is not set
8444 +# CONFIG_SCSI_SATA_NV is not set
8445 +# CONFIG_SCSI_SATA_QSTOR is not set
8446 +# CONFIG_SCSI_SATA_PROMISE is not set
8447 +# CONFIG_SCSI_SATA_SX4 is not set
8448 +# CONFIG_SCSI_SATA_SIL is not set
8449 +# CONFIG_SCSI_SATA_SIS is not set
8450 +# CONFIG_SCSI_SATA_ULI is not set
8451 +# CONFIG_SCSI_SATA_VIA is not set
8452 +# CONFIG_SCSI_SATA_VITESSE is not set
8453 +# CONFIG_SCSI_BUSLOGIC is not set
8454 +# CONFIG_SCSI_CPQFCTS is not set
8455 +# CONFIG_SCSI_DMX3191D is not set
8456 +# CONFIG_SCSI_DTC3280 is not set
8457 +# CONFIG_SCSI_EATA is not set
8458 +# CONFIG_SCSI_EATA_DMA is not set
8459 +# CONFIG_SCSI_EATA_PIO is not set
8460 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
8461 +# CONFIG_SCSI_GDTH is not set
8462 +# CONFIG_SCSI_GENERIC_NCR5380 is not set
8463 +# CONFIG_SCSI_INITIO is not set
8464 +# CONFIG_SCSI_INIA100 is not set
8465 +# CONFIG_SCSI_NCR53C406A is not set
8466 +# CONFIG_SCSI_NCR53C7xx is not set
8467 +# CONFIG_SCSI_SYM53C8XX_2 is not set
8468 +# CONFIG_SCSI_NCR53C8XX is not set
8469 +# CONFIG_SCSI_SYM53C8XX is not set
8470 +# CONFIG_SCSI_PAS16 is not set
8471 +# CONFIG_SCSI_PCI2000 is not set
8472 +# CONFIG_SCSI_PCI2220I is not set
8473 +# CONFIG_SCSI_PSI240I is not set
8474 +# CONFIG_SCSI_QLOGIC_FAS is not set
8475 +# CONFIG_SCSI_QLOGIC_ISP is not set
8476 +# CONFIG_SCSI_QLOGIC_FC is not set
8477 +# CONFIG_SCSI_QLOGIC_1280 is not set
8478 +# CONFIG_SCSI_SIM710 is not set
8479 +# CONFIG_SCSI_SYM53C416 is not set
8480 +# CONFIG_SCSI_DC390T is not set
8481 +# CONFIG_SCSI_T128 is not set
8482 +# CONFIG_SCSI_U14_34F is not set
8483 +# CONFIG_SCSI_NSP32 is not set
8484 +# CONFIG_SCSI_DEBUG is not set
8485 +
8486 +#
8487 +# PCMCIA SCSI adapter support
8488 +#
8489 +# CONFIG_SCSI_PCMCIA is not set
8490 +
8491 +#
8492 +# Fusion MPT device support
8493 +#
8494 +# CONFIG_FUSION is not set
8495 +# CONFIG_FUSION_BOOT is not set
8496 +# CONFIG_FUSION_ISENSE is not set
8497 +# CONFIG_FUSION_CTL is not set
8498 +# CONFIG_FUSION_LAN is not set
8499 +
8500 +#
8501 +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
8502 +#
8503 +# CONFIG_IEEE1394 is not set
8504 +
8505 +#
8506 +# I2O device support
8507 +#
8508 +# CONFIG_I2O is not set
8509 +# CONFIG_I2O_PCI is not set
8510 +# CONFIG_I2O_BLOCK is not set
8511 +# CONFIG_I2O_LAN is not set
8512 +# CONFIG_I2O_SCSI is not set
8513 +# CONFIG_I2O_PROC is not set
8514 +
8515 +#
8516 +# Network device support
8517 +#
8518 +CONFIG_NETDEVICES=y
8519 +
8520 +#
8521 +# ARCnet devices
8522 +#
8523 +# CONFIG_ARCNET is not set
8524 +# CONFIG_DUMMY is not set
8525 +# CONFIG_BONDING is not set
8526 +# CONFIG_EQUALIZER is not set
8527 +# CONFIG_TUN is not set
8528 +# CONFIG_ETHERTAP is not set
8529 +
8530 +#
8531 +# Ethernet (10 or 100Mbit)
8532 +#
8533 +CONFIG_NET_ETHERNET=y
8534 +# CONFIG_MIPS_AU1X00_ENET is not set
8535 +# CONFIG_SUNLANCE is not set
8536 +# CONFIG_HAPPYMEAL is not set
8537 +# CONFIG_SUNBMAC is not set
8538 +# CONFIG_SUNQE is not set
8539 +# CONFIG_SUNGEM is not set
8540 +# CONFIG_NET_VENDOR_3COM is not set
8541 +# CONFIG_LANCE is not set
8542 +# CONFIG_NET_VENDOR_SMC is not set
8543 +# CONFIG_NET_VENDOR_RACAL is not set
8544 +# CONFIG_HP100 is not set
8545 +# CONFIG_NET_ISA is not set
8546 +# CONFIG_NET_PCI is not set
8547 +# CONFIG_NET_POCKET is not set
8548 +
8549 +#
8550 +# Ethernet (1000 Mbit)
8551 +#
8552 +# CONFIG_ACENIC is not set
8553 +# CONFIG_DL2K is not set
8554 +# CONFIG_E1000 is not set
8555 +# CONFIG_MYRI_SBUS is not set
8556 +# CONFIG_NS83820 is not set
8557 +# CONFIG_HAMACHI is not set
8558 +# CONFIG_YELLOWFIN is not set
8559 +# CONFIG_R8169 is not set
8560 +# CONFIG_SK98LIN is not set
8561 +# CONFIG_TIGON3 is not set
8562 +# CONFIG_FDDI is not set
8563 +# CONFIG_HIPPI is not set
8564 +# CONFIG_PLIP is not set
8565 +CONFIG_PPP=m
8566 +CONFIG_PPP_MULTILINK=y
8567 +# CONFIG_PPP_FILTER is not set
8568 +CONFIG_PPP_ASYNC=m
8569 +# CONFIG_PPP_SYNC_TTY is not set
8570 +CONFIG_PPP_DEFLATE=m
8571 +# CONFIG_PPP_BSDCOMP is not set
8572 +CONFIG_PPPOE=m
8573 +# CONFIG_SLIP is not set
8574 +
8575 +#
8576 +# Wireless LAN (non-hamradio)
8577 +#
8578 +# CONFIG_NET_RADIO is not set
8579 +
8580 +#
8581 +# Token Ring devices
8582 +#
8583 +# CONFIG_TR is not set
8584 +# CONFIG_NET_FC is not set
8585 +# CONFIG_RCPCI is not set
8586 +# CONFIG_SHAPER is not set
8587 +
8588 +#
8589 +# Wan interfaces
8590 +#
8591 +# CONFIG_WAN is not set
8592 +
8593 +#
8594 +# PCMCIA network device support
8595 +#
8596 +# CONFIG_NET_PCMCIA is not set
8597 +
8598 +#
8599 +# Amateur Radio support
8600 +#
8601 +# CONFIG_HAMRADIO is not set
8602 +
8603 +#
8604 +# IrDA (infrared) support
8605 +#
8606 +# CONFIG_IRDA is not set
8607 +
8608 +#
8609 +# ISDN subsystem
8610 +#
8611 +# CONFIG_ISDN is not set
8612 +
8613 +#
8614 +# Input core support
8615 +#
8616 +CONFIG_INPUT=y
8617 +CONFIG_INPUT_KEYBDEV=y
8618 +CONFIG_INPUT_MOUSEDEV=y
8619 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
8620 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
8621 +# CONFIG_INPUT_JOYDEV is not set
8622 +CONFIG_INPUT_EVDEV=y
8623 +# CONFIG_INPUT_UINPUT is not set
8624 +
8625 +#
8626 +# Character devices
8627 +#
8628 +CONFIG_VT=y
8629 +# CONFIG_VT_CONSOLE is not set
8630 +# CONFIG_SERIAL is not set
8631 +# CONFIG_SERIAL_EXTENDED is not set
8632 +CONFIG_SERIAL_NONSTANDARD=y
8633 +# CONFIG_COMPUTONE is not set
8634 +# CONFIG_ROCKETPORT is not set
8635 +# CONFIG_CYCLADES is not set
8636 +# CONFIG_DIGIEPCA is not set
8637 +# CONFIG_DIGI is not set
8638 +# CONFIG_ESPSERIAL is not set
8639 +# CONFIG_MOXA_INTELLIO is not set
8640 +# CONFIG_MOXA_SMARTIO is not set
8641 +# CONFIG_ISI is not set
8642 +# CONFIG_SYNCLINK is not set
8643 +# CONFIG_SYNCLINKMP is not set
8644 +# CONFIG_N_HDLC is not set
8645 +# CONFIG_RISCOM8 is not set
8646 +# CONFIG_SPECIALIX is not set
8647 +# CONFIG_SX is not set
8648 +# CONFIG_RIO is not set
8649 +# CONFIG_STALDRV is not set
8650 +# CONFIG_SERIAL_TX3912 is not set
8651 +# CONFIG_SERIAL_TX3912_CONSOLE is not set
8652 +# CONFIG_SERIAL_TXX9 is not set
8653 +# CONFIG_SERIAL_TXX9_CONSOLE is not set
8654 +CONFIG_AU1X00_UART=y
8655 +CONFIG_AU1X00_SERIAL_CONSOLE=y
8656 +# CONFIG_AU1X00_USB_TTY is not set
8657 +# CONFIG_AU1X00_USB_RAW is not set
8658 +# CONFIG_TXX927_SERIAL is not set
8659 +CONFIG_UNIX98_PTYS=y
8660 +CONFIG_UNIX98_PTY_COUNT=256
8661 +
8662 +#
8663 +# I2C support
8664 +#
8665 +CONFIG_I2C=y
8666 +# CONFIG_I2C_ALGOBIT is not set
8667 +# CONFIG_SCx200_ACB is not set
8668 +# CONFIG_I2C_ALGOPCF is not set
8669 +# CONFIG_I2C_CHARDEV is not set
8670 +CONFIG_I2C_PROC=y
8671 +
8672 +#
8673 +# Mice
8674 +#
8675 +# CONFIG_BUSMOUSE is not set
8676 +# CONFIG_MOUSE is not set
8677 +
8678 +#
8679 +# Joysticks
8680 +#
8681 +# CONFIG_INPUT_GAMEPORT is not set
8682 +# CONFIG_INPUT_NS558 is not set
8683 +# CONFIG_INPUT_LIGHTNING is not set
8684 +# CONFIG_INPUT_PCIGAME is not set
8685 +# CONFIG_INPUT_CS461X is not set
8686 +# CONFIG_INPUT_EMU10K1 is not set
8687 +# CONFIG_INPUT_SERIO is not set
8688 +# CONFIG_INPUT_SERPORT is not set
8689 +
8690 +#
8691 +# Joysticks
8692 +#
8693 +# CONFIG_INPUT_ANALOG is not set
8694 +# CONFIG_INPUT_A3D is not set
8695 +# CONFIG_INPUT_ADI is not set
8696 +# CONFIG_INPUT_COBRA is not set
8697 +# CONFIG_INPUT_GF2K is not set
8698 +# CONFIG_INPUT_GRIP is not set
8699 +# CONFIG_INPUT_INTERACT is not set
8700 +# CONFIG_INPUT_TMDC is not set
8701 +# CONFIG_INPUT_SIDEWINDER is not set
8702 +# CONFIG_INPUT_IFORCE_USB is not set
8703 +# CONFIG_INPUT_IFORCE_232 is not set
8704 +# CONFIG_INPUT_WARRIOR is not set
8705 +# CONFIG_INPUT_MAGELLAN is not set
8706 +# CONFIG_INPUT_SPACEORB is not set
8707 +# CONFIG_INPUT_SPACEBALL is not set
8708 +# CONFIG_INPUT_STINGER is not set
8709 +# CONFIG_INPUT_DB9 is not set
8710 +# CONFIG_INPUT_GAMECON is not set
8711 +# CONFIG_INPUT_TURBOGRAFX is not set
8712 +# CONFIG_QIC02_TAPE is not set
8713 +# CONFIG_IPMI_HANDLER is not set
8714 +# CONFIG_IPMI_PANIC_EVENT is not set
8715 +# CONFIG_IPMI_DEVICE_INTERFACE is not set
8716 +# CONFIG_IPMI_KCS is not set
8717 +# CONFIG_IPMI_WATCHDOG is not set
8718 +
8719 +#
8720 +# Watchdog Cards
8721 +#
8722 +# CONFIG_WATCHDOG is not set
8723 +# CONFIG_SCx200 is not set
8724 +# CONFIG_SCx200_GPIO is not set
8725 +# CONFIG_AMD_PM768 is not set
8726 +# CONFIG_NVRAM is not set
8727 +# CONFIG_RTC is not set
8728 +# CONFIG_DTLK is not set
8729 +# CONFIG_R3964 is not set
8730 +# CONFIG_APPLICOM is not set
8731 +
8732 +#
8733 +# Ftape, the floppy tape device driver
8734 +#
8735 +# CONFIG_FTAPE is not set
8736 +# CONFIG_AGP is not set
8737 +
8738 +#
8739 +# Direct Rendering Manager (XFree86 DRI support)
8740 +#
8741 +# CONFIG_DRM is not set
8742 +
8743 +#
8744 +# PCMCIA character devices
8745 +#
8746 +# CONFIG_PCMCIA_SERIAL_CS is not set
8747 +# CONFIG_SYNCLINK_CS is not set
8748 +# CONFIG_AU1X00_GPIO is not set
8749 +# CONFIG_TS_AU1X00_ADS7846 is not set
8750 +
8751 +#
8752 +# File systems
8753 +#
8754 +# CONFIG_QUOTA is not set
8755 +# CONFIG_QFMT_V2 is not set
8756 +CONFIG_AUTOFS_FS=y
8757 +# CONFIG_AUTOFS4_FS is not set
8758 +# CONFIG_REISERFS_FS is not set
8759 +# CONFIG_REISERFS_CHECK is not set
8760 +# CONFIG_REISERFS_PROC_INFO is not set
8761 +# CONFIG_ADFS_FS is not set
8762 +# CONFIG_ADFS_FS_RW is not set
8763 +# CONFIG_AFFS_FS is not set
8764 +# CONFIG_HFS_FS is not set
8765 +# CONFIG_HFSPLUS_FS is not set
8766 +# CONFIG_BEFS_FS is not set
8767 +# CONFIG_BEFS_DEBUG is not set
8768 +# CONFIG_BFS_FS is not set
8769 +CONFIG_EXT3_FS=y
8770 +CONFIG_JBD=y
8771 +# CONFIG_JBD_DEBUG is not set
8772 +CONFIG_FAT_FS=y
8773 +CONFIG_MSDOS_FS=y
8774 +# CONFIG_UMSDOS_FS is not set
8775 +CONFIG_VFAT_FS=y
8776 +# CONFIG_EFS_FS is not set
8777 +# CONFIG_JFFS_FS is not set
8778 +# CONFIG_JFFS2_FS is not set
8779 +# CONFIG_CRAMFS is not set
8780 +CONFIG_TMPFS=y
8781 +CONFIG_RAMFS=y
8782 +# CONFIG_ISO9660_FS is not set
8783 +# CONFIG_JOLIET is not set
8784 +# CONFIG_ZISOFS is not set
8785 +# CONFIG_JFS_FS is not set
8786 +# CONFIG_JFS_DEBUG is not set
8787 +# CONFIG_JFS_STATISTICS is not set
8788 +# CONFIG_MINIX_FS is not set
8789 +# CONFIG_VXFS_FS is not set
8790 +# CONFIG_NTFS_FS is not set
8791 +# CONFIG_NTFS_RW is not set
8792 +# CONFIG_HPFS_FS is not set
8793 +CONFIG_PROC_FS=y
8794 +# CONFIG_DEVFS_FS is not set
8795 +# CONFIG_DEVFS_MOUNT is not set
8796 +# CONFIG_DEVFS_DEBUG is not set
8797 +CONFIG_DEVPTS_FS=y
8798 +# CONFIG_QNX4FS_FS is not set
8799 +# CONFIG_QNX4FS_RW is not set
8800 +# CONFIG_ROMFS_FS is not set
8801 +CONFIG_EXT2_FS=y
8802 +# CONFIG_SYSV_FS is not set
8803 +# CONFIG_UDF_FS is not set
8804 +# CONFIG_UDF_RW is not set
8805 +# CONFIG_UFS_FS is not set
8806 +# CONFIG_UFS_FS_WRITE is not set
8807 +# CONFIG_XFS_FS is not set
8808 +# CONFIG_XFS_QUOTA is not set
8809 +# CONFIG_XFS_RT is not set
8810 +# CONFIG_XFS_TRACE is not set
8811 +# CONFIG_XFS_DEBUG is not set
8812 +
8813 +#
8814 +# Network File Systems
8815 +#
8816 +# CONFIG_CODA_FS is not set
8817 +# CONFIG_INTERMEZZO_FS is not set
8818 +CONFIG_NFS_FS=y
8819 +CONFIG_NFS_V3=y
8820 +# CONFIG_NFS_DIRECTIO is not set
8821 +CONFIG_ROOT_NFS=y
8822 +# CONFIG_NFSD is not set
8823 +# CONFIG_NFSD_V3 is not set
8824 +# CONFIG_NFSD_TCP is not set
8825 +CONFIG_SUNRPC=y
8826 +CONFIG_LOCKD=y
8827 +CONFIG_LOCKD_V4=y
8828 +# CONFIG_SMB_FS is not set
8829 +# CONFIG_NCP_FS is not set
8830 +# CONFIG_NCPFS_PACKET_SIGNING is not set
8831 +# CONFIG_NCPFS_IOCTL_LOCKING is not set
8832 +# CONFIG_NCPFS_STRONG is not set
8833 +# CONFIG_NCPFS_NFS_NS is not set
8834 +# CONFIG_NCPFS_OS2_NS is not set
8835 +# CONFIG_NCPFS_SMALLDOS is not set
8836 +# CONFIG_NCPFS_NLS is not set
8837 +# CONFIG_NCPFS_EXTRAS is not set
8838 +# CONFIG_ZISOFS_FS is not set
8839 +
8840 +#
8841 +# Partition Types
8842 +#
8843 +# CONFIG_PARTITION_ADVANCED is not set
8844 +CONFIG_MSDOS_PARTITION=y
8845 +# CONFIG_SMB_NLS is not set
8846 +CONFIG_NLS=y
8847 +
8848 +#
8849 +# Native Language Support
8850 +#
8851 +CONFIG_NLS_DEFAULT="iso8859-1"
8852 +# CONFIG_NLS_CODEPAGE_437 is not set
8853 +# CONFIG_NLS_CODEPAGE_737 is not set
8854 +# CONFIG_NLS_CODEPAGE_775 is not set
8855 +# CONFIG_NLS_CODEPAGE_850 is not set
8856 +# CONFIG_NLS_CODEPAGE_852 is not set
8857 +# CONFIG_NLS_CODEPAGE_855 is not set
8858 +# CONFIG_NLS_CODEPAGE_857 is not set
8859 +# CONFIG_NLS_CODEPAGE_860 is not set
8860 +# CONFIG_NLS_CODEPAGE_861 is not set
8861 +# CONFIG_NLS_CODEPAGE_862 is not set
8862 +# CONFIG_NLS_CODEPAGE_863 is not set
8863 +# CONFIG_NLS_CODEPAGE_864 is not set
8864 +# CONFIG_NLS_CODEPAGE_865 is not set
8865 +# CONFIG_NLS_CODEPAGE_866 is not set
8866 +# CONFIG_NLS_CODEPAGE_869 is not set
8867 +# CONFIG_NLS_CODEPAGE_936 is not set
8868 +# CONFIG_NLS_CODEPAGE_950 is not set
8869 +# CONFIG_NLS_CODEPAGE_932 is not set
8870 +# CONFIG_NLS_CODEPAGE_949 is not set
8871 +# CONFIG_NLS_CODEPAGE_874 is not set
8872 +# CONFIG_NLS_ISO8859_8 is not set
8873 +# CONFIG_NLS_CODEPAGE_1250 is not set
8874 +# CONFIG_NLS_CODEPAGE_1251 is not set
8875 +# CONFIG_NLS_ISO8859_1 is not set
8876 +# CONFIG_NLS_ISO8859_2 is not set
8877 +# CONFIG_NLS_ISO8859_3 is not set
8878 +# CONFIG_NLS_ISO8859_4 is not set
8879 +# CONFIG_NLS_ISO8859_5 is not set
8880 +# CONFIG_NLS_ISO8859_6 is not set
8881 +# CONFIG_NLS_ISO8859_7 is not set
8882 +# CONFIG_NLS_ISO8859_9 is not set
8883 +# CONFIG_NLS_ISO8859_13 is not set
8884 +# CONFIG_NLS_ISO8859_14 is not set
8885 +# CONFIG_NLS_ISO8859_15 is not set
8886 +# CONFIG_NLS_KOI8_R is not set
8887 +# CONFIG_NLS_KOI8_U is not set
8888 +# CONFIG_NLS_UTF8 is not set
8889 +
8890 +#
8891 +# Multimedia devices
8892 +#
8893 +# CONFIG_VIDEO_DEV is not set
8894 +
8895 +#
8896 +# Console drivers
8897 +#
8898 +# CONFIG_VGA_CONSOLE is not set
8899 +# CONFIG_MDA_CONSOLE is not set
8900 +
8901 +#
8902 +# Frame-buffer support
8903 +#
8904 +CONFIG_FB=y
8905 +CONFIG_DUMMY_CONSOLE=y
8906 +# CONFIG_FB_RIVA is not set
8907 +# CONFIG_FB_CLGEN is not set
8908 +# CONFIG_FB_PM2 is not set
8909 +# CONFIG_FB_PM3 is not set
8910 +# CONFIG_FB_CYBER2000 is not set
8911 +# CONFIG_FB_MATROX is not set
8912 +# CONFIG_FB_ATY is not set
8913 +# CONFIG_FB_RADEON is not set
8914 +# CONFIG_FB_ATY128 is not set
8915 +# CONFIG_FB_INTEL is not set
8916 +# CONFIG_FB_SIS is not set
8917 +# CONFIG_FB_NEOMAGIC is not set
8918 +# CONFIG_FB_3DFX is not set
8919 +# CONFIG_FB_VOODOO1 is not set
8920 +# CONFIG_FB_TRIDENT is not set
8921 +# CONFIG_FB_E1356 is not set
8922 +# CONFIG_FB_IT8181 is not set
8923 +# CONFIG_FB_VIRTUAL is not set
8924 +CONFIG_FBCON_ADVANCED=y
8925 +# CONFIG_FBCON_MFB is not set
8926 +# CONFIG_FBCON_CFB2 is not set
8927 +# CONFIG_FBCON_CFB4 is not set
8928 +# CONFIG_FBCON_CFB8 is not set
8929 +CONFIG_FBCON_CFB16=y
8930 +# CONFIG_FBCON_CFB24 is not set
8931 +CONFIG_FBCON_CFB32=y
8932 +# CONFIG_FBCON_AFB is not set
8933 +# CONFIG_FBCON_ILBM is not set
8934 +# CONFIG_FBCON_IPLAN2P2 is not set
8935 +# CONFIG_FBCON_IPLAN2P4 is not set
8936 +# CONFIG_FBCON_IPLAN2P8 is not set
8937 +# CONFIG_FBCON_MAC is not set
8938 +# CONFIG_FBCON_VGA_PLANES is not set
8939 +# CONFIG_FBCON_VGA is not set
8940 +# CONFIG_FBCON_HGA is not set
8941 +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
8942 +CONFIG_FBCON_FONTS=y
8943 +CONFIG_FONT_8x8=y
8944 +CONFIG_FONT_8x16=y
8945 +# CONFIG_FONT_SUN8x16 is not set
8946 +# CONFIG_FONT_SUN12x22 is not set
8947 +# CONFIG_FONT_6x11 is not set
8948 +# CONFIG_FONT_PEARL_8x8 is not set
8949 +# CONFIG_FONT_ACORN_8x8 is not set
8950 +
8951 +#
8952 +# Sound
8953 +#
8954 +CONFIG_SOUND=y
8955 +# CONFIG_SOUND_ALI5455 is not set
8956 +# CONFIG_SOUND_BT878 is not set
8957 +# CONFIG_SOUND_CMPCI is not set
8958 +# CONFIG_SOUND_EMU10K1 is not set
8959 +# CONFIG_MIDI_EMU10K1 is not set
8960 +# CONFIG_SOUND_FUSION is not set
8961 +# CONFIG_SOUND_CS4281 is not set
8962 +# CONFIG_SOUND_ES1370 is not set
8963 +# CONFIG_SOUND_ES1371 is not set
8964 +# CONFIG_SOUND_ESSSOLO1 is not set
8965 +# CONFIG_SOUND_MAESTRO is not set
8966 +# CONFIG_SOUND_MAESTRO3 is not set
8967 +# CONFIG_SOUND_FORTE is not set
8968 +# CONFIG_SOUND_ICH is not set
8969 +# CONFIG_SOUND_RME96XX is not set
8970 +# CONFIG_SOUND_SONICVIBES is not set
8971 +# CONFIG_SOUND_AU1X00 is not set
8972 +CONFIG_SOUND_AU1550_PSC=y
8973 +# CONFIG_SOUND_AU1550_I2S is not set
8974 +# CONFIG_SOUND_TRIDENT is not set
8975 +# CONFIG_SOUND_MSNDCLAS is not set
8976 +# CONFIG_SOUND_MSNDPIN is not set
8977 +# CONFIG_SOUND_VIA82CXXX is not set
8978 +# CONFIG_MIDI_VIA82CXXX is not set
8979 +# CONFIG_SOUND_OSS is not set
8980 +# CONFIG_SOUND_TVMIXER is not set
8981 +# CONFIG_SOUND_AD1980 is not set
8982 +# CONFIG_SOUND_WM97XX is not set
8983 +
8984 +#
8985 +# USB support
8986 +#
8987 +CONFIG_USB=y
8988 +# CONFIG_USB_DEBUG is not set
8989 +
8990 +#
8991 +# Miscellaneous USB options
8992 +#
8993 +CONFIG_USB_DEVICEFS=y
8994 +# CONFIG_USB_BANDWIDTH is not set
8995 +
8996 +#
8997 +# USB Host Controller Drivers
8998 +#
8999 +# CONFIG_USB_EHCI_HCD is not set
9000 +# CONFIG_USB_UHCI is not set
9001 +# CONFIG_USB_UHCI_ALT is not set
9002 +CONFIG_USB_OHCI=y
9003 +
9004 +#
9005 +# USB Device Class drivers
9006 +#
9007 +# CONFIG_USB_AUDIO is not set
9008 +# CONFIG_USB_EMI26 is not set
9009 +# CONFIG_USB_BLUETOOTH is not set
9010 +# CONFIG_USB_MIDI is not set
9011 +CONFIG_USB_STORAGE=y
9012 +# CONFIG_USB_STORAGE_DEBUG is not set
9013 +# CONFIG_USB_STORAGE_DATAFAB is not set
9014 +# CONFIG_USB_STORAGE_FREECOM is not set
9015 +# CONFIG_USB_STORAGE_ISD200 is not set
9016 +# CONFIG_USB_STORAGE_DPCM is not set
9017 +# CONFIG_USB_STORAGE_HP8200e is not set
9018 +# CONFIG_USB_STORAGE_SDDR09 is not set
9019 +# CONFIG_USB_STORAGE_SDDR55 is not set
9020 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
9021 +# CONFIG_USB_ACM is not set
9022 +# CONFIG_USB_PRINTER is not set
9023 +
9024 +#
9025 +# USB Human Interface Devices (HID)
9026 +#
9027 +CONFIG_USB_HID=y
9028 +CONFIG_USB_HIDINPUT=y
9029 +CONFIG_USB_HIDDEV=y
9030 +# CONFIG_USB_AIPTEK is not set
9031 +# CONFIG_USB_WACOM is not set
9032 +# CONFIG_USB_KBTAB is not set
9033 +# CONFIG_USB_POWERMATE is not set
9034 +
9035 +#
9036 +# USB Imaging devices
9037 +#
9038 +# CONFIG_USB_DC2XX is not set
9039 +# CONFIG_USB_MDC800 is not set
9040 +# CONFIG_USB_SCANNER is not set
9041 +# CONFIG_USB_MICROTEK is not set
9042 +# CONFIG_USB_HPUSBSCSI is not set
9043 +
9044 +#
9045 +# USB Multimedia devices
9046 +#
9047 +
9048 +#
9049 +# Video4Linux support is needed for USB Multimedia device support
9050 +#
9051 +
9052 +#
9053 +# USB Network adaptors
9054 +#
9055 +# CONFIG_USB_PEGASUS is not set
9056 +# CONFIG_USB_RTL8150 is not set
9057 +# CONFIG_USB_KAWETH is not set
9058 +# CONFIG_USB_CATC is not set
9059 +# CONFIG_USB_CDCETHER is not set
9060 +# CONFIG_USB_USBNET is not set
9061 +
9062 +#
9063 +# USB port drivers
9064 +#
9065 +# CONFIG_USB_USS720 is not set
9066 +
9067 +#
9068 +# USB Serial Converter support
9069 +#
9070 +# CONFIG_USB_SERIAL is not set
9071 +
9072 +#
9073 +# USB Miscellaneous drivers
9074 +#
9075 +# CONFIG_USB_RIO500 is not set
9076 +# CONFIG_USB_AUERSWALD is not set
9077 +# CONFIG_USB_TIGL is not set
9078 +# CONFIG_USB_BRLVGER is not set
9079 +# CONFIG_USB_LCD is not set
9080 +
9081 +#
9082 +# Support for USB gadgets
9083 +#
9084 +# CONFIG_USB_GADGET is not set
9085 +
9086 +#
9087 +# Bluetooth support
9088 +#
9089 +# CONFIG_BLUEZ is not set
9090 +
9091 +#
9092 +# Kernel hacking
9093 +#
9094 +CONFIG_CROSSCOMPILE=y
9095 +# CONFIG_RUNTIME_DEBUG is not set
9096 +# CONFIG_KGDB is not set
9097 +# CONFIG_GDB_CONSOLE is not set
9098 +# CONFIG_DEBUG_INFO is not set
9099 +# CONFIG_MAGIC_SYSRQ is not set
9100 +# CONFIG_MIPS_UNCACHED is not set
9101 +CONFIG_LOG_BUF_SHIFT=0
9102 +
9103 +#
9104 +# Cryptographic options
9105 +#
9106 +# CONFIG_CRYPTO is not set
9107 +
9108 +#
9109 +# Library routines
9110 +#
9111 +# CONFIG_CRC32 is not set
9112 +CONFIG_ZLIB_INFLATE=m
9113 +CONFIG_ZLIB_DEFLATE=m
9114 +# CONFIG_FW_LOADER is not set
9115 diff -Nur linux-2.4.29/arch/mips/defconfig-pb1500 linux-mips/arch/mips/defconfig-pb1500
9116 --- linux-2.4.29/arch/mips/defconfig-pb1500 2005-01-19 15:09:28.000000000 +0100
9117 +++ linux-mips/arch/mips/defconfig-pb1500 2005-03-26 11:47:16.365965712 +0100
9118 @@ -30,8 +30,8 @@
9119 # CONFIG_MIPS_PB1000 is not set
9120 # CONFIG_MIPS_PB1100 is not set
9121 CONFIG_MIPS_PB1500=y
9122 -# CONFIG_MIPS_HYDROGEN3 is not set
9123 # CONFIG_MIPS_PB1550 is not set
9124 +# CONFIG_MIPS_HYDROGEN3 is not set
9125 # CONFIG_MIPS_XXS1500 is not set
9126 # CONFIG_MIPS_MTX1 is not set
9127 # CONFIG_COGENT_CSB250 is not set
9128 @@ -215,9 +215,7 @@
9129 # CONFIG_MTD_MTX1 is not set
9130 CONFIG_MTD_PB1500_BOOT=y
9131 # CONFIG_MTD_PB1500_USER is not set
9132 -# CONFIG_MTD_DB1X00 is not set
9133 # CONFIG_MTD_PB1550 is not set
9134 -# CONFIG_MTD_HYDROGEN3 is not set
9135 # CONFIG_MTD_MIRAGE is not set
9136 # CONFIG_MTD_CSTM_MIPS_IXX is not set
9137 # CONFIG_MTD_OCELOT is not set
9138 @@ -236,7 +234,6 @@
9139 #
9140 # Disk-On-Chip Device Drivers
9141 #
9142 -# CONFIG_MTD_DOC1000 is not set
9143 # CONFIG_MTD_DOC2000 is not set
9144 # CONFIG_MTD_DOC2001 is not set
9145 # CONFIG_MTD_DOCPROBE is not set
9146 @@ -341,11 +338,6 @@
9147 #
9148 # CONFIG_IPX is not set
9149 # CONFIG_ATALK is not set
9150 -
9151 -#
9152 -# Appletalk devices
9153 -#
9154 -# CONFIG_DEV_APPLETALK is not set
9155 # CONFIG_DECNET is not set
9156 # CONFIG_BRIDGE is not set
9157 # CONFIG_X25 is not set
9158 @@ -675,7 +667,6 @@
9159 # CONFIG_AU1X00_USB_TTY is not set
9160 # CONFIG_AU1X00_USB_RAW is not set
9161 # CONFIG_TXX927_SERIAL is not set
9162 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9163 CONFIG_UNIX98_PTYS=y
9164 CONFIG_UNIX98_PTY_COUNT=256
9165
9166 diff -Nur linux-2.4.29/arch/mips/defconfig-pb1550 linux-mips/arch/mips/defconfig-pb1550
9167 --- linux-2.4.29/arch/mips/defconfig-pb1550 2005-01-19 15:09:29.000000000 +0100
9168 +++ linux-mips/arch/mips/defconfig-pb1550 2005-03-26 11:47:16.471948318 +0100
9169 @@ -30,8 +30,8 @@
9170 # CONFIG_MIPS_PB1000 is not set
9171 # CONFIG_MIPS_PB1100 is not set
9172 # CONFIG_MIPS_PB1500 is not set
9173 -# CONFIG_MIPS_HYDROGEN3 is not set
9174 CONFIG_MIPS_PB1550=y
9175 +# CONFIG_MIPS_HYDROGEN3 is not set
9176 # CONFIG_MIPS_XXS1500 is not set
9177 # CONFIG_MIPS_MTX1 is not set
9178 # CONFIG_COGENT_CSB250 is not set
9179 @@ -213,11 +213,9 @@
9180 # CONFIG_MTD_BOSPORUS is not set
9181 # CONFIG_MTD_XXS1500 is not set
9182 # CONFIG_MTD_MTX1 is not set
9183 -# CONFIG_MTD_DB1X00 is not set
9184 CONFIG_MTD_PB1550=y
9185 CONFIG_MTD_PB1550_BOOT=y
9186 CONFIG_MTD_PB1550_USER=y
9187 -# CONFIG_MTD_HYDROGEN3 is not set
9188 # CONFIG_MTD_MIRAGE is not set
9189 # CONFIG_MTD_CSTM_MIPS_IXX is not set
9190 # CONFIG_MTD_OCELOT is not set
9191 @@ -236,7 +234,6 @@
9192 #
9193 # Disk-On-Chip Device Drivers
9194 #
9195 -# CONFIG_MTD_DOC1000 is not set
9196 # CONFIG_MTD_DOC2000 is not set
9197 # CONFIG_MTD_DOC2001 is not set
9198 # CONFIG_MTD_DOCPROBE is not set
9199 @@ -343,11 +340,6 @@
9200 #
9201 # CONFIG_IPX is not set
9202 # CONFIG_ATALK is not set
9203 -
9204 -#
9205 -# Appletalk devices
9206 -#
9207 -# CONFIG_DEV_APPLETALK is not set
9208 # CONFIG_DECNET is not set
9209 # CONFIG_BRIDGE is not set
9210 # CONFIG_X25 is not set
9211 @@ -633,7 +625,6 @@
9212 # CONFIG_AU1X00_USB_TTY is not set
9213 # CONFIG_AU1X00_USB_RAW is not set
9214 # CONFIG_TXX927_SERIAL is not set
9215 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9216 CONFIG_UNIX98_PTYS=y
9217 CONFIG_UNIX98_PTY_COUNT=256
9218
9219 diff -Nur linux-2.4.29/arch/mips/defconfig-rbtx4927 linux-mips/arch/mips/defconfig-rbtx4927
9220 --- linux-2.4.29/arch/mips/defconfig-rbtx4927 2005-01-19 15:09:29.000000000 +0100
9221 +++ linux-mips/arch/mips/defconfig-rbtx4927 2005-03-26 11:47:16.531938472 +0100
9222 @@ -28,8 +28,8 @@
9223 # CONFIG_MIPS_PB1000 is not set
9224 # CONFIG_MIPS_PB1100 is not set
9225 # CONFIG_MIPS_PB1500 is not set
9226 -# CONFIG_MIPS_HYDROGEN3 is not set
9227 # CONFIG_MIPS_PB1550 is not set
9228 +# CONFIG_MIPS_HYDROGEN3 is not set
9229 # CONFIG_MIPS_XXS1500 is not set
9230 # CONFIG_MIPS_MTX1 is not set
9231 # CONFIG_COGENT_CSB250 is not set
9232 @@ -223,11 +223,6 @@
9233 #
9234 # CONFIG_IPX is not set
9235 # CONFIG_ATALK is not set
9236 -
9237 -#
9238 -# Appletalk devices
9239 -#
9240 -# CONFIG_DEV_APPLETALK is not set
9241 # CONFIG_DECNET is not set
9242 # CONFIG_BRIDGE is not set
9243 # CONFIG_X25 is not set
9244 @@ -466,7 +461,6 @@
9245 CONFIG_SERIAL_TXX9=y
9246 CONFIG_SERIAL_TXX9_CONSOLE=y
9247 # CONFIG_TXX927_SERIAL is not set
9248 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9249 # CONFIG_UNIX98_PTYS is not set
9250
9251 #
9252 diff -Nur linux-2.4.29/arch/mips/defconfig-rm200 linux-mips/arch/mips/defconfig-rm200
9253 --- linux-2.4.29/arch/mips/defconfig-rm200 2005-01-19 15:09:29.000000000 +0100
9254 +++ linux-mips/arch/mips/defconfig-rm200 2005-03-26 11:47:16.579930595 +0100
9255 @@ -30,8 +30,8 @@
9256 # CONFIG_MIPS_PB1000 is not set
9257 # CONFIG_MIPS_PB1100 is not set
9258 # CONFIG_MIPS_PB1500 is not set
9259 -# CONFIG_MIPS_HYDROGEN3 is not set
9260 # CONFIG_MIPS_PB1550 is not set
9261 +# CONFIG_MIPS_HYDROGEN3 is not set
9262 # CONFIG_MIPS_XXS1500 is not set
9263 # CONFIG_MIPS_MTX1 is not set
9264 # CONFIG_COGENT_CSB250 is not set
9265 @@ -229,11 +229,6 @@
9266 #
9267 # CONFIG_IPX is not set
9268 # CONFIG_ATALK is not set
9269 -
9270 -#
9271 -# Appletalk devices
9272 -#
9273 -# CONFIG_DEV_APPLETALK is not set
9274 # CONFIG_DECNET is not set
9275 # CONFIG_BRIDGE is not set
9276 # CONFIG_X25 is not set
9277 @@ -340,7 +335,6 @@
9278 # CONFIG_SERIAL is not set
9279 # CONFIG_SERIAL_EXTENDED is not set
9280 # CONFIG_SERIAL_NONSTANDARD is not set
9281 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9282 CONFIG_UNIX98_PTYS=y
9283 CONFIG_UNIX98_PTY_COUNT=256
9284
9285 diff -Nur linux-2.4.29/arch/mips/defconfig-sb1250-swarm linux-mips/arch/mips/defconfig-sb1250-swarm
9286 --- linux-2.4.29/arch/mips/defconfig-sb1250-swarm 2005-01-19 15:09:29.000000000 +0100
9287 +++ linux-mips/arch/mips/defconfig-sb1250-swarm 2005-03-26 11:47:16.645919765 +0100
9288 @@ -30,8 +30,8 @@
9289 # CONFIG_MIPS_PB1000 is not set
9290 # CONFIG_MIPS_PB1100 is not set
9291 # CONFIG_MIPS_PB1500 is not set
9292 -# CONFIG_MIPS_HYDROGEN3 is not set
9293 # CONFIG_MIPS_PB1550 is not set
9294 +# CONFIG_MIPS_HYDROGEN3 is not set
9295 # CONFIG_MIPS_XXS1500 is not set
9296 # CONFIG_MIPS_MTX1 is not set
9297 # CONFIG_COGENT_CSB250 is not set
9298 @@ -90,6 +90,7 @@
9299 # CONFIG_SIBYTE_TBPROF is not set
9300 CONFIG_SIBYTE_GENBUS_IDE=y
9301 CONFIG_SMP_CAPABLE=y
9302 +CONFIG_MIPS_RTC=y
9303 # CONFIG_SNI_RM200_PCI is not set
9304 # CONFIG_TANBAC_TB0226 is not set
9305 # CONFIG_TANBAC_TB0229 is not set
9306 @@ -253,11 +254,6 @@
9307 #
9308 # CONFIG_IPX is not set
9309 # CONFIG_ATALK is not set
9310 -
9311 -#
9312 -# Appletalk devices
9313 -#
9314 -# CONFIG_DEV_APPLETALK is not set
9315 # CONFIG_DECNET is not set
9316 # CONFIG_BRIDGE is not set
9317 # CONFIG_X25 is not set
9318 @@ -469,7 +465,6 @@
9319 CONFIG_SIBYTE_SB1250_DUART=y
9320 CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
9321 CONFIG_SERIAL_CONSOLE=y
9322 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9323 CONFIG_UNIX98_PTYS=y
9324 CONFIG_UNIX98_PTY_COUNT=256
9325
9326 diff -Nur linux-2.4.29/arch/mips/defconfig-sead linux-mips/arch/mips/defconfig-sead
9327 --- linux-2.4.29/arch/mips/defconfig-sead 2005-01-19 15:09:29.000000000 +0100
9328 +++ linux-mips/arch/mips/defconfig-sead 2005-03-26 11:47:16.686913037 +0100
9329 @@ -28,8 +28,8 @@
9330 # CONFIG_MIPS_PB1000 is not set
9331 # CONFIG_MIPS_PB1100 is not set
9332 # CONFIG_MIPS_PB1500 is not set
9333 -# CONFIG_MIPS_HYDROGEN3 is not set
9334 # CONFIG_MIPS_PB1550 is not set
9335 +# CONFIG_MIPS_HYDROGEN3 is not set
9336 # CONFIG_MIPS_XXS1500 is not set
9337 # CONFIG_MIPS_MTX1 is not set
9338 # CONFIG_COGENT_CSB250 is not set
9339 @@ -244,7 +244,6 @@
9340 CONFIG_SERIAL_CONSOLE=y
9341 # CONFIG_SERIAL_EXTENDED is not set
9342 # CONFIG_SERIAL_NONSTANDARD is not set
9343 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9344 # CONFIG_UNIX98_PTYS is not set
9345
9346 #
9347 diff -Nur linux-2.4.29/arch/mips/defconfig-stretch linux-mips/arch/mips/defconfig-stretch
9348 --- linux-2.4.29/arch/mips/defconfig-stretch 2005-01-19 15:09:29.000000000 +0100
9349 +++ linux-mips/arch/mips/defconfig-stretch 2005-03-26 11:47:16.751902371 +0100
9350 @@ -30,8 +30,8 @@
9351 # CONFIG_MIPS_PB1000 is not set
9352 # CONFIG_MIPS_PB1100 is not set
9353 # CONFIG_MIPS_PB1500 is not set
9354 -# CONFIG_MIPS_HYDROGEN3 is not set
9355 # CONFIG_MIPS_PB1550 is not set
9356 +# CONFIG_MIPS_HYDROGEN3 is not set
9357 # CONFIG_MIPS_XXS1500 is not set
9358 # CONFIG_MIPS_MTX1 is not set
9359 # CONFIG_COGENT_CSB250 is not set
9360 @@ -240,11 +240,6 @@
9361 #
9362 # CONFIG_IPX is not set
9363 # CONFIG_ATALK is not set
9364 -
9365 -#
9366 -# Appletalk devices
9367 -#
9368 -# CONFIG_DEV_APPLETALK is not set
9369 # CONFIG_DECNET is not set
9370 # CONFIG_BRIDGE is not set
9371 # CONFIG_X25 is not set
9372 @@ -324,9 +319,11 @@
9373 # CONFIG_SCSI_MEGARAID is not set
9374 # CONFIG_SCSI_MEGARAID2 is not set
9375 # CONFIG_SCSI_SATA is not set
9376 +# CONFIG_SCSI_SATA_AHCI is not set
9377 # CONFIG_SCSI_SATA_SVW is not set
9378 # CONFIG_SCSI_ATA_PIIX is not set
9379 # CONFIG_SCSI_SATA_NV is not set
9380 +# CONFIG_SCSI_SATA_QSTOR is not set
9381 # CONFIG_SCSI_SATA_PROMISE is not set
9382 # CONFIG_SCSI_SATA_SX4 is not set
9383 # CONFIG_SCSI_SATA_SIL is not set
9384 @@ -516,7 +513,6 @@
9385 # CONFIG_SERIAL_TXX9 is not set
9386 # CONFIG_SERIAL_TXX9_CONSOLE is not set
9387 # CONFIG_TXX927_SERIAL is not set
9388 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9389 CONFIG_UNIX98_PTYS=y
9390 CONFIG_UNIX98_PTY_COUNT=256
9391
9392 diff -Nur linux-2.4.29/arch/mips/defconfig-tb0226 linux-mips/arch/mips/defconfig-tb0226
9393 --- linux-2.4.29/arch/mips/defconfig-tb0226 2005-01-19 15:09:29.000000000 +0100
9394 +++ linux-mips/arch/mips/defconfig-tb0226 2005-03-26 11:47:16.828889735 +0100
9395 @@ -30,8 +30,8 @@
9396 # CONFIG_MIPS_PB1000 is not set
9397 # CONFIG_MIPS_PB1100 is not set
9398 # CONFIG_MIPS_PB1500 is not set
9399 -# CONFIG_MIPS_HYDROGEN3 is not set
9400 # CONFIG_MIPS_PB1550 is not set
9401 +# CONFIG_MIPS_HYDROGEN3 is not set
9402 # CONFIG_MIPS_XXS1500 is not set
9403 # CONFIG_MIPS_MTX1 is not set
9404 # CONFIG_COGENT_CSB250 is not set
9405 @@ -228,11 +228,6 @@
9406 #
9407 # CONFIG_IPX is not set
9408 # CONFIG_ATALK is not set
9409 -
9410 -#
9411 -# Appletalk devices
9412 -#
9413 -# CONFIG_DEV_APPLETALK is not set
9414 # CONFIG_DECNET is not set
9415 # CONFIG_BRIDGE is not set
9416 # CONFIG_X25 is not set
9417 @@ -312,9 +307,11 @@
9418 # CONFIG_SCSI_MEGARAID is not set
9419 # CONFIG_SCSI_MEGARAID2 is not set
9420 # CONFIG_SCSI_SATA is not set
9421 +# CONFIG_SCSI_SATA_AHCI is not set
9422 # CONFIG_SCSI_SATA_SVW is not set
9423 # CONFIG_SCSI_ATA_PIIX is not set
9424 # CONFIG_SCSI_SATA_NV is not set
9425 +# CONFIG_SCSI_SATA_QSTOR is not set
9426 # CONFIG_SCSI_SATA_PROMISE is not set
9427 # CONFIG_SCSI_SATA_SX4 is not set
9428 # CONFIG_SCSI_SATA_SIL is not set
9429 @@ -518,7 +515,6 @@
9430 CONFIG_SERIAL_CONSOLE=y
9431 # CONFIG_SERIAL_EXTENDED is not set
9432 # CONFIG_SERIAL_NONSTANDARD is not set
9433 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9434 # CONFIG_VR41XX_KIU is not set
9435 CONFIG_UNIX98_PTYS=y
9436 CONFIG_UNIX98_PTY_COUNT=256
9437 diff -Nur linux-2.4.29/arch/mips/defconfig-tb0229 linux-mips/arch/mips/defconfig-tb0229
9438 --- linux-2.4.29/arch/mips/defconfig-tb0229 2005-01-19 15:09:29.000000000 +0100
9439 +++ linux-mips/arch/mips/defconfig-tb0229 2005-03-26 11:47:16.893879069 +0100
9440 @@ -30,8 +30,8 @@
9441 # CONFIG_MIPS_PB1000 is not set
9442 # CONFIG_MIPS_PB1100 is not set
9443 # CONFIG_MIPS_PB1500 is not set
9444 -# CONFIG_MIPS_HYDROGEN3 is not set
9445 # CONFIG_MIPS_PB1550 is not set
9446 +# CONFIG_MIPS_HYDROGEN3 is not set
9447 # CONFIG_MIPS_XXS1500 is not set
9448 # CONFIG_MIPS_MTX1 is not set
9449 # CONFIG_COGENT_CSB250 is not set
9450 @@ -230,11 +230,6 @@
9451 #
9452 # CONFIG_IPX is not set
9453 # CONFIG_ATALK is not set
9454 -
9455 -#
9456 -# Appletalk devices
9457 -#
9458 -# CONFIG_DEV_APPLETALK is not set
9459 # CONFIG_DECNET is not set
9460 # CONFIG_BRIDGE is not set
9461 # CONFIG_X25 is not set
9462 @@ -445,7 +440,6 @@
9463 CONFIG_SERIAL_CONSOLE=y
9464 # CONFIG_SERIAL_EXTENDED is not set
9465 # CONFIG_SERIAL_NONSTANDARD is not set
9466 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9467 # CONFIG_VR41XX_KIU is not set
9468 CONFIG_UNIX98_PTYS=y
9469 CONFIG_UNIX98_PTY_COUNT=256
9470 diff -Nur linux-2.4.29/arch/mips/defconfig-ti1500 linux-mips/arch/mips/defconfig-ti1500
9471 --- linux-2.4.29/arch/mips/defconfig-ti1500 2005-01-19 15:09:29.000000000 +0100
9472 +++ linux-mips/arch/mips/defconfig-ti1500 2005-03-26 11:47:16.995862331 +0100
9473 @@ -30,8 +30,8 @@
9474 # CONFIG_MIPS_PB1000 is not set
9475 # CONFIG_MIPS_PB1100 is not set
9476 # CONFIG_MIPS_PB1500 is not set
9477 -# CONFIG_MIPS_HYDROGEN3 is not set
9478 # CONFIG_MIPS_PB1550 is not set
9479 +# CONFIG_MIPS_HYDROGEN3 is not set
9480 CONFIG_MIPS_XXS1500=y
9481 # CONFIG_MIPS_MTX1 is not set
9482 # CONFIG_COGENT_CSB250 is not set
9483 @@ -213,9 +213,7 @@
9484 # CONFIG_MTD_BOSPORUS is not set
9485 CONFIG_MTD_XXS1500=y
9486 # CONFIG_MTD_MTX1 is not set
9487 -# CONFIG_MTD_DB1X00 is not set
9488 # CONFIG_MTD_PB1550 is not set
9489 -# CONFIG_MTD_HYDROGEN3 is not set
9490 # CONFIG_MTD_MIRAGE is not set
9491 # CONFIG_MTD_CSTM_MIPS_IXX is not set
9492 # CONFIG_MTD_OCELOT is not set
9493 @@ -234,7 +232,6 @@
9494 #
9495 # Disk-On-Chip Device Drivers
9496 #
9497 -# CONFIG_MTD_DOC1000 is not set
9498 # CONFIG_MTD_DOC2000 is not set
9499 # CONFIG_MTD_DOC2001 is not set
9500 # CONFIG_MTD_DOCPROBE is not set
9501 @@ -339,11 +336,6 @@
9502 #
9503 # CONFIG_IPX is not set
9504 # CONFIG_ATALK is not set
9505 -
9506 -#
9507 -# Appletalk devices
9508 -#
9509 -# CONFIG_DEV_APPLETALK is not set
9510 # CONFIG_DECNET is not set
9511 # CONFIG_BRIDGE is not set
9512 # CONFIG_X25 is not set
9513 @@ -600,7 +592,6 @@
9514 # CONFIG_AU1X00_USB_TTY is not set
9515 # CONFIG_AU1X00_USB_RAW is not set
9516 # CONFIG_TXX927_SERIAL is not set
9517 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9518 CONFIG_UNIX98_PTYS=y
9519 CONFIG_UNIX98_PTY_COUNT=256
9520
9521 diff -Nur linux-2.4.29/arch/mips/defconfig-workpad linux-mips/arch/mips/defconfig-workpad
9522 --- linux-2.4.29/arch/mips/defconfig-workpad 2005-01-19 15:09:29.000000000 +0100
9523 +++ linux-mips/arch/mips/defconfig-workpad 2005-03-26 11:47:17.054852650 +0100
9524 @@ -30,8 +30,8 @@
9525 # CONFIG_MIPS_PB1000 is not set
9526 # CONFIG_MIPS_PB1100 is not set
9527 # CONFIG_MIPS_PB1500 is not set
9528 -# CONFIG_MIPS_HYDROGEN3 is not set
9529 # CONFIG_MIPS_PB1550 is not set
9530 +# CONFIG_MIPS_HYDROGEN3 is not set
9531 # CONFIG_MIPS_XXS1500 is not set
9532 # CONFIG_MIPS_MTX1 is not set
9533 # CONFIG_COGENT_CSB250 is not set
9534 @@ -222,11 +222,6 @@
9535 #
9536 # CONFIG_IPX is not set
9537 # CONFIG_ATALK is not set
9538 -
9539 -#
9540 -# Appletalk devices
9541 -#
9542 -# CONFIG_DEV_APPLETALK is not set
9543 # CONFIG_DECNET is not set
9544 # CONFIG_BRIDGE is not set
9545 # CONFIG_X25 is not set
9546 @@ -426,7 +421,6 @@
9547 # CONFIG_SERIAL_MULTIPORT is not set
9548 # CONFIG_HUB6 is not set
9549 # CONFIG_SERIAL_NONSTANDARD is not set
9550 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9551 # CONFIG_VR41XX_KIU is not set
9552 CONFIG_UNIX98_PTYS=y
9553 CONFIG_UNIX98_PTY_COUNT=256
9554 diff -Nur linux-2.4.29/arch/mips/defconfig-xxs1500 linux-mips/arch/mips/defconfig-xxs1500
9555 --- linux-2.4.29/arch/mips/defconfig-xxs1500 2005-01-19 15:09:29.000000000 +0100
9556 +++ linux-mips/arch/mips/defconfig-xxs1500 2005-03-26 11:47:17.143838045 +0100
9557 @@ -30,8 +30,8 @@
9558 # CONFIG_MIPS_PB1000 is not set
9559 # CONFIG_MIPS_PB1100 is not set
9560 # CONFIG_MIPS_PB1500 is not set
9561 -# CONFIG_MIPS_HYDROGEN3 is not set
9562 # CONFIG_MIPS_PB1550 is not set
9563 +# CONFIG_MIPS_HYDROGEN3 is not set
9564 CONFIG_MIPS_XXS1500=y
9565 # CONFIG_MIPS_MTX1 is not set
9566 # CONFIG_COGENT_CSB250 is not set
9567 @@ -213,9 +213,7 @@
9568 # CONFIG_MTD_BOSPORUS is not set
9569 CONFIG_MTD_XXS1500=y
9570 # CONFIG_MTD_MTX1 is not set
9571 -# CONFIG_MTD_DB1X00 is not set
9572 # CONFIG_MTD_PB1550 is not set
9573 -# CONFIG_MTD_HYDROGEN3 is not set
9574 # CONFIG_MTD_MIRAGE is not set
9575 # CONFIG_MTD_CSTM_MIPS_IXX is not set
9576 # CONFIG_MTD_OCELOT is not set
9577 @@ -234,7 +232,6 @@
9578 #
9579 # Disk-On-Chip Device Drivers
9580 #
9581 -# CONFIG_MTD_DOC1000 is not set
9582 # CONFIG_MTD_DOC2000 is not set
9583 # CONFIG_MTD_DOC2001 is not set
9584 # CONFIG_MTD_DOCPROBE is not set
9585 @@ -339,11 +336,6 @@
9586 #
9587 # CONFIG_IPX is not set
9588 # CONFIG_ATALK is not set
9589 -
9590 -#
9591 -# Appletalk devices
9592 -#
9593 -# CONFIG_DEV_APPLETALK is not set
9594 # CONFIG_DECNET is not set
9595 # CONFIG_BRIDGE is not set
9596 # CONFIG_X25 is not set
9597 @@ -671,7 +663,6 @@
9598 # CONFIG_AU1X00_USB_TTY is not set
9599 # CONFIG_AU1X00_USB_RAW is not set
9600 # CONFIG_TXX927_SERIAL is not set
9601 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9602 CONFIG_UNIX98_PTYS=y
9603 CONFIG_UNIX98_PTY_COUNT=256
9604
9605 diff -Nur linux-2.4.29/arch/mips/defconfig-yosemite linux-mips/arch/mips/defconfig-yosemite
9606 --- linux-2.4.29/arch/mips/defconfig-yosemite 2005-01-19 15:09:29.000000000 +0100
9607 +++ linux-mips/arch/mips/defconfig-yosemite 2005-03-26 11:47:17.208827379 +0100
9608 @@ -30,8 +30,8 @@
9609 # CONFIG_MIPS_PB1000 is not set
9610 # CONFIG_MIPS_PB1100 is not set
9611 # CONFIG_MIPS_PB1500 is not set
9612 -# CONFIG_MIPS_HYDROGEN3 is not set
9613 # CONFIG_MIPS_PB1550 is not set
9614 +# CONFIG_MIPS_HYDROGEN3 is not set
9615 # CONFIG_MIPS_XXS1500 is not set
9616 # CONFIG_MIPS_MTX1 is not set
9617 # CONFIG_COGENT_CSB250 is not set
9618 @@ -227,11 +227,6 @@
9619 #
9620 # CONFIG_IPX is not set
9621 # CONFIG_ATALK is not set
9622 -
9623 -#
9624 -# Appletalk devices
9625 -#
9626 -# CONFIG_DEV_APPLETALK is not set
9627 # CONFIG_DECNET is not set
9628 # CONFIG_BRIDGE is not set
9629 # CONFIG_X25 is not set
9630 @@ -310,9 +305,11 @@
9631 # CONFIG_SCSI_MEGARAID is not set
9632 # CONFIG_SCSI_MEGARAID2 is not set
9633 # CONFIG_SCSI_SATA is not set
9634 +# CONFIG_SCSI_SATA_AHCI is not set
9635 # CONFIG_SCSI_SATA_SVW is not set
9636 # CONFIG_SCSI_ATA_PIIX is not set
9637 # CONFIG_SCSI_SATA_NV is not set
9638 +# CONFIG_SCSI_SATA_QSTOR is not set
9639 # CONFIG_SCSI_SATA_PROMISE is not set
9640 # CONFIG_SCSI_SATA_SX4 is not set
9641 # CONFIG_SCSI_SATA_SIL is not set
9642 @@ -477,7 +474,6 @@
9643 # CONFIG_SERIAL_TXX9 is not set
9644 # CONFIG_SERIAL_TXX9_CONSOLE is not set
9645 # CONFIG_TXX927_SERIAL is not set
9646 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
9647 CONFIG_UNIX98_PTYS=y
9648 CONFIG_UNIX98_PTY_COUNT=256
9649
9650 diff -Nur linux-2.4.29/arch/mips/kernel/cpu-probe.c linux-mips/arch/mips/kernel/cpu-probe.c
9651 --- linux-2.4.29/arch/mips/kernel/cpu-probe.c 2005-01-19 15:09:29.000000000 +0100
9652 +++ linux-mips/arch/mips/kernel/cpu-probe.c 2005-01-31 12:59:30.000000000 +0100
9653 @@ -105,6 +105,7 @@
9654 case CPU_AU1100:
9655 case CPU_AU1500:
9656 case CPU_AU1550:
9657 + case CPU_AU1200:
9658 if (au1k_wait_ptr != NULL) {
9659 cpu_wait = au1k_wait_ptr;
9660 printk(" available.\n");
9661 diff -Nur linux-2.4.29/arch/mips/kernel/head.S linux-mips/arch/mips/kernel/head.S
9662 --- linux-2.4.29/arch/mips/kernel/head.S 2005-01-19 15:09:29.000000000 +0100
9663 +++ linux-mips/arch/mips/kernel/head.S 2004-11-22 14:38:23.000000000 +0100
9664 @@ -43,9 +43,9 @@
9665
9666 /* Cache Error */
9667 LEAF(except_vec2_generic)
9668 + .set push
9669 .set noreorder
9670 .set noat
9671 - .set mips0
9672 /*
9673 * This is a very bad place to be. Our cache error
9674 * detection has triggered. If we have write-back data
9675 @@ -64,10 +64,9 @@
9676
9677 j cache_parity_error
9678 nop
9679 + .set pop
9680 END(except_vec2_generic)
9681
9682 - .set at
9683 -
9684 /*
9685 * Special interrupt vector for embedded MIPS. This is a
9686 * dedicated interrupt vector which reduces interrupt processing
9687 @@ -76,8 +75,11 @@
9688 * size!
9689 */
9690 NESTED(except_vec4, 0, sp)
9691 + .set push
9692 + .set noreorder
9693 1: j 1b /* Dummy, will be replaced */
9694 nop
9695 + .set pop
9696 END(except_vec4)
9697
9698 /*
9699 @@ -87,8 +89,11 @@
9700 * unconditional jump to this vector.
9701 */
9702 NESTED(except_vec_ejtag_debug, 0, sp)
9703 + .set push
9704 + .set noreorder
9705 j ejtag_debug_handler
9706 nop
9707 + .set pop
9708 END(except_vec_ejtag_debug)
9709
9710 __FINIT
9711 @@ -97,6 +102,7 @@
9712 * EJTAG debug exception handler.
9713 */
9714 NESTED(ejtag_debug_handler, PT_SIZE, sp)
9715 + .set push
9716 .set noat
9717 .set noreorder
9718 mtc0 k0, CP0_DESAVE
9719 @@ -120,7 +126,7 @@
9720 deret
9721 .set mips0
9722 nop
9723 - .set at
9724 + .set pop
9725 END(ejtag_debug_handler)
9726
9727 __INIT
9728 @@ -132,13 +138,17 @@
9729 * unconditional jump to this vector.
9730 */
9731 NESTED(except_vec_nmi, 0, sp)
9732 + .set push
9733 + .set noreorder
9734 j nmi_handler
9735 nop
9736 + .set pop
9737 END(except_vec_nmi)
9738
9739 __FINIT
9740
9741 NESTED(nmi_handler, PT_SIZE, sp)
9742 + .set push
9743 .set noat
9744 .set noreorder
9745 .set mips3
9746 @@ -147,8 +157,7 @@
9747 move a0, sp
9748 RESTORE_ALL
9749 eret
9750 - .set at
9751 - .set mips0
9752 + .set pop
9753 END(nmi_handler)
9754
9755 __INIT
9756 @@ -157,7 +166,20 @@
9757 * Kernel entry point
9758 */
9759 NESTED(kernel_entry, 16, sp)
9760 + .set push
9761 + /*
9762 + * For the moment disable interrupts and mark the kernel mode.
9763 + * A full initialization of the CPU's status register is done
9764 + * later in per_cpu_trap_init().
9765 + */
9766 + mfc0 t0, CP0_STATUS
9767 + or t0, ST0_CU0|0x1f
9768 + xor t0, 0x1f
9769 + mtc0 t0, CP0_STATUS
9770 +
9771 .set noreorder
9772 + sll zero,3 # ehb
9773 + .set reorder
9774
9775 /*
9776 * The firmware/bootloader passes argc/argp/envp
9777 @@ -170,8 +192,8 @@
9778 la t1, (_end - 4)
9779 1:
9780 addiu t0, 4
9781 + sw zero, (t0)
9782 bne t0, t1, 1b
9783 - sw zero, (t0)
9784
9785 /*
9786 * Stack for kernel and init, current variable
9787 @@ -182,7 +204,7 @@
9788 sw t0, kernelsp
9789
9790 jal init_arch
9791 - nop
9792 + .set pop
9793 END(kernel_entry)
9794
9795
9796 @@ -193,17 +215,26 @@
9797 * function after setting up the stack and gp registers.
9798 */
9799 LEAF(smp_bootstrap)
9800 - .set push
9801 - .set noreorder
9802 - mtc0 zero, CP0_WIRED
9803 - CLI
9804 + .set push
9805 + /*
9806 + * For the moment disable interrupts and bootstrap exception
9807 + * vectors and mark the kernel mode. A full initialization of
9808 + * the CPU's status register is done later in
9809 + * per_cpu_trap_init().
9810 + */
9811 mfc0 t0, CP0_STATUS
9812 - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_UX)
9813 - and t0, t1
9814 - or t0, (ST0_CU0);
9815 + or t0, ST0_CU0|ST0_BEV|0x1f
9816 + xor t0, ST0_BEV|0x1f
9817 + mtc0 t0, CP0_STATUS
9818 +
9819 + .set noreorder
9820 + sll zero,3 # ehb
9821 + .set reorder
9822 +
9823 + mtc0 zero, CP0_WIRED
9824 +
9825 jal start_secondary
9826 - mtc0 t0, CP0_STATUS
9827 - .set pop
9828 + .set pop
9829 END(smp_bootstrap)
9830 #endif
9831
9832 diff -Nur linux-2.4.29/arch/mips/kernel/scall_o32.S linux-mips/arch/mips/kernel/scall_o32.S
9833 --- linux-2.4.29/arch/mips/kernel/scall_o32.S 2005-01-19 15:09:29.000000000 +0100
9834 +++ linux-mips/arch/mips/kernel/scall_o32.S 2005-03-26 11:47:17.566768632 +0100
9835 @@ -121,15 +121,14 @@
9836
9837 trace_a_syscall:
9838 SAVE_STATIC
9839 - sw t2, PT_R1(sp)
9840 + move s0, t2
9841 jal syscall_trace
9842 - lw t2, PT_R1(sp)
9843
9844 lw a0, PT_R4(sp) # Restore argument registers
9845 lw a1, PT_R5(sp)
9846 lw a2, PT_R6(sp)
9847 lw a3, PT_R7(sp)
9848 - jalr t2
9849 + jalr s0
9850
9851 li t0, -EMAXERRNO - 1 # error?
9852 sltu t0, t0, v0
9853 diff -Nur linux-2.4.29/arch/mips/kernel/setup.c linux-mips/arch/mips/kernel/setup.c
9854 --- linux-2.4.29/arch/mips/kernel/setup.c 2005-01-19 15:09:29.000000000 +0100
9855 +++ linux-mips/arch/mips/kernel/setup.c 2005-01-13 22:15:57.000000000 +0100
9856 @@ -5,7 +5,7 @@
9857 *
9858 * Copyright (C) 1995 Linus Torvalds
9859 * Copyright (C) 1995 Waldorf Electronics
9860 - * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Ralf Baechle
9861 + * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 01, 05 Ralf Baechle
9862 * Copyright (C) 1996 Stoned Elipot
9863 * Copyright (C) 2000, 2001, 2002 Maciej W. Rozycki
9864 */
9865 @@ -71,6 +71,8 @@
9866 extern struct rtc_ops no_rtc_ops;
9867 struct rtc_ops *rtc_ops;
9868
9869 +EXPORT_SYMBOL(rtc_ops);
9870 +
9871 #ifdef CONFIG_PC_KEYB
9872 struct kbd_ops *kbd_ops;
9873 #endif
9874 @@ -132,10 +134,6 @@
9875 */
9876 load_mmu();
9877
9878 - /* Disable coprocessors and set FPU for 16/32 FPR register model */
9879 - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
9880 - set_c0_status(ST0_CU0);
9881 -
9882 start_kernel();
9883 }
9884
9885 diff -Nur linux-2.4.29/arch/mips/kernel/traps.c linux-mips/arch/mips/kernel/traps.c
9886 --- linux-2.4.29/arch/mips/kernel/traps.c 2005-01-19 15:09:29.000000000 +0100
9887 +++ linux-mips/arch/mips/kernel/traps.c 2004-11-22 14:38:23.000000000 +0100
9888 @@ -887,12 +887,18 @@
9889 void __init per_cpu_trap_init(void)
9890 {
9891 unsigned int cpu = smp_processor_id();
9892 + unsigned int status_set = ST0_CU0;
9893
9894 - /* Some firmware leaves the BEV flag set, clear it. */
9895 - clear_c0_status(ST0_CU3|ST0_CU2|ST0_CU1|ST0_BEV|ST0_KX|ST0_SX|ST0_UX);
9896 -
9897 + /*
9898 + * Disable coprocessors and 64-bit addressing and set FPU for
9899 + * the 16/32 FPR register model. Reset the BEV flag that some
9900 + * firmware may have left set and the TS bit (for IP27). Set
9901 + * XX for ISA IV code to work.
9902 + */
9903 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
9904 - set_c0_status(ST0_XX);
9905 + status_set |= ST0_XX;
9906 + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
9907 + status_set);
9908
9909 /*
9910 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
9911 @@ -902,7 +908,7 @@
9912 set_c0_cause(CAUSEF_IV);
9913
9914 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
9915 - write_c0_context(cpu << 23);
9916 + TLBMISS_HANDLER_SETUP();
9917
9918 atomic_inc(&init_mm.mm_count);
9919 current->active_mm = &init_mm;
9920 @@ -918,8 +924,6 @@
9921 extern char except_vec4;
9922 unsigned long i;
9923
9924 - per_cpu_trap_init();
9925 -
9926 /* Copy the generic exception handler code to it's final destination. */
9927 memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
9928
9929 @@ -1020,10 +1024,5 @@
9930
9931 flush_icache_range(KSEG0, KSEG0 + 0x400);
9932
9933 - atomic_inc(&init_mm.mm_count); /* XXX UP? */
9934 - current->active_mm = &init_mm;
9935 -
9936 - /* XXX Must be done for all CPUs */
9937 - current_cpu_data.asid_cache = ASID_FIRST_VERSION;
9938 - TLBMISS_HANDLER_SETUP();
9939 + per_cpu_trap_init();
9940 }
9941 diff -Nur linux-2.4.29/arch/mips/lib/rtc-no.c linux-mips/arch/mips/lib/rtc-no.c
9942 --- linux-2.4.29/arch/mips/lib/rtc-no.c 2004-02-18 14:36:30.000000000 +0100
9943 +++ linux-mips/arch/mips/lib/rtc-no.c 2005-01-13 22:15:57.000000000 +0100
9944 @@ -6,10 +6,9 @@
9945 * Stub RTC routines to keep Linux from crashing on machine which don't
9946 * have a RTC chip.
9947 *
9948 - * Copyright (C) 1998, 2001 by Ralf Baechle
9949 + * Copyright (C) 1998, 2001, 2005 by Ralf Baechle
9950 */
9951 #include <linux/kernel.h>
9952 -#include <linux/module.h>
9953 #include <linux/mc146818rtc.h>
9954
9955 static unsigned int shouldnt_happen(void)
9956 @@ -29,5 +28,3 @@
9957 .rtc_write_data = (void *) &shouldnt_happen,
9958 .rtc_bcd_mode = (void *) &shouldnt_happen
9959 };
9960 -
9961 -EXPORT_SYMBOL(rtc_ops);
9962 diff -Nur linux-2.4.29/arch/mips/lib/rtc-std.c linux-mips/arch/mips/lib/rtc-std.c
9963 --- linux-2.4.29/arch/mips/lib/rtc-std.c 2004-02-18 14:36:30.000000000 +0100
9964 +++ linux-mips/arch/mips/lib/rtc-std.c 2005-01-13 22:15:57.000000000 +0100
9965 @@ -5,9 +5,8 @@
9966 *
9967 * RTC routines for PC style attached Dallas chip.
9968 *
9969 - * Copyright (C) 1998, 2001 by Ralf Baechle
9970 + * Copyright (C) 1998, 2001, 05 by Ralf Baechle
9971 */
9972 -#include <linux/module.h>
9973 #include <linux/mc146818rtc.h>
9974 #include <asm/io.h>
9975
9976 @@ -33,5 +32,3 @@
9977 &std_rtc_write_data,
9978 &std_rtc_bcd_mode
9979 };
9980 -
9981 -EXPORT_SYMBOL(rtc_ops);
9982 diff -Nur linux-2.4.29/arch/mips/Makefile linux-mips/arch/mips/Makefile
9983 --- linux-2.4.29/arch/mips/Makefile 2005-01-19 15:09:26.000000000 +0100
9984 +++ linux-mips/arch/mips/Makefile 2005-01-31 12:59:28.000000000 +0100
9985 @@ -211,7 +211,7 @@
9986 endif
9987
9988 #
9989 -# Au1000 (Alchemy Semi PB1000) eval board
9990 +# Au1x AMD Alchemy eval boards
9991 #
9992 ifdef CONFIG_MIPS_PB1000
9993 LIBS += arch/mips/au1000/pb1000/pb1000.o \
9994 @@ -220,9 +220,6 @@
9995 LOADADDR := 0x80100000
9996 endif
9997
9998 -#
9999 -# Au1100 (Alchemy Semi PB1100) eval board
10000 -#
10001 ifdef CONFIG_MIPS_PB1100
10002 LIBS += arch/mips/au1000/pb1100/pb1100.o \
10003 arch/mips/au1000/common/au1000.o
10004 @@ -230,9 +227,6 @@
10005 LOADADDR += 0x80100000
10006 endif
10007
10008 -#
10009 -# Au1500 (Alchemy Semi PB1500) eval board
10010 -#
10011 ifdef CONFIG_MIPS_PB1500
10012 LIBS += arch/mips/au1000/pb1500/pb1500.o \
10013 arch/mips/au1000/common/au1000.o
10014 @@ -240,9 +234,6 @@
10015 LOADADDR := 0x80100000
10016 endif
10017
10018 -#
10019 -# Au1x00 (AMD/Alchemy) eval boards
10020 -#
10021 ifdef CONFIG_MIPS_DB1000
10022 LIBS += arch/mips/au1000/db1x00/db1x00.o \
10023 arch/mips/au1000/common/au1000.o
10024 @@ -313,6 +304,27 @@
10025 LOADADDR += 0x80100000
10026 endif
10027
10028 +ifdef CONFIG_MIPS_PB1200
10029 +LIBS += arch/mips/au1000/pb1200/pb1200.o \
10030 + arch/mips/au1000/common/au1000.o
10031 +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
10032 +LOADADDR += 0x80100000
10033 +endif
10034 +
10035 +ifdef CONFIG_MIPS_DB1200
10036 +LIBS += arch/mips/au1000/pb1200/pb1200.o \
10037 + arch/mips/au1000/common/au1000.o
10038 +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
10039 +LOADADDR += 0x80100000
10040 +endif
10041 +
10042 +ifdef CONFIG_MIPS_FICMMP
10043 +LIBS += arch/mips/au1000/ficmmp/ficmmp.o \
10044 + arch/mips/au1000/common/au1000.o
10045 +SUBDIRS += arch/mips/au1000/ficmmp arch/mips/au1000/common
10046 +LOADADDR += 0x80100000
10047 +endif
10048 +
10049
10050 #
10051 # Cogent CSB250
10052 diff -Nur linux-2.4.29/arch/mips/mm/cerr-sb1.c linux-mips/arch/mips/mm/cerr-sb1.c
10053 --- linux-2.4.29/arch/mips/mm/cerr-sb1.c 2004-02-18 14:36:30.000000000 +0100
10054 +++ linux-mips/arch/mips/mm/cerr-sb1.c 2004-12-13 18:37:23.000000000 +0100
10055 @@ -252,14 +252,14 @@
10056
10057 /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
10058 static const uint64_t mask_72_64[8] = {
10059 - 0x0738C808099264FFL,
10060 - 0x38C808099264FF07L,
10061 - 0xC808099264FF0738L,
10062 - 0x08099264FF0738C8L,
10063 - 0x099264FF0738C808L,
10064 - 0x9264FF0738C80809L,
10065 - 0x64FF0738C8080992L,
10066 - 0xFF0738C808099264L
10067 + 0x0738C808099264FFULL,
10068 + 0x38C808099264FF07ULL,
10069 + 0xC808099264FF0738ULL,
10070 + 0x08099264FF0738C8ULL,
10071 + 0x099264FF0738C808ULL,
10072 + 0x9264FF0738C80809ULL,
10073 + 0x64FF0738C8080992ULL,
10074 + 0xFF0738C808099264ULL
10075 };
10076
10077 /* Calculate the parity on a range of bits */
10078 @@ -331,9 +331,9 @@
10079 ((lru >> 4) & 0x3),
10080 ((lru >> 6) & 0x3));
10081 }
10082 - va = (taglo & 0xC0000FFFFFFFE000) | addr;
10083 + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
10084 if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
10085 - va |= 0x3FFFF00000000000;
10086 + va |= 0x3FFFF00000000000ULL;
10087 valid = ((taghi >> 29) & 1);
10088 if (valid) {
10089 tlo_tmp = taglo & 0xfff3ff;
10090 @@ -474,7 +474,7 @@
10091 : "r" ((way << 13) | addr));
10092
10093 taglo = ((unsigned long long)taglohi << 32) | taglolo;
10094 - pa = (taglo & 0xFFFFFFE000) | addr;
10095 + pa = (taglo & 0xFFFFFFE000ULL) | addr;
10096 if (way == 0) {
10097 lru = (taghi >> 14) & 0xff;
10098 prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
10099 diff -Nur linux-2.4.29/arch/mips/mm/c-r4k.c linux-mips/arch/mips/mm/c-r4k.c
10100 --- linux-2.4.29/arch/mips/mm/c-r4k.c 2005-01-19 15:09:29.000000000 +0100
10101 +++ linux-mips/arch/mips/mm/c-r4k.c 2005-03-26 11:47:17.585765515 +0100
10102 @@ -867,9 +867,16 @@
10103 * normally they'd suffer from aliases but magic in the hardware deals
10104 * with that for us so we don't need to take care ourselves.
10105 */
10106 - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
10107 - if (c->dcache.waysize > PAGE_SIZE)
10108 - c->dcache.flags |= MIPS_CACHE_ALIASES;
10109 + switch (c->cputype) {
10110 + case CPU_R10000:
10111 + case CPU_R12000:
10112 + break;
10113 + case CPU_24K:
10114 + if (!(read_c0_config7() & (1 << 16)))
10115 + default:
10116 + if (c->dcache.waysize > PAGE_SIZE)
10117 + c->dcache.flags |= MIPS_CACHE_ALIASES;
10118 + }
10119
10120 switch (c->cputype) {
10121 case CPU_20KC:
10122 @@ -1069,9 +1076,6 @@
10123 probe_pcache();
10124 setup_scache();
10125
10126 - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
10127 - c->dcache.flags |= MIPS_CACHE_ALIASES;
10128 -
10129 r4k_blast_dcache_page_setup();
10130 r4k_blast_dcache_page_indexed_setup();
10131 r4k_blast_dcache_setup();
10132 diff -Nur linux-2.4.29/arch/mips/mm/tlbex-mips32.S linux-mips/arch/mips/mm/tlbex-mips32.S
10133 --- linux-2.4.29/arch/mips/mm/tlbex-mips32.S 2004-02-18 14:36:30.000000000 +0100
10134 +++ linux-mips/arch/mips/mm/tlbex-mips32.S 2004-11-29 00:33:15.000000000 +0100
10135 @@ -196,7 +196,7 @@
10136 .set noat; \
10137 SAVE_ALL; \
10138 mfc0 a2, CP0_BADVADDR; \
10139 - STI; \
10140 + KMODE; \
10141 .set at; \
10142 move a0, sp; \
10143 jal do_page_fault; \
10144 diff -Nur linux-2.4.29/arch/mips/mm/tlbex-r4k.S linux-mips/arch/mips/mm/tlbex-r4k.S
10145 --- linux-2.4.29/arch/mips/mm/tlbex-r4k.S 2004-02-18 14:36:30.000000000 +0100
10146 +++ linux-mips/arch/mips/mm/tlbex-r4k.S 2004-11-25 23:18:38.000000000 +0100
10147 @@ -184,13 +184,10 @@
10148 P_MTC0 k0, CP0_ENTRYLO0 # load it
10149 PTE_SRL k1, k1, 6 # convert to entrylo1
10150 P_MTC0 k1, CP0_ENTRYLO1 # load it
10151 - b 1f
10152 - rm9000_tlb_hazard
10153 + mtc0_tlbw_hazard
10154 tlbwr # write random tlb entry
10155 -1:
10156 - nop
10157 - rm9000_tlb_hazard
10158 - eret # return from trap
10159 + tlbw_eret_hazard
10160 + eret
10161 END(except_vec0_r4000)
10162
10163 /* TLB refill, EXL == 0, R4600 version */
10164 @@ -468,13 +465,10 @@
10165 PTE_PRESENT(k0, k1, nopage_tlbl)
10166 PTE_MAKEVALID(k0, k1)
10167 PTE_RELOAD(k1, k0)
10168 - rm9000_tlb_hazard
10169 - nop
10170 - b 1f
10171 - tlbwi
10172 -1:
10173 + mtc0_tlbw_hazard
10174 + tlbwi
10175 nop
10176 - rm9000_tlb_hazard
10177 + tlbw_eret_hazard
10178 .set mips3
10179 eret
10180 .set mips0
10181 @@ -496,13 +490,10 @@
10182 PTE_WRITABLE(k0, k1, nopage_tlbs)
10183 PTE_MAKEWRITE(k0, k1)
10184 PTE_RELOAD(k1, k0)
10185 - rm9000_tlb_hazard
10186 - nop
10187 - b 1f
10188 - tlbwi
10189 -1:
10190 + mtc0_tlbw_hazard
10191 + tlbwi
10192 nop
10193 - rm9000_tlb_hazard
10194 + tlbw_eret_hazard
10195 .set mips3
10196 eret
10197 .set mips0
10198 @@ -529,13 +520,10 @@
10199
10200 /* Now reload the entry into the tlb. */
10201 PTE_RELOAD(k1, k0)
10202 - rm9000_tlb_hazard
10203 - nop
10204 - b 1f
10205 - tlbwi
10206 -1:
10207 - rm9000_tlb_hazard
10208 + mtc0_tlbw_hazard
10209 + tlbwi
10210 nop
10211 + tlbw_eret_hazard
10212 .set mips3
10213 eret
10214 .set mips0
10215 diff -Nur linux-2.4.29/arch/mips/mm/tlb-r4k.c linux-mips/arch/mips/mm/tlb-r4k.c
10216 --- linux-2.4.29/arch/mips/mm/tlb-r4k.c 2005-01-19 15:09:29.000000000 +0100
10217 +++ linux-mips/arch/mips/mm/tlb-r4k.c 2004-11-25 23:18:38.000000000 +0100
10218 @@ -3,17 +3,12 @@
10219 * License. See the file "COPYING" in the main directory of this archive
10220 * for more details.
10221 *
10222 - * r4xx0.c: R4000 processor variant specific MMU/Cache routines.
10223 - *
10224 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
10225 * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle ralf@gnu.org
10226 - *
10227 - * To do:
10228 - *
10229 - * - this code is a overbloated pig
10230 - * - many of the bug workarounds are not efficient at all, but at
10231 - * least they are functional ...
10232 + * Carsten Langgaard, carstenl@mips.com
10233 + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
10234 */
10235 +#include <linux/config.h>
10236 #include <linux/init.h>
10237 #include <linux/sched.h>
10238 #include <linux/mm.h>
10239 @@ -25,9 +20,6 @@
10240 #include <asm/pgtable.h>
10241 #include <asm/system.h>
10242
10243 -#undef DEBUG_TLB
10244 -#undef DEBUG_TLBUPDATE
10245 -
10246 extern char except_vec0_nevada, except_vec0_r4000, except_vec0_r4600;
10247
10248 /* CP0 hazard avoidance. */
10249 @@ -41,33 +33,23 @@
10250 unsigned long old_ctx;
10251 int entry;
10252
10253 -#ifdef DEBUG_TLB
10254 - printk("[tlball]");
10255 -#endif
10256 -
10257 local_irq_save(flags);
10258 /* Save old context and create impossible VPN2 value */
10259 old_ctx = read_c0_entryhi();
10260 write_c0_entrylo0(0);
10261 write_c0_entrylo1(0);
10262 - BARRIER;
10263
10264 entry = read_c0_wired();
10265
10266 /* Blast 'em all away. */
10267 while (entry < current_cpu_data.tlbsize) {
10268 - /*
10269 - * Make sure all entries differ. If they're not different
10270 - * MIPS32 will take revenge ...
10271 - */
10272 write_c0_entryhi(KSEG0 + entry*0x2000);
10273 write_c0_index(entry);
10274 - BARRIER;
10275 + mtc0_tlbw_hazard();
10276 tlb_write_indexed();
10277 - BARRIER;
10278 entry++;
10279 }
10280 - BARRIER;
10281 + tlbw_use_hazard();
10282 write_c0_entryhi(old_ctx);
10283 local_irq_restore(flags);
10284 }
10285 @@ -76,12 +58,8 @@
10286 {
10287 int cpu = smp_processor_id();
10288
10289 - if (cpu_context(cpu, mm) != 0) {
10290 -#ifdef DEBUG_TLB
10291 - printk("[tlbmm<%d>]", cpu_context(cpu, mm));
10292 -#endif
10293 + if (cpu_context(cpu, mm) != 0)
10294 drop_mmu_context(mm,cpu);
10295 - }
10296 }
10297
10298 void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
10299 @@ -93,10 +71,6 @@
10300 unsigned long flags;
10301 int size;
10302
10303 -#ifdef DEBUG_TLB
10304 - printk("[tlbrange<%02x,%08lx,%08lx>]",
10305 - cpu_asid(cpu, mm), start, end);
10306 -#endif
10307 local_irq_save(flags);
10308 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
10309 size = (size + 1) >> 1;
10310 @@ -112,7 +86,7 @@
10311
10312 write_c0_entryhi(start | newpid);
10313 start += (PAGE_SIZE << 1);
10314 - BARRIER;
10315 + mtc0_tlbw_hazard();
10316 tlb_probe();
10317 BARRIER;
10318 idx = read_c0_index();
10319 @@ -122,10 +96,10 @@
10320 continue;
10321 /* Make sure all entries differ. */
10322 write_c0_entryhi(KSEG0 + idx*0x2000);
10323 - BARRIER;
10324 + mtc0_tlbw_hazard();
10325 tlb_write_indexed();
10326 - BARRIER;
10327 }
10328 + tlbw_use_hazard();
10329 write_c0_entryhi(oldpid);
10330 } else {
10331 drop_mmu_context(mm, cpu);
10332 @@ -138,34 +112,30 @@
10333 {
10334 int cpu = smp_processor_id();
10335
10336 - if (!vma || cpu_context(cpu, vma->vm_mm) != 0) {
10337 + if (cpu_context(cpu, vma->vm_mm) != 0) {
10338 unsigned long flags;
10339 - int oldpid, newpid, idx;
10340 + unsigned long oldpid, newpid, idx;
10341
10342 -#ifdef DEBUG_TLB
10343 - printk("[tlbpage<%d,%08lx>]", cpu_context(cpu, vma->vm_mm),
10344 - page);
10345 -#endif
10346 newpid = cpu_asid(cpu, vma->vm_mm);
10347 page &= (PAGE_MASK << 1);
10348 local_irq_save(flags);
10349 oldpid = read_c0_entryhi();
10350 write_c0_entryhi(page | newpid);
10351 - BARRIER;
10352 + mtc0_tlbw_hazard();
10353 tlb_probe();
10354 BARRIER;
10355 idx = read_c0_index();
10356 write_c0_entrylo0(0);
10357 write_c0_entrylo1(0);
10358 - if(idx < 0)
10359 + if (idx < 0)
10360 goto finish;
10361 /* Make sure all entries differ. */
10362 write_c0_entryhi(KSEG0+idx*0x2000);
10363 - BARRIER;
10364 + mtc0_tlbw_hazard();
10365 tlb_write_indexed();
10366 + tlbw_use_hazard();
10367
10368 finish:
10369 - BARRIER;
10370 write_c0_entryhi(oldpid);
10371 local_irq_restore(flags);
10372 }
10373 @@ -185,7 +155,7 @@
10374
10375 local_irq_save(flags);
10376 write_c0_entryhi(page);
10377 - BARRIER;
10378 + mtc0_tlbw_hazard();
10379 tlb_probe();
10380 BARRIER;
10381 idx = read_c0_index();
10382 @@ -194,18 +164,19 @@
10383 if (idx >= 0) {
10384 /* Make sure all entries differ. */
10385 write_c0_entryhi(KSEG0+idx*0x2000);
10386 + mtc0_tlbw_hazard();
10387 tlb_write_indexed();
10388 + tlbw_use_hazard();
10389 }
10390 - BARRIER;
10391 write_c0_entryhi(oldpid);
10392 +
10393 local_irq_restore(flags);
10394 }
10395
10396 EXPORT_SYMBOL(local_flush_tlb_one);
10397
10398 -/* We will need multiple versions of update_mmu_cache(), one that just
10399 - * updates the TLB with the new pte(s), and another which also checks
10400 - * for the R4k "end of page" hardware bug and does the needy.
10401 +/*
10402 + * Updates the TLB with the new pte(s).
10403 */
10404 void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
10405 {
10406 @@ -223,25 +194,16 @@
10407
10408 pid = read_c0_entryhi() & ASID_MASK;
10409
10410 -#ifdef DEBUG_TLB
10411 - if ((pid != cpu_asid(cpu, vma->vm_mm)) ||
10412 - (cpu_context(vma->vm_mm) == 0)) {
10413 - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d "
10414 - "tlbpid=%d\n", (int) (cpu_asid(cpu, vma->vm_mm)), pid);
10415 - }
10416 -#endif
10417 -
10418 local_irq_save(flags);
10419 address &= (PAGE_MASK << 1);
10420 write_c0_entryhi(address | pid);
10421 pgdp = pgd_offset(vma->vm_mm, address);
10422 - BARRIER;
10423 + mtc0_tlbw_hazard();
10424 tlb_probe();
10425 BARRIER;
10426 pmdp = pmd_offset(pgdp, address);
10427 idx = read_c0_index();
10428 ptep = pte_offset(pmdp, address);
10429 - BARRIER;
10430 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
10431 write_c0_entrylo0(ptep->pte_high);
10432 ptep++;
10433 @@ -251,15 +213,13 @@
10434 write_c0_entrylo1(pte_val(*ptep) >> 6);
10435 #endif
10436 write_c0_entryhi(address | pid);
10437 - BARRIER;
10438 - if (idx < 0) {
10439 + mtc0_tlbw_hazard();
10440 + if (idx < 0)
10441 tlb_write_random();
10442 - } else {
10443 + else
10444 tlb_write_indexed();
10445 - }
10446 - BARRIER;
10447 + tlbw_use_hazard();
10448 write_c0_entryhi(pid);
10449 - BARRIER;
10450 local_irq_restore(flags);
10451 }
10452
10453 @@ -279,24 +239,26 @@
10454 asid = read_c0_entryhi() & ASID_MASK;
10455 write_c0_entryhi(address | asid);
10456 pgdp = pgd_offset(vma->vm_mm, address);
10457 + mtc0_tlbw_hazard();
10458 tlb_probe();
10459 + BARRIER;
10460 pmdp = pmd_offset(pgdp, address);
10461 idx = read_c0_index();
10462 ptep = pte_offset(pmdp, address);
10463 write_c0_entrylo0(pte_val(*ptep++) >> 6);
10464 write_c0_entrylo1(pte_val(*ptep) >> 6);
10465 - BARRIER;
10466 + mtc0_tlbw_hazard();
10467 if (idx < 0)
10468 tlb_write_random();
10469 else
10470 tlb_write_indexed();
10471 - BARRIER;
10472 + tlbw_use_hazard();
10473 local_irq_restore(flags);
10474 }
10475 #endif
10476
10477 void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
10478 - unsigned long entryhi, unsigned long pagemask)
10479 + unsigned long entryhi, unsigned long pagemask)
10480 {
10481 unsigned long flags;
10482 unsigned long wired;
10483 @@ -315,9 +277,9 @@
10484 write_c0_entryhi(entryhi);
10485 write_c0_entrylo0(entrylo0);
10486 write_c0_entrylo1(entrylo1);
10487 - BARRIER;
10488 + mtc0_tlbw_hazard();
10489 tlb_write_indexed();
10490 - BARRIER;
10491 + tlbw_use_hazard();
10492
10493 write_c0_entryhi(old_ctx);
10494 BARRIER;
10495 @@ -355,17 +317,15 @@
10496 }
10497
10498 write_c0_index(temp_tlb_entry);
10499 - BARRIER;
10500 write_c0_pagemask(pagemask);
10501 write_c0_entryhi(entryhi);
10502 write_c0_entrylo0(entrylo0);
10503 write_c0_entrylo1(entrylo1);
10504 - BARRIER;
10505 + mtc0_tlbw_hazard();
10506 tlb_write_indexed();
10507 - BARRIER;
10508 + tlbw_use_hazard();
10509
10510 write_c0_entryhi(old_ctx);
10511 - BARRIER;
10512 write_c0_pagemask(old_pagemask);
10513 out:
10514 local_irq_restore(flags);
10515 @@ -375,7 +335,7 @@
10516 static void __init probe_tlb(unsigned long config)
10517 {
10518 struct cpuinfo_mips *c = &current_cpu_data;
10519 - unsigned int reg;
10520 + unsigned int config1;
10521
10522 /*
10523 * If this isn't a MIPS32 / MIPS64 compliant CPU. Config 1 register
10524 @@ -385,16 +345,16 @@
10525 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
10526 return;
10527
10528 - reg = read_c0_config1();
10529 + config1 = read_c0_config1();
10530 if (!((config >> 7) & 3))
10531 panic("No TLB present");
10532
10533 - c->tlbsize = ((reg >> 25) & 0x3f) + 1;
10534 + c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
10535 }
10536
10537 void __init r4k_tlb_init(void)
10538 {
10539 - u32 config = read_c0_config();
10540 + unsigned int config = read_c0_config();
10541
10542 /*
10543 * You should never change this register:
10544 diff -Nur linux-2.4.29/arch/mips64/defconfig linux-mips/arch/mips64/defconfig
10545 --- linux-2.4.29/arch/mips64/defconfig 2005-01-19 15:09:30.000000000 +0100
10546 +++ linux-mips/arch/mips64/defconfig 2005-03-26 11:47:17.749738603 +0100
10547 @@ -30,8 +30,8 @@
10548 # CONFIG_MIPS_PB1000 is not set
10549 # CONFIG_MIPS_PB1100 is not set
10550 # CONFIG_MIPS_PB1500 is not set
10551 -# CONFIG_MIPS_HYDROGEN3 is not set
10552 # CONFIG_MIPS_PB1550 is not set
10553 +# CONFIG_MIPS_HYDROGEN3 is not set
10554 # CONFIG_MIPS_XXS1500 is not set
10555 # CONFIG_MIPS_MTX1 is not set
10556 # CONFIG_COGENT_CSB250 is not set
10557 @@ -470,9 +470,11 @@
10558 # CONFIG_SCSI_MEGARAID is not set
10559 # CONFIG_SCSI_MEGARAID2 is not set
10560 # CONFIG_SCSI_SATA is not set
10561 +# CONFIG_SCSI_SATA_AHCI is not set
10562 # CONFIG_SCSI_SATA_SVW is not set
10563 # CONFIG_SCSI_ATA_PIIX is not set
10564 # CONFIG_SCSI_SATA_NV is not set
10565 +# CONFIG_SCSI_SATA_QSTOR is not set
10566 # CONFIG_SCSI_SATA_PROMISE is not set
10567 # CONFIG_SCSI_SATA_SX4 is not set
10568 # CONFIG_SCSI_SATA_SIL is not set
10569 @@ -658,7 +660,6 @@
10570 CONFIG_SERIAL_CONSOLE=y
10571 # CONFIG_SERIAL_EXTENDED is not set
10572 # CONFIG_SERIAL_NONSTANDARD is not set
10573 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10574 CONFIG_UNIX98_PTYS=y
10575 CONFIG_UNIX98_PTY_COUNT=256
10576
10577 diff -Nur linux-2.4.29/arch/mips64/defconfig-atlas linux-mips/arch/mips64/defconfig-atlas
10578 --- linux-2.4.29/arch/mips64/defconfig-atlas 2005-01-19 15:09:30.000000000 +0100
10579 +++ linux-mips/arch/mips64/defconfig-atlas 2005-03-26 11:47:17.816727608 +0100
10580 @@ -28,8 +28,8 @@
10581 # CONFIG_MIPS_PB1000 is not set
10582 # CONFIG_MIPS_PB1100 is not set
10583 # CONFIG_MIPS_PB1500 is not set
10584 -# CONFIG_MIPS_HYDROGEN3 is not set
10585 # CONFIG_MIPS_PB1550 is not set
10586 +# CONFIG_MIPS_HYDROGEN3 is not set
10587 # CONFIG_MIPS_XXS1500 is not set
10588 # CONFIG_MIPS_MTX1 is not set
10589 # CONFIG_COGENT_CSB250 is not set
10590 @@ -232,11 +232,6 @@
10591 #
10592 # CONFIG_IPX is not set
10593 # CONFIG_ATALK is not set
10594 -
10595 -#
10596 -# Appletalk devices
10597 -#
10598 -# CONFIG_DEV_APPLETALK is not set
10599 # CONFIG_DECNET is not set
10600 # CONFIG_BRIDGE is not set
10601 # CONFIG_X25 is not set
10602 @@ -314,9 +309,11 @@
10603 # CONFIG_SCSI_MEGARAID is not set
10604 # CONFIG_SCSI_MEGARAID2 is not set
10605 # CONFIG_SCSI_SATA is not set
10606 +# CONFIG_SCSI_SATA_AHCI is not set
10607 # CONFIG_SCSI_SATA_SVW is not set
10608 # CONFIG_SCSI_ATA_PIIX is not set
10609 # CONFIG_SCSI_SATA_NV is not set
10610 +# CONFIG_SCSI_SATA_QSTOR is not set
10611 # CONFIG_SCSI_SATA_PROMISE is not set
10612 # CONFIG_SCSI_SATA_SX4 is not set
10613 # CONFIG_SCSI_SATA_SIL is not set
10614 @@ -474,7 +471,6 @@
10615 CONFIG_SERIAL_CONSOLE=y
10616 # CONFIG_SERIAL_EXTENDED is not set
10617 # CONFIG_SERIAL_NONSTANDARD is not set
10618 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10619 CONFIG_UNIX98_PTYS=y
10620 CONFIG_UNIX98_PTY_COUNT=256
10621
10622 diff -Nur linux-2.4.29/arch/mips64/defconfig-decstation linux-mips/arch/mips64/defconfig-decstation
10623 --- linux-2.4.29/arch/mips64/defconfig-decstation 2005-01-19 15:09:30.000000000 +0100
10624 +++ linux-mips/arch/mips64/defconfig-decstation 2005-03-26 11:47:17.884716450 +0100
10625 @@ -28,8 +28,8 @@
10626 # CONFIG_MIPS_PB1000 is not set
10627 # CONFIG_MIPS_PB1100 is not set
10628 # CONFIG_MIPS_PB1500 is not set
10629 -# CONFIG_MIPS_HYDROGEN3 is not set
10630 # CONFIG_MIPS_PB1550 is not set
10631 +# CONFIG_MIPS_HYDROGEN3 is not set
10632 # CONFIG_MIPS_XXS1500 is not set
10633 # CONFIG_MIPS_MTX1 is not set
10634 # CONFIG_COGENT_CSB250 is not set
10635 @@ -224,11 +224,6 @@
10636 #
10637 # CONFIG_IPX is not set
10638 # CONFIG_ATALK is not set
10639 -
10640 -#
10641 -# Appletalk devices
10642 -#
10643 -# CONFIG_DEV_APPLETALK is not set
10644 # CONFIG_DECNET is not set
10645 # CONFIG_BRIDGE is not set
10646 # CONFIG_X25 is not set
10647 @@ -307,9 +302,11 @@
10648 # CONFIG_SCSI_MEGARAID is not set
10649 # CONFIG_SCSI_MEGARAID2 is not set
10650 # CONFIG_SCSI_SATA is not set
10651 +# CONFIG_SCSI_SATA_AHCI is not set
10652 # CONFIG_SCSI_SATA_SVW is not set
10653 # CONFIG_SCSI_ATA_PIIX is not set
10654 # CONFIG_SCSI_SATA_NV is not set
10655 +# CONFIG_SCSI_SATA_QSTOR is not set
10656 # CONFIG_SCSI_SATA_PROMISE is not set
10657 # CONFIG_SCSI_SATA_SX4 is not set
10658 # CONFIG_SCSI_SATA_SIL is not set
10659 @@ -477,7 +474,6 @@
10660 CONFIG_SERIAL_DEC_CONSOLE=y
10661 # CONFIG_DZ is not set
10662 CONFIG_ZS=y
10663 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10664 CONFIG_UNIX98_PTYS=y
10665 CONFIG_UNIX98_PTY_COUNT=256
10666
10667 diff -Nur linux-2.4.29/arch/mips64/defconfig-ip22 linux-mips/arch/mips64/defconfig-ip22
10668 --- linux-2.4.29/arch/mips64/defconfig-ip22 2005-01-19 15:09:31.000000000 +0100
10669 +++ linux-mips/arch/mips64/defconfig-ip22 2005-03-26 11:47:17.955704799 +0100
10670 @@ -30,8 +30,8 @@
10671 # CONFIG_MIPS_PB1000 is not set
10672 # CONFIG_MIPS_PB1100 is not set
10673 # CONFIG_MIPS_PB1500 is not set
10674 -# CONFIG_MIPS_HYDROGEN3 is not set
10675 # CONFIG_MIPS_PB1550 is not set
10676 +# CONFIG_MIPS_HYDROGEN3 is not set
10677 # CONFIG_MIPS_XXS1500 is not set
10678 # CONFIG_MIPS_MTX1 is not set
10679 # CONFIG_COGENT_CSB250 is not set
10680 @@ -235,11 +235,6 @@
10681 #
10682 # CONFIG_IPX is not set
10683 # CONFIG_ATALK is not set
10684 -
10685 -#
10686 -# Appletalk devices
10687 -#
10688 -# CONFIG_DEV_APPLETALK is not set
10689 # CONFIG_DECNET is not set
10690 # CONFIG_BRIDGE is not set
10691 # CONFIG_X25 is not set
10692 @@ -319,9 +314,11 @@
10693 # CONFIG_SCSI_MEGARAID is not set
10694 # CONFIG_SCSI_MEGARAID2 is not set
10695 # CONFIG_SCSI_SATA is not set
10696 +# CONFIG_SCSI_SATA_AHCI is not set
10697 # CONFIG_SCSI_SATA_SVW is not set
10698 # CONFIG_SCSI_ATA_PIIX is not set
10699 # CONFIG_SCSI_SATA_NV is not set
10700 +# CONFIG_SCSI_SATA_QSTOR is not set
10701 # CONFIG_SCSI_SATA_PROMISE is not set
10702 # CONFIG_SCSI_SATA_SX4 is not set
10703 # CONFIG_SCSI_SATA_SIL is not set
10704 @@ -488,7 +485,6 @@
10705 # CONFIG_SERIAL_TXX9_CONSOLE is not set
10706 # CONFIG_TXX927_SERIAL is not set
10707 CONFIG_IP22_SERIAL=y
10708 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10709 CONFIG_UNIX98_PTYS=y
10710 CONFIG_UNIX98_PTY_COUNT=256
10711
10712 diff -Nur linux-2.4.29/arch/mips64/defconfig-ip27 linux-mips/arch/mips64/defconfig-ip27
10713 --- linux-2.4.29/arch/mips64/defconfig-ip27 2005-01-19 15:09:31.000000000 +0100
10714 +++ linux-mips/arch/mips64/defconfig-ip27 2005-03-26 11:47:18.038691179 +0100
10715 @@ -30,8 +30,8 @@
10716 # CONFIG_MIPS_PB1000 is not set
10717 # CONFIG_MIPS_PB1100 is not set
10718 # CONFIG_MIPS_PB1500 is not set
10719 -# CONFIG_MIPS_HYDROGEN3 is not set
10720 # CONFIG_MIPS_PB1550 is not set
10721 +# CONFIG_MIPS_HYDROGEN3 is not set
10722 # CONFIG_MIPS_XXS1500 is not set
10723 # CONFIG_MIPS_MTX1 is not set
10724 # CONFIG_COGENT_CSB250 is not set
10725 @@ -470,9 +470,11 @@
10726 # CONFIG_SCSI_MEGARAID is not set
10727 # CONFIG_SCSI_MEGARAID2 is not set
10728 # CONFIG_SCSI_SATA is not set
10729 +# CONFIG_SCSI_SATA_AHCI is not set
10730 # CONFIG_SCSI_SATA_SVW is not set
10731 # CONFIG_SCSI_ATA_PIIX is not set
10732 # CONFIG_SCSI_SATA_NV is not set
10733 +# CONFIG_SCSI_SATA_QSTOR is not set
10734 # CONFIG_SCSI_SATA_PROMISE is not set
10735 # CONFIG_SCSI_SATA_SX4 is not set
10736 # CONFIG_SCSI_SATA_SIL is not set
10737 @@ -658,7 +660,6 @@
10738 CONFIG_SERIAL_CONSOLE=y
10739 # CONFIG_SERIAL_EXTENDED is not set
10740 # CONFIG_SERIAL_NONSTANDARD is not set
10741 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10742 CONFIG_UNIX98_PTYS=y
10743 CONFIG_UNIX98_PTY_COUNT=256
10744
10745 diff -Nur linux-2.4.29/arch/mips64/defconfig-jaguar linux-mips/arch/mips64/defconfig-jaguar
10746 --- linux-2.4.29/arch/mips64/defconfig-jaguar 2005-01-19 15:09:31.000000000 +0100
10747 +++ linux-mips/arch/mips64/defconfig-jaguar 2005-03-26 11:47:18.091682482 +0100
10748 @@ -30,8 +30,8 @@
10749 # CONFIG_MIPS_PB1000 is not set
10750 # CONFIG_MIPS_PB1100 is not set
10751 # CONFIG_MIPS_PB1500 is not set
10752 -# CONFIG_MIPS_HYDROGEN3 is not set
10753 # CONFIG_MIPS_PB1550 is not set
10754 +# CONFIG_MIPS_HYDROGEN3 is not set
10755 # CONFIG_MIPS_XXS1500 is not set
10756 # CONFIG_MIPS_MTX1 is not set
10757 # CONFIG_COGENT_CSB250 is not set
10758 @@ -227,11 +227,6 @@
10759 #
10760 # CONFIG_IPX is not set
10761 # CONFIG_ATALK is not set
10762 -
10763 -#
10764 -# Appletalk devices
10765 -#
10766 -# CONFIG_DEV_APPLETALK is not set
10767 # CONFIG_DECNET is not set
10768 # CONFIG_BRIDGE is not set
10769 # CONFIG_X25 is not set
10770 @@ -403,7 +398,6 @@
10771 # CONFIG_SERIAL_TXX9 is not set
10772 # CONFIG_SERIAL_TXX9_CONSOLE is not set
10773 # CONFIG_TXX927_SERIAL is not set
10774 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10775 CONFIG_UNIX98_PTYS=y
10776 CONFIG_UNIX98_PTY_COUNT=256
10777
10778 diff -Nur linux-2.4.29/arch/mips64/defconfig-malta linux-mips/arch/mips64/defconfig-malta
10779 --- linux-2.4.29/arch/mips64/defconfig-malta 2005-01-19 15:09:31.000000000 +0100
10780 +++ linux-mips/arch/mips64/defconfig-malta 2005-03-26 11:47:18.150672800 +0100
10781 @@ -30,8 +30,8 @@
10782 # CONFIG_MIPS_PB1000 is not set
10783 # CONFIG_MIPS_PB1100 is not set
10784 # CONFIG_MIPS_PB1500 is not set
10785 -# CONFIG_MIPS_HYDROGEN3 is not set
10786 # CONFIG_MIPS_PB1550 is not set
10787 +# CONFIG_MIPS_HYDROGEN3 is not set
10788 # CONFIG_MIPS_XXS1500 is not set
10789 # CONFIG_MIPS_MTX1 is not set
10790 # CONFIG_COGENT_CSB250 is not set
10791 @@ -235,11 +235,6 @@
10792 #
10793 # CONFIG_IPX is not set
10794 # CONFIG_ATALK is not set
10795 -
10796 -#
10797 -# Appletalk devices
10798 -#
10799 -# CONFIG_DEV_APPLETALK is not set
10800 # CONFIG_DECNET is not set
10801 # CONFIG_BRIDGE is not set
10802 # CONFIG_X25 is not set
10803 @@ -317,9 +312,11 @@
10804 # CONFIG_SCSI_MEGARAID is not set
10805 # CONFIG_SCSI_MEGARAID2 is not set
10806 # CONFIG_SCSI_SATA is not set
10807 +# CONFIG_SCSI_SATA_AHCI is not set
10808 # CONFIG_SCSI_SATA_SVW is not set
10809 # CONFIG_SCSI_ATA_PIIX is not set
10810 # CONFIG_SCSI_SATA_NV is not set
10811 +# CONFIG_SCSI_SATA_QSTOR is not set
10812 # CONFIG_SCSI_SATA_PROMISE is not set
10813 # CONFIG_SCSI_SATA_SX4 is not set
10814 # CONFIG_SCSI_SATA_SIL is not set
10815 @@ -477,7 +474,6 @@
10816 CONFIG_SERIAL_CONSOLE=y
10817 # CONFIG_SERIAL_EXTENDED is not set
10818 # CONFIG_SERIAL_NONSTANDARD is not set
10819 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10820 CONFIG_UNIX98_PTYS=y
10821 CONFIG_UNIX98_PTY_COUNT=256
10822
10823 diff -Nur linux-2.4.29/arch/mips64/defconfig-ocelotc linux-mips/arch/mips64/defconfig-ocelotc
10824 --- linux-2.4.29/arch/mips64/defconfig-ocelotc 2005-01-19 15:09:31.000000000 +0100
10825 +++ linux-mips/arch/mips64/defconfig-ocelotc 2005-03-26 11:47:18.209663119 +0100
10826 @@ -30,8 +30,8 @@
10827 # CONFIG_MIPS_PB1000 is not set
10828 # CONFIG_MIPS_PB1100 is not set
10829 # CONFIG_MIPS_PB1500 is not set
10830 -# CONFIG_MIPS_HYDROGEN3 is not set
10831 # CONFIG_MIPS_PB1550 is not set
10832 +# CONFIG_MIPS_HYDROGEN3 is not set
10833 # CONFIG_MIPS_XXS1500 is not set
10834 # CONFIG_MIPS_MTX1 is not set
10835 # CONFIG_COGENT_CSB250 is not set
10836 @@ -231,11 +231,6 @@
10837 #
10838 # CONFIG_IPX is not set
10839 # CONFIG_ATALK is not set
10840 -
10841 -#
10842 -# Appletalk devices
10843 -#
10844 -# CONFIG_DEV_APPLETALK is not set
10845 # CONFIG_DECNET is not set
10846 # CONFIG_BRIDGE is not set
10847 # CONFIG_X25 is not set
10848 @@ -453,7 +448,6 @@
10849 # CONFIG_SERIAL_TXX9 is not set
10850 # CONFIG_SERIAL_TXX9_CONSOLE is not set
10851 # CONFIG_TXX927_SERIAL is not set
10852 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10853 CONFIG_UNIX98_PTYS=y
10854 CONFIG_UNIX98_PTY_COUNT=256
10855
10856 diff -Nur linux-2.4.29/arch/mips64/defconfig-sb1250-swarm linux-mips/arch/mips64/defconfig-sb1250-swarm
10857 --- linux-2.4.29/arch/mips64/defconfig-sb1250-swarm 2005-01-19 15:09:31.000000000 +0100
10858 +++ linux-mips/arch/mips64/defconfig-sb1250-swarm 2005-03-26 11:47:18.269653273 +0100
10859 @@ -30,8 +30,8 @@
10860 # CONFIG_MIPS_PB1000 is not set
10861 # CONFIG_MIPS_PB1100 is not set
10862 # CONFIG_MIPS_PB1500 is not set
10863 -# CONFIG_MIPS_HYDROGEN3 is not set
10864 # CONFIG_MIPS_PB1550 is not set
10865 +# CONFIG_MIPS_HYDROGEN3 is not set
10866 # CONFIG_MIPS_XXS1500 is not set
10867 # CONFIG_MIPS_MTX1 is not set
10868 # CONFIG_COGENT_CSB250 is not set
10869 @@ -90,6 +90,7 @@
10870 # CONFIG_SIBYTE_TBPROF is not set
10871 CONFIG_SIBYTE_GENBUS_IDE=y
10872 CONFIG_SMP_CAPABLE=y
10873 +CONFIG_MIPS_RTC=y
10874 # CONFIG_SNI_RM200_PCI is not set
10875 # CONFIG_TANBAC_TB0226 is not set
10876 # CONFIG_TANBAC_TB0229 is not set
10877 @@ -253,11 +254,6 @@
10878 #
10879 # CONFIG_IPX is not set
10880 # CONFIG_ATALK is not set
10881 -
10882 -#
10883 -# Appletalk devices
10884 -#
10885 -# CONFIG_DEV_APPLETALK is not set
10886 # CONFIG_DECNET is not set
10887 # CONFIG_BRIDGE is not set
10888 # CONFIG_X25 is not set
10889 @@ -432,7 +428,6 @@
10890 CONFIG_SIBYTE_SB1250_DUART=y
10891 CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
10892 CONFIG_SERIAL_CONSOLE=y
10893 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10894 CONFIG_UNIX98_PTYS=y
10895 CONFIG_UNIX98_PTY_COUNT=256
10896
10897 diff -Nur linux-2.4.29/arch/mips64/defconfig-sead linux-mips/arch/mips64/defconfig-sead
10898 --- linux-2.4.29/arch/mips64/defconfig-sead 2005-01-19 15:09:31.000000000 +0100
10899 +++ linux-mips/arch/mips64/defconfig-sead 2005-03-26 11:47:18.311646381 +0100
10900 @@ -28,8 +28,8 @@
10901 # CONFIG_MIPS_PB1000 is not set
10902 # CONFIG_MIPS_PB1100 is not set
10903 # CONFIG_MIPS_PB1500 is not set
10904 -# CONFIG_MIPS_HYDROGEN3 is not set
10905 # CONFIG_MIPS_PB1550 is not set
10906 +# CONFIG_MIPS_HYDROGEN3 is not set
10907 # CONFIG_MIPS_XXS1500 is not set
10908 # CONFIG_MIPS_MTX1 is not set
10909 # CONFIG_COGENT_CSB250 is not set
10910 @@ -242,7 +242,6 @@
10911 CONFIG_SERIAL_CONSOLE=y
10912 # CONFIG_SERIAL_EXTENDED is not set
10913 # CONFIG_SERIAL_NONSTANDARD is not set
10914 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10915 # CONFIG_UNIX98_PTYS is not set
10916
10917 #
10918 diff -Nur linux-2.4.29/arch/mips64/kernel/binfmt_elfn32.c linux-mips/arch/mips64/kernel/binfmt_elfn32.c
10919 --- linux-2.4.29/arch/mips64/kernel/binfmt_elfn32.c 2003-08-25 13:44:40.000000000 +0200
10920 +++ linux-mips/arch/mips64/kernel/binfmt_elfn32.c 2005-01-31 12:59:30.000000000 +0100
10921 @@ -116,4 +116,7 @@
10922 #undef MODULE_DESCRIPTION
10923 #undef MODULE_AUTHOR
10924
10925 +#undef TASK_SIZE
10926 +#define TASK_SIZE TASK_SIZE32
10927 +
10928 #include "../../../fs/binfmt_elf.c"
10929 diff -Nur linux-2.4.29/arch/mips64/kernel/binfmt_elfo32.c linux-mips/arch/mips64/kernel/binfmt_elfo32.c
10930 --- linux-2.4.29/arch/mips64/kernel/binfmt_elfo32.c 2003-08-25 13:44:40.000000000 +0200
10931 +++ linux-mips/arch/mips64/kernel/binfmt_elfo32.c 2005-01-31 12:59:30.000000000 +0100
10932 @@ -137,4 +137,7 @@
10933 #undef MODULE_DESCRIPTION
10934 #undef MODULE_AUTHOR
10935
10936 +#undef TASK_SIZE
10937 +#define TASK_SIZE TASK_SIZE32
10938 +
10939 #include "../../../fs/binfmt_elf.c"
10940 diff -Nur linux-2.4.29/arch/mips64/kernel/head.S linux-mips/arch/mips64/kernel/head.S
10941 --- linux-2.4.29/arch/mips64/kernel/head.S 2004-02-18 14:36:30.000000000 +0100
10942 +++ linux-mips/arch/mips64/kernel/head.S 2004-11-22 14:38:26.000000000 +0100
10943 @@ -91,6 +91,21 @@
10944 __INIT
10945
10946 NESTED(kernel_entry, 16, sp) # kernel entry point
10947 + .set push
10948 + /*
10949 + * For the moment disable interrupts, mark the kernel mode and
10950 + * set ST0_KX so that the CPU does not spit fire when using
10951 + * 64-bit addresses. A full initialization of the CPU's status
10952 + * register is done later in per_cpu_trap_init().
10953 + */
10954 + mfc0 t0, CP0_STATUS
10955 + or t0, ST0_CU0|ST0_KX|0x1f
10956 + xor t0, 0x1f
10957 + mtc0 t0, CP0_STATUS
10958 +
10959 + .set noreorder
10960 + sll zero,3 # ehb
10961 + .set reorder
10962
10963 ori sp, 0xf # align stack on 16 byte.
10964 xori sp, 0xf
10965 @@ -103,8 +118,6 @@
10966
10967 ARC64_TWIDDLE_PC
10968
10969 - CLI # disable interrupts
10970 -
10971 /*
10972 * The firmware/bootloader passes argc/argp/envp
10973 * to us as arguments. But clear bss first because
10974 @@ -125,6 +138,7 @@
10975 dsubu sp, 4*SZREG # init stack pointer
10976
10977 j init_arch
10978 + .set pop
10979 END(kernel_entry)
10980
10981 #ifdef CONFIG_SMP
10982 @@ -133,6 +147,23 @@
10983 * function after setting up the stack and gp registers.
10984 */
10985 NESTED(smp_bootstrap, 16, sp)
10986 + .set push
10987 + /*
10988 + * For the moment disable interrupts and bootstrap exception
10989 + * vectors, mark the kernel mode and set ST0_KX so that the CPU
10990 + * does not spit fire when using 64-bit addresses. A full
10991 + * initialization of the CPU's status register is done later in
10992 + * per_cpu_trap_init().
10993 + */
10994 + mfc0 t0, CP0_STATUS
10995 + or t0, ST0_CU0|ST0_BEV|ST0_KX|0x1f
10996 + xor t0, ST0_BEV|0x1f
10997 + mtc0 t0, CP0_STATUS
10998 +
10999 + .set noreorder
11000 + sll zero,3 # ehb
11001 + .set reorder
11002 +
11003 #ifdef CONFIG_SGI_IP27
11004 GET_NASID_ASM t1
11005 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
11006 @@ -146,19 +177,8 @@
11007 ARC64_TWIDDLE_PC
11008 #endif /* CONFIG_SGI_IP27 */
11009
11010 - CLI
11011 -
11012 - /*
11013 - * For the moment set ST0_KU so the CPU will not spit fire when
11014 - * executing 64-bit instructions. The full initialization of the
11015 - * CPU's status register is done later in per_cpu_trap_init().
11016 - */
11017 - mfc0 t0, CP0_STATUS
11018 - or t0, ST0_KX
11019 - mtc0 t0, CP0_STATUS
11020 -
11021 jal start_secondary # XXX: IP27: cboot
11022 -
11023 + .set pop
11024 END(smp_bootstrap)
11025 #endif /* CONFIG_SMP */
11026
11027 diff -Nur linux-2.4.29/arch/mips64/kernel/ioctl32.c linux-mips/arch/mips64/kernel/ioctl32.c
11028 --- linux-2.4.29/arch/mips64/kernel/ioctl32.c 2005-01-19 15:09:31.000000000 +0100
11029 +++ linux-mips/arch/mips64/kernel/ioctl32.c 2005-01-31 12:59:30.000000000 +0100
11030 @@ -2352,7 +2352,7 @@
11031 IOCTL32_HANDLER(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout),
11032 IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE),
11033 IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE_MULTI),
11034 - IOCTL32_DEFAULT(AUTOFS_IOC_PROTSUBVER),
11035 + IOCTL32_DEFAULT(AUTOFS_IOC_PROTOSUBVER),
11036 IOCTL32_DEFAULT(AUTOFS_IOC_ASKREGHOST),
11037 IOCTL32_DEFAULT(AUTOFS_IOC_TOGGLEREGHOST),
11038 IOCTL32_DEFAULT(AUTOFS_IOC_ASKUMOUNT),
11039 diff -Nur linux-2.4.29/arch/mips64/kernel/linux32.c linux-mips/arch/mips64/kernel/linux32.c
11040 --- linux-2.4.29/arch/mips64/kernel/linux32.c 2005-01-19 15:09:32.000000000 +0100
11041 +++ linux-mips/arch/mips64/kernel/linux32.c 2005-03-26 11:47:18.669587634 +0100
11042 @@ -1088,11 +1088,9 @@
11043 i--;
11044 }
11045
11046 - inode = file->f_dentry->d_inode;
11047 /* VERIFY_WRITE actually means a read, as we write to user space */
11048 - retval = locks_verify_area((type == VERIFY_WRITE
11049 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
11050 - inode, file, file->f_pos, tot_len);
11051 + retval = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
11052 + file, &file->f_pos, tot_len);
11053 if (retval) {
11054 if (iov != iovstack)
11055 kfree(iov);
11056 @@ -1189,72 +1187,19 @@
11057 lseek back to original location. They fail just like lseek does on
11058 non-seekable files. */
11059
11060 -asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
11061 - size_t count, u32 unused, u64 a4, u64 a5)
11062 +asmlinkage ssize_t sys32_pread(unsigned int fd, char *buf,
11063 + size_t count, u32 unused, u64 a4, u64 a5)
11064 {
11065 - ssize_t ret;
11066 - struct file * file;
11067 - ssize_t (*read)(struct file *, char *, size_t, loff_t *);
11068 - loff_t pos;
11069 -
11070 - ret = -EBADF;
11071 - file = fget(fd);
11072 - if (!file)
11073 - goto bad_file;
11074 - if (!(file->f_mode & FMODE_READ))
11075 - goto out;
11076 - pos = merge_64(a4, a5);
11077 - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
11078 - file, pos, count);
11079 - if (ret)
11080 - goto out;
11081 - ret = -EINVAL;
11082 - if (!file->f_op || !(read = file->f_op->read))
11083 - goto out;
11084 - if (pos < 0)
11085 - goto out;
11086 - ret = read(file, buf, count, &pos);
11087 - if (ret > 0)
11088 - dnotify_parent(file->f_dentry, DN_ACCESS);
11089 -out:
11090 - fput(file);
11091 -bad_file:
11092 - return ret;
11093 + return sys_pread(fd, buf, count, merge_64(a4, a5));
11094 }
11095
11096 asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
11097 size_t count, u32 unused, u64 a4, u64 a5)
11098 {
11099 - ssize_t ret;
11100 - struct file * file;
11101 - ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
11102 - loff_t pos;
11103 + return sys_pwrite(fd, buf, count, merge_64(a4, a5));
11104 +}
11105
11106 - ret = -EBADF;
11107 - file = fget(fd);
11108 - if (!file)
11109 - goto bad_file;
11110 - if (!(file->f_mode & FMODE_WRITE))
11111 - goto out;
11112 - pos = merge_64(a4, a5);
11113 - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
11114 - file, pos, count);
11115 - if (ret)
11116 - goto out;
11117 - ret = -EINVAL;
11118 - if (!file->f_op || !(write = file->f_op->write))
11119 - goto out;
11120 - if (pos < 0)
11121 - goto out;
11122
11123 - ret = write(file, buf, count, &pos);
11124 - if (ret > 0)
11125 - dnotify_parent(file->f_dentry, DN_MODIFY);
11126 -out:
11127 - fput(file);
11128 -bad_file:
11129 - return ret;
11130 -}
11131 /*
11132 * Ooo, nasty. We need here to frob 32-bit unsigned longs to
11133 * 64-bit unsigned longs.
11134 @@ -2792,7 +2737,8 @@
11135 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
11136 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
11137 */
11138 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
11139 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
11140 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
11141 {
11142 unsigned char *workbuf, *wp;
11143 unsigned long bufsz, space_avail;
11144 @@ -2823,6 +2769,9 @@
11145 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
11146
11147 clen64 = kcmsg32->cmsg_len;
11148 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
11149 + (clen64 > (orig_cmsg_len + wp - workbuf)))
11150 + break;
11151 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
11152 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
11153 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
11154 @@ -2908,6 +2857,7 @@
11155 struct sockaddr *uaddr;
11156 int *uaddr_len;
11157 unsigned long cmsg_ptr;
11158 + __kernel_size_t cmsg_len;
11159 int err, total_len, len = 0;
11160
11161 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
11162 @@ -2923,6 +2873,7 @@
11163 total_len = err;
11164
11165 cmsg_ptr = (unsigned long) kern_msg.msg_control;
11166 + cmsg_len = kern_msg.msg_controllen;
11167 kern_msg.msg_flags = 0;
11168
11169 sock = sockfd_lookup(fd, &err);
11170 @@ -2948,7 +2899,8 @@
11171 * to fix it up before we tack on more stuff.
11172 */
11173 if((unsigned long) kern_msg.msg_control != cmsg_ptr)
11174 - cmsg32_recvmsg_fixup(&kern_msg, cmsg_ptr);
11175 + cmsg32_recvmsg_fixup(&kern_msg,
11176 + cmsg_ptr, cmsg_len);
11177
11178 /* Wheee... */
11179 if(sock->passcred)
11180 diff -Nur linux-2.4.29/arch/mips64/kernel/scall_64.S linux-mips/arch/mips64/kernel/scall_64.S
11181 --- linux-2.4.29/arch/mips64/kernel/scall_64.S 2005-01-19 15:09:32.000000000 +0100
11182 +++ linux-mips/arch/mips64/kernel/scall_64.S 2005-03-26 11:47:18.698582876 +0100
11183 @@ -102,15 +102,14 @@
11184
11185 trace_a_syscall:
11186 SAVE_STATIC
11187 - sd t2,PT_R1(sp)
11188 + move s0, t2
11189 jal syscall_trace
11190 - ld t2,PT_R1(sp)
11191
11192 ld a0, PT_R4(sp) # Restore argument registers
11193 ld a1, PT_R5(sp)
11194 ld a2, PT_R6(sp)
11195 ld a3, PT_R7(sp)
11196 - jalr t2
11197 + jalr s0
11198
11199 li t0, -EMAXERRNO - 1 # error?
11200 sltu t0, t0, v0
11201 diff -Nur linux-2.4.29/arch/mips64/kernel/scall_n32.S linux-mips/arch/mips64/kernel/scall_n32.S
11202 --- linux-2.4.29/arch/mips64/kernel/scall_n32.S 2005-01-19 15:09:32.000000000 +0100
11203 +++ linux-mips/arch/mips64/kernel/scall_n32.S 2005-03-26 11:47:18.734576968 +0100
11204 @@ -106,15 +106,14 @@
11205
11206 trace_a_syscall:
11207 SAVE_STATIC
11208 - sd t2,PT_R1(sp)
11209 + move s0, t2
11210 jal syscall_trace
11211 - ld t2,PT_R1(sp)
11212
11213 ld a0, PT_R4(sp) # Restore argument registers
11214 ld a1, PT_R5(sp)
11215 ld a2, PT_R6(sp)
11216 ld a3, PT_R7(sp)
11217 - jalr t2
11218 + jalr s0
11219
11220 li t0, -EMAXERRNO - 1 # error?
11221 sltu t0, t0, v0
11222 diff -Nur linux-2.4.29/arch/mips64/kernel/scall_o32.S linux-mips/arch/mips64/kernel/scall_o32.S
11223 --- linux-2.4.29/arch/mips64/kernel/scall_o32.S 2005-01-19 15:09:32.000000000 +0100
11224 +++ linux-mips/arch/mips64/kernel/scall_o32.S 2005-03-26 11:47:18.788568107 +0100
11225 @@ -118,9 +118,8 @@
11226 sd a6, PT_R10(sp)
11227 sd a7, PT_R11(sp)
11228
11229 - sd t2,PT_R1(sp)
11230 + move s0, t2
11231 jal syscall_trace
11232 - ld t2,PT_R1(sp)
11233
11234 ld a0, PT_R4(sp) # Restore argument registers
11235 ld a1, PT_R5(sp)
11236 @@ -129,7 +128,7 @@
11237 ld a4, PT_R8(sp)
11238 ld a5, PT_R9(sp)
11239
11240 - jalr t2
11241 + jalr s0
11242
11243 li t0, -EMAXERRNO - 1 # error?
11244 sltu t0, t0, v0
11245 @@ -576,6 +575,8 @@
11246 sys_call_table:
11247 syscalltable
11248
11249 + .purgem sys
11250 +
11251 .macro sys function, nargs
11252 .byte \nargs
11253 .endm
11254 diff -Nur linux-2.4.29/arch/mips64/kernel/setup.c linux-mips/arch/mips64/kernel/setup.c
11255 --- linux-2.4.29/arch/mips64/kernel/setup.c 2005-01-19 15:09:32.000000000 +0100
11256 +++ linux-mips/arch/mips64/kernel/setup.c 2004-11-22 14:38:26.000000000 +0100
11257 @@ -129,14 +129,6 @@
11258 */
11259 load_mmu();
11260
11261 - /*
11262 - * On IP27, I am seeing the TS bit set when the kernel is loaded.
11263 - * Maybe because the kernel is in ckseg0 and not xkphys? Clear it
11264 - * anyway ...
11265 - */
11266 - clear_c0_status(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
11267 - set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
11268 -
11269 start_kernel();
11270 }
11271
11272 diff -Nur linux-2.4.29/arch/mips64/kernel/signal_n32.c linux-mips/arch/mips64/kernel/signal_n32.c
11273 --- linux-2.4.29/arch/mips64/kernel/signal_n32.c 2005-01-19 15:09:33.000000000 +0100
11274 +++ linux-mips/arch/mips64/kernel/signal_n32.c 2005-03-26 11:47:18.811564333 +0100
11275 @@ -68,7 +68,7 @@
11276 };
11277
11278 extern asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
11279 -extern int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
11280 +extern int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
11281
11282 asmlinkage void sysn32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
11283 {
11284 diff -Nur linux-2.4.29/arch/mips64/kernel/traps.c linux-mips/arch/mips64/kernel/traps.c
11285 --- linux-2.4.29/arch/mips64/kernel/traps.c 2005-01-19 15:09:33.000000000 +0100
11286 +++ linux-mips/arch/mips64/kernel/traps.c 2004-11-22 14:38:26.000000000 +0100
11287 @@ -809,13 +809,18 @@
11288 void __init per_cpu_trap_init(void)
11289 {
11290 unsigned int cpu = smp_processor_id();
11291 + unsigned int status_set = ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX;
11292
11293 - /* Some firmware leaves the BEV flag set, clear it. */
11294 - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_BEV);
11295 - set_c0_status(ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX);
11296 -
11297 + /*
11298 + * Disable coprocessors, enable 64-bit addressing and set FPU
11299 + * for the 32/32 FPR register model. Reset the BEV flag that
11300 + * some firmware may have left set and the TS bit (for IP27).
11301 + * Set XX for ISA IV code to work.
11302 + */
11303 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
11304 - set_c0_status(ST0_XX);
11305 + status_set |= ST0_XX;
11306 + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
11307 + status_set);
11308
11309 /*
11310 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
11311 @@ -825,13 +830,11 @@
11312 set_c0_cause(CAUSEF_IV);
11313
11314 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
11315 - write_c0_context(((long)(&pgd_current[cpu])) << 23);
11316 - write_c0_wired(0);
11317 + TLBMISS_HANDLER_SETUP();
11318
11319 atomic_inc(&init_mm.mm_count);
11320 current->active_mm = &init_mm;
11321 - if (current->mm)
11322 - BUG();
11323 + BUG_ON(current->mm);
11324 enter_lazy_tlb(&init_mm, current, cpu);
11325 }
11326
11327 @@ -842,8 +845,6 @@
11328 extern char except_vec4;
11329 unsigned long i;
11330
11331 - per_cpu_trap_init();
11332 -
11333 /* Copy the generic exception handlers to their final destination. */
11334 memcpy((void *) KSEG0 , &except_vec0_generic, 0x80);
11335 memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
11336 @@ -933,6 +934,5 @@
11337
11338 flush_icache_range(KSEG0, KSEG0 + 0x400);
11339
11340 - atomic_inc(&init_mm.mm_count); /* XXX UP? */
11341 - current->active_mm = &init_mm;
11342 + per_cpu_trap_init();
11343 }
11344 diff -Nur linux-2.4.29/arch/mips64/mm/cerr-sb1.c linux-mips/arch/mips64/mm/cerr-sb1.c
11345 --- linux-2.4.29/arch/mips64/mm/cerr-sb1.c 2004-02-18 14:36:30.000000000 +0100
11346 +++ linux-mips/arch/mips64/mm/cerr-sb1.c 2004-12-13 18:37:26.000000000 +0100
11347 @@ -252,14 +252,14 @@
11348
11349 /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
11350 static const uint64_t mask_72_64[8] = {
11351 - 0x0738C808099264FFL,
11352 - 0x38C808099264FF07L,
11353 - 0xC808099264FF0738L,
11354 - 0x08099264FF0738C8L,
11355 - 0x099264FF0738C808L,
11356 - 0x9264FF0738C80809L,
11357 - 0x64FF0738C8080992L,
11358 - 0xFF0738C808099264L
11359 + 0x0738C808099264FFULL,
11360 + 0x38C808099264FF07ULL,
11361 + 0xC808099264FF0738ULL,
11362 + 0x08099264FF0738C8ULL,
11363 + 0x099264FF0738C808ULL,
11364 + 0x9264FF0738C80809ULL,
11365 + 0x64FF0738C8080992ULL,
11366 + 0xFF0738C808099264ULL
11367 };
11368
11369 /* Calculate the parity on a range of bits */
11370 @@ -331,9 +331,9 @@
11371 ((lru >> 4) & 0x3),
11372 ((lru >> 6) & 0x3));
11373 }
11374 - va = (taglo & 0xC0000FFFFFFFE000) | addr;
11375 + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
11376 if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
11377 - va |= 0x3FFFF00000000000;
11378 + va |= 0x3FFFF00000000000ULL;
11379 valid = ((taghi >> 29) & 1);
11380 if (valid) {
11381 tlo_tmp = taglo & 0xfff3ff;
11382 @@ -474,7 +474,7 @@
11383 : "r" ((way << 13) | addr));
11384
11385 taglo = ((unsigned long long)taglohi << 32) | taglolo;
11386 - pa = (taglo & 0xFFFFFFE000) | addr;
11387 + pa = (taglo & 0xFFFFFFE000ULL) | addr;
11388 if (way == 0) {
11389 lru = (taghi >> 14) & 0xff;
11390 prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
11391 diff -Nur linux-2.4.29/arch/mips64/mm/c-r4k.c linux-mips/arch/mips64/mm/c-r4k.c
11392 --- linux-2.4.29/arch/mips64/mm/c-r4k.c 2005-01-19 15:09:33.000000000 +0100
11393 +++ linux-mips/arch/mips64/mm/c-r4k.c 2005-03-26 11:47:18.942542836 +0100
11394 @@ -867,9 +867,16 @@
11395 * normally they'd suffer from aliases but magic in the hardware deals
11396 * with that for us so we don't need to take care ourselves.
11397 */
11398 - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
11399 - if (c->dcache.waysize > PAGE_SIZE)
11400 - c->dcache.flags |= MIPS_CACHE_ALIASES;
11401 + switch (c->cputype) {
11402 + case CPU_R10000:
11403 + case CPU_R12000:
11404 + break;
11405 + case CPU_24K:
11406 + if (!(read_c0_config7() & (1 << 16)))
11407 + default:
11408 + if (c->dcache.waysize > PAGE_SIZE)
11409 + c->dcache.flags |= MIPS_CACHE_ALIASES;
11410 + }
11411
11412 switch (c->cputype) {
11413 case CPU_20KC:
11414 @@ -1070,9 +1077,6 @@
11415 setup_scache();
11416 coherency_setup();
11417
11418 - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
11419 - c->dcache.flags |= MIPS_CACHE_ALIASES;
11420 -
11421 r4k_blast_dcache_page_setup();
11422 r4k_blast_dcache_page_indexed_setup();
11423 r4k_blast_dcache_setup();
11424 diff -Nur linux-2.4.29/arch/mips64/mm/tlbex-r4k.S linux-mips/arch/mips64/mm/tlbex-r4k.S
11425 --- linux-2.4.29/arch/mips64/mm/tlbex-r4k.S 2004-02-18 14:36:30.000000000 +0100
11426 +++ linux-mips/arch/mips64/mm/tlbex-r4k.S 2004-11-25 23:18:38.000000000 +0100
11427 @@ -151,11 +151,9 @@
11428 ld k0, 0(k1) # get even pte
11429 ld k1, 8(k1) # get odd pte
11430 PTE_RELOAD k0 k1
11431 - rm9000_tlb_hazard
11432 - b 1f
11433 - tlbwr
11434 -1: nop
11435 - rm9000_tlb_hazard
11436 + mtc0_tlbw_hazard
11437 + tlbwr
11438 +1: tlbw_eret_hazard
11439 eret
11440
11441 9: # handle the vmalloc range
11442 @@ -163,11 +161,9 @@
11443 ld k0, 0(k1) # get even pte
11444 ld k1, 8(k1) # get odd pte
11445 PTE_RELOAD k0 k1
11446 - rm9000_tlb_hazard
11447 - b 1f
11448 - tlbwr
11449 -1: nop
11450 - rm9000_tlb_hazard
11451 + mtc0_tlbw_hazard
11452 + tlbwr
11453 +1: tlbw_eret_hazard
11454 eret
11455 END(handle_vec1_r4k)
11456
11457 @@ -195,10 +191,9 @@
11458 ld k0, 0(k1) # get even pte
11459 ld k1, 8(k1) # get odd pte
11460 PTE_RELOAD k0 k1
11461 - rm9000_tlb_hazard
11462 - nop
11463 + mtc0_tlbw_hazard
11464 tlbwr
11465 - rm9000_tlb_hazard
11466 + tlbw_eret_hazard
11467 eret
11468
11469 9: # handle the vmalloc range
11470 @@ -206,10 +201,9 @@
11471 ld k0, 0(k1) # get even pte
11472 ld k1, 8(k1) # get odd pte
11473 PTE_RELOAD k0 k1
11474 - rm9000_tlb_hazard
11475 - nop
11476 + mtc0_tlbw_hazard
11477 tlbwr
11478 - rm9000_tlb_hazard
11479 + tlbw_eret_hazard
11480 eret
11481 END(handle_vec1_r10k)
11482
11483 diff -Nur linux-2.4.29/arch/mips64/mm/tlb-r4k.c linux-mips/arch/mips64/mm/tlb-r4k.c
11484 --- linux-2.4.29/arch/mips64/mm/tlb-r4k.c 2005-01-19 15:09:33.000000000 +0100
11485 +++ linux-mips/arch/mips64/mm/tlb-r4k.c 2004-11-25 23:18:38.000000000 +0100
11486 @@ -1,24 +1,12 @@
11487 /*
11488 - * Carsten Langgaard, carstenl@mips.com
11489 - * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
11490 - *
11491 - * This program is free software; you can distribute it and/or modify it
11492 - * under the terms of the GNU General Public License (Version 2) as
11493 - * published by the Free Software Foundation.
11494 - *
11495 - * This program is distributed in the hope it will be useful, but WITHOUT
11496 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11497 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11498 + * This file is subject to the terms and conditions of the GNU General Public
11499 + * License. See the file "COPYING" in the main directory of this archive
11500 * for more details.
11501 *
11502 - * You should have received a copy of the GNU General Public License along
11503 - * with this program; if not, write to the Free Software Foundation, Inc.,
11504 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
11505 - *
11506 - * MIPS64 CPU variant specific MMU routines.
11507 - * These routine are not optimized in any way, they are done in a generic way
11508 - * so they can be used on all MIPS64 compliant CPUs, and also done in an
11509 - * attempt not to break anything for the R4xx0 style CPUs.
11510 + * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
11511 + * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle ralf@gnu.org
11512 + * Carsten Langgaard, carstenl@mips.com
11513 + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
11514 */
11515 #include <linux/init.h>
11516 #include <linux/sched.h>
11517 @@ -30,9 +18,6 @@
11518 #include <asm/pgtable.h>
11519 #include <asm/system.h>
11520
11521 -#undef DEBUG_TLB
11522 -#undef DEBUG_TLBUPDATE
11523 -
11524 extern void except_vec1_r4k(void);
11525
11526 /* CP0 hazard avoidance. */
11527 @@ -46,31 +31,23 @@
11528 unsigned long old_ctx;
11529 int entry;
11530
11531 -#ifdef DEBUG_TLB
11532 - printk("[tlball]");
11533 -#endif
11534 -
11535 local_irq_save(flags);
11536 /* Save old context and create impossible VPN2 value */
11537 old_ctx = read_c0_entryhi();
11538 - write_c0_entryhi(XKPHYS);
11539 write_c0_entrylo0(0);
11540 write_c0_entrylo1(0);
11541 - BARRIER;
11542
11543 entry = read_c0_wired();
11544
11545 /* Blast 'em all away. */
11546 - while(entry < current_cpu_data.tlbsize) {
11547 - /* Make sure all entries differ. */
11548 - write_c0_entryhi(XKPHYS+entry*0x2000);
11549 + while (entry < current_cpu_data.tlbsize) {
11550 + write_c0_entryhi(XKPHYS + entry*0x2000);
11551 write_c0_index(entry);
11552 - BARRIER;
11553 + mtc0_tlbw_hazard();
11554 tlb_write_indexed();
11555 - BARRIER;
11556 entry++;
11557 }
11558 - BARRIER;
11559 + tlbw_use_hazard();
11560 write_c0_entryhi(old_ctx);
11561 local_irq_restore(flags);
11562 }
11563 @@ -79,12 +56,8 @@
11564 {
11565 int cpu = smp_processor_id();
11566
11567 - if (cpu_context(cpu, mm) != 0) {
11568 -#ifdef DEBUG_TLB
11569 - printk("[tlbmm<%d>]", mm->context);
11570 -#endif
11571 + if (cpu_context(cpu, mm) != 0)
11572 drop_mmu_context(mm,cpu);
11573 - }
11574 }
11575
11576 void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
11577 @@ -96,10 +69,6 @@
11578 unsigned long flags;
11579 int size;
11580
11581 -#ifdef DEBUG_TLB
11582 - printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & ASID_MASK),
11583 - start, end);
11584 -#endif
11585 local_irq_save(flags);
11586 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
11587 size = (size + 1) >> 1;
11588 @@ -110,25 +79,25 @@
11589 start &= (PAGE_MASK << 1);
11590 end += ((PAGE_SIZE << 1) - 1);
11591 end &= (PAGE_MASK << 1);
11592 - while(start < end) {
11593 + while (start < end) {
11594 int idx;
11595
11596 write_c0_entryhi(start | newpid);
11597 start += (PAGE_SIZE << 1);
11598 - BARRIER;
11599 + mtc0_tlbw_hazard();
11600 tlb_probe();
11601 BARRIER;
11602 idx = read_c0_index();
11603 write_c0_entrylo0(0);
11604 write_c0_entrylo1(0);
11605 - if(idx < 0)
11606 + if (idx < 0)
11607 continue;
11608 /* Make sure all entries differ. */
11609 write_c0_entryhi(XKPHYS+idx*0x2000);
11610 - BARRIER;
11611 + mtc0_tlbw_hazard();
11612 tlb_write_indexed();
11613 - BARRIER;
11614 }
11615 + tlbw_use_hazard();
11616 write_c0_entryhi(oldpid);
11617 } else {
11618 drop_mmu_context(mm, cpu);
11619 @@ -145,28 +114,26 @@
11620 unsigned long flags;
11621 unsigned long oldpid, newpid, idx;
11622
11623 -#ifdef DEBUG_TLB
11624 - printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
11625 -#endif
11626 newpid = cpu_asid(cpu, vma->vm_mm);
11627 page &= (PAGE_MASK << 1);
11628 local_irq_save(flags);
11629 oldpid = read_c0_entryhi();
11630 write_c0_entryhi(page | newpid);
11631 - BARRIER;
11632 + mtc0_tlbw_hazard();
11633 tlb_probe();
11634 BARRIER;
11635 idx = read_c0_index();
11636 write_c0_entrylo0(0);
11637 write_c0_entrylo1(0);
11638 - if(idx < 0)
11639 + if (idx < 0)
11640 goto finish;
11641 /* Make sure all entries differ. */
11642 write_c0_entryhi(XKPHYS+idx*0x2000);
11643 - BARRIER;
11644 + mtc0_tlbw_hazard();
11645 tlb_write_indexed();
11646 + tlbw_use_hazard();
11647 +
11648 finish:
11649 - BARRIER;
11650 write_c0_entryhi(oldpid);
11651 local_irq_restore(flags);
11652 }
11653 @@ -186,7 +153,7 @@
11654
11655 local_irq_save(flags);
11656 write_c0_entryhi(page);
11657 - BARRIER;
11658 + mtc0_tlbw_hazard();
11659 tlb_probe();
11660 BARRIER;
11661 idx = read_c0_index();
11662 @@ -195,10 +162,12 @@
11663 if (idx >= 0) {
11664 /* Make sure all entries differ. */
11665 write_c0_entryhi(KSEG0+idx*0x2000);
11666 + mtc0_tlbw_hazard();
11667 tlb_write_indexed();
11668 + tlbw_use_hazard();
11669 }
11670 - BARRIER;
11671 write_c0_entryhi(oldpid);
11672 +
11673 local_irq_restore(flags);
11674 }
11675
11676 @@ -208,7 +177,6 @@
11677 void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
11678 {
11679 unsigned long flags;
11680 - unsigned int asid;
11681 pgd_t *pgdp;
11682 pmd_t *pmdp;
11683 pte_t *ptep;
11684 @@ -222,70 +190,58 @@
11685
11686 pid = read_c0_entryhi() & ASID_MASK;
11687
11688 -#ifdef DEBUG_TLB
11689 - if ((pid != (cpu_asid(smp_processor_id(), vma->vm_mm))) ||
11690 - (cpu_context(smp_processor_id(), vma->vm_mm) == 0)) {
11691 - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d"
11692 - "tlbpid=%d\n", (int) (cpu_context(smp_processor_id(),
11693 - vma->vm_mm) & ASID_MASK), pid);
11694 - }
11695 -#endif
11696 -
11697 local_irq_save(flags);
11698 address &= (PAGE_MASK << 1);
11699 - write_c0_entryhi(address | (pid));
11700 + write_c0_entryhi(address | pid);
11701 pgdp = pgd_offset(vma->vm_mm, address);
11702 - BARRIER;
11703 + mtc0_tlbw_hazard();
11704 tlb_probe();
11705 BARRIER;
11706 pmdp = pmd_offset(pgdp, address);
11707 idx = read_c0_index();
11708 ptep = pte_offset(pmdp, address);
11709 - BARRIER;
11710 write_c0_entrylo0(pte_val(*ptep++) >> 6);
11711 write_c0_entrylo1(pte_val(*ptep) >> 6);
11712 - write_c0_entryhi(address | (pid));
11713 - BARRIER;
11714 - if(idx < 0) {
11715 + write_c0_entryhi(address | pid);
11716 + mtc0_tlbw_hazard();
11717 + if (idx < 0)
11718 tlb_write_random();
11719 - } else {
11720 + else
11721 tlb_write_indexed();
11722 - }
11723 - BARRIER;
11724 + tlbw_use_hazard();
11725 write_c0_entryhi(pid);
11726 - BARRIER;
11727 local_irq_restore(flags);
11728 }
11729
11730 -void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
11731 - unsigned long entryhi, unsigned long pagemask)
11732 +void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
11733 + unsigned long entryhi, unsigned long pagemask)
11734 {
11735 - unsigned long flags;
11736 - unsigned long wired;
11737 - unsigned long old_pagemask;
11738 - unsigned long old_ctx;
11739 -
11740 - local_irq_save(flags);
11741 - /* Save old context and create impossible VPN2 value */
11742 - old_ctx = (read_c0_entryhi() & ASID_MASK);
11743 - old_pagemask = read_c0_pagemask();
11744 - wired = read_c0_wired();
11745 - write_c0_wired(wired + 1);
11746 - write_c0_index(wired);
11747 - BARRIER;
11748 - write_c0_pagemask(pagemask);
11749 - write_c0_entryhi(entryhi);
11750 - write_c0_entrylo0(entrylo0);
11751 - write_c0_entrylo1(entrylo1);
11752 - BARRIER;
11753 - tlb_write_indexed();
11754 - BARRIER;
11755 -
11756 - write_c0_entryhi(old_ctx);
11757 - BARRIER;
11758 - write_c0_pagemask(old_pagemask);
11759 - local_flush_tlb_all();
11760 - local_irq_restore(flags);
11761 + unsigned long flags;
11762 + unsigned long wired;
11763 + unsigned long old_pagemask;
11764 + unsigned long old_ctx;
11765 +
11766 + local_irq_save(flags);
11767 + /* Save old context and create impossible VPN2 value */
11768 + old_ctx = read_c0_entryhi() & ASID_MASK;
11769 + old_pagemask = read_c0_pagemask();
11770 + wired = read_c0_wired();
11771 + write_c0_wired(wired + 1);
11772 + write_c0_index(wired);
11773 + BARRIER;
11774 + write_c0_pagemask(pagemask);
11775 + write_c0_entryhi(entryhi);
11776 + write_c0_entrylo0(entrylo0);
11777 + write_c0_entrylo1(entrylo1);
11778 + mtc0_tlbw_hazard();
11779 + tlb_write_indexed();
11780 + tlbw_use_hazard();
11781 +
11782 + write_c0_entryhi(old_ctx);
11783 + BARRIER;
11784 + write_c0_pagemask(old_pagemask);
11785 + local_flush_tlb_all();
11786 + local_irq_restore(flags);
11787 }
11788
11789 /*
11790 @@ -317,17 +273,15 @@
11791 }
11792
11793 write_c0_index(temp_tlb_entry);
11794 - BARRIER;
11795 write_c0_pagemask(pagemask);
11796 write_c0_entryhi(entryhi);
11797 write_c0_entrylo0(entrylo0);
11798 write_c0_entrylo1(entrylo1);
11799 - BARRIER;
11800 + mtc0_tlbw_hazard();
11801 tlb_write_indexed();
11802 - BARRIER;
11803 + tlbw_use_hazard();
11804
11805 write_c0_entryhi(old_ctx);
11806 - BARRIER;
11807 write_c0_pagemask(old_pagemask);
11808 out:
11809 local_irq_restore(flags);
11810 @@ -348,15 +302,23 @@
11811 return;
11812
11813 config1 = read_c0_config1();
11814 - if (!((config1 >> 7) & 3))
11815 - panic("No MMU present");
11816 + if (!((config >> 7) & 3))
11817 + panic("No TLB present");
11818
11819 c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
11820 }
11821
11822 void __init r4k_tlb_init(void)
11823 {
11824 - unsigned long config = read_c0_config();
11825 + unsigned int config = read_c0_config();
11826 +
11827 + /*
11828 + * You should never change this register:
11829 + * - On R4600 1.7 the tlbp never hits for pages smaller than
11830 + * the value in the c0_pagemask register.
11831 + * - The entire mm handling assumes the c0_pagemask register to
11832 + * be set for 4kb pages.
11833 + */
11834 probe_tlb(config);
11835 write_c0_pagemask(PM_DEFAULT_MASK);
11836 write_c0_wired(0);
11837 diff -Nur linux-2.4.29/arch/parisc/kernel/sys_parisc32.c linux-mips/arch/parisc/kernel/sys_parisc32.c
11838 --- linux-2.4.29/arch/parisc/kernel/sys_parisc32.c 2005-01-19 15:09:35.000000000 +0100
11839 +++ linux-mips/arch/parisc/kernel/sys_parisc32.c 2005-03-26 11:47:18.967538734 +0100
11840 @@ -1671,11 +1671,9 @@
11841 i--;
11842 }
11843
11844 - inode = file->f_dentry->d_inode;
11845 /* VERIFY_WRITE actually means a read, as we write to user space */
11846 - retval = locks_verify_area((type == VERIFY_WRITE
11847 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
11848 - inode, file, file->f_pos, tot_len);
11849 + retval = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
11850 + file, &file->f_pos, tot_len);
11851 if (retval) {
11852 if (iov != iovstack)
11853 kfree(iov);
11854 @@ -2108,7 +2106,8 @@
11855 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
11856 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
11857 */
11858 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
11859 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
11860 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
11861 {
11862 unsigned char *workbuf, *wp;
11863 unsigned long bufsz, space_avail;
11864 @@ -2139,6 +2138,9 @@
11865 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
11866
11867 clen64 = kcmsg32->cmsg_len;
11868 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
11869 + (clen64 > (orig_cmsg_len + wp - workbuf)))
11870 + break;
11871 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
11872 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
11873 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
11874 @@ -2224,6 +2226,7 @@
11875 struct sockaddr *uaddr;
11876 int *uaddr_len;
11877 unsigned long cmsg_ptr;
11878 + __kernel_size_t cmsg_len;
11879 int err, total_len, len = 0;
11880
11881 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
11882 @@ -2239,6 +2242,7 @@
11883 total_len = err;
11884
11885 cmsg_ptr = (unsigned long) kern_msg.msg_control;
11886 + cmsg_len = kern_msg.msg_controllen;
11887 kern_msg.msg_flags = 0;
11888
11889 sock = sockfd_lookup(fd, &err);
11890 @@ -2264,7 +2268,8 @@
11891 * to fix it up before we tack on more stuff.
11892 */
11893 if((unsigned long) kern_msg.msg_control != cmsg_ptr)
11894 - cmsg32_recvmsg_fixup(&kern_msg, cmsg_ptr);
11895 + cmsg32_recvmsg_fixup(&kern_msg,
11896 + cmsg_ptr, cmsg_len);
11897
11898 /* Wheee... */
11899 if(sock->passcred)
11900 diff -Nur linux-2.4.29/arch/ppc/kernel/cputable.c linux-mips/arch/ppc/kernel/cputable.c
11901 --- linux-2.4.29/arch/ppc/kernel/cputable.c 2004-11-17 12:54:21.000000000 +0100
11902 +++ linux-mips/arch/ppc/kernel/cputable.c 2005-03-26 11:47:18.990534959 +0100
11903 @@ -480,8 +480,8 @@
11904 32, 32,
11905 0, /*__setup_cpu_440 */
11906 },
11907 - { /* 440GX Rev. B1 (2.1) */
11908 - 0xf0000fff, 0x50000852, "440GX Rev. B1 (2.1)",
11909 + { /* 440GX Rev. C */
11910 + 0xf0000fff, 0x50000892, "440GX Rev. C",
11911 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
11912 PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
11913 32, 32,
11914 diff -Nur linux-2.4.29/arch/ppc/kernel/head_8xx.S linux-mips/arch/ppc/kernel/head_8xx.S
11915 --- linux-2.4.29/arch/ppc/kernel/head_8xx.S 2004-02-18 14:36:30.000000000 +0100
11916 +++ linux-mips/arch/ppc/kernel/head_8xx.S 2005-03-26 11:47:18.992534631 +0100
11917 @@ -338,13 +338,13 @@
11918 3:
11919 lwz r21, 0(r20) /* Get the level 1 entry */
11920 rlwinm. r20, r21,0,0,19 /* Extract page descriptor page address */
11921 - beq 2f /* If zero, don't try to find a pte */
11922
11923 /* We have a pte table, so load the MI_TWC with the attributes
11924 * for this "segment."
11925 */
11926 tophys(r21,r21)
11927 ori r21,r21,1 /* Set valid bit */
11928 + beq- 2f /* If zero, don't try to find a pte */
11929 #ifdef CONFIG_8xx_CPU6
11930 li r3, 0x2b80
11931 stw r3, 12(r0)
11932 @@ -369,7 +369,7 @@
11933 * set. All other Linux PTE bits control the behavior
11934 * of the MMU.
11935 */
11936 - li r21, 0x00f0
11937 +2: li r21, 0x00f0
11938 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
11939
11940 #ifdef CONFIG_8xx_CPU6
11941 @@ -388,15 +388,6 @@
11942 #endif
11943 rfi
11944
11945 -2: mfspr r20, M_TW /* Restore registers */
11946 - lwz r21, 0(r0)
11947 - mtcr r21
11948 - lwz r21, 4(r0)
11949 -#ifdef CONFIG_8xx_CPU6
11950 - lwz r3, 8(r0)
11951 -#endif
11952 - b InstructionAccess
11953 -
11954 . = 0x1200
11955 DataStoreTLBMiss:
11956 #ifdef CONFIG_8xx_CPU6
11957 @@ -422,12 +413,12 @@
11958 3:
11959 lwz r21, 0(r20) /* Get the level 1 entry */
11960 rlwinm. r20, r21,0,0,19 /* Extract page descriptor page address */
11961 - beq 2f /* If zero, don't try to find a pte */
11962
11963 /* We have a pte table, so load fetch the pte from the table.
11964 */
11965 tophys(r21, r21)
11966 ori r21, r21, 1 /* Set valid bit in physical L2 page */
11967 + beq- 2f /* If zero, don't try to find a pte */
11968 #ifdef CONFIG_8xx_CPU6
11969 li r3, 0x3b80
11970 stw r3, 12(r0)
11971 @@ -461,7 +452,7 @@
11972 * set. All other Linux PTE bits control the behavior
11973 * of the MMU.
11974 */
11975 - li r21, 0x00f0
11976 +2: li r21, 0x00f0
11977 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
11978
11979 #ifdef CONFIG_8xx_CPU6
11980 @@ -480,24 +471,6 @@
11981 #endif
11982 rfi
11983
11984 -2:
11985 - /* Copy 20 msb from MD_EPN to DAR since the dcxx instructions fail
11986 - * to update DAR when they cause a DTLB miss.
11987 - */
11988 - mfspr r21, MD_EPN
11989 - mfspr r20, DAR
11990 - rlwimi r20, r21, 0, 0, 19
11991 - mtspr DAR, r20
11992 -
11993 - mfspr r20, M_TW /* Restore registers */
11994 - lwz r21, 0(r0)
11995 - mtcr r21
11996 - lwz r21, 4(r0)
11997 -#ifdef CONFIG_8xx_CPU6
11998 - lwz r3, 8(r0)
11999 -#endif
12000 - b DataAccess
12001 -
12002 /* This is an instruction TLB error on the MPC8xx. This could be due
12003 * to many reasons, such as executing guarded memory or illegal instruction
12004 * addresses. There is nothing to do but handle a big time error fault.
12005 diff -Nur linux-2.4.29/arch/ppc64/kernel/sys_ppc32.c linux-mips/arch/ppc64/kernel/sys_ppc32.c
12006 --- linux-2.4.29/arch/ppc64/kernel/sys_ppc32.c 2005-01-19 15:09:37.000000000 +0100
12007 +++ linux-mips/arch/ppc64/kernel/sys_ppc32.c 2005-03-26 11:47:19.016530693 +0100
12008 @@ -183,11 +183,9 @@
12009 i--;
12010 }
12011
12012 - inode = file->f_dentry->d_inode;
12013 /* VERIFY_WRITE actually means a read, as we write to user space */
12014 - retval = locks_verify_area((type == VERIFY_WRITE
12015 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
12016 - inode, file, file->f_pos, tot_len);
12017 + retval = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
12018 + file, &file->f_pos, tot_len);
12019 if (retval) {
12020 if (iov != iovstack)
12021 kfree(iov);
12022 @@ -3666,7 +3664,8 @@
12023 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
12024 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
12025 */
12026 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
12027 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
12028 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
12029 {
12030 unsigned char *workbuf, *wp;
12031 unsigned long bufsz, space_avail;
12032 @@ -3697,6 +3696,9 @@
12033 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
12034
12035 clen64 = kcmsg32->cmsg_len;
12036 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12037 + (clen64 > (orig_cmsg_len + wp - workbuf)))
12038 + break;
12039 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
12040 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
12041 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
12042 @@ -3753,6 +3755,7 @@
12043 struct sockaddr *uaddr;
12044 int *uaddr_len;
12045 unsigned long cmsg_ptr;
12046 + __kernel_size_t cmsg_len;
12047 int err, total_len, len = 0;
12048
12049 PPCDBG(PPCDBG_SYS32, "sys32_recvmsg - entered - fd=%x, user_msg@=%p, user_flags=%x \n", fd, user_msg, user_flags);
12050 @@ -3770,6 +3773,7 @@
12051 total_len = err;
12052
12053 cmsg_ptr = (unsigned long) kern_msg.msg_control;
12054 + cmsg_len = kern_msg.msg_controllen;
12055 kern_msg.msg_flags = 0;
12056
12057 sock = sockfd_lookup(fd, &err);
12058 @@ -3795,7 +3799,8 @@
12059 * to fix it up before we tack on more stuff.
12060 */
12061 if((unsigned long) kern_msg.msg_control != cmsg_ptr)
12062 - cmsg32_recvmsg_fixup(&kern_msg, cmsg_ptr);
12063 + cmsg32_recvmsg_fixup(&kern_msg,
12064 + cmsg_ptr, cmsg_len);
12065
12066 /* Wheee... */
12067 if(sock->passcred)
12068 diff -Nur linux-2.4.29/arch/s390x/kernel/linux32.c linux-mips/arch/s390x/kernel/linux32.c
12069 --- linux-2.4.29/arch/s390x/kernel/linux32.c 2005-01-19 15:09:38.000000000 +0100
12070 +++ linux-mips/arch/s390x/kernel/linux32.c 2005-03-26 11:47:19.529446512 +0100
12071 @@ -1108,7 +1108,6 @@
12072 unsigned long tot_len;
12073 struct iovec iovstack[UIO_FASTIOV];
12074 struct iovec *iov=iovstack, *ivp;
12075 - struct inode *inode;
12076 long retval, i;
12077 io_fn_t fn;
12078 iov_fn_t fnv;
12079 @@ -1145,11 +1144,9 @@
12080 i--;
12081 }
12082
12083 - inode = file->f_dentry->d_inode;
12084 /* VERIFY_WRITE actually means a read, as we write to user space */
12085 - retval = locks_verify_area((type == VERIFY_WRITE
12086 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
12087 - inode, file, file->f_pos, tot_len);
12088 + retval = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
12089 + file, &file->f_pos, tot_len);
12090 if (retval)
12091 goto out;
12092
12093 @@ -2600,7 +2597,8 @@
12094 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
12095 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
12096 */
12097 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
12098 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
12099 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
12100 {
12101 unsigned char *workbuf, *wp;
12102 unsigned long bufsz, space_avail;
12103 @@ -2631,6 +2629,9 @@
12104 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
12105
12106 clen64 = kcmsg32->cmsg_len;
12107 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12108 + (clen64 > (orig_cmsg_len + wp - workbuf)))
12109 + break;
12110 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
12111 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
12112 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
12113 @@ -2890,7 +2891,8 @@
12114
12115 static __inline__ void
12116 scm_recv32(struct socket *sock, struct msghdr *msg,
12117 - struct scm_cookie *scm, int flags, unsigned long cmsg_ptr)
12118 + struct scm_cookie *scm, int flags, unsigned long cmsg_ptr,
12119 + __kernel_size_t cmsg_len)
12120 {
12121 if(!msg->msg_control)
12122 {
12123 @@ -2905,7 +2907,7 @@
12124 * to fix it up before we tack on more stuff.
12125 */
12126 if((unsigned long) msg->msg_control != cmsg_ptr)
12127 - cmsg32_recvmsg_fixup(msg, cmsg_ptr);
12128 + cmsg32_recvmsg_fixup(msg, cmsg_ptr, cmsg_len);
12129 /* Wheee... */
12130 if(sock->passcred)
12131 put_cmsg32(msg,
12132 @@ -2919,14 +2921,14 @@
12133
12134 static int
12135 sock_recvmsg32(struct socket *sock, struct msghdr *msg, int size, int flags,
12136 - unsigned long cmsg_ptr)
12137 + unsigned long cmsg_ptr, __kernel_size_t cmsg_len)
12138 {
12139 struct scm_cookie scm;
12140
12141 memset(&scm, 0, sizeof(scm));
12142 size = sock->ops->recvmsg(sock, msg, size, flags, &scm);
12143 if (size >= 0)
12144 - scm_recv32(sock, msg, &scm, flags, cmsg_ptr);
12145 + scm_recv32(sock, msg, &scm, flags, cmsg_ptr, cmsg_len);
12146
12147 return size;
12148 }
12149 @@ -2943,6 +2945,7 @@
12150 struct iovec *iov=iovstack;
12151 struct msghdr msg_sys;
12152 unsigned long cmsg_ptr;
12153 + __kernel_size_t cmsg_len;
12154 int err, iov_size, total_len, len;
12155
12156 /* kernel mode address */
12157 @@ -2986,11 +2989,12 @@
12158 total_len=err;
12159
12160 cmsg_ptr = (unsigned long)msg_sys.msg_control;
12161 + cmsg_len = msg_sys.msg_controllen;
12162 msg_sys.msg_flags = 0;
12163
12164 if (sock->file->f_flags & O_NONBLOCK)
12165 flags |= MSG_DONTWAIT;
12166 - err = sock_recvmsg32(sock, &msg_sys, total_len, flags, cmsg_ptr);
12167 + err = sock_recvmsg32(sock, &msg_sys, total_len, flags, cmsg_ptr, cmsg_len);
12168 if (err < 0)
12169 goto out_freeiov;
12170 len = err;
12171 diff -Nur linux-2.4.29/arch/sparc/kernel/muldiv.c linux-mips/arch/sparc/kernel/muldiv.c
12172 --- linux-2.4.29/arch/sparc/kernel/muldiv.c 1998-01-13 00:15:43.000000000 +0100
12173 +++ linux-mips/arch/sparc/kernel/muldiv.c 2005-03-26 11:47:19.631429774 +0100
12174 @@ -4,6 +4,9 @@
12175 *
12176 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
12177 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
12178 + *
12179 + * 2004-12-25 Krzysztof Helt (krzysztof.h1@wp.pl)
12180 + * - fixed registers constrains in inline assembly declarations
12181 */
12182
12183 #include <linux/kernel.h>
12184 @@ -125,7 +128,7 @@
12185 "mov %%o0, %0\n\t"
12186 "mov %%o1, %1\n\t"
12187 : "=r" (rs1), "=r" (rs2)
12188 - :
12189 + : "0" (rs1), "1" (rs2)
12190 : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc");
12191 #ifdef DEBUG_MULDIV
12192 printk ("0x%x%08x\n", rs2, rs1);
12193 @@ -145,7 +148,7 @@
12194 "mov %%o0, %0\n\t"
12195 "mov %%o1, %1\n\t"
12196 : "=r" (rs1), "=r" (rs2)
12197 - :
12198 + : "0" (rs1), "1" (rs2)
12199 : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc");
12200 #ifdef DEBUG_MULDIV
12201 printk ("0x%x%08x\n", rs2, rs1);
12202 @@ -174,7 +177,7 @@
12203 "mov %%o1, %0\n\t"
12204 "mov %%o0, %1\n\t"
12205 : "=r" (rs1), "=r" (rs2)
12206 - : "r" (regs->y)
12207 + : "r" (regs->y), "0" (rs1), "1" (rs2)
12208 : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
12209 "g1", "g2", "g3", "cc");
12210 #ifdef DEBUG_MULDIV
12211 @@ -203,7 +206,7 @@
12212 "mov %%o1, %0\n\t"
12213 "mov %%o0, %1\n\t"
12214 : "=r" (rs1), "=r" (rs2)
12215 - : "r" (regs->y)
12216 + : "r" (regs->y), "0" (rs1), "1" (rs2)
12217 : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
12218 "g1", "g2", "g3", "cc");
12219 #ifdef DEBUG_MULDIV
12220 diff -Nur linux-2.4.29/arch/sparc/kernel/process.c linux-mips/arch/sparc/kernel/process.c
12221 --- linux-2.4.29/arch/sparc/kernel/process.c 2004-08-08 01:26:04.000000000 +0200
12222 +++ linux-mips/arch/sparc/kernel/process.c 2005-03-26 11:47:19.632429610 +0100
12223 @@ -512,6 +512,11 @@
12224 }
12225 }
12226
12227 +#ifdef CONFIG_SMP
12228 + /* FPU must be disabled on SMP. */
12229 + childregs->psr &= ~PSR_EF;
12230 +#endif
12231 +
12232 /* Set the return value for the child. */
12233 childregs->u_regs[UREG_I0] = current->pid;
12234 childregs->u_regs[UREG_I1] = 1;
12235 diff -Nur linux-2.4.29/arch/sparc64/kernel/ioctl32.c linux-mips/arch/sparc64/kernel/ioctl32.c
12236 --- linux-2.4.29/arch/sparc64/kernel/ioctl32.c 2005-01-19 15:09:39.000000000 +0100
12237 +++ linux-mips/arch/sparc64/kernel/ioctl32.c 2005-03-26 11:47:19.641428133 +0100
12238 @@ -562,6 +562,8 @@
12239
12240 if (!(current->thread.flags & SPARC_FLAG_32BIT))
12241 usp += STACK_BIAS;
12242 + else
12243 + usp &= 0xffffffffUL;
12244
12245 return (void *) (usp - len);
12246 }
12247 @@ -696,6 +698,7 @@
12248 set_fs (old_fs);
12249 if (!err) {
12250 switch (cmd) {
12251 + case TUNSETIFF:
12252 case SIOCGIFFLAGS:
12253 case SIOCGIFMETRIC:
12254 case SIOCGIFMTU:
12255 diff -Nur linux-2.4.29/arch/sparc64/kernel/pci_schizo.c linux-mips/arch/sparc64/kernel/pci_schizo.c
12256 --- linux-2.4.29/arch/sparc64/kernel/pci_schizo.c 2004-11-17 12:54:21.000000000 +0100
12257 +++ linux-mips/arch/sparc64/kernel/pci_schizo.c 2005-03-26 11:47:19.646427312 +0100
12258 @@ -388,9 +388,9 @@
12259 return ret;
12260 }
12261
12262 -static unsigned int __init schizo_irq_build(struct pci_pbm_info *pbm,
12263 - struct pci_dev *pdev,
12264 - unsigned int ino)
12265 +static unsigned int schizo_irq_build(struct pci_pbm_info *pbm,
12266 + struct pci_dev *pdev,
12267 + unsigned int ino)
12268 {
12269 struct ino_bucket *bucket;
12270 unsigned long imap, iclr;
12271 @@ -444,19 +444,57 @@
12272 static unsigned long stc_tag_buf[16];
12273 static unsigned long stc_line_buf[16];
12274
12275 -/* These offsets look weird because I keep in pbm->controller_regs
12276 - * the second PROM register property minus 0x10000 which is the
12277 - * base of the Safari and UPA64S registers of SCHIZO.
12278 - */
12279 -#define SCHIZO_PBM_A_REGS_OFF (0x600000UL - 0x400000UL)
12280 -#define SCHIZO_PBM_B_REGS_OFF (0x700000UL - 0x400000UL)
12281 +#define SCHIZO_UE_INO 0x30 /* Uncorrectable ECC error */
12282 +#define SCHIZO_CE_INO 0x31 /* Correctable ECC error */
12283 +#define SCHIZO_PCIERR_A_INO 0x32 /* PBM A PCI bus error */
12284 +#define SCHIZO_PCIERR_B_INO 0x33 /* PBM B PCI bus error */
12285 +#define SCHIZO_SERR_INO 0x34 /* Safari interface error */
12286 +
12287 +struct pci_pbm_info *pbm_for_ino(struct pci_controller_info *p, u32 ino)
12288 +{
12289 + ino &= IMAP_INO;
12290 + if (p->pbm_A.ino_bitmap & (1UL << ino))
12291 + return &p->pbm_A;
12292 + if (p->pbm_B.ino_bitmap & (1UL << ino))
12293 + return &p->pbm_B;
12294 +
12295 + printk("PCI%d: No ino_bitmap entry for ino[%x], bitmaps "
12296 + "PBM_A[%016lx] PBM_B[%016lx]",
12297 + p->index, ino,
12298 + p->pbm_A.ino_bitmap,
12299 + p->pbm_B.ino_bitmap);
12300 + printk("PCI%d: Using PBM_A, report this problem immediately.\n",
12301 + p->index);
12302 +
12303 + return &p->pbm_A;
12304 +}
12305
12306 -static void schizo_clear_other_err_intr(int irq)
12307 +static void schizo_clear_other_err_intr(struct pci_controller_info *p, int irq)
12308 {
12309 - struct ino_bucket *bucket = __bucket(irq);
12310 - unsigned long iclr = bucket->iclr;
12311 + struct pci_pbm_info *pbm;
12312 + struct ino_bucket *bucket;
12313 + unsigned long iclr;
12314 +
12315 + /* Do not clear the interrupt for the other PCI bus.
12316 + *
12317 + * This "ACK both PBM IRQs" only needs to be performed
12318 + * for chip-wide error interrupts.
12319 + */
12320 + if ((irq & IMAP_INO) == SCHIZO_PCIERR_A_INO ||
12321 + (irq & IMAP_INO) == SCHIZO_PCIERR_B_INO)
12322 + return;
12323 +
12324 + pbm = pbm_for_ino(p, irq);
12325 + if (pbm == &p->pbm_A)
12326 + pbm = &p->pbm_B;
12327 + else
12328 + pbm = &p->pbm_A;
12329 +
12330 + irq = schizo_irq_build(pbm, NULL,
12331 + (pbm->portid << 6) | (irq & IMAP_INO));
12332 + bucket = __bucket(irq);
12333 + iclr = bucket->iclr;
12334
12335 - iclr += (SCHIZO_PBM_B_REGS_OFF - SCHIZO_PBM_A_REGS_OFF);
12336 upa_writel(ICLR_IDLE, iclr);
12337 }
12338
12339 @@ -790,7 +828,7 @@
12340 /* Interrogate IOMMU for error status. */
12341 schizo_check_iommu_error(p, UE_ERR);
12342
12343 - schizo_clear_other_err_intr(irq);
12344 + schizo_clear_other_err_intr(p, irq);
12345 }
12346
12347 #define SCHIZO_CE_AFSR 0x10040UL
12348 @@ -879,7 +917,7 @@
12349 printk("(none)");
12350 printk("]\n");
12351
12352 - schizo_clear_other_err_intr(irq);
12353 + schizo_clear_other_err_intr(p, irq);
12354 }
12355
12356 #define SCHIZO_PCI_AFSR 0x2010UL
12357 @@ -914,9 +952,9 @@
12358 #define SCHIZO_PCICTRL_SBH_ERR (1UL << 35UL) /* Safari */
12359 #define SCHIZO_PCICTRL_SERR (1UL << 34UL) /* Safari/Tomatillo */
12360 #define SCHIZO_PCICTRL_PCISPD (1UL << 33UL) /* Safari */
12361 -#define SCHIZO_PCICTRL_MRM_PREF (1UL << 28UL) /* Tomatillo */
12362 -#define SCHIZO_PCICTRL_RDO_PREF (1UL << 27UL) /* Tomatillo */
12363 -#define SCHIZO_PCICTRL_RDL_PREF (1UL << 26UL) /* Tomatillo */
12364 +#define SCHIZO_PCICTRL_MRM_PREF (1UL << 30UL) /* Tomatillo */
12365 +#define SCHIZO_PCICTRL_RDO_PREF (1UL << 29UL) /* Tomatillo */
12366 +#define SCHIZO_PCICTRL_RDL_PREF (1UL << 28UL) /* Tomatillo */
12367 #define SCHIZO_PCICTRL_PTO (3UL << 24UL) /* Safari/Tomatillo */
12368 #define SCHIZO_PCICTRL_PTO_SHIFT 24UL
12369 #define SCHIZO_PCICTRL_TRWSW (7UL << 21UL) /* Tomatillo */
12370 @@ -1094,7 +1132,7 @@
12371 if (error_bits & (SCHIZO_PCIAFSR_PPERR | SCHIZO_PCIAFSR_SPERR))
12372 pci_scan_for_parity_error(p, pbm, pbm->pci_bus);
12373
12374 - schizo_clear_other_err_intr(irq);
12375 + schizo_clear_other_err_intr(p, irq);
12376 }
12377
12378 #define SCHIZO_SAFARI_ERRLOG 0x10018UL
12379 @@ -1149,7 +1187,7 @@
12380 printk("PCI%d: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n",
12381 p->index, errlog);
12382
12383 - schizo_clear_other_err_intr(irq);
12384 + schizo_clear_other_err_intr(p, irq);
12385 return;
12386 }
12387
12388 @@ -1157,7 +1195,7 @@
12389 p->index);
12390 schizo_check_iommu_error(p, SAFARI_ERR);
12391
12392 - schizo_clear_other_err_intr(irq);
12393 + schizo_clear_other_err_intr(p, irq);
12394 }
12395
12396 /* Nearly identical to PSYCHO equivalents... */
12397 @@ -1171,26 +1209,6 @@
12398 #define SCHIZO_SAFARI_IRQCTRL 0x10010UL
12399 #define SCHIZO_SAFIRQCTRL_EN 0x8000000000000000UL
12400
12401 -#define SCHIZO_UE_INO 0x30 /* Uncorrectable ECC error */
12402 -#define SCHIZO_CE_INO 0x31 /* Correctable ECC error */
12403 -#define SCHIZO_PCIERR_A_INO 0x32 /* PBM A PCI bus error */
12404 -#define SCHIZO_PCIERR_B_INO 0x33 /* PBM B PCI bus error */
12405 -#define SCHIZO_SERR_INO 0x34 /* Safari interface error */
12406 -
12407 -struct pci_pbm_info *pbm_for_ino(struct pci_controller_info *p, u32 ino)
12408 -{
12409 - ino &= IMAP_INO;
12410 - if (p->pbm_A.ino_bitmap & (1UL << ino))
12411 - return &p->pbm_A;
12412 - if (p->pbm_B.ino_bitmap & (1UL << ino))
12413 - return &p->pbm_B;
12414 - prom_printf("TOMATILLO%d: No entry in ino bitmap for %d\n",
12415 - p->index, ino);
12416 - prom_halt();
12417 - /* NOTREACHED */
12418 - return NULL;
12419 -}
12420 -
12421 /* How the Tomatillo IRQs are routed around is pure guesswork here.
12422 *
12423 * All the Tomatillo devices I see in prtconf dumps seem to have only
12424 @@ -1964,7 +1982,7 @@
12425
12426 tmp &= ~SCHIZO_PCICTRL_PTO;
12427 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO &&
12428 - pbm->chip_version == 0x2)
12429 + pbm->chip_version >= 0x2)
12430 tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT;
12431 else
12432 tmp |= 0x1UL << SCHIZO_PCICTRL_PTO_SHIFT;
12433 @@ -1972,8 +1990,16 @@
12434 if (!prom_getbool(pbm->prom_node, "no-bus-parking"))
12435 tmp |= SCHIZO_PCICTRL_PARK;
12436
12437 + if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO &&
12438 + pbm->chip_version <= 0x1)
12439 + tmp |= (1UL << 61);
12440 + else
12441 + tmp &= ~(1UL << 61);
12442 +
12443 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO)
12444 - tmp |= SCHIZO_PCICTRL_MRM_PREF;
12445 + tmp |= (SCHIZO_PCICTRL_MRM_PREF |
12446 + SCHIZO_PCICTRL_RDO_PREF |
12447 + SCHIZO_PCICTRL_RDL_PREF);
12448
12449 schizo_write(pbm->pbm_regs + SCHIZO_PCI_CTRL, tmp);
12450
12451 diff -Nur linux-2.4.29/arch/sparc64/kernel/smp.c linux-mips/arch/sparc64/kernel/smp.c
12452 --- linux-2.4.29/arch/sparc64/kernel/smp.c 2005-01-19 15:09:39.000000000 +0100
12453 +++ linux-mips/arch/sparc64/kernel/smp.c 2005-03-26 11:47:19.647427148 +0100
12454 @@ -1034,7 +1034,7 @@
12455 void smp_capture(void)
12456 {
12457 if (smp_processors_ready) {
12458 - int result = __atomic_add(1, &smp_capture_depth);
12459 + int result = atomic_add_ret(1, &smp_capture_depth);
12460
12461 membar("#StoreStore | #LoadStore");
12462 if (result == 1) {
12463 diff -Nur linux-2.4.29/arch/sparc64/kernel/sparc64_ksyms.c linux-mips/arch/sparc64/kernel/sparc64_ksyms.c
12464 --- linux-2.4.29/arch/sparc64/kernel/sparc64_ksyms.c 2004-11-17 12:54:21.000000000 +0100
12465 +++ linux-mips/arch/sparc64/kernel/sparc64_ksyms.c 2005-03-26 11:47:19.648426984 +0100
12466 @@ -173,18 +173,21 @@
12467 EXPORT_SYMBOL(__up);
12468
12469 /* Atomic counter implementation. */
12470 -EXPORT_SYMBOL(__atomic_add);
12471 -EXPORT_SYMBOL(__atomic_sub);
12472 +EXPORT_SYMBOL(atomic_add);
12473 +EXPORT_SYMBOL(atomic_add_ret);
12474 +EXPORT_SYMBOL(atomic_sub);
12475 +EXPORT_SYMBOL(atomic_sub_ret);
12476 #ifdef CONFIG_SMP
12477 EXPORT_SYMBOL(atomic_dec_and_lock);
12478 #endif
12479
12480 /* Atomic bit operations. */
12481 -EXPORT_SYMBOL(___test_and_set_bit);
12482 -EXPORT_SYMBOL(___test_and_clear_bit);
12483 -EXPORT_SYMBOL(___test_and_change_bit);
12484 -EXPORT_SYMBOL(___test_and_set_le_bit);
12485 -EXPORT_SYMBOL(___test_and_clear_le_bit);
12486 +EXPORT_SYMBOL(test_and_set_bit);
12487 +EXPORT_SYMBOL(test_and_clear_bit);
12488 +EXPORT_SYMBOL(test_and_change_bit);
12489 +EXPORT_SYMBOL(set_bit);
12490 +EXPORT_SYMBOL(clear_bit);
12491 +EXPORT_SYMBOL(change_bit);
12492
12493 EXPORT_SYMBOL(ivector_table);
12494 EXPORT_SYMBOL(enable_irq);
12495 diff -Nur linux-2.4.29/arch/sparc64/kernel/sys_sparc32.c linux-mips/arch/sparc64/kernel/sys_sparc32.c
12496 --- linux-2.4.29/arch/sparc64/kernel/sys_sparc32.c 2005-01-19 15:09:39.000000000 +0100
12497 +++ linux-mips/arch/sparc64/kernel/sys_sparc32.c 2005-03-26 11:47:19.669423538 +0100
12498 @@ -505,25 +505,32 @@
12499 return err;
12500 }
12501
12502 -static int do_sys32_msgsnd (int first, int second, int third, void *uptr)
12503 +static int do_sys32_msgsnd(int first, int second, int third, void *uptr)
12504 {
12505 - struct msgbuf *p = kmalloc (second + sizeof (struct msgbuf), GFP_USER);
12506 - struct msgbuf32 *up = (struct msgbuf32 *)uptr;
12507 + struct msgbuf *p;
12508 + struct msgbuf32 *up;
12509 mm_segment_t old_fs;
12510 int err;
12511
12512 + if (second < 0)
12513 + return -EINVAL;
12514 +
12515 + p = kmalloc(second + sizeof (struct msgbuf), GFP_USER);
12516 if (!p)
12517 return -ENOMEM;
12518 +
12519 + up = (struct msgbuf32 *)uptr;
12520 err = -EFAULT;
12521 - if (get_user (p->mtype, &up->mtype) ||
12522 - __copy_from_user (p->mtext, &up->mtext, second))
12523 + if (get_user(p->mtype, &up->mtype) ||
12524 + __copy_from_user(p->mtext, up->mtext, second))
12525 goto out;
12526 - old_fs = get_fs ();
12527 - set_fs (KERNEL_DS);
12528 - err = sys_msgsnd (first, p, second, third);
12529 - set_fs (old_fs);
12530 +
12531 + old_fs = get_fs();
12532 + set_fs(KERNEL_DS);
12533 + err = sys_msgsnd(first, p, second, third);
12534 + set_fs(old_fs);
12535 out:
12536 - kfree (p);
12537 + kfree(p);
12538 return err;
12539 }
12540
12541 @@ -535,6 +542,9 @@
12542 mm_segment_t old_fs;
12543 int err;
12544
12545 + if (second < 0)
12546 + return -EINVAL;
12547 +
12548 if (!version) {
12549 struct ipc_kludge *uipck = (struct ipc_kludge *)uptr;
12550 struct ipc_kludge ipck;
12551 @@ -560,7 +570,7 @@
12552 goto free_then_out;
12553 up = (struct msgbuf32 *)uptr;
12554 if (put_user (p->mtype, &up->mtype) ||
12555 - __copy_to_user (&up->mtext, p->mtext, err))
12556 + __copy_to_user (up->mtext, p->mtext, err))
12557 err = -EFAULT;
12558 free_then_out:
12559 kfree (p);
12560 @@ -647,18 +657,18 @@
12561 return err;
12562 }
12563
12564 -static int do_sys32_shmat (int first, int second, int third, int version, void *uptr)
12565 +static int do_sys32_shmat(int first, int second, u32 third, int version, void *uptr)
12566 {
12567 unsigned long raddr;
12568 - u32 *uaddr = (u32 *)A((u32)third);
12569 + u32 *uaddr = (u32 *)A(third);
12570 int err = -EINVAL;
12571
12572 if (version == 1)
12573 goto out;
12574 - err = sys_shmat (first, uptr, second, &raddr);
12575 + err = sys_shmat(first, uptr, second, &raddr);
12576 if (err)
12577 goto out;
12578 - err = put_user (raddr, uaddr);
12579 + err = put_user(raddr, uaddr);
12580 out:
12581 return err;
12582 }
12583 @@ -770,6 +780,8 @@
12584
12585 if (!(current->thread.flags & SPARC_FLAG_32BIT))
12586 usp += STACK_BIAS;
12587 + else
12588 + usp &= 0xffffffffUL;
12589
12590 return (void *) (usp - len);
12591 }
12592 @@ -795,9 +807,11 @@
12593 return sys_semtimedop(semid, tsems, nsems, t64);
12594 }
12595
12596 -asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
12597 +asmlinkage int sys32_ipc (u32 call, u32 first, u32 second, u32 third, s32 __ptr, s32 __fifth)
12598 {
12599 int version, err;
12600 + u32 ptr = (u32) __ptr;
12601 + u32 fifth = (u32) __fifth;
12602
12603 version = call >> 16; /* hack for backward compatibility */
12604 call &= 0xffff;
12605 @@ -806,15 +820,23 @@
12606 switch (call) {
12607 case SEMOP:
12608 /* struct sembuf is the same on 32 and 64bit :)) */
12609 - err = sys_semtimedop (first, (struct sembuf *)AA(ptr), second, NULL);
12610 + err = sys_semtimedop((int)first,
12611 + (struct sembuf *)A(ptr),
12612 + second, NULL);
12613 goto out;
12614 case SEMTIMEDOP:
12615 - err = sys32_semtimedop (first, (struct sembuf *)AA(ptr), second, (const struct timespec32 *) AA(fifth));
12616 + err = sys32_semtimedop((int)first,
12617 + (struct sembuf *)A(ptr),
12618 + second,
12619 + (const struct timespec32 *)
12620 + A(third));
12621 case SEMGET:
12622 - err = sys_semget (first, second, third);
12623 + err = sys_semget((key_t)first, (int)second,
12624 + (int)third);
12625 goto out;
12626 case SEMCTL:
12627 - err = do_sys32_semctl (first, second, third, (void *)AA(ptr));
12628 + err = do_sys32_semctl((int)first, (int)second,
12629 + (int)third, (void *) A(ptr));
12630 goto out;
12631 default:
12632 err = -ENOSYS;
12633 @@ -823,17 +845,20 @@
12634 if (call <= MSGCTL)
12635 switch (call) {
12636 case MSGSND:
12637 - err = do_sys32_msgsnd (first, second, third, (void *)AA(ptr));
12638 + err = do_sys32_msgsnd((int)first, (int)second,
12639 + (int)third, (void *)A(ptr));
12640 goto out;
12641 case MSGRCV:
12642 - err = do_sys32_msgrcv (first, second, fifth, third,
12643 - version, (void *)AA(ptr));
12644 + err = do_sys32_msgrcv((int)first, (int)second,
12645 + (int)fifth, (int)third,
12646 + version, (void *)A(ptr));
12647 goto out;
12648 case MSGGET:
12649 - err = sys_msgget ((key_t) first, second);
12650 + err = sys_msgget((key_t)first, (int)second);
12651 goto out;
12652 case MSGCTL:
12653 - err = do_sys32_msgctl (first, second, (void *)AA(ptr));
12654 + err = do_sys32_msgctl((int)first, (int)second,
12655 + (void *)A(ptr));
12656 goto out;
12657 default:
12658 err = -ENOSYS;
12659 @@ -842,17 +867,18 @@
12660 if (call <= SHMCTL)
12661 switch (call) {
12662 case SHMAT:
12663 - err = do_sys32_shmat (first, second, third,
12664 - version, (void *)AA(ptr));
12665 + err = do_sys32_shmat((int)first, (int)second, third,
12666 + version, (void *)A(ptr));
12667 goto out;
12668 case SHMDT:
12669 - err = sys_shmdt ((char *)AA(ptr));
12670 + err = sys_shmdt((char *)A(ptr));
12671 goto out;
12672 case SHMGET:
12673 - err = sys_shmget (first, second, third);
12674 + err = sys_shmget((key_t)first, second, (int)third);
12675 goto out;
12676 case SHMCTL:
12677 - err = do_sys32_shmctl (first, second, (void *)AA(ptr));
12678 + err = do_sys32_shmctl((int)first, (int)second,
12679 + (void *)A(ptr));
12680 goto out;
12681 default:
12682 err = -ENOSYS;
12683 @@ -1093,7 +1119,6 @@
12684 __kernel_ssize_t32 tot_len;
12685 struct iovec iovstack[UIO_FASTIOV];
12686 struct iovec *iov=iovstack, *ivp;
12687 - struct inode *inode;
12688 long retval, i;
12689 io_fn_t fn;
12690 iov_fn_t fnv;
12691 @@ -1140,11 +1165,9 @@
12692 i--;
12693 }
12694
12695 - inode = file->f_dentry->d_inode;
12696 /* VERIFY_WRITE actually means a read, as we write to user space */
12697 - retval = locks_verify_area((type == VERIFY_WRITE
12698 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
12699 - inode, file, file->f_pos, tot_len);
12700 + retval = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
12701 + file, &file->f_pos, tot_len);
12702 if (retval)
12703 goto out;
12704
12705 @@ -2160,9 +2183,6 @@
12706 timeout = (timespec_to_jiffies(&ts)
12707 + (ts.tv_sec || ts.tv_nsec));
12708
12709 - current->state = TASK_INTERRUPTIBLE;
12710 - timeout = schedule_timeout(timeout);
12711 -
12712 if (timeout) {
12713 /* None ready -- temporarily unblock those we're
12714 * interested while we are sleeping in so that we'll
12715 @@ -2648,7 +2668,8 @@
12716 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
12717 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
12718 */
12719 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
12720 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
12721 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
12722 {
12723 unsigned char *workbuf, *wp;
12724 unsigned long bufsz, space_avail;
12725 @@ -2679,6 +2700,9 @@
12726 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
12727
12728 clen64 = kcmsg32->cmsg_len;
12729 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12730 + (clen64 > (orig_cmsg_len + wp - workbuf)))
12731 + break;
12732 if (kcmsg32->cmsg_level == SOL_SOCKET &&
12733 kcmsg32->cmsg_type == SO_TIMESTAMP) {
12734 struct timeval tv;
12735 @@ -2782,6 +2806,7 @@
12736 struct sockaddr *uaddr;
12737 int *uaddr_len;
12738 unsigned long cmsg_ptr;
12739 + __kernel_size_t cmsg_len;
12740 int err, total_len, len = 0;
12741
12742 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
12743 @@ -2797,6 +2822,7 @@
12744 total_len = err;
12745
12746 cmsg_ptr = (unsigned long) kern_msg.msg_control;
12747 + cmsg_len = kern_msg.msg_controllen;
12748 kern_msg.msg_flags = 0;
12749
12750 sock = sockfd_lookup(fd, &err);
12751 @@ -2822,7 +2848,8 @@
12752 * to fix it up before we tack on more stuff.
12753 */
12754 if((unsigned long) kern_msg.msg_control != cmsg_ptr)
12755 - cmsg32_recvmsg_fixup(&kern_msg, cmsg_ptr);
12756 + cmsg32_recvmsg_fixup(&kern_msg,
12757 + cmsg_ptr, cmsg_len);
12758
12759 /* Wheee... */
12760 if(sock->passcred)
12761 diff -Nur linux-2.4.29/arch/sparc64/kernel/time.c linux-mips/arch/sparc64/kernel/time.c
12762 --- linux-2.4.29/arch/sparc64/kernel/time.c 2004-11-17 12:54:21.000000000 +0100
12763 +++ linux-mips/arch/sparc64/kernel/time.c 2005-03-26 11:47:19.670423374 +0100
12764 @@ -770,6 +770,7 @@
12765 strcmp(model, "mk48t59") &&
12766 strcmp(model, "m5819") &&
12767 strcmp(model, "m5819p") &&
12768 + strcmp(model, "m5823") &&
12769 strcmp(model, "ds1287")) {
12770 if (cbus != NULL) {
12771 prom_printf("clock_probe: Central bus lacks timer chip.\n");
12772 @@ -829,7 +830,8 @@
12773
12774 if (!strcmp(model, "ds1287") ||
12775 !strcmp(model, "m5819") ||
12776 - !strcmp(model, "m5819p")) {
12777 + !strcmp(model, "m5819p") ||
12778 + !strcmp(model, "m5823")) {
12779 ds1287_regs = edev->resource[0].start;
12780 } else {
12781 mstk48t59_regs = edev->resource[0].start;
12782 @@ -850,7 +852,8 @@
12783 }
12784 if (!strcmp(model, "ds1287") ||
12785 !strcmp(model, "m5819") ||
12786 - !strcmp(model, "m5819p")) {
12787 + !strcmp(model, "m5819p") ||
12788 + !strcmp(model, "m5823")) {
12789 ds1287_regs = isadev->resource.start;
12790 } else {
12791 mstk48t59_regs = isadev->resource.start;
12792 diff -Nur linux-2.4.29/arch/sparc64/lib/atomic.S linux-mips/arch/sparc64/lib/atomic.S
12793 --- linux-2.4.29/arch/sparc64/lib/atomic.S 2001-12-21 18:41:53.000000000 +0100
12794 +++ linux-mips/arch/sparc64/lib/atomic.S 2005-03-26 11:47:19.671423210 +0100
12795 @@ -4,33 +4,83 @@
12796 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
12797 */
12798
12799 +#include <linux/config.h>
12800 #include <asm/asi.h>
12801
12802 + /* On SMP we need to use memory barriers to ensure
12803 + * correct memory operation ordering, nop these out
12804 + * for uniprocessor.
12805 + */
12806 +#ifdef CONFIG_SMP
12807 +#define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad
12808 +#define ATOMIC_POST_BARRIER membar #StoreLoad | #StoreStore
12809 +#else
12810 +#define ATOMIC_PRE_BARRIER nop
12811 +#define ATOMIC_POST_BARRIER nop
12812 +#endif
12813 +
12814 .text
12815 - .align 64
12816
12817 .globl atomic_impl_begin, atomic_impl_end
12818 -
12819 - .globl __atomic_add
12820 atomic_impl_begin:
12821 -__atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
12822 - lduw [%o1], %g5
12823 + /* Two versions of the atomic routines, one that
12824 + * does not return a value and does not perform
12825 + * memory barriers, and a second which returns
12826 + * a value and does the barriers.
12827 + */
12828 + .globl atomic_add
12829 + .type atomic_add,#function
12830 +atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
12831 +1: lduw [%o1], %g5
12832 + add %g5, %o0, %g7
12833 + cas [%o1], %g5, %g7
12834 + cmp %g5, %g7
12835 + bne,pn %icc, 1b
12836 + nop
12837 + retl
12838 + nop
12839 + .size atomic_add, .-atomic_add
12840 +
12841 + .globl atomic_sub
12842 + .type atomic_sub,#function
12843 +atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
12844 +1: lduw [%o1], %g5
12845 + sub %g5, %o0, %g7
12846 + cas [%o1], %g5, %g7
12847 + cmp %g5, %g7
12848 + bne,pn %icc, 1b
12849 + nop
12850 + retl
12851 + nop
12852 + .size atomic_sub, .-atomic_sub
12853 +
12854 + .globl atomic_add_ret
12855 + .type atomic_add_ret,#function
12856 +atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
12857 + ATOMIC_PRE_BARRIER
12858 +1: lduw [%o1], %g5
12859 add %g5, %o0, %g7
12860 cas [%o1], %g5, %g7
12861 cmp %g5, %g7
12862 - bne,pn %icc, __atomic_add
12863 - membar #StoreLoad | #StoreStore
12864 + bne,pn %icc, 1b
12865 + add %g7, %o0, %g7
12866 + ATOMIC_POST_BARRIER
12867 retl
12868 - add %g7, %o0, %o0
12869 + sra %g7, 0, %o0
12870 + .size atomic_add_ret, .-atomic_add_ret
12871
12872 - .globl __atomic_sub
12873 -__atomic_sub: /* %o0 = increment, %o1 = atomic_ptr */
12874 - lduw [%o1], %g5
12875 + .globl atomic_sub_ret
12876 + .type atomic_sub_ret,#function
12877 +atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
12878 + ATOMIC_PRE_BARRIER
12879 +1: lduw [%o1], %g5
12880 sub %g5, %o0, %g7
12881 cas [%o1], %g5, %g7
12882 cmp %g5, %g7
12883 - bne,pn %icc, __atomic_sub
12884 - membar #StoreLoad | #StoreStore
12885 + bne,pn %icc, 1b
12886 + sub %g7, %o0, %g7
12887 + ATOMIC_POST_BARRIER
12888 retl
12889 - sub %g7, %o0, %o0
12890 + sra %g7, 0, %o0
12891 + .size atomic_sub_ret, .-atomic_sub_ret
12892 atomic_impl_end:
12893 diff -Nur linux-2.4.29/arch/sparc64/lib/bitops.S linux-mips/arch/sparc64/lib/bitops.S
12894 --- linux-2.4.29/arch/sparc64/lib/bitops.S 2001-12-21 18:41:53.000000000 +0100
12895 +++ linux-mips/arch/sparc64/lib/bitops.S 2005-03-26 11:47:19.683421241 +0100
12896 @@ -4,107 +4,149 @@
12897 * Copyright (C) 2000 David S. Miller (davem@redhat.com)
12898 */
12899
12900 +#include <linux/config.h>
12901 #include <asm/asi.h>
12902
12903 + /* On SMP we need to use memory barriers to ensure
12904 + * correct memory operation ordering, nop these out
12905 + * for uniprocessor.
12906 + */
12907 +#ifdef CONFIG_SMP
12908 +#define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad
12909 +#define BITOP_POST_BARRIER membar #StoreLoad | #StoreStore
12910 +#else
12911 +#define BITOP_PRE_BARRIER nop
12912 +#define BITOP_POST_BARRIER nop
12913 +#endif
12914 +
12915 .text
12916 - .align 64
12917 +
12918 .globl __bitops_begin
12919 __bitops_begin:
12920
12921 - .globl ___test_and_set_bit
12922 -___test_and_set_bit: /* %o0=nr, %o1=addr */
12923 +
12924 + .globl test_and_set_bit
12925 + .type test_and_set_bit,#function
12926 +test_and_set_bit: /* %o0=nr, %o1=addr */
12927 + BITOP_PRE_BARRIER
12928 srlx %o0, 6, %g1
12929 mov 1, %g5
12930 sllx %g1, 3, %g3
12931 and %o0, 63, %g2
12932 sllx %g5, %g2, %g5
12933 add %o1, %g3, %o1
12934 - ldx [%o1], %g7
12935 -1: andcc %g7, %g5, %o0
12936 - bne,pn %xcc, 2f
12937 - xor %g7, %g5, %g1
12938 +1: ldx [%o1], %g7
12939 + or %g7, %g5, %g1
12940 casx [%o1], %g7, %g1
12941 cmp %g7, %g1
12942 - bne,a,pn %xcc, 1b
12943 - ldx [%o1], %g7
12944 -2: retl
12945 - membar #StoreLoad | #StoreStore
12946 -
12947 - .globl ___test_and_clear_bit
12948 -___test_and_clear_bit: /* %o0=nr, %o1=addr */
12949 + bne,pn %xcc, 1b
12950 + and %g7, %g5, %g2
12951 + BITOP_POST_BARRIER
12952 + clr %o0
12953 + retl
12954 + movrne %g2, 1, %o0
12955 + .size test_and_set_bit, .-test_and_set_bit
12956 +
12957 + .globl test_and_clear_bit
12958 + .type test_and_clear_bit,#function
12959 +test_and_clear_bit: /* %o0=nr, %o1=addr */
12960 + BITOP_PRE_BARRIER
12961 srlx %o0, 6, %g1
12962 mov 1, %g5
12963 sllx %g1, 3, %g3
12964 and %o0, 63, %g2
12965 sllx %g5, %g2, %g5
12966 add %o1, %g3, %o1
12967 - ldx [%o1], %g7
12968 -1: andcc %g7, %g5, %o0
12969 - be,pn %xcc, 2f
12970 - xor %g7, %g5, %g1
12971 +1: ldx [%o1], %g7
12972 + andn %g7, %g5, %g1
12973 casx [%o1], %g7, %g1
12974 cmp %g7, %g1
12975 - bne,a,pn %xcc, 1b
12976 - ldx [%o1], %g7
12977 -2: retl
12978 - membar #StoreLoad | #StoreStore
12979 -
12980 - .globl ___test_and_change_bit
12981 -___test_and_change_bit: /* %o0=nr, %o1=addr */
12982 + bne,pn %xcc, 1b
12983 + and %g7, %g5, %g2
12984 + BITOP_POST_BARRIER
12985 + clr %o0
12986 + retl
12987 + movrne %g2, 1, %o0
12988 + .size test_and_clear_bit, .-test_and_clear_bit
12989 +
12990 + .globl test_and_change_bit
12991 + .type test_and_change_bit,#function
12992 +test_and_change_bit: /* %o0=nr, %o1=addr */
12993 + BITOP_PRE_BARRIER
12994 + srlx %o0, 6, %g1
12995 + mov 1, %g5
12996 + sllx %g1, 3, %g3
12997 + and %o0, 63, %g2
12998 + sllx %g5, %g2, %g5
12999 + add %o1, %g3, %o1
13000 +1: ldx [%o1], %g7
13001 + xor %g7, %g5, %g1
13002 + casx [%o1], %g7, %g1
13003 + cmp %g7, %g1
13004 + bne,pn %xcc, 1b
13005 + and %g7, %g5, %g2
13006 + BITOP_POST_BARRIER
13007 + clr %o0
13008 + retl
13009 + movrne %g2, 1, %o0
13010 + .size test_and_change_bit, .-test_and_change_bit
13011 +
13012 + .globl set_bit
13013 + .type set_bit,#function
13014 +set_bit: /* %o0=nr, %o1=addr */
13015 + srlx %o0, 6, %g1
13016 + mov 1, %g5
13017 + sllx %g1, 3, %g3
13018 + and %o0, 63, %g2
13019 + sllx %g5, %g2, %g5
13020 + add %o1, %g3, %o1
13021 +1: ldx [%o1], %g7
13022 + or %g7, %g5, %g1
13023 + casx [%o1], %g7, %g1
13024 + cmp %g7, %g1
13025 + bne,pn %xcc, 1b
13026 + nop
13027 + retl
13028 + nop
13029 + .size set_bit, .-set_bit
13030 +
13031 + .globl clear_bit
13032 + .type clear_bit,#function
13033 +clear_bit: /* %o0=nr, %o1=addr */
13034 + srlx %o0, 6, %g1
13035 + mov 1, %g5
13036 + sllx %g1, 3, %g3
13037 + and %o0, 63, %g2
13038 + sllx %g5, %g2, %g5
13039 + add %o1, %g3, %o1
13040 +1: ldx [%o1], %g7
13041 + andn %g7, %g5, %g1
13042 + casx [%o1], %g7, %g1
13043 + cmp %g7, %g1
13044 + bne,pn %xcc, 1b
13045 + nop
13046 + retl
13047 + nop
13048 + .size clear_bit, .-clear_bit
13049 +
13050 + .globl change_bit
13051 + .type change_bit,#function
13052 +change_bit: /* %o0=nr, %o1=addr */
13053 srlx %o0, 6, %g1
13054 mov 1, %g5
13055 sllx %g1, 3, %g3
13056 and %o0, 63, %g2
13057 sllx %g5, %g2, %g5
13058 add %o1, %g3, %o1
13059 - ldx [%o1], %g7
13060 -1: and %g7, %g5, %o0
13061 +1: ldx [%o1], %g7
13062 xor %g7, %g5, %g1
13063 casx [%o1], %g7, %g1
13064 cmp %g7, %g1
13065 - bne,a,pn %xcc, 1b
13066 - ldx [%o1], %g7
13067 -2: retl
13068 - membar #StoreLoad | #StoreStore
13069 - nop
13070 -
13071 - .globl ___test_and_set_le_bit
13072 -___test_and_set_le_bit: /* %o0=nr, %o1=addr */
13073 - srlx %o0, 5, %g1
13074 - mov 1, %g5
13075 - sllx %g1, 2, %g3
13076 - and %o0, 31, %g2
13077 - sllx %g5, %g2, %g5
13078 - add %o1, %g3, %o1
13079 - lduwa [%o1] ASI_PL, %g7
13080 -1: andcc %g7, %g5, %o0
13081 - bne,pn %icc, 2f
13082 - xor %g7, %g5, %g1
13083 - casa [%o1] ASI_PL, %g7, %g1
13084 - cmp %g7, %g1
13085 - bne,a,pn %icc, 1b
13086 - lduwa [%o1] ASI_PL, %g7
13087 -2: retl
13088 - membar #StoreLoad | #StoreStore
13089 -
13090 - .globl ___test_and_clear_le_bit
13091 -___test_and_clear_le_bit: /* %o0=nr, %o1=addr */
13092 - srlx %o0, 5, %g1
13093 - mov 1, %g5
13094 - sllx %g1, 2, %g3
13095 - and %o0, 31, %g2
13096 - sllx %g5, %g2, %g5
13097 - add %o1, %g3, %o1
13098 - lduwa [%o1] ASI_PL, %g7
13099 -1: andcc %g7, %g5, %o0
13100 - be,pn %icc, 2f
13101 - xor %g7, %g5, %g1
13102 - casa [%o1] ASI_PL, %g7, %g1
13103 - cmp %g7, %g1
13104 - bne,a,pn %icc, 1b
13105 - lduwa [%o1] ASI_PL, %g7
13106 -2: retl
13107 - membar #StoreLoad | #StoreStore
13108 + bne,pn %xcc, 1b
13109 + nop
13110 + retl
13111 + nop
13112 + .size change_bit, .-change_bit
13113
13114 .globl __bitops_end
13115 __bitops_end:
13116 diff -Nur linux-2.4.29/arch/sparc64/lib/debuglocks.c linux-mips/arch/sparc64/lib/debuglocks.c
13117 --- linux-2.4.29/arch/sparc64/lib/debuglocks.c 2001-12-21 18:41:53.000000000 +0100
13118 +++ linux-mips/arch/sparc64/lib/debuglocks.c 2005-03-26 11:47:19.684421077 +0100
13119 @@ -162,6 +162,7 @@
13120 runlock_again:
13121 /* Spin trying to decrement the counter using casx. */
13122 __asm__ __volatile__(
13123 +" membar #StoreLoad | #LoadLoad\n"
13124 " ldx [%0], %%g5\n"
13125 " sub %%g5, 1, %%g7\n"
13126 " casx [%0], %%g5, %%g7\n"
13127 @@ -276,6 +277,7 @@
13128 current->thread.smp_lock_count--;
13129 wlock_again:
13130 __asm__ __volatile__(
13131 +" membar #StoreLoad | #LoadLoad\n"
13132 " mov 1, %%g3\n"
13133 " sllx %%g3, 63, %%g3\n"
13134 " ldx [%0], %%g5\n"
13135 diff -Nur linux-2.4.29/arch/sparc64/lib/rwlock.S linux-mips/arch/sparc64/lib/rwlock.S
13136 --- linux-2.4.29/arch/sparc64/lib/rwlock.S 2000-09-09 02:55:17.000000000 +0200
13137 +++ linux-mips/arch/sparc64/lib/rwlock.S 2005-03-26 11:47:19.689420256 +0100
13138 @@ -24,12 +24,13 @@
13139 99: retl
13140 nop
13141 __read_unlock: /* %o0 = lock_ptr */
13142 + membar #StoreLoad | #LoadLoad
13143 lduw [%o0], %g5
13144 sub %g5, 1, %g7
13145 cas [%o0], %g5, %g7
13146 cmp %g5, %g7
13147 be,pt %xcc, 99b
13148 - membar #StoreLoad | #StoreStore
13149 + nop
13150 ba,a,pt %xcc, __read_unlock
13151
13152 __read_wait_for_writer:
13153 diff -Nur linux-2.4.29/arch/x86_64/ia32/socket32.c linux-mips/arch/x86_64/ia32/socket32.c
13154 --- linux-2.4.29/arch/x86_64/ia32/socket32.c 2005-01-19 15:09:39.000000000 +0100
13155 +++ linux-mips/arch/x86_64/ia32/socket32.c 2005-03-26 11:47:19.905384811 +0100
13156 @@ -302,7 +302,8 @@
13157 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
13158 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
13159 */
13160 -static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_uptr)
13161 +static void cmsg32_recvmsg_fixup(struct msghdr *kmsg,
13162 + unsigned long orig_cmsg_uptr, __kernel_size_t orig_cmsg_len)
13163 {
13164 unsigned char *workbuf, *wp;
13165 unsigned long bufsz, space_avail;
13166 @@ -333,6 +334,9 @@
13167 __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type);
13168
13169 clen64 = kcmsg32->cmsg_len;
13170 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
13171 + (clen64 > (orig_cmsg_len + wp - workbuf)))
13172 + break;
13173 copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg),
13174 clen64 - CMSG_ALIGN(sizeof(*ucmsg)));
13175 clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) +
13176 @@ -418,6 +422,7 @@
13177 struct sockaddr *uaddr;
13178 int *uaddr_len;
13179 unsigned long cmsg_ptr;
13180 + __kernel_size_t cmsg_len;
13181 int err, total_len, len = 0;
13182
13183 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
13184 @@ -433,6 +438,7 @@
13185 total_len = err;
13186
13187 cmsg_ptr = (unsigned long) kern_msg.msg_control;
13188 + cmsg_len = kern_msg.msg_controllen;
13189 kern_msg.msg_flags = 0;
13190
13191 sock = sockfd_lookup(fd, &err);
13192 @@ -458,7 +464,8 @@
13193 * to fix it up before we tack on more stuff.
13194 */
13195 if((unsigned long) kern_msg.msg_control != cmsg_ptr)
13196 - cmsg32_recvmsg_fixup(&kern_msg, cmsg_ptr);
13197 + cmsg32_recvmsg_fixup(&kern_msg,
13198 + cmsg_ptr, cmsg_len);
13199
13200 /* Wheee... */
13201 if(sock->passcred)
13202 diff -Nur linux-2.4.29/arch/x86_64/kernel/acpi.c linux-mips/arch/x86_64/kernel/acpi.c
13203 --- linux-2.4.29/arch/x86_64/kernel/acpi.c 2004-08-08 01:26:04.000000000 +0200
13204 +++ linux-mips/arch/x86_64/kernel/acpi.c 2005-03-26 11:47:19.976373161 +0100
13205 @@ -53,6 +53,7 @@
13206
13207 acpi_interrupt_flags acpi_sci_flags __initdata;
13208 int acpi_sci_override_gsi __initdata;
13209 +int acpi_skip_timer_override __initdata;
13210 /* --------------------------------------------------------------------------
13211 Boot-time Configuration
13212 -------------------------------------------------------------------------- */
13213 @@ -333,6 +334,12 @@
13214 return 0;
13215 }
13216
13217 + if (acpi_skip_timer_override &&
13218 + intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
13219 + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
13220 + return 0;
13221 + }
13222 +
13223 mp_override_legacy_irq (
13224 intsrc->bus_irq,
13225 intsrc->flags.polarity,
13226 diff -Nur linux-2.4.29/arch/x86_64/kernel/io_apic.c linux-mips/arch/x86_64/kernel/io_apic.c
13227 --- linux-2.4.29/arch/x86_64/kernel/io_apic.c 2004-08-08 01:26:04.000000000 +0200
13228 +++ linux-mips/arch/x86_64/kernel/io_apic.c 2005-03-26 11:47:19.977372996 +0100
13229 @@ -259,10 +259,14 @@
13230 case PCI_VENDOR_ID_VIA:
13231 return;
13232 case PCI_VENDOR_ID_NVIDIA:
13233 +#ifdef CONFIG_ACPI
13234 + /* All timer overrides on Nvidia
13235 + seem to be wrong. Skip them. */
13236 + acpi_skip_timer_override = 1;
13237 printk(KERN_INFO
13238 - "PCI bridge %02x:%02x from %x found. Setting \"noapic\". Overwrite with \"apic\"\n",
13239 - num,slot,vendor);
13240 - skip_ioapic_setup = 1;
13241 + "Nvidia board detected. Ignoring ACPI timer override.\n");
13242 +#endif
13243 + /* RED-PEN skip them on mptables too? */
13244 return;
13245 }
13246
13247 diff -Nur linux-2.4.29/arch/x86_64/kernel/pci-irq.c linux-mips/arch/x86_64/kernel/pci-irq.c
13248 --- linux-2.4.29/arch/x86_64/kernel/pci-irq.c 2003-08-25 13:44:40.000000000 +0200
13249 +++ linux-mips/arch/x86_64/kernel/pci-irq.c 2005-03-26 11:47:20.061359212 +0100
13250 @@ -742,7 +742,7 @@
13251 void pcibios_enable_irq(struct pci_dev *dev)
13252 {
13253 u8 pin;
13254 - extern int interrupt_line_quirk;
13255 + extern int via_interrupt_line_quirk;
13256
13257 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
13258 if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
13259 @@ -762,6 +762,6 @@
13260 }
13261 /* VIA bridges use interrupt line for apic/pci steering across
13262 the V-Link */
13263 - else if (interrupt_line_quirk)
13264 + else if (via_interrupt_line_quirk)
13265 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
13266 }
13267 diff -Nur linux-2.4.29/arch/x86_64/kernel/setup.c linux-mips/arch/x86_64/kernel/setup.c
13268 --- linux-2.4.29/arch/x86_64/kernel/setup.c 2005-01-19 15:09:39.000000000 +0100
13269 +++ linux-mips/arch/x86_64/kernel/setup.c 2005-03-26 11:47:20.069357900 +0100
13270 @@ -93,7 +93,8 @@
13271 struct resource standard_io_resources[] = {
13272 { "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
13273 { "pic1", 0x20, 0x3f, IORESOURCE_BUSY },
13274 - { "timer", 0x40, 0x5f, IORESOURCE_BUSY },
13275 + { "timer0", 0x40, 0x43, IORESOURCE_BUSY },
13276 + { "timer1", 0x50, 0x53, IORESOURCE_BUSY },
13277 { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY },
13278 { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
13279 { "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },
13280 diff -Nur linux-2.4.29/Documentation/Changes linux-mips/Documentation/Changes
13281 --- linux-2.4.29/Documentation/Changes 2005-01-19 15:09:22.000000000 +0100
13282 +++ linux-mips/Documentation/Changes 2005-03-26 11:47:05.688718095 +0100
13283 @@ -341,7 +341,7 @@
13284
13285 JFSutils
13286 ---------
13287 -o <http://oss.software.ibm.com/jfs/>
13288 +o <http://jfs.sourceforge.net/>
13289
13290 Reiserfsprogs
13291 -------------
13292 diff -Nur linux-2.4.29/Documentation/Configure.help linux-mips/Documentation/Configure.help
13293 --- linux-2.4.29/Documentation/Configure.help 2005-01-19 15:09:22.000000000 +0100
13294 +++ linux-mips/Documentation/Configure.help 2005-03-26 11:47:12.272637522 +0100
13295 @@ -9345,6 +9345,11 @@
13296
13297 If unsure, say N.
13298
13299 +CONFIG_SCSI_SATA_QSTOR
13300 + This option enables support for Pacific Digital Serial ATA QStor.
13301 +
13302 + If unsure, say N.
13303 +
13304 CONFIG_SCSI_SATA_SX4
13305 This option enables support for Promise Serial ATA SX4.
13306
13307 diff -Nur linux-2.4.29/Documentation/filesystems/jfs.txt linux-mips/Documentation/filesystems/jfs.txt
13308 --- linux-2.4.29/Documentation/filesystems/jfs.txt 2003-11-28 19:26:19.000000000 +0100
13309 +++ linux-mips/Documentation/filesystems/jfs.txt 2005-03-26 11:47:12.320629645 +0100
13310 @@ -1,13 +1,6 @@
13311 IBM's Journaled File System (JFS) for Linux
13312
13313 -JFS Homepage: http://oss.software.ibm.com/jfs/
13314 -
13315 -Team members
13316 -------------
13317 -Dave Kleikamp shaggy@austin.ibm.com
13318 -Dave Blaschke blaschke@us.ibm.com
13319 -Steve Best sbest@us.ibm.com
13320 -Barry Arndt barndt@us.ibm.com
13321 +JFS Homepage: http://jfs.sourceforge.net/
13322
13323 The following mount options are supported:
13324
13325 @@ -15,7 +8,8 @@
13326 ASCII. The default is compiled into the kernel as
13327 CONFIG_NLS_DEFAULT. Use iocharset=utf8 for UTF8
13328 translations. This requires CONFIG_NLS_UTF8 to be set
13329 - in the kernel .config file.
13330 + in the kernel .config file. Specify iocharset=none for
13331 + no conversion (default linux-2.6 behavior).
13332
13333 resize=value Resize the volume to <value> blocks. JFS only supports
13334 growing a volume, not shrinking it. This option is only
13335 @@ -51,4 +45,4 @@
13336 Please send bugs, comments, cards and letters to shaggy@austin.ibm.com.
13337
13338 The JFS mailing list can be subscribed to by using the link labeled
13339 -"Mail list Subscribe" at our web page http://oss.software.ibm.com/jfs/.
13340 +"Mail list Subscribe" at our web page http://jfs.sourceforge.net/.
13341 diff -Nur linux-2.4.29/Documentation/i2c/writing-clients linux-mips/Documentation/i2c/writing-clients
13342 --- linux-2.4.29/Documentation/i2c/writing-clients 2004-11-17 12:54:20.000000000 +0100
13343 +++ linux-mips/Documentation/i2c/writing-clients 2005-03-26 11:47:12.338626691 +0100
13344 @@ -380,9 +380,6 @@
13345
13346 For now, you can ignore the `flags' parameter. It is there for future use.
13347
13348 - /* Unique ID allocation */
13349 - static int foo_id = 0;
13350 -
13351 int foo_detect_client(struct i2c_adapter *adapter, int address,
13352 unsigned short flags, int kind)
13353 {
13354 @@ -518,7 +515,6 @@
13355 data->type = kind;
13356 /* SENSORS ONLY END */
13357
13358 - new_client->id = foo_id++; /* Automatically unique */
13359 data->valid = 0; /* Only if you use this field */
13360 init_MUTEX(&data->update_lock); /* Only if you use this field */
13361
13362 diff -Nur linux-2.4.29/drivers/acpi/pci_irq.c linux-mips/drivers/acpi/pci_irq.c
13363 --- linux-2.4.29/drivers/acpi/pci_irq.c 2004-08-08 01:26:04.000000000 +0200
13364 +++ linux-mips/drivers/acpi/pci_irq.c 2005-03-26 11:47:20.083355602 +0100
13365 @@ -335,6 +335,7 @@
13366 {
13367 int irq = 0;
13368 u8 pin = 0;
13369 + extern int via_interrupt_line_quirk;
13370
13371 ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
13372
13373 @@ -383,6 +384,9 @@
13374 }
13375 }
13376
13377 + if (via_interrupt_line_quirk)
13378 + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15);
13379 +
13380 dev->irq = irq;
13381
13382 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", dev->slot_name, dev->irq));
13383 diff -Nur linux-2.4.29/drivers/block/nbd.c linux-mips/drivers/block/nbd.c
13384 --- linux-2.4.29/drivers/block/nbd.c 2003-08-25 13:44:41.000000000 +0200
13385 +++ linux-mips/drivers/block/nbd.c 2005-03-26 11:47:20.373308014 +0100
13386 @@ -408,10 +408,7 @@
13387 int dev, error, temp;
13388 struct request sreq ;
13389
13390 - /* Anyone capable of this syscall can do *real bad* things */
13391
13392 - if (!capable(CAP_SYS_ADMIN))
13393 - return -EPERM;
13394 if (!inode)
13395 return -EINVAL;
13396 dev = MINOR(inode->i_rdev);
13397 @@ -419,6 +416,20 @@
13398 return -ENODEV;
13399
13400 lo = &nbd_dev[dev];
13401 +
13402 + /* these are innocent, but.... */
13403 + switch (cmd) {
13404 + case BLKGETSIZE:
13405 + return put_user(nbd_bytesizes[dev] >> 9, (unsigned long *) arg);
13406 + case BLKGETSIZE64:
13407 + return put_user((u64)nbd_bytesizes[dev], (u64 *) arg);
13408 + }
13409 +
13410 + /* ... anyone capable of any of the below ioctls can do *real bad*
13411 + things */
13412 + if (!capable(CAP_SYS_ADMIN))
13413 + return -EPERM;
13414 +
13415 switch (cmd) {
13416 case NBD_DISCONNECT:
13417 printk("NBD_DISCONNECT\n");
13418 @@ -524,10 +535,6 @@
13419 dev, lo->queue_head.next, lo->queue_head.prev, requests_in, requests_out);
13420 return 0;
13421 #endif
13422 - case BLKGETSIZE:
13423 - return put_user(nbd_bytesizes[dev] >> 9, (unsigned long *) arg);
13424 - case BLKGETSIZE64:
13425 - return put_user((u64)nbd_bytesizes[dev], (u64 *) arg);
13426 }
13427 return -EINVAL;
13428 }
13429 diff -Nur linux-2.4.29/drivers/char/au1000_gpio.c linux-mips/drivers/char/au1000_gpio.c
13430 --- linux-2.4.29/drivers/char/au1000_gpio.c 2003-08-25 13:44:41.000000000 +0200
13431 +++ linux-mips/drivers/char/au1000_gpio.c 2003-12-20 14:18:51.000000000 +0100
13432 @@ -246,7 +246,7 @@
13433
13434 static struct miscdevice au1000gpio_miscdev =
13435 {
13436 - GPIO_MINOR,
13437 + MISC_DYNAMIC_MINOR,
13438 "au1000_gpio",
13439 &au1000gpio_fops
13440 };
13441 diff -Nur linux-2.4.29/drivers/char/au1550_psc_spi.c linux-mips/drivers/char/au1550_psc_spi.c
13442 --- linux-2.4.29/drivers/char/au1550_psc_spi.c 1970-01-01 01:00:00.000000000 +0100
13443 +++ linux-mips/drivers/char/au1550_psc_spi.c 2005-03-26 11:47:20.510285533 +0100
13444 @@ -0,0 +1,466 @@
13445 +/*
13446 + * Driver for Alchemy Au1550 SPI on the PSC.
13447 + *
13448 + * Copyright 2004 Embedded Edge, LLC.
13449 + * dan@embeddededge.com
13450 + *
13451 + * This program is free software; you can redistribute it and/or modify it
13452 + * under the terms of the GNU General Public License as published by the
13453 + * Free Software Foundation; either version 2 of the License, or (at your
13454 + * option) any later version.
13455 + *
13456 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13457 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13458 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13459 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
13460 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
13461 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13462 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
13463 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13464 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
13465 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13466 + *
13467 + * You should have received a copy of the GNU General Public License along
13468 + * with this program; if not, write to the Free Software Foundation, Inc.,
13469 + * 675 Mass Ave, Cambridge, MA 02139, USA.
13470 + */
13471 +
13472 +#include <linux/module.h>
13473 +#include <linux/config.h>
13474 +#include <linux/types.h>
13475 +#include <linux/kernel.h>
13476 +#include <linux/miscdevice.h>
13477 +#include <linux/init.h>
13478 +#include <asm/uaccess.h>
13479 +#include <asm/io.h>
13480 +#include <asm/au1000.h>
13481 +#include <asm/au1550_spi.h>
13482 +#include <asm/au1xxx_psc.h>
13483 +
13484 +#ifdef CONFIG_MIPS_PB1550
13485 +#include <asm/pb1550.h>
13486 +#endif
13487 +
13488 +#ifdef CONFIG_MIPS_DB1550
13489 +#include <asm/db1x00.h>
13490 +#endif
13491 +
13492 +#ifdef CONFIG_MIPS_PB1200
13493 +#include <asm/pb1200.h>
13494 +#endif
13495 +
13496 +/* This is just a simple programmed I/O SPI interface on the PSC of the 1550.
13497 + * We support open, close, write, and ioctl. The SPI is a full duplex
13498 + * interface, you can't read without writing. So, the write system call
13499 + * copies the bytes out to the SPI, and whatever is returned is placed
13500 + * in the same buffer. Kinda weird, maybe we'll change it, but for now
13501 + * it works OK.
13502 + * I didn't implement any DMA yet, and it's a debate about the necessity.
13503 + * The SPI clocks are usually quite fast, so data is sent/received as
13504 + * quickly as you can stuff the FIFO. The overhead of DMA and interrupts
13505 + * are usually far greater than the data transfer itself. If, however,
13506 + * we find applications that move large amounts of data, we may choose
13507 + * use the overhead of buffering and DMA to do the work.
13508 + */
13509 +
13510 +/* The maximum clock rate specified in the manual is 2mHz.
13511 +*/
13512 +#define MAX_BAUD_RATE (2 * 1000000)
13513 +#define PSC_INTCLK_RATE (32 * 1000000)
13514 +
13515 +static int inuse;
13516 +
13517 +/* We have to know what the user requested for the data length
13518 + * so we know how to stuff the fifo. The FIFO is 32 bits wide,
13519 + * and we have to load it with the bits to go in a single transfer.
13520 + */
13521 +static uint spi_datalen;
13522 +
13523 +static int
13524 +au1550spi_master_done( int ms )
13525 +{
13526 + int timeout=ms;
13527 + volatile psc_spi_t *sp;
13528 +
13529 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13530 +
13531 + /* Loop until MD is set or timeout has expired */
13532 + while(!(sp->psc_spievent & PSC_SPIEVNT_MD) && timeout--) udelay(1000);
13533 +
13534 + if ( !timeout )
13535 + return 0;
13536 + else
13537 + sp->psc_spievent |= PSC_SPIEVNT_MD;
13538 +
13539 + return 1;
13540 +}
13541 +
13542 +static int
13543 +au1550spi_open(struct inode *inode, struct file *file)
13544 +{
13545 + if (inuse)
13546 + return -EBUSY;
13547 +
13548 + inuse = 1;
13549 +
13550 + MOD_INC_USE_COUNT;
13551 +
13552 + return 0;
13553 +}
13554 +
13555 +static ssize_t
13556 +au1550spi_write(struct file *fp, const char *bp, size_t count, loff_t *ppos)
13557 +{
13558 + int bytelen, i;
13559 + size_t rcount, retval;
13560 + unsigned char sb, *rp, *wp;
13561 + uint fifoword, pcr, stat;
13562 + volatile psc_spi_t *sp;
13563 +
13564 + /* Get the number of bytes per transfer.
13565 + */
13566 + bytelen = ((spi_datalen - 1) / 8) + 1;
13567 +
13568 + /* User needs to send us multiple of this count.
13569 + */
13570 + if ((count % bytelen) != 0)
13571 + return -EINVAL;
13572 +
13573 + rp = wp = (unsigned char *)bp;
13574 + retval = rcount = count;
13575 +
13576 + /* Reset the FIFO.
13577 + */
13578 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13579 + sp->psc_spipcr = (PSC_SPIPCR_RC | PSC_SPIPCR_TC);
13580 + au_sync();
13581 + do {
13582 + pcr = sp->psc_spipcr;
13583 + au_sync();
13584 + } while (pcr != 0);
13585 +
13586 + /* Prime the transmit FIFO.
13587 + */
13588 + while (count > 0) {
13589 + fifoword = 0;
13590 + for (i=0; i<bytelen; i++) {
13591 + fifoword <<= 8;
13592 + if (get_user(sb, wp) < 0)
13593 + return -EFAULT;
13594 + fifoword |= sb;
13595 + wp++;
13596 + }
13597 + count -= bytelen;
13598 + if (count <= 0)
13599 + fifoword |= PSC_SPITXRX_LC;
13600 + sp->psc_spitxrx = fifoword;
13601 + au_sync();
13602 + stat = sp->psc_spistat;
13603 + au_sync();
13604 + if (stat & PSC_SPISTAT_TF)
13605 + break;
13606 + }
13607 +
13608 + /* Start the transfer.
13609 + */
13610 + sp->psc_spipcr = PSC_SPIPCR_MS;
13611 + au_sync();
13612 +
13613 + /* Now, just keep the transmit fifo full and empty the receive.
13614 + */
13615 + while (count > 0) {
13616 + stat = sp->psc_spistat;
13617 + au_sync();
13618 + while ((stat & PSC_SPISTAT_RE) == 0) {
13619 + fifoword = sp->psc_spitxrx;
13620 + au_sync();
13621 + for (i=0; i<bytelen; i++) {
13622 + sb = fifoword & 0xff;
13623 + if (put_user(sb, rp) < 0)
13624 + return -EFAULT;
13625 + fifoword >>= 8;
13626 + rp++;
13627 + }
13628 + rcount -= bytelen;
13629 + stat = sp->psc_spistat;
13630 + au_sync();
13631 + }
13632 + if ((stat & PSC_SPISTAT_TF) == 0) {
13633 + fifoword = 0;
13634 + for (i=0; i<bytelen; i++) {
13635 + fifoword <<= 8;
13636 + if (get_user(sb, wp) < 0)
13637 + return -EFAULT;
13638 + fifoword |= sb;
13639 + wp++;
13640 + }
13641 + count -= bytelen;
13642 + if (count <= 0)
13643 + fifoword |= PSC_SPITXRX_LC;
13644 + sp->psc_spitxrx = fifoword;
13645 + au_sync();
13646 + }
13647 + }
13648 +
13649 + /* All of the bytes for transmit have been written. Hang
13650 + * out waiting for any residual bytes that are yet to be
13651 + * read from the fifo.
13652 + */
13653 + while (rcount > 0) {
13654 + stat = sp->psc_spistat;
13655 + au_sync();
13656 + if ((stat & PSC_SPISTAT_RE) == 0) {
13657 + fifoword = sp->psc_spitxrx;
13658 + au_sync();
13659 + for (i=0; i<bytelen; i++) {
13660 + sb = fifoword & 0xff;
13661 + if (put_user(sb, rp) < 0)
13662 + return -EFAULT;
13663 + fifoword >>= 8;
13664 + rp++;
13665 + }
13666 + rcount -= bytelen;
13667 + }
13668 + }
13669 +
13670 + /* Wait for MasterDone event. 30ms timeout */
13671 + if (!au1550spi_master_done(30) ) retval = -EFAULT;
13672 + return retval;
13673 +}
13674 +
13675 +static int
13676 +au1550spi_release(struct inode *inode, struct file *file)
13677 +{
13678 + MOD_DEC_USE_COUNT;
13679 +
13680 + inuse = 0;
13681 +
13682 + return 0;
13683 +}
13684 +
13685 +/* Set the baud rate closest to the request, then return the actual
13686 + * value we are using.
13687 + */
13688 +static uint
13689 +set_baud_rate(uint baud)
13690 +{
13691 + uint rate, tmpclk, brg, ctl, stat;
13692 + volatile psc_spi_t *sp;
13693 +
13694 + /* For starters, the input clock is divided by two.
13695 + */
13696 + tmpclk = PSC_INTCLK_RATE/2;
13697 +
13698 + rate = tmpclk / baud;
13699 +
13700 + /* The dividers work as follows:
13701 + * baud = tmpclk / (2 * (brg + 1))
13702 + */
13703 + brg = (rate/2) - 1;
13704 +
13705 + /* Test BRG to ensure it will fit into the 6 bits allocated.
13706 + */
13707 +
13708 + /* Make sure the device is disabled while we make the change.
13709 + */
13710 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13711 + ctl = sp->psc_spicfg;
13712 + au_sync();
13713 + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
13714 + au_sync();
13715 + ctl = PSC_SPICFG_CLR_BAUD(ctl);
13716 + ctl |= PSC_SPICFG_SET_BAUD(brg);
13717 + sp->psc_spicfg = ctl;
13718 + au_sync();
13719 +
13720 + /* If the device was running prior to getting here, wait for
13721 + * it to restart.
13722 + */
13723 + if (ctl & PSC_SPICFG_DE_ENABLE) {
13724 + do {
13725 + stat = sp->psc_spistat;
13726 + au_sync();
13727 + } while ((stat & PSC_SPISTAT_DR) == 0);
13728 + }
13729 +
13730 + /* Return the actual value.
13731 + */
13732 + rate = tmpclk / (2 * (brg + 1));
13733 +
13734 + return(rate);
13735 +}
13736 +
13737 +static uint
13738 +set_word_len(uint len)
13739 +{
13740 + uint ctl, stat;
13741 + volatile psc_spi_t *sp;
13742 +
13743 + if ((len < 4) || (len > 24))
13744 + return -EINVAL;
13745 +
13746 + /* Make sure the device is disabled while we make the change.
13747 + */
13748 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13749 + ctl = sp->psc_spicfg;
13750 + au_sync();
13751 + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
13752 + au_sync();
13753 + ctl = PSC_SPICFG_CLR_LEN(ctl);
13754 + ctl |= PSC_SPICFG_SET_LEN(len);
13755 + sp->psc_spicfg = ctl;
13756 + au_sync();
13757 +
13758 + /* If the device was running prior to getting here, wait for
13759 + * it to restart.
13760 + */
13761 + if (ctl & PSC_SPICFG_DE_ENABLE) {
13762 + do {
13763 + stat = sp->psc_spistat;
13764 + au_sync();
13765 + } while ((stat & PSC_SPISTAT_DR) == 0);
13766 + }
13767 +
13768 + return 0;
13769 +}
13770 +
13771 +static int
13772 +au1550spi_ioctl(struct inode *inode, struct file *file,
13773 + unsigned int cmd, unsigned long arg)
13774 +{
13775 + int status;
13776 + u32 val;
13777 +
13778 + status = 0;
13779 +
13780 + switch(cmd) {
13781 + case AU1550SPI_WORD_LEN:
13782 + status = set_word_len(arg);
13783 + break;
13784 +
13785 + case AU1550SPI_SET_BAUD:
13786 + if (get_user(val, (u32 *)arg))
13787 + return -EFAULT;
13788 +
13789 + val = set_baud_rate(val);
13790 + if (put_user(val, (u32 *)arg))
13791 + return -EFAULT;
13792 + break;
13793 +
13794 + default:
13795 + status = -ENOIOCTLCMD;
13796 +
13797 + }
13798 +
13799 + return status;
13800 +}
13801 +
13802 +
13803 +static struct file_operations au1550spi_fops =
13804 +{
13805 + owner: THIS_MODULE,
13806 + write: au1550spi_write,
13807 + ioctl: au1550spi_ioctl,
13808 + open: au1550spi_open,
13809 + release: au1550spi_release,
13810 +};
13811 +
13812 +
13813 +static struct miscdevice au1550spi_miscdev =
13814 +{
13815 + MISC_DYNAMIC_MINOR,
13816 + "au1550_spi",
13817 + &au1550spi_fops
13818 +};
13819 +
13820 +
13821 +int __init
13822 +au1550spi_init(void)
13823 +{
13824 + uint clk, rate, stat;
13825 + volatile psc_spi_t *sp;
13826 +
13827 + /* Wire up Freq3 as a clock for the SPI. The PSC does
13828 + * factor of 2 divisor, so run a higher rate so we can
13829 + * get some granularity to the clock speeds.
13830 + * We can't do this in board set up because the frequency
13831 + * is computed too late.
13832 + */
13833 + rate = get_au1x00_speed();
13834 + rate /= PSC_INTCLK_RATE;
13835 +
13836 + /* The FRDIV in the frequency control is (FRDIV + 1) * 2
13837 + */
13838 + rate /=2;
13839 + rate--;
13840 + clk = au_readl(SYS_FREQCTRL1);
13841 + au_sync();
13842 + clk &= ~SYS_FC_FRDIV3_MASK;
13843 + clk |= (rate << SYS_FC_FRDIV3_BIT);
13844 + clk |= SYS_FC_FE3;
13845 + au_writel(clk, SYS_FREQCTRL1);
13846 + au_sync();
13847 +
13848 + /* Set up the clock source routing to get Freq3 to PSC0_intclk.
13849 + */
13850 + clk = au_readl(SYS_CLKSRC);
13851 + au_sync();
13852 + clk &= ~0x03e0;
13853 + clk |= (5 << 7);
13854 + au_writel(clk, SYS_CLKSRC);
13855 + au_sync();
13856 +
13857 + /* Set up GPIO pin function to drive PSC0_SYNC1, which is
13858 + * the SPI Select.
13859 + */
13860 + clk = au_readl(SYS_PINFUNC);
13861 + au_sync();
13862 + clk |= 1;
13863 + au_writel(clk, SYS_PINFUNC);
13864 + au_sync();
13865 +
13866 + /* Now, set up the PSC for SPI PIO mode.
13867 + */
13868 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13869 + sp->psc_ctrl = PSC_CTRL_DISABLE;
13870 + au_sync();
13871 + sp->psc_sel = PSC_SEL_PS_SPIMODE;
13872 + sp->psc_spicfg = 0;
13873 + au_sync();
13874 + sp->psc_ctrl = PSC_CTRL_ENABLE;
13875 + au_sync();
13876 + do {
13877 + stat = sp->psc_spistat;
13878 + au_sync();
13879 + } while ((stat & PSC_SPISTAT_SR) == 0);
13880 +
13881 + sp->psc_spicfg = (PSC_SPICFG_RT_FIFO8 | PSC_SPICFG_TT_FIFO8 |
13882 + PSC_SPICFG_DD_DISABLE | PSC_SPICFG_MO);
13883 + sp->psc_spicfg |= PSC_SPICFG_SET_LEN(8);
13884 + spi_datalen = 8;
13885 + sp->psc_spimsk = PSC_SPIMSK_ALLMASK;
13886 + au_sync();
13887 +
13888 + set_baud_rate(1000000);
13889 +
13890 + sp->psc_spicfg |= PSC_SPICFG_DE_ENABLE;
13891 + do {
13892 + stat = sp->psc_spistat;
13893 + au_sync();
13894 + } while ((stat & PSC_SPISTAT_DR) == 0);
13895 +
13896 + misc_register(&au1550spi_miscdev);
13897 + printk("Au1550 SPI driver\n");
13898 + return 0;
13899 +}
13900 +
13901 +
13902 +void __exit
13903 +au1550spi_exit(void)
13904 +{
13905 + misc_deregister(&au1550spi_miscdev);
13906 +}
13907 +
13908 +
13909 +module_init(au1550spi_init);
13910 +module_exit(au1550spi_exit);
13911 diff -Nur linux-2.4.29/drivers/char/Config.in linux-mips/drivers/char/Config.in
13912 --- linux-2.4.29/drivers/char/Config.in 2004-08-08 01:26:04.000000000 +0200
13913 +++ linux-mips/drivers/char/Config.in 2005-03-26 11:47:20.469292261 +0100
13914 @@ -313,14 +313,11 @@
13915 if [ "$CONFIG_OBSOLETE" = "y" -a "$CONFIG_ALPHA_BOOK1" = "y" ]; then
13916 bool 'Tadpole ANA H8 Support (OBSOLETE)' CONFIG_H8
13917 fi
13918 -if [ "$CONFIG_MIPS" = "y" -a "$CONFIG_NEW_TIME_C" = "y" ]; then
13919 - tristate 'Generic MIPS RTC Support' CONFIG_MIPS_RTC
13920 -fi
13921 if [ "$CONFIG_SGI_IP22" = "y" ]; then
13922 - bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
13923 + tristate 'Dallas DS1286 RTC support' CONFIG_DS1286
13924 fi
13925 if [ "$CONFIG_SGI_IP27" = "y" ]; then
13926 - bool 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
13927 + tristate 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
13928 fi
13929 if [ "$CONFIG_TOSHIBA_RBTX4927" = "y" -o "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
13930 tristate 'Dallas DS1742 RTC support' CONFIG_DS1742
13931 @@ -383,6 +380,11 @@
13932 source drivers/char/drm/Config.in
13933 fi
13934 fi
13935 +
13936 +if [ "$CONFIG_X86" = "y" ]; then
13937 + tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
13938 +fi
13939 +
13940 endmenu
13941
13942 if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
13943 @@ -391,6 +393,7 @@
13944 if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
13945 tristate ' Alchemy Au1x00 GPIO device support' CONFIG_AU1X00_GPIO
13946 tristate ' Au1000/ADS7846 touchscreen support' CONFIG_TS_AU1X00_ADS7846
13947 + #tristate ' Alchemy Au1550 PSC SPI support' CONFIG_AU1550_PSC_SPI
13948 fi
13949 if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
13950 tristate ' ITE GPIO' CONFIG_ITE_GPIO
13951 diff -Nur linux-2.4.29/drivers/char/decserial.c linux-mips/drivers/char/decserial.c
13952 --- linux-2.4.29/drivers/char/decserial.c 2003-08-25 13:44:41.000000000 +0200
13953 +++ linux-mips/drivers/char/decserial.c 2004-09-28 02:53:01.000000000 +0200
13954 @@ -3,95 +3,105 @@
13955 * choose the right serial device at boot time
13956 *
13957 * triemer 6-SEP-1998
13958 - * sercons.c is designed to allow the three different kinds
13959 + * sercons.c is designed to allow the three different kinds
13960 * of serial devices under the decstation world to co-exist
13961 - * in the same kernel. The idea here is to abstract
13962 + * in the same kernel. The idea here is to abstract
13963 * the pieces of the drivers that are common to this file
13964 * so that they do not clash at compile time and runtime.
13965 *
13966 * HK 16-SEP-1998 v0.002
13967 * removed the PROM console as this is not a real serial
13968 * device. Added support for PROM console in drivers/char/tty_io.c
13969 - * instead. Although it may work to enable more than one
13970 + * instead. Although it may work to enable more than one
13971 * console device I strongly recommend to use only one.
13972 + *
13973 + * Copyright (C) 2004 Maciej W. Rozycki
13974 */
13975
13976 #include <linux/config.h>
13977 +#include <linux/errno.h>
13978 #include <linux/init.h>
13979 +
13980 #include <asm/dec/machtype.h>
13981 +#include <asm/dec/serial.h>
13982 +
13983 +extern int register_zs_hook(unsigned int channel,
13984 + struct dec_serial_hook *hook);
13985 +extern int unregister_zs_hook(unsigned int channel);
13986 +
13987 +extern int register_dz_hook(unsigned int channel,
13988 + struct dec_serial_hook *hook);
13989 +extern int unregister_dz_hook(unsigned int channel);
13990
13991 +int register_dec_serial_hook(unsigned int channel,
13992 + struct dec_serial_hook *hook)
13993 +{
13994 #ifdef CONFIG_ZS
13995 -extern int zs_init(void);
13996 + if (IOASIC)
13997 + return register_zs_hook(channel, hook);
13998 #endif
13999 -
14000 #ifdef CONFIG_DZ
14001 -extern int dz_init(void);
14002 + if (!IOASIC)
14003 + return register_dz_hook(channel, hook);
14004 #endif
14005 + return 0;
14006 +}
14007
14008 -#ifdef CONFIG_SERIAL_DEC_CONSOLE
14009 -
14010 +int unregister_dec_serial_hook(unsigned int channel)
14011 +{
14012 #ifdef CONFIG_ZS
14013 -extern void zs_serial_console_init(void);
14014 + if (IOASIC)
14015 + return unregister_zs_hook(channel);
14016 #endif
14017 -
14018 #ifdef CONFIG_DZ
14019 -extern void dz_serial_console_init(void);
14020 -#endif
14021 -
14022 + if (!IOASIC)
14023 + return unregister_dz_hook(channel);
14024 #endif
14025 + return 0;
14026 +}
14027
14028 -/* rs_init - starts up the serial interface -
14029 - handle normal case of starting up the serial interface */
14030
14031 -#ifdef CONFIG_SERIAL_DEC
14032 +extern int zs_init(void);
14033 +extern int dz_init(void);
14034
14035 +/*
14036 + * rs_init - starts up the serial interface -
14037 + * handle normal case of starting up the serial interface
14038 + */
14039 int __init rs_init(void)
14040 {
14041 -
14042 -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
14043 - if (IOASIC)
14044 - return zs_init();
14045 - else
14046 - return dz_init();
14047 -#else
14048 -
14049 #ifdef CONFIG_ZS
14050 - return zs_init();
14051 + if (IOASIC)
14052 + return zs_init();
14053 #endif
14054 -
14055 #ifdef CONFIG_DZ
14056 - return dz_init();
14057 -#endif
14058 -
14059 + if (!IOASIC)
14060 + return dz_init();
14061 #endif
14062 + return -ENXIO;
14063 }
14064
14065 __initcall(rs_init);
14066
14067 -#endif
14068
14069 #ifdef CONFIG_SERIAL_DEC_CONSOLE
14070
14071 -/* dec_serial_console_init handles the special case of starting
14072 - * up the console on the serial port
14073 +extern void zs_serial_console_init(void);
14074 +extern void dz_serial_console_init(void);
14075 +
14076 +/*
14077 + * dec_serial_console_init handles the special case of starting
14078 + * up the console on the serial port
14079 */
14080 void __init dec_serial_console_init(void)
14081 {
14082 -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
14083 - if (IOASIC)
14084 - zs_serial_console_init();
14085 - else
14086 - dz_serial_console_init();
14087 -#else
14088 -
14089 #ifdef CONFIG_ZS
14090 - zs_serial_console_init();
14091 + if (IOASIC)
14092 + zs_serial_console_init();
14093 #endif
14094 -
14095 #ifdef CONFIG_DZ
14096 - dz_serial_console_init();
14097 -#endif
14098 -
14099 + if (!IOASIC)
14100 + dz_serial_console_init();
14101 #endif
14102 }
14103
14104 diff -Nur linux-2.4.29/drivers/char/ds1286.c linux-mips/drivers/char/ds1286.c
14105 --- linux-2.4.29/drivers/char/ds1286.c 2004-02-18 14:36:31.000000000 +0100
14106 +++ linux-mips/drivers/char/ds1286.c 2004-01-10 06:21:39.000000000 +0100
14107 @@ -1,6 +1,10 @@
14108 /*
14109 * DS1286 Real Time Clock interface for Linux
14110 *
14111 + * Copyright (C) 2003 TimeSys Corp.
14112 + * S. James Hill (James.Hill@timesys.com)
14113 + * (sjhill@realitydiluted.com)
14114 + *
14115 * Copyright (C) 1998, 1999, 2000 Ralf Baechle
14116 *
14117 * Based on code written by Paul Gortmaker.
14118 @@ -29,6 +33,7 @@
14119 #include <linux/types.h>
14120 #include <linux/errno.h>
14121 #include <linux/miscdevice.h>
14122 +#include <linux/module.h>
14123 #include <linux/slab.h>
14124 #include <linux/ioport.h>
14125 #include <linux/fcntl.h>
14126 @@ -95,6 +100,12 @@
14127 return -EIO;
14128 }
14129
14130 +void rtc_ds1286_wait(void)
14131 +{
14132 + unsigned char sec = CMOS_READ(RTC_SECONDS);
14133 + while (sec == CMOS_READ(RTC_SECONDS));
14134 +}
14135 +
14136 static int ds1286_ioctl(struct inode *inode, struct file *file,
14137 unsigned int cmd, unsigned long arg)
14138 {
14139 @@ -249,23 +260,22 @@
14140 {
14141 spin_lock_irq(&ds1286_lock);
14142
14143 - if (ds1286_status & RTC_IS_OPEN)
14144 - goto out_busy;
14145 + if (ds1286_status & RTC_IS_OPEN) {
14146 + spin_unlock_irq(&ds1286_lock);
14147 + return -EBUSY;
14148 + }
14149
14150 ds1286_status |= RTC_IS_OPEN;
14151
14152 - spin_lock_irq(&ds1286_lock);
14153 + spin_unlock_irq(&ds1286_lock);
14154 return 0;
14155 -
14156 -out_busy:
14157 - spin_lock_irq(&ds1286_lock);
14158 - return -EBUSY;
14159 }
14160
14161 static int ds1286_release(struct inode *inode, struct file *file)
14162 {
14163 + spin_lock_irq(&ds1286_lock);
14164 ds1286_status &= ~RTC_IS_OPEN;
14165 -
14166 + spin_unlock_irq(&ds1286_lock);
14167 return 0;
14168 }
14169
14170 @@ -276,32 +286,6 @@
14171 return 0;
14172 }
14173
14174 -/*
14175 - * The various file operations we support.
14176 - */
14177 -
14178 -static struct file_operations ds1286_fops = {
14179 - .llseek = no_llseek,
14180 - .read = ds1286_read,
14181 - .poll = ds1286_poll,
14182 - .ioctl = ds1286_ioctl,
14183 - .open = ds1286_open,
14184 - .release = ds1286_release,
14185 -};
14186 -
14187 -static struct miscdevice ds1286_dev=
14188 -{
14189 - .minor = RTC_MINOR,
14190 - .name = "rtc",
14191 - .fops = &ds1286_fops,
14192 -};
14193 -
14194 -int __init ds1286_init(void)
14195 -{
14196 - printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
14197 - return misc_register(&ds1286_dev);
14198 -}
14199 -
14200 static char *days[] = {
14201 "***", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
14202 };
14203 @@ -528,3 +512,38 @@
14204 BCD_TO_BIN(alm_tm->tm_hour);
14205 alm_tm->tm_sec = 0;
14206 }
14207 +
14208 +static struct file_operations ds1286_fops = {
14209 + .owner = THIS_MODULE,
14210 + .llseek = no_llseek,
14211 + .read = ds1286_read,
14212 + .poll = ds1286_poll,
14213 + .ioctl = ds1286_ioctl,
14214 + .open = ds1286_open,
14215 + .release = ds1286_release,
14216 +};
14217 +
14218 +static struct miscdevice ds1286_dev =
14219 +{
14220 + .minor = RTC_MINOR,
14221 + .name = "rtc",
14222 + .fops = &ds1286_fops,
14223 +};
14224 +
14225 +static int __init ds1286_init(void)
14226 +{
14227 + printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
14228 + return misc_register(&ds1286_dev);
14229 +}
14230 +
14231 +static void __exit ds1286_exit(void)
14232 +{
14233 + misc_deregister(&ds1286_dev);
14234 +}
14235 +
14236 +module_init(ds1286_init);
14237 +module_exit(ds1286_exit);
14238 +EXPORT_NO_SYMBOLS;
14239 +
14240 +MODULE_AUTHOR("Ralf Baechle");
14241 +MODULE_LICENSE("GPL");
14242 diff -Nur linux-2.4.29/drivers/char/ds1742.c linux-mips/drivers/char/ds1742.c
14243 --- linux-2.4.29/drivers/char/ds1742.c 2004-02-18 14:36:31.000000000 +0100
14244 +++ linux-mips/drivers/char/ds1742.c 2004-01-09 20:27:16.000000000 +0100
14245 @@ -142,6 +142,7 @@
14246 CMOS_WRITE(RTC_WRITE, RTC_CONTROL);
14247
14248 /* convert */
14249 + memset(&tm, 0, sizeof(struct rtc_time));
14250 to_tm(t, &tm);
14251
14252 /* check each field one by one */
14253 @@ -216,6 +217,7 @@
14254 unsigned long curr_time;
14255
14256 curr_time = rtc_ds1742_get_time();
14257 + memset(&tm, 0, sizeof(struct rtc_time));
14258 to_tm(curr_time, &tm);
14259
14260 p = buf;
14261 @@ -251,8 +253,8 @@
14262
14263 void rtc_ds1742_wait(void)
14264 {
14265 - while (CMOS_READ(RTC_SECONDS) & 1);
14266 - while (!(CMOS_READ(RTC_SECONDS) & 1));
14267 + unsigned char sec = CMOS_READ(RTC_SECONDS);
14268 + while (sec == CMOS_READ(RTC_SECONDS));
14269 }
14270
14271 static int ds1742_ioctl(struct inode *inode, struct file *file,
14272 @@ -264,6 +266,7 @@
14273 switch (cmd) {
14274 case RTC_RD_TIME: /* Read the time/date from RTC */
14275 curr_time = rtc_ds1742_get_time();
14276 + memset(&rtc_tm, 0, sizeof(struct rtc_time));
14277 to_tm(curr_time, &rtc_tm);
14278 rtc_tm.tm_year -= 1900;
14279 return copy_to_user((void *) arg, &rtc_tm, sizeof(rtc_tm)) ?
14280 diff -Nur linux-2.4.29/drivers/char/dummy_keyb.c linux-mips/drivers/char/dummy_keyb.c
14281 --- linux-2.4.29/drivers/char/dummy_keyb.c 2003-08-25 13:44:41.000000000 +0200
14282 +++ linux-mips/drivers/char/dummy_keyb.c 2004-01-09 09:53:08.000000000 +0100
14283 @@ -140,3 +140,7 @@
14284 {
14285 printk("Dummy keyboard driver installed.\n");
14286 }
14287 +#ifdef CONFIG_MAGIC_SYSRQ
14288 +unsigned char kbd_sysrq_key;
14289 +unsigned char kbd_sysrq_xlate[128];
14290 +#endif
14291 diff -Nur linux-2.4.29/drivers/char/dz.c linux-mips/drivers/char/dz.c
14292 --- linux-2.4.29/drivers/char/dz.c 2005-01-19 15:09:44.000000000 +0100
14293 +++ linux-mips/drivers/char/dz.c 2004-12-27 05:13:42.000000000 +0100
14294 @@ -1,11 +1,13 @@
14295 /*
14296 - * dz.c: Serial port driver for DECStations equiped
14297 + * dz.c: Serial port driver for DECstations equipped
14298 * with the DZ chipset.
14299 *
14300 * Copyright (C) 1998 Olivier A. D. Lebaillif
14301 *
14302 * Email: olivier.lebaillif@ifrsys.com
14303 *
14304 + * Copyright (C) 2004 Maciej W. Rozycki
14305 + *
14306 * [31-AUG-98] triemer
14307 * Changed IRQ to use Harald's dec internals interrupts.h
14308 * removed base_addr code - moving address assignment to setup.c
14309 @@ -24,6 +26,7 @@
14310 #undef DEBUG_DZ
14311
14312 #include <linux/config.h>
14313 +#include <linux/delay.h>
14314 #include <linux/version.h>
14315 #include <linux/kernel.h>
14316 #include <linux/sched.h>
14317 @@ -54,33 +57,56 @@
14318 #include <asm/system.h>
14319 #include <asm/uaccess.h>
14320
14321 -#define CONSOLE_LINE (3) /* for definition of struct console */
14322 +#ifdef CONFIG_MAGIC_SYSRQ
14323 +#include <linux/sysrq.h>
14324 +#endif
14325
14326 #include "dz.h"
14327
14328 -#define DZ_INTR_DEBUG 1
14329 -
14330 DECLARE_TASK_QUEUE(tq_serial);
14331
14332 -static struct dz_serial *lines[4];
14333 -static unsigned char tmp_buffer[256];
14334 +static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
14335 +static struct tty_driver serial_driver, callout_driver;
14336 +
14337 +static struct tty_struct *serial_table[DZ_NB_PORT];
14338 +static struct termios *serial_termios[DZ_NB_PORT];
14339 +static struct termios *serial_termios_locked[DZ_NB_PORT];
14340 +
14341 +static int serial_refcount;
14342
14343 -#ifdef DEBUG_DZ
14344 /*
14345 - * debugging code to send out chars via prom
14346 + * tmp_buf is used as a temporary buffer by serial_write. We need to
14347 + * lock it in case the copy_from_user blocks while swapping in a page,
14348 + * and some other program tries to do a serial write at the same time.
14349 + * Since the lock will only come under contention when the system is
14350 + * swapping and available memory is low, it makes sense to share one
14351 + * buffer across all the serial ports, since it significantly saves
14352 + * memory if large numbers of serial ports are open.
14353 */
14354 -static void debug_console(const char *s, int count)
14355 -{
14356 - unsigned i;
14357 +static unsigned char *tmp_buf;
14358 +static DECLARE_MUTEX(tmp_buf_sem);
14359
14360 - for (i = 0; i < count; i++) {
14361 - if (*s == 10)
14362 - prom_printf("%c", 13);
14363 - prom_printf("%c", *s++);
14364 - }
14365 -}
14366 +static char *dz_name __initdata = "DECstation DZ serial driver version ";
14367 +static char *dz_version __initdata = "1.03";
14368 +
14369 +static struct dz_serial *lines[DZ_NB_PORT];
14370 +static unsigned char tmp_buffer[256];
14371 +
14372 +#ifdef CONFIG_SERIAL_DEC_CONSOLE
14373 +static struct console dz_sercons;
14374 +#endif
14375 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
14376 + !defined(MODULE)
14377 +static unsigned long break_pressed; /* break, really ... */
14378 #endif
14379
14380 +static void change_speed (struct dz_serial *);
14381 +
14382 +static int baud_table[] = {
14383 + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
14384 + 9600, 0
14385 +};
14386 +
14387 /*
14388 * ------------------------------------------------------------
14389 * dz_in () and dz_out ()
14390 @@ -94,15 +120,16 @@
14391 {
14392 volatile unsigned short *addr =
14393 (volatile unsigned short *) (info->port + offset);
14394 +
14395 return *addr;
14396 }
14397
14398 static inline void dz_out(struct dz_serial *info, unsigned offset,
14399 unsigned short value)
14400 {
14401 -
14402 volatile unsigned short *addr =
14403 (volatile unsigned short *) (info->port + offset);
14404 +
14405 *addr = value;
14406 }
14407
14408 @@ -143,25 +170,24 @@
14409
14410 tmp |= mask; /* set the TX flag */
14411 dz_out(info, DZ_TCR, tmp);
14412 -
14413 }
14414
14415 /*
14416 * ------------------------------------------------------------
14417 - * Here starts the interrupt handling routines. All of the
14418 - * following subroutines are declared as inline and are folded
14419 - * into dz_interrupt. They were separated out for readability's
14420 - * sake.
14421 *
14422 - * Note: rs_interrupt() is a "fast" interrupt, which means that it
14423 + * Here starts the interrupt handling routines. All of the following
14424 + * subroutines are declared as inline and are folded into
14425 + * dz_interrupt(). They were separated out for readability's sake.
14426 + *
14427 + * Note: dz_interrupt() is a "fast" interrupt, which means that it
14428 * runs with interrupts turned off. People who may want to modify
14429 - * rs_interrupt() should try to keep the interrupt handler as fast as
14430 + * dz_interrupt() should try to keep the interrupt handler as fast as
14431 * possible. After you are done making modifications, it is not a bad
14432 * idea to do:
14433 *
14434 * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c
14435 *
14436 - * and look at the resulting assemble code in serial.s.
14437 + * and look at the resulting assemble code in dz.s.
14438 *
14439 * ------------------------------------------------------------
14440 */
14441 @@ -188,101 +214,97 @@
14442 * This routine deals with inputs from any lines.
14443 * ------------------------------------------------------------
14444 */
14445 -static inline void receive_chars(struct dz_serial *info_in)
14446 +static inline void receive_chars(struct dz_serial *info_in,
14447 + struct pt_regs *regs)
14448 {
14449 -
14450 struct dz_serial *info;
14451 - struct tty_struct *tty = 0;
14452 + struct tty_struct *tty;
14453 struct async_icount *icount;
14454 - int ignore = 0;
14455 - unsigned short status, tmp;
14456 - unsigned char ch;
14457 -
14458 - /* this code is going to be a problem...
14459 - the call to tty_flip_buffer is going to need
14460 - to be rethought...
14461 - */
14462 - do {
14463 - status = dz_in(info_in, DZ_RBUF);
14464 - info = lines[LINE(status)];
14465 + int lines_rx[DZ_NB_PORT] = { [0 ... DZ_NB_PORT - 1] = 0 };
14466 + unsigned short status;
14467 + unsigned char ch, flag;
14468 + int i;
14469
14470 - /* punt so we don't get duplicate characters */
14471 - if (!(status & DZ_DVAL))
14472 - goto ignore_char;
14473 -
14474 - ch = UCHAR(status); /* grab the char */
14475 -
14476 -#if 0
14477 - if (info->is_console) {
14478 - if (ch == 0)
14479 - return; /* it's a break ... */
14480 - }
14481 -#endif
14482 + while ((status = dz_in(info_in, DZ_RBUF)) & DZ_DVAL) {
14483 + info = lines[LINE(status)];
14484 + tty = info->tty; /* point to the proper dev */
14485
14486 - tty = info->tty; /* now tty points to the proper dev */
14487 - icount = &info->icount;
14488 + ch = UCHAR(status); /* grab the char */
14489
14490 - if (!tty)
14491 - break;
14492 - if (tty->flip.count >= TTY_FLIPBUF_SIZE)
14493 - break;
14494 + if (!tty && (!info->hook || !info->hook->rx_char))
14495 + continue;
14496
14497 - *tty->flip.char_buf_ptr = ch;
14498 - *tty->flip.flag_buf_ptr = 0;
14499 + icount = &info->icount;
14500 icount->rx++;
14501
14502 - /* keep track of the statistics */
14503 - if (status & (DZ_OERR | DZ_FERR | DZ_PERR)) {
14504 - if (status & DZ_PERR) /* parity error */
14505 - icount->parity++;
14506 - else if (status & DZ_FERR) /* frame error */
14507 - icount->frame++;
14508 - if (status & DZ_OERR) /* overrun error */
14509 - icount->overrun++;
14510 -
14511 - /* check to see if we should ignore the character
14512 - and mask off conditions that should be ignored
14513 + flag = 0;
14514 + if (status & DZ_FERR) { /* frame error */
14515 + /*
14516 + * There is no separate BREAK status bit, so
14517 + * treat framing errors as BREAKs for Magic SysRq
14518 + * and SAK; normally, otherwise.
14519 */
14520 -
14521 - if (status & info->ignore_status_mask) {
14522 - if (++ignore > 100)
14523 - break;
14524 - goto ignore_char;
14525 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
14526 + !defined(MODULE)
14527 + if (info->line == dz_sercons.index) {
14528 + if (!break_pressed)
14529 + break_pressed = jiffies;
14530 + continue;
14531 }
14532 - /* mask off the error conditions we want to ignore */
14533 - tmp = status & info->read_status_mask;
14534 -
14535 - if (tmp & DZ_PERR) {
14536 - *tty->flip.flag_buf_ptr = TTY_PARITY;
14537 -#ifdef DEBUG_DZ
14538 - debug_console("PERR\n", 5);
14539 -#endif
14540 - } else if (tmp & DZ_FERR) {
14541 - *tty->flip.flag_buf_ptr = TTY_FRAME;
14542 -#ifdef DEBUG_DZ
14543 - debug_console("FERR\n", 5);
14544 #endif
14545 + flag = TTY_BREAK;
14546 + if (info->flags & DZ_SAK)
14547 + do_SAK(tty);
14548 + else
14549 + flag = TTY_FRAME;
14550 + } else if (status & DZ_OERR) /* overrun error */
14551 + flag = TTY_OVERRUN;
14552 + else if (status & DZ_PERR) /* parity error */
14553 + flag = TTY_PARITY;
14554 +
14555 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
14556 + !defined(MODULE)
14557 + if (break_pressed && info->line == dz_sercons.index) {
14558 + if (time_before(jiffies, break_pressed + HZ * 5)) {
14559 + handle_sysrq(ch, regs, NULL, NULL);
14560 + break_pressed = 0;
14561 + continue;
14562 }
14563 - if (tmp & DZ_OERR) {
14564 -#ifdef DEBUG_DZ
14565 - debug_console("OERR\n", 5);
14566 + break_pressed = 0;
14567 + }
14568 #endif
14569 - if (tty->flip.count < TTY_FLIPBUF_SIZE) {
14570 - tty->flip.count++;
14571 - tty->flip.flag_buf_ptr++;
14572 - tty->flip.char_buf_ptr++;
14573 - *tty->flip.flag_buf_ptr = TTY_OVERRUN;
14574 - }
14575 - }
14576 +
14577 + if (info->hook && info->hook->rx_char) {
14578 + (*info->hook->rx_char)(ch, flag);
14579 + return;
14580 }
14581 - tty->flip.flag_buf_ptr++;
14582 - tty->flip.char_buf_ptr++;
14583 - tty->flip.count++;
14584 - ignore_char:
14585 - } while (status & DZ_DVAL);
14586
14587 - if (tty)
14588 - tty_flip_buffer_push(tty);
14589 + /* keep track of the statistics */
14590 + switch (flag) {
14591 + case TTY_FRAME:
14592 + icount->frame++;
14593 + break;
14594 + case TTY_PARITY:
14595 + icount->parity++;
14596 + break;
14597 + case TTY_OVERRUN:
14598 + icount->overrun++;
14599 + break;
14600 + case TTY_BREAK:
14601 + icount->brk++;
14602 + break;
14603 + default:
14604 + break;
14605 + }
14606 +
14607 + if ((status & info->ignore_status_mask) == 0) {
14608 + tty_insert_flip_char(tty, ch, flag);
14609 + lines_rx[LINE(status)] = 1;
14610 + }
14611 + }
14612 + for (i = 0; i < DZ_NB_PORT; i++)
14613 + if (lines_rx[i])
14614 + tty_flip_buffer_push(lines[i]->tty);
14615 }
14616
14617 /*
14618 @@ -292,20 +314,34 @@
14619 * This routine deals with outputs to any lines.
14620 * ------------------------------------------------------------
14621 */
14622 -static inline void transmit_chars(struct dz_serial *info)
14623 +static inline void transmit_chars(struct dz_serial *info_in)
14624 {
14625 + struct dz_serial *info;
14626 + unsigned short status;
14627 unsigned char tmp;
14628
14629 + status = dz_in(info_in, DZ_CSR);
14630 + info = lines[LINE(status)];
14631
14632 + if (info->hook || !info->tty) {
14633 + unsigned short mask, tmp;
14634
14635 - if (info->x_char) { /* XON/XOFF chars */
14636 + mask = 1 << info->line;
14637 + tmp = dz_in(info, DZ_TCR); /* read the TX flag */
14638 + tmp &= ~mask; /* clear the TX flag */
14639 + dz_out(info, DZ_TCR, tmp);
14640 + return;
14641 + }
14642 +
14643 + if (info->x_char) { /* XON/XOFF chars */
14644 dz_out(info, DZ_TDR, info->x_char);
14645 info->icount.tx++;
14646 info->x_char = 0;
14647 return;
14648 }
14649 /* if nothing to do or stopped or hardware stopped */
14650 - if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tty->hw_stopped) {
14651 + if (info->xmit_cnt <= 0 ||
14652 + info->tty->stopped || info->tty->hw_stopped) {
14653 dz_stop(info->tty);
14654 return;
14655 }
14656 @@ -359,15 +395,14 @@
14657 */
14658 static void dz_interrupt(int irq, void *dev, struct pt_regs *regs)
14659 {
14660 - struct dz_serial *info;
14661 + struct dz_serial *info = (struct dz_serial *)dev;
14662 unsigned short status;
14663
14664 /* get the reason why we just got an irq */
14665 - status = dz_in((struct dz_serial *) dev, DZ_CSR);
14666 - info = lines[LINE(status)]; /* re-arrange info the proper port */
14667 + status = dz_in(info, DZ_CSR);
14668
14669 if (status & DZ_RDONE)
14670 - receive_chars(info); /* the receive function */
14671 + receive_chars(info, regs);
14672
14673 if (status & DZ_TRDY)
14674 transmit_chars(info);
14675 @@ -514,7 +549,7 @@
14676
14677
14678 info->cflags &= ~DZ_CREAD; /* turn off receive enable flag */
14679 - dz_out(info, DZ_LPR, info->cflags);
14680 + dz_out(info, DZ_LPR, info->cflags | info->line);
14681
14682 if (info->xmit_buf) { /* free Tx buffer */
14683 free_page((unsigned long) info->xmit_buf);
14684 @@ -545,18 +580,21 @@
14685 {
14686 unsigned long flags;
14687 unsigned cflag;
14688 - int baud;
14689 + int baud, i;
14690
14691 - if (!info->tty || !info->tty->termios)
14692 - return;
14693 + if (!info->hook) {
14694 + if (!info->tty || !info->tty->termios)
14695 + return;
14696 + cflag = info->tty->termios->c_cflag;
14697 + } else {
14698 + cflag = info->hook->cflags;
14699 + }
14700
14701 save_flags(flags);
14702 cli();
14703
14704 info->cflags = info->line;
14705
14706 - cflag = info->tty->termios->c_cflag;
14707 -
14708 switch (cflag & CSIZE) {
14709 case CS5:
14710 info->cflags |= DZ_CS5;
14711 @@ -579,7 +617,16 @@
14712 if (cflag & PARODD)
14713 info->cflags |= DZ_PARODD;
14714
14715 - baud = tty_get_baud_rate(info->tty);
14716 + i = cflag & CBAUD;
14717 + if (i & CBAUDEX) {
14718 + i &= ~CBAUDEX;
14719 + if (!info->hook)
14720 + info->tty->termios->c_cflag &= ~CBAUDEX;
14721 + else
14722 + info->hook->cflags &= ~CBAUDEX;
14723 + }
14724 + baud = baud_table[i];
14725 +
14726 switch (baud) {
14727 case 50:
14728 info->cflags |= DZ_B50;
14729 @@ -629,16 +676,16 @@
14730 }
14731
14732 info->cflags |= DZ_RXENAB;
14733 - dz_out(info, DZ_LPR, info->cflags);
14734 + dz_out(info, DZ_LPR, info->cflags | info->line);
14735
14736 /* setup accept flag */
14737 info->read_status_mask = DZ_OERR;
14738 - if (I_INPCK(info->tty))
14739 + if (info->tty && I_INPCK(info->tty))
14740 info->read_status_mask |= (DZ_FERR | DZ_PERR);
14741
14742 /* characters to ignore */
14743 info->ignore_status_mask = 0;
14744 - if (I_IGNPAR(info->tty))
14745 + if (info->tty && I_IGNPAR(info->tty))
14746 info->ignore_status_mask |= (DZ_FERR | DZ_PERR);
14747
14748 restore_flags(flags);
14749 @@ -694,7 +741,7 @@
14750
14751 down(&tmp_buf_sem);
14752 while (1) {
14753 - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14754 + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14755 if (c <= 0)
14756 break;
14757
14758 @@ -707,7 +754,7 @@
14759 save_flags(flags);
14760 cli();
14761
14762 - c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14763 + c = min(c, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14764 memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
14765 info->xmit_head = ((info->xmit_head + c) & (DZ_XMIT_SIZE - 1));
14766 info->xmit_cnt += c;
14767 @@ -727,7 +774,7 @@
14768 save_flags(flags);
14769 cli();
14770
14771 - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14772 + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
14773 if (c <= 0) {
14774 restore_flags(flags);
14775 break;
14776 @@ -845,7 +892,7 @@
14777
14778 /*
14779 * ------------------------------------------------------------
14780 - * rs_ioctl () and friends
14781 + * dz_ioctl () and friends
14782 * ------------------------------------------------------------
14783 */
14784 static int get_serial_info(struct dz_serial *info,
14785 @@ -958,6 +1005,9 @@
14786 struct dz_serial *info = (struct dz_serial *) tty->driver_data;
14787 int retval;
14788
14789 + if (info->hook)
14790 + return -ENODEV;
14791 +
14792 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
14793 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
14794 (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
14795 @@ -1252,19 +1302,14 @@
14796 int retval, line;
14797
14798 line = MINOR(tty->device) - tty->driver.minor_start;
14799 -
14800 - /* The dz lines for the mouse/keyboard must be
14801 - * opened using their respective drivers.
14802 - */
14803 if ((line < 0) || (line >= DZ_NB_PORT))
14804 return -ENODEV;
14805 + info = lines[line];
14806
14807 - if ((line == DZ_KEYBOARD) || (line == DZ_MOUSE))
14808 + if (info->hook)
14809 return -ENODEV;
14810
14811 - info = lines[line];
14812 info->count++;
14813 -
14814 tty->driver_data = info;
14815 info->tty = tty;
14816
14817 @@ -1285,14 +1330,21 @@
14818 else
14819 *tty->termios = info->callout_termios;
14820 change_speed(info);
14821 -
14822 }
14823 +#ifdef CONFIG_SERIAL_DEC_CONSOLE
14824 + if (dz_sercons.cflag && dz_sercons.index == line) {
14825 + tty->termios->c_cflag = dz_sercons.cflag;
14826 + dz_sercons.cflag = 0;
14827 + change_speed(info);
14828 + }
14829 +#endif
14830 +
14831 info->session = current->session;
14832 info->pgrp = current->pgrp;
14833 return 0;
14834 }
14835
14836 -static void show_serial_version(void)
14837 +static void __init show_serial_version(void)
14838 {
14839 printk("%s%s\n", dz_name, dz_version);
14840 }
14841 @@ -1300,7 +1352,6 @@
14842 int __init dz_init(void)
14843 {
14844 int i;
14845 - long flags;
14846 struct dz_serial *info;
14847
14848 /* Setup base handler, and timer table. */
14849 @@ -1311,9 +1362,9 @@
14850 memset(&serial_driver, 0, sizeof(struct tty_driver));
14851 serial_driver.magic = TTY_DRIVER_MAGIC;
14852 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
14853 - serial_driver.name = "ttyS";
14854 -#else
14855 serial_driver.name = "tts/%d";
14856 +#else
14857 + serial_driver.name = "ttyS";
14858 #endif
14859 serial_driver.major = TTY_MAJOR;
14860 serial_driver.minor_start = 64;
14861 @@ -1352,9 +1403,9 @@
14862 */
14863 callout_driver = serial_driver;
14864 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
14865 - callout_driver.name = "cua";
14866 -#else
14867 callout_driver.name = "cua/%d";
14868 +#else
14869 + callout_driver.name = "cua";
14870 #endif
14871 callout_driver.major = TTYAUX_MAJOR;
14872 callout_driver.subtype = SERIAL_TYPE_CALLOUT;
14873 @@ -1363,25 +1414,27 @@
14874 panic("Couldn't register serial driver");
14875 if (tty_register_driver(&callout_driver))
14876 panic("Couldn't register callout driver");
14877 - save_flags(flags);
14878 - cli();
14879
14880 for (i = 0; i < DZ_NB_PORT; i++) {
14881 info = &multi[i];
14882 lines[i] = info;
14883 - info->magic = SERIAL_MAGIC;
14884 -
14885 + info->tty = 0;
14886 + info->x_char = 0;
14887 if (mips_machtype == MACH_DS23100 ||
14888 mips_machtype == MACH_DS5100)
14889 info->port = (unsigned long) KN01_DZ11_BASE;
14890 else
14891 info->port = (unsigned long) KN02_DZ11_BASE;
14892 -
14893 info->line = i;
14894 - info->tty = 0;
14895 +
14896 + if (info->hook && info->hook->init_info) {
14897 + (*info->hook->init_info)(info);
14898 + continue;
14899 + }
14900 +
14901 + info->magic = SERIAL_MAGIC;
14902 info->close_delay = 50;
14903 info->closing_wait = 3000;
14904 - info->x_char = 0;
14905 info->event = 0;
14906 info->count = 0;
14907 info->blocked_open = 0;
14908 @@ -1393,25 +1446,16 @@
14909 info->normal_termios = serial_driver.init_termios;
14910 init_waitqueue_head(&info->open_wait);
14911 init_waitqueue_head(&info->close_wait);
14912 -
14913 - /*
14914 - * If we are pointing to address zero then punt - not correctly
14915 - * set up in setup.c to handle this.
14916 - */
14917 - if (!info->port)
14918 - return 0;
14919 -
14920 - printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
14921 - info->port, dec_interrupt[DEC_IRQ_DZ11]);
14922 -
14923 + printk("ttyS%02d at 0x%08x (irq = %d) is a DC7085 DZ\n",
14924 + info->line, info->port, dec_interrupt[DEC_IRQ_DZ11]);
14925 tty_register_devfs(&serial_driver, 0,
14926 - serial_driver.minor_start + info->line);
14927 + serial_driver.minor_start + info->line);
14928 tty_register_devfs(&callout_driver, 0,
14929 - callout_driver.minor_start + info->line);
14930 + callout_driver.minor_start + info->line);
14931 }
14932
14933 - /* reset the chip */
14934 #ifndef CONFIG_SERIAL_DEC_CONSOLE
14935 + /* reset the chip */
14936 dz_out(info, DZ_CSR, DZ_CLR);
14937 while (dz_in(info, DZ_CSR) & DZ_CLR);
14938 iob();
14939 @@ -1420,43 +1464,104 @@
14940 dz_out(info, DZ_CSR, DZ_MSE);
14941 #endif
14942
14943 - /* order matters here... the trick is that flags
14944 - is updated... in request_irq - to immediatedly obliterate
14945 - it is unwise. */
14946 - restore_flags(flags);
14947 -
14948 -
14949 if (request_irq(dec_interrupt[DEC_IRQ_DZ11], dz_interrupt,
14950 - SA_INTERRUPT, "DZ", lines[0]))
14951 + 0, "DZ", lines[0]))
14952 panic("Unable to register DZ interrupt");
14953
14954 + for (i = 0; i < DZ_NB_PORT; i++)
14955 + if (lines[i]->hook) {
14956 + startup(lines[i]);
14957 + if (lines[i]->hook->init_channel)
14958 + (*lines[i]->hook->init_channel)(lines[i]);
14959 + }
14960 +
14961 return 0;
14962 }
14963
14964 -#ifdef CONFIG_SERIAL_DEC_CONSOLE
14965 -static void dz_console_put_char(unsigned char ch)
14966 +/*
14967 + * polling I/O routines
14968 + */
14969 +static int dz_poll_tx_char(void *handle, unsigned char ch)
14970 {
14971 unsigned long flags;
14972 - int loops = 2500;
14973 - unsigned short tmp = ch;
14974 - /* this code sends stuff out to serial device - spinning its
14975 - wheels and waiting. */
14976 + struct dz_serial *info = handle;
14977 + unsigned short csr, tcr, trdy, mask;
14978 + int loops = 10000;
14979 + int ret;
14980
14981 - /* force the issue - point it at lines[3] */
14982 - dz_console = &multi[CONSOLE_LINE];
14983 + local_irq_save(flags);
14984 + csr = dz_in(info, DZ_CSR);
14985 + dz_out(info, DZ_CSR, csr & ~DZ_TIE);
14986 + tcr = dz_in(info, DZ_TCR);
14987 + tcr |= 1 << info->line;
14988 + mask = tcr;
14989 + dz_out(info, DZ_TCR, mask);
14990 + iob();
14991 + local_irq_restore(flags);
14992
14993 - save_flags(flags);
14994 - cli();
14995 + while (loops--) {
14996 + trdy = dz_in(info, DZ_CSR);
14997 + if (!(trdy & DZ_TRDY))
14998 + continue;
14999 + trdy = (trdy & DZ_TLINE) >> 8;
15000 + if (trdy == info->line)
15001 + break;
15002 + mask &= ~(1 << trdy);
15003 + dz_out(info, DZ_TCR, mask);
15004 + iob();
15005 + udelay(2);
15006 + }
15007
15008 + if (loops) {
15009 + dz_out(info, DZ_TDR, ch);
15010 + ret = 0;
15011 + } else
15012 + ret = -EAGAIN;
15013
15014 - /* spin our wheels */
15015 - while (((dz_in(dz_console, DZ_CSR) & DZ_TRDY) != DZ_TRDY) && loops--);
15016 + dz_out(info, DZ_TCR, tcr);
15017 + dz_out(info, DZ_CSR, csr);
15018
15019 - /* Actually transmit the character. */
15020 - dz_out(dz_console, DZ_TDR, tmp);
15021 + return ret;
15022 +}
15023
15024 - restore_flags(flags);
15025 +static int dz_poll_rx_char(void *handle)
15026 +{
15027 + return -ENODEV;
15028 +}
15029 +
15030 +int register_dz_hook(unsigned int channel, struct dec_serial_hook *hook)
15031 +{
15032 + struct dz_serial *info = multi + channel;
15033 +
15034 + if (info->hook) {
15035 + printk("%s: line %d has already a hook registered\n",
15036 + __FUNCTION__, channel);
15037 +
15038 + return 0;
15039 + } else {
15040 + hook->poll_rx_char = dz_poll_rx_char;
15041 + hook->poll_tx_char = dz_poll_tx_char;
15042 + info->hook = hook;
15043 +
15044 + return 1;
15045 + }
15046 +}
15047 +
15048 +int unregister_dz_hook(unsigned int channel)
15049 +{
15050 + struct dz_serial *info = &multi[channel];
15051 +
15052 + if (info->hook) {
15053 + info->hook = NULL;
15054 + return 1;
15055 + } else {
15056 + printk("%s: trying to unregister hook on line %d,"
15057 + " but none is registered\n", __FUNCTION__, channel);
15058 + return 0;
15059 + }
15060 }
15061 +
15062 +#ifdef CONFIG_SERIAL_DEC_CONSOLE
15063 /*
15064 * -------------------------------------------------------------------
15065 * dz_console_print ()
15066 @@ -1465,17 +1570,19 @@
15067 * The console must be locked when we get here.
15068 * -------------------------------------------------------------------
15069 */
15070 -static void dz_console_print(struct console *cons,
15071 +static void dz_console_print(struct console *co,
15072 const char *str,
15073 unsigned int count)
15074 {
15075 + struct dz_serial *info = multi + co->index;
15076 +
15077 #ifdef DEBUG_DZ
15078 prom_printf((char *) str);
15079 #endif
15080 while (count--) {
15081 if (*str == '\n')
15082 - dz_console_put_char('\r');
15083 - dz_console_put_char(*str++);
15084 + dz_poll_tx_char(info, '\r');
15085 + dz_poll_tx_char(info, *str++);
15086 }
15087 }
15088
15089 @@ -1486,12 +1593,12 @@
15090
15091 static int __init dz_console_setup(struct console *co, char *options)
15092 {
15093 + struct dz_serial *info = multi + co->index;
15094 int baud = 9600;
15095 int bits = 8;
15096 int parity = 'n';
15097 int cflag = CREAD | HUPCL | CLOCAL;
15098 char *s;
15099 - unsigned short mask, tmp;
15100
15101 if (options) {
15102 baud = simple_strtoul(options, NULL, 10);
15103 @@ -1542,44 +1649,31 @@
15104 }
15105 co->cflag = cflag;
15106
15107 - /* TOFIX: force to console line */
15108 - dz_console = &multi[CONSOLE_LINE];
15109 if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
15110 - dz_console->port = KN01_DZ11_BASE;
15111 + info->port = KN01_DZ11_BASE;
15112 else
15113 - dz_console->port = KN02_DZ11_BASE;
15114 - dz_console->line = CONSOLE_LINE;
15115 + info->port = KN02_DZ11_BASE;
15116 + info->line = co->index;
15117
15118 - dz_out(dz_console, DZ_CSR, DZ_CLR);
15119 - while ((tmp = dz_in(dz_console, DZ_CSR)) & DZ_CLR);
15120 + dz_out(info, DZ_CSR, DZ_CLR);
15121 + while (dz_in(info, DZ_CSR) & DZ_CLR);
15122
15123 /* enable scanning */
15124 - dz_out(dz_console, DZ_CSR, DZ_MSE);
15125 + dz_out(info, DZ_CSR, DZ_MSE);
15126
15127 /* Set up flags... */
15128 - dz_console->cflags = 0;
15129 - dz_console->cflags |= DZ_B9600;
15130 - dz_console->cflags |= DZ_CS8;
15131 - dz_console->cflags |= DZ_PARENB;
15132 - dz_out(dz_console, DZ_LPR, dz_console->cflags);
15133 -
15134 - mask = 1 << dz_console->line;
15135 - tmp = dz_in(dz_console, DZ_TCR); /* read the TX flag */
15136 - if (!(tmp & mask)) {
15137 - tmp |= mask; /* set the TX flag */
15138 - dz_out(dz_console, DZ_TCR, tmp);
15139 - }
15140 + dz_out(info, DZ_LPR, cflag | info->line);
15141 +
15142 return 0;
15143 }
15144
15145 -static struct console dz_sercons =
15146 -{
15147 - .name = "ttyS",
15148 - .write = dz_console_print,
15149 - .device = dz_console_device,
15150 - .setup = dz_console_setup,
15151 - .flags = CON_CONSDEV | CON_PRINTBUFFER,
15152 - .index = CONSOLE_LINE,
15153 +static struct console dz_sercons = {
15154 + .name = "ttyS",
15155 + .write = dz_console_print,
15156 + .device = dz_console_device,
15157 + .setup = dz_console_setup,
15158 + .flags = CON_PRINTBUFFER,
15159 + .index = -1,
15160 };
15161
15162 void __init dz_serial_console_init(void)
15163 diff -Nur linux-2.4.29/drivers/char/dz.h linux-mips/drivers/char/dz.h
15164 --- linux-2.4.29/drivers/char/dz.h 2002-08-03 02:39:43.000000000 +0200
15165 +++ linux-mips/drivers/char/dz.h 2004-09-28 02:53:01.000000000 +0200
15166 @@ -10,6 +10,8 @@
15167 #ifndef DZ_SERIAL_H
15168 #define DZ_SERIAL_H
15169
15170 +#include <asm/dec/serial.h>
15171 +
15172 #define SERIAL_MAGIC 0x5301
15173
15174 /*
15175 @@ -17,6 +19,7 @@
15176 */
15177 #define DZ_TRDY 0x8000 /* Transmitter empty */
15178 #define DZ_TIE 0x4000 /* Transmitter Interrupt Enable */
15179 +#define DZ_TLINE 0x0300 /* Transmitter Line Number */
15180 #define DZ_RDONE 0x0080 /* Receiver data ready */
15181 #define DZ_RIE 0x0040 /* Receive Interrupt Enable */
15182 #define DZ_MSE 0x0020 /* Master Scan Enable */
15183 @@ -37,19 +40,30 @@
15184 #define UCHAR(x) (unsigned char)(x & DZ_RBUF_MASK)
15185
15186 /*
15187 - * Definitions for the Transmit Register.
15188 + * Definitions for the Transmit Control Register.
15189 */
15190 #define DZ_LINE_KEYBOARD 0x0001
15191 #define DZ_LINE_MOUSE 0x0002
15192 #define DZ_LINE_MODEM 0x0004
15193 #define DZ_LINE_PRINTER 0x0008
15194
15195 +#define DZ_MODEM_RTS 0x0800 /* RTS for the modem line (2) */
15196 #define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */
15197 +#define DZ_PRINT_RTS 0x0200 /* RTS for the printer line (3) */
15198 +#define DZ_PRINT_DTR 0x0100 /* DTR for the printer line (3) */
15199 +#define DZ_LNENB 0x000f /* Transmitter Line Enable */
15200
15201 /*
15202 * Definitions for the Modem Status Register.
15203 */
15204 +#define DZ_MODEM_RI 0x0800 /* RI for the modem line (2) */
15205 +#define DZ_MODEM_CD 0x0400 /* CD for the modem line (2) */
15206 #define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */
15207 +#define DZ_MODEM_CTS 0x0100 /* CTS for the modem line (2) */
15208 +#define DZ_PRINT_RI 0x0008 /* RI for the printer line (2) */
15209 +#define DZ_PRINT_CD 0x0004 /* CD for the printer line (2) */
15210 +#define DZ_PRINT_DSR 0x0002 /* DSR for the printer line (2) */
15211 +#define DZ_PRINT_CTS 0x0001 /* CTS for the printer line (2) */
15212
15213 /*
15214 * Definitions for the Transmit Data Register.
15215 @@ -115,9 +129,6 @@
15216
15217 #define DZ_EVENT_WRITE_WAKEUP 0
15218
15219 -#ifndef MIN
15220 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
15221 -
15222 #define DZ_INITIALIZED 0x80000000 /* Serial port was initialized */
15223 #define DZ_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
15224 #define DZ_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
15225 @@ -129,6 +140,7 @@
15226 #define DZ_CLOSING_WAIT_INF 0
15227 #define DZ_CLOSING_WAIT_NONE 65535
15228
15229 +#define DZ_SAK 0x0004 /* Secure Attention Key (Orange book) */
15230 #define DZ_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
15231 #define DZ_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
15232 #define DZ_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
15233 @@ -166,79 +178,9 @@
15234 long session; /* Session of opening process */
15235 long pgrp; /* pgrp of opening process */
15236
15237 + struct dec_serial_hook *hook; /* Hook on this channel. */
15238 unsigned char is_console; /* flag indicating a serial console */
15239 unsigned char is_initialized;
15240 };
15241
15242 -static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
15243 -static struct dz_serial *dz_console;
15244 -static struct tty_driver serial_driver, callout_driver;
15245 -
15246 -static struct tty_struct *serial_table[DZ_NB_PORT];
15247 -static struct termios *serial_termios[DZ_NB_PORT];
15248 -static struct termios *serial_termios_locked[DZ_NB_PORT];
15249 -
15250 -static int serial_refcount;
15251 -
15252 -/*
15253 - * tmp_buf is used as a temporary buffer by serial_write. We need to
15254 - * lock it in case the copy_from_user blocks while swapping in a page,
15255 - * and some other program tries to do a serial write at the same time.
15256 - * Since the lock will only come under contention when the system is
15257 - * swapping and available memory is low, it makes sense to share one
15258 - * buffer across all the serial ports, since it significantly saves
15259 - * memory if large numbers of serial ports are open.
15260 - */
15261 -static unsigned char *tmp_buf;
15262 -static DECLARE_MUTEX(tmp_buf_sem);
15263 -
15264 -static char *dz_name = "DECstation DZ serial driver version ";
15265 -static char *dz_version = "1.02";
15266 -
15267 -static inline unsigned short dz_in (struct dz_serial *, unsigned);
15268 -static inline void dz_out (struct dz_serial *, unsigned, unsigned short);
15269 -
15270 -static inline void dz_sched_event (struct dz_serial *, int);
15271 -static inline void receive_chars (struct dz_serial *);
15272 -static inline void transmit_chars (struct dz_serial *);
15273 -static inline void check_modem_status (struct dz_serial *);
15274 -
15275 -static void dz_stop (struct tty_struct *);
15276 -static void dz_start (struct tty_struct *);
15277 -static void dz_interrupt (int, void *, struct pt_regs *);
15278 -static void do_serial_bh (void);
15279 -static void do_softint (void *);
15280 -static void do_serial_hangup (void *);
15281 -static void change_speed (struct dz_serial *);
15282 -static void dz_flush_chars (struct tty_struct *);
15283 -static void dz_console_print (struct console *, const char *, unsigned int);
15284 -static void dz_flush_buffer (struct tty_struct *);
15285 -static void dz_throttle (struct tty_struct *);
15286 -static void dz_unthrottle (struct tty_struct *);
15287 -static void dz_send_xchar (struct tty_struct *, char);
15288 -static void shutdown (struct dz_serial *);
15289 -static void send_break (struct dz_serial *, int);
15290 -static void dz_set_termios (struct tty_struct *, struct termios *);
15291 -static void dz_close (struct tty_struct *, struct file *);
15292 -static void dz_hangup (struct tty_struct *);
15293 -static void show_serial_version (void);
15294 -
15295 -static int dz_write (struct tty_struct *, int, const unsigned char *, int);
15296 -static int dz_write_room (struct tty_struct *);
15297 -static int dz_chars_in_buffer (struct tty_struct *);
15298 -static int startup (struct dz_serial *);
15299 -static int get_serial_info (struct dz_serial *, struct serial_struct *);
15300 -static int set_serial_info (struct dz_serial *, struct serial_struct *);
15301 -static int get_lsr_info (struct dz_serial *, unsigned int *);
15302 -static int dz_ioctl (struct tty_struct *, struct file *, unsigned int, unsigned long);
15303 -static int block_til_ready (struct tty_struct *, struct file *, struct dz_serial *);
15304 -static int dz_open (struct tty_struct *, struct file *);
15305 -
15306 -#ifdef MODULE
15307 -int init_module (void)
15308 -void cleanup_module (void)
15309 -#endif
15310 -
15311 -#endif
15312 -
15313 #endif /* DZ_SERIAL_H */
15314 diff -Nur linux-2.4.29/drivers/char/ibm_workpad_keymap.map linux-mips/drivers/char/ibm_workpad_keymap.map
15315 --- linux-2.4.29/drivers/char/ibm_workpad_keymap.map 1970-01-01 01:00:00.000000000 +0100
15316 +++ linux-mips/drivers/char/ibm_workpad_keymap.map 2003-12-20 15:20:44.000000000 +0100
15317 @@ -0,0 +1,343 @@
15318 +# Keymap for IBM Workpad z50
15319 +# US Mapping
15320 +#
15321 +# by Michael Klar <wyldfier@iname.com>
15322 +#
15323 +# This is a great big mess on account of how the Caps Lock key is handled as
15324 +# LeftShift-RightShift. Right shift key had to be broken out, so don't use
15325 +# use this map file as a basis for other keyboards that don't do the same
15326 +# thing with Caps Lock.
15327 +#
15328 +# This file is subject to the terms and conditions of the GNU General Public
15329 +# License. See the file "COPYING" in the main directory of this archive
15330 +# for more details.
15331 +
15332 +keymaps 0-2,4-5,8,12,32-33,36-37
15333 +strings as usual
15334 +
15335 +keycode 0 = F1 F11 Console_13
15336 + shiftr keycode 0 = F11
15337 + shift shiftr keycode 0 = F11
15338 + control keycode 0 = F1
15339 + alt keycode 0 = Console_1
15340 + control alt keycode 0 = Console_1
15341 +keycode 1 = F3 F13 Console_15
15342 + shiftr keycode 1 = F13
15343 + shift shiftr keycode 1 = F13
15344 + control keycode 1 = F3
15345 + alt keycode 1 = Console_3
15346 + control alt keycode 1 = Console_3
15347 +keycode 2 = F5 F15 Console_17
15348 + shiftr keycode 2 = F15
15349 + shift shiftr keycode 2 = F15
15350 + control keycode 2 = F5
15351 + alt keycode 2 = Console_5
15352 + control alt keycode 2 = Console_5
15353 +keycode 3 = F7 F17 Console_19
15354 + shiftr keycode 3 = F17
15355 + shift shiftr keycode 3 = F17
15356 + control keycode 3 = F7
15357 + alt keycode 3 = Console_7
15358 + control alt keycode 3 = Console_7
15359 +keycode 4 = F9 F19 Console_21
15360 + shiftr keycode 4 = F19
15361 + shift shiftr keycode 4 = F19
15362 + control keycode 4 = F9
15363 + alt keycode 4 = Console_9
15364 + control alt keycode 4 = Console_9
15365 +#keycode 5 is contrast down
15366 +#keycode 6 is contrast up
15367 +keycode 7 = F11 F11 Console_23
15368 + shiftr keycode 7 = F11
15369 + shift shiftr keycode 7 = F11
15370 + control keycode 7 = F11
15371 + alt keycode 7 = Console_11
15372 + control alt keycode 7 = Console_11
15373 +keycode 8 = F2 F12 Console_14
15374 + shiftr keycode 8 = F12
15375 + shift shiftr keycode 8 = F12
15376 + control keycode 8 = F2
15377 + alt keycode 8 = Console_2
15378 + control alt keycode 8 = Console_2
15379 +keycode 9 = F4 F14 Console_16
15380 + shiftr keycode 9 = F14
15381 + shift shiftr keycode 9 = F14
15382 + control keycode 9 = F4
15383 + alt keycode 9 = Console_4
15384 + control alt keycode 9 = Console_4
15385 +keycode 10 = F6 F16 Console_18
15386 + shiftr keycode 10 = F16
15387 + shift shiftr keycode 10 = F16
15388 + control keycode 10 = F6
15389 + alt keycode 10 = Console_6
15390 + control alt keycode 10 = Console_6
15391 +keycode 11 = F8 F18 Console_20
15392 + shiftr keycode 11 = F18
15393 + shift shiftr keycode 11 = F18
15394 + control keycode 11 = F8
15395 + alt keycode 11 = Console_8
15396 + control alt keycode 11 = Console_8
15397 +keycode 12 = F10 F20 Console_22
15398 + shiftr keycode 12 = F20
15399 + shift shiftr keycode 12 = F20
15400 + control keycode 12 = F10
15401 + alt keycode 12 = Console_10
15402 + control alt keycode 12 = Console_10
15403 +#keycode 13 is brightness down
15404 +#keycode 14 is brightness up
15405 +keycode 15 = F12 F12 Console_24
15406 + shiftr keycode 15 = F12
15407 + shift shiftr keycode 15 = F12
15408 + control keycode 15 = F12
15409 + alt keycode 15 = Console_12
15410 + control alt keycode 15 = Console_12
15411 +keycode 16 = apostrophe quotedbl
15412 + shiftr keycode 16 = quotedbl
15413 + shift shiftr keycode 16 = quotedbl
15414 + control keycode 16 = Control_g
15415 + alt keycode 16 = Meta_apostrophe
15416 +keycode 17 = bracketleft braceleft
15417 + shiftr keycode 17 = braceleft
15418 + shift shiftr keycode 17 = braceleft
15419 + control keycode 17 = Escape
15420 + alt keycode 17 = Meta_bracketleft
15421 +keycode 18 = minus underscore backslash
15422 + shiftr keycode 18 = underscore
15423 + shift shiftr keycode 18 = underscore
15424 + control keycode 18 = Control_underscore
15425 + shift control keycode 18 = Control_underscore
15426 + shiftr control keycode 18 = Control_underscore
15427 + shift shiftr control keycode 18 = Control_underscore
15428 + alt keycode 18 = Meta_minus
15429 +keycode 19 = zero parenright braceright
15430 + shiftr keycode 19 = parenright
15431 + shift shiftr keycode 19 = parenright
15432 + alt keycode 19 = Meta_zero
15433 +keycode 20 = p
15434 + shiftr keycode 20 = +P
15435 + shift shiftr keycode 20 = +p
15436 +keycode 21 = semicolon colon
15437 + shiftr keycode 21 = colon
15438 + shift shiftr keycode 21 = colon
15439 + alt keycode 21 = Meta_semicolon
15440 +keycode 22 = Up Scroll_Backward
15441 + shiftr keycode 22 = Scroll_Backward
15442 + shift shiftr keycode 22 = Scroll_Backward
15443 + alt keycode 22 = Prior
15444 +keycode 23 = slash question
15445 + shiftr keycode 23 = question
15446 + shift shiftr keycode 23 = question
15447 + control keycode 23 = Delete
15448 + alt keycode 23 = Meta_slash
15449 +
15450 +keycode 27 = nine parenleft bracketright
15451 + shiftr keycode 27 = parenleft
15452 + shift shiftr keycode 27 = parenleft
15453 + alt keycode 27 = Meta_nine
15454 +keycode 28 = o
15455 + shiftr keycode 28 = +O
15456 + shift shiftr keycode 28 = +o
15457 +keycode 29 = l
15458 + shiftr keycode 29 = +L
15459 + shift shiftr keycode 29 = +l
15460 +keycode 30 = period greater
15461 + shiftr keycode 30 = greater
15462 + shift shiftr keycode 30 = greater
15463 + control keycode 30 = Compose
15464 + alt keycode 30 = Meta_period
15465 +
15466 +keycode 32 = Left Decr_Console
15467 + shiftr keycode 32 = Decr_Console
15468 + shift shiftr keycode 32 = Decr_Console
15469 + alt keycode 32 = Home
15470 +keycode 33 = bracketright braceright asciitilde
15471 + shiftr keycode 33 = braceright
15472 + shift shiftr keycode 33 = braceright
15473 + control keycode 33 = Control_bracketright
15474 + alt keycode 33 = Meta_bracketright
15475 +keycode 34 = equal plus
15476 + shiftr keycode 34 = plus
15477 + shift shiftr keycode 34 = plus
15478 + alt keycode 34 = Meta_equal
15479 +keycode 35 = eight asterisk bracketleft
15480 + shiftr keycode 35 = asterisk
15481 + shift shiftr keycode 35 = asterisk
15482 + control keycode 35 = Delete
15483 + alt keycode 35 = Meta_eight
15484 +keycode 36 = i
15485 + shiftr keycode 36 = +I
15486 + shift shiftr keycode 36 = +i
15487 +keycode 37 = k
15488 + shiftr keycode 37 = +K
15489 + shift shiftr keycode 37 = +k
15490 +keycode 38 = comma less
15491 + shiftr keycode 38 = less
15492 + shift shiftr keycode 38 = less
15493 + alt keycode 38 = Meta_comma
15494 +
15495 +keycode 40 = h
15496 + shiftr keycode 40 = +H
15497 + shift shiftr keycode 40 = +h
15498 +keycode 41 = y
15499 + shiftr keycode 41 = +Y
15500 + shift shiftr keycode 41 = +y
15501 +keycode 42 = six asciicircum
15502 + shiftr keycode 42 = asciicircum
15503 + shift shiftr keycode 42 = asciicircum
15504 + control keycode 42 = Control_asciicircum
15505 + alt keycode 42 = Meta_six
15506 +keycode 43 = seven ampersand braceleft
15507 + shiftr keycode 43 = ampersand
15508 + shift shiftr keycode 43 = ampersand
15509 + control keycode 43 = Control_underscore
15510 + alt keycode 43 = Meta_seven
15511 +keycode 44 = u
15512 + shiftr keycode 44 = +U
15513 + shift shiftr keycode 44 = +u
15514 +keycode 45 = j
15515 + shiftr keycode 45 = +J
15516 + shift shiftr keycode 45 = +j
15517 +keycode 46 = m
15518 + shiftr keycode 46 = +M
15519 + shift shiftr keycode 46 = +m
15520 +keycode 47 = n
15521 + shiftr keycode 47 = +N
15522 + shift shiftr keycode 47 = +n
15523 +
15524 +# This is the "Backspace" key:
15525 +keycode 49 = Delete Delete
15526 + shiftr keycode 49 = Delete
15527 + shift shiftr keycode 49 = Delete
15528 + control keycode 49 = BackSpace
15529 + alt keycode 49 = Meta_Delete
15530 +keycode 50 = Num_Lock
15531 + shift keycode 50 = Bare_Num_Lock
15532 + shiftr keycode 50 = Bare_Num_Lock
15533 + shift shiftr keycode 50 = Bare_Num_Lock
15534 +# This is the "Delete" key:
15535 +keycode 51 = Remove
15536 + control alt keycode 51 = Boot
15537 +
15538 +keycode 53 = backslash bar
15539 + shiftr keycode 53 = bar
15540 + shift shiftr keycode 53 = bar
15541 + control keycode 53 = Control_backslash
15542 + alt keycode 53 = Meta_backslash
15543 +keycode 54 = Return
15544 + alt keycode 54 = Meta_Control_m
15545 +keycode 55 = space space
15546 + shiftr keycode 55 = space
15547 + shift shiftr keycode 55 = space
15548 + control keycode 55 = nul
15549 + alt keycode 55 = Meta_space
15550 +keycode 56 = g
15551 + shiftr keycode 56 = +G
15552 + shift shiftr keycode 56 = +g
15553 +keycode 57 = t
15554 + shiftr keycode 57 = +T
15555 + shift shiftr keycode 57 = +t
15556 +keycode 58 = five percent
15557 + shiftr keycode 58 = percent
15558 + shift shiftr keycode 58 = percent
15559 + control keycode 58 = Control_bracketright
15560 + alt keycode 58 = Meta_five
15561 +keycode 59 = four dollar dollar
15562 + shiftr keycode 59 = dollar
15563 + shift shiftr keycode 59 = dollar
15564 + control keycode 59 = Control_backslash
15565 + alt keycode 59 = Meta_four
15566 +keycode 60 = r
15567 + shiftr keycode 60 = +R
15568 + shift shiftr keycode 60 = +r
15569 +keycode 61 = f
15570 + shiftr keycode 61 = +F
15571 + shift shiftr keycode 61 = +f
15572 + altgr keycode 61 = Hex_F
15573 +keycode 62 = v
15574 + shiftr keycode 62 = +V
15575 + shift shiftr keycode 62 = +v
15576 +keycode 63 = b
15577 + shiftr keycode 63 = +B
15578 + shift shiftr keycode 63 = +b
15579 + altgr keycode 63 = Hex_B
15580 +
15581 +keycode 67 = three numbersign
15582 + shiftr keycode 67 = numbersign
15583 + shift shiftr keycode 67 = numbersign
15584 + control keycode 67 = Escape
15585 + alt keycode 67 = Meta_three
15586 +keycode 68 = e
15587 + shiftr keycode 68 = +E
15588 + shift shiftr keycode 68 = +e
15589 + altgr keycode 68 = Hex_E
15590 +keycode 69 = d
15591 + shiftr keycode 69 = +D
15592 + shift shiftr keycode 69 = +d
15593 + altgr keycode 69 = Hex_D
15594 +keycode 70 = c
15595 + shiftr keycode 70 = +C
15596 + shift shiftr keycode 70 = +c
15597 + altgr keycode 70 = Hex_C
15598 +keycode 71 = Right Incr_Console
15599 + shiftr keycode 71 = Incr_Console
15600 + shift shiftr keycode 71 = Incr_Console
15601 + alt keycode 71 = End
15602 +
15603 +keycode 75 = two at at
15604 + shiftr keycode 75 = at
15605 + shift shiftr keycode 75 = at
15606 + control keycode 75 = nul
15607 + shift control keycode 75 = nul
15608 + shiftr control keycode 75 = nul
15609 + shift shiftr control keycode 75 = nul
15610 + alt keycode 75 = Meta_two
15611 +keycode 76 = w
15612 + shiftr keycode 76 = +W
15613 + shift shiftr keycode 76 = +w
15614 +keycode 77 = s
15615 + shiftr keycode 77 = +S
15616 + shift shiftr keycode 77 = +s
15617 +keycode 78 = x
15618 + shiftr keycode 78 = +X
15619 + shift shiftr keycode 78 = +x
15620 +keycode 79 = Down Scroll_Forward
15621 + shiftr keycode 79 = Scroll_Forward
15622 + shift shiftr keycode 79 = Scroll_Forward
15623 + alt keycode 79 = Next
15624 +keycode 80 = Escape Escape
15625 + shiftr keycode 80 = Escape
15626 + shift shiftr keycode 80 = Escape
15627 + alt keycode 80 = Meta_Escape
15628 +keycode 81 = Tab Tab
15629 + shiftr keycode 81 = Tab
15630 + shift shiftr keycode 81 = Tab
15631 + alt keycode 81 = Meta_Tab
15632 +keycode 82 = grave asciitilde
15633 + shiftr keycode 82 = asciitilde
15634 + shift shiftr keycode 82 = asciitilde
15635 + control keycode 82 = nul
15636 + alt keycode 82 = Meta_grave
15637 +keycode 83 = one exclam
15638 + shiftr keycode 83 = exclam
15639 + shift shiftr keycode 83 = exclam
15640 + alt keycode 83 = Meta_one
15641 +keycode 84 = q
15642 + shiftr keycode 84 = +Q
15643 + shift shiftr keycode 84 = +q
15644 +keycode 85 = a
15645 + shiftr keycode 85 = +A
15646 + shift shiftr keycode 85 = +a
15647 + altgr keycode 85 = Hex_A
15648 +keycode 86 = z
15649 + shiftr keycode 86 = +Z
15650 + shift shiftr keycode 86 = +z
15651 +
15652 +# This is the windows key:
15653 +keycode 88 = Decr_Console
15654 +keycode 89 = Shift
15655 +keycode 90 = Control
15656 +keycode 91 = Control
15657 +keycode 92 = Alt
15658 +keycode 93 = AltGr
15659 +keycode 94 = ShiftR
15660 + shift keycode 94 = Caps_Lock
15661 diff -Nur linux-2.4.29/drivers/char/indydog.c linux-mips/drivers/char/indydog.c
15662 --- linux-2.4.29/drivers/char/indydog.c 2003-08-25 13:44:41.000000000 +0200
15663 +++ linux-mips/drivers/char/indydog.c 2004-06-22 17:32:07.000000000 +0200
15664 @@ -1,5 +1,5 @@
15665 /*
15666 - * IndyDog 0.2 A Hardware Watchdog Device for SGI IP22
15667 + * IndyDog 0.3 A Hardware Watchdog Device for SGI IP22
15668 *
15669 * (c) Copyright 2002 Guido Guenther <agx@sigxcpu.org>, All Rights Reserved.
15670 *
15671 @@ -7,10 +7,10 @@
15672 * modify it under the terms of the GNU General Public License
15673 * as published by the Free Software Foundation; either version
15674 * 2 of the License, or (at your option) any later version.
15675 - *
15676 + *
15677 * based on softdog.c by Alan Cox <alan@redhat.com>
15678 */
15679 -
15680 +
15681 #include <linux/module.h>
15682 #include <linux/config.h>
15683 #include <linux/types.h>
15684 @@ -19,13 +19,12 @@
15685 #include <linux/mm.h>
15686 #include <linux/miscdevice.h>
15687 #include <linux/watchdog.h>
15688 -#include <linux/smp_lock.h>
15689 #include <linux/init.h>
15690 #include <asm/uaccess.h>
15691 #include <asm/sgi/mc.h>
15692
15693 -static unsigned long indydog_alive;
15694 -static int expect_close = 0;
15695 +#define PFX "indydog: "
15696 +static int indydog_alive;
15697
15698 #ifdef CONFIG_WATCHDOG_NOWAYOUT
15699 static int nowayout = 1;
15700 @@ -33,10 +32,30 @@
15701 static int nowayout = 0;
15702 #endif
15703
15704 +#define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */
15705 +
15706 MODULE_PARM(nowayout,"i");
15707 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
15708
15709 -static inline void indydog_ping(void)
15710 +static void indydog_start(void)
15711 +{
15712 + u32 mc_ctrl0 = sgimc->cpuctrl0;
15713 +
15714 + mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
15715 + sgimc->cpuctrl0 = mc_ctrl0;
15716 +}
15717 +
15718 +static void indydog_stop(void)
15719 +{
15720 + u32 mc_ctrl0 = sgimc->cpuctrl0;
15721 +
15722 + mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
15723 + sgimc->cpuctrl0 = mc_ctrl0;
15724 +
15725 + printk(KERN_INFO PFX "Stopped watchdog timer.\n");
15726 +}
15727 +
15728 +static void indydog_ping(void)
15729 {
15730 sgimc->watchdogt = 0;
15731 }
15732 @@ -46,18 +65,14 @@
15733 */
15734 static int indydog_open(struct inode *inode, struct file *file)
15735 {
15736 - u32 mc_ctrl0;
15737 -
15738 - if (test_and_set_bit(0,&indydog_alive))
15739 + if (indydog_alive)
15740 return -EBUSY;
15741
15742 - if (nowayout) {
15743 + if (nowayout)
15744 MOD_INC_USE_COUNT;
15745 - }
15746
15747 /* Activate timer */
15748 - mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
15749 - sgimc->cpuctrl0 = mc_ctrl0;
15750 + indydog_start();
15751 indydog_ping();
15752
15753 indydog_alive = 1;
15754 @@ -69,63 +84,48 @@
15755 static int indydog_release(struct inode *inode, struct file *file)
15756 {
15757 /* Shut off the timer.
15758 - * Lock it in if it's a module and we set nowayout. */
15759 - lock_kernel();
15760 - if (expect_close) {
15761 - u32 mc_ctrl0 = sgimc->cpuctrl0;
15762 + * Lock it in if it's a module and we defined ...NOWAYOUT */
15763 + if (!nowayout) {
15764 + u32 mc_ctrl0 = sgimc->cpuctrl0;
15765 mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
15766 sgimc->cpuctrl0 = mc_ctrl0;
15767 printk(KERN_INFO "Stopped watchdog timer.\n");
15768 - } else
15769 - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n");
15770 - clear_bit(0, &indydog_alive);
15771 - unlock_kernel();
15772 + }
15773 + indydog_alive = 0;
15774
15775 return 0;
15776 }
15777
15778 static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
15779 {
15780 - /* Can't seek (pwrite) on this device */
15781 + /* Can't seek (pwrite) on this device */
15782 if (ppos != &file->f_pos)
15783 return -ESPIPE;
15784
15785 - /*
15786 - * Refresh the timer.
15787 - */
15788 + /* Refresh the timer. */
15789 if (len) {
15790 - if (!nowayout) {
15791 - size_t i;
15792 -
15793 - /* In case it was set long ago */
15794 - expect_close = 0;
15795 -
15796 - for (i = 0; i != len; i++) {
15797 - char c;
15798 - if (get_user(c, data + i))
15799 - return -EFAULT;
15800 - if (c == 'V')
15801 - expect_close = 1;
15802 - }
15803 - }
15804 indydog_ping();
15805 - return 1;
15806 }
15807 - return 0;
15808 + return len;
15809 }
15810
15811 static int indydog_ioctl(struct inode *inode, struct file *file,
15812 unsigned int cmd, unsigned long arg)
15813 {
15814 + int options, retval = -EINVAL;
15815 static struct watchdog_info ident = {
15816 - options: WDIOF_MAGICCLOSE,
15817 - identity: "Hardware Watchdog for SGI IP22",
15818 + .options = WDIOF_KEEPALIVEPING |
15819 + WDIOF_MAGICCLOSE,
15820 + .firmware_version = 0,
15821 + .identity = "Hardware Watchdog for SGI IP22",
15822 };
15823 +
15824 switch (cmd) {
15825 default:
15826 return -ENOIOCTLCMD;
15827 case WDIOC_GETSUPPORT:
15828 - if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
15829 + if (copy_to_user((struct watchdog_info *)arg,
15830 + &ident, sizeof(ident)))
15831 return -EFAULT;
15832 return 0;
15833 case WDIOC_GETSTATUS:
15834 @@ -134,31 +134,53 @@
15835 case WDIOC_KEEPALIVE:
15836 indydog_ping();
15837 return 0;
15838 + case WDIOC_GETTIMEOUT:
15839 + return put_user(WATCHDOG_TIMEOUT,(int *)arg);
15840 + case WDIOC_SETOPTIONS:
15841 + {
15842 + if (get_user(options, (int *)arg))
15843 + return -EFAULT;
15844 +
15845 + if (options & WDIOS_DISABLECARD) {
15846 + indydog_stop();
15847 + retval = 0;
15848 + }
15849 +
15850 + if (options & WDIOS_ENABLECARD) {
15851 + indydog_start();
15852 + retval = 0;
15853 + }
15854 +
15855 + return retval;
15856 + }
15857 }
15858 }
15859
15860 static struct file_operations indydog_fops = {
15861 - owner: THIS_MODULE,
15862 - write: indydog_write,
15863 - ioctl: indydog_ioctl,
15864 - open: indydog_open,
15865 - release: indydog_release,
15866 + .owner = THIS_MODULE,
15867 + .write = indydog_write,
15868 + .ioctl = indydog_ioctl,
15869 + .open = indydog_open,
15870 + .release = indydog_release,
15871 };
15872
15873 static struct miscdevice indydog_miscdev = {
15874 - minor: WATCHDOG_MINOR,
15875 - name: "watchdog",
15876 - fops: &indydog_fops,
15877 + .minor = WATCHDOG_MINOR,
15878 + .name = "watchdog",
15879 + .fops = &indydog_fops,
15880 };
15881
15882 -static const char banner[] __initdata = KERN_INFO "Hardware Watchdog Timer for SGI IP22: 0.2\n";
15883 +static char banner[] __initdata =
15884 + KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
15885
15886 static int __init watchdog_init(void)
15887 {
15888 int ret = misc_register(&indydog_miscdev);
15889 -
15890 - if (ret)
15891 + if (ret) {
15892 + printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
15893 + WATCHDOG_MINOR, ret);
15894 return ret;
15895 + }
15896
15897 printk(banner);
15898
15899 @@ -172,4 +194,7 @@
15900
15901 module_init(watchdog_init);
15902 module_exit(watchdog_exit);
15903 +
15904 +MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>");
15905 +MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22");
15906 MODULE_LICENSE("GPL");
15907 diff -Nur linux-2.4.29/drivers/char/ip27-rtc.c linux-mips/drivers/char/ip27-rtc.c
15908 --- linux-2.4.29/drivers/char/ip27-rtc.c 2004-02-18 14:36:31.000000000 +0100
15909 +++ linux-mips/drivers/char/ip27-rtc.c 2004-04-06 03:35:30.000000000 +0200
15910 @@ -44,6 +44,7 @@
15911 #include <asm/sn/klconfig.h>
15912 #include <asm/sn/sn0/ip27.h>
15913 #include <asm/sn/sn0/hub.h>
15914 +#include <asm/sn/sn_private.h>
15915
15916 static int rtc_ioctl(struct inode *inode, struct file *file,
15917 unsigned int cmd, unsigned long arg);
15918 @@ -209,11 +210,8 @@
15919
15920 static int __init rtc_init(void)
15921 {
15922 - nasid_t nid;
15923 -
15924 - nid = get_nasid();
15925 rtc = (struct m48t35_rtc *)
15926 - (KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0);
15927 + (KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base + IOC3_BYTEBUS_DEV0);
15928
15929 printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
15930 if (misc_register(&rtc_dev)) {
15931 @@ -325,3 +323,7 @@
15932
15933 rtc_tm->tm_mon--;
15934 }
15935 +
15936 +MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
15937 +MODULE_DESCRIPTION("SGI IP27 M48T35 RTC driver");
15938 +MODULE_LICENSE("GPL");
15939 diff -Nur linux-2.4.29/drivers/char/lcd.c linux-mips/drivers/char/lcd.c
15940 --- linux-2.4.29/drivers/char/lcd.c 2005-01-19 15:09:46.000000000 +0100
15941 +++ linux-mips/drivers/char/lcd.c 2005-03-26 11:47:20.582273718 +0100
15942 @@ -386,6 +386,8 @@
15943
15944 int ctr=0;
15945
15946 + if (!capable(CAP_SYS_ADMIN)) return -EPERM;
15947 +
15948 // Chip Erase Sequence
15949 WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
15950 WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
15951 @@ -422,6 +424,8 @@
15952
15953 struct lcd_display display;
15954
15955 + if (!capable(CAP_SYS_ADMIN)) return -EPERM;
15956 +
15957 if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
15958 return -EFAULT;
15959 rom = (unsigned char *) kmalloc((128),GFP_ATOMIC);
15960 @@ -434,8 +438,10 @@
15961 save_flags(flags);
15962 for (i=0; i<FLASH_SIZE; i=i+128) {
15963
15964 - if(copy_from_user(rom, display.RomImage + i, 128))
15965 + if(copy_from_user(rom, display.RomImage + i, 128)) {
15966 + kfree(rom);
15967 return -EFAULT;
15968 + }
15969 burn_addr = kFlashBase + i;
15970 cli();
15971 for ( index = 0; index < ( 128 ) ; index++ )
15972 diff -Nur linux-2.4.29/drivers/char/lp.c linux-mips/drivers/char/lp.c
15973 --- linux-2.4.29/drivers/char/lp.c 2005-01-19 15:09:46.000000000 +0100
15974 +++ linux-mips/drivers/char/lp.c 2005-03-26 11:47:20.584273390 +0100
15975 @@ -314,12 +314,14 @@
15976 if (copy_size > LP_BUFFER_SIZE)
15977 copy_size = LP_BUFFER_SIZE;
15978
15979 - if (copy_from_user (kbuf, buf, copy_size))
15980 - return -EFAULT;
15981 -
15982 if (down_interruptible (&lp_table[minor].port_mutex))
15983 return -EINTR;
15984
15985 + if (copy_from_user (kbuf, buf, copy_size)) {
15986 + retv = -EFAULT;
15987 + goto out_unlock;
15988 + }
15989 +
15990 /* Claim Parport or sleep until it becomes available
15991 */
15992 lp_claim_parport_or_block (&lp_table[minor]);
15993 @@ -398,7 +400,7 @@
15994 lp_table[minor].current_mode = IEEE1284_MODE_COMPAT;
15995 lp_release_parport (&lp_table[minor]);
15996 }
15997 -
15998 +out_unlock:
15999 up (&lp_table[minor].port_mutex);
16000
16001 return retv;
16002 diff -Nur linux-2.4.29/drivers/char/Makefile linux-mips/drivers/char/Makefile
16003 --- linux-2.4.29/drivers/char/Makefile 2004-08-08 01:26:04.000000000 +0200
16004 +++ linux-mips/drivers/char/Makefile 2005-03-26 11:47:20.471291933 +0100
16005 @@ -48,7 +48,12 @@
16006 KEYBD =
16007 endif
16008 ifeq ($(CONFIG_VR41XX_KIU),y)
16009 - KEYMAP =
16010 + ifeq ($(CONFIG_IBM_WORKPAD),y)
16011 + KEYMAP = ibm_workpad_keymap.o
16012 + endif
16013 + ifeq ($(CONFIG_VICTOR_MPC30X),y)
16014 + KEYMAP = victor_mpc30x_keymap.o
16015 + endif
16016 KEYBD = vr41xx_keyb.o
16017 endif
16018 endif
16019 @@ -251,7 +256,6 @@
16020 obj-$(CONFIG_RTC) += rtc.o
16021 obj-$(CONFIG_GEN_RTC) += genrtc.o
16022 obj-$(CONFIG_EFI_RTC) += efirtc.o
16023 -obj-$(CONFIG_SGI_DS1286) += ds1286.o
16024 obj-$(CONFIG_MIPS_RTC) += mips_rtc.o
16025 obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o
16026 ifeq ($(CONFIG_PPC),)
16027 @@ -259,6 +263,7 @@
16028 endif
16029 obj-$(CONFIG_TOSHIBA) += toshiba.o
16030 obj-$(CONFIG_I8K) += i8k.o
16031 +obj-$(CONFIG_DS1286) += ds1286.o
16032 obj-$(CONFIG_DS1620) += ds1620.o
16033 obj-$(CONFIG_DS1742) += ds1742.o
16034 obj-$(CONFIG_INTEL_RNG) += i810_rng.o
16035 @@ -269,6 +274,7 @@
16036
16037 obj-$(CONFIG_ITE_GPIO) += ite_gpio.o
16038 obj-$(CONFIG_AU1X00_GPIO) += au1000_gpio.o
16039 +obj-$(CONFIG_AU1550_PSC_SPI) += au1550_psc_spi.o
16040 obj-$(CONFIG_AU1X00_USB_TTY) += au1000_usbtty.o
16041 obj-$(CONFIG_AU1X00_USB_RAW) += au1000_usbraw.o
16042 obj-$(CONFIG_COBALT_LCD) += lcd.o
16043 @@ -353,3 +359,9 @@
16044
16045 qtronixmap.c: qtronixmap.map
16046 set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
16047 +
16048 +ibm_workpad_keymap.c: ibm_workpad_keymap.map
16049 + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
16050 +
16051 +victor_mpc30x_keymap.c: victor_mpc30x_keymap.map
16052 + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
16053 diff -Nur linux-2.4.29/drivers/char/mips_rtc.c linux-mips/drivers/char/mips_rtc.c
16054 --- linux-2.4.29/drivers/char/mips_rtc.c 2004-01-05 14:53:56.000000000 +0100
16055 +++ linux-mips/drivers/char/mips_rtc.c 2004-06-28 14:54:53.000000000 +0200
16056 @@ -53,14 +53,6 @@
16057 #include <asm/io.h>
16058 #include <asm/uaccess.h>
16059 #include <asm/system.h>
16060 -
16061 -/*
16062 - * Check machine
16063 - */
16064 -#if !defined(CONFIG_MIPS) || !defined(CONFIG_NEW_TIME_C)
16065 -#error "This driver is for MIPS machines with CONFIG_NEW_TIME_C defined"
16066 -#endif
16067 -
16068 #include <asm/time.h>
16069
16070 static unsigned long rtc_status = 0; /* bitmapped status byte. */
16071 diff -Nur linux-2.4.29/drivers/char/sb1250_duart.c linux-mips/drivers/char/sb1250_duart.c
16072 --- linux-2.4.29/drivers/char/sb1250_duart.c 2004-02-18 14:36:31.000000000 +0100
16073 +++ linux-mips/drivers/char/sb1250_duart.c 2004-09-17 01:25:44.000000000 +0200
16074 @@ -328,10 +328,11 @@
16075 if (c <= 0) break;
16076
16077 if (from_user) {
16078 + spin_unlock_irqrestore(&us->outp_lock, flags);
16079 if (copy_from_user(us->outp_buf + us->outp_tail, buf, c)) {
16080 - spin_unlock_irqrestore(&us->outp_lock, flags);
16081 return -EFAULT;
16082 }
16083 + spin_lock_irqsave(&us->outp_lock, flags);
16084 } else {
16085 memcpy(us->outp_buf + us->outp_tail, buf, c);
16086 }
16087 @@ -498,9 +499,31 @@
16088 duart_set_cflag(us->line, tty->termios->c_cflag);
16089 }
16090
16091 +static int get_serial_info(uart_state_t *us, struct serial_struct * retinfo) {
16092 +
16093 + struct serial_struct tmp;
16094 +
16095 + memset(&tmp, 0, sizeof(tmp));
16096 +
16097 + tmp.type=PORT_SB1250;
16098 + tmp.line=us->line;
16099 + tmp.port=A_DUART_CHANREG(tmp.line,0);
16100 + tmp.irq=K_INT_UART_0 + tmp.line;
16101 + tmp.xmit_fifo_size=16; /* fixed by hw */
16102 + tmp.baud_base=5000000;
16103 + tmp.io_type=SERIAL_IO_MEM;
16104 +
16105 + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
16106 + return -EFAULT;
16107 +
16108 + return 0;
16109 +}
16110 +
16111 static int duart_ioctl(struct tty_struct *tty, struct file * file,
16112 unsigned int cmd, unsigned long arg)
16113 {
16114 + uart_state_t *us = (uart_state_t *) tty->driver_data;
16115 +
16116 /* if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
16117 return -ENODEV;*/
16118 switch (cmd) {
16119 @@ -517,7 +540,7 @@
16120 printk("Ignoring TIOCMSET\n");
16121 break;
16122 case TIOCGSERIAL:
16123 - printk("Ignoring TIOCGSERIAL\n");
16124 + return get_serial_info(us,(struct serial_struct *) arg);
16125 break;
16126 case TIOCSSERIAL:
16127 printk("Ignoring TIOCSSERIAL\n");
16128 diff -Nur linux-2.4.29/drivers/char/serial.c linux-mips/drivers/char/serial.c
16129 --- linux-2.4.29/drivers/char/serial.c 2005-01-19 15:09:50.000000000 +0100
16130 +++ linux-mips/drivers/char/serial.c 2004-12-27 05:13:43.000000000 +0100
16131 @@ -62,6 +62,12 @@
16132 * Robert Schwebel <robert@schwebel.de>,
16133 * Juergen Beisert <jbeisert@eurodsn.de>,
16134 * Theodore Ts'o <tytso@mit.edu>
16135 + *
16136 + * 10/00: Added suport for MIPS Atlas board.
16137 + * 11/00: Hooks for serial kernel debug port support added.
16138 + * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard,
16139 + * carstenl@mips.com
16140 + * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
16141 */
16142
16143 static char *serial_version = "5.05c";
16144 @@ -413,6 +419,22 @@
16145 return 0;
16146 }
16147
16148 +#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
16149 +
16150 +#include <asm/mips-boards/atlas.h>
16151 +
16152 +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
16153 +{
16154 + return (*(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) & 0xff);
16155 +}
16156 +
16157 +static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
16158 +{
16159 + *(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) = value;
16160 +}
16161 +
16162 +#else
16163 +
16164 static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
16165 {
16166 switch (info->io_type) {
16167 @@ -447,6 +469,8 @@
16168 outb(value, info->port+offset);
16169 }
16170 }
16171 +#endif
16172 +
16173
16174 /*
16175 * We used to support using pause I/O for certain machines. We
16176 diff -Nur linux-2.4.29/drivers/char/synclinkmp.c linux-mips/drivers/char/synclinkmp.c
16177 --- linux-2.4.29/drivers/char/synclinkmp.c 2005-01-19 15:09:53.000000000 +0100
16178 +++ linux-mips/drivers/char/synclinkmp.c 2005-03-26 11:47:20.653262067 +0100
16179 @@ -1,5 +1,5 @@
16180 /*
16181 - * $Id$
16182 + * $Id$
16183 *
16184 * Device driver for Microgate SyncLink Multiport
16185 * high speed multiprotocol serial adapter.
16186 @@ -504,7 +504,7 @@
16187 MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i");
16188
16189 static char *driver_name = "SyncLink MultiPort driver";
16190 -static char *driver_version = "$Revision$";
16191 +static char *driver_version = "$Revision$";
16192
16193 static int __devinit synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
16194 static void __devexit synclinkmp_remove_one(struct pci_dev *dev);
16195 @@ -4482,7 +4482,7 @@
16196 * 07..05 Reserved, must be 0
16197 * 04..00 RRC<4..0> Rx FIFO trigger active 0x00 = 1 byte
16198 */
16199 - write_reg(info, TRC0, 0x00);
16200 + write_reg(info, RRC, 0x00);
16201
16202 /* TRC0 Transmit Ready Control 0
16203 *
16204 diff -Nur linux-2.4.29/drivers/char/victor_mpc30x_keymap.map linux-mips/drivers/char/victor_mpc30x_keymap.map
16205 --- linux-2.4.29/drivers/char/victor_mpc30x_keymap.map 1970-01-01 01:00:00.000000000 +0100
16206 +++ linux-mips/drivers/char/victor_mpc30x_keymap.map 2004-02-05 18:04:42.000000000 +0100
16207 @@ -0,0 +1,102 @@
16208 +# Victor Interlink MP-C303/304 keyboard keymap
16209 +#
16210 +# Copyright (C) 2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
16211 +#
16212 +# This file is subject to the terms and conditions of the GNU General Public
16213 +# License. See the file "COPYING" in the main directory of this archive
16214 +# for more details.
16215 +keymaps 0-1,4-5,8-9,12
16216 +alt_is_meta
16217 +strings as usual
16218 +compose as usual for "iso-8859-1"
16219 +
16220 +# First line
16221 +keycode 89 = Escape
16222 +keycode 9 = Delete
16223 +
16224 +# 2nd line
16225 +keycode 73 = one exclam
16226 +keycode 18 = two quotedbl
16227 +keycode 92 = three numbersign
16228 + control keycode 92 = Escape
16229 +keycode 53 = four dollar
16230 + control keycode 53 = Control_backslash
16231 +keycode 21 = five percent
16232 + control keycode 21 = Control_bracketright
16233 +keycode 50 = six ampersand
16234 + control keycode 50 = Control_underscore
16235 +keycode 48 = seven apostrophe
16236 +keycode 51 = eight parenleft
16237 +keycode 16 = nine parenright
16238 +keycode 80 = zero asciitilde
16239 + control keycode 80 = nul
16240 +keycode 49 = minus equal
16241 +keycode 30 = asciicircum asciitilde
16242 + control keycode 30 = Control_asciicircum
16243 +keycode 5 = backslash bar
16244 + control keycode 5 = Control_backslash
16245 +keycode 13 = BackSpace
16246 +# 3rd line
16247 +keycode 57 = Tab
16248 +keycode 74 = q
16249 +keycode 26 = w
16250 +keycode 81 = e
16251 +keycode 29 = r
16252 +keycode 37 = t
16253 +keycode 45 = y
16254 +keycode 72 = u
16255 +keycode 24 = i
16256 +keycode 32 = o
16257 +keycode 41 = p
16258 +keycode 1 = at grave
16259 + control keycode 1 = nul
16260 +keycode 54 = bracketleft braceleft
16261 +keycode 63 = Return
16262 + alt keycode 63 = Meta_Control_m
16263 +# 4th line
16264 +keycode 23 = Caps_Lock
16265 +keycode 34 = a
16266 +keycode 66 = s
16267 +keycode 52 = d
16268 +keycode 20 = f
16269 +keycode 84 = g
16270 +keycode 67 = h
16271 +keycode 64 = j
16272 +keycode 17 = k
16273 +keycode 83 = l
16274 +keycode 22 = semicolon plus
16275 +keycode 61 = colon asterisk
16276 + control keycode 61 = Control_g
16277 +keycode 65 = bracketright braceright
16278 + control keycode 65 = Control_bracketright
16279 +# 5th line
16280 +keycode 91 = Shift
16281 +keycode 76 = z
16282 +keycode 68 = x
16283 +keycode 28 = c
16284 +keycode 36 = v
16285 +keycode 44 = b
16286 +keycode 19 = n
16287 +keycode 27 = m
16288 +keycode 35 = comma less
16289 +keycode 3 = period greater
16290 + control keycode 3 = Compose
16291 +keycode 38 = slash question
16292 + control keycode 38 = Delete
16293 + shift control keycode 38 = Delete
16294 +keycode 6 = backslash underscore
16295 + control keycode 6 = Control_backslash
16296 +keycode 55 = Up
16297 + alt keycode 55 = PageUp
16298 +keycode 14 = Shift
16299 +# 6th line
16300 +keycode 56 = Control
16301 +keycode 42 = Alt
16302 +keycode 33 = space
16303 + control keycode 33 = nul
16304 +keycode 7 = Left
16305 + alt keycode 7 = Home
16306 +keycode 31 = Down
16307 + alt keycode 31 = PageDown
16308 +keycode 47 = Right
16309 + alt keycode 47 = End
16310 diff -Nur linux-2.4.29/drivers/char/vr41xx_keyb.c linux-mips/drivers/char/vr41xx_keyb.c
16311 --- linux-2.4.29/drivers/char/vr41xx_keyb.c 2004-02-18 14:36:31.000000000 +0100
16312 +++ linux-mips/drivers/char/vr41xx_keyb.c 2004-02-17 13:08:55.000000000 +0100
16313 @@ -308,7 +308,7 @@
16314 if (found != 0) {
16315 kiu_base = VRC4173_KIU_OFFSET;
16316 mkiuintreg = VRC4173_MKIUINTREG_OFFSET;
16317 - vrc4173_clock_supply(VRC4173_KIU_CLOCK);
16318 + vrc4173_supply_clock(VRC4173_KIU_CLOCK);
16319 }
16320 }
16321 #endif
16322 @@ -325,7 +325,7 @@
16323
16324 if (current_cpu_data.cputype == CPU_VR4111 ||
16325 current_cpu_data.cputype == CPU_VR4121)
16326 - vr41xx_clock_supply(KIU_CLOCK);
16327 + vr41xx_supply_clock(KIU_CLOCK);
16328
16329 kiu_writew(KIURST_KIURST, KIURST);
16330
16331 diff -Nur linux-2.4.29/drivers/i2c/Config.in linux-mips/drivers/i2c/Config.in
16332 --- linux-2.4.29/drivers/i2c/Config.in 2004-04-14 15:05:29.000000000 +0200
16333 +++ linux-mips/drivers/i2c/Config.in 2005-03-26 11:47:20.974209393 +0100
16334 @@ -57,6 +57,10 @@
16335 if [ "$CONFIG_SGI_IP22" = "y" ]; then
16336 dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C
16337 fi
16338 +
16339 + if [ "$CONFIG_SOC_AU1550" = "y" -o "$CONFIG_SOC_AU1200" ]; then
16340 + dep_tristate 'Au1550/Au1200 SMBus interface' CONFIG_I2C_ALGO_AU1550 $CONFIG_I2C
16341 + fi
16342
16343 # This is needed for automatic patch generation: sensors code starts here
16344 # This is needed for automatic patch generation: sensors code ends here
16345 diff -Nur linux-2.4.29/drivers/i2c/i2c-algo-au1550.c linux-mips/drivers/i2c/i2c-algo-au1550.c
16346 --- linux-2.4.29/drivers/i2c/i2c-algo-au1550.c 1970-01-01 01:00:00.000000000 +0100
16347 +++ linux-mips/drivers/i2c/i2c-algo-au1550.c 2005-03-26 11:47:21.004204470 +0100
16348 @@ -0,0 +1,340 @@
16349 +/*
16350 + * i2c-algo-au1550.c: SMBus (i2c) driver algorithms for Alchemy PSC interface
16351 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
16352 + *
16353 + * The documentation describes this as an SMBus controller, but it doesn't
16354 + * understand any of the SMBus protocol in hardware. It's really an I2C
16355 + * controller that could emulate most of the SMBus in software.
16356 + */
16357 +
16358 +#include <linux/kernel.h>
16359 +#include <linux/module.h>
16360 +#include <linux/init.h>
16361 +#include <linux/errno.h>
16362 +#include <linux/delay.h>
16363 +
16364 +#include <asm/au1000.h>
16365 +#include <asm/au1xxx_psc.h>
16366 +
16367 +#include <linux/i2c.h>
16368 +#include <linux/i2c-algo-au1550.h>
16369 +
16370 +static int
16371 +wait_xfer_done(struct i2c_algo_au1550_data *adap)
16372 +{
16373 + u32 stat;
16374 + int i;
16375 + volatile psc_smb_t *sp;
16376 +
16377 + sp = (volatile psc_smb_t *)(adap->psc_base);
16378 +
16379 + /* Wait for Tx FIFO Underflow.
16380 + */
16381 + for (i = 0; i < adap->xfer_timeout; i++) {
16382 + stat = sp->psc_smbevnt;
16383 + au_sync();
16384 + if ((stat & PSC_SMBEVNT_TU) != 0) {
16385 + /* Clear it. */
16386 + sp->psc_smbevnt = PSC_SMBEVNT_TU;
16387 + au_sync();
16388 + return 0;
16389 + }
16390 + udelay(1);
16391 + }
16392 +
16393 + return -ETIMEDOUT;
16394 +}
16395 +
16396 +static int
16397 +wait_ack(struct i2c_algo_au1550_data *adap)
16398 +{
16399 + u32 stat;
16400 + volatile psc_smb_t *sp;
16401 +
16402 + if (wait_xfer_done(adap))
16403 + return -ETIMEDOUT;
16404 +
16405 + sp = (volatile psc_smb_t *)(adap->psc_base);
16406 +
16407 + stat = sp->psc_smbevnt;
16408 + au_sync();
16409 +
16410 + if ((stat & (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | PSC_SMBEVNT_AL)) != 0)
16411 + return -ETIMEDOUT;
16412 +
16413 + return 0;
16414 +}
16415 +
16416 +static int
16417 +wait_master_done(struct i2c_algo_au1550_data *adap)
16418 +{
16419 + u32 stat;
16420 + int i;
16421 + volatile psc_smb_t *sp;
16422 +
16423 + sp = (volatile psc_smb_t *)(adap->psc_base);
16424 +
16425 + /* Wait for Master Done.
16426 + */
16427 + for (i = 0; i < adap->xfer_timeout; i++) {
16428 + stat = sp->psc_smbevnt;
16429 + au_sync();
16430 + if ((stat & PSC_SMBEVNT_MD) != 0)
16431 + return 0;
16432 + udelay(1);
16433 + }
16434 +
16435 + return -ETIMEDOUT;
16436 +}
16437 +
16438 +static int
16439 +do_address(struct i2c_algo_au1550_data *adap, unsigned int addr, int rd)
16440 +{
16441 + volatile psc_smb_t *sp;
16442 + u32 stat;
16443 +
16444 + sp = (volatile psc_smb_t *)(adap->psc_base);
16445 +
16446 + /* Reset the FIFOs, clear events.
16447 + */
16448 + sp->psc_smbpcr = PSC_SMBPCR_DC;
16449 + sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR;
16450 + au_sync();
16451 + do {
16452 + stat = sp->psc_smbpcr;
16453 + au_sync();
16454 + } while ((stat & PSC_SMBPCR_DC) != 0);
16455 +
16456 + /* Write out the i2c chip address and specify operation
16457 + */
16458 + addr <<= 1;
16459 + if (rd)
16460 + addr |= 1;
16461 +
16462 + /* Put byte into fifo, start up master.
16463 + */
16464 + sp->psc_smbtxrx = addr;
16465 + au_sync();
16466 + sp->psc_smbpcr = PSC_SMBPCR_MS;
16467 + au_sync();
16468 + if (wait_ack(adap))
16469 + return -EIO;
16470 + return 0;
16471 +}
16472 +
16473 +static u32
16474 +wait_for_rx_byte(struct i2c_algo_au1550_data *adap, u32 *ret_data)
16475 +{
16476 + int j;
16477 + u32 data, stat;
16478 + volatile psc_smb_t *sp;
16479 +
16480 + if (wait_xfer_done(adap))
16481 + return -EIO;
16482 +
16483 + sp = (volatile psc_smb_t *)(adap->psc_base);
16484 +
16485 + j = adap->xfer_timeout * 100;
16486 + do {
16487 + j--;
16488 + if (j <= 0)
16489 + return -EIO;
16490 +
16491 + stat = sp->psc_smbstat;
16492 + au_sync();
16493 + if ((stat & PSC_SMBSTAT_RE) == 0)
16494 + j = 0;
16495 + else
16496 + udelay(1);
16497 + } while (j > 0);
16498 + data = sp->psc_smbtxrx;
16499 + au_sync();
16500 + *ret_data = data;
16501 +
16502 + return 0;
16503 +}
16504 +
16505 +static int
16506 +i2c_read(struct i2c_algo_au1550_data *adap, unsigned char *buf,
16507 + unsigned int len)
16508 +{
16509 + int i;
16510 + u32 data;
16511 + volatile psc_smb_t *sp;
16512 +
16513 + if (len == 0)
16514 + return 0;
16515 +
16516 + /* A read is performed by stuffing the transmit fifo with
16517 + * zero bytes for timing, waiting for bytes to appear in the
16518 + * receive fifo, then reading the bytes.
16519 + */
16520 +
16521 + sp = (volatile psc_smb_t *)(adap->psc_base);
16522 +
16523 + i = 0;
16524 + while (i < (len-1)) {
16525 + sp->psc_smbtxrx = 0;
16526 + au_sync();
16527 + if (wait_for_rx_byte(adap, &data))
16528 + return -EIO;
16529 +
16530 + buf[i] = data;
16531 + i++;
16532 + }
16533 +
16534 + /* The last byte has to indicate transfer done.
16535 + */
16536 + sp->psc_smbtxrx = PSC_SMBTXRX_STP;
16537 + au_sync();
16538 + if (wait_master_done(adap))
16539 + return -EIO;
16540 +
16541 + data = sp->psc_smbtxrx;
16542 + au_sync();
16543 + buf[i] = data;
16544 + return 0;
16545 +}
16546 +
16547 +static int
16548 +i2c_write(struct i2c_algo_au1550_data *adap, unsigned char *buf,
16549 + unsigned int len)
16550 +{
16551 + int i;
16552 + u32 data;
16553 + volatile psc_smb_t *sp;
16554 +
16555 + if (len == 0)
16556 + return 0;
16557 +
16558 + sp = (volatile psc_smb_t *)(adap->psc_base);
16559 +
16560 + i = 0;
16561 + while (i < (len-1)) {
16562 + data = buf[i];
16563 + sp->psc_smbtxrx = data;
16564 + au_sync();
16565 + if (wait_ack(adap))
16566 + return -EIO;
16567 + i++;
16568 + }
16569 +
16570 + /* The last byte has to indicate transfer done.
16571 + */
16572 + data = buf[i];
16573 + data |= PSC_SMBTXRX_STP;
16574 + sp->psc_smbtxrx = data;
16575 + au_sync();
16576 + if (wait_master_done(adap))
16577 + return -EIO;
16578 + return 0;
16579 +}
16580 +
16581 +static int
16582 +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
16583 +{
16584 + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
16585 + struct i2c_msg *p;
16586 + int i, err = 0;
16587 +
16588 + for (i = 0; !err && i < num; i++) {
16589 + p = &msgs[i];
16590 + err = do_address(adap, p->addr, p->flags & I2C_M_RD);
16591 + if (err || !p->len)
16592 + continue;
16593 + if (p->flags & I2C_M_RD)
16594 + err = i2c_read(adap, p->buf, p->len);
16595 + else
16596 + err = i2c_write(adap, p->buf, p->len);
16597 + }
16598 +
16599 + /* Return the number of messages processed, or the error code.
16600 + */
16601 + if (err == 0)
16602 + err = num;
16603 + return err;
16604 +}
16605 +
16606 +static u32
16607 +au1550_func(struct i2c_adapter *adap)
16608 +{
16609 + return I2C_FUNC_I2C;
16610 +}
16611 +
16612 +static struct i2c_algorithm au1550_algo = {
16613 + .name = "Au1550 algorithm",
16614 + .id = I2C_ALGO_AU1550,
16615 + .master_xfer = au1550_xfer,
16616 + .functionality = au1550_func,
16617 +};
16618 +
16619 +/*
16620 + * registering functions to load algorithms at runtime
16621 + * Prior to calling us, the 50MHz clock frequency and routing
16622 + * must have been set up for the PSC indicated by the adapter.
16623 + */
16624 +int
16625 +i2c_au1550_add_bus(struct i2c_adapter *i2c_adap)
16626 +{
16627 + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
16628 + volatile psc_smb_t *sp;
16629 + u32 stat;
16630 +
16631 + i2c_adap->algo = &au1550_algo;
16632 +
16633 + /* Now, set up the PSC for SMBus PIO mode.
16634 + */
16635 + sp = (volatile psc_smb_t *)(adap->psc_base);
16636 + sp->psc_ctrl = PSC_CTRL_DISABLE;
16637 + au_sync();
16638 + sp->psc_sel = PSC_SEL_PS_SMBUSMODE;
16639 + sp->psc_smbcfg = 0;
16640 + au_sync();
16641 + sp->psc_ctrl = PSC_CTRL_ENABLE;
16642 + au_sync();
16643 + do {
16644 + stat = sp->psc_smbstat;
16645 + au_sync();
16646 + } while ((stat & PSC_SMBSTAT_SR) == 0);
16647 +
16648 + sp->psc_smbcfg = (PSC_SMBCFG_RT_FIFO8 | PSC_SMBCFG_TT_FIFO8 |
16649 + PSC_SMBCFG_DD_DISABLE);
16650 +
16651 + /* Divide by 8 to get a 6.25 MHz clock. The later protocol
16652 + * timings are based on this clock.
16653 + */
16654 + sp->psc_smbcfg |= PSC_SMBCFG_SET_DIV(PSC_SMBCFG_DIV2);
16655 + sp->psc_smbmsk = PSC_SMBMSK_ALLMASK;
16656 + au_sync();
16657 +
16658 + /* Set the protocol timer values. See Table 71 in the
16659 + * Au1550 Data Book for standard timing values.
16660 + */
16661 + sp->psc_smbtmr = PSC_SMBTMR_SET_TH(2) | PSC_SMBTMR_SET_PS(15) | \
16662 + PSC_SMBTMR_SET_PU(11) | PSC_SMBTMR_SET_SH(11) | \
16663 + PSC_SMBTMR_SET_SU(11) | PSC_SMBTMR_SET_CL(15) | \
16664 + PSC_SMBTMR_SET_CH(11);
16665 + au_sync();
16666 +
16667 + sp->psc_smbcfg |= PSC_SMBCFG_DE_ENABLE;
16668 + do {
16669 + stat = sp->psc_smbstat;
16670 + au_sync();
16671 + } while ((stat & PSC_SMBSTAT_DR) == 0);
16672 +
16673 + return i2c_add_adapter(i2c_adap);
16674 +}
16675 +
16676 +
16677 +int
16678 +i2c_au1550_del_bus(struct i2c_adapter *adap)
16679 +{
16680 + return i2c_del_adapter(adap);
16681 +}
16682 +
16683 +EXPORT_SYMBOL(i2c_au1550_add_bus);
16684 +EXPORT_SYMBOL(i2c_au1550_del_bus);
16685 +
16686 +MODULE_AUTHOR("Dan Malek <dan@embeddededge.com>");
16687 +MODULE_DESCRIPTION("SMBus Au1550 algorithm");
16688 +MODULE_LICENSE("GPL");
16689 diff -Nur linux-2.4.29/drivers/i2c/i2c-algo-bit.c linux-mips/drivers/i2c/i2c-algo-bit.c
16690 --- linux-2.4.29/drivers/i2c/i2c-algo-bit.c 2004-02-18 14:36:31.000000000 +0100
16691 +++ linux-mips/drivers/i2c/i2c-algo-bit.c 2005-03-26 11:47:21.069193803 +0100
16692 @@ -28,14 +28,12 @@
16693 #include <linux/delay.h>
16694 #include <linux/slab.h>
16695 #include <linux/init.h>
16696 -#include <asm/uaccess.h>
16697 -#include <linux/ioport.h>
16698 #include <linux/errno.h>
16699 #include <linux/sched.h>
16700 -
16701 #include <linux/i2c.h>
16702 #include <linux/i2c-algo-bit.h>
16703
16704 +
16705 /* ----- global defines ----------------------------------------------- */
16706 #define DEB(x) if (i2c_debug>=1) x;
16707 #define DEB2(x) if (i2c_debug>=2) x;
16708 @@ -522,8 +520,8 @@
16709
16710 static u32 bit_func(struct i2c_adapter *adap)
16711 {
16712 - return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR |
16713 - I2C_FUNC_PROTOCOL_MANGLING;
16714 + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
16715 + I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
16716 }
16717
16718
16719 diff -Nur linux-2.4.29/drivers/i2c/i2c-algo-pcf.c linux-mips/drivers/i2c/i2c-algo-pcf.c
16720 --- linux-2.4.29/drivers/i2c/i2c-algo-pcf.c 2004-02-18 14:36:31.000000000 +0100
16721 +++ linux-mips/drivers/i2c/i2c-algo-pcf.c 2005-03-26 11:47:21.128184122 +0100
16722 @@ -32,15 +32,13 @@
16723 #include <linux/delay.h>
16724 #include <linux/slab.h>
16725 #include <linux/init.h>
16726 -#include <asm/uaccess.h>
16727 -#include <linux/ioport.h>
16728 #include <linux/errno.h>
16729 #include <linux/sched.h>
16730 -
16731 #include <linux/i2c.h>
16732 #include <linux/i2c-algo-pcf.h>
16733 #include "i2c-pcf8584.h"
16734
16735 +
16736 /* ----- global defines ----------------------------------------------- */
16737 #define DEB(x) if (i2c_debug>=1) x
16738 #define DEB2(x) if (i2c_debug>=2) x
16739 @@ -435,8 +433,8 @@
16740
16741 static u32 pcf_func(struct i2c_adapter *adap)
16742 {
16743 - return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR |
16744 - I2C_FUNC_PROTOCOL_MANGLING;
16745 + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
16746 + I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
16747 }
16748
16749 /* -----exported algorithm data: ------------------------------------- */
16750 diff -Nur linux-2.4.29/drivers/i2c/i2c-au1550.c linux-mips/drivers/i2c/i2c-au1550.c
16751 --- linux-2.4.29/drivers/i2c/i2c-au1550.c 1970-01-01 01:00:00.000000000 +0100
16752 +++ linux-mips/drivers/i2c/i2c-au1550.c 2005-03-26 11:47:21.146181168 +0100
16753 @@ -0,0 +1,154 @@
16754 +/*
16755 + * i2c-au1550.c: SMBus (i2c) adapter for Alchemy PSC interface
16756 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
16757 + *
16758 + * This is just a skeleton adapter to use with the Au1550 PSC
16759 + * algorithm. It was developed for the Pb1550, but will work with
16760 + * any Au1550 board that has a similar PSC configuration.
16761 + *
16762 + * This program is free software; you can redistribute it and/or
16763 + * modify it under the terms of the GNU General Public License
16764 + * as published by the Free Software Foundation; either version 2
16765 + * of the License, or (at your option) any later version.
16766 + *
16767 + * This program is distributed in the hope that it will be useful,
16768 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16769 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16770 + * GNU General Public License for more details.
16771 + *
16772 + * You should have received a copy of the GNU General Public License
16773 + * along with this program; if not, write to the Free Software
16774 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16775 + */
16776 +
16777 +#include <linux/config.h>
16778 +#include <linux/kernel.h>
16779 +#include <linux/module.h>
16780 +#include <linux/init.h>
16781 +#include <linux/errno.h>
16782 +
16783 +#include <asm/au1000.h>
16784 +#include <asm/au1xxx_psc.h>
16785 +#if defined( CONFIG_MIPS_PB1550 )
16786 + #include <asm/pb1550.h>
16787 +#endif
16788 +#if defined( CONFIG_MIPS_PB1200 )
16789 + #include <asm/pb1200.h>
16790 +#endif
16791 +#if defined( CONFIG_MIPS_DB1200 )
16792 + #include <asm/db1200.h>
16793 +#endif
16794 +#if defined( CONFIG_MIPS_FICMMP )
16795 + #include <asm/ficmmp.h>
16796 +#endif
16797 +
16798 +#include <linux/i2c.h>
16799 +#include <linux/i2c-algo-au1550.h>
16800 +
16801 +
16802 +
16803 +static int
16804 +pb1550_reg(struct i2c_client *client)
16805 +{
16806 + return 0;
16807 +}
16808 +
16809 +static int
16810 +pb1550_unreg(struct i2c_client *client)
16811 +{
16812 + return 0;
16813 +}
16814 +
16815 +static void
16816 +pb1550_inc_use(struct i2c_adapter *adap)
16817 +{
16818 +#ifdef MODULE
16819 + MOD_INC_USE_COUNT;
16820 +#endif
16821 +}
16822 +
16823 +static void
16824 +pb1550_dec_use(struct i2c_adapter *adap)
16825 +{
16826 +#ifdef MODULE
16827 + MOD_DEC_USE_COUNT;
16828 +#endif
16829 +}
16830 +
16831 +static struct i2c_algo_au1550_data pb1550_i2c_info = {
16832 + SMBUS_PSC_BASE, 200, 200
16833 +};
16834 +
16835 +static struct i2c_adapter pb1550_board_adapter = {
16836 + name: "pb1550 adapter",
16837 + id: I2C_HW_AU1550_PSC,
16838 + algo: NULL,
16839 + algo_data: &pb1550_i2c_info,
16840 + inc_use: pb1550_inc_use,
16841 + dec_use: pb1550_dec_use,
16842 + client_register: pb1550_reg,
16843 + client_unregister: pb1550_unreg,
16844 + client_count: 0,
16845 +};
16846 +
16847 +int __init
16848 +i2c_pb1550_init(void)
16849 +{
16850 + /* This is where we would set up a 50MHz clock source
16851 + * and routing. On the Pb1550, the SMBus is PSC2, which
16852 + * uses a shared clock with USB. This has been already
16853 + * configured by Yamon as a 48MHz clock, close enough
16854 + * for our work.
16855 + */
16856 + if (i2c_au1550_add_bus(&pb1550_board_adapter) < 0)
16857 + return -ENODEV;
16858 +
16859 + return 0;
16860 +}
16861 +
16862 +/* BIG hack to support the control interface on the Wolfson WM8731
16863 + * audio codec on the Pb1550 board. We get an address and two data
16864 + * bytes to write, create an i2c message, and send it across the
16865 + * i2c transfer function. We do this here because we have access to
16866 + * the i2c adapter structure.
16867 + */
16868 +static struct i2c_msg wm_i2c_msg; /* We don't want this stuff on the stack */
16869 +static u8 i2cbuf[2];
16870 +
16871 +int
16872 +pb1550_wm_codec_write(u8 addr, u8 reg, u8 val)
16873 +{
16874 + wm_i2c_msg.addr = addr;
16875 + wm_i2c_msg.flags = 0;
16876 + wm_i2c_msg.buf = i2cbuf;
16877 + wm_i2c_msg.len = 2;
16878 + i2cbuf[0] = reg;
16879 + i2cbuf[1] = val;
16880 +
16881 + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, &wm_i2c_msg, 1);
16882 +}
16883 +
16884 +/* the next function is needed by DVB driver. */
16885 +int pb1550_i2c_xfer(struct i2c_msg msgs[], int num)
16886 +{
16887 + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, msgs, num);
16888 +}
16889 +
16890 +EXPORT_SYMBOL(pb1550_wm_codec_write);
16891 +EXPORT_SYMBOL(pb1550_i2c_xfer);
16892 +
16893 +MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
16894 +MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
16895 +MODULE_LICENSE("GPL");
16896 +
16897 +int
16898 +init_module(void)
16899 +{
16900 + return i2c_pb1550_init();
16901 +}
16902 +
16903 +void
16904 +cleanup_module(void)
16905 +{
16906 + i2c_au1550_del_bus(&pb1550_board_adapter);
16907 +}
16908 diff -Nur linux-2.4.29/drivers/i2c/i2c-core.c linux-mips/drivers/i2c/i2c-core.c
16909 --- linux-2.4.29/drivers/i2c/i2c-core.c 2005-01-19 15:09:54.000000000 +0100
16910 +++ linux-mips/drivers/i2c/i2c-core.c 2004-11-29 18:47:16.000000000 +0100
16911 @@ -1280,6 +1280,9 @@
16912 #ifdef CONFIG_I2C_MAX1617
16913 extern int i2c_max1617_init(void);
16914 #endif
16915 +#ifdef CONFIG_I2C_ALGO_AU1550
16916 + extern int i2c_pb1550_init(void);
16917 +#endif
16918
16919 #ifdef CONFIG_I2C_PROC
16920 extern int sensors_init(void);
16921 @@ -1335,6 +1338,10 @@
16922 i2c_max1617_init();
16923 #endif
16924
16925 +#ifdef CONFIG_I2C_ALGO_AU1550
16926 + i2c_pb1550_init();
16927 +#endif
16928 +
16929 /* -------------- proc interface ---- */
16930 #ifdef CONFIG_I2C_PROC
16931 sensors_init();
16932 diff -Nur linux-2.4.29/drivers/i2c/Makefile linux-mips/drivers/i2c/Makefile
16933 --- linux-2.4.29/drivers/i2c/Makefile 2004-02-18 14:36:31.000000000 +0100
16934 +++ linux-mips/drivers/i2c/Makefile 2005-03-26 11:47:20.975209228 +0100
16935 @@ -6,7 +6,7 @@
16936
16937 export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
16938 i2c-algo-ite.o i2c-algo-sibyte.o i2c-algo-sgi.o \
16939 - i2c-proc.o
16940 + i2c-algo-au1550.o i2c-proc.o i2c-au1550.o
16941
16942 obj-$(CONFIG_I2C) += i2c-core.o
16943 obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
16944 @@ -25,6 +25,7 @@
16945 obj-$(CONFIG_I2C_ALGO_SIBYTE) += i2c-algo-sibyte.o i2c-sibyte.o
16946 obj-$(CONFIG_I2C_MAX1617) += i2c-max1617.o
16947 obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o
16948 +obj-$(CONFIG_I2C_ALGO_AU1550) += i2c-algo-au1550.o i2c-au1550.o
16949
16950 # This is needed for automatic patch generation: sensors code starts here
16951 # This is needed for automatic patch generation: sensors code ends here
16952 diff -Nur linux-2.4.29/drivers/ide/ide-cd.c linux-mips/drivers/ide/ide-cd.c
16953 --- linux-2.4.29/drivers/ide/ide-cd.c 2003-11-28 19:26:20.000000000 +0100
16954 +++ linux-mips/drivers/ide/ide-cd.c 2005-03-26 11:47:21.315153436 +0100
16955 @@ -2206,25 +2206,31 @@
16956 /* Read the multisession information. */
16957 if (toc->hdr.first_track != CDROM_LEADOUT) {
16958 /* Read the multisession information. */
16959 - stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
16960 + stat = cdrom_read_tocentry(drive, 0, 0, 1, (char *)&ms_tmp,
16961 sizeof(ms_tmp), sense);
16962 if (stat) return stat;
16963 +
16964 + toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
16965 } else {
16966 - ms_tmp.ent.addr.msf.minute = 0;
16967 - ms_tmp.ent.addr.msf.second = 2;
16968 - ms_tmp.ent.addr.msf.frame = 0;
16969 ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
16970 + toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */
16971 }
16972
16973 #if ! STANDARD_ATAPI
16974 - if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
16975 + if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) {
16976 + /* Re-read multisession information using MSF format */
16977 + stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
16978 + sizeof(ms_tmp), sense);
16979 + if (stat)
16980 + return stat;
16981 +
16982 msf_from_bcd (&ms_tmp.ent.addr.msf);
16983 + toc->last_session_lba = msf_to_lba(ms_tmp.ent.addr.msf.minute,
16984 + ms_tmp.ent.addr.msf.second,
16985 + ms_tmp.ent.addr.msf.frame);
16986 + }
16987 #endif /* not STANDARD_ATAPI */
16988
16989 - toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
16990 - ms_tmp.ent.addr.msf.second,
16991 - ms_tmp.ent.addr.msf.frame);
16992 -
16993 toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
16994
16995 /* Now try to get the total cdrom capacity. */
16996 diff -Nur linux-2.4.29/drivers/isdn/hisax/ipacx.c linux-mips/drivers/isdn/hisax/ipacx.c
16997 --- linux-2.4.29/drivers/isdn/hisax/ipacx.c 2002-11-29 00:53:13.000000000 +0100
16998 +++ linux-mips/drivers/isdn/hisax/ipacx.c 2005-03-26 11:47:21.653097971 +0100
16999 @@ -152,7 +152,13 @@
17000
17001 case (HW_RESET | REQUEST):
17002 case (HW_ENABLE | REQUEST):
17003 - ph_command(cs, IPACX_CMD_TIM);
17004 + if ((cs->dc.isac.ph_state == IPACX_IND_RES) ||
17005 + (cs->dc.isac.ph_state == IPACX_IND_DR) ||
17006 + (cs->dc.isac.ph_state == IPACX_IND_DC))
17007 + ph_command(cs, IPACX_CMD_TIM);
17008 + else
17009 + ph_command(cs, IPACX_CMD_RES);
17010 +
17011 break;
17012
17013 case (HW_INFO3 | REQUEST):
17014 diff -Nur linux-2.4.29/drivers/md/lvm-snap.c linux-mips/drivers/md/lvm-snap.c
17015 --- linux-2.4.29/drivers/md/lvm-snap.c 2004-04-14 15:05:30.000000000 +0200
17016 +++ linux-mips/drivers/md/lvm-snap.c 2005-03-26 11:47:21.896058096 +0100
17017 @@ -119,7 +119,6 @@
17018 unsigned long mask = lv->lv_snapshot_hash_mask;
17019 int chunk_size = lv->lv_chunk_size;
17020 lv_block_exception_t *ret;
17021 - int i = 0;
17022
17023 hash_table =
17024 &hash_table[hashfn(org_dev, org_start, mask, chunk_size)];
17025 @@ -132,15 +131,9 @@
17026 exception = list_entry(next, lv_block_exception_t, hash);
17027 if (exception->rsector_org == org_start &&
17028 exception->rdev_org == org_dev) {
17029 - if (i) {
17030 - /* fun, isn't it? :) */
17031 - list_del(next);
17032 - list_add(next, hash_table);
17033 - }
17034 ret = exception;
17035 break;
17036 }
17037 - i++;
17038 }
17039 return ret;
17040 }
17041 diff -Nur linux-2.4.29/drivers/media/video/indycam.c linux-mips/drivers/media/video/indycam.c
17042 --- linux-2.4.29/drivers/media/video/indycam.c 2004-02-18 14:36:31.000000000 +0100
17043 +++ linux-mips/drivers/media/video/indycam.c 2004-12-09 21:32:05.000000000 +0100
17044 @@ -50,13 +50,14 @@
17045 0x80, /* INDYCAM_GAMMA */
17046 };
17047
17048 - int err = 0;
17049 struct indycam *camera;
17050 struct i2c_client *client;
17051 + int err = 0;
17052
17053 client = kmalloc(sizeof(*client), GFP_KERNEL);
17054 - if (!client)
17055 + if (!client)
17056 return -ENOMEM;
17057 +
17058 camera = kmalloc(sizeof(*camera), GFP_KERNEL);
17059 if (!camera) {
17060 err = -ENOMEM;
17061 @@ -67,7 +68,7 @@
17062 client->adapter = adap;
17063 client->addr = addr;
17064 client->driver = &i2c_driver_indycam;
17065 - strcpy(client->name, "IndyCam client");
17066 + strcpy(client->name, "IndyCam client");
17067 camera->client = client;
17068
17069 err = i2c_attach_client(client);
17070 @@ -75,18 +76,18 @@
17071 goto out_free_camera;
17072
17073 camera->version = i2c_smbus_read_byte_data(client, INDYCAM_VERSION);
17074 - if (camera->version != CAMERA_VERSION_INDY &&
17075 - camera->version != CAMERA_VERSION_MOOSE) {
17076 + if ((camera->version != CAMERA_VERSION_INDY) &&
17077 + (camera->version != CAMERA_VERSION_MOOSE)) {
17078 err = -ENODEV;
17079 goto out_detach_client;
17080 }
17081 - printk(KERN_INFO "Indycam v%d.%d detected.\n",
17082 + printk(KERN_INFO "IndyCam v%d.%d detected.\n",
17083 INDYCAM_VERSION_MAJOR(camera->version),
17084 INDYCAM_VERSION_MINOR(camera->version));
17085
17086 err = i2c_master_send(client, initseq, sizeof(initseq));
17087 if (err)
17088 - printk(KERN_INFO "IndyCam initalization failed\n");
17089 + printk(KERN_ERR "IndyCam initalization failed.\n");
17090
17091 MOD_INC_USE_COUNT;
17092 return 0;
17093 diff -Nur linux-2.4.29/drivers/media/video/vino.c linux-mips/drivers/media/video/vino.c
17094 --- linux-2.4.29/drivers/media/video/vino.c 2004-02-18 14:36:31.000000000 +0100
17095 +++ linux-mips/drivers/media/video/vino.c 2004-12-10 05:02:54.000000000 +0100
17096 @@ -5,6 +5,8 @@
17097 * License version 2 as published by the Free Software Foundation.
17098 *
17099 * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
17100 + * Copyright (C) 2004 Mikael Nousiainen <tmnousia@cc.hut.fi>
17101 + *
17102 */
17103
17104 #include <linux/module.h>
17105 @@ -37,13 +39,23 @@
17106 #define DEBUG(x...)
17107 #endif
17108
17109 +/* Channels (who could have guessed) */
17110 +#define VINO_CHAN_NONE 0
17111 +#define VINO_CHAN_A 1
17112 +#define VINO_CHAN_B 2
17113 +
17114 /* VINO video size */
17115 #define VINO_PAL_WIDTH 768
17116 #define VINO_PAL_HEIGHT 576
17117 #define VINO_NTSC_WIDTH 646
17118 #define VINO_NTSC_HEIGHT 486
17119
17120 -/* set this to some sensible values. note: VINO_MIN_WIDTH has to be 8*x */
17121 +/* Minimum value for Y-clipping (for smaller values the images
17122 + * will be corrupted) */
17123 +#define VINO_MIN_Y_CLIPPING 2
17124 +
17125 +/* Set these to some sensible values.
17126 + * Note: the picture width has to be divisible by 8 */
17127 #define VINO_MIN_WIDTH 32
17128 #define VINO_MIN_HEIGHT 32
17129
17130 @@ -64,9 +76,7 @@
17131
17132 struct vino_device {
17133 struct video_device vdev;
17134 -#define VINO_CHAN_A 1
17135 -#define VINO_CHAN_B 2
17136 - int chan;
17137 + int chan; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
17138 int alpha;
17139 /* clipping... */
17140 unsigned int left, right, top, bottom;
17141 @@ -106,7 +116,7 @@
17142
17143 struct vino_client {
17144 struct i2c_client *driver;
17145 - int owner;
17146 + int owner; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
17147 };
17148
17149 struct vino_video {
17150 @@ -362,6 +372,7 @@
17151 static int dma_setup(struct vino_device *v)
17152 {
17153 u32 ctrl, intr;
17154 + int ofs;
17155 struct sgi_vino_channel *ch;
17156
17157 ch = (v->chan == VINO_CHAN_A) ? &vino->a : &vino->b;
17158 @@ -377,14 +388,24 @@
17159 ch->line_size = v->line_size - 8;
17160 /* set the alpha register */
17161 ch->alpha = v->alpha;
17162 - /* set cliping registers */
17163 - ch->clip_start = VINO_CLIP_ODD(v->top) | VINO_CLIP_EVEN(v->top+1) |
17164 + /* Set the clipping registers, this is the constant source of fun :)
17165 + * Y clipping start has to be >= 2 and end has to be start + height/2
17166 + * The values of top and bottom are even so dividing is not a problem
17167 + *
17168 + * The docs say that clipping values for the even field should be
17169 + * odd_end + something_to_skip_vertical_blanking + some_lines and
17170 + * even_start + height/2, though the image is good this way also
17171 + *
17172 + * TODO: for analog sources (SAA7191), the clipping values are a bit
17173 + * different and that case isn't yet handled
17174 + */
17175 + ofs = VINO_MIN_Y_CLIPPING; /* Should depend on input source */
17176 + ch->clip_start = VINO_CLIP_ODD(ofs + v->top / 2) |
17177 + VINO_CLIP_EVEN(ofs + v->top / 2 + 1) |
17178 VINO_CLIP_X(v->left);
17179 - ch->clip_end = VINO_CLIP_ODD(v->bottom) | VINO_CLIP_EVEN(v->bottom+1) |
17180 + ch->clip_end = VINO_CLIP_ODD(ofs + v->bottom / 2 - 1) |
17181 + VINO_CLIP_EVEN(ofs + v->bottom / 2) |
17182 VINO_CLIP_X(v->right);
17183 - /* FIXME: end-of-field bug workaround
17184 - VINO_CLIP_X(VINO_PAL_WIDTH);
17185 - */
17186 /* init the frame rate and norm (full frame rate only for now...) */
17187 ch->frame_rate = VINO_FRAMERT_RT(0x1fff) |
17188 (get_capture_norm(v) == VIDEO_MODE_PAL ?
17189 @@ -510,6 +531,7 @@
17190 static void vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
17191 {
17192 u32 intr, ctrl;
17193 + int a_eof, b_eof;
17194
17195 spin_lock(&Vino->vino_lock);
17196 ctrl = vino->control;
17197 @@ -525,12 +547,14 @@
17198 vino->control = ctrl;
17199 clear_eod(&Vino->chB);
17200 }
17201 + a_eof = intr & VINO_INTSTAT_A_EOF;
17202 + b_eof = intr & VINO_INTSTAT_B_EOF;
17203 vino->intr_status = ~intr;
17204 spin_unlock(&Vino->vino_lock);
17205 - /* FIXME: For now we are assuming that interrupt means that frame is
17206 - * done. That's not true, but we can live with such brokeness for
17207 - * a while ;-) */
17208 - field_done(&Vino->chA);
17209 + if (a_eof)
17210 + field_done(&Vino->chA);
17211 + if (b_eof)
17212 + field_done(&Vino->chB);
17213 }
17214
17215 static int vino_grab(struct vino_device *v, int frame)
17216 diff -Nur linux-2.4.29/drivers/mtd/devices/docprobe.c linux-mips/drivers/mtd/devices/docprobe.c
17217 --- linux-2.4.29/drivers/mtd/devices/docprobe.c 2003-06-13 16:51:34.000000000 +0200
17218 +++ linux-mips/drivers/mtd/devices/docprobe.c 2003-06-16 01:42:21.000000000 +0200
17219 @@ -89,10 +89,10 @@
17220 0xe4000000,
17221 #elif defined(CONFIG_MOMENCO_OCELOT)
17222 0x2f000000,
17223 - 0xff000000,
17224 + 0xff000000,
17225 #elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
17226 - 0xff000000,
17227 -##else
17228 + 0xff000000,
17229 +#else
17230 #warning Unknown architecture for DiskOnChip. No default probe locations defined
17231 #endif
17232 0 };
17233 diff -Nur linux-2.4.29/drivers/mtd/devices/ms02-nv.c linux-mips/drivers/mtd/devices/ms02-nv.c
17234 --- linux-2.4.29/drivers/mtd/devices/ms02-nv.c 2003-06-13 16:51:34.000000000 +0200
17235 +++ linux-mips/drivers/mtd/devices/ms02-nv.c 2004-07-30 12:22:40.000000000 +0200
17236 @@ -1,10 +1,10 @@
17237 /*
17238 - * Copyright (c) 2001 Maciej W. Rozycki
17239 + * Copyright (c) 2001 Maciej W. Rozycki
17240 *
17241 - * This program is free software; you can redistribute it and/or
17242 - * modify it under the terms of the GNU General Public License
17243 - * as published by the Free Software Foundation; either version
17244 - * 2 of the License, or (at your option) any later version.
17245 + * This program is free software; you can redistribute it and/or
17246 + * modify it under the terms of the GNU General Public License
17247 + * as published by the Free Software Foundation; either version
17248 + * 2 of the License, or (at your option) any later version.
17249 *
17250 * $Id$
17251 */
17252 @@ -29,18 +29,18 @@
17253
17254
17255 static char version[] __initdata =
17256 - "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
17257 + "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
17258
17259 -MODULE_AUTHOR("Maciej W. Rozycki <macro@ds2.pg.gda.pl>");
17260 +MODULE_AUTHOR("Maciej W. Rozycki <macro@linux-mips.org>");
17261 MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver");
17262 MODULE_LICENSE("GPL");
17263
17264
17265 /*
17266 * Addresses we probe for an MS02-NV at. Modules may be located
17267 - * at any 8MB boundary within a 0MB up to 112MB range or at any 32MB
17268 - * boundary within a 0MB up to 448MB range. We don't support a module
17269 - * at 0MB, though.
17270 + * at any 8MiB boundary within a 0MiB up to 112MiB range or at any 32MiB
17271 + * boundary within a 0MiB up to 448MiB range. We don't support a module
17272 + * at 0MiB, though.
17273 */
17274 static ulong ms02nv_addrs[] __initdata = {
17275 0x07000000, 0x06800000, 0x06000000, 0x05800000, 0x05000000,
17276 @@ -130,7 +130,7 @@
17277
17278 int ret = -ENODEV;
17279
17280 - /* The module decodes 8MB of address space. */
17281 + /* The module decodes 8MiB of address space. */
17282 mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
17283 if (!mod_res)
17284 return -ENOMEM;
17285 @@ -233,7 +233,7 @@
17286 goto err_out_csr_res;
17287 }
17288
17289 - printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMB.\n",
17290 + printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMiB.\n",
17291 mtd->index, ms02nv_name, addr, size >> 20);
17292
17293 mp->next = root_ms02nv_mtd;
17294 @@ -293,12 +293,12 @@
17295
17296 switch (mips_machtype) {
17297 case MACH_DS5000_200:
17298 - csr = (volatile u32 *)KN02_CSR_ADDR;
17299 + csr = (volatile u32 *)KN02_CSR_BASE;
17300 if (*csr & KN02_CSR_BNK32M)
17301 stride = 2;
17302 break;
17303 case MACH_DS5000_2X0:
17304 - case MACH_DS5000:
17305 + case MACH_DS5900:
17306 csr = (volatile u32 *)KN03_MCR_BASE;
17307 if (*csr & KN03_MCR_BNK32M)
17308 stride = 2;
17309 diff -Nur linux-2.4.29/drivers/mtd/devices/ms02-nv.h linux-mips/drivers/mtd/devices/ms02-nv.h
17310 --- linux-2.4.29/drivers/mtd/devices/ms02-nv.h 2002-11-29 00:53:13.000000000 +0100
17311 +++ linux-mips/drivers/mtd/devices/ms02-nv.h 2004-07-30 12:22:40.000000000 +0200
17312 @@ -1,32 +1,96 @@
17313 /*
17314 - * Copyright (c) 2001 Maciej W. Rozycki
17315 + * Copyright (c) 2001, 2003 Maciej W. Rozycki
17316 *
17317 - * This program is free software; you can redistribute it and/or
17318 - * modify it under the terms of the GNU General Public License
17319 - * as published by the Free Software Foundation; either version
17320 - * 2 of the License, or (at your option) any later version.
17321 + * DEC MS02-NV (54-20948-01) battery backed-up NVRAM module for
17322 + * DECstation/DECsystem 5000/2x0 and DECsystem 5900 and 5900/260
17323 + * systems.
17324 + *
17325 + * This program is free software; you can redistribute it and/or
17326 + * modify it under the terms of the GNU General Public License
17327 + * as published by the Free Software Foundation; either version
17328 + * 2 of the License, or (at your option) any later version.
17329 + *
17330 + * $Id$
17331 */
17332
17333 #include <linux/ioport.h>
17334 #include <linux/mtd/mtd.h>
17335
17336 +/*
17337 + * Addresses are decoded as follows:
17338 + *
17339 + * 0x000000 - 0x3fffff SRAM
17340 + * 0x400000 - 0x7fffff CSR
17341 + *
17342 + * Within the SRAM area the following ranges are forced by the system
17343 + * firmware:
17344 + *
17345 + * 0x000000 - 0x0003ff diagnostic area, destroyed upon a reboot
17346 + * 0x000400 - ENDofRAM storage area, available to operating systems
17347 + *
17348 + * but we can't really use the available area right from 0x000400 as
17349 + * the first word is used by the firmware as a status flag passed
17350 + * from an operating system. If anything but the valid data magic
17351 + * ID value is found, the firmware considers the SRAM clean, i.e.
17352 + * containing no valid data, and disables the battery resulting in
17353 + * data being erased as soon as power is switched off. So the choice
17354 + * for the start address of the user-available is 0x001000 which is
17355 + * nicely page aligned. The area between 0x000404 and 0x000fff may
17356 + * be used by the driver for own needs.
17357 + *
17358 + * The diagnostic area defines two status words to be read by an
17359 + * operating system, a magic ID to distinguish a MS02-NV board from
17360 + * anything else and a status information providing results of tests
17361 + * as well as the size of SRAM available, which can be 1MiB or 2MiB
17362 + * (that's what the firmware handles; no idea if 2MiB modules ever
17363 + * existed).
17364 + *
17365 + * The firmware only handles the MS02-NV board if installed in the
17366 + * last (15th) slot, so for any other location the status information
17367 + * stored in the SRAM cannot be relied upon. But from the hardware
17368 + * point of view there is no problem using up to 14 such boards in a
17369 + * system -- only the 1st slot needs to be filled with a DRAM module.
17370 + * The MS02-NV board is ECC-protected, like other MS02 memory boards.
17371 + *
17372 + * The state of the battery as provided by the CSR is reflected on
17373 + * the two onboard LEDs. When facing the battery side of the board,
17374 + * with the LEDs at the top left and the battery at the bottom right
17375 + * (i.e. looking from the back side of the system box), their meaning
17376 + * is as follows (the system has to be powered on):
17377 + *
17378 + * left LED battery disable status: lit = enabled
17379 + * right LED battery condition status: lit = OK
17380 + */
17381 +
17382 /* MS02-NV iomem register offsets. */
17383 #define MS02NV_CSR 0x400000 /* control & status register */
17384
17385 +/* MS02-NV CSR status bits. */
17386 +#define MS02NV_CSR_BATT_OK 0x01 /* battery OK */
17387 +#define MS02NV_CSR_BATT_OFF 0x02 /* battery disabled */
17388 +
17389 +
17390 /* MS02-NV memory offsets. */
17391 #define MS02NV_DIAG 0x0003f8 /* diagnostic status */
17392 #define MS02NV_MAGIC 0x0003fc /* MS02-NV magic ID */
17393 -#define MS02NV_RAM 0x000400 /* general-purpose RAM start */
17394 +#define MS02NV_VALID 0x000400 /* valid data magic ID */
17395 +#define MS02NV_RAM 0x001000 /* user-exposed RAM start */
17396
17397 -/* MS02-NV diagnostic status constants. */
17398 -#define MS02NV_DIAG_SIZE_MASK 0xf0 /* RAM size mask */
17399 -#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* RAM size shift (left) */
17400 +/* MS02-NV diagnostic status bits. */
17401 +#define MS02NV_DIAG_TEST 0x01 /* SRAM test done (?) */
17402 +#define MS02NV_DIAG_RO 0x02 /* SRAM r/o test done */
17403 +#define MS02NV_DIAG_RW 0x04 /* SRAM r/w test done */
17404 +#define MS02NV_DIAG_FAIL 0x08 /* SRAM test failed */
17405 +#define MS02NV_DIAG_SIZE_MASK 0xf0 /* SRAM size mask */
17406 +#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* SRAM size shift (left) */
17407
17408 /* MS02-NV general constants. */
17409 #define MS02NV_ID 0x03021966 /* MS02-NV magic ID value */
17410 +#define MS02NV_VALID_ID 0xbd100248 /* valid data magic ID value */
17411 #define MS02NV_SLOT_SIZE 0x800000 /* size of the address space
17412 decoded by the module */
17413
17414 +
17415 typedef volatile u32 ms02nv_uint;
17416
17417 struct ms02nv_private {
17418 diff -Nur linux-2.4.29/drivers/mtd/maps/Config.in linux-mips/drivers/mtd/maps/Config.in
17419 --- linux-2.4.29/drivers/mtd/maps/Config.in 2003-06-13 16:51:34.000000000 +0200
17420 +++ linux-mips/drivers/mtd/maps/Config.in 2004-02-26 01:46:35.000000000 +0100
17421 @@ -51,11 +51,26 @@
17422 dep_tristate ' Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
17423 dep_tristate ' Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
17424 dep_tristate ' Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
17425 + dep_tristate ' Bosporus MTD support' CONFIG_MTD_BOSPORUS $CONFIG_MIPS_BOSPORUS
17426 + dep_tristate ' XXS1500 boot flash device' CONFIG_MTD_XXS1500 $CONFIG_MIPS_XXS1500
17427 + dep_tristate ' MTX-1 flash device' CONFIG_MTD_MTX1 $CONFIG_MIPS_MTX1
17428 if [ "$CONFIG_MTD_PB1500" = "y" -o "$CONFIG_MTD_PB1500" = "m" \
17429 -o "$CONFIG_MTD_PB1100" = "y" -o "$CONFIG_MTD_PB1100" = "m" ]; then
17430 bool ' Pb[15]00 boot flash device' CONFIG_MTD_PB1500_BOOT
17431 bool ' Pb[15]00 user flash device (2nd 32MiB bank)' CONFIG_MTD_PB1500_USER
17432 fi
17433 + tristate ' Db1x00 MTD support' CONFIG_MTD_DB1X00
17434 + if [ "$CONFIG_MTD_DB1X00" = "y" -o "$CONFIG_MTD_DB1X00" = "m" ]; then
17435 + bool ' Db1x00 boot flash device' CONFIG_MTD_DB1X00_BOOT
17436 + bool ' Db1x00 user flash device (2nd bank)' CONFIG_MTD_DB1X00_USER
17437 + fi
17438 + tristate ' Pb1550 MTD support' CONFIG_MTD_PB1550
17439 + if [ "$CONFIG_MTD_PB1550" = "y" -o "$CONFIG_MTD_PB1550" = "m" ]; then
17440 + bool ' Pb1550 Boot Flash' CONFIG_MTD_PB1550_BOOT
17441 + bool ' Pb1550 User Parameter Flash' CONFIG_MTD_PB1550_USER
17442 + fi
17443 + dep_tristate ' Hydrogen 3 MTD support' CONFIG_MTD_HYDROGEN3 $CONFIG_MIPS_HYDROGEN3
17444 + dep_tristate ' Mirage MTD support' CONFIG_MTD_MIRAGE $CONFIG_MIPS_MIRAGE
17445 dep_tristate ' Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board' CONFIG_MTD_CSTM_MIPS_IXX $CONFIG_MTD_CFI $CONFIG_MTD_JEDEC $CONFIG_MTD_PARTITIONS
17446 if [ "$CONFIG_MTD_CSTM_MIPS_IXX" = "y" -o "$CONFIG_MTD_CSTM_MIPS_IXX" = "m" ]; then
17447 hex ' Physical start address of flash mapping' CONFIG_MTD_CSTM_MIPS_IXX_START 0x8000000
17448 diff -Nur linux-2.4.29/drivers/mtd/maps/db1x00-flash.c linux-mips/drivers/mtd/maps/db1x00-flash.c
17449 --- linux-2.4.29/drivers/mtd/maps/db1x00-flash.c 1970-01-01 01:00:00.000000000 +0100
17450 +++ linux-mips/drivers/mtd/maps/db1x00-flash.c 2005-03-26 11:47:22.085027082 +0100
17451 @@ -0,0 +1,283 @@
17452 +/*
17453 + * Flash memory access on Alchemy Db1xxx boards
17454 + *
17455 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
17456 + *
17457 + */
17458 +
17459 +#include <linux/config.h>
17460 +#include <linux/module.h>
17461 +#include <linux/types.h>
17462 +#include <linux/kernel.h>
17463 +
17464 +#include <linux/mtd/mtd.h>
17465 +#include <linux/mtd/map.h>
17466 +#include <linux/mtd/partitions.h>
17467 +
17468 +#include <asm/io.h>
17469 +#include <asm/au1000.h>
17470 +#include <asm/db1x00.h>
17471 +
17472 +#ifdef DEBUG_RW
17473 +#define DBG(x...) printk(x)
17474 +#else
17475 +#define DBG(x...)
17476 +#endif
17477 +
17478 +static unsigned long window_addr;
17479 +static unsigned long window_size;
17480 +static unsigned long flash_size;
17481 +
17482 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
17483 +{
17484 + __u8 ret;
17485 + ret = __raw_readb(map->map_priv_1 + ofs);
17486 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17487 + return ret;
17488 +}
17489 +
17490 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
17491 +{
17492 + __u16 ret;
17493 + ret = __raw_readw(map->map_priv_1 + ofs);
17494 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17495 + return ret;
17496 +}
17497 +
17498 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
17499 +{
17500 + __u32 ret;
17501 + ret = __raw_readl(map->map_priv_1 + ofs);
17502 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17503 + return ret;
17504 +}
17505 +
17506 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
17507 +{
17508 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
17509 + memcpy_fromio(to, map->map_priv_1 + from, len);
17510 +}
17511 +
17512 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
17513 +{
17514 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17515 + __raw_writeb(d, map->map_priv_1 + adr);
17516 + mb();
17517 +}
17518 +
17519 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
17520 +{
17521 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17522 + __raw_writew(d, map->map_priv_1 + adr);
17523 + mb();
17524 +}
17525 +
17526 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
17527 +{
17528 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17529 + __raw_writel(d, map->map_priv_1 + adr);
17530 + mb();
17531 +}
17532 +
17533 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
17534 +{
17535 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
17536 + memcpy_toio(map->map_priv_1 + to, from, len);
17537 +}
17538 +
17539 +static struct map_info db1x00_map = {
17540 + name: "Db1x00 flash",
17541 + read8: physmap_read8,
17542 + read16: physmap_read16,
17543 + read32: physmap_read32,
17544 + copy_from: physmap_copy_from,
17545 + write8: physmap_write8,
17546 + write16: physmap_write16,
17547 + write32: physmap_write32,
17548 + copy_to: physmap_copy_to,
17549 +};
17550 +
17551 +static unsigned char flash_buswidth = 4;
17552 +
17553 +/*
17554 + * The Db1x boards support different flash densities. We setup
17555 + * the mtd_partition structures below for default of 64Mbit
17556 + * flash densities, and override the partitions sizes, if
17557 + * necessary, after we check the board status register.
17558 + */
17559 +
17560 +#ifdef DB1X00_BOTH_BANKS
17561 +/* both banks will be used. Combine the first bank and the first
17562 + * part of the second bank together into a single jffs/jffs2
17563 + * partition.
17564 + */
17565 +static struct mtd_partition db1x00_partitions[] = {
17566 + {
17567 + name: "User FS",
17568 + size: 0x1c00000,
17569 + offset: 0x0000000
17570 + },{
17571 + name: "yamon",
17572 + size: 0x0100000,
17573 + offset: MTDPART_OFS_APPEND,
17574 + mask_flags: MTD_WRITEABLE
17575 + },{
17576 + name: "raw kernel",
17577 + size: (0x300000-0x40000), /* last 256KB is yamon env */
17578 + offset: MTDPART_OFS_APPEND,
17579 + }
17580 +};
17581 +#elif defined(DB1X00_BOOT_ONLY)
17582 +static struct mtd_partition db1x00_partitions[] = {
17583 + {
17584 + name: "User FS",
17585 + size: 0x00c00000,
17586 + offset: 0x0000000
17587 + },{
17588 + name: "yamon",
17589 + size: 0x0100000,
17590 + offset: MTDPART_OFS_APPEND,
17591 + mask_flags: MTD_WRITEABLE
17592 + },{
17593 + name: "raw kernel",
17594 + size: (0x300000-0x40000), /* last 256KB is yamon env */
17595 + offset: MTDPART_OFS_APPEND,
17596 + }
17597 +};
17598 +#elif defined(DB1X00_USER_ONLY)
17599 +static struct mtd_partition db1x00_partitions[] = {
17600 + {
17601 + name: "User FS",
17602 + size: 0x0e00000,
17603 + offset: 0x0000000
17604 + },{
17605 + name: "raw kernel",
17606 + size: MTDPART_SIZ_FULL,
17607 + offset: MTDPART_OFS_APPEND,
17608 + }
17609 +};
17610 +#else
17611 +#error MTD_DB1X00 define combo error /* should never happen */
17612 +#endif
17613 +
17614 +
17615 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
17616 +
17617 +static struct mtd_partition *parsed_parts;
17618 +static struct mtd_info *mymtd;
17619 +
17620 +/*
17621 + * Probe the flash density and setup window address and size
17622 + * based on user CONFIG options. There are times when we don't
17623 + * want the MTD driver to be probing the boot or user flash,
17624 + * so having the option to enable only one bank is important.
17625 + */
17626 +int setup_flash_params()
17627 +{
17628 + switch ((bcsr->status >> 14) & 0x3) {
17629 + case 0: /* 64Mbit devices */
17630 + flash_size = 0x800000; /* 8MB per part */
17631 +#if defined(DB1X00_BOTH_BANKS)
17632 + window_addr = 0x1E000000;
17633 + window_size = 0x2000000;
17634 +#elif defined(DB1X00_BOOT_ONLY)
17635 + window_addr = 0x1F000000;
17636 + window_size = 0x1000000;
17637 +#else /* USER ONLY */
17638 + window_addr = 0x1E000000;
17639 + window_size = 0x1000000;
17640 +#endif
17641 + break;
17642 + case 1:
17643 + /* 128 Mbit devices */
17644 + flash_size = 0x1000000; /* 16MB per part */
17645 +#if defined(DB1X00_BOTH_BANKS)
17646 + window_addr = 0x1C000000;
17647 + window_size = 0x4000000;
17648 + /* USERFS from 0x1C00 0000 to 0x1FC0 0000 */
17649 + db1x00_partitions[0].size = 0x3C00000;
17650 +#elif defined(DB1X00_BOOT_ONLY)
17651 + window_addr = 0x1E000000;
17652 + window_size = 0x2000000;
17653 + /* USERFS from 0x1E00 0000 to 0x1FC0 0000 */
17654 + db1x00_partitions[0].size = 0x1C00000;
17655 +#else /* USER ONLY */
17656 + window_addr = 0x1C000000;
17657 + window_size = 0x2000000;
17658 + /* USERFS from 0x1C00 0000 to 0x1DE00000 */
17659 + db1x00_partitions[0].size = 0x1DE0000;
17660 +#endif
17661 + break;
17662 + case 2:
17663 + /* 256 Mbit devices */
17664 + flash_size = 0x4000000; /* 64MB per part */
17665 +#if defined(DB1X00_BOTH_BANKS)
17666 + return 1;
17667 +#elif defined(DB1X00_BOOT_ONLY)
17668 + /* Boot ROM flash bank only; no user bank */
17669 + window_addr = 0x1C000000;
17670 + window_size = 0x4000000;
17671 + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
17672 + db1x00_partitions[0].size = 0x3C00000;
17673 +#else /* USER ONLY */
17674 + return 1;
17675 +#endif
17676 + break;
17677 + default:
17678 + return 1;
17679 + }
17680 + return 0;
17681 +}
17682 +
17683 +int __init db1x00_mtd_init(void)
17684 +{
17685 + struct mtd_partition *parts;
17686 + int nb_parts = 0;
17687 + char *part_type;
17688 +
17689 + /* Default flash buswidth */
17690 + db1x00_map.buswidth = flash_buswidth;
17691 +
17692 + if (setup_flash_params())
17693 + return -ENXIO;
17694 +
17695 + /*
17696 + * Static partition definition selection
17697 + */
17698 + part_type = "static";
17699 + parts = db1x00_partitions;
17700 + nb_parts = NB_OF(db1x00_partitions);
17701 + db1x00_map.size = window_size;
17702 +
17703 + /*
17704 + * Now let's probe for the actual flash. Do it here since
17705 + * specific machine settings might have been set above.
17706 + */
17707 + printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
17708 + db1x00_map.buswidth*8);
17709 + db1x00_map.map_priv_1 =
17710 + (unsigned long)ioremap(window_addr, window_size);
17711 + mymtd = do_map_probe("cfi_probe", &db1x00_map);
17712 + if (!mymtd) return -ENXIO;
17713 + mymtd->module = THIS_MODULE;
17714 +
17715 + add_mtd_partitions(mymtd, parts, nb_parts);
17716 + return 0;
17717 +}
17718 +
17719 +static void __exit db1x00_mtd_cleanup(void)
17720 +{
17721 + if (mymtd) {
17722 + del_mtd_partitions(mymtd);
17723 + map_destroy(mymtd);
17724 + if (parsed_parts)
17725 + kfree(parsed_parts);
17726 + }
17727 +}
17728 +
17729 +module_init(db1x00_mtd_init);
17730 +module_exit(db1x00_mtd_cleanup);
17731 +
17732 +MODULE_AUTHOR("Pete Popov");
17733 +MODULE_DESCRIPTION("Db1x00 mtd map driver");
17734 +MODULE_LICENSE("GPL");
17735 diff -Nur linux-2.4.29/drivers/mtd/maps/hydrogen3-flash.c linux-mips/drivers/mtd/maps/hydrogen3-flash.c
17736 --- linux-2.4.29/drivers/mtd/maps/hydrogen3-flash.c 1970-01-01 01:00:00.000000000 +0100
17737 +++ linux-mips/drivers/mtd/maps/hydrogen3-flash.c 2004-01-10 23:40:18.000000000 +0100
17738 @@ -0,0 +1,189 @@
17739 +/*
17740 + * Flash memory access on Alchemy HydrogenIII boards
17741 + *
17742 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
17743 + *
17744 + */
17745 +
17746 +#include <linux/config.h>
17747 +#include <linux/module.h>
17748 +#include <linux/types.h>
17749 +#include <linux/kernel.h>
17750 +
17751 +#include <linux/mtd/mtd.h>
17752 +#include <linux/mtd/map.h>
17753 +#include <linux/mtd/partitions.h>
17754 +
17755 +#include <asm/io.h>
17756 +#include <asm/au1000.h>
17757 +
17758 +#ifdef DEBUG_RW
17759 +#define DBG(x...) printk(x)
17760 +#else
17761 +#define DBG(x...)
17762 +#endif
17763 +
17764 +#define WINDOW_ADDR 0x1E000000
17765 +#define WINDOW_SIZE 0x02000000
17766 +
17767 +
17768 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
17769 +{
17770 + __u8 ret;
17771 + ret = __raw_readb(map->map_priv_1 + ofs);
17772 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17773 + return ret;
17774 +}
17775 +
17776 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
17777 +{
17778 + __u16 ret;
17779 + ret = __raw_readw(map->map_priv_1 + ofs);
17780 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17781 + return ret;
17782 +}
17783 +
17784 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
17785 +{
17786 + __u32 ret;
17787 + ret = __raw_readl(map->map_priv_1 + ofs);
17788 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17789 + return ret;
17790 +}
17791 +
17792 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
17793 +{
17794 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
17795 + memcpy_fromio(to, map->map_priv_1 + from, len);
17796 +}
17797 +
17798 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
17799 +{
17800 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17801 + __raw_writeb(d, map->map_priv_1 + adr);
17802 + mb();
17803 +}
17804 +
17805 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
17806 +{
17807 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17808 + __raw_writew(d, map->map_priv_1 + adr);
17809 + mb();
17810 +}
17811 +
17812 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
17813 +{
17814 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17815 + __raw_writel(d, map->map_priv_1 + adr);
17816 + mb();
17817 +}
17818 +
17819 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
17820 +{
17821 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
17822 + memcpy_toio(map->map_priv_1 + to, from, len);
17823 +}
17824 +
17825 +static struct map_info hydrogen3_map = {
17826 + name: "HydrogenIII flash",
17827 + read8: physmap_read8,
17828 + read16: physmap_read16,
17829 + read32: physmap_read32,
17830 + copy_from: physmap_copy_from,
17831 + write8: physmap_write8,
17832 + write16: physmap_write16,
17833 + write32: physmap_write32,
17834 + copy_to: physmap_copy_to,
17835 +};
17836 +
17837 +static unsigned char flash_buswidth = 4;
17838 +
17839 +/* MTDPART_OFS_APPEND is vastly preferred to any attempt at statically lining
17840 + * up the offsets. */
17841 +static struct mtd_partition hydrogen3_partitions[] = {
17842 + {
17843 + name: "User FS",
17844 + size: 0x1c00000,
17845 + offset: 0x0000000
17846 + },{
17847 + name: "yamon",
17848 + size: 0x0100000,
17849 + offset: MTDPART_OFS_APPEND,
17850 + mask_flags: MTD_WRITEABLE
17851 + },{
17852 + name: "raw kernel",
17853 + size: 0x02c0000,
17854 + offset: MTDPART_OFS_APPEND
17855 + }
17856 +};
17857 +
17858 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
17859 +
17860 +static struct mtd_partition *parsed_parts;
17861 +static struct mtd_info *mymtd;
17862 +
17863 +int __init hydrogen3_mtd_init(void)
17864 +{
17865 + struct mtd_partition *parts;
17866 + int nb_parts = 0;
17867 + char *part_type;
17868 +
17869 + /* Default flash buswidth */
17870 + hydrogen3_map.buswidth = flash_buswidth;
17871 +
17872 + /*
17873 + * Static partition definition selection
17874 + */
17875 + part_type = "static";
17876 + parts = hydrogen3_partitions;
17877 + nb_parts = NB_OF(hydrogen3_partitions);
17878 + hydrogen3_map.size = WINDOW_SIZE;
17879 +
17880 + /*
17881 + * Now let's probe for the actual flash. Do it here since
17882 + * specific machine settings might have been set above.
17883 + */
17884 + printk(KERN_NOTICE "HydrogenIII flash: probing %d-bit flash bus\n",
17885 + hydrogen3_map.buswidth*8);
17886 + hydrogen3_map.map_priv_1 =
17887 + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
17888 + mymtd = do_map_probe("cfi_probe", &hydrogen3_map);
17889 + if (!mymtd) return -ENXIO;
17890 + mymtd->module = THIS_MODULE;
17891 +
17892 + add_mtd_partitions(mymtd, parts, nb_parts);
17893 + return 0;
17894 +}
17895 +
17896 +static void __exit hydrogen3_mtd_cleanup(void)
17897 +{
17898 + if (mymtd) {
17899 + del_mtd_partitions(mymtd);
17900 + map_destroy(mymtd);
17901 + if (parsed_parts)
17902 + kfree(parsed_parts);
17903 + }
17904 +}
17905 +
17906 +/*#ifndef MODULE
17907 +
17908 +static int __init _bootflashonly(char *str)
17909 +{
17910 + bootflashonly = simple_strtol(str, NULL, 0);
17911 + return 1;
17912 +}
17913 +
17914 +
17915 +__setup("bootflashonly=", _bootflashonly);
17916 +
17917 +#endif*/
17918 +
17919 +
17920 +module_init(hydrogen3_mtd_init);
17921 +module_exit(hydrogen3_mtd_cleanup);
17922 +
17923 +MODULE_PARM(bootflashonly, "i");
17924 +MODULE_PARM_DESC(bootflashonly, "1=use \"boot flash only\"");
17925 +MODULE_AUTHOR("Pete Popov");
17926 +MODULE_DESCRIPTION("HydrogenIII mtd map driver");
17927 +MODULE_LICENSE("GPL");
17928 diff -Nur linux-2.4.29/drivers/mtd/maps/lasat.c linux-mips/drivers/mtd/maps/lasat.c
17929 --- linux-2.4.29/drivers/mtd/maps/lasat.c 2003-06-13 16:51:34.000000000 +0200
17930 +++ linux-mips/drivers/mtd/maps/lasat.c 2003-08-18 04:59:02.000000000 +0200
17931 @@ -1,15 +1,6 @@
17932 /*
17933 * Flash device on lasat 100 and 200 boards
17934 *
17935 - * Presumably (C) 2002 Brian Murphy <brian@murphy.dk> or whoever he
17936 - * works for.
17937 - *
17938 - * This program is free software; you can redistribute it and/or
17939 - * modify it under the terms of the GNU General Public License version
17940 - * 2 as published by the Free Software Foundation.
17941 - *
17942 - * $Id$
17943 - *
17944 */
17945
17946 #include <linux/module.h>
17947 @@ -21,7 +12,6 @@
17948 #include <linux/mtd/partitions.h>
17949 #include <linux/config.h>
17950 #include <asm/lasat/lasat.h>
17951 -#include <asm/lasat/lasat_mtd.h>
17952
17953 static struct mtd_info *mymtd;
17954
17955 @@ -69,30 +59,33 @@
17956 }
17957
17958 static struct map_info sp_map = {
17959 - .name = "SP flash",
17960 - .buswidth = 4,
17961 - .read8 = sp_read8,
17962 - .read16 = sp_read16,
17963 - .read32 = sp_read32,
17964 - .copy_from = sp_copy_from,
17965 - .write8 = sp_write8,
17966 - .write16 = sp_write16,
17967 - .write32 = sp_write32,
17968 - .copy_to = sp_copy_to
17969 + name: "SP flash",
17970 + buswidth: 4,
17971 + read8: sp_read8,
17972 + read16: sp_read16,
17973 + read32: sp_read32,
17974 + copy_from: sp_copy_from,
17975 + write8: sp_write8,
17976 + write16: sp_write16,
17977 + write32: sp_write32,
17978 + copy_to: sp_copy_to
17979 };
17980
17981 static struct mtd_partition partition_info[LASAT_MTD_LAST];
17982 -static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Filesystem", "Config"};
17983 +static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Config", "Filesystem"};
17984
17985 static int __init init_sp(void)
17986 {
17987 int i;
17988 + int nparts = 0;
17989 /* this does not play well with the old flash code which
17990 * protects and uprotects the flash when necessary */
17991 printk(KERN_NOTICE "Unprotecting flash\n");
17992 *lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
17993
17994 - sp_map.map_priv_1 = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
17995 + sp_map.map_priv_1 = ioremap_nocache(
17996 + lasat_flash_partition_start(LASAT_MTD_BOOTLOADER),
17997 + lasat_board_info.li_flash_size);
17998 sp_map.size = lasat_board_info.li_flash_size;
17999
18000 printk(KERN_NOTICE "sp flash device: %lx at %lx\n",
18001 @@ -109,12 +102,15 @@
18002
18003 for (i=0; i < LASAT_MTD_LAST; i++) {
18004 size = lasat_flash_partition_size(i);
18005 - partition_info[i].size = size;
18006 - partition_info[i].offset = offset;
18007 - offset += size;
18008 + if (size != 0) {
18009 + nparts++;
18010 + partition_info[i].size = size;
18011 + partition_info[i].offset = offset;
18012 + offset += size;
18013 + }
18014 }
18015
18016 - add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
18017 + add_mtd_partitions( mymtd, partition_info, nparts );
18018 return 0;
18019 }
18020
18021 @@ -124,11 +120,11 @@
18022 static void __exit cleanup_sp(void)
18023 {
18024 if (mymtd) {
18025 - del_mtd_partitions(mymtd);
18026 - map_destroy(mymtd);
18027 + del_mtd_partitions(mymtd);
18028 + map_destroy(mymtd);
18029 }
18030 if (sp_map.map_priv_1) {
18031 - sp_map.map_priv_1 = 0;
18032 + sp_map.map_priv_1 = 0;
18033 }
18034 }
18035
18036 diff -Nur linux-2.4.29/drivers/mtd/maps/Makefile linux-mips/drivers/mtd/maps/Makefile
18037 --- linux-2.4.29/drivers/mtd/maps/Makefile 2003-06-13 16:51:34.000000000 +0200
18038 +++ linux-mips/drivers/mtd/maps/Makefile 2004-02-26 01:46:35.000000000 +0100
18039 @@ -52,7 +52,13 @@
18040 obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o
18041 obj-$(CONFIG_MTD_PB1100) += pb1xxx-flash.o
18042 obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o
18043 +obj-$(CONFIG_MTD_XXS1500) += xxs1500.o
18044 +obj-$(CONFIG_MTD_MTX1) += mtx-1.o
18045 obj-$(CONFIG_MTD_LASAT) += lasat.o
18046 +obj-$(CONFIG_MTD_DB1X00) += db1x00-flash.o
18047 +obj-$(CONFIG_MTD_PB1550) += pb1550-flash.o
18048 +obj-$(CONFIG_MTD_HYDROGEN3) += hydrogen3-flash.o
18049 +obj-$(CONFIG_MTD_BOSPORUS) += pb1xxx-flash.o
18050 obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
18051 obj-$(CONFIG_MTD_EDB7312) += edb7312.o
18052 obj-$(CONFIG_MTD_IMPA7) += impa7.o
18053 @@ -61,5 +67,6 @@
18054 obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
18055 obj-$(CONFIG_MTD_NETtel) += nettel.o
18056 obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
18057 +obj-$(CONFIG_MTD_MIRAGE) += mirage-flash.o
18058
18059 include $(TOPDIR)/Rules.make
18060 diff -Nur linux-2.4.29/drivers/mtd/maps/mirage-flash.c linux-mips/drivers/mtd/maps/mirage-flash.c
18061 --- linux-2.4.29/drivers/mtd/maps/mirage-flash.c 1970-01-01 01:00:00.000000000 +0100
18062 +++ linux-mips/drivers/mtd/maps/mirage-flash.c 2003-12-22 04:37:22.000000000 +0100
18063 @@ -0,0 +1,194 @@
18064 +/*
18065 + * Flash memory access on AMD Mirage board.
18066 + *
18067 + * (C) 2003 Embedded Edge
18068 + * based on mirage-flash.c:
18069 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
18070 + *
18071 + */
18072 +
18073 +#include <linux/config.h>
18074 +#include <linux/module.h>
18075 +#include <linux/types.h>
18076 +#include <linux/kernel.h>
18077 +
18078 +#include <linux/mtd/mtd.h>
18079 +#include <linux/mtd/map.h>
18080 +#include <linux/mtd/partitions.h>
18081 +
18082 +#include <asm/io.h>
18083 +#include <asm/au1000.h>
18084 +//#include <asm/mirage.h>
18085 +
18086 +#ifdef DEBUG_RW
18087 +#define DBG(x...) printk(x)
18088 +#else
18089 +#define DBG(x...)
18090 +#endif
18091 +
18092 +static unsigned long window_addr;
18093 +static unsigned long window_size;
18094 +static unsigned long flash_size;
18095 +
18096 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18097 +{
18098 + __u8 ret;
18099 + ret = __raw_readb(map->map_priv_1 + ofs);
18100 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18101 + return ret;
18102 +}
18103 +
18104 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18105 +{
18106 + __u16 ret;
18107 + ret = __raw_readw(map->map_priv_1 + ofs);
18108 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18109 + return ret;
18110 +}
18111 +
18112 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18113 +{
18114 + __u32 ret;
18115 + ret = __raw_readl(map->map_priv_1 + ofs);
18116 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18117 + return ret;
18118 +}
18119 +
18120 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18121 +{
18122 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18123 + memcpy_fromio(to, map->map_priv_1 + from, len);
18124 +}
18125 +
18126 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18127 +{
18128 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18129 + __raw_writeb(d, map->map_priv_1 + adr);
18130 + mb();
18131 +}
18132 +
18133 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18134 +{
18135 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18136 + __raw_writew(d, map->map_priv_1 + adr);
18137 + mb();
18138 +}
18139 +
18140 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18141 +{
18142 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18143 + __raw_writel(d, map->map_priv_1 + adr);
18144 + mb();
18145 +}
18146 +
18147 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18148 +{
18149 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18150 + memcpy_toio(map->map_priv_1 + to, from, len);
18151 +}
18152 +
18153 +static struct map_info mirage_map = {
18154 + name: "Mirage flash",
18155 + read8: physmap_read8,
18156 + read16: physmap_read16,
18157 + read32: physmap_read32,
18158 + copy_from: physmap_copy_from,
18159 + write8: physmap_write8,
18160 + write16: physmap_write16,
18161 + write32: physmap_write32,
18162 + copy_to: physmap_copy_to,
18163 +};
18164 +
18165 +static unsigned char flash_buswidth = 4;
18166 +
18167 +static struct mtd_partition mirage_partitions[] = {
18168 + {
18169 + name: "User FS",
18170 + size: 0x1c00000,
18171 + offset: 0x0000000
18172 + },{
18173 + name: "yamon",
18174 + size: 0x0100000,
18175 + offset: MTDPART_OFS_APPEND,
18176 + mask_flags: MTD_WRITEABLE
18177 + },{
18178 + name: "raw kernel",
18179 + size: (0x300000-0x40000), /* last 256KB is yamon env */
18180 + offset: MTDPART_OFS_APPEND,
18181 + }
18182 +};
18183 +
18184 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18185 +
18186 +static struct mtd_partition *parsed_parts;
18187 +static struct mtd_info *mymtd;
18188 +
18189 +/*
18190 + * Probe the flash density and setup window address and size
18191 + * based on user CONFIG options. There are times when we don't
18192 + * want the MTD driver to be probing the boot or user flash,
18193 + * so having the option to enable only one bank is important.
18194 + */
18195 +int setup_flash_params()
18196 +{
18197 + flash_size = 0x4000000; /* 64MB per part */
18198 + /* Boot ROM flash bank only; no user bank */
18199 + window_addr = 0x1C000000;
18200 + window_size = 0x4000000;
18201 + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
18202 + mirage_partitions[0].size = 0x3C00000;
18203 + return 0;
18204 +}
18205 +
18206 +int __init mirage_mtd_init(void)
18207 +{
18208 + struct mtd_partition *parts;
18209 + int nb_parts = 0;
18210 + char *part_type;
18211 +
18212 + /* Default flash buswidth */
18213 + mirage_map.buswidth = flash_buswidth;
18214 +
18215 + if (setup_flash_params())
18216 + return -ENXIO;
18217 +
18218 + /*
18219 + * Static partition definition selection
18220 + */
18221 + part_type = "static";
18222 + parts = mirage_partitions;
18223 + nb_parts = NB_OF(mirage_partitions);
18224 + mirage_map.size = window_size;
18225 +
18226 + /*
18227 + * Now let's probe for the actual flash. Do it here since
18228 + * specific machine settings might have been set above.
18229 + */
18230 + printk(KERN_NOTICE "Mirage flash: probing %d-bit flash bus\n",
18231 + mirage_map.buswidth*8);
18232 + mirage_map.map_priv_1 =
18233 + (unsigned long)ioremap(window_addr, window_size);
18234 + mymtd = do_map_probe("cfi_probe", &mirage_map);
18235 + if (!mymtd) return -ENXIO;
18236 + mymtd->module = THIS_MODULE;
18237 +
18238 + add_mtd_partitions(mymtd, parts, nb_parts);
18239 + return 0;
18240 +}
18241 +
18242 +static void __exit mirage_mtd_cleanup(void)
18243 +{
18244 + if (mymtd) {
18245 + del_mtd_partitions(mymtd);
18246 + map_destroy(mymtd);
18247 + if (parsed_parts)
18248 + kfree(parsed_parts);
18249 + }
18250 +}
18251 +
18252 +module_init(mirage_mtd_init);
18253 +module_exit(mirage_mtd_cleanup);
18254 +
18255 +MODULE_AUTHOR("Embedded Edge");
18256 +MODULE_DESCRIPTION("Mirage mtd map driver");
18257 +MODULE_LICENSE("GPL");
18258 diff -Nur linux-2.4.29/drivers/mtd/maps/mtx-1.c linux-mips/drivers/mtd/maps/mtx-1.c
18259 --- linux-2.4.29/drivers/mtd/maps/mtx-1.c 1970-01-01 01:00:00.000000000 +0100
18260 +++ linux-mips/drivers/mtd/maps/mtx-1.c 2003-06-27 02:04:35.000000000 +0200
18261 @@ -0,0 +1,181 @@
18262 +/*
18263 + * Flash memory access on 4G Systems MTX-1 board
18264 + *
18265 + * (C) 2003 Pete Popov <ppopov@mvista.com>
18266 + * Bruno Randolf <bruno.randolf@4g-systems.de>
18267 + */
18268 +
18269 +#include <linux/config.h>
18270 +#include <linux/module.h>
18271 +#include <linux/types.h>
18272 +#include <linux/kernel.h>
18273 +
18274 +#include <linux/mtd/mtd.h>
18275 +#include <linux/mtd/map.h>
18276 +#include <linux/mtd/partitions.h>
18277 +
18278 +#include <asm/io.h>
18279 +#include <asm/au1000.h>
18280 +
18281 +#ifdef DEBUG_RW
18282 +#define DBG(x...) printk(x)
18283 +#else
18284 +#define DBG(x...)
18285 +#endif
18286 +
18287 +#ifdef CONFIG_MIPS_MTX1
18288 +#define WINDOW_ADDR 0x1E000000
18289 +#define WINDOW_SIZE 0x2000000
18290 +#endif
18291 +
18292 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18293 +{
18294 + __u8 ret;
18295 + ret = __raw_readb(map->map_priv_1 + ofs);
18296 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18297 + return ret;
18298 +}
18299 +
18300 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18301 +{
18302 + __u16 ret;
18303 + ret = __raw_readw(map->map_priv_1 + ofs);
18304 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18305 + return ret;
18306 +}
18307 +
18308 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18309 +{
18310 + __u32 ret;
18311 + ret = __raw_readl(map->map_priv_1 + ofs);
18312 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18313 + return ret;
18314 +}
18315 +
18316 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18317 +{
18318 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18319 + memcpy_fromio(to, map->map_priv_1 + from, len);
18320 +}
18321 +
18322 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18323 +{
18324 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18325 + __raw_writeb(d, map->map_priv_1 + adr);
18326 + mb();
18327 +}
18328 +
18329 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18330 +{
18331 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18332 + __raw_writew(d, map->map_priv_1 + adr);
18333 + mb();
18334 +}
18335 +
18336 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18337 +{
18338 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18339 + __raw_writel(d, map->map_priv_1 + adr);
18340 + mb();
18341 +}
18342 +
18343 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18344 +{
18345 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18346 + memcpy_toio(map->map_priv_1 + to, from, len);
18347 +}
18348 +
18349 +
18350 +
18351 +static struct map_info mtx1_map = {
18352 + name: "MTX-1 flash",
18353 + read8: physmap_read8,
18354 + read16: physmap_read16,
18355 + read32: physmap_read32,
18356 + copy_from: physmap_copy_from,
18357 + write8: physmap_write8,
18358 + write16: physmap_write16,
18359 + write32: physmap_write32,
18360 + copy_to: physmap_copy_to,
18361 +};
18362 +
18363 +
18364 +static unsigned long flash_size = 0x01000000;
18365 +static unsigned char flash_buswidth = 4;
18366 +static struct mtd_partition mtx1_partitions[] = {
18367 + {
18368 + name: "user fs",
18369 + size: 0x1c00000,
18370 + offset: 0,
18371 + },{
18372 + name: "yamon",
18373 + size: 0x0100000,
18374 + offset: MTDPART_OFS_APPEND,
18375 + mask_flags: MTD_WRITEABLE
18376 + },{
18377 + name: "raw kernel",
18378 + size: 0x02c0000,
18379 + offset: MTDPART_OFS_APPEND,
18380 + },{
18381 + name: "yamon env vars",
18382 + size: 0x0040000,
18383 + offset: MTDPART_OFS_APPEND,
18384 + mask_flags: MTD_WRITEABLE
18385 + }
18386 +};
18387 +
18388 +
18389 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18390 +
18391 +static struct mtd_partition *parsed_parts;
18392 +static struct mtd_info *mymtd;
18393 +
18394 +int __init mtx1_mtd_init(void)
18395 +{
18396 + struct mtd_partition *parts;
18397 + int nb_parts = 0;
18398 + char *part_type;
18399 +
18400 + /* Default flash buswidth */
18401 + mtx1_map.buswidth = flash_buswidth;
18402 +
18403 + /*
18404 + * Static partition definition selection
18405 + */
18406 + part_type = "static";
18407 + parts = mtx1_partitions;
18408 + nb_parts = NB_OF(mtx1_partitions);
18409 + mtx1_map.size = flash_size;
18410 +
18411 + /*
18412 + * Now let's probe for the actual flash. Do it here since
18413 + * specific machine settings might have been set above.
18414 + */
18415 + printk(KERN_NOTICE "MTX-1 flash: probing %d-bit flash bus\n",
18416 + mtx1_map.buswidth*8);
18417 + mtx1_map.map_priv_1 =
18418 + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
18419 + mymtd = do_map_probe("cfi_probe", &mtx1_map);
18420 + if (!mymtd) return -ENXIO;
18421 + mymtd->module = THIS_MODULE;
18422 +
18423 + add_mtd_partitions(mymtd, parts, nb_parts);
18424 + return 0;
18425 +}
18426 +
18427 +static void __exit mtx1_mtd_cleanup(void)
18428 +{
18429 + if (mymtd) {
18430 + del_mtd_partitions(mymtd);
18431 + map_destroy(mymtd);
18432 + if (parsed_parts)
18433 + kfree(parsed_parts);
18434 + }
18435 +}
18436 +
18437 +module_init(mtx1_mtd_init);
18438 +module_exit(mtx1_mtd_cleanup);
18439 +
18440 +MODULE_AUTHOR("Pete Popov");
18441 +MODULE_DESCRIPTION("MTX-1 CFI map driver");
18442 +MODULE_LICENSE("GPL");
18443 diff -Nur linux-2.4.29/drivers/mtd/maps/pb1550-flash.c linux-mips/drivers/mtd/maps/pb1550-flash.c
18444 --- linux-2.4.29/drivers/mtd/maps/pb1550-flash.c 1970-01-01 01:00:00.000000000 +0100
18445 +++ linux-mips/drivers/mtd/maps/pb1550-flash.c 2004-02-26 01:48:48.000000000 +0100
18446 @@ -0,0 +1,270 @@
18447 +/*
18448 + * Flash memory access on Alchemy Pb1550 board
18449 + *
18450 + * (C) 2004 Embedded Edge, LLC, based on pb1550-flash.c:
18451 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
18452 + *
18453 + */
18454 +
18455 +#include <linux/config.h>
18456 +#include <linux/module.h>
18457 +#include <linux/types.h>
18458 +#include <linux/kernel.h>
18459 +
18460 +#include <linux/mtd/mtd.h>
18461 +#include <linux/mtd/map.h>
18462 +#include <linux/mtd/partitions.h>
18463 +
18464 +#include <asm/io.h>
18465 +#include <asm/au1000.h>
18466 +#include <asm/pb1550.h>
18467 +
18468 +#ifdef DEBUG_RW
18469 +#define DBG(x...) printk(x)
18470 +#else
18471 +#define DBG(x...)
18472 +#endif
18473 +
18474 +static unsigned long window_addr;
18475 +static unsigned long window_size;
18476 +
18477 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18478 +{
18479 + __u8 ret;
18480 + ret = __raw_readb(map->map_priv_1 + ofs);
18481 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18482 + return ret;
18483 +}
18484 +
18485 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18486 +{
18487 + __u16 ret;
18488 + ret = __raw_readw(map->map_priv_1 + ofs);
18489 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18490 + return ret;
18491 +}
18492 +
18493 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18494 +{
18495 + __u32 ret;
18496 + ret = __raw_readl(map->map_priv_1 + ofs);
18497 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18498 + return ret;
18499 +}
18500 +
18501 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18502 +{
18503 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18504 + memcpy_fromio(to, map->map_priv_1 + from, len);
18505 +}
18506 +
18507 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18508 +{
18509 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18510 + __raw_writeb(d, map->map_priv_1 + adr);
18511 + mb();
18512 +}
18513 +
18514 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18515 +{
18516 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18517 + __raw_writew(d, map->map_priv_1 + adr);
18518 + mb();
18519 +}
18520 +
18521 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18522 +{
18523 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18524 + __raw_writel(d, map->map_priv_1 + adr);
18525 + mb();
18526 +}
18527 +
18528 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18529 +{
18530 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18531 + memcpy_toio(map->map_priv_1 + to, from, len);
18532 +}
18533 +
18534 +static struct map_info pb1550_map = {
18535 + name: "Pb1550 flash",
18536 + read8: physmap_read8,
18537 + read16: physmap_read16,
18538 + read32: physmap_read32,
18539 + copy_from: physmap_copy_from,
18540 + write8: physmap_write8,
18541 + write16: physmap_write16,
18542 + write32: physmap_write32,
18543 + copy_to: physmap_copy_to,
18544 +};
18545 +
18546 +static unsigned char flash_buswidth = 4;
18547 +
18548 +/*
18549 + * Support only 64MB NOR Flash parts
18550 + */
18551 +
18552 +#ifdef PB1550_BOTH_BANKS
18553 +/* both banks will be used. Combine the first bank and the first
18554 + * part of the second bank together into a single jffs/jffs2
18555 + * partition.
18556 + */
18557 +static struct mtd_partition pb1550_partitions[] = {
18558 + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
18559 + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
18560 + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
18561 + */
18562 + {
18563 + name: "User FS",
18564 + size: (0x1FC00000 - 0x18000000),
18565 + offset: 0x0000000
18566 + },{
18567 + name: "yamon",
18568 + size: 0x0100000,
18569 + offset: MTDPART_OFS_APPEND,
18570 + mask_flags: MTD_WRITEABLE
18571 + },{
18572 + name: "raw kernel",
18573 + size: (0x300000 - 0x40000), /* last 256KB is yamon env */
18574 + offset: MTDPART_OFS_APPEND,
18575 + }
18576 +};
18577 +#elif defined(PB1550_BOOT_ONLY)
18578 +static struct mtd_partition pb1550_partitions[] = {
18579 + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
18580 + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
18581 + */
18582 + {
18583 + name: "User FS",
18584 + size: 0x03c00000,
18585 + offset: 0x0000000
18586 + },{
18587 + name: "yamon",
18588 + size: 0x0100000,
18589 + offset: MTDPART_OFS_APPEND,
18590 + mask_flags: MTD_WRITEABLE
18591 + },{
18592 + name: "raw kernel",
18593 + size: (0x300000-0x40000), /* last 256KB is yamon env */
18594 + offset: MTDPART_OFS_APPEND,
18595 + }
18596 +};
18597 +#elif defined(PB1550_USER_ONLY)
18598 +static struct mtd_partition pb1550_partitions[] = {
18599 + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
18600 + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
18601 + */
18602 + {
18603 + name: "User FS",
18604 + size: (0x4000000 - 0x200000), /* reserve 2MB for raw kernel */
18605 + offset: 0x0000000
18606 + },{
18607 + name: "raw kernel",
18608 + size: MTDPART_SIZ_FULL,
18609 + offset: MTDPART_OFS_APPEND,
18610 + }
18611 +};
18612 +#else
18613 +#error MTD_PB1550 define combo error /* should never happen */
18614 +#endif
18615 +
18616 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18617 +
18618 +static struct mtd_partition *parsed_parts;
18619 +static struct mtd_info *mymtd;
18620 +
18621 +/*
18622 + * Probe the flash density and setup window address and size
18623 + * based on user CONFIG options. There are times when we don't
18624 + * want the MTD driver to be probing the boot or user flash,
18625 + * so having the option to enable only one bank is important.
18626 + */
18627 +int setup_flash_params()
18628 +{
18629 + u16 boot_swapboot;
18630 + boot_swapboot = (au_readl(MEM_STSTAT) & (0x7<<1)) |
18631 + ((bcsr->status >> 6) & 0x1);
18632 + printk("Pb1550 MTD: boot:swap %d\n", boot_swapboot);
18633 +
18634 + switch (boot_swapboot) {
18635 + case 0: /* 512Mbit devices, both enabled */
18636 + case 1:
18637 + case 8:
18638 + case 9:
18639 +#if defined(PB1550_BOTH_BANKS)
18640 + window_addr = 0x18000000;
18641 + window_size = 0x8000000;
18642 +#elif defined(PB1550_BOOT_ONLY)
18643 + window_addr = 0x1C000000;
18644 + window_size = 0x4000000;
18645 +#else /* USER ONLY */
18646 + window_addr = 0x1E000000;
18647 + window_size = 0x1000000;
18648 +#endif
18649 + break;
18650 + case 0xC:
18651 + case 0xD:
18652 + case 0xE:
18653 + case 0xF:
18654 + /* 64 MB Boot NOR Flash is disabled */
18655 + /* and the start address is moved to 0x0C00000 */
18656 + window_addr = 0x0C000000;
18657 + window_size = 0x4000000;
18658 + default:
18659 + printk("Pb1550 MTD: unsupported boot:swap setting\n");
18660 + return 1;
18661 + }
18662 + return 0;
18663 +}
18664 +
18665 +int __init pb1550_mtd_init(void)
18666 +{
18667 + struct mtd_partition *parts;
18668 + int nb_parts = 0;
18669 + char *part_type;
18670 +
18671 + /* Default flash buswidth */
18672 + pb1550_map.buswidth = flash_buswidth;
18673 +
18674 + if (setup_flash_params())
18675 + return -ENXIO;
18676 +
18677 + /*
18678 + * Static partition definition selection
18679 + */
18680 + part_type = "static";
18681 + parts = pb1550_partitions;
18682 + nb_parts = NB_OF(pb1550_partitions);
18683 + pb1550_map.size = window_size;
18684 +
18685 + /*
18686 + * Now let's probe for the actual flash. Do it here since
18687 + * specific machine settings might have been set above.
18688 + */
18689 + printk(KERN_NOTICE "Pb1550 flash: probing %d-bit flash bus\n",
18690 + pb1550_map.buswidth*8);
18691 + pb1550_map.map_priv_1 =
18692 + (unsigned long)ioremap(window_addr, window_size);
18693 + mymtd = do_map_probe("cfi_probe", &pb1550_map);
18694 + if (!mymtd) return -ENXIO;
18695 + mymtd->module = THIS_MODULE;
18696 +
18697 + add_mtd_partitions(mymtd, parts, nb_parts);
18698 + return 0;
18699 +}
18700 +
18701 +static void __exit pb1550_mtd_cleanup(void)
18702 +{
18703 + if (mymtd) {
18704 + del_mtd_partitions(mymtd);
18705 + map_destroy(mymtd);
18706 + if (parsed_parts)
18707 + kfree(parsed_parts);
18708 + }
18709 +}
18710 +
18711 +module_init(pb1550_mtd_init);
18712 +module_exit(pb1550_mtd_cleanup);
18713 +
18714 +MODULE_AUTHOR("Embedded Edge, LLC");
18715 +MODULE_DESCRIPTION("Pb1550 mtd map driver");
18716 +MODULE_LICENSE("GPL");
18717 diff -Nur linux-2.4.29/drivers/mtd/maps/pb1xxx-flash.c linux-mips/drivers/mtd/maps/pb1xxx-flash.c
18718 --- linux-2.4.29/drivers/mtd/maps/pb1xxx-flash.c 2003-06-13 16:51:34.000000000 +0200
18719 +++ linux-mips/drivers/mtd/maps/pb1xxx-flash.c 2003-05-19 08:27:22.000000000 +0200
18720 @@ -192,6 +192,34 @@
18721 #else
18722 #error MTD_PB1500 define combo error /* should never happen */
18723 #endif
18724 +#elif defined(CONFIG_MTD_BOSPORUS)
18725 +static unsigned char flash_buswidth = 2;
18726 +static unsigned long flash_size = 0x02000000;
18727 +#define WINDOW_ADDR 0x1F000000
18728 +#define WINDOW_SIZE 0x2000000
18729 +static struct mtd_partition pb1xxx_partitions[] = {
18730 + {
18731 + name: "User FS",
18732 + size: 0x00400000,
18733 + offset: 0x00000000,
18734 + },{
18735 + name: "Yamon-2",
18736 + size: 0x00100000,
18737 + offset: 0x00400000,
18738 + },{
18739 + name: "Root FS",
18740 + size: 0x00700000,
18741 + offset: 0x00500000,
18742 + },{
18743 + name: "Yamon-1",
18744 + size: 0x00100000,
18745 + offset: 0x00C00000,
18746 + },{
18747 + name: "Kernel",
18748 + size: 0x00300000,
18749 + offset: 0x00D00000,
18750 + }
18751 +};
18752 #else
18753 #error Unsupported board
18754 #endif
18755 diff -Nur linux-2.4.29/drivers/mtd/maps/xxs1500.c linux-mips/drivers/mtd/maps/xxs1500.c
18756 --- linux-2.4.29/drivers/mtd/maps/xxs1500.c 1970-01-01 01:00:00.000000000 +0100
18757 +++ linux-mips/drivers/mtd/maps/xxs1500.c 2003-08-02 04:06:01.000000000 +0200
18758 @@ -0,0 +1,186 @@
18759 +/*
18760 + * Flash memory access on MyCable XXS1500 board
18761 + *
18762 + * (C) 2003 Pete Popov <ppopov@mvista.com>
18763 + *
18764 + * $Id$
18765 + */
18766 +
18767 +#include <linux/config.h>
18768 +#include <linux/module.h>
18769 +#include <linux/types.h>
18770 +#include <linux/kernel.h>
18771 +
18772 +#include <linux/mtd/mtd.h>
18773 +#include <linux/mtd/map.h>
18774 +#include <linux/mtd/partitions.h>
18775 +
18776 +#include <asm/io.h>
18777 +#include <asm/au1000.h>
18778 +
18779 +#ifdef DEBUG_RW
18780 +#define DBG(x...) printk(x)
18781 +#else
18782 +#define DBG(x...)
18783 +#endif
18784 +
18785 +#ifdef CONFIG_MIPS_XXS1500
18786 +#define WINDOW_ADDR 0x1F000000
18787 +#define WINDOW_SIZE 0x1000000
18788 +#endif
18789 +
18790 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18791 +{
18792 + __u8 ret;
18793 + ret = __raw_readb(map->map_priv_1 + ofs);
18794 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18795 + return ret;
18796 +}
18797 +
18798 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18799 +{
18800 + __u16 ret;
18801 + ret = __raw_readw(map->map_priv_1 + ofs);
18802 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18803 + return ret;
18804 +}
18805 +
18806 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18807 +{
18808 + __u32 ret;
18809 + ret = __raw_readl(map->map_priv_1 + ofs);
18810 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18811 + return ret;
18812 +}
18813 +
18814 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18815 +{
18816 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18817 + memcpy_fromio(to, map->map_priv_1 + from, len);
18818 +}
18819 +
18820 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18821 +{
18822 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18823 + __raw_writeb(d, map->map_priv_1 + adr);
18824 + mb();
18825 +}
18826 +
18827 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18828 +{
18829 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18830 + __raw_writew(d, map->map_priv_1 + adr);
18831 + mb();
18832 +}
18833 +
18834 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18835 +{
18836 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18837 + __raw_writel(d, map->map_priv_1 + adr);
18838 + mb();
18839 +}
18840 +
18841 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18842 +{
18843 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18844 + memcpy_toio(map->map_priv_1 + to, from, len);
18845 +}
18846 +
18847 +
18848 +
18849 +static struct map_info xxs1500_map = {
18850 + name: "XXS1500 flash",
18851 + read8: physmap_read8,
18852 + read16: physmap_read16,
18853 + read32: physmap_read32,
18854 + copy_from: physmap_copy_from,
18855 + write8: physmap_write8,
18856 + write16: physmap_write16,
18857 + write32: physmap_write32,
18858 + copy_to: physmap_copy_to,
18859 +};
18860 +
18861 +
18862 +static unsigned long flash_size = 0x00800000;
18863 +static unsigned char flash_buswidth = 4;
18864 +static struct mtd_partition xxs1500_partitions[] = {
18865 + {
18866 + name: "kernel image",
18867 + size: 0x00200000,
18868 + offset: 0,
18869 + },{
18870 + name: "user fs 0",
18871 + size: (0x00C00000-0x200000),
18872 + offset: MTDPART_OFS_APPEND,
18873 + },{
18874 + name: "yamon",
18875 + size: 0x00100000,
18876 + offset: MTDPART_OFS_APPEND,
18877 + mask_flags: MTD_WRITEABLE
18878 + },{
18879 + name: "user fs 1",
18880 + size: 0x2c0000,
18881 + offset: MTDPART_OFS_APPEND,
18882 + },{
18883 + name: "yamon env vars",
18884 + size: 0x040000,
18885 + offset: MTDPART_OFS_APPEND,
18886 + mask_flags: MTD_WRITEABLE
18887 + }
18888 +};
18889 +
18890 +
18891 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18892 +
18893 +static struct mtd_partition *parsed_parts;
18894 +static struct mtd_info *mymtd;
18895 +
18896 +int __init xxs1500_mtd_init(void)
18897 +{
18898 + struct mtd_partition *parts;
18899 + int nb_parts = 0;
18900 + char *part_type;
18901 +
18902 + /* Default flash buswidth */
18903 + xxs1500_map.buswidth = flash_buswidth;
18904 +
18905 + /*
18906 + * Static partition definition selection
18907 + */
18908 + part_type = "static";
18909 + parts = xxs1500_partitions;
18910 + nb_parts = NB_OF(xxs1500_partitions);
18911 + xxs1500_map.size = flash_size;
18912 +
18913 + /*
18914 + * Now let's probe for the actual flash. Do it here since
18915 + * specific machine settings might have been set above.
18916 + */
18917 + printk(KERN_NOTICE "XXS1500 flash: probing %d-bit flash bus\n",
18918 + xxs1500_map.buswidth*8);
18919 + xxs1500_map.map_priv_1 =
18920 + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
18921 + mymtd = do_map_probe("cfi_probe", &xxs1500_map);
18922 + if (!mymtd) return -ENXIO;
18923 + mymtd->module = THIS_MODULE;
18924 +
18925 + add_mtd_partitions(mymtd, parts, nb_parts);
18926 + return 0;
18927 +}
18928 +
18929 +static void __exit xxs1500_mtd_cleanup(void)
18930 +{
18931 + if (mymtd) {
18932 + del_mtd_partitions(mymtd);
18933 + map_destroy(mymtd);
18934 + if (parsed_parts)
18935 + kfree(parsed_parts);
18936 + }
18937 +}
18938 +
18939 +module_init(xxs1500_mtd_init);
18940 +module_exit(xxs1500_mtd_cleanup);
18941 +
18942 +MODULE_AUTHOR("Pete Popov");
18943 +MODULE_DESCRIPTION("XXS1500 CFI map driver");
18944 +MODULE_LICENSE("GPL");
18945 diff -Nur linux-2.4.29/drivers/net/defxx.c linux-mips/drivers/net/defxx.c
18946 --- linux-2.4.29/drivers/net/defxx.c 2004-11-17 12:54:21.000000000 +0100
18947 +++ linux-mips/drivers/net/defxx.c 2004-11-19 01:28:39.000000000 +0100
18948 @@ -10,24 +10,18 @@
18949 *
18950 * Abstract:
18951 * A Linux device driver supporting the Digital Equipment Corporation
18952 - * FDDI EISA and PCI controller families. Supported adapters include:
18953 + * FDDI TURBOchannel, EISA and PCI controller families. Supported
18954 + * adapters include:
18955 *
18956 - * DEC FDDIcontroller/EISA (DEFEA)
18957 - * DEC FDDIcontroller/PCI (DEFPA)
18958 + * DEC FDDIcontroller/TURBOchannel (DEFTA)
18959 + * DEC FDDIcontroller/EISA (DEFEA)
18960 + * DEC FDDIcontroller/PCI (DEFPA)
18961 *
18962 - * Maintainers:
18963 - * LVS Lawrence V. Stefani
18964 - *
18965 - * Contact:
18966 - * The author may be reached at:
18967 + * The original author:
18968 + * LVS Lawrence V. Stefani <lstefani@yahoo.com>
18969 *
18970 - * Inet: stefani@lkg.dec.com
18971 - * (NOTE! this address no longer works -jgarzik)
18972 - *
18973 - * Mail: Digital Equipment Corporation
18974 - * 550 King Street
18975 - * M/S: LKG1-3/M07
18976 - * Littleton, MA 01460
18977 + * Maintainers:
18978 + * macro Maciej W. Rozycki <macro@linux-mips.org>
18979 *
18980 * Credits:
18981 * I'd like to thank Patricia Cross for helping me get started with
18982 @@ -197,16 +191,16 @@
18983 * Sep 2000 tjeerd Fix leak on unload, cosmetic code cleanup
18984 * Feb 2001 Skb allocation fixes
18985 * Feb 2001 davej PCI enable cleanups.
18986 + * 04 Aug 2003 macro Converted to the DMA API.
18987 + * 14 Aug 2004 macro Fix device names reported.
18988 + * 26 Sep 2004 macro TURBOchannel support.
18989 */
18990
18991 /* Include files */
18992
18993 #include <linux/module.h>
18994 -
18995 #include <linux/kernel.h>
18996 -#include <linux/sched.h>
18997 #include <linux/string.h>
18998 -#include <linux/ptrace.h>
18999 #include <linux/errno.h>
19000 #include <linux/ioport.h>
19001 #include <linux/slab.h>
19002 @@ -215,19 +209,33 @@
19003 #include <linux/delay.h>
19004 #include <linux/init.h>
19005 #include <linux/netdevice.h>
19006 +#include <linux/fddidevice.h>
19007 +#include <linux/skbuff.h>
19008 +
19009 #include <asm/byteorder.h>
19010 #include <asm/bitops.h>
19011 #include <asm/io.h>
19012
19013 -#include <linux/fddidevice.h>
19014 -#include <linux/skbuff.h>
19015 +#ifdef CONFIG_TC
19016 +#include <asm/dec/tc.h>
19017 +#else
19018 +static int search_tc_card(const char *name) { return -ENODEV; }
19019 +static void claim_tc_card(int slot) { }
19020 +static void release_tc_card(int slot) { }
19021 +static unsigned long get_tc_base_addr(int slot) { return 0; }
19022 +static unsigned long get_tc_irq_nr(int slot) { return -1; }
19023 +#endif
19024
19025 #include "defxx.h"
19026
19027 -/* Version information string - should be updated prior to each new release!!! */
19028 +/* Version information string should be updated prior to each new release! */
19029 +#define DRV_NAME "defxx"
19030 +#define DRV_VERSION "v1.07T"
19031 +#define DRV_RELDATE "2004/09/26"
19032
19033 static char version[] __devinitdata =
19034 - "defxx.c:v1.05e 2001/02/03 Lawrence V. Stefani and others\n";
19035 + DRV_NAME ": " DRV_VERSION " " DRV_RELDATE
19036 + " Lawrence V. Stefani and others\n";
19037
19038 #define DYNAMIC_BUFFERS 1
19039
19040 @@ -243,7 +251,7 @@
19041 static void dfx_bus_init(struct net_device *dev);
19042 static void dfx_bus_config_check(DFX_board_t *bp);
19043
19044 -static int dfx_driver_init(struct net_device *dev);
19045 +static int dfx_driver_init(struct net_device *dev, const char *print_name);
19046 static int dfx_adap_init(DFX_board_t *bp, int get_buffers);
19047
19048 static int dfx_open(struct net_device *dev);
19049 @@ -337,48 +345,84 @@
19050 int offset,
19051 u8 data
19052 )
19053 +{
19054 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19055 + {
19056 + volatile u8 *addr = (void *)(bp->base_addr + offset);
19057
19058 + *addr = data;
19059 + mb();
19060 + }
19061 + else
19062 {
19063 u16 port = bp->base_addr + offset;
19064
19065 outb(data, port);
19066 }
19067 +}
19068
19069 static inline void dfx_port_read_byte(
19070 DFX_board_t *bp,
19071 int offset,
19072 u8 *data
19073 )
19074 +{
19075 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19076 + {
19077 + volatile u8 *addr = (void *)(bp->base_addr + offset);
19078
19079 + mb();
19080 + *data = *addr;
19081 + }
19082 + else
19083 {
19084 u16 port = bp->base_addr + offset;
19085
19086 *data = inb(port);
19087 }
19088 +}
19089
19090 static inline void dfx_port_write_long(
19091 DFX_board_t *bp,
19092 int offset,
19093 u32 data
19094 )
19095 +{
19096 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19097 + {
19098 + volatile u32 *addr = (void *)(bp->base_addr + offset);
19099
19100 + *addr = data;
19101 + mb();
19102 + }
19103 + else
19104 {
19105 u16 port = bp->base_addr + offset;
19106
19107 outl(data, port);
19108 }
19109 +}
19110
19111 static inline void dfx_port_read_long(
19112 DFX_board_t *bp,
19113 int offset,
19114 u32 *data
19115 )
19116 +{
19117 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19118 + {
19119 + volatile u32 *addr = (void *)(bp->base_addr + offset);
19120
19121 + mb();
19122 + *data = *addr;
19123 + }
19124 + else
19125 {
19126 u16 port = bp->base_addr + offset;
19127
19128 *data = inl(port);
19129 }
19130 +}
19131
19132 \f
19133 /*
19134 @@ -393,8 +437,9 @@
19135 * Condition code
19136 *
19137 * Arguments:
19138 - * pdev - pointer to pci device information (NULL for EISA)
19139 - * ioaddr - pointer to port (NULL for PCI)
19140 + * pdev - pointer to pci device information (NULL for EISA or TURBOchannel)
19141 + * bus_type - bus type (one of DFX_BUS_TYPE_*)
19142 + * handle - bus-specific data: slot (TC), pointer to port (EISA), NULL (PCI)
19143 *
19144 * Functional Description:
19145 *
19146 @@ -410,54 +455,68 @@
19147 * initialized and the board resources are read and stored in
19148 * the device structure.
19149 */
19150 -static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
19151 +static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, u32 bus_type, long handle)
19152 {
19153 + static int version_disp;
19154 + char *print_name = DRV_NAME;
19155 struct net_device *dev;
19156 DFX_board_t *bp; /* board pointer */
19157 + long ioaddr; /* pointer to port */
19158 + unsigned long len; /* resource length */
19159 + int alloc_size; /* total buffer size used */
19160 int err;
19161
19162 -#ifndef MODULE
19163 - static int version_disp;
19164 -
19165 - if (!version_disp) /* display version info if adapter is found */
19166 - {
19167 + if (!version_disp) { /* display version info if adapter is found */
19168 version_disp = 1; /* set display flag to TRUE so that */
19169 printk(version); /* we only display this string ONCE */
19170 }
19171 -#endif
19172
19173 - /*
19174 - * init_fddidev() allocates a device structure with private data, clears the device structure and private data,
19175 - * and calls fddi_setup() and register_netdev(). Not much left to do for us here.
19176 - */
19177 - dev = init_fddidev(NULL, sizeof(*bp));
19178 + if (pdev != NULL)
19179 + print_name = pdev->slot_name;
19180 +
19181 + dev = alloc_fddidev(sizeof(*bp));
19182 if (!dev) {
19183 - printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
19184 + printk(KERN_ERR "%s: unable to allocate fddidev, aborting\n",
19185 + print_name);
19186 return -ENOMEM;
19187 }
19188
19189 /* Enable PCI device. */
19190 - if (pdev != NULL) {
19191 + if (bus_type == DFX_BUS_TYPE_PCI) {
19192 err = pci_enable_device (pdev);
19193 if (err) goto err_out;
19194 ioaddr = pci_resource_start (pdev, 1);
19195 }
19196
19197 SET_MODULE_OWNER(dev);
19198 + SET_NETDEV_DEV(dev, &pdev->dev);
19199
19200 bp = dev->priv;
19201
19202 - if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) {
19203 - printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n",
19204 - dev->name, PFI_K_CSR_IO_LEN, ioaddr);
19205 + if (bus_type == DFX_BUS_TYPE_TC) {
19206 + /* TURBOchannel board */
19207 + bp->slot = handle;
19208 + claim_tc_card(bp->slot);
19209 + ioaddr = get_tc_base_addr(handle) + PI_TC_K_CSR_OFFSET;
19210 + len = PI_TC_K_CSR_LEN;
19211 + } else if (bus_type == DFX_BUS_TYPE_EISA) {
19212 + /* EISA board */
19213 + ioaddr = handle;
19214 + len = PI_ESIC_K_CSR_IO_LEN;
19215 + } else
19216 + /* PCI board */
19217 + len = PFI_K_CSR_IO_LEN;
19218 + dev->base_addr = ioaddr; /* save port (I/O) base address */
19219 +
19220 + if (!request_region(ioaddr, len, print_name)) {
19221 + printk(KERN_ERR "%s: Cannot reserve I/O resource "
19222 + "0x%lx @ 0x%lx, aborting\n", print_name, len, ioaddr);
19223 err = -EBUSY;
19224 goto err_out;
19225 }
19226
19227 /* Initialize new device structure */
19228
19229 - dev->base_addr = ioaddr; /* save port (I/O) base address */
19230 -
19231 dev->get_stats = dfx_ctl_get_stats;
19232 dev->open = dfx_open;
19233 dev->stop = dfx_close;
19234 @@ -465,37 +524,54 @@
19235 dev->set_multicast_list = dfx_ctl_set_multicast_list;
19236 dev->set_mac_address = dfx_ctl_set_mac_address;
19237
19238 - if (pdev == NULL) {
19239 - /* EISA board */
19240 - bp->bus_type = DFX_BUS_TYPE_EISA;
19241 + bp->bus_type = bus_type;
19242 + if (bus_type == DFX_BUS_TYPE_TC || bus_type == DFX_BUS_TYPE_EISA) {
19243 + /* TURBOchannel or EISA board */
19244 bp->next = root_dfx_eisa_dev;
19245 root_dfx_eisa_dev = dev;
19246 } else {
19247 /* PCI board */
19248 - bp->bus_type = DFX_BUS_TYPE_PCI;
19249 bp->pci_dev = pdev;
19250 pci_set_drvdata (pdev, dev);
19251 pci_set_master (pdev);
19252 }
19253
19254 - if (dfx_driver_init(dev) != DFX_K_SUCCESS) {
19255 +
19256 + if (dfx_driver_init(dev, print_name) != DFX_K_SUCCESS) {
19257 err = -ENODEV;
19258 goto err_out_region;
19259 }
19260
19261 + err = register_netdev(dev);
19262 + if (err)
19263 + goto err_out_kfree;
19264 +
19265 + printk("%s: registered as %s\n", print_name, dev->name);
19266 return 0;
19267
19268 +err_out_kfree:
19269 + alloc_size = sizeof(PI_DESCR_BLOCK) +
19270 + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
19271 +#ifndef DYNAMIC_BUFFERS
19272 + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
19273 +#endif
19274 + sizeof(PI_CONSUMER_BLOCK) +
19275 + (PI_ALIGN_K_DESC_BLK - 1);
19276 + if (bp->kmalloced)
19277 + pci_free_consistent(pdev, alloc_size,
19278 + bp->kmalloced, bp->kmalloced_dma);
19279 err_out_region:
19280 - release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
19281 + release_region(ioaddr, len);
19282 err_out:
19283 - unregister_netdev(dev);
19284 - kfree(dev);
19285 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19286 + release_tc_card(bp->slot);
19287 + free_netdev(dev);
19288 return err;
19289 }
19290
19291 static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
19292 {
19293 - return dfx_init_one_pci_or_eisa(pdev, 0);
19294 + return dfx_init_one_pci_or_eisa(pdev, DFX_BUS_TYPE_PCI, 0);
19295 }
19296
19297 static int __init dfx_eisa_init(void)
19298 @@ -507,6 +583,7 @@
19299
19300 DBG_printk("In dfx_eisa_init...\n");
19301
19302 +#ifdef CONFIG_EISA
19303 /* Scan for FDDI EISA controllers */
19304
19305 for (i=0; i < DFX_MAX_EISA_SLOTS; i++) /* only scan for up to 16 EISA slots */
19306 @@ -517,9 +594,27 @@
19307 {
19308 port = (i << 12); /* recalc base addr */
19309
19310 - if (dfx_init_one_pci_or_eisa(NULL, port) == 0) rc = 0;
19311 + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_EISA, port) == 0) rc = 0;
19312 }
19313 }
19314 +#endif
19315 + return rc;
19316 +}
19317 +
19318 +static int __init dfx_tc_init(void)
19319 +{
19320 + int rc = -ENODEV;
19321 + int slot; /* TC slot number */
19322 +
19323 + DBG_printk("In dfx_tc_init...\n");
19324 +
19325 + /* Scan for FDDI TC controllers */
19326 + while ((slot = search_tc_card("PMAF-F")) >= 0) {
19327 + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_TC, slot) == 0)
19328 + rc = 0;
19329 + else
19330 + break;
19331 + }
19332 return rc;
19333 }
19334 \f
19335 @@ -583,8 +678,9 @@
19336
19337 /* Initialize adapter based on bus type */
19338
19339 - if (bp->bus_type == DFX_BUS_TYPE_EISA)
19340 - {
19341 + if (bp->bus_type == DFX_BUS_TYPE_TC) {
19342 + dev->irq = get_tc_irq_nr(bp->slot);
19343 + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
19344 /* Get the interrupt level from the ESIC chip */
19345
19346 dfx_port_read_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, &val);
19347 @@ -766,6 +862,7 @@
19348 *
19349 * Arguments:
19350 * dev - pointer to device information
19351 + * print_name - printable device name
19352 *
19353 * Functional Description:
19354 * This function allocates additional resources such as the host memory
19355 @@ -780,20 +877,21 @@
19356 * or read adapter MAC address
19357 *
19358 * Assumptions:
19359 - * Memory allocated from kmalloc() call is physically contiguous, locked
19360 - * memory whose physical address equals its virtual address.
19361 + * Memory allocated from pci_alloc_consistent() call is physically
19362 + * contiguous, locked memory.
19363 *
19364 * Side Effects:
19365 * Adapter is reset and should be in DMA_UNAVAILABLE state before
19366 * returning from this routine.
19367 */
19368
19369 -static int __devinit dfx_driver_init(struct net_device *dev)
19370 +static int __devinit dfx_driver_init(struct net_device *dev,
19371 + const char *print_name)
19372 {
19373 DFX_board_t *bp = dev->priv;
19374 int alloc_size; /* total buffer size needed */
19375 char *top_v, *curr_v; /* virtual addrs into memory block */
19376 - u32 top_p, curr_p; /* physical addrs into memory block */
19377 + dma_addr_t top_p, curr_p; /* physical addrs into memory block */
19378 u32 data; /* host data register value */
19379
19380 DBG_printk("In dfx_driver_init...\n");
19381 @@ -837,26 +935,20 @@
19382
19383 /* Read the factory MAC address from the adapter then save it */
19384
19385 - if (dfx_hw_port_ctrl_req(bp,
19386 - PI_PCTRL_M_MLA,
19387 - PI_PDATA_A_MLA_K_LO,
19388 - 0,
19389 - &data) != DFX_K_SUCCESS)
19390 - {
19391 - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
19392 + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_LO, 0,
19393 + &data) != DFX_K_SUCCESS) {
19394 + printk("%s: Could not read adapter factory MAC address!\n",
19395 + print_name);
19396 return(DFX_K_FAILURE);
19397 - }
19398 + }
19399 memcpy(&bp->factory_mac_addr[0], &data, sizeof(u32));
19400
19401 - if (dfx_hw_port_ctrl_req(bp,
19402 - PI_PCTRL_M_MLA,
19403 - PI_PDATA_A_MLA_K_HI,
19404 - 0,
19405 - &data) != DFX_K_SUCCESS)
19406 - {
19407 - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
19408 + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_HI, 0,
19409 + &data) != DFX_K_SUCCESS) {
19410 + printk("%s: Could not read adapter factory MAC address!\n",
19411 + print_name);
19412 return(DFX_K_FAILURE);
19413 - }
19414 + }
19415 memcpy(&bp->factory_mac_addr[4], &data, sizeof(u16));
19416
19417 /*
19418 @@ -867,28 +959,27 @@
19419 */
19420
19421 memcpy(dev->dev_addr, bp->factory_mac_addr, FDDI_K_ALEN);
19422 - if (bp->bus_type == DFX_BUS_TYPE_EISA)
19423 - printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
19424 - dev->name,
19425 - dev->base_addr,
19426 - dev->irq,
19427 - dev->dev_addr[0],
19428 - dev->dev_addr[1],
19429 - dev->dev_addr[2],
19430 - dev->dev_addr[3],
19431 - dev->dev_addr[4],
19432 - dev->dev_addr[5]);
19433 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19434 + printk("%s: DEFTA at addr = 0x%lX, IRQ = %d, "
19435 + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
19436 + print_name, dev->base_addr, dev->irq,
19437 + dev->dev_addr[0], dev->dev_addr[1],
19438 + dev->dev_addr[2], dev->dev_addr[3],
19439 + dev->dev_addr[4], dev->dev_addr[5]);
19440 + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
19441 + printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, "
19442 + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
19443 + print_name, dev->base_addr, dev->irq,
19444 + dev->dev_addr[0], dev->dev_addr[1],
19445 + dev->dev_addr[2], dev->dev_addr[3],
19446 + dev->dev_addr[4], dev->dev_addr[5]);
19447 else
19448 - printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
19449 - dev->name,
19450 - dev->base_addr,
19451 - dev->irq,
19452 - dev->dev_addr[0],
19453 - dev->dev_addr[1],
19454 - dev->dev_addr[2],
19455 - dev->dev_addr[3],
19456 - dev->dev_addr[4],
19457 - dev->dev_addr[5]);
19458 + printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, "
19459 + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
19460 + print_name, dev->base_addr, dev->irq,
19461 + dev->dev_addr[0], dev->dev_addr[1],
19462 + dev->dev_addr[2], dev->dev_addr[3],
19463 + dev->dev_addr[4], dev->dev_addr[5]);
19464
19465 /*
19466 * Get memory for descriptor block, consumer block, and other buffers
19467 @@ -903,14 +994,15 @@
19468 #endif
19469 sizeof(PI_CONSUMER_BLOCK) +
19470 (PI_ALIGN_K_DESC_BLK - 1);
19471 - bp->kmalloced = top_v = (char *) kmalloc(alloc_size, GFP_KERNEL);
19472 - if (top_v == NULL)
19473 - {
19474 - printk("%s: Could not allocate memory for host buffers and structures!\n", dev->name);
19475 + bp->kmalloced = top_v = pci_alloc_consistent(bp->pci_dev, alloc_size,
19476 + &bp->kmalloced_dma);
19477 + if (top_v == NULL) {
19478 + printk("%s: Could not allocate memory for host buffers "
19479 + "and structures!\n", print_name);
19480 return(DFX_K_FAILURE);
19481 - }
19482 + }
19483 memset(top_v, 0, alloc_size); /* zero out memory before continuing */
19484 - top_p = virt_to_bus(top_v); /* get physical address of buffer */
19485 + top_p = bp->kmalloced_dma; /* get physical address of buffer */
19486
19487 /*
19488 * To guarantee the 8K alignment required for the descriptor block, 8K - 1
19489 @@ -924,7 +1016,7 @@
19490 * for allocating the needed memory.
19491 */
19492
19493 - curr_p = (u32) (ALIGN(top_p, PI_ALIGN_K_DESC_BLK));
19494 + curr_p = ALIGN(top_p, PI_ALIGN_K_DESC_BLK);
19495 curr_v = top_v + (curr_p - top_p);
19496
19497 /* Reserve space for descriptor block */
19498 @@ -965,14 +1057,20 @@
19499
19500 /* Display virtual and physical addresses if debug driver */
19501
19502 - DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n", dev->name, (long)bp->descr_block_virt, bp->descr_block_phys);
19503 - DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
19504 - DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
19505 - DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
19506 - DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->cons_block_virt, bp->cons_block_phys);
19507 + DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n",
19508 + print_name,
19509 + (long)bp->descr_block_virt, bp->descr_block_phys);
19510 + DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n",
19511 + print_name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
19512 + DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n",
19513 + print_name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
19514 + DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n",
19515 + print_name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
19516 + DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n",
19517 + print_name, (long)bp->cons_block_virt, bp->cons_block_phys);
19518
19519 return(DFX_K_SUCCESS);
19520 - }
19521 +}
19522
19523 \f
19524 /*
19525 @@ -1218,7 +1316,9 @@
19526
19527 /* Register IRQ - support shared interrupts by passing device ptr */
19528
19529 - ret = request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev);
19530 + ret = request_irq(dev->irq, (void *)dfx_interrupt,
19531 + (bp->bus_type == DFX_BUS_TYPE_TC) ? 0 : SA_SHIRQ,
19532 + dev->name, dev);
19533 if (ret) {
19534 printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
19535 return ret;
19536 @@ -1737,7 +1837,7 @@
19537 dfx_port_write_long(bp, PFI_K_REG_MODE_CTRL,
19538 (PFI_MODE_M_PDQ_INT_ENB + PFI_MODE_M_DMA_ENB));
19539 }
19540 - else
19541 + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
19542 {
19543 /* Disable interrupts at the ESIC */
19544
19545 @@ -1755,6 +1855,13 @@
19546 tmp |= PI_CONFIG_STAT_0_M_INT_ENB;
19547 dfx_port_write_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, tmp);
19548 }
19549 + else {
19550 + /* TC doesn't share interrupts so no need to disable them */
19551 +
19552 + /* Call interrupt service routine for this adapter */
19553 +
19554 + dfx_int_common(dev);
19555 + }
19556
19557 spin_unlock(&bp->lock);
19558 }
19559 @@ -2663,12 +2770,12 @@
19560
19561 static void my_skb_align(struct sk_buff *skb, int n)
19562 {
19563 - u32 x=(u32)skb->data; /* We only want the low bits .. */
19564 - u32 v;
19565 + unsigned long x = (unsigned long)skb->data;
19566 + unsigned long v;
19567
19568 - v=(x+n-1)&~(n-1); /* Where we want to be */
19569 + v = ALIGN(x, n); /* Where we want to be */
19570
19571 - skb_reserve(skb, v-x);
19572 + skb_reserve(skb, v - x);
19573 }
19574
19575 \f
19576 @@ -2745,7 +2852,10 @@
19577 */
19578
19579 my_skb_align(newskb, 128);
19580 - bp->descr_block_virt->rcv_data[i+j].long_1 = virt_to_bus(newskb->data);
19581 + bp->descr_block_virt->rcv_data[i + j].long_1 =
19582 + (u32)pci_map_single(bp->pci_dev, newskb->data,
19583 + NEW_SKB_SIZE,
19584 + PCI_DMA_FROMDEVICE);
19585 /*
19586 * p_rcv_buff_va is only used inside the
19587 * kernel so we put the skb pointer here.
19588 @@ -2859,9 +2969,17 @@
19589
19590 my_skb_align(newskb, 128);
19591 skb = (struct sk_buff *)bp->p_rcv_buff_va[entry];
19592 + pci_unmap_single(bp->pci_dev,
19593 + bp->descr_block_virt->rcv_data[entry].long_1,
19594 + NEW_SKB_SIZE,
19595 + PCI_DMA_FROMDEVICE);
19596 skb_reserve(skb, RCV_BUFF_K_PADDING);
19597 bp->p_rcv_buff_va[entry] = (char *)newskb;
19598 - bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data);
19599 + bp->descr_block_virt->rcv_data[entry].long_1 =
19600 + (u32)pci_map_single(bp->pci_dev,
19601 + newskb->data,
19602 + NEW_SKB_SIZE,
19603 + PCI_DMA_FROMDEVICE);
19604 } else
19605 skb = NULL;
19606 } else
19607 @@ -2934,7 +3052,7 @@
19608 * is contained in a single physically contiguous buffer
19609 * in which the virtual address of the start of packet
19610 * (skb->data) can be converted to a physical address
19611 - * by using virt_to_bus().
19612 + * by using pci_map_single().
19613 *
19614 * Since the adapter architecture requires a three byte
19615 * packet request header to prepend the start of packet,
19616 @@ -3082,12 +3200,13 @@
19617 * skb->data.
19618 * 6. The physical address of the start of packet
19619 * can be determined from the virtual address
19620 - * by using virt_to_bus() and is only 32-bits
19621 + * by using pci_map_single() and is only 32-bits
19622 * wide.
19623 */
19624
19625 p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN));
19626 - p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data);
19627 + p_xmt_descr->long_1 = (u32)pci_map_single(bp->pci_dev, skb->data,
19628 + skb->len, PCI_DMA_TODEVICE);
19629
19630 /*
19631 * Verify that descriptor is actually available
19632 @@ -3171,6 +3290,7 @@
19633 {
19634 XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
19635 PI_TYPE_2_CONSUMER *p_type_2_cons; /* ptr to rcv/xmt consumer block register */
19636 + u8 comp; /* local transmit completion index */
19637 int freed = 0; /* buffers freed */
19638
19639 /* Service all consumed transmit frames */
19640 @@ -3188,7 +3308,11 @@
19641 bp->xmt_total_bytes += p_xmt_drv_descr->p_skb->len;
19642
19643 /* Return skb to operating system */
19644 -
19645 + comp = bp->rcv_xmt_reg.index.xmt_comp;
19646 + pci_unmap_single(bp->pci_dev,
19647 + bp->descr_block_virt->xmt_data[comp].long_1,
19648 + p_xmt_drv_descr->p_skb->len,
19649 + PCI_DMA_TODEVICE);
19650 dev_kfree_skb_irq(p_xmt_drv_descr->p_skb);
19651
19652 /*
19653 @@ -3297,6 +3421,7 @@
19654 {
19655 u32 prod_cons; /* rcv/xmt consumer block longword */
19656 XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
19657 + u8 comp; /* local transmit completion index */
19658
19659 /* Flush all outstanding transmit frames */
19660
19661 @@ -3307,7 +3432,11 @@
19662 p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[bp->rcv_xmt_reg.index.xmt_comp]);
19663
19664 /* Return skb to operating system */
19665 -
19666 + comp = bp->rcv_xmt_reg.index.xmt_comp;
19667 + pci_unmap_single(bp->pci_dev,
19668 + bp->descr_block_virt->xmt_data[comp].long_1,
19669 + p_xmt_drv_descr->p_skb->len,
19670 + PCI_DMA_TODEVICE);
19671 dev_kfree_skb(p_xmt_drv_descr->p_skb);
19672
19673 /* Increment transmit error counter */
19674 @@ -3337,12 +3466,36 @@
19675
19676 static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
19677 {
19678 - DFX_board_t *bp = dev->priv;
19679 + DFX_board_t *bp = dev->priv;
19680 + unsigned long len; /* resource length */
19681 + int alloc_size; /* total buffer size used */
19682
19683 + if (bp->bus_type == DFX_BUS_TYPE_TC) {
19684 + /* TURBOchannel board */
19685 + len = PI_TC_K_CSR_LEN;
19686 + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
19687 + /* EISA board */
19688 + len = PI_ESIC_K_CSR_IO_LEN;
19689 + } else {
19690 + len = PFI_K_CSR_IO_LEN;
19691 + }
19692 unregister_netdev(dev);
19693 - release_region(dev->base_addr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN );
19694 - if (bp->kmalloced) kfree(bp->kmalloced);
19695 - kfree(dev);
19696 + release_region(dev->base_addr, len);
19697 +
19698 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19699 + release_tc_card(bp->slot);
19700 +
19701 + alloc_size = sizeof(PI_DESCR_BLOCK) +
19702 + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
19703 +#ifndef DYNAMIC_BUFFERS
19704 + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
19705 +#endif
19706 + sizeof(PI_CONSUMER_BLOCK) +
19707 + (PI_ALIGN_K_DESC_BLK - 1);
19708 + if (bp->kmalloced)
19709 + pci_free_consistent(pdev, alloc_size, bp->kmalloced,
19710 + bp->kmalloced_dma);
19711 + free_netdev(dev);
19712 }
19713
19714 static void __devexit dfx_remove_one (struct pci_dev *pdev)
19715 @@ -3353,21 +3506,22 @@
19716 pci_set_drvdata(pdev, NULL);
19717 }
19718
19719 -static struct pci_device_id dfx_pci_tbl[] __devinitdata = {
19720 +static struct pci_device_id dfx_pci_tbl[] = {
19721 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI, PCI_ANY_ID, PCI_ANY_ID, },
19722 { 0, }
19723 };
19724 MODULE_DEVICE_TABLE(pci, dfx_pci_tbl);
19725
19726 static struct pci_driver dfx_driver = {
19727 - name: "defxx",
19728 - probe: dfx_init_one,
19729 - remove: __devexit_p(dfx_remove_one),
19730 - id_table: dfx_pci_tbl,
19731 + .name = "defxx",
19732 + .probe = dfx_init_one,
19733 + .remove = __devexit_p(dfx_remove_one),
19734 + .id_table = dfx_pci_tbl,
19735 };
19736
19737 static int dfx_have_pci;
19738 static int dfx_have_eisa;
19739 +static int dfx_have_tc;
19740
19741
19742 static void __exit dfx_eisa_cleanup(void)
19743 @@ -3388,12 +3542,7 @@
19744
19745 static int __init dfx_init(void)
19746 {
19747 - int rc_pci, rc_eisa;
19748 -
19749 -/* when a module, this is printed whether or not devices are found in probe */
19750 -#ifdef MODULE
19751 - printk(version);
19752 -#endif
19753 + int rc_pci, rc_eisa, rc_tc;
19754
19755 rc_pci = pci_module_init(&dfx_driver);
19756 if (rc_pci >= 0) dfx_have_pci = 1;
19757 @@ -3401,20 +3550,27 @@
19758 rc_eisa = dfx_eisa_init();
19759 if (rc_eisa >= 0) dfx_have_eisa = 1;
19760
19761 - return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci);
19762 + rc_tc = dfx_tc_init();
19763 + if (rc_tc >= 0) dfx_have_tc = 1;
19764 +
19765 + return ((rc_tc < 0) ? 0 : rc_tc) +
19766 + ((rc_eisa < 0) ? 0 : rc_eisa) +
19767 + ((rc_pci < 0) ? 0 : rc_pci);
19768 }
19769
19770 static void __exit dfx_cleanup(void)
19771 {
19772 if (dfx_have_pci)
19773 pci_unregister_driver(&dfx_driver);
19774 - if (dfx_have_eisa)
19775 + if (dfx_have_eisa || dfx_have_tc)
19776 dfx_eisa_cleanup();
19777 -
19778 }
19779
19780 module_init(dfx_init);
19781 module_exit(dfx_cleanup);
19782 +MODULE_AUTHOR("Lawrence V. Stefani");
19783 +MODULE_DESCRIPTION("DEC FDDIcontroller EISA/PCI (DEFEA/DEFPA) driver "
19784 + DRV_VERSION " " DRV_RELDATE);
19785 MODULE_LICENSE("GPL");
19786
19787 \f
19788 diff -Nur linux-2.4.29/drivers/net/defxx.h linux-mips/drivers/net/defxx.h
19789 --- linux-2.4.29/drivers/net/defxx.h 2001-02-13 22:15:05.000000000 +0100
19790 +++ linux-mips/drivers/net/defxx.h 2004-10-03 20:06:48.000000000 +0200
19791 @@ -12,17 +12,11 @@
19792 * Contains all definitions specified by port specification and required
19793 * by the defxx.c driver.
19794 *
19795 - * Maintainers:
19796 - * LVS Lawrence V. Stefani
19797 - *
19798 - * Contact:
19799 - * The author may be reached at:
19800 + * The original author:
19801 + * LVS Lawrence V. Stefani <lstefani@yahoo.com>
19802 *
19803 - * Inet: stefani@lkg.dec.com
19804 - * Mail: Digital Equipment Corporation
19805 - * 550 King Street
19806 - * M/S: LKG1-3/M07
19807 - * Littleton, MA 01460
19808 + * Maintainers:
19809 + * macro Maciej W. Rozycki <macro@linux-mips.org>
19810 *
19811 * Modification History:
19812 * Date Name Description
19813 @@ -30,6 +24,7 @@
19814 * 09-Sep-96 LVS Added group_prom field. Moved read/write I/O
19815 * macros to DEFXX.C.
19816 * 12-Sep-96 LVS Removed packet request header pointers.
19817 + * 04 Aug 2003 macro Converted to the DMA API.
19818 */
19819
19820 #ifndef _DEFXX_H_
19821 @@ -1467,6 +1462,11 @@
19822
19823 #endif /* #ifndef BIG_ENDIAN */
19824
19825 +/* Define TC PDQ CSR offset and length */
19826 +
19827 +#define PI_TC_K_CSR_OFFSET 0x100000
19828 +#define PI_TC_K_CSR_LEN 0x80 /* 128 bytes */
19829 +
19830 /* Define EISA controller register offsets */
19831
19832 #define PI_ESIC_K_BURST_HOLDOFF 0x040
19833 @@ -1634,6 +1634,7 @@
19834
19835 #define DFX_BUS_TYPE_PCI 0 /* type code for DEC FDDIcontroller/PCI */
19836 #define DFX_BUS_TYPE_EISA 1 /* type code for DEC FDDIcontroller/EISA */
19837 +#define DFX_BUS_TYPE_TC 2 /* type code for DEC FDDIcontroller/TURBOchannel */
19838
19839 #define DFX_FC_PRH2_PRH1_PRH0 0x54003820 /* Packet Request Header bytes + FC */
19840 #define DFX_PRH0_BYTE 0x20 /* Packet Request Header byte 0 */
19841 @@ -1704,17 +1705,19 @@
19842 {
19843 /* Keep virtual and physical pointers to locked, physically contiguous memory */
19844
19845 - char *kmalloced; /* kfree this on unload */
19846 + char *kmalloced; /* pci_free_consistent this on unload */
19847 + dma_addr_t kmalloced_dma;
19848 + /* DMA handle for the above */
19849 PI_DESCR_BLOCK *descr_block_virt; /* PDQ descriptor block virt address */
19850 - u32 descr_block_phys; /* PDQ descriptor block phys address */
19851 + dma_addr_t descr_block_phys; /* PDQ descriptor block phys address */
19852 PI_DMA_CMD_REQ *cmd_req_virt; /* Command request buffer virt address */
19853 - u32 cmd_req_phys; /* Command request buffer phys address */
19854 + dma_addr_t cmd_req_phys; /* Command request buffer phys address */
19855 PI_DMA_CMD_RSP *cmd_rsp_virt; /* Command response buffer virt address */
19856 - u32 cmd_rsp_phys; /* Command response buffer phys address */
19857 + dma_addr_t cmd_rsp_phys; /* Command response buffer phys address */
19858 char *rcv_block_virt; /* LLC host receive queue buf blk virt */
19859 - u32 rcv_block_phys; /* LLC host receive queue buf blk phys */
19860 + dma_addr_t rcv_block_phys; /* LLC host receive queue buf blk phys */
19861 PI_CONSUMER_BLOCK *cons_block_virt; /* PDQ consumer block virt address */
19862 - u32 cons_block_phys; /* PDQ consumer block phys address */
19863 + dma_addr_t cons_block_phys; /* PDQ consumer block phys address */
19864
19865 /* Keep local copies of Type 1 and Type 2 register data */
19866
19867 @@ -1758,8 +1761,9 @@
19868
19869 struct net_device *dev; /* pointer to device structure */
19870 struct net_device *next;
19871 - u32 bus_type; /* bus type (0 == PCI, 1 == EISA) */
19872 - u16 base_addr; /* base I/O address (same as dev->base_addr) */
19873 + u32 bus_type; /* bus type (0 == PCI, 1 == EISA, 2 == TC) */
19874 + long base_addr; /* base I/O address (same as dev->base_addr) */
19875 + int slot; /* TC slot number */
19876 struct pci_dev * pci_dev;
19877 u32 full_duplex_enb; /* FDDI Full Duplex enable (1 == on, 2 == off) */
19878 u32 req_ttrt; /* requested TTRT value (in 80ns units) */
19879 diff -Nur linux-2.4.29/drivers/net/e1000/e1000_ethtool.c linux-mips/drivers/net/e1000/e1000_ethtool.c
19880 --- linux-2.4.29/drivers/net/e1000/e1000_ethtool.c 2005-01-19 15:09:56.000000000 +0100
19881 +++ linux-mips/drivers/net/e1000/e1000_ethtool.c 2005-03-26 11:47:31.355505582 +0100
19882 @@ -1309,7 +1309,7 @@
19883 struct e1000_desc_ring *txdr = &adapter->test_tx_ring;
19884 struct e1000_desc_ring *rxdr = &adapter->test_rx_ring;
19885 struct pci_dev *pdev = adapter->pdev;
19886 - int i;
19887 + int i, ret_val;
19888
19889 E1000_WRITE_REG(&adapter->hw, RDT, rxdr->count - 1);
19890
19891 @@ -1329,11 +1329,12 @@
19892 rxdr->buffer_info[i].length,
19893 PCI_DMA_FROMDEVICE);
19894
19895 - if (!e1000_check_lbtest_frame(rxdr->buffer_info[i++].skb, 1024))
19896 - return 0;
19897 - } while (i < 64);
19898 + ret_val = e1000_check_lbtest_frame(rxdr->buffer_info[i].skb,
19899 + 1024);
19900 + i++;
19901 + } while (ret_val != 0 && i < 64);
19902
19903 - return 13;
19904 + return ret_val;
19905 }
19906
19907 static int
19908 diff -Nur linux-2.4.29/drivers/net/e1000/e1000.h linux-mips/drivers/net/e1000/e1000.h
19909 --- linux-2.4.29/drivers/net/e1000/e1000.h 2005-01-19 15:09:56.000000000 +0100
19910 +++ linux-mips/drivers/net/e1000/e1000.h 2005-03-26 11:47:30.488647853 +0100
19911 @@ -140,6 +140,7 @@
19912 #define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */
19913
19914 #define AUTO_ALL_MODES 0
19915 +#define E1000_EEPROM_82544_APM 0x0004
19916 #define E1000_EEPROM_APME 0x0400
19917
19918 #ifndef E1000_MASTER_SLAVE
19919 @@ -211,6 +212,7 @@
19920
19921 /* TX */
19922 struct e1000_desc_ring tx_ring;
19923 + struct e1000_buffer previous_buffer_info;
19924 spinlock_t tx_lock;
19925 uint32_t txd_cmd;
19926 uint32_t tx_int_delay;
19927 @@ -224,6 +226,7 @@
19928 uint32_t tx_fifo_size;
19929 atomic_t tx_fifo_stall;
19930 boolean_t pcix_82544;
19931 + boolean_t detect_tx_hung;
19932
19933 /* RX */
19934 struct e1000_desc_ring rx_ring;
19935 diff -Nur linux-2.4.29/drivers/net/e1000/e1000_hw.c linux-mips/drivers/net/e1000/e1000_hw.c
19936 --- linux-2.4.29/drivers/net/e1000/e1000_hw.c 2005-01-19 15:09:56.000000000 +0100
19937 +++ linux-mips/drivers/net/e1000/e1000_hw.c 2005-03-26 11:47:31.359504925 +0100
19938 @@ -1573,7 +1573,8 @@
19939 if(mii_status_reg & MII_SR_LINK_STATUS) break;
19940 msec_delay(100);
19941 }
19942 - if((i == 0) && (hw->phy_type == e1000_phy_m88)) {
19943 + if((i == 0) &&
19944 + (hw->phy_type == e1000_phy_m88)) {
19945 /* We didn't get link. Reset the DSP and wait again for link. */
19946 ret_val = e1000_phy_reset_dsp(hw);
19947 if(ret_val) {
19948 @@ -2504,7 +2505,7 @@
19949 }
19950 }
19951
19952 - ret_val = e1000_read_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr,
19953 + ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr,
19954 phy_data);
19955
19956 return ret_val;
19957 @@ -2610,7 +2611,7 @@
19958 }
19959 }
19960
19961 - ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr,
19962 + ret_val = e1000_write_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr,
19963 phy_data);
19964
19965 return ret_val;
19966 @@ -2956,8 +2957,7 @@
19967 /* Check polarity status */
19968 ret_val = e1000_check_polarity(hw, &polarity);
19969 if(ret_val)
19970 - return ret_val;
19971 -
19972 + return ret_val;
19973 phy_info->cable_polarity = polarity;
19974
19975 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
19976 @@ -2967,9 +2967,9 @@
19977 phy_info->mdix_mode = (phy_data & M88E1000_PSSR_MDIX) >>
19978 M88E1000_PSSR_MDIX_SHIFT;
19979
19980 - if(phy_data & M88E1000_PSSR_1000MBS) {
19981 - /* Cable Length Estimation and Local/Remote Receiver Informatoion
19982 - * are only valid at 1000 Mbps
19983 + if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
19984 + /* Cable Length Estimation and Local/Remote Receiver Information
19985 + * are only valid at 1000 Mbps.
19986 */
19987 phy_info->cable_length = ((phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
19988 M88E1000_PSSR_CABLE_LENGTH_SHIFT);
19989 @@ -4641,41 +4641,44 @@
19990 {
19991 uint32_t status;
19992
19993 - if(hw->mac_type < e1000_82543) {
19994 + switch (hw->mac_type) {
19995 + case e1000_82542_rev2_0:
19996 + case e1000_82542_rev2_1:
19997 hw->bus_type = e1000_bus_type_unknown;
19998 hw->bus_speed = e1000_bus_speed_unknown;
19999 hw->bus_width = e1000_bus_width_unknown;
20000 - return;
20001 - }
20002 -
20003 - status = E1000_READ_REG(hw, STATUS);
20004 - hw->bus_type = (status & E1000_STATUS_PCIX_MODE) ?
20005 - e1000_bus_type_pcix : e1000_bus_type_pci;
20006 + break;
20007 + default:
20008 + status = E1000_READ_REG(hw, STATUS);
20009 + hw->bus_type = (status & E1000_STATUS_PCIX_MODE) ?
20010 + e1000_bus_type_pcix : e1000_bus_type_pci;
20011
20012 - if(hw->device_id == E1000_DEV_ID_82546EB_QUAD_COPPER) {
20013 - hw->bus_speed = (hw->bus_type == e1000_bus_type_pci) ?
20014 - e1000_bus_speed_66 : e1000_bus_speed_120;
20015 - } else if(hw->bus_type == e1000_bus_type_pci) {
20016 - hw->bus_speed = (status & E1000_STATUS_PCI66) ?
20017 - e1000_bus_speed_66 : e1000_bus_speed_33;
20018 - } else {
20019 - switch (status & E1000_STATUS_PCIX_SPEED) {
20020 - case E1000_STATUS_PCIX_SPEED_66:
20021 - hw->bus_speed = e1000_bus_speed_66;
20022 - break;
20023 - case E1000_STATUS_PCIX_SPEED_100:
20024 - hw->bus_speed = e1000_bus_speed_100;
20025 - break;
20026 - case E1000_STATUS_PCIX_SPEED_133:
20027 - hw->bus_speed = e1000_bus_speed_133;
20028 - break;
20029 - default:
20030 - hw->bus_speed = e1000_bus_speed_reserved;
20031 - break;
20032 + if(hw->device_id == E1000_DEV_ID_82546EB_QUAD_COPPER) {
20033 + hw->bus_speed = (hw->bus_type == e1000_bus_type_pci) ?
20034 + e1000_bus_speed_66 : e1000_bus_speed_120;
20035 + } else if(hw->bus_type == e1000_bus_type_pci) {
20036 + hw->bus_speed = (status & E1000_STATUS_PCI66) ?
20037 + e1000_bus_speed_66 : e1000_bus_speed_33;
20038 + } else {
20039 + switch (status & E1000_STATUS_PCIX_SPEED) {
20040 + case E1000_STATUS_PCIX_SPEED_66:
20041 + hw->bus_speed = e1000_bus_speed_66;
20042 + break;
20043 + case E1000_STATUS_PCIX_SPEED_100:
20044 + hw->bus_speed = e1000_bus_speed_100;
20045 + break;
20046 + case E1000_STATUS_PCIX_SPEED_133:
20047 + hw->bus_speed = e1000_bus_speed_133;
20048 + break;
20049 + default:
20050 + hw->bus_speed = e1000_bus_speed_reserved;
20051 + break;
20052 + }
20053 }
20054 + hw->bus_width = (status & E1000_STATUS_BUS64) ?
20055 + e1000_bus_width_64 : e1000_bus_width_32;
20056 + break;
20057 }
20058 - hw->bus_width = (status & E1000_STATUS_BUS64) ?
20059 - e1000_bus_width_64 : e1000_bus_width_32;
20060 }
20061 /******************************************************************************
20062 * Reads a value from one of the devices registers using port I/O (as opposed
20063 @@ -4740,6 +4743,7 @@
20064 uint16_t agc_value = 0;
20065 uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
20066 uint16_t i, phy_data;
20067 + uint16_t cable_length;
20068
20069 DEBUGFUNC("e1000_get_cable_length");
20070
20071 @@ -4751,10 +4755,11 @@
20072 &phy_data);
20073 if(ret_val)
20074 return ret_val;
20075 + cable_length = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
20076 + M88E1000_PSSR_CABLE_LENGTH_SHIFT;
20077
20078 /* Convert the enum value to ranged values */
20079 - switch((phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
20080 - M88E1000_PSSR_CABLE_LENGTH_SHIFT) {
20081 + switch (cable_length) {
20082 case e1000_cable_length_50:
20083 *min_length = 0;
20084 *max_length = e1000_igp_cable_length_50;
20085 @@ -4921,8 +4926,7 @@
20086 return ret_val;
20087
20088 hw->speed_downgraded = (phy_data & IGP01E1000_PLHR_SS_DOWNGRADE) ? 1 : 0;
20089 - }
20090 - else if(hw->phy_type == e1000_phy_m88) {
20091 + } else if(hw->phy_type == e1000_phy_m88) {
20092 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS,
20093 &phy_data);
20094 if(ret_val)
20095 diff -Nur linux-2.4.29/drivers/net/e1000/e1000_hw.h linux-mips/drivers/net/e1000/e1000_hw.h
20096 --- linux-2.4.29/drivers/net/e1000/e1000_hw.h 2005-01-19 15:09:56.000000000 +0100
20097 +++ linux-mips/drivers/net/e1000/e1000_hw.h 2005-03-26 11:47:31.362504433 +0100
20098 @@ -36,7 +36,6 @@
20099 #include "e1000_osdep.h"
20100
20101
20102 -
20103 /* Forward declarations of structures used by the shared code */
20104 struct e1000_hw;
20105 struct e1000_hw_stats;
20106 @@ -370,6 +369,7 @@
20107 #define E1000_DEV_ID_82546GB_SERDES 0x107B
20108 #define E1000_DEV_ID_82546GB_PCIE 0x108A
20109 #define E1000_DEV_ID_82547EI 0x1019
20110 +
20111 #define NODE_ADDRESS_SIZE 6
20112 #define ETH_LENGTH_OF_ADDRESS 6
20113
20114 @@ -1735,6 +1735,9 @@
20115 #define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */
20116 #define PHY_EXT_STATUS 0x0F /* Extended Status Reg */
20117
20118 +#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
20119 +#define MAX_PHY_MULTI_PAGE_REG 0xF /* Registers equal on all pages */
20120 +
20121 /* M88E1000 Specific Registers */
20122 #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
20123 #define M88E1000_PHY_SPEC_STATUS 0x11 /* PHY Specific Status Register */
20124 @@ -1795,8 +1798,7 @@
20125
20126 #define IGP01E1000_ANALOG_REGS_PAGE 0x20C0
20127
20128 -#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
20129 -#define MAX_PHY_MULTI_PAGE_REG 0xF /*Registers that are equal on all pages*/
20130 +
20131 /* PHY Control Register */
20132 #define MII_CR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */
20133 #define MII_CR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */
20134 @@ -2099,7 +2101,11 @@
20135 #define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080
20136 #define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500
20137
20138 +
20139 /* Bit definitions for valid PHY IDs. */
20140 +/* I = Integrated
20141 + * E = External
20142 + */
20143 #define M88E1000_E_PHY_ID 0x01410C50
20144 #define M88E1000_I_PHY_ID 0x01410C30
20145 #define M88E1011_I_PHY_ID 0x01410C20
20146 diff -Nur linux-2.4.29/drivers/net/e1000/e1000_main.c linux-mips/drivers/net/e1000/e1000_main.c
20147 --- linux-2.4.29/drivers/net/e1000/e1000_main.c 2005-01-19 15:09:56.000000000 +0100
20148 +++ linux-mips/drivers/net/e1000/e1000_main.c 2005-03-26 11:47:31.364504105 +0100
20149 @@ -34,6 +34,14 @@
20150 * - if_mii support and associated kcompat for older kernels
20151 * - More errlogging support from Jon Mason <jonmason@us.ibm.com>
20152 * - Fix TSO issues on PPC64 machines -- Jon Mason <jonmason@us.ibm.com>
20153 + * 5.7.1 12/16/04
20154 + * - Resurrect 82547EI/GI related fix in e1000_intr to avoid deadlocks. This
20155 + * fix was removed as it caused system instability. The suspected cause of
20156 + * this is the called to e1000_irq_disable in e1000_intr. Inlined the
20157 + * required piece of e1000_irq_disable into e1000_intr.
20158 + * 5.7.0 12/10/04
20159 + * - include fix to the condition that determines when to quit NAPI - Robert Olsson
20160 + * - use netif_poll_{disable/enable} to synchronize between NAPI and i/f up/down
20161 * 5.6.5 11/01/04
20162 * - Enabling NETIF_F_SG without checksum offload is illegal -
20163 John Mason <jdmason@us.ibm.com>
20164 @@ -41,8 +49,13 @@
20165 * - Remove redundant initialization - Jamal Hadi
20166 * - Reset buffer_info->dma in tx resource cleanup logic
20167 * 5.6.2 10/12/04
20168 + * - Avoid filling tx_ring completely - shemminger@osdl.org
20169 + * - Replace schedule_timeout() with msleep()/msleep_interruptible() -
20170 + * nacc@us.ibm.com
20171 * - Sparse cleanup - shemminger@osdl.org
20172 * - Fix tx resource cleanup logic
20173 + * - LLTX support - ak@suse.de and hadi@cyberus.ca
20174 + * - {set, get}_wol is now symmetric for 82545EM adapters
20175 */
20176
20177 char e1000_driver_name[] = "e1000";
20178 @@ -52,7 +65,7 @@
20179 #else
20180 #define DRIVERNAPI "-NAPI"
20181 #endif
20182 -char e1000_driver_version[] = "5.6.10.1-k1"DRIVERNAPI;
20183 +char e1000_driver_version[] = "5.7.6-k1"DRIVERNAPI;
20184 char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
20185
20186 /* e1000_pci_tbl - PCI Device ID Table
20187 @@ -76,6 +89,7 @@
20188 INTEL_E1000_ETHERNET_DEVICE(0x1011),
20189 INTEL_E1000_ETHERNET_DEVICE(0x1012),
20190 INTEL_E1000_ETHERNET_DEVICE(0x1013),
20191 + INTEL_E1000_ETHERNET_DEVICE(0x1014),
20192 INTEL_E1000_ETHERNET_DEVICE(0x1015),
20193 INTEL_E1000_ETHERNET_DEVICE(0x1016),
20194 INTEL_E1000_ETHERNET_DEVICE(0x1017),
20195 @@ -303,6 +317,9 @@
20196 mod_timer(&adapter->watchdog_timer, jiffies);
20197 e1000_irq_enable(adapter);
20198
20199 +#ifdef CONFIG_E1000_NAPI
20200 + netif_poll_enable(netdev);
20201 +#endif
20202 return 0;
20203 }
20204
20205 @@ -316,6 +333,10 @@
20206 del_timer_sync(&adapter->tx_fifo_stall_timer);
20207 del_timer_sync(&adapter->watchdog_timer);
20208 del_timer_sync(&adapter->phy_info_timer);
20209 +
20210 +#ifdef CONFIG_E1000_NAPI
20211 + netif_poll_disable(netdev);
20212 +#endif
20213 adapter->link_speed = 0;
20214 adapter->link_duplex = 0;
20215 netif_carrier_off(netdev);
20216 @@ -409,6 +430,7 @@
20217 int i;
20218 int err;
20219 uint16_t eeprom_data;
20220 + uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
20221
20222 if((err = pci_enable_device(pdev)))
20223 return err;
20224 @@ -505,9 +527,6 @@
20225 }
20226
20227 #ifdef NETIF_F_TSO
20228 - /* Disbaled for now until root-cause is found for
20229 - * hangs reported against non-IA archs. TSO can be
20230 - * enabled using ethtool -K eth<x> tso on */
20231 if((adapter->hw.mac_type >= e1000_82544) &&
20232 (adapter->hw.mac_type != e1000_82547))
20233 netdev->features |= NETIF_F_TSO;
20234 @@ -576,6 +595,11 @@
20235 case e1000_82542_rev2_1:
20236 case e1000_82543:
20237 break;
20238 + case e1000_82544:
20239 + e1000_read_eeprom(&adapter->hw,
20240 + EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data);
20241 + eeprom_apme_mask = E1000_EEPROM_82544_APM;
20242 + break;
20243 case e1000_82546:
20244 case e1000_82546_rev_3:
20245 if((E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1)
20246 @@ -590,7 +614,7 @@
20247 EEPROM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
20248 break;
20249 }
20250 - if(eeprom_data & E1000_EEPROM_APME)
20251 + if(eeprom_data & eeprom_apme_mask)
20252 adapter->wol |= E1000_WUFC_MAG;
20253
20254 /* reset the hardware with the new settings */
20255 @@ -797,6 +821,31 @@
20256 }
20257
20258 /**
20259 + * e1000_check_64k_bound - check that memory doesn't cross 64kB boundary
20260 + * @adapter: address of board private structure
20261 + * @begin: address of beginning of memory
20262 + * @end: address of end of memory
20263 + **/
20264 +static inline boolean_t
20265 +e1000_check_64k_bound(struct e1000_adapter *adapter,
20266 + void *start, unsigned long len)
20267 +{
20268 + unsigned long begin = (unsigned long) start;
20269 + unsigned long end = begin + len;
20270 +
20271 + /* first rev 82545 and 82546 need to not allow any memory
20272 + * write location to cross a 64k boundary due to errata 23 */
20273 + if (adapter->hw.mac_type == e1000_82545 ||
20274 + adapter->hw.mac_type == e1000_82546 ) {
20275 +
20276 + /* check buffer doesn't cross 64kB */
20277 + return ((begin ^ (end - 1)) >> 16) != 0 ? FALSE : TRUE;
20278 + }
20279 +
20280 + return TRUE;
20281 +}
20282 +
20283 +/**
20284 * e1000_setup_tx_resources - allocate Tx resources (Descriptors)
20285 * @adapter: board private structure
20286 *
20287 @@ -826,11 +875,42 @@
20288
20289 txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
20290 if(!txdr->desc) {
20291 +setup_tx_desc_die:
20292 DPRINTK(PROBE, ERR,
20293 "Unable to Allocate Memory for the Transmit descriptor ring\n");
20294 vfree(txdr->buffer_info);
20295 return -ENOMEM;
20296 }
20297 +
20298 + /* fix for errata 23, cant cross 64kB boundary */
20299 + if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
20300 + void *olddesc = txdr->desc;
20301 + dma_addr_t olddma = txdr->dma;
20302 + DPRINTK(TX_ERR,ERR,"txdr align check failed: %u bytes at %p\n",
20303 + txdr->size, txdr->desc);
20304 + /* try again, without freeing the previous */
20305 + txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
20306 + /* failed allocation, critial failure */
20307 + if(!txdr->desc) {
20308 + pci_free_consistent(pdev, txdr->size, olddesc, olddma);
20309 + goto setup_tx_desc_die;
20310 + }
20311 +
20312 + if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
20313 + /* give up */
20314 + pci_free_consistent(pdev, txdr->size,
20315 + txdr->desc, txdr->dma);
20316 + pci_free_consistent(pdev, txdr->size, olddesc, olddma);
20317 + DPRINTK(PROBE, ERR,
20318 + "Unable to Allocate aligned Memory for the Transmit"
20319 + " descriptor ring\n");
20320 + vfree(txdr->buffer_info);
20321 + return -ENOMEM;
20322 + } else {
20323 + /* free old, move on with the new one since its okay */
20324 + pci_free_consistent(pdev, txdr->size, olddesc, olddma);
20325 + }
20326 + }
20327 memset(txdr->desc, 0, txdr->size);
20328
20329 txdr->next_to_use = 0;
20330 @@ -948,11 +1028,43 @@
20331 rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
20332
20333 if(!rxdr->desc) {
20334 +setup_rx_desc_die:
20335 DPRINTK(PROBE, ERR,
20336 - "Unable to Allocate Memory for the Recieve descriptor ring\n");
20337 + "Unble to Allocate Memory for the Recieve descriptor ring\n");
20338 vfree(rxdr->buffer_info);
20339 return -ENOMEM;
20340 }
20341 +
20342 + /* fix for errata 23, cant cross 64kB boundary */
20343 + if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
20344 + void *olddesc = rxdr->desc;
20345 + dma_addr_t olddma = rxdr->dma;
20346 + DPRINTK(RX_ERR,ERR,
20347 + "rxdr align check failed: %u bytes at %p\n",
20348 + rxdr->size, rxdr->desc);
20349 + /* try again, without freeing the previous */
20350 + rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
20351 + /* failed allocation, critial failure */
20352 + if(!rxdr->desc) {
20353 + pci_free_consistent(pdev, rxdr->size, olddesc, olddma);
20354 + goto setup_rx_desc_die;
20355 + }
20356 +
20357 + if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
20358 + /* give up */
20359 + pci_free_consistent(pdev, rxdr->size,
20360 + rxdr->desc, rxdr->dma);
20361 + pci_free_consistent(pdev, rxdr->size, olddesc, olddma);
20362 + DPRINTK(PROBE, ERR,
20363 + "Unable to Allocate aligned Memory for the"
20364 + " Receive descriptor ring\n");
20365 + vfree(rxdr->buffer_info);
20366 + return -ENOMEM;
20367 + } else {
20368 + /* free old, move on with the new one since its okay */
20369 + pci_free_consistent(pdev, rxdr->size, olddesc, olddma);
20370 + }
20371 + }
20372 memset(rxdr->desc, 0, rxdr->size);
20373
20374 rxdr->next_to_clean = 0;
20375 @@ -1086,6 +1198,7 @@
20376 struct e1000_buffer *buffer_info)
20377 {
20378 struct pci_dev *pdev = adapter->pdev;
20379 +
20380 if(buffer_info->dma) {
20381 pci_unmap_page(pdev,
20382 buffer_info->dma,
20383 @@ -1114,6 +1227,11 @@
20384
20385 /* Free all the Tx ring sk_buffs */
20386
20387 + if (likely(adapter->previous_buffer_info.skb != NULL)) {
20388 + e1000_unmap_and_free_tx_resource(adapter,
20389 + &adapter->previous_buffer_info);
20390 + }
20391 +
20392 for(i = 0; i < tx_ring->count; i++) {
20393 buffer_info = &tx_ring->buffer_info[i];
20394 e1000_unmap_and_free_tx_resource(adapter, buffer_info);
20395 @@ -1415,7 +1533,6 @@
20396 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
20397 struct net_device *netdev = adapter->netdev;
20398 struct e1000_desc_ring *txdr = &adapter->tx_ring;
20399 - unsigned int i;
20400 uint32_t link;
20401
20402 e1000_check_for_link(&adapter->hw);
20403 @@ -1495,12 +1612,8 @@
20404 /* Cause software interrupt to ensure rx ring is cleaned */
20405 E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0);
20406
20407 - /* Early detection of hung controller */
20408 - i = txdr->next_to_clean;
20409 - if(txdr->buffer_info[i].dma &&
20410 - time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) &&
20411 - !(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_TXOFF))
20412 - netif_stop_queue(netdev);
20413 + /* Force detection of hung controller every watchdog period*/
20414 + adapter->detect_tx_hung = TRUE;
20415
20416 /* Reset the timer */
20417 mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
20418 @@ -2132,10 +2245,28 @@
20419 __netif_rx_schedule(netdev);
20420 }
20421 #else
20422 + /* Writing IMC and IMS is needed for 82547.
20423 + Due to Hub Link bus being occupied, an interrupt
20424 + de-assertion message is not able to be sent.
20425 + When an interrupt assertion message is generated later,
20426 + two messages are re-ordered and sent out.
20427 + That causes APIC to think 82547 is in de-assertion
20428 + state, while 82547 is in assertion state, resulting
20429 + in dead lock. Writing IMC forces 82547 into
20430 + de-assertion state.
20431 + */
20432 + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2){
20433 + atomic_inc(&adapter->irq_sem);
20434 + E1000_WRITE_REG(&adapter->hw, IMC, ~0);
20435 + }
20436 +
20437 for(i = 0; i < E1000_MAX_INTR; i++)
20438 if(unlikely(!e1000_clean_rx_irq(adapter) &
20439 !e1000_clean_tx_irq(adapter)))
20440 break;
20441 +
20442 + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
20443 + e1000_irq_enable(adapter);
20444 #endif
20445
20446 return IRQ_HANDLED;
20447 @@ -2155,24 +2286,21 @@
20448 int tx_cleaned;
20449 int work_done = 0;
20450
20451 - if (!netif_carrier_ok(netdev))
20452 - goto quit_polling;
20453 -
20454 tx_cleaned = e1000_clean_tx_irq(adapter);
20455 e1000_clean_rx_irq(adapter, &work_done, work_to_do);
20456
20457 *budget -= work_done;
20458 netdev->quota -= work_done;
20459
20460 - /* if no Rx and Tx cleanup work was done, exit the polling mode */
20461 - if(!tx_cleaned || (work_done < work_to_do) ||
20462 + /* if no Tx and not enough Rx work done, exit the polling mode */
20463 + if((!tx_cleaned && (work_done < work_to_do)) ||
20464 !netif_running(netdev)) {
20465 -quit_polling: netif_rx_complete(netdev);
20466 + netif_rx_complete(netdev);
20467 e1000_irq_enable(adapter);
20468 return 0;
20469 }
20470
20471 - return (work_done >= work_to_do);
20472 + return 1;
20473 }
20474
20475 #endif
20476 @@ -2196,11 +2324,34 @@
20477 eop_desc = E1000_TX_DESC(*tx_ring, eop);
20478
20479 while(eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
20480 + /* pre-mature writeback of Tx descriptors */
20481 + /* clear (free buffers and unmap pci_mapping) */
20482 + /* previous_buffer_info */
20483 + if (likely(adapter->previous_buffer_info.skb != NULL)) {
20484 + e1000_unmap_and_free_tx_resource(adapter,
20485 + &adapter->previous_buffer_info);
20486 + }
20487 +
20488 for(cleaned = FALSE; !cleaned; ) {
20489 tx_desc = E1000_TX_DESC(*tx_ring, i);
20490 buffer_info = &tx_ring->buffer_info[i];
20491 + cleaned = (i == eop);
20492 +
20493 + /* pre-mature writeback of Tx descriptors */
20494 + /* save the cleaning of the this for the */
20495 + /* next iteration */
20496 + if (cleaned) {
20497 + memcpy(&adapter->previous_buffer_info,
20498 + buffer_info,
20499 + sizeof(struct e1000_buffer));
20500 + memset(buffer_info,
20501 + 0,
20502 + sizeof(struct e1000_buffer));
20503 + } else {
20504 + e1000_unmap_and_free_tx_resource(adapter,
20505 + buffer_info);
20506 + }
20507
20508 - e1000_unmap_and_free_tx_resource(adapter, buffer_info);
20509 tx_desc->buffer_addr = 0;
20510 tx_desc->lower.data = 0;
20511 tx_desc->upper.data = 0;
20512 @@ -2222,6 +2373,16 @@
20513 netif_wake_queue(netdev);
20514
20515 spin_unlock(&adapter->tx_lock);
20516 +
20517 + if(adapter->detect_tx_hung) {
20518 + /* detect a transmit hang in hardware, this serializes the
20519 + * check with the clearing of time_stamp and movement of i */
20520 + adapter->detect_tx_hung = FALSE;
20521 + if(tx_ring->buffer_info[i].dma &&
20522 + time_after(jiffies, tx_ring->buffer_info[i].time_stamp + HZ) &&
20523 + !(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_TXOFF))
20524 + netif_stop_queue(netdev);
20525 + }
20526
20527 return cleaned;
20528 }
20529 @@ -2389,20 +2550,43 @@
20530 struct e1000_buffer *buffer_info;
20531 struct sk_buff *skb;
20532 int reserve_len = 2;
20533 - unsigned int i;
20534 + unsigned int i, bufsz;
20535
20536 i = rx_ring->next_to_use;
20537 buffer_info = &rx_ring->buffer_info[i];
20538
20539 while(!buffer_info->skb) {
20540 + bufsz = adapter->rx_buffer_len + reserve_len;
20541
20542 - skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
20543 -
20544 + skb = dev_alloc_skb(bufsz);
20545 if(unlikely(!skb)) {
20546 /* Better luck next round */
20547 break;
20548 }
20549
20550 + /* fix for errata 23, cant cross 64kB boundary */
20551 + if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
20552 + struct sk_buff *oldskb = skb;
20553 + DPRINTK(RX_ERR,ERR,
20554 + "skb align check failed: %u bytes at %p\n",
20555 + bufsz, skb->data);
20556 + /* try again, without freeing the previous */
20557 + skb = dev_alloc_skb(bufsz);
20558 + if (!skb) {
20559 + dev_kfree_skb(oldskb);
20560 + break;
20561 + }
20562 + if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
20563 + /* give up */
20564 + dev_kfree_skb(skb);
20565 + dev_kfree_skb(oldskb);
20566 + break; /* while !buffer_info->skb */
20567 + } else {
20568 + /* move on with the new one */
20569 + dev_kfree_skb(oldskb);
20570 + }
20571 + }
20572 +
20573 /* Make buffer alignment 2 beyond a 16 byte boundary
20574 * this will result in a 16 byte aligned IP header after
20575 * the 14 byte MAC header is removed
20576 @@ -2418,6 +2602,25 @@
20577 adapter->rx_buffer_len,
20578 PCI_DMA_FROMDEVICE);
20579
20580 + /* fix for errata 23, cant cross 64kB boundary */
20581 + if(!e1000_check_64k_bound(adapter,
20582 + (void *)(unsigned long)buffer_info->dma,
20583 + adapter->rx_buffer_len)) {
20584 + DPRINTK(RX_ERR,ERR,
20585 + "dma align check failed: %u bytes at %ld\n",
20586 + adapter->rx_buffer_len, (unsigned long)buffer_info->dma);
20587 +
20588 + dev_kfree_skb(skb);
20589 + buffer_info->skb = NULL;
20590 +
20591 + pci_unmap_single(pdev,
20592 + buffer_info->dma,
20593 + adapter->rx_buffer_len,
20594 + PCI_DMA_FROMDEVICE);
20595 +
20596 + break; /* while !buffer_info->skb */
20597 + }
20598 +
20599 rx_desc = E1000_RX_DESC(*rx_ring, i);
20600 rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
20601
20602 diff -Nur linux-2.4.29/drivers/net/hamradio/hdlcdrv.c linux-mips/drivers/net/hamradio/hdlcdrv.c
20603 --- linux-2.4.29/drivers/net/hamradio/hdlcdrv.c 2002-02-25 20:37:59.000000000 +0100
20604 +++ linux-mips/drivers/net/hamradio/hdlcdrv.c 2004-05-04 14:04:27.000000000 +0200
20605 @@ -587,6 +587,8 @@
20606 return -EINVAL;
20607 s = (struct hdlcdrv_state *)dev->priv;
20608
20609 + netif_stop_queue(dev);
20610 +
20611 if (s->ops && s->ops->close)
20612 i = s->ops->close(dev);
20613 if (s->skb)
20614 diff -Nur linux-2.4.29/drivers/net/irda/au1k_ir.c linux-mips/drivers/net/irda/au1k_ir.c
20615 --- linux-2.4.29/drivers/net/irda/au1k_ir.c 2004-02-18 14:36:31.000000000 +0100
20616 +++ linux-mips/drivers/net/irda/au1k_ir.c 2005-03-26 11:47:31.367503613 +0100
20617 @@ -81,10 +81,6 @@
20618
20619 #define RUN_AT(x) (jiffies + (x))
20620
20621 -#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
20622 -static BCSR * const bcsr = (BCSR *)0xAE000000;
20623 -#endif
20624 -
20625 static spinlock_t ir_lock = SPIN_LOCK_UNLOCKED;
20626
20627 /*
20628 diff -Nur linux-2.4.29/drivers/net/sk98lin/skvpd.c linux-mips/drivers/net/sk98lin/skvpd.c
20629 --- linux-2.4.29/drivers/net/sk98lin/skvpd.c 2004-04-14 15:05:30.000000000 +0200
20630 +++ linux-mips/drivers/net/sk98lin/skvpd.c 2005-03-26 11:47:31.369503284 +0100
20631 @@ -466,6 +466,15 @@
20632
20633 pAC->vpd.vpd_size = vpd_size;
20634
20635 + /* Asus K8V Se Deluxe bugfix. Correct VPD content */
20636 + /* MBo April 2004 */
20637 + if( ((unsigned char)pAC->vpd.vpd_buf[0x3f] == 0x38) &&
20638 + ((unsigned char)pAC->vpd.vpd_buf[0x40] == 0x3c) &&
20639 + ((unsigned char)pAC->vpd.vpd_buf[0x41] == 0x45) ) {
20640 + printk(KERN_INFO "sk98lin : humm... Asus mainboard with buggy VPD ? correcting data.\n");
20641 + (unsigned char)pAC->vpd.vpd_buf[0x40] = 0x38;
20642 + }
20643 +
20644 /* find the end tag of the RO area */
20645 if (!(r = vpd_find_para(pAC, VPD_RV, &rp))) {
20646 SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR | SK_DBGCAT_FATAL,
20647 diff -Nur linux-2.4.29/drivers/net/tg3.c linux-mips/drivers/net/tg3.c
20648 --- linux-2.4.29/drivers/net/tg3.c 2005-01-19 15:09:56.000000000 +0100
20649 +++ linux-mips/drivers/net/tg3.c 2005-03-26 11:47:30.480649166 +0100
20650 @@ -59,8 +59,8 @@
20651
20652 #define DRV_MODULE_NAME "tg3"
20653 #define PFX DRV_MODULE_NAME ": "
20654 -#define DRV_MODULE_VERSION "3.15"
20655 -#define DRV_MODULE_RELDATE "January 6, 2005"
20656 +#define DRV_MODULE_VERSION "3.24"
20657 +#define DRV_MODULE_RELDATE "March 4, 2005"
20658
20659 #define TG3_DEF_MAC_MODE 0
20660 #define TG3_DEF_RX_MODE 0
20661 @@ -575,9 +575,10 @@
20662 if (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED)
20663 return;
20664
20665 - tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x7007);
20666 - tg3_readphy(tp, MII_TG3_AUX_CTRL, &val);
20667 - tg3_writephy(tp, MII_TG3_AUX_CTRL, (val | (1 << 15) | (1 << 4)));
20668 + if (!tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x7007) &&
20669 + !tg3_readphy(tp, MII_TG3_AUX_CTRL, &val))
20670 + tg3_writephy(tp, MII_TG3_AUX_CTRL,
20671 + (val | (1 << 15) | (1 << 4)));
20672 }
20673
20674 static int tg3_bmcr_reset(struct tg3 *tp)
20675 @@ -618,9 +619,10 @@
20676 while (limit--) {
20677 u32 tmp32;
20678
20679 - tg3_readphy(tp, 0x16, &tmp32);
20680 - if ((tmp32 & 0x1000) == 0)
20681 - break;
20682 + if (!tg3_readphy(tp, 0x16, &tmp32)) {
20683 + if ((tmp32 & 0x1000) == 0)
20684 + break;
20685 + }
20686 }
20687 if (limit <= 0)
20688 return -EBUSY;
20689 @@ -672,9 +674,9 @@
20690 for (i = 0; i < 6; i += 2) {
20691 u32 low, high;
20692
20693 - tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &low);
20694 - tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &high);
20695 - if (tg3_wait_macro_done(tp)) {
20696 + if (tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &low) ||
20697 + tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &high) ||
20698 + tg3_wait_macro_done(tp)) {
20699 *resetp = 1;
20700 return -EBUSY;
20701 }
20702 @@ -730,7 +732,9 @@
20703 }
20704
20705 /* Disable transmitter and interrupt. */
20706 - tg3_readphy(tp, MII_TG3_EXT_CTRL, &reg32);
20707 + if (tg3_readphy(tp, MII_TG3_EXT_CTRL, &reg32))
20708 + continue;
20709 +
20710 reg32 |= 0x3000;
20711 tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20712
20713 @@ -739,7 +743,9 @@
20714 BMCR_FULLDPLX | TG3_BMCR_SPEED1000);
20715
20716 /* Set to master mode. */
20717 - tg3_readphy(tp, MII_TG3_CTRL, &phy9_orig);
20718 + if (tg3_readphy(tp, MII_TG3_CTRL, &phy9_orig))
20719 + continue;
20720 +
20721 tg3_writephy(tp, MII_TG3_CTRL,
20722 (MII_TG3_CTRL_AS_MASTER |
20723 MII_TG3_CTRL_ENABLE_AS_MASTER));
20724 @@ -777,9 +783,11 @@
20725
20726 tg3_writephy(tp, MII_TG3_CTRL, phy9_orig);
20727
20728 - tg3_readphy(tp, MII_TG3_EXT_CTRL, &reg32);
20729 - reg32 &= ~0x3000;
20730 - tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20731 + if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, &reg32)) {
20732 + reg32 &= ~0x3000;
20733 + tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20734 + } else if (!err)
20735 + err = -EBUSY;
20736
20737 return err;
20738 }
20739 @@ -843,9 +851,9 @@
20740 u32 phy_reg;
20741
20742 /* Set bit 14 with read-modify-write to preserve other bits */
20743 - tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0007);
20744 - tg3_readphy(tp, MII_TG3_AUX_CTRL, &phy_reg);
20745 - tg3_writephy(tp, MII_TG3_AUX_CTRL, phy_reg | 0x4000);
20746 + if (!tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0007) &&
20747 + !tg3_readphy(tp, MII_TG3_AUX_CTRL, &phy_reg))
20748 + tg3_writephy(tp, MII_TG3_AUX_CTRL, phy_reg | 0x4000);
20749 }
20750 tg3_phy_set_wirespeed(tp);
20751 return 0;
20752 @@ -877,7 +885,7 @@
20753 GRC_LCLCTRL_GPIO_OUTPUT1));
20754 udelay(100);
20755 } else {
20756 - int no_gpio2;
20757 + u32 no_gpio2;
20758 u32 grc_local_ctrl;
20759
20760 if (tp_peer != tp &&
20761 @@ -885,8 +893,8 @@
20762 return;
20763
20764 /* On 5753 and variants, GPIO2 cannot be used. */
20765 - no_gpio2 = (tp->nic_sram_data_cfg &
20766 - NIC_SRAM_DATA_CFG_NO_GPIO2) != 0;
20767 + no_gpio2 = tp->nic_sram_data_cfg &
20768 + NIC_SRAM_DATA_CFG_NO_GPIO2;
20769
20770 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
20771 GRC_LCLCTRL_GPIO_OE1 |
20772 @@ -898,29 +906,17 @@
20773 GRC_LCLCTRL_GPIO_OUTPUT2);
20774 }
20775 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
20776 - grc_local_ctrl);
20777 + grc_local_ctrl);
20778 udelay(100);
20779
20780 - grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
20781 - GRC_LCLCTRL_GPIO_OE1 |
20782 - GRC_LCLCTRL_GPIO_OE2 |
20783 - GRC_LCLCTRL_GPIO_OUTPUT0 |
20784 - GRC_LCLCTRL_GPIO_OUTPUT1 |
20785 - GRC_LCLCTRL_GPIO_OUTPUT2;
20786 - if (no_gpio2) {
20787 - grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 |
20788 - GRC_LCLCTRL_GPIO_OUTPUT2);
20789 - }
20790 + grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0;
20791 +
20792 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
20793 - grc_local_ctrl);
20794 + grc_local_ctrl);
20795 udelay(100);
20796
20797 - grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
20798 - GRC_LCLCTRL_GPIO_OE1 |
20799 - GRC_LCLCTRL_GPIO_OE2 |
20800 - GRC_LCLCTRL_GPIO_OUTPUT0 |
20801 - GRC_LCLCTRL_GPIO_OUTPUT1;
20802 if (!no_gpio2) {
20803 + grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2;
20804 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
20805 grc_local_ctrl);
20806 udelay(100);
20807 @@ -1240,7 +1236,7 @@
20808 };
20809 }
20810
20811 -static int tg3_phy_copper_begin(struct tg3 *tp)
20812 +static void tg3_phy_copper_begin(struct tg3 *tp)
20813 {
20814 u32 new_adv;
20815 int i;
20816 @@ -1355,15 +1351,16 @@
20817 if (tp->link_config.duplex == DUPLEX_FULL)
20818 bmcr |= BMCR_FULLDPLX;
20819
20820 - tg3_readphy(tp, MII_BMCR, &orig_bmcr);
20821 - if (bmcr != orig_bmcr) {
20822 + if (!tg3_readphy(tp, MII_BMCR, &orig_bmcr) &&
20823 + (bmcr != orig_bmcr)) {
20824 tg3_writephy(tp, MII_BMCR, BMCR_LOOPBACK);
20825 for (i = 0; i < 1500; i++) {
20826 u32 tmp;
20827
20828 udelay(10);
20829 - tg3_readphy(tp, MII_BMSR, &tmp);
20830 - tg3_readphy(tp, MII_BMSR, &tmp);
20831 + if (tg3_readphy(tp, MII_BMSR, &tmp) ||
20832 + tg3_readphy(tp, MII_BMSR, &tmp))
20833 + continue;
20834 if (!(tmp & BMSR_LSTATUS)) {
20835 udelay(40);
20836 break;
20837 @@ -1376,8 +1373,6 @@
20838 tg3_writephy(tp, MII_BMCR,
20839 BMCR_ANENABLE | BMCR_ANRESTART);
20840 }
20841 -
20842 - return 0;
20843 }
20844
20845 static int tg3_init_5401phy_dsp(struct tg3 *tp)
20846 @@ -1412,7 +1407,9 @@
20847 {
20848 u32 adv_reg, all_mask;
20849
20850 - tg3_readphy(tp, MII_ADVERTISE, &adv_reg);
20851 + if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
20852 + return 0;
20853 +
20854 all_mask = (ADVERTISE_10HALF | ADVERTISE_10FULL |
20855 ADVERTISE_100HALF | ADVERTISE_100FULL);
20856 if ((adv_reg & all_mask) != all_mask)
20857 @@ -1420,7 +1417,9 @@
20858 if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) {
20859 u32 tg3_ctrl;
20860
20861 - tg3_readphy(tp, MII_TG3_CTRL, &tg3_ctrl);
20862 + if (tg3_readphy(tp, MII_TG3_CTRL, &tg3_ctrl))
20863 + return 0;
20864 +
20865 all_mask = (MII_TG3_CTRL_ADV_1000_HALF |
20866 MII_TG3_CTRL_ADV_1000_FULL);
20867 if ((tg3_ctrl & all_mask) != all_mask)
20868 @@ -1460,8 +1459,8 @@
20869 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) &&
20870 netif_carrier_ok(tp->dev)) {
20871 tg3_readphy(tp, MII_BMSR, &bmsr);
20872 - tg3_readphy(tp, MII_BMSR, &bmsr);
20873 - if (!(bmsr & BMSR_LSTATUS))
20874 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
20875 + !(bmsr & BMSR_LSTATUS))
20876 force_reset = 1;
20877 }
20878 if (force_reset)
20879 @@ -1469,9 +1468,8 @@
20880
20881 if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
20882 tg3_readphy(tp, MII_BMSR, &bmsr);
20883 - tg3_readphy(tp, MII_BMSR, &bmsr);
20884 -
20885 - if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE))
20886 + if (tg3_readphy(tp, MII_BMSR, &bmsr) ||
20887 + !(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE))
20888 bmsr = 0;
20889
20890 if (!(bmsr & BMSR_LSTATUS)) {
20891 @@ -1482,8 +1480,8 @@
20892 tg3_readphy(tp, MII_BMSR, &bmsr);
20893 for (i = 0; i < 1000; i++) {
20894 udelay(10);
20895 - tg3_readphy(tp, MII_BMSR, &bmsr);
20896 - if (bmsr & BMSR_LSTATUS) {
20897 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
20898 + (bmsr & BMSR_LSTATUS)) {
20899 udelay(40);
20900 break;
20901 }
20902 @@ -1545,8 +1543,8 @@
20903 bmsr = 0;
20904 for (i = 0; i < 100; i++) {
20905 tg3_readphy(tp, MII_BMSR, &bmsr);
20906 - tg3_readphy(tp, MII_BMSR, &bmsr);
20907 - if (bmsr & BMSR_LSTATUS)
20908 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
20909 + (bmsr & BMSR_LSTATUS))
20910 break;
20911 udelay(40);
20912 }
20913 @@ -1557,8 +1555,8 @@
20914 tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat);
20915 for (i = 0; i < 2000; i++) {
20916 udelay(10);
20917 - tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat);
20918 - if (aux_stat)
20919 + if (!tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat) &&
20920 + aux_stat)
20921 break;
20922 }
20923
20924 @@ -1569,7 +1567,8 @@
20925 bmcr = 0;
20926 for (i = 0; i < 200; i++) {
20927 tg3_readphy(tp, MII_BMCR, &bmcr);
20928 - tg3_readphy(tp, MII_BMCR, &bmcr);
20929 + if (tg3_readphy(tp, MII_BMCR, &bmcr))
20930 + continue;
20931 if (bmcr && bmcr != 0x7fff)
20932 break;
20933 udelay(10);
20934 @@ -1606,10 +1605,13 @@
20935 (tp->link_config.autoneg == AUTONEG_ENABLE)) {
20936 u32 local_adv, remote_adv;
20937
20938 - tg3_readphy(tp, MII_ADVERTISE, &local_adv);
20939 + if (tg3_readphy(tp, MII_ADVERTISE, &local_adv))
20940 + local_adv = 0;
20941 local_adv &= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
20942
20943 - tg3_readphy(tp, MII_LPA, &remote_adv);
20944 + if (tg3_readphy(tp, MII_LPA, &remote_adv))
20945 + remote_adv = 0;
20946 +
20947 remote_adv &= (LPA_PAUSE_CAP | LPA_PAUSE_ASYM);
20948
20949 /* If we are not advertising full pause capability,
20950 @@ -1628,8 +1630,8 @@
20951 tg3_phy_copper_begin(tp);
20952
20953 tg3_readphy(tp, MII_BMSR, &tmp);
20954 - tg3_readphy(tp, MII_BMSR, &tmp);
20955 - if (tmp & BMSR_LSTATUS)
20956 + if (!tg3_readphy(tp, MII_BMSR, &tmp) &&
20957 + (tmp & BMSR_LSTATUS))
20958 current_link_up = 1;
20959 }
20960
20961 @@ -2130,8 +2132,9 @@
20962 if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)
20963 port_a = 0;
20964
20965 - serdes_cfg = tr32(MAC_SERDES_CFG) &
20966 - ((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20));
20967 + /* preserve bits 0-11,13,14 for signal pre-emphasis */
20968 + /* preserve bits 20-23 for voltage regulator */
20969 + serdes_cfg = tr32(MAC_SERDES_CFG) & 0x00f06fff;
20970 }
20971
20972 sg_dig_ctrl = tr32(SG_DIG_CTRL);
20973 @@ -2142,9 +2145,9 @@
20974 u32 val = serdes_cfg;
20975
20976 if (port_a)
20977 - val |= 0xc010880;
20978 + val |= 0xc010000;
20979 else
20980 - val |= 0x4010880;
20981 + val |= 0x4010000;
20982 tw32_f(MAC_SERDES_CFG, val);
20983 }
20984 tw32_f(SG_DIG_CTRL, 0x01388400);
20985 @@ -2167,7 +2170,7 @@
20986
20987 if (sg_dig_ctrl != expected_sg_dig_ctrl) {
20988 if (workaround)
20989 - tw32_f(MAC_SERDES_CFG, serdes_cfg | 0xc011880);
20990 + tw32_f(MAC_SERDES_CFG, serdes_cfg | 0xc011000);
20991 tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl | (1 << 30));
20992 udelay(5);
20993 tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl);
20994 @@ -2208,9 +2211,9 @@
20995 u32 val = serdes_cfg;
20996
20997 if (port_a)
20998 - val |= 0xc010880;
20999 + val |= 0xc010000;
21000 else
21001 - val |= 0x4010880;
21002 + val |= 0x4010000;
21003
21004 tw32_f(MAC_SERDES_CFG, val);
21005 }
21006 @@ -2218,8 +2221,12 @@
21007 tw32_f(SG_DIG_CTRL, 0x01388400);
21008 udelay(40);
21009
21010 + /* Link parallel detection - link is up */
21011 + /* only if we have PCS_SYNC and not */
21012 + /* receiving config code words */
21013 mac_status = tr32(MAC_STATUS);
21014 - if (mac_status & MAC_STATUS_PCS_SYNCED) {
21015 + if ((mac_status & MAC_STATUS_PCS_SYNCED) &&
21016 + !(mac_status & MAC_STATUS_RCVD_CFG)) {
21017 tg3_setup_flow_control(tp, 0, 0);
21018 current_link_up = 1;
21019 }
21020 @@ -2690,7 +2697,11 @@
21021
21022 len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */
21023
21024 - if (len > RX_COPY_THRESHOLD) {
21025 + if (len > RX_COPY_THRESHOLD
21026 + && tp->rx_offset == 2
21027 + /* rx_offset != 2 iff this is a 5701 card running
21028 + * in PCI-X mode [see tg3_get_invariants()] */
21029 + ) {
21030 int skb_size;
21031
21032 skb_size = tg3_alloc_rx_skb(tp, opaque_key,
21033 @@ -3085,11 +3096,19 @@
21034
21035 skb->nh.iph->check = 0;
21036 skb->nh.iph->tot_len = ntohs(mss + ip_tcp_len + tcp_opt_len);
21037 - skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
21038 - skb->nh.iph->daddr,
21039 - 0, IPPROTO_TCP, 0);
21040 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
21041 + skb->h.th->check = 0;
21042 + base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
21043 + }
21044 + else {
21045 + skb->h.th->check =
21046 + ~csum_tcpudp_magic(skb->nh.iph->saddr,
21047 + skb->nh.iph->daddr,
21048 + 0, IPPROTO_TCP, 0);
21049 + }
21050
21051 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
21052 + if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
21053 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
21054 if (tcp_opt_len || skb->nh.iph->ihl > 5) {
21055 int tsflags;
21056
21057 @@ -3156,7 +3175,7 @@
21058 would_hit_hwbug = entry + 1;
21059 }
21060
21061 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21062 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
21063 tg3_set_txd(tp, entry, mapping, len,
21064 base_flags, (i == last)|(mss << 1));
21065 else
21066 @@ -3655,8 +3674,9 @@
21067 /* tp->lock is held. */
21068 static void tg3_write_sig_pre_reset(struct tg3 *tp, int kind)
21069 {
21070 - tg3_write_mem(tp, NIC_SRAM_FIRMWARE_MBOX,
21071 - NIC_SRAM_FIRMWARE_MBOX_MAGIC1);
21072 + if (!(tp->tg3_flags2 & TG3_FLG2_SUN_570X))
21073 + tg3_write_mem(tp, NIC_SRAM_FIRMWARE_MBOX,
21074 + NIC_SRAM_FIRMWARE_MBOX_MAGIC1);
21075
21076 if (tp->tg3_flags2 & TG3_FLG2_ASF_NEW_HANDSHAKE) {
21077 switch (kind) {
21078 @@ -3860,19 +3880,20 @@
21079 tw32_f(MAC_MODE, 0);
21080 udelay(40);
21081
21082 - /* Wait for firmware initialization to complete. */
21083 - for (i = 0; i < 100000; i++) {
21084 - tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
21085 - if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
21086 - break;
21087 - udelay(10);
21088 - }
21089 - if (i >= 100000 &&
21090 - !(tp->tg3_flags2 & TG3_FLG2_SUN_570X)) {
21091 - printk(KERN_ERR PFX "tg3_reset_hw timed out for %s, "
21092 - "firmware will not restart magic=%08x\n",
21093 - tp->dev->name, val);
21094 - return -ENODEV;
21095 + if (!(tp->tg3_flags2 & TG3_FLG2_SUN_570X)) {
21096 + /* Wait for firmware initialization to complete. */
21097 + for (i = 0; i < 100000; i++) {
21098 + tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
21099 + if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
21100 + break;
21101 + udelay(10);
21102 + }
21103 + if (i >= 100000) {
21104 + printk(KERN_ERR PFX "tg3_reset_hw timed out for %s, "
21105 + "firmware will not restart magic=%08x\n",
21106 + tp->dev->name, val);
21107 + return -ENODEV;
21108 + }
21109 }
21110
21111 if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
21112 @@ -4747,7 +4768,7 @@
21113 unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
21114 int err, i;
21115
21116 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21117 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
21118 return 0;
21119
21120 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
21121 @@ -4831,9 +4852,8 @@
21122 tw32(MAC_ADDR_0_LOW + (i * 8), addr_low);
21123 }
21124
21125 - if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
21126 - GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701 &&
21127 - GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
21128 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
21129 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
21130 for (i = 0; i < 12; i++) {
21131 tw32(MAC_EXTADDR_0_HIGH + (i * 8), addr_high);
21132 tw32(MAC_EXTADDR_0_LOW + (i * 8), addr_low);
21133 @@ -4879,7 +4899,8 @@
21134 (bdinfo_addr + TG3_BDINFO_MAXLEN_FLAGS),
21135 maxlen_flags);
21136
21137 - if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705)
21138 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) &&
21139 + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750))
21140 tg3_write_mem(tp,
21141 (bdinfo_addr + TG3_BDINFO_NIC_ADDR),
21142 nic_addr);
21143 @@ -5181,7 +5202,7 @@
21144 }
21145
21146 #if TG3_TSO_SUPPORT != 0
21147 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21148 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
21149 rdmac_mode |= (1 << 27);
21150 #endif
21151
21152 @@ -5331,7 +5352,7 @@
21153 tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ);
21154 tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE);
21155 #if TG3_TSO_SUPPORT != 0
21156 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21157 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
21158 tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8);
21159 #endif
21160 tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE);
21161 @@ -5381,8 +5402,10 @@
21162 udelay(10);
21163
21164 if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
21165 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
21166 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) &&
21167 + !(tp->tg3_flags2 & TG3_FLG2_SERDES_PREEMPHASIS)) {
21168 /* Set drive transmission level to 1.2V */
21169 + /* only if the signal pre-emphasis bit is not set */
21170 val = tr32(MAC_SERDES_CFG);
21171 val &= 0xfffff000;
21172 val |= 0x880;
21173 @@ -5411,9 +5434,10 @@
21174 u32 tmp;
21175
21176 /* Clear CRC stats. */
21177 - tg3_readphy(tp, 0x1e, &tmp);
21178 - tg3_writephy(tp, 0x1e, tmp | 0x8000);
21179 - tg3_readphy(tp, 0x14, &tmp);
21180 + if (!tg3_readphy(tp, 0x1e, &tmp)) {
21181 + tg3_writephy(tp, 0x1e, tmp | 0x8000);
21182 + tg3_readphy(tp, 0x14, &tmp);
21183 + }
21184 }
21185
21186 __tg3_set_rx_mode(tp->dev);
21187 @@ -6003,9 +6027,11 @@
21188 u32 val;
21189
21190 spin_lock_irqsave(&tp->lock, flags);
21191 - tg3_readphy(tp, 0x1e, &val);
21192 - tg3_writephy(tp, 0x1e, val | 0x8000);
21193 - tg3_readphy(tp, 0x14, &val);
21194 + if (!tg3_readphy(tp, 0x1e, &val)) {
21195 + tg3_writephy(tp, 0x1e, val | 0x8000);
21196 + tg3_readphy(tp, 0x14, &val);
21197 + } else
21198 + val = 0;
21199 spin_unlock_irqrestore(&tp->lock, flags);
21200
21201 tp->phy_crc_errors += val;
21202 @@ -6349,11 +6375,13 @@
21203
21204 static int tg3_get_eeprom_len(struct net_device *dev)
21205 {
21206 - return EEPROM_CHIP_SIZE;
21207 + struct tg3 *tp = netdev_priv(dev);
21208 +
21209 + return tp->nvram_size;
21210 }
21211
21212 -static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
21213 - u32 offset, u32 *val);
21214 +static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val);
21215 +
21216 static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
21217 {
21218 struct tg3 *tp = dev->priv;
21219 @@ -6365,10 +6393,7 @@
21220 len = eeprom->len;
21221 eeprom->len = 0;
21222
21223 - ret = tg3_nvram_read_using_eeprom(tp, 0, &eeprom->magic);
21224 - if (ret)
21225 - return ret;
21226 - eeprom->magic = swab32(eeprom->magic);
21227 + eeprom->magic = TG3_EEPROM_MAGIC;
21228
21229 if (offset & 3) {
21230 /* adjustments to start on required 4 byte boundary */
21231 @@ -6378,9 +6403,10 @@
21232 /* i.e. offset=1 len=2 */
21233 b_count = len;
21234 }
21235 - ret = tg3_nvram_read_using_eeprom(tp, offset-b_offset, &val);
21236 + ret = tg3_nvram_read(tp, offset-b_offset, &val);
21237 if (ret)
21238 return ret;
21239 + val = cpu_to_le32(val);
21240 memcpy(data, ((char*)&val) + b_offset, b_count);
21241 len -= b_count;
21242 offset += b_count;
21243 @@ -6390,12 +6416,13 @@
21244 /* read bytes upto the last 4 byte boundary */
21245 pd = &data[eeprom->len];
21246 for (i = 0; i < (len - (len & 3)); i += 4) {
21247 - ret = tg3_nvram_read_using_eeprom(tp, offset + i,
21248 - (u32*)(pd + i));
21249 + ret = tg3_nvram_read(tp, offset + i, &val);
21250 if (ret) {
21251 eeprom->len += i;
21252 return ret;
21253 }
21254 + val = cpu_to_le32(val);
21255 + memcpy(pd + i, &val, 4);
21256 }
21257 eeprom->len += i;
21258
21259 @@ -6404,15 +6431,72 @@
21260 pd = &data[eeprom->len];
21261 b_count = len & 3;
21262 b_offset = offset + len - b_count;
21263 - ret = tg3_nvram_read_using_eeprom(tp, b_offset, &val);
21264 + ret = tg3_nvram_read(tp, b_offset, &val);
21265 if (ret)
21266 return ret;
21267 + val = cpu_to_le32(val);
21268 memcpy(pd, ((char*)&val), b_count);
21269 eeprom->len += b_count;
21270 }
21271 return 0;
21272 }
21273
21274 +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf);
21275 +
21276 +static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
21277 +{
21278 + struct tg3 *tp = netdev_priv(dev);
21279 + int ret;
21280 + u32 offset, len, b_offset, odd_len, start, end;
21281 + u8 *buf;
21282 +
21283 + if (eeprom->magic != TG3_EEPROM_MAGIC)
21284 + return -EINVAL;
21285 +
21286 + offset = eeprom->offset;
21287 + len = eeprom->len;
21288 +
21289 + if ((b_offset = (offset & 3))) {
21290 + /* adjustments to start on required 4 byte boundary */
21291 + ret = tg3_nvram_read(tp, offset-b_offset, &start);
21292 + if (ret)
21293 + return ret;
21294 + start = cpu_to_le32(start);
21295 + len += b_offset;
21296 + offset &= ~3;
21297 + }
21298 +
21299 + odd_len = 0;
21300 + if ((len & 3) && ((len > 4) || (b_offset == 0))) {
21301 + /* adjustments to end on required 4 byte boundary */
21302 + odd_len = 1;
21303 + len = (len + 3) & ~3;
21304 + ret = tg3_nvram_read(tp, offset+len-4, &end);
21305 + if (ret)
21306 + return ret;
21307 + end = cpu_to_le32(end);
21308 + }
21309 +
21310 + buf = data;
21311 + if (b_offset || odd_len) {
21312 + buf = kmalloc(len, GFP_KERNEL);
21313 + if (buf == 0)
21314 + return -ENOMEM;
21315 + if (b_offset)
21316 + memcpy(buf, &start, 4);
21317 + if (odd_len)
21318 + memcpy(buf+len-4, &end, 4);
21319 + memcpy(buf + b_offset, data, eeprom->len);
21320 + }
21321 +
21322 + ret = tg3_nvram_write_block(tp, offset, len, buf);
21323 +
21324 + if (buf != data)
21325 + kfree(buf);
21326 +
21327 + return ret;
21328 +}
21329 +
21330 static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
21331 {
21332 struct tg3 *tp = netdev_priv(dev);
21333 @@ -6561,10 +6645,10 @@
21334 int r;
21335
21336 spin_lock_irq(&tp->lock);
21337 - tg3_readphy(tp, MII_BMCR, &bmcr);
21338 - tg3_readphy(tp, MII_BMCR, &bmcr);
21339 r = -EINVAL;
21340 - if (bmcr & BMCR_ANENABLE) {
21341 + tg3_readphy(tp, MII_BMCR, &bmcr);
21342 + if (!tg3_readphy(tp, MII_BMCR, &bmcr) &&
21343 + (bmcr & BMCR_ANENABLE)) {
21344 tg3_writephy(tp, MII_BMCR, bmcr | BMCR_ANRESTART);
21345 r = 0;
21346 }
21347 @@ -6812,6 +6896,7 @@
21348 .get_link = ethtool_op_get_link,
21349 .get_eeprom_len = tg3_get_eeprom_len,
21350 .get_eeprom = tg3_get_eeprom,
21351 + .set_eeprom = tg3_set_eeprom,
21352 .get_ringparam = tg3_get_ringparam,
21353 .set_ringparam = tg3_set_ringparam,
21354 .get_pauseparam = tg3_get_pauseparam,
21355 @@ -6831,6 +6916,103 @@
21356 .get_ethtool_stats = tg3_get_ethtool_stats,
21357 };
21358
21359 +static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
21360 +{
21361 + u32 cursize, val;
21362 +
21363 + tp->nvram_size = EEPROM_CHIP_SIZE;
21364 +
21365 + if (tg3_nvram_read(tp, 0, &val) != 0)
21366 + return;
21367 +
21368 + if (swab32(val) != TG3_EEPROM_MAGIC)
21369 + return;
21370 +
21371 + /*
21372 + * Size the chip by reading offsets at increasing powers of two.
21373 + * When we encounter our validation signature, we know the addressing
21374 + * has wrapped around, and thus have our chip size.
21375 + */
21376 + cursize = 0x800;
21377 +
21378 + while (cursize < tp->nvram_size) {
21379 + if (tg3_nvram_read(tp, cursize, &val) != 0)
21380 + return;
21381 +
21382 + if (swab32(val) == TG3_EEPROM_MAGIC)
21383 + break;
21384 +
21385 + cursize <<= 1;
21386 + }
21387 +
21388 + tp->nvram_size = cursize;
21389 +}
21390 +
21391 +static void __devinit tg3_get_nvram_size(struct tg3 *tp)
21392 +{
21393 + u32 val;
21394 +
21395 + if (tg3_nvram_read(tp, 0xf0, &val) == 0) {
21396 + if (val != 0) {
21397 + tp->nvram_size = (val >> 16) * 1024;
21398 + return;
21399 + }
21400 + }
21401 + tp->nvram_size = 0x20000;
21402 +}
21403 +
21404 +static void __devinit tg3_get_nvram_info(struct tg3 *tp)
21405 +{
21406 + u32 nvcfg1;
21407 +
21408 + nvcfg1 = tr32(NVRAM_CFG1);
21409 + if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) {
21410 + tp->tg3_flags2 |= TG3_FLG2_FLASH;
21411 + }
21412 + else {
21413 + nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
21414 + tw32(NVRAM_CFG1, nvcfg1);
21415 + }
21416 +
21417 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21418 + switch (nvcfg1 & NVRAM_CFG1_VENDOR_MASK) {
21419 + case FLASH_VENDOR_ATMEL_FLASH_BUFFERED:
21420 + tp->nvram_jedecnum = JEDEC_ATMEL;
21421 + tp->nvram_pagesize = ATMEL_AT45DB0X1B_PAGE_SIZE;
21422 + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21423 + break;
21424 + case FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED:
21425 + tp->nvram_jedecnum = JEDEC_ATMEL;
21426 + tp->nvram_pagesize = ATMEL_AT25F512_PAGE_SIZE;
21427 + break;
21428 + case FLASH_VENDOR_ATMEL_EEPROM:
21429 + tp->nvram_jedecnum = JEDEC_ATMEL;
21430 + tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
21431 + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21432 + break;
21433 + case FLASH_VENDOR_ST:
21434 + tp->nvram_jedecnum = JEDEC_ST;
21435 + tp->nvram_pagesize = ST_M45PEX0_PAGE_SIZE;
21436 + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21437 + break;
21438 + case FLASH_VENDOR_SAIFUN:
21439 + tp->nvram_jedecnum = JEDEC_SAIFUN;
21440 + tp->nvram_pagesize = SAIFUN_SA25F0XX_PAGE_SIZE;
21441 + break;
21442 + case FLASH_VENDOR_SST_SMALL:
21443 + case FLASH_VENDOR_SST_LARGE:
21444 + tp->nvram_jedecnum = JEDEC_SST;
21445 + tp->nvram_pagesize = SST_25VF0X0_PAGE_SIZE;
21446 + break;
21447 + }
21448 + }
21449 + else {
21450 + tp->nvram_jedecnum = JEDEC_ATMEL;
21451 + tp->nvram_pagesize = ATMEL_AT45DB0X1B_PAGE_SIZE;
21452 + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21453 + }
21454 +}
21455 +
21456 /* Chips other than 5700/5701 use the NVRAM for fetching info. */
21457 static void __devinit tg3_nvram_init(struct tg3 *tp)
21458 {
21459 @@ -6855,32 +7037,27 @@
21460
21461 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
21462 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) {
21463 - u32 nvcfg1;
21464 + tp->tg3_flags |= TG3_FLAG_NVRAM;
21465
21466 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21467 u32 nvaccess = tr32(NVRAM_ACCESS);
21468
21469 - tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21470 + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21471 }
21472
21473 - nvcfg1 = tr32(NVRAM_CFG1);
21474 -
21475 - tp->tg3_flags |= TG3_FLAG_NVRAM;
21476 - if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) {
21477 - if (nvcfg1 & NVRAM_CFG1_BUFFERED_MODE)
21478 - tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21479 - } else {
21480 - nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
21481 - tw32(NVRAM_CFG1, nvcfg1);
21482 - }
21483 + tg3_get_nvram_info(tp);
21484 + tg3_get_nvram_size(tp);
21485
21486 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21487 u32 nvaccess = tr32(NVRAM_ACCESS);
21488
21489 - tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21490 + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21491 }
21492 +
21493 } else {
21494 tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED);
21495 +
21496 + tg3_get_eeprom_size(tp);
21497 }
21498 }
21499
21500 @@ -6918,11 +7095,30 @@
21501 return 0;
21502 }
21503
21504 -static int __devinit tg3_nvram_read(struct tg3 *tp,
21505 - u32 offset, u32 *val)
21506 +#define NVRAM_CMD_TIMEOUT 10000
21507 +
21508 +static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
21509 {
21510 int i;
21511
21512 + tw32(NVRAM_CMD, nvram_cmd);
21513 + for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
21514 + udelay(10);
21515 + if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
21516 + udelay(10);
21517 + break;
21518 + }
21519 + }
21520 + if (i == NVRAM_CMD_TIMEOUT) {
21521 + return -EBUSY;
21522 + }
21523 + return 0;
21524 +}
21525 +
21526 +static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val)
21527 +{
21528 + int ret;
21529 +
21530 if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) {
21531 printk(KERN_ERR PFX "Attempt to do nvram_read on Sun 570X\n");
21532 return -EINVAL;
21533 @@ -6931,10 +7127,14 @@
21534 if (!(tp->tg3_flags & TG3_FLAG_NVRAM))
21535 return tg3_nvram_read_using_eeprom(tp, offset, val);
21536
21537 - if (tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED)
21538 - offset = ((offset / NVRAM_BUFFERED_PAGE_SIZE) <<
21539 - NVRAM_BUFFERED_PAGE_POS) +
21540 - (offset % NVRAM_BUFFERED_PAGE_SIZE);
21541 + if ((tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) &&
21542 + (tp->tg3_flags2 & TG3_FLG2_FLASH) &&
21543 + (tp->nvram_jedecnum == JEDEC_ATMEL)) {
21544 +
21545 + offset = ((offset / tp->nvram_pagesize) <<
21546 + ATMEL_AT45DB0X1B_PAGE_POS) +
21547 + (offset % tp->nvram_pagesize);
21548 + }
21549
21550 if (offset > NVRAM_ADDR_MSK)
21551 return -EINVAL;
21552 @@ -6948,19 +7148,11 @@
21553 }
21554
21555 tw32(NVRAM_ADDR, offset);
21556 - tw32(NVRAM_CMD,
21557 - NVRAM_CMD_RD | NVRAM_CMD_GO |
21558 - NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
21559 + ret = tg3_nvram_exec_cmd(tp, NVRAM_CMD_RD | NVRAM_CMD_GO |
21560 + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
21561
21562 - /* Wait for done bit to clear. */
21563 - for (i = 0; i < 1000; i++) {
21564 - udelay(10);
21565 - if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
21566 - udelay(10);
21567 - *val = swab32(tr32(NVRAM_RDDATA));
21568 - break;
21569 - }
21570 - }
21571 + if (ret == 0)
21572 + *val = swab32(tr32(NVRAM_RDDATA));
21573
21574 tg3_nvram_unlock(tp);
21575
21576 @@ -6970,10 +7162,268 @@
21577 tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21578 }
21579
21580 - if (i >= 1000)
21581 - return -EBUSY;
21582 + return ret;
21583 +}
21584
21585 - return 0;
21586 +static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp,
21587 + u32 offset, u32 len, u8 *buf)
21588 +{
21589 + int i, j, rc = 0;
21590 + u32 val;
21591 +
21592 + for (i = 0; i < len; i += 4) {
21593 + u32 addr, data;
21594 +
21595 + addr = offset + i;
21596 +
21597 + memcpy(&data, buf + i, 4);
21598 +
21599 + tw32(GRC_EEPROM_DATA, cpu_to_le32(data));
21600 +
21601 + val = tr32(GRC_EEPROM_ADDR);
21602 + tw32(GRC_EEPROM_ADDR, val | EEPROM_ADDR_COMPLETE);
21603 +
21604 + val &= ~(EEPROM_ADDR_ADDR_MASK | EEPROM_ADDR_DEVID_MASK |
21605 + EEPROM_ADDR_READ);
21606 + tw32(GRC_EEPROM_ADDR, val |
21607 + (0 << EEPROM_ADDR_DEVID_SHIFT) |
21608 + (addr & EEPROM_ADDR_ADDR_MASK) |
21609 + EEPROM_ADDR_START |
21610 + EEPROM_ADDR_WRITE);
21611 +
21612 + for (j = 0; j < 10000; j++) {
21613 + val = tr32(GRC_EEPROM_ADDR);
21614 +
21615 + if (val & EEPROM_ADDR_COMPLETE)
21616 + break;
21617 + udelay(100);
21618 + }
21619 + if (!(val & EEPROM_ADDR_COMPLETE)) {
21620 + rc = -EBUSY;
21621 + break;
21622 + }
21623 + }
21624 +
21625 + return rc;
21626 +}
21627 +
21628 +/* offset and length are dword aligned */
21629 +static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
21630 + u8 *buf)
21631 +{
21632 + int ret = 0;
21633 + u32 pagesize = tp->nvram_pagesize;
21634 + u32 pagemask = pagesize - 1;
21635 + u32 nvram_cmd;
21636 + u8 *tmp;
21637 +
21638 + tmp = kmalloc(pagesize, GFP_KERNEL);
21639 + if (tmp == NULL)
21640 + return -ENOMEM;
21641 +
21642 + while (len) {
21643 + int j;
21644 + u32 phy_addr, page_off, size, nvaccess;
21645 +
21646 + phy_addr = offset & ~pagemask;
21647 +
21648 + for (j = 0; j < pagesize; j += 4) {
21649 + if ((ret = tg3_nvram_read(tp, phy_addr + j,
21650 + (u32 *) (tmp + j))))
21651 + break;
21652 + }
21653 + if (ret)
21654 + break;
21655 +
21656 + page_off = offset & pagemask;
21657 + size = pagesize;
21658 + if (len < size)
21659 + size = len;
21660 +
21661 + len -= size;
21662 +
21663 + memcpy(tmp + page_off, buf, size);
21664 +
21665 + offset = offset + (pagesize - page_off);
21666 +
21667 + nvaccess = tr32(NVRAM_ACCESS);
21668 + tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21669 +
21670 + /*
21671 + * Before we can erase the flash page, we need
21672 + * to issue a special "write enable" command.
21673 + */
21674 + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21675 +
21676 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21677 + break;
21678 +
21679 + /* Erase the target page */
21680 + tw32(NVRAM_ADDR, phy_addr);
21681 +
21682 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR |
21683 + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_ERASE;
21684 +
21685 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21686 + break;
21687 +
21688 + /* Issue another write enable to start the write. */
21689 + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21690 +
21691 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21692 + break;
21693 +
21694 + for (j = 0; j < pagesize; j += 4) {
21695 + u32 data;
21696 +
21697 + data = *((u32 *) (tmp + j));
21698 + tw32(NVRAM_WRDATA, cpu_to_be32(data));
21699 +
21700 + tw32(NVRAM_ADDR, phy_addr + j);
21701 +
21702 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE |
21703 + NVRAM_CMD_WR;
21704 +
21705 + if (j == 0)
21706 + nvram_cmd |= NVRAM_CMD_FIRST;
21707 + else if (j == (pagesize - 4))
21708 + nvram_cmd |= NVRAM_CMD_LAST;
21709 +
21710 + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd)))
21711 + break;
21712 + }
21713 + if (ret)
21714 + break;
21715 + }
21716 +
21717 + nvram_cmd = NVRAM_CMD_WRDI | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21718 + tg3_nvram_exec_cmd(tp, nvram_cmd);
21719 +
21720 + kfree(tmp);
21721 +
21722 + return ret;
21723 +}
21724 +
21725 +/* offset and length are dword aligned */
21726 +static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
21727 + u8 *buf)
21728 +{
21729 + int i, ret = 0;
21730 +
21731 + for (i = 0; i < len; i += 4, offset += 4) {
21732 + u32 data, page_off, phy_addr, nvram_cmd;
21733 +
21734 + memcpy(&data, buf + i, 4);
21735 + tw32(NVRAM_WRDATA, cpu_to_be32(data));
21736 +
21737 + page_off = offset % tp->nvram_pagesize;
21738 +
21739 + if ((tp->tg3_flags2 & TG3_FLG2_FLASH) &&
21740 + (tp->nvram_jedecnum == JEDEC_ATMEL)) {
21741 +
21742 + phy_addr = ((offset / tp->nvram_pagesize) <<
21743 + ATMEL_AT45DB0X1B_PAGE_POS) + page_off;
21744 + }
21745 + else {
21746 + phy_addr = offset;
21747 + }
21748 +
21749 + tw32(NVRAM_ADDR, phy_addr);
21750 +
21751 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR;
21752 +
21753 + if ((page_off == 0) || (i == 0))
21754 + nvram_cmd |= NVRAM_CMD_FIRST;
21755 + else if (page_off == (tp->nvram_pagesize - 4))
21756 + nvram_cmd |= NVRAM_CMD_LAST;
21757 +
21758 + if (i == (len - 4))
21759 + nvram_cmd |= NVRAM_CMD_LAST;
21760 +
21761 + if ((tp->nvram_jedecnum == JEDEC_ST) &&
21762 + (nvram_cmd & NVRAM_CMD_FIRST)) {
21763 +
21764 + if ((ret = tg3_nvram_exec_cmd(tp,
21765 + NVRAM_CMD_WREN | NVRAM_CMD_GO |
21766 + NVRAM_CMD_DONE)))
21767 +
21768 + break;
21769 + }
21770 + if (!(tp->tg3_flags2 & TG3_FLG2_FLASH)) {
21771 + /* We always do complete word writes to eeprom. */
21772 + nvram_cmd |= (NVRAM_CMD_FIRST | NVRAM_CMD_LAST);
21773 + }
21774 +
21775 + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd)))
21776 + break;
21777 + }
21778 + return ret;
21779 +}
21780 +
21781 +/* offset and length are dword aligned */
21782 +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
21783 +{
21784 + int ret;
21785 +
21786 + if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) {
21787 + printk(KERN_ERR PFX "Attempt to do nvram_write on Sun 570X\n");
21788 + return -EINVAL;
21789 + }
21790 +
21791 + if (tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) {
21792 + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
21793 + GRC_LCLCTRL_GPIO_OE1);
21794 + udelay(40);
21795 + }
21796 +
21797 + if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) {
21798 + ret = tg3_nvram_write_block_using_eeprom(tp, offset, len, buf);
21799 + }
21800 + else {
21801 + u32 grc_mode;
21802 +
21803 + tg3_nvram_lock(tp);
21804 +
21805 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21806 + u32 nvaccess = tr32(NVRAM_ACCESS);
21807 +
21808 + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21809 +
21810 + tw32(NVRAM_WRITE1, 0x406);
21811 + }
21812 +
21813 + grc_mode = tr32(GRC_MODE);
21814 + tw32(GRC_MODE, grc_mode | GRC_MODE_NVRAM_WR_ENABLE);
21815 +
21816 + if ((tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) ||
21817 + !(tp->tg3_flags2 & TG3_FLG2_FLASH)) {
21818 +
21819 + ret = tg3_nvram_write_block_buffered(tp, offset, len,
21820 + buf);
21821 + }
21822 + else {
21823 + ret = tg3_nvram_write_block_unbuffered(tp, offset, len,
21824 + buf);
21825 + }
21826 +
21827 + grc_mode = tr32(GRC_MODE);
21828 + tw32(GRC_MODE, grc_mode & ~GRC_MODE_NVRAM_WR_ENABLE);
21829 +
21830 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21831 + u32 nvaccess = tr32(NVRAM_ACCESS);
21832 +
21833 + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21834 + }
21835 + tg3_nvram_unlock(tp);
21836 + }
21837 +
21838 + if (tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) {
21839 + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
21840 + GRC_LCLCTRL_GPIO_OE1 | GRC_LCLCTRL_GPIO_OUTPUT1);
21841 + udelay(40);
21842 + }
21843 +
21844 + return ret;
21845 }
21846
21847 struct subsys_tbl_ent {
21848 @@ -7047,11 +7497,19 @@
21849 tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
21850 if (val == NIC_SRAM_DATA_SIG_MAGIC) {
21851 u32 nic_cfg, led_cfg;
21852 - u32 nic_phy_id, cfg2;
21853 + u32 nic_phy_id, ver, cfg2 = 0;
21854
21855 tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
21856 tp->nic_sram_data_cfg = nic_cfg;
21857
21858 + tg3_read_mem(tp, NIC_SRAM_DATA_VER, &ver);
21859 + ver >>= NIC_SRAM_DATA_VER_SHIFT;
21860 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) &&
21861 + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) &&
21862 + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5703) &&
21863 + (ver > 0) && (ver < 0x100))
21864 + tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &cfg2);
21865 +
21866 eeprom_signature_found = 1;
21867
21868 if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) ==
21869 @@ -7070,8 +7528,7 @@
21870 eeprom_phy_id = 0;
21871
21872 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21873 - tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &led_cfg);
21874 - led_cfg &= (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
21875 + led_cfg = cfg2 & (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
21876 SHASTA_EXT_LED_MODE_MASK);
21877 } else
21878 led_cfg = nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK;
21879 @@ -7116,9 +7573,8 @@
21880 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
21881 tp->led_ctrl = LED_CTRL_MODE_PHY_2;
21882
21883 - if (((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) ||
21884 - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
21885 - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) &&
21886 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) &&
21887 + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) &&
21888 (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP))
21889 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
21890
21891 @@ -7130,9 +7586,13 @@
21892 if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)
21893 tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP;
21894
21895 - tg3_read_mem(tp, NIC_SRAM_DATA_PHY_ID, &cfg2);
21896 if (cfg2 & (1 << 17))
21897 tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING;
21898 +
21899 + /* serdes signal pre-emphasis in register 0x590 set by */
21900 + /* bootcode if bit 18 is set */
21901 + if (cfg2 & (1 << 18))
21902 + tp->tg3_flags2 |= TG3_FLG2_SERDES_PREEMPHASIS;
21903 }
21904
21905 /* Reading the PHY ID register can conflict with ASF
21906 @@ -7188,9 +7648,8 @@
21907 u32 bmsr, adv_reg, tg3_ctrl;
21908
21909 tg3_readphy(tp, MII_BMSR, &bmsr);
21910 - tg3_readphy(tp, MII_BMSR, &bmsr);
21911 -
21912 - if (bmsr & BMSR_LSTATUS)
21913 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
21914 + (bmsr & BMSR_LSTATUS))
21915 goto skip_phy_reset;
21916
21917 err = tg3_phy_reset(tp);
21918 @@ -7414,6 +7873,9 @@
21919 tp->pci_hdr_type = (cacheline_sz_reg >> 16) & 0xff;
21920 tp->pci_bist = (cacheline_sz_reg >> 24) & 0xff;
21921
21922 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21923 + tp->tg3_flags2 |= TG3_FLG2_HW_TSO;
21924 +
21925 if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0)
21926 tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
21927
21928 @@ -8302,11 +8764,13 @@
21929 }
21930
21931 #if TG3_TSO_SUPPORT != 0
21932 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
21933 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
21934 + tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
21935 + }
21936 + else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
21937 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
21938 tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
21939 - ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 &&
21940 - GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)) {
21941 + (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
21942 tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
21943 } else {
21944 tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
21945 diff -Nur linux-2.4.29/drivers/net/tg3.h linux-mips/drivers/net/tg3.h
21946 --- linux-2.4.29/drivers/net/tg3.h 2004-11-17 12:54:21.000000000 +0100
21947 +++ linux-mips/drivers/net/tg3.h 2005-03-26 11:47:30.485648346 +0100
21948 @@ -1274,6 +1274,7 @@
21949 #define GRC_MODE_HOST_STACKUP 0x00010000
21950 #define GRC_MODE_HOST_SENDBDS 0x00020000
21951 #define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000
21952 +#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000
21953 #define GRC_MODE_NO_RX_PHDR_CSUM 0x00800000
21954 #define GRC_MODE_IRQ_ON_TX_CPU_ATTN 0x01000000
21955 #define GRC_MODE_IRQ_ON_RX_CPU_ATTN 0x02000000
21956 @@ -1366,6 +1367,8 @@
21957 #define NVRAM_CMD_ERASE 0x00000040
21958 #define NVRAM_CMD_FIRST 0x00000080
21959 #define NVRAM_CMD_LAST 0x00000100
21960 +#define NVRAM_CMD_WREN 0x00010000
21961 +#define NVRAM_CMD_WRDI 0x00020000
21962 #define NVRAM_STAT 0x00007004
21963 #define NVRAM_WRDATA 0x00007008
21964 #define NVRAM_ADDR 0x0000700c
21965 @@ -1375,8 +1378,18 @@
21966 #define NVRAM_CFG1_FLASHIF_ENAB 0x00000001
21967 #define NVRAM_CFG1_BUFFERED_MODE 0x00000002
21968 #define NVRAM_CFG1_PASS_THRU 0x00000004
21969 +#define NVRAM_CFG1_STATUS_BITS 0x00000070
21970 #define NVRAM_CFG1_BIT_BANG 0x00000008
21971 +#define NVRAM_CFG1_FLASH_SIZE 0x02000000
21972 #define NVRAM_CFG1_COMPAT_BYPASS 0x80000000
21973 +#define NVRAM_CFG1_VENDOR_MASK 0x03000003
21974 +#define FLASH_VENDOR_ATMEL_EEPROM 0x02000000
21975 +#define FLASH_VENDOR_ATMEL_FLASH_BUFFERED 0x02000003
21976 +#define FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED 0x00000003
21977 +#define FLASH_VENDOR_ST 0x03000001
21978 +#define FLASH_VENDOR_SAIFUN 0x01000003
21979 +#define FLASH_VENDOR_SST_SMALL 0x00000001
21980 +#define FLASH_VENDOR_SST_LARGE 0x02000001
21981 #define NVRAM_CFG2 0x00007018
21982 #define NVRAM_CFG3 0x0000701c
21983 #define NVRAM_SWARB 0x00007020
21984 @@ -1396,15 +1409,16 @@
21985 #define SWARB_REQ1 0x00002000
21986 #define SWARB_REQ2 0x00004000
21987 #define SWARB_REQ3 0x00008000
21988 -#define NVRAM_BUFFERED_PAGE_SIZE 264
21989 -#define NVRAM_BUFFERED_PAGE_POS 9
21990 #define NVRAM_ACCESS 0x00007024
21991 #define ACCESS_ENABLE 0x00000001
21992 #define ACCESS_WR_ENABLE 0x00000002
21993 -/* 0x7024 --> 0x7400 unused */
21994 +#define NVRAM_WRITE1 0x00007028
21995 +/* 0x702c --> 0x7400 unused */
21996
21997 /* 0x7400 --> 0x8000 unused */
21998
21999 +#define TG3_EEPROM_MAGIC 0x669955aa
22000 +
22001 /* 32K Window into NIC internal memory */
22002 #define NIC_SRAM_WIN_BASE 0x00008000
22003
22004 @@ -1438,6 +1452,9 @@
22005 #define NIC_SRAM_DATA_CFG_FIBER_WOL 0x00004000
22006 #define NIC_SRAM_DATA_CFG_NO_GPIO2 0x00100000
22007
22008 +#define NIC_SRAM_DATA_VER 0x00000b5c
22009 +#define NIC_SRAM_DATA_VER_SHIFT 16
22010 +
22011 #define NIC_SRAM_DATA_PHY_ID 0x00000b74
22012 #define NIC_SRAM_DATA_PHY_ID1_MASK 0xffff0000
22013 #define NIC_SRAM_DATA_PHY_ID2_MASK 0x0000ffff
22014 @@ -2090,6 +2107,9 @@
22015 #define TG3_FLG2_PHY_JUST_INITTED 0x00001000
22016 #define TG3_FLG2_PHY_SERDES 0x00002000
22017 #define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000
22018 +#define TG3_FLG2_FLASH 0x00008000
22019 +#define TG3_FLG2_HW_TSO 0x00010000
22020 +#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
22021
22022 u32 split_mode_max_reqs;
22023 #define SPLIT_MODE_5704_MAX_REQ 3
22024 @@ -2164,6 +2184,34 @@
22025 struct tg3_hw_stats *hw_stats;
22026 dma_addr_t stats_mapping;
22027 struct tq_struct reset_task;
22028 +
22029 + u32 nvram_size;
22030 + u32 nvram_pagesize;
22031 + u32 nvram_jedecnum;
22032 +
22033 +#define JEDEC_ATMEL 0x1f
22034 +#define JEDEC_ST 0x20
22035 +#define JEDEC_SAIFUN 0x4f
22036 +#define JEDEC_SST 0xbf
22037 +
22038 +#define ATMEL_AT24C64_CHIP_SIZE (64 * 1024)
22039 +#define ATMEL_AT24C64_PAGE_SIZE (32)
22040 +
22041 +#define ATMEL_AT24C512_CHIP_SIZE (512 * 1024)
22042 +#define ATMEL_AT24C512_PAGE_SIZE (128)
22043 +
22044 +#define ATMEL_AT45DB0X1B_PAGE_POS 9
22045 +#define ATMEL_AT45DB0X1B_PAGE_SIZE 264
22046 +
22047 +#define ATMEL_AT25F512_PAGE_SIZE 256
22048 +
22049 +#define ST_M45PEX0_PAGE_SIZE 256
22050 +
22051 +#define SAIFUN_SA25F0XX_PAGE_SIZE 256
22052 +
22053 +#define SST_25VF0X0_PAGE_SIZE 4098
22054 +
22055 +
22056 };
22057
22058 #endif /* !(_T3_H) */
22059 diff -Nur linux-2.4.29/drivers/net/tulip/21142.c linux-mips/drivers/net/tulip/21142.c
22060 --- linux-2.4.29/drivers/net/tulip/21142.c 2003-06-13 16:51:35.000000000 +0200
22061 +++ linux-mips/drivers/net/tulip/21142.c 2005-03-26 11:47:31.371502956 +0100
22062 @@ -14,8 +14,8 @@
22063
22064 */
22065
22066 -#include "tulip.h"
22067 #include <linux/pci.h>
22068 +#include "tulip.h"
22069 #include <linux/delay.h>
22070
22071
22072 diff -Nur linux-2.4.29/drivers/net/tulip/eeprom.c linux-mips/drivers/net/tulip/eeprom.c
22073 --- linux-2.4.29/drivers/net/tulip/eeprom.c 2003-06-13 16:51:35.000000000 +0200
22074 +++ linux-mips/drivers/net/tulip/eeprom.c 2005-03-26 11:47:31.372502792 +0100
22075 @@ -14,6 +14,7 @@
22076
22077 */
22078
22079 +#include <linux/pci.h>
22080 #include "tulip.h"
22081 #include <linux/init.h>
22082 #include <asm/unaligned.h>
22083 diff -Nur linux-2.4.29/drivers/net/tulip/interrupt.c linux-mips/drivers/net/tulip/interrupt.c
22084 --- linux-2.4.29/drivers/net/tulip/interrupt.c 2003-06-13 16:51:35.000000000 +0200
22085 +++ linux-mips/drivers/net/tulip/interrupt.c 2005-03-26 11:47:31.372502792 +0100
22086 @@ -14,10 +14,10 @@
22087
22088 */
22089
22090 +#include <linux/pci.h>
22091 #include "tulip.h"
22092 #include <linux/config.h>
22093 #include <linux/etherdevice.h>
22094 -#include <linux/pci.h>
22095
22096
22097 int tulip_rx_copybreak;
22098 diff -Nur linux-2.4.29/drivers/net/tulip/media.c linux-mips/drivers/net/tulip/media.c
22099 --- linux-2.4.29/drivers/net/tulip/media.c 2003-06-13 16:51:35.000000000 +0200
22100 +++ linux-mips/drivers/net/tulip/media.c 2005-03-26 11:47:31.373502628 +0100
22101 @@ -18,6 +18,7 @@
22102 #include <linux/mii.h>
22103 #include <linux/init.h>
22104 #include <linux/delay.h>
22105 +#include <linux/pci.h>
22106 #include "tulip.h"
22107
22108
22109 diff -Nur linux-2.4.29/drivers/net/tulip/pnic2.c linux-mips/drivers/net/tulip/pnic2.c
22110 --- linux-2.4.29/drivers/net/tulip/pnic2.c 2003-06-13 16:51:35.000000000 +0200
22111 +++ linux-mips/drivers/net/tulip/pnic2.c 2005-03-26 11:47:31.374502464 +0100
22112 @@ -76,8 +76,8 @@
22113
22114
22115
22116 -#include "tulip.h"
22117 #include <linux/pci.h>
22118 +#include "tulip.h"
22119 #include <linux/delay.h>
22120
22121
22122 diff -Nur linux-2.4.29/drivers/net/tulip/pnic.c linux-mips/drivers/net/tulip/pnic.c
22123 --- linux-2.4.29/drivers/net/tulip/pnic.c 2003-06-13 16:51:35.000000000 +0200
22124 +++ linux-mips/drivers/net/tulip/pnic.c 2005-03-26 11:47:31.374502464 +0100
22125 @@ -15,6 +15,7 @@
22126 */
22127
22128 #include <linux/kernel.h>
22129 +#include <linux/pci.h>
22130 #include "tulip.h"
22131
22132
22133 diff -Nur linux-2.4.29/drivers/net/tulip/timer.c linux-mips/drivers/net/tulip/timer.c
22134 --- linux-2.4.29/drivers/net/tulip/timer.c 2004-08-08 01:26:05.000000000 +0200
22135 +++ linux-mips/drivers/net/tulip/timer.c 2005-03-26 11:47:31.375502300 +0100
22136 @@ -14,6 +14,7 @@
22137
22138 */
22139
22140 +#include <linux/pci.h>
22141 #include "tulip.h"
22142
22143
22144 diff -Nur linux-2.4.29/drivers/net/tulip/tulip_core.c linux-mips/drivers/net/tulip/tulip_core.c
22145 --- linux-2.4.29/drivers/net/tulip/tulip_core.c 2004-08-08 01:26:05.000000000 +0200
22146 +++ linux-mips/drivers/net/tulip/tulip_core.c 2005-03-26 11:47:31.377501972 +0100
22147 @@ -20,8 +20,8 @@
22148
22149 #include <linux/config.h>
22150 #include <linux/module.h>
22151 -#include "tulip.h"
22152 #include <linux/pci.h>
22153 +#include "tulip.h"
22154 #include <linux/init.h>
22155 #include <linux/etherdevice.h>
22156 #include <linux/delay.h>
22157 diff -Nur linux-2.4.29/drivers/net/tulip/tulip.h linux-mips/drivers/net/tulip/tulip.h
22158 --- linux-2.4.29/drivers/net/tulip/tulip.h 2002-11-29 00:53:14.000000000 +0100
22159 +++ linux-mips/drivers/net/tulip/tulip.h 2005-03-26 11:47:31.375502300 +0100
22160 @@ -146,6 +146,9 @@
22161 TxIntr = 0x01,
22162 };
22163
22164 +/* bit mask for CSR5 TX/RX process state */
22165 +#define CSR5_TS 0x00700000
22166 +#define CSR5_RS 0x000e0000
22167
22168 enum tulip_mode_bits {
22169 TxThreshold = (1 << 22),
22170 @@ -484,9 +487,19 @@
22171 u32 csr6 = inl(ioaddr + CSR6);
22172
22173 if (csr6 & RxTx) {
22174 + unsigned i=1300/10;
22175 outl(csr6 & ~RxTx, ioaddr + CSR6);
22176 barrier();
22177 - (void) inl(ioaddr + CSR6); /* mmio sync */
22178 + /* wait until in-flight frame completes.
22179 + * Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin)
22180 + * Typically expect this loop to end in < 50us on 100BT.
22181 + */
22182 + while (--i && (inl(ioaddr + CSR5) & (CSR5_TS|CSR5_RS)))
22183 + udelay(10);
22184 +
22185 + if (!i)
22186 + printk (KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
22187 + tp->pdev->slot_name);
22188 }
22189 }
22190
22191 diff -Nur linux-2.4.29/drivers/pci/pci.c linux-mips/drivers/pci/pci.c
22192 --- linux-2.4.29/drivers/pci/pci.c 2004-11-17 12:54:21.000000000 +0100
22193 +++ linux-mips/drivers/pci/pci.c 2004-11-19 01:28:41.000000000 +0100
22194 @@ -1281,11 +1281,17 @@
22195 {
22196 unsigned int buses;
22197 unsigned short cr;
22198 + unsigned short bctl;
22199 struct pci_bus *child;
22200 int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
22201
22202 pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
22203 DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n", dev->slot_name, buses & 0xffffff, pass);
22204 + /* Disable MasterAbortMode during probing to avoid reporting
22205 + of bus errors (in some architectures) */
22206 + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
22207 + pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
22208 + bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
22209 if ((buses & 0xffff00) && !pcibios_assign_all_busses()) {
22210 /*
22211 * Bus already configured by firmware, process it in the first
22212 @@ -1351,6 +1357,7 @@
22213 pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
22214 pci_write_config_word(dev, PCI_COMMAND, cr);
22215 }
22216 + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
22217 sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
22218 return max;
22219 }
22220 diff -Nur linux-2.4.29/drivers/pci/quirks.c linux-mips/drivers/pci/quirks.c
22221 --- linux-2.4.29/drivers/pci/quirks.c 2004-11-17 12:54:21.000000000 +0100
22222 +++ linux-mips/drivers/pci/quirks.c 2005-03-26 11:47:31.393499346 +0100
22223 @@ -368,9 +368,6 @@
22224 * non-x86 architectures (yes Via exists on PPC among other places),
22225 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
22226 * interrupts delivered properly.
22227 - *
22228 - * TODO: When we have device-specific interrupt routers,
22229 - * quirk_via_irqpic will go away from quirks.
22230 */
22231
22232 /*
22233 @@ -393,22 +390,6 @@
22234 d->irq = irq;
22235 }
22236
22237 -static void __init quirk_via_irqpic(struct pci_dev *dev)
22238 -{
22239 - u8 irq, new_irq = dev->irq & 0xf;
22240 -
22241 - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
22242 -
22243 - if (new_irq != irq) {
22244 - printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
22245 - dev->slot_name, irq, new_irq);
22246 -
22247 - udelay(15);
22248 - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
22249 - }
22250 -}
22251 -
22252 -
22253 /*
22254 * PIIX3 USB: We have to disable USB interrupts that are
22255 * hardwired to PIRQD# and may be shared with an
22256 @@ -639,12 +620,14 @@
22257 * VIA northbridges care about PCI_INTERRUPT_LINE
22258 */
22259
22260 -int interrupt_line_quirk;
22261 +int via_interrupt_line_quirk;
22262
22263 static void __init quirk_via_bridge(struct pci_dev *pdev)
22264 {
22265 - if(pdev->devfn == 0)
22266 - interrupt_line_quirk = 1;
22267 + if(pdev->devfn == 0) {
22268 + printk(KERN_INFO "PCI: Via IRQ fixup\n");
22269 + via_interrupt_line_quirk = 1;
22270 + }
22271 }
22272
22273 /*
22274 @@ -773,9 +756,6 @@
22275 #endif
22276 { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi },
22277 { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi },
22278 - { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irqpic },
22279 - { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irqpic },
22280 - { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_6, quirk_via_irqpic },
22281
22282 { PCI_FIXUP_FINAL, PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410, quirk_amd_ioapic },
22283 { PCI_FIXUP_FINAL, PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C, quirk_amd_ordering },
22284 diff -Nur linux-2.4.29/drivers/pcmcia/au1000_db1x00.c linux-mips/drivers/pcmcia/au1000_db1x00.c
22285 --- linux-2.4.29/drivers/pcmcia/au1000_db1x00.c 2005-01-19 15:09:57.000000000 +0100
22286 +++ linux-mips/drivers/pcmcia/au1000_db1x00.c 2005-03-26 11:47:31.434492618 +0100
22287 @@ -1,6 +1,6 @@
22288 /*
22289 *
22290 - * Alchemy Semi Db1x00 boards specific pcmcia routines.
22291 + * AMD Alchemy DUAL-SLOT Db1x00 boards' specific pcmcia routines.
22292 *
22293 * Copyright 2002 MontaVista Software Inc.
22294 * Author: MontaVista Software, Inc.
22295 @@ -54,9 +54,20 @@
22296 #include <asm/au1000.h>
22297 #include <asm/au1000_pcmcia.h>
22298
22299 +#if defined(CONFIG_MIPS_PB1200)
22300 +#include <asm/pb1200.h>
22301 +#elif defined(CONFIG_MIPS_DB1200)
22302 +#include <asm/db1200.h>
22303 +#else
22304 #include <asm/db1x00.h>
22305 +#endif
22306
22307 -static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
22308 +#define PCMCIA_MAX_SOCK 1
22309 +#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
22310 +
22311 +/* VPP/VCC */
22312 +#define SET_VCC_VPP(VCC, VPP, SLOT)\
22313 + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
22314
22315 static int db1x00_pcmcia_init(struct pcmcia_init *init)
22316 {
22317 @@ -76,7 +87,7 @@
22318 db1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
22319 {
22320 u32 inserted;
22321 - unsigned char vs;
22322 + u16 vs;
22323
22324 if(sock > PCMCIA_MAX_SOCK) return -1;
22325
22326 @@ -87,11 +98,11 @@
22327
22328 if (sock == 0) {
22329 vs = bcsr->status & 0x3;
22330 - inserted = !(bcsr->status & (1<<4));
22331 + inserted = BOARD_CARD_INSERTED(0);
22332 }
22333 else {
22334 vs = (bcsr->status & 0xC)>>2;
22335 - inserted = !(bcsr->status & (1<<5));
22336 + inserted = BOARD_CARD_INSERTED(1);
22337 }
22338
22339 DEBUG(KERN_DEBUG "db1x00 socket %d: inserted %d, vs %d\n",
22340 @@ -144,16 +155,9 @@
22341 if(info->sock > PCMCIA_MAX_SOCK) return -1;
22342
22343 if(info->sock == 0)
22344 -#ifdef CONFIG_MIPS_DB1550
22345 - info->irq = AU1000_GPIO_3;
22346 + info->irq = BOARD_PC0_INT;
22347 else
22348 - info->irq = AU1000_GPIO_5;
22349 -#else
22350 - info->irq = AU1000_GPIO_2;
22351 - else
22352 - info->irq = AU1000_GPIO_5;
22353 -#endif
22354 -
22355 + info->irq = BOARD_PC1_INT;
22356 return 0;
22357 }
22358
22359 diff -Nur linux-2.4.29/drivers/pcmcia/cistpl.c linux-mips/drivers/pcmcia/cistpl.c
22360 --- linux-2.4.29/drivers/pcmcia/cistpl.c 2004-02-18 14:36:31.000000000 +0100
22361 +++ linux-mips/drivers/pcmcia/cistpl.c 2005-03-26 11:47:31.435492454 +0100
22362 @@ -140,7 +140,6 @@
22363 } else {
22364 u_int inc = 1;
22365 if (attr) { mem->flags |= MAP_ATTRIB; inc++; addr *= 2; }
22366 - sys += (addr & (s->cap.map_size-1));
22367 mem->card_start = addr & ~(s->cap.map_size-1);
22368 while (len) {
22369 set_cis_map(s, mem);
22370 diff -Nur linux-2.4.29/drivers/pcmcia/Config.in linux-mips/drivers/pcmcia/Config.in
22371 --- linux-2.4.29/drivers/pcmcia/Config.in 2004-02-18 14:36:31.000000000 +0100
22372 +++ linux-mips/drivers/pcmcia/Config.in 2004-02-22 06:21:34.000000000 +0100
22373 @@ -30,16 +30,14 @@
22374 dep_tristate ' M8xx support' CONFIG_PCMCIA_M8XX $CONFIG_PCMCIA
22375 fi
22376 if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
22377 - dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
22378 - if [ "$CONFIG_PCMCIA_AU1X00" != "n" ]; then
22379 - bool ' Pb1x00 board support' CONFIG_PCMCIA_PB1X00
22380 - bool ' Db1x00 board support' CONFIG_PCMCIA_DB1X00
22381 - bool ' XXS1500 board support' CONFIG_PCMCIA_XXS1500
22382 - fi
22383 + dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
22384 fi
22385 if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
22386 dep_bool ' SiByte PCMCIA support' CONFIG_PCMCIA_SIBYTE $CONFIG_PCMCIA $CONFIG_BLK_DEV_IDE_SIBYTE
22387 fi
22388 + if [ "$CONFIG_VRC4171" = "y" -o "$CONFIG_VRC4171" = "m" ]; then
22389 + dep_tristate ' NEC VRC4171 Card Controllers support' CONFIG_PCMCIA_VRC4171 $CONFIG_PCMCIA
22390 + fi
22391 if [ "$CONFIG_VRC4173" = "y" -o "$CONFIG_VRC4173" = "m" ]; then
22392 dep_tristate ' NEC VRC4173 CARDU support' CONFIG_PCMCIA_VRC4173 $CONFIG_PCMCIA
22393 fi
22394 diff -Nur linux-2.4.29/drivers/pcmcia/Makefile linux-mips/drivers/pcmcia/Makefile
22395 --- linux-2.4.29/drivers/pcmcia/Makefile 2004-02-18 14:36:31.000000000 +0100
22396 +++ linux-mips/drivers/pcmcia/Makefile 2005-03-26 11:47:31.433492782 +0100
22397 @@ -61,9 +61,18 @@
22398
22399 obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
22400 au1000_ss-objs-y := au1000_generic.o
22401 -au1000_ss-objs-$(CONFIG_PCMCIA_PB1X00) += au1000_pb1x00.o
22402 -au1000_ss-objs-$(CONFIG_PCMCIA_DB1X00) += au1000_db1x00.o
22403 -au1000_ss-objs-$(CONFIG_PCMCIA_XXS1500) += au1000_xxs1500.o
22404 +au1000_ss-objs-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
22405 +au1000_ss-objs-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o
22406 +au1000_ss-objs-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o
22407 +au1000_ss-objs-$(CONFIG_MIPS_PB1550) += au1000_pb1550.o
22408 +au1000_ss-objs-$(CONFIG_MIPS_PB1200) += au1000_db1x00.o
22409 +au1000_ss-objs-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o
22410 +au1000_ss-objs-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o
22411 +au1000_ss-objs-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o
22412 +au1000_ss-objs-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o
22413 +au1000_ss-objs-$(CONFIG_MIPS_DB1200) += au1000_db1x00.o
22414 +au1000_ss-objs-$(CONFIG_MIPS_HYDROGEN3) += au1000_hydrogen3.o
22415 +au1000_ss-objs-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o
22416
22417 obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
22418 obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
22419 @@ -89,6 +98,7 @@
22420 sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
22421 sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
22422
22423 +obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
22424 obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
22425
22426 include $(TOPDIR)/Rules.make
22427 diff -Nur linux-2.4.29/drivers/pcmcia/vrc4171_card.c linux-mips/drivers/pcmcia/vrc4171_card.c
22428 --- linux-2.4.29/drivers/pcmcia/vrc4171_card.c 1970-01-01 01:00:00.000000000 +0100
22429 +++ linux-mips/drivers/pcmcia/vrc4171_card.c 2004-01-19 16:54:58.000000000 +0100
22430 @@ -0,0 +1,886 @@
22431 +/*
22432 + * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services.
22433 + *
22434 + * Copyright (C) 2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
22435 + *
22436 + * This program is free software; you can redistribute it and/or modify
22437 + * it under the terms of the GNU General Public License as published by
22438 + * the Free Software Foundation; either version 2 of the License, or
22439 + * (at your option) any later version.
22440 + *
22441 + * This program is distributed in the hope that it will be useful,
22442 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22443 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22444 + * GNU General Public License for more details.
22445 + *
22446 + * You should have received a copy of the GNU General Public License
22447 + * along with this program; if not, write to the Free Software
22448 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22449 + */
22450 +#include <linux/init.h>
22451 +#include <linux/ioport.h>
22452 +#include <linux/irq.h>
22453 +#include <linux/module.h>
22454 +#include <linux/spinlock.h>
22455 +#include <linux/sched.h>
22456 +#include <linux/types.h>
22457 +
22458 +#include <asm/io.h>
22459 +#include <asm/vr41xx/vrc4171.h>
22460 +
22461 +#include <pcmcia/ss.h>
22462 +
22463 +#include "i82365.h"
22464 +
22465 +MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Services");
22466 +MODULE_AUTHOR("Yoichi Yuasa <yuasa@hh.iij4u.or.jp>");
22467 +MODULE_LICENSE("GPL");
22468 +
22469 +#define CARD_MAX_SLOTS 2
22470 +#define CARD_SLOTA 0
22471 +#define CARD_SLOTB 1
22472 +#define CARD_SLOTB_OFFSET 0x40
22473 +
22474 +#define CARD_MEM_START 0x10000000
22475 +#define CARD_MEM_END 0x13ffffff
22476 +#define CARD_MAX_MEM_OFFSET 0x3ffffff
22477 +#define CARD_MAX_MEM_SPEED 1000
22478 +
22479 +#define CARD_CONTROLLER_INDEX 0x03e0
22480 +#define CARD_CONTROLLER_DATA 0x03e1
22481 +#define CARD_CONTROLLER_SIZE 2
22482 + /* Power register */
22483 + #define VPP_GET_VCC 0x01
22484 + #define POWER_ENABLE 0x10
22485 + #define CARD_VOLTAGE_SENSE 0x1f
22486 + #define VCC_3VORXV_CAPABLE 0x00
22487 + #define VCC_XV_ONLY 0x01
22488 + #define VCC_3V_CAPABLE 0x02
22489 + #define VCC_5V_ONLY 0x03
22490 + #define CARD_VOLTAGE_SELECT 0x2f
22491 + #define VCC_3V 0x01
22492 + #define VCC_5V 0x00
22493 + #define VCC_XV 0x02
22494 + #define VCC_STATUS_3V 0x02
22495 + #define VCC_STATUS_5V 0x01
22496 + #define VCC_STATUS_XV 0x03
22497 + #define GLOBAL_CONTROL 0x1e
22498 + #define EXWRBK 0x04
22499 + #define IRQPM_EN 0x08
22500 + #define CLRPMIRQ 0x10
22501 +
22502 +#define IO_MAX_MAPS 2
22503 +#define MEM_MAX_MAPS 5
22504 +
22505 +enum {
22506 + SLOTB_PROBE = 0,
22507 + SLOTB_NOPROBE_IO,
22508 + SLOTB_NOPROBE_MEM,
22509 + SLOTB_NOPROBE_ALL
22510 +};
22511 +
22512 +typedef struct vrc4171_socket {
22513 + int noprobe;
22514 + void (*handler)(void *, unsigned int);
22515 + void *info;
22516 + socket_cap_t cap;
22517 + spinlock_t event_lock;
22518 + uint16_t events;
22519 + struct socket_info_t *pcmcia_socket;
22520 + struct tq_struct tq_task;
22521 + char name[24];
22522 + int csc_irq;
22523 + int io_irq;
22524 +} vrc4171_socket_t;
22525 +
22526 +static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
22527 +static int vrc4171_slotb = SLOTB_IS_NONE;
22528 +static unsigned int vrc4171_irq;
22529 +static uint16_t vrc4171_irq_mask = 0xdeb8;
22530 +
22531 +extern struct socket_info_t *pcmcia_register_socket(int slot,
22532 + struct pccard_operations *vtable,
22533 + int use_bus_pm);
22534 +extern void pcmcia_unregister_socket(struct socket_info_t *s);
22535 +
22536 +static inline uint8_t exca_read_byte(int slot, uint8_t index)
22537 +{
22538 + if (slot == CARD_SLOTB)
22539 + index += CARD_SLOTB_OFFSET;
22540 +
22541 + outb(index, CARD_CONTROLLER_INDEX);
22542 + return inb(CARD_CONTROLLER_DATA);
22543 +}
22544 +
22545 +static inline uint16_t exca_read_word(int slot, uint8_t index)
22546 +{
22547 + uint16_t data;
22548 +
22549 + if (slot == CARD_SLOTB)
22550 + index += CARD_SLOTB_OFFSET;
22551 +
22552 + outb(index++, CARD_CONTROLLER_INDEX);
22553 + data = inb(CARD_CONTROLLER_DATA);
22554 +
22555 + outb(index, CARD_CONTROLLER_INDEX);
22556 + data |= ((uint16_t)inb(CARD_CONTROLLER_DATA)) << 8;
22557 +
22558 + return data;
22559 +}
22560 +
22561 +static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t data)
22562 +{
22563 + if (slot == CARD_SLOTB)
22564 + index += CARD_SLOTB_OFFSET;
22565 +
22566 + outb(index, CARD_CONTROLLER_INDEX);
22567 + outb(data, CARD_CONTROLLER_DATA);
22568 +
22569 + return data;
22570 +}
22571 +
22572 +static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t data)
22573 +{
22574 + if (slot == CARD_SLOTB)
22575 + index += CARD_SLOTB_OFFSET;
22576 +
22577 + outb(index++, CARD_CONTROLLER_INDEX);
22578 + outb(data, CARD_CONTROLLER_DATA);
22579 +
22580 + outb(index, CARD_CONTROLLER_INDEX);
22581 + outb((uint8_t)(data >> 8), CARD_CONTROLLER_DATA);
22582 +
22583 + return data;
22584 +}
22585 +
22586 +static inline int search_nonuse_irq(void)
22587 +{
22588 + int i;
22589 +
22590 + for (i = 0; i < 16; i++) {
22591 + if (vrc4171_irq_mask & (1 << i)) {
22592 + vrc4171_irq_mask &= ~(1 << i);
22593 + return i;
22594 + }
22595 + }
22596 +
22597 + return -1;
22598 +}
22599 +
22600 +static int pccard_init(unsigned int slot)
22601 +{
22602 + vrc4171_socket_t *socket = &vrc4171_sockets[slot];
22603 +
22604 + socket->cap.features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
22605 + socket->cap.irq_mask = 0;
22606 + socket->cap.pci_irq = vrc4171_irq;
22607 + socket->cap.map_size = 0x1000;
22608 + socket->events = 0;
22609 + spin_lock_init(socket->event_lock);
22610 + socket->csc_irq = search_nonuse_irq();
22611 + socket->io_irq = search_nonuse_irq();
22612 +
22613 + return 0;
22614 +}
22615 +
22616 +static int pccard_suspend(unsigned int slot)
22617 +{
22618 + return -EINVAL;
22619 +}
22620 +
22621 +static int pccard_register_callback(unsigned int slot,
22622 + void (*handler)(void *, unsigned int),
22623 + void *info)
22624 +{
22625 + vrc4171_socket_t *socket;
22626 +
22627 + if (slot >= CARD_MAX_SLOTS)
22628 + return -EINVAL;
22629 +
22630 + socket = &vrc4171_sockets[slot];
22631 +
22632 + socket->handler = handler;
22633 + socket->info = info;
22634 +
22635 + if (handler)
22636 + MOD_INC_USE_COUNT;
22637 + else
22638 + MOD_DEC_USE_COUNT;
22639 +
22640 + return 0;
22641 +}
22642 +
22643 +static int pccard_inquire_socket(unsigned int slot, socket_cap_t *cap)
22644 +{
22645 + vrc4171_socket_t *socket;
22646 +
22647 + if (slot >= CARD_MAX_SLOTS || cap == NULL)
22648 + return -EINVAL;
22649 +
22650 + socket = &vrc4171_sockets[slot];
22651 +
22652 + *cap = socket->cap;
22653 +
22654 + return 0;
22655 +}
22656 +
22657 +static int pccard_get_status(unsigned int slot, u_int *value)
22658 +{
22659 + uint8_t status, sense;
22660 + u_int val = 0;
22661 +
22662 + if (slot >= CARD_MAX_SLOTS || value == NULL)
22663 + return -EINVAL;
22664 +
22665 + status = exca_read_byte(slot, I365_STATUS);
22666 + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
22667 + if (status & I365_CS_STSCHG)
22668 + val |= SS_STSCHG;
22669 + } else {
22670 + if (!(status & I365_CS_BVD1))
22671 + val |= SS_BATDEAD;
22672 + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
22673 + val |= SS_BATWARN;
22674 + }
22675 + if ((status & I365_CS_DETECT) == I365_CS_DETECT)
22676 + val |= SS_DETECT;
22677 + if (status & I365_CS_WRPROT)
22678 + val |= SS_WRPROT;
22679 + if (status & I365_CS_READY)
22680 + val |= SS_READY;
22681 + if (status & I365_CS_POWERON)
22682 + val |= SS_POWERON;
22683 +
22684 + sense = exca_read_byte(slot, CARD_VOLTAGE_SENSE);
22685 + switch (sense) {
22686 + case VCC_3VORXV_CAPABLE:
22687 + val |= SS_3VCARD | SS_XVCARD;
22688 + break;
22689 + case VCC_XV_ONLY:
22690 + val |= SS_XVCARD;
22691 + break;
22692 + case VCC_3V_CAPABLE:
22693 + val |= SS_3VCARD;
22694 + break;
22695 + default:
22696 + /* 5V only */
22697 + break;
22698 + }
22699 +
22700 + *value = val;
22701 +
22702 + return 0;
22703 +}
22704 +
22705 +static inline u_char get_Vcc_value(uint8_t voltage)
22706 +{
22707 + switch (voltage) {
22708 + case VCC_STATUS_3V:
22709 + return 33;
22710 + case VCC_STATUS_5V:
22711 + return 50;
22712 + default:
22713 + break;
22714 + }
22715 +
22716 + return 0;
22717 +}
22718 +
22719 +static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
22720 +{
22721 + if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
22722 + return Vcc;
22723 +
22724 + return 0;
22725 +}
22726 +
22727 +static int pccard_get_socket(unsigned int slot, socket_state_t *state)
22728 +{
22729 + vrc4171_socket_t *socket;
22730 + uint8_t power, voltage, control, cscint;
22731 +
22732 + if (slot >= CARD_MAX_SLOTS || state == NULL)
22733 + return -EINVAL;
22734 +
22735 + socket = &vrc4171_sockets[slot];
22736 +
22737 + power = exca_read_byte(slot, I365_POWER);
22738 + voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
22739 +
22740 + state->Vcc = get_Vcc_value(voltage);
22741 + state->Vpp = get_Vpp_value(power, state->Vcc);
22742 +
22743 + state->flags = 0;
22744 + if (power & POWER_ENABLE)
22745 + state->flags |= SS_PWR_AUTO;
22746 + if (power & I365_PWR_OUT)
22747 + state->flags |= SS_OUTPUT_ENA;
22748 +
22749 + control = exca_read_byte(slot, I365_INTCTL);
22750 + if (control & I365_PC_IOCARD)
22751 + state->flags |= SS_IOCARD;
22752 + if (!(control & I365_PC_RESET))
22753 + state->flags |= SS_RESET;
22754 +
22755 + cscint = exca_read_byte(slot, I365_CSCINT);
22756 + state->csc_mask = 0;
22757 + if (state->flags & SS_IOCARD) {
22758 + if (cscint & I365_CSC_STSCHG)
22759 + state->flags |= SS_STSCHG;
22760 + } else {
22761 + if (cscint & I365_CSC_BVD1)
22762 + state->csc_mask |= SS_BATDEAD;
22763 + if (cscint & I365_CSC_BVD2)
22764 + state->csc_mask |= SS_BATWARN;
22765 + }
22766 + if (cscint & I365_CSC_READY)
22767 + state->csc_mask |= SS_READY;
22768 + if (cscint & I365_CSC_DETECT)
22769 + state->csc_mask |= SS_DETECT;
22770 +
22771 + return 0;
22772 +}
22773 +
22774 +static inline uint8_t set_Vcc_value(u_char Vcc)
22775 +{
22776 + switch (Vcc) {
22777 + case 33:
22778 + return VCC_3V;
22779 + case 50:
22780 + return VCC_5V;
22781 + }
22782 +
22783 + /* Small voltage is chosen for safety. */
22784 + return VCC_3V;
22785 +}
22786 +
22787 +static int pccard_set_socket(unsigned int slot, socket_state_t *state)
22788 +{
22789 + vrc4171_socket_t *socket;
22790 + uint8_t voltage, power, control, cscint;
22791 +
22792 + if (slot >= CARD_MAX_SLOTS ||
22793 + (state->Vpp != state->Vcc && state->Vpp != 0) ||
22794 + (state->Vcc != 50 && state->Vcc != 33 && state->Vcc != 0))
22795 + return -EINVAL;
22796 +
22797 + socket = &vrc4171_sockets[slot];
22798 +
22799 + spin_lock_irq(&socket->event_lock);
22800 +
22801 + voltage = set_Vcc_value(state->Vcc);
22802 + exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
22803 +
22804 + power = POWER_ENABLE;
22805 + if (state->Vpp == state->Vcc)
22806 + power |= VPP_GET_VCC;
22807 + if (state->flags & SS_OUTPUT_ENA)
22808 + power |= I365_PWR_OUT;
22809 + exca_write_byte(slot, I365_POWER, power);
22810 +
22811 + control = 0;
22812 + if (state->io_irq != 0)
22813 + control |= socket->io_irq;
22814 + if (state->flags & SS_IOCARD)
22815 + control |= I365_PC_IOCARD;
22816 + if (state->flags & SS_RESET)
22817 + control &= ~I365_PC_RESET;
22818 + else
22819 + control |= I365_PC_RESET;
22820 + exca_write_byte(slot, I365_INTCTL, control);
22821 +
22822 + cscint = 0;
22823 + exca_write_byte(slot, I365_CSCINT, cscint);
22824 + exca_read_byte(slot, I365_CSC); /* clear CardStatus change */
22825 + if (state->csc_mask != 0)
22826 + cscint |= socket->csc_irq << 8;
22827 + if (state->flags & SS_IOCARD) {
22828 + if (state->csc_mask & SS_STSCHG)
22829 + cscint |= I365_CSC_STSCHG;
22830 + } else {
22831 + if (state->csc_mask & SS_BATDEAD)
22832 + cscint |= I365_CSC_BVD1;
22833 + if (state->csc_mask & SS_BATWARN)
22834 + cscint |= I365_CSC_BVD2;
22835 + }
22836 + if (state->csc_mask & SS_READY)
22837 + cscint |= I365_CSC_READY;
22838 + if (state->csc_mask & SS_DETECT)
22839 + cscint |= I365_CSC_DETECT;
22840 + exca_write_byte(slot, I365_CSCINT, cscint);
22841 +
22842 + spin_unlock_irq(&socket->event_lock);
22843 +
22844 + return 0;
22845 +}
22846 +
22847 +static int pccard_get_io_map(unsigned int slot, struct pccard_io_map *io)
22848 +{
22849 + vrc4171_socket_t *socket;
22850 + uint8_t ioctl, addrwin;
22851 + u_char map;
22852 +
22853 + if (slot >= CARD_MAX_SLOTS || io == NULL ||
22854 + io->map >= IO_MAX_MAPS)
22855 + return -EINVAL;
22856 +
22857 + socket = &vrc4171_sockets[slot];
22858 + map = io->map;
22859 +
22860 + io->start = exca_read_word(slot, I365_IO(map)+I365_W_START);
22861 + io->stop = exca_read_word(slot, I365_IO(map)+I365_W_STOP);
22862 +
22863 + ioctl = exca_read_byte(slot, I365_IOCTL);
22864 + if (io->flags & I365_IOCTL_WAIT(map))
22865 + io->speed = 1;
22866 + else
22867 + io->speed = 0;
22868 +
22869 + io->flags = 0;
22870 + if (ioctl & I365_IOCTL_16BIT(map))
22871 + io->flags |= MAP_16BIT;
22872 + if (ioctl & I365_IOCTL_IOCS16(map))
22873 + io->flags |= MAP_AUTOSZ;
22874 + if (ioctl & I365_IOCTL_0WS(map))
22875 + io->flags |= MAP_0WS;
22876 +
22877 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22878 + if (addrwin & I365_ENA_IO(map))
22879 + io->flags |= MAP_ACTIVE;
22880 +
22881 + return 0;
22882 +}
22883 +
22884 +static int pccard_set_io_map(unsigned int slot, struct pccard_io_map *io)
22885 +{
22886 + vrc4171_socket_t *socket;
22887 + uint8_t ioctl, addrwin;
22888 + u_char map;
22889 +
22890 + if (slot >= CARD_MAX_SLOTS ||
22891 + io == NULL || io->map >= IO_MAX_MAPS ||
22892 + io->start > 0xffff || io->stop > 0xffff || io->start > io->stop)
22893 + return -EINVAL;
22894 +
22895 + socket = &vrc4171_sockets[slot];
22896 + map = io->map;
22897 +
22898 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22899 + if (addrwin & I365_ENA_IO(map)) {
22900 + addrwin &= ~I365_ENA_IO(map);
22901 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
22902 + }
22903 +
22904 + exca_write_word(slot, I365_IO(map)+I365_W_START, io->start);
22905 + exca_write_word(slot, I365_IO(map)+I365_W_STOP, io->stop);
22906 +
22907 + ioctl = 0;
22908 + if (io->speed > 0)
22909 + ioctl |= I365_IOCTL_WAIT(map);
22910 + if (io->flags & MAP_16BIT)
22911 + ioctl |= I365_IOCTL_16BIT(map);
22912 + if (io->flags & MAP_AUTOSZ)
22913 + ioctl |= I365_IOCTL_IOCS16(map);
22914 + if (io->flags & MAP_0WS)
22915 + ioctl |= I365_IOCTL_0WS(map);
22916 + exca_write_byte(slot, I365_IOCTL, ioctl);
22917 +
22918 + if (io->flags & MAP_ACTIVE) {
22919 + addrwin |= I365_ENA_IO(map);
22920 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
22921 + }
22922 +
22923 + return 0;
22924 +}
22925 +
22926 +static int pccard_get_mem_map(unsigned int slot, struct pccard_mem_map *mem)
22927 +{
22928 + vrc4171_socket_t *socket;
22929 + uint8_t addrwin;
22930 + u_long start, stop;
22931 + u_int offset;
22932 + u_char map;
22933 +
22934 + if (slot >= CARD_MAX_SLOTS || mem == NULL || mem->map >= MEM_MAX_MAPS)
22935 + return -EINVAL;
22936 +
22937 + socket = &vrc4171_sockets[slot];
22938 + map = mem->map;
22939 +
22940 + mem->flags = 0;
22941 + mem->speed = 0;
22942 +
22943 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22944 + if (addrwin & I365_ENA_MEM(map))
22945 + mem->flags |= MAP_ACTIVE;
22946 +
22947 + start = exca_read_word(slot, I365_MEM(map)+I365_W_START);
22948 + if (start & I365_MEM_16BIT)
22949 + mem->flags |= MAP_16BIT;
22950 + mem->sys_start = (start & 0x3fffUL) << 12;
22951 +
22952 + stop = exca_read_word(slot, I365_MEM(map)+I365_W_STOP);
22953 + if (start & I365_MEM_WS0)
22954 + mem->speed += 1;
22955 + if (start & I365_MEM_WS1)
22956 + mem->speed += 2;
22957 + mem->sys_stop = ((stop & 0x3fffUL) << 12) + 0xfffUL;
22958 +
22959 + offset = exca_read_word(slot, I365_MEM(map)+I365_W_OFF);
22960 + if (offset & I365_MEM_REG)
22961 + mem->flags |= MAP_ATTRIB;
22962 + if (offset & I365_MEM_WRPROT)
22963 + mem->flags |= MAP_WRPROT;
22964 + mem->card_start = (offset & 0x3fffUL) << 12;
22965 +
22966 + mem->sys_start += CARD_MEM_START;
22967 + mem->sys_stop += CARD_MEM_START;
22968 +
22969 + return 0;
22970 +}
22971 +
22972 +static int pccard_set_mem_map(unsigned int slot, struct pccard_mem_map *mem)
22973 +{
22974 + vrc4171_socket_t *socket;
22975 + uint16_t start, stop, offset;
22976 + uint8_t addrwin;
22977 + u_char map;
22978 +
22979 + if (slot >= CARD_MAX_SLOTS ||
22980 + mem == NULL || mem->map >= MEM_MAX_MAPS ||
22981 + mem->sys_start < CARD_MEM_START || mem->sys_start > CARD_MEM_END ||
22982 + mem->sys_stop < CARD_MEM_START || mem->sys_stop > CARD_MEM_END ||
22983 + mem->sys_start > mem->sys_stop ||
22984 + mem->card_start > CARD_MAX_MEM_OFFSET ||
22985 + mem->speed > CARD_MAX_MEM_SPEED)
22986 + return -EINVAL;
22987 +
22988 + socket = &vrc4171_sockets[slot];
22989 + map = mem->map;
22990 +
22991 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22992 + if (addrwin & I365_ENA_MEM(map)) {
22993 + addrwin &= ~I365_ENA_MEM(map);
22994 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
22995 + }
22996 +
22997 + start = (mem->sys_start >> 12) & 0x3fff;
22998 + if (mem->flags & MAP_16BIT)
22999 + start |= I365_MEM_16BIT;
23000 + exca_write_word(slot, I365_MEM(map)+I365_W_START, start);
23001 +
23002 + stop = (mem->sys_stop >> 12) & 0x3fff;
23003 + switch (mem->speed) {
23004 + case 0:
23005 + break;
23006 + case 1:
23007 + stop |= I365_MEM_WS0;
23008 + break;
23009 + case 2:
23010 + stop |= I365_MEM_WS1;
23011 + break;
23012 + default:
23013 + stop |= I365_MEM_WS0 | I365_MEM_WS1;
23014 + break;
23015 + }
23016 + exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop);
23017 +
23018 + offset = (mem->card_start >> 12) & 0x3fff;
23019 + if (mem->flags & MAP_ATTRIB)
23020 + offset |= I365_MEM_REG;
23021 + if (mem->flags & MAP_WRPROT)
23022 + offset |= I365_MEM_WRPROT;
23023 + exca_write_word(slot, I365_MEM(map)+I365_W_OFF, offset);
23024 +
23025 + if (mem->flags & MAP_ACTIVE) {
23026 + addrwin |= I365_ENA_MEM(map);
23027 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23028 + }
23029 +
23030 + return 0;
23031 +}
23032 +
23033 +static void pccard_proc_setup(unsigned int slot, struct proc_dir_entry *base)
23034 +{
23035 +}
23036 +
23037 +static struct pccard_operations vrc4171_pccard_operations = {
23038 + .init = pccard_init,
23039 + .suspend = pccard_suspend,
23040 + .register_callback = pccard_register_callback,
23041 + .inquire_socket = pccard_inquire_socket,
23042 + .get_status = pccard_get_status,
23043 + .get_socket = pccard_get_socket,
23044 + .set_socket = pccard_set_socket,
23045 + .get_io_map = pccard_get_io_map,
23046 + .set_io_map = pccard_set_io_map,
23047 + .get_mem_map = pccard_get_mem_map,
23048 + .set_mem_map = pccard_set_mem_map,
23049 + .proc_setup = pccard_proc_setup,
23050 +};
23051 +
23052 +static void pccard_bh(void *data)
23053 +{
23054 + vrc4171_socket_t *socket = (vrc4171_socket_t *)data;
23055 + uint16_t events;
23056 +
23057 + spin_lock_irq(&socket->event_lock);
23058 + events = socket->events;
23059 + socket->events = 0;
23060 + spin_unlock_irq(&socket->event_lock);
23061 +
23062 + if (socket->handler)
23063 + socket->handler(socket->info, events);
23064 +}
23065 +
23066 +static inline uint16_t get_events(int slot)
23067 +{
23068 + uint16_t events = 0;
23069 + uint8_t status, csc;
23070 +
23071 + status = exca_read_byte(slot, I365_STATUS);
23072 + csc = exca_read_byte(slot, I365_CSC);
23073 +
23074 + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
23075 + if ((csc & I365_CSC_STSCHG) && (status & I365_CS_STSCHG))
23076 + events |= SS_STSCHG;
23077 + } else {
23078 + if (csc & (I365_CSC_BVD1 | I365_CSC_BVD2)) {
23079 + if (!(status & I365_CS_BVD1))
23080 + events |= SS_BATDEAD;
23081 + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
23082 + events |= SS_BATWARN;
23083 + }
23084 + }
23085 + if ((csc & I365_CSC_READY) && (status & I365_CS_READY))
23086 + events |= SS_READY;
23087 + if ((csc & I365_CSC_DETECT) && ((status & I365_CS_DETECT) == I365_CS_DETECT))
23088 + events |= SS_DETECT;
23089 +
23090 + return events;
23091 +}
23092 +
23093 +static void pccard_status_change(int slot, vrc4171_socket_t *socket)
23094 +{
23095 + uint16_t events;
23096 +
23097 + socket->tq_task.routine = pccard_bh;
23098 + socket->tq_task.data = socket;
23099 +
23100 + events = get_events(slot);
23101 + if (events) {
23102 + spin_lock(&socket->event_lock);
23103 + socket->events |= events;
23104 + spin_unlock(&socket->event_lock);
23105 + schedule_task(&socket->tq_task);
23106 + }
23107 +}
23108 +
23109 +static void pccard_interrupt(int irq, void *dev_id, struct pt_regs *regs)
23110 +{
23111 + vrc4171_socket_t *socket;
23112 + uint16_t status;
23113 +
23114 + status = vrc4171_get_irq_status();
23115 + if (status & IRQ_A) {
23116 + socket = &vrc4171_sockets[CARD_SLOTA];
23117 + if (socket->noprobe == SLOTB_PROBE) {
23118 + if (status & (1 << socket->csc_irq))
23119 + pccard_status_change(CARD_SLOTA, socket);
23120 + }
23121 + }
23122 +
23123 + if (status & IRQ_B) {
23124 + socket = &vrc4171_sockets[CARD_SLOTB];
23125 + if (socket->noprobe == SLOTB_PROBE) {
23126 + if (status & (1 << socket->csc_irq))
23127 + pccard_status_change(CARD_SLOTB, socket);
23128 + }
23129 + }
23130 +}
23131 +
23132 +static inline void reserve_using_irq(int slot)
23133 +{
23134 + unsigned int irq;
23135 +
23136 + irq = exca_read_byte(slot, I365_INTCTL);
23137 + irq &= 0x0f;
23138 + vrc4171_irq_mask &= ~(1 << irq);
23139 +
23140 + irq = exca_read_byte(slot, I365_CSCINT);
23141 + irq = (irq & 0xf0) >> 4;
23142 + vrc4171_irq_mask &= ~(1 << irq);
23143 +}
23144 +
23145 +static int __devinit vrc4171_add_socket(int slot)
23146 +{
23147 + vrc4171_socket_t *socket;
23148 +
23149 + if (slot >= CARD_MAX_SLOTS)
23150 + return -EINVAL;
23151 +
23152 + socket = &vrc4171_sockets[slot];
23153 + if (socket->noprobe != SLOTB_PROBE) {
23154 + uint8_t addrwin;
23155 +
23156 + switch (socket->noprobe) {
23157 + case SLOTB_NOPROBE_MEM:
23158 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
23159 + addrwin &= 0x1f;
23160 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23161 + break;
23162 + case SLOTB_NOPROBE_IO:
23163 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
23164 + addrwin &= 0xc0;
23165 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23166 + break;
23167 + default:
23168 + break;
23169 + }
23170 +
23171 + reserve_using_irq(slot);
23172 +
23173 + return 0;
23174 + }
23175 +
23176 + sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot);
23177 +
23178 + socket->pcmcia_socket = pcmcia_register_socket(slot, &vrc4171_pccard_operations, 1);
23179 + if (socket->pcmcia_socket == NULL)
23180 + return -ENOMEM;
23181 +
23182 + exca_write_byte(slot, I365_ADDRWIN, 0);
23183 +
23184 + exca_write_byte(slot, GLOBAL_CONTROL, 0);
23185 +
23186 + return 0;
23187 +}
23188 +
23189 +static void vrc4171_remove_socket(int slot)
23190 +{
23191 + vrc4171_socket_t *socket;
23192 +
23193 + if (slot >= CARD_MAX_SLOTS)
23194 + return;
23195 +
23196 + socket = &vrc4171_sockets[slot];
23197 +
23198 + if (socket->pcmcia_socket != NULL) {
23199 + pcmcia_unregister_socket(socket->pcmcia_socket);
23200 + socket->pcmcia_socket = NULL;
23201 + }
23202 +}
23203 +
23204 +static int __devinit vrc4171_card_setup(char *options)
23205 +{
23206 + if (options == NULL || *options == '\0')
23207 + return 0;
23208 +
23209 + if (strncmp(options, "irq:", 4) == 0) {
23210 + int irq;
23211 + options += 4;
23212 + irq = simple_strtoul(options, &options, 0);
23213 + if (irq >= 0 && irq < NR_IRQS)
23214 + vrc4171_irq = irq;
23215 +
23216 + if (*options != ',')
23217 + return 0;
23218 + options++;
23219 + }
23220 +
23221 + if (strncmp(options, "slota:", 6) == 0) {
23222 + options += 6;
23223 + if (*options != '\0') {
23224 + if (strncmp(options, "noprobe", 7) == 0) {
23225 + vrc4171_sockets[CARD_SLOTA].noprobe = 1;
23226 + options += 7;
23227 + }
23228 +
23229 + if (*options != ',')
23230 + return 0;
23231 + options++;
23232 + } else
23233 + return 0;
23234 +
23235 + }
23236 +
23237 + if (strncmp(options, "slotb:", 6) == 0) {
23238 + options += 6;
23239 + if (*options != '\0') {
23240 + if (strncmp(options, "pccard", 6) == 0) {
23241 + vrc4171_slotb = SLOTB_IS_PCCARD;
23242 + options += 6;
23243 + } else if (strncmp(options, "cf", 2) == 0) {
23244 + vrc4171_slotb = SLOTB_IS_CF;
23245 + options += 2;
23246 + } else if (strncmp(options, "flashrom", 8) == 0) {
23247 + vrc4171_slotb = SLOTB_IS_FLASHROM;
23248 + options += 8;
23249 + } else if (strncmp(options, "none", 4) == 0) {
23250 + vrc4171_slotb = SLOTB_IS_NONE;
23251 + options += 4;
23252 + }
23253 +
23254 + if (*options != ',')
23255 + return 0;
23256 + options++;
23257 +
23258 + if ( strncmp(options, "memnoprobe", 10) == 0)
23259 + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_MEM;
23260 + if ( strncmp(options, "ionoprobe", 9) == 0)
23261 + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_IO;
23262 + if ( strncmp(options, "noprobe", 7) == 0)
23263 + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_ALL;
23264 + }
23265 + }
23266 +
23267 + return 0;
23268 +}
23269 +
23270 +__setup("vrc4171_card=", vrc4171_card_setup);
23271 +
23272 +static int __devinit vrc4171_card_init(void)
23273 +{
23274 + int retval, slot;
23275 +
23276 + vrc4171_set_multifunction_pin(vrc4171_slotb);
23277 +
23278 + if (request_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE,
23279 + "NEC VRC4171 Card Controller") == NULL)
23280 + return -EBUSY;
23281 +
23282 + for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
23283 + if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE)
23284 + break;
23285 +
23286 + retval = vrc4171_add_socket(slot);
23287 + if (retval != 0)
23288 + return retval;
23289 + }
23290 +
23291 + retval = request_irq(vrc4171_irq, pccard_interrupt, SA_SHIRQ,
23292 + "NEC VRC4171 Card Controller", vrc4171_sockets);
23293 + if (retval < 0) {
23294 + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
23295 + vrc4171_remove_socket(slot);
23296 +
23297 + return retval;
23298 + }
23299 +
23300 + printk(KERN_INFO "NEC VRC4171 Card Controller, connected to IRQ %d\n", vrc4171_irq);
23301 +
23302 + return 0;
23303 +}
23304 +
23305 +static void __devexit vrc4171_card_exit(void)
23306 +{
23307 + int slot;
23308 +
23309 + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
23310 + vrc4171_remove_socket(slot);
23311 +
23312 + release_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE);
23313 +}
23314 +
23315 +module_init(vrc4171_card_init);
23316 +module_exit(vrc4171_card_exit);
23317 diff -Nur linux-2.4.29/drivers/sbus/audio/audio.c linux-mips/drivers/sbus/audio/audio.c
23318 --- linux-2.4.29/drivers/sbus/audio/audio.c 2001-10-11 08:42:46.000000000 +0200
23319 +++ linux-mips/drivers/sbus/audio/audio.c 2005-03-26 11:47:32.089385135 +0100
23320 @@ -65,6 +65,14 @@
23321 #define tprintk(x)
23322 #endif
23323
23324 +static int audio_input_buffers = 8;
23325 +MODULE_PARM(audio_input_buffers, "i");
23326 +MODULE_PARM_DESC(audio_input_buffers,"Number of input 8KB buffers.");
23327 +
23328 +static int audio_output_buffers = 8;
23329 +MODULE_PARM(audio_output_buffers, "i");
23330 +MODULE_PARM_DESC(audio_output_buffers,"Number of output 8KB buffer.");
23331 +
23332 static short lis_get_elist_ent( strevent_t *list, pid_t pid );
23333 static int lis_add_to_elist( strevent_t **list, pid_t pid, short events );
23334 static int lis_del_from_elist( strevent_t **list, pid_t pid, short events );
23335 @@ -438,7 +446,7 @@
23336 m = drv->ops->get_input_balance(drv);
23337 i = OSS_TO_GAIN(k);
23338 j = OSS_TO_BAL(k);
23339 - oprintk((" for stereo to do %d (bal %d):", i, j));
23340 + oprintk((" for stereo to do %ld (bal %ld):", i, j));
23341 if (drv->ops->set_input_volume)
23342 drv->ops->set_input_volume(drv, i);
23343 if (drv->ops->set_input_balance)
23344 @@ -488,7 +496,7 @@
23345 oprintk((" started as (0x%x)\n", BAL_TO_OSS(l,m)));
23346 i = OSS_TO_GAIN(k);
23347 j = OSS_TO_BAL(k);
23348 - oprintk((" for stereo to %d (bal %d)\n", i, j));
23349 + oprintk((" for stereo to %ld (bal %ld)\n", i, j));
23350 if (drv->ops->set_output_volume)
23351 drv->ops->set_output_volume(drv, i);
23352 if (drv->ops->set_output_balance)
23353 @@ -565,7 +573,7 @@
23354 if (k & SOUND_MASK_CD) j = AUDIO_CD;
23355 if (k & SOUND_MASK_LINE) j = AUDIO_LINE_IN;
23356 if (k & SOUND_MASK_MIC) j = AUDIO_MICROPHONE;
23357 - oprintk(("setting inport to %d\n", j));
23358 + oprintk(("setting inport to %ld\n", j));
23359 i = drv->ops->set_input_port(drv, j);
23360
23361 return put_user(i, (int *)arg);
23362 @@ -798,7 +806,7 @@
23363 retval = -EINVAL;
23364 break;
23365 }
23366 - get_user(i, (int *)arg)
23367 + get_user(i, (int *)arg);
23368 tprintk(("setting speed to %d\n", i));
23369 drv->ops->set_input_rate(drv, i);
23370 drv->ops->set_output_rate(drv, i);
23371 @@ -1955,8 +1963,6 @@
23372 * Input buffers, on the other hand, always fill completely,
23373 * so we don't need input counts - each contains input_buffer_size
23374 * bytes of audio data.
23375 - *
23376 - * TODO: Make number of input/output buffers tunable parameters
23377 */
23378
23379 init_waitqueue_head(&drv->open_wait);
23380 @@ -1964,7 +1970,7 @@
23381 init_waitqueue_head(&drv->output_drain_wait);
23382 init_waitqueue_head(&drv->input_read_wait);
23383
23384 - drv->num_output_buffers = 8;
23385 + drv->num_output_buffers = audio_output_buffers;
23386 drv->output_buffer_size = (4096 * 2);
23387 drv->playing_count = 0;
23388 drv->output_offset = 0;
23389 @@ -1997,7 +2003,7 @@
23390 }
23391
23392 /* Setup the circular queue of input buffers. */
23393 - drv->num_input_buffers = 8;
23394 + drv->num_input_buffers = audio_input_buffers;
23395 drv->input_buffer_size = (4096 * 2);
23396 drv->recording_count = 0;
23397 drv->input_front = 0;
23398 diff -Nur linux-2.4.29/drivers/sbus/audio/dbri.c linux-mips/drivers/sbus/audio/dbri.c
23399 --- linux-2.4.29/drivers/sbus/audio/dbri.c 2002-11-29 00:53:14.000000000 +0100
23400 +++ linux-mips/drivers/sbus/audio/dbri.c 2005-03-26 11:47:32.378337711 +0100
23401 @@ -51,6 +51,7 @@
23402 #include <linux/slab.h>
23403 #include <linux/version.h>
23404 #include <linux/delay.h>
23405 +#include <linux/soundcard.h>
23406 #include <asm/openprom.h>
23407 #include <asm/oplib.h>
23408 #include <asm/system.h>
23409 @@ -161,7 +162,7 @@
23410
23411 static void dbri_process_interrupt_buffer(struct dbri *);
23412
23413 -static void dbri_cmdsend(struct dbri *dbri, volatile s32 *cmd)
23414 +static void dbri_cmdsend(struct dbri *dbri, volatile s32 *cmd, int pause)
23415 {
23416 int MAXLOOPS = 1000000;
23417 int maxloops = MAXLOOPS;
23418 @@ -181,25 +182,30 @@
23419 } else if ((cmd - &dbri->dma->cmd[0]) >= DBRI_NO_CMDS-1) {
23420 printk("DBRI: Command buffer overflow! (bug in driver)\n");
23421 } else {
23422 - *(cmd++) = DBRI_CMD(D_PAUSE, 0, 0);
23423 + if (pause)
23424 + *(cmd++) = DBRI_CMD(D_PAUSE, 0, 0);
23425 *(cmd++) = DBRI_CMD(D_WAIT, 1, 0);
23426 dbri->wait_seen = 0;
23427 sbus_writel(dbri->dma_dvma, dbri->regs + REG8);
23428 - while ((--maxloops) > 0 &&
23429 - (sbus_readl(dbri->regs + REG0) & D_P))
23430 - barrier();
23431 - if (maxloops == 0) {
23432 - printk("DBRI: Chip never completed command buffer\n");
23433 - } else {
23434 - while ((--maxloops) > 0 && (! dbri->wait_seen))
23435 - dbri_process_interrupt_buffer(dbri);
23436 + if (pause) {
23437 + while ((--maxloops) > 0 &&
23438 + (sbus_readl(dbri->regs + REG0) & D_P))
23439 + barrier();
23440 if (maxloops == 0) {
23441 - printk("DBRI: Chip never acked WAIT\n");
23442 + printk("DBRI: Chip never completed command buffer\n");
23443 } else {
23444 - dprintk(D_INT, ("DBRI: Chip completed command "
23445 - "buffer (%d)\n",
23446 - MAXLOOPS - maxloops));
23447 + while ((--maxloops) > 0 && (! dbri->wait_seen))
23448 + dbri_process_interrupt_buffer(dbri);
23449 + if (maxloops == 0) {
23450 + printk("DBRI: Chip never acked WAIT\n");
23451 + } else {
23452 + dprintk(D_INT, ("DBRI: Chip completed command "
23453 + "buffer (%d)\n",
23454 + MAXLOOPS - maxloops));
23455 + }
23456 }
23457 + } else {
23458 + dprintk(D_INT, ("DBRI: NO PAUSE\n"));
23459 }
23460 }
23461
23462 @@ -257,7 +263,10 @@
23463 /* We should query the openprom to see what burst sizes this
23464 * SBus supports. For now, just disable all SBus bursts */
23465 tmp = sbus_readl(dbri->regs + REG0);
23466 - tmp &= ~(D_G | D_S | D_E);
23467 + /* A brute approach - DBRI falls back to working burst size by itself
23468 + * On SS20 D_S does not work, so do not try so high. */
23469 + tmp |= D_G | D_E;
23470 + tmp &= ~D_S;
23471 sbus_writel(tmp, dbri->regs + REG0);
23472
23473 /*
23474 @@ -268,7 +277,7 @@
23475 *(cmd++) = DBRI_CMD(D_IIQ, 0, 0);
23476 *(cmd++) = dma_addr;
23477
23478 - dbri_cmdsend(dbri, cmd);
23479 + dbri_cmdsend(dbri, cmd, 1);
23480 }
23481
23482
23483 @@ -455,7 +464,7 @@
23484 dbri->pipes[pipe].sdp
23485 | D_SDP_P | D_SDP_C | D_SDP_2SAME);
23486 *(cmd++) = dbri->dma_dvma + dbri_dma_off(desc, td);
23487 - dbri_cmdsend(dbri, cmd);
23488 + dbri_cmdsend(dbri, cmd, 1);
23489 }
23490
23491 if (code == D_INTR_FXDT) {
23492 @@ -579,7 +588,7 @@
23493 cmd = dbri_cmdlock(dbri);
23494 *(cmd++) = DBRI_CMD(D_SDP, 0, sdp | D_SDP_C | D_SDP_P);
23495 *(cmd++) = 0;
23496 - dbri_cmdsend(dbri, cmd);
23497 + dbri_cmdsend(dbri, cmd, 1);
23498
23499 desc = dbri->pipes[pipe].desc;
23500 while (desc != -1) {
23501 @@ -722,7 +731,7 @@
23502 *(cmd++) = D_TS_LEN(length) | D_TS_CYCLE(cycle) | D_TS_NEXT(nextpipe);
23503 }
23504
23505 - dbri_cmdsend(dbri, cmd);
23506 + dbri_cmdsend(dbri, cmd, 1);
23507 }
23508
23509 /* I don't use this function, so it's basically untested. */
23510 @@ -752,7 +761,7 @@
23511 *(cmd++) = D_TS_NEXT(nextpipe);
23512 }
23513
23514 - dbri_cmdsend(dbri, cmd);
23515 + dbri_cmdsend(dbri, cmd, 1);
23516 }
23517
23518 /* xmit_fixed() / recv_fixed()
23519 @@ -803,7 +812,7 @@
23520 *(cmd++) = DBRI_CMD(D_SSP, 0, pipe);
23521 *(cmd++) = data;
23522
23523 - dbri_cmdsend(dbri, cmd);
23524 + dbri_cmdsend(dbri, cmd, 1);
23525 }
23526
23527 static void recv_fixed(struct dbri *dbri, int pipe, volatile __u32 *ptr)
23528 @@ -884,7 +893,9 @@
23529 }
23530
23531 if (len > ((1 << 13) - 1)) {
23532 - mylen = (1 << 13) - 1;
23533 + /* One should not leave a buffer shorter than */
23534 + /* a single sample. Otherwise bad things happens.*/
23535 + mylen = (1 << 13) - 4;
23536 } else {
23537 mylen = len;
23538 }
23539 @@ -954,7 +965,7 @@
23540
23541 cmd = dbri_cmdlock(dbri);
23542 *(cmd++) = DBRI_CMD(D_CDP, 0, pipe);
23543 - dbri_cmdsend(dbri,cmd);
23544 + dbri_cmdsend(dbri,cmd, 0);
23545 } else {
23546 /* Pipe isn't active - issue an SDP command to start
23547 * our chain of TDs running.
23548 @@ -965,7 +976,7 @@
23549 dbri->pipes[pipe].sdp
23550 | D_SDP_P | D_SDP_EVERY | D_SDP_C);
23551 *(cmd++) = dbri->dma_dvma + dbri_dma_off(desc, first_td);
23552 - dbri_cmdsend(dbri, cmd);
23553 + dbri_cmdsend(dbri, cmd, 0);
23554 }
23555
23556 restore_flags(flags);
23557 @@ -1083,7 +1094,7 @@
23558 *(cmd++) = DBRI_CMD(D_SDP, 0, dbri->pipes[pipe].sdp | D_SDP_P | D_SDP_C);
23559 *(cmd++) = dbri->dma_dvma + dbri_dma_off(desc, first_rd);
23560
23561 - dbri_cmdsend(dbri, cmd);
23562 + dbri_cmdsend(dbri, cmd, 1);
23563 }
23564
23565
23566 @@ -1191,7 +1202,7 @@
23567 *(cmd++) = DBRI_CMD(D_PAUSE, 0, 0);
23568 *(cmd++) = DBRI_CMD(D_CDM, 0, D_CDM_XCE|D_CDM_XEN|D_CDM_REN);
23569
23570 - dbri_cmdsend(dbri, cmd);
23571 + dbri_cmdsend(dbri, cmd, 1);
23572 }
23573
23574 /*
23575 @@ -1538,7 +1549,6 @@
23576 xmit_on_pipe(dbri, 4, buffer, count,
23577 &dbri_audio_output_callback, drv);
23578
23579 -#if 0
23580 /* Notify midlevel that we're a DMA-capable driver that
23581 * can accept another buffer immediately. We should probably
23582 * check that we've got enough resources (i.e, descriptors)
23583 @@ -1551,9 +1561,14 @@
23584 * DBRI with a chain of buffers, but the midlevel code is
23585 * so tricky that I really don't want to deal with it.
23586 */
23587 + /*
23588 + * This must be enabled otherwise the output is noisy
23589 + * as return to user space is done when all buffers
23590 + * are already played, so user space player has no time
23591 + * to prepare next ones without a period of silence. - Krzysztof Helt
23592 + */
23593
23594 sparcaudio_output_done(drv, 2);
23595 -#endif
23596 }
23597
23598 static void dbri_stop_output(struct sparcaudio_driver *drv)
23599 @@ -1842,6 +1857,12 @@
23600 return dbri_get_output_rate(drv);
23601 }
23602
23603 +static int dbri_get_formats(struct sparcaudio_driver *drv)
23604 +{
23605 +/* 8-bit format is not working */
23606 + return (AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE);
23607 +}
23608 +
23609 /******************* sparcaudio midlevel - ports ***********************/
23610
23611 static int dbri_set_output_port(struct sparcaudio_driver *drv, int port)
23612 @@ -1983,6 +2004,19 @@
23613 dbri_get_input_ports,
23614 dbri_set_output_muted,
23615 dbri_get_output_muted,
23616 + NULL, /* dbri_set_output_pause, */
23617 + NULL, /* dbri_get_output_pause, */
23618 + NULL, /* dbri_set_input_pause, */
23619 + NULL, /* dbri_get_input_pause, */
23620 + NULL, /* dbri_set_output_samples, */
23621 + NULL, /* dbri_get_output_samples, */
23622 + NULL, /* dbri_set_input_samples, */
23623 + NULL, /* dbri_get_input_samples, */
23624 + NULL, /* dbri_set_output_error, */
23625 + NULL, /* dbri_get_output_error, */
23626 + NULL, /* dbri_set_input_error, */
23627 + NULL, /* dbri_get_input_error, */
23628 + dbri_get_formats
23629 };
23630
23631
23632 @@ -2093,7 +2127,7 @@
23633 #endif
23634 *(cmd++) = DBRI_CMD(D_TE, 0, val);
23635
23636 - dbri_cmdsend(dbri, cmd);
23637 + dbri_cmdsend(dbri, cmd, 1);
23638
23639 /* Activate the interface */
23640 tmp = sbus_readl(dbri->regs + REG0);
23641 diff -Nur linux-2.4.29/drivers/scsi/ahci.c linux-mips/drivers/scsi/ahci.c
23642 --- linux-2.4.29/drivers/scsi/ahci.c 2005-01-19 15:10:01.000000000 +0100
23643 +++ linux-mips/drivers/scsi/ahci.c 2005-03-26 11:47:32.448326225 +0100
23644 @@ -40,8 +40,6 @@
23645 #define DRV_NAME "ahci"
23646 #define DRV_VERSION "1.00"
23647
23648 -#define msleep libata_msleep /* 2.4-specific */
23649 -
23650 enum {
23651 AHCI_PCI_BAR = 5,
23652 AHCI_MAX_SG = 168, /* hardware max is 64K */
23653 @@ -180,6 +178,7 @@
23654 static void ahci_host_stop(struct ata_host_set *host_set);
23655 static void ahci_qc_prep(struct ata_queued_cmd *qc);
23656 static u8 ahci_check_status(struct ata_port *ap);
23657 +static u8 ahci_check_err(struct ata_port *ap);
23658 static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
23659
23660 static Scsi_Host_Template ahci_sht = {
23661 @@ -206,6 +205,8 @@
23662 .port_disable = ata_port_disable,
23663
23664 .check_status = ahci_check_status,
23665 + .check_altstatus = ahci_check_status,
23666 + .check_err = ahci_check_err,
23667 .dev_select = ata_noop_dev_select,
23668
23669 .phy_reset = ahci_phy_reset,
23670 @@ -248,6 +249,12 @@
23671 board_ahci }, /* ICH7 */
23672 { PCI_VENDOR_ID_INTEL, 0x27c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
23673 board_ahci }, /* ICH7M */
23674 + { PCI_VENDOR_ID_INTEL, 0x27c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
23675 + board_ahci }, /* ICH7R */
23676 + { PCI_VENDOR_ID_INTEL, 0x27c3, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
23677 + board_ahci }, /* ICH7R */
23678 + { PCI_VENDOR_ID_AL, 0x5288, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
23679 + board_ahci }, /* ULi M5288 */
23680 { } /* terminate list */
23681 };
23682
23683 @@ -448,6 +455,13 @@
23684 return readl(mmio + PORT_TFDATA) & 0xFF;
23685 }
23686
23687 +static u8 ahci_check_err(struct ata_port *ap)
23688 +{
23689 + void *mmio = (void *) ap->ioaddr.cmd_addr;
23690 +
23691 + return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
23692 +}
23693 +
23694 static void ahci_fill_sg(struct ata_queued_cmd *qc)
23695 {
23696 struct ahci_port_priv *pp = qc->ap->private_data;
23697 @@ -515,15 +529,6 @@
23698 ahci_fill_sg(qc);
23699 }
23700
23701 -static inline void ahci_dma_complete (struct ata_port *ap,
23702 - struct ata_queued_cmd *qc,
23703 - int have_err)
23704 -{
23705 - /* get drive status; clear intr; complete txn */
23706 - ata_qc_complete(ata_qc_from_tag(ap, ap->active_tag),
23707 - have_err ? ATA_ERR : 0);
23708 -}
23709 -
23710 static void ahci_intr_error(struct ata_port *ap, u32 irq_stat)
23711 {
23712 void *mmio = ap->host_set->mmio_base;
23713 @@ -569,7 +574,7 @@
23714 writel(tmp, port_mmio + PORT_CMD);
23715 readl(port_mmio + PORT_CMD); /* flush */
23716
23717 - printk(KERN_WARNING "ata%u: error occurred, port reset\n", ap->port_no);
23718 + printk(KERN_WARNING "ata%u: error occurred, port reset\n", ap->id);
23719 }
23720
23721 static void ahci_eng_timeout(struct ata_port *ap)
23722 @@ -761,10 +766,10 @@
23723
23724 using_dac = hpriv->cap & HOST_CAP_64;
23725 if (using_dac &&
23726 - !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
23727 + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
23728 hpriv->flags |= HOST_CAP_64;
23729 } else {
23730 - rc = pci_set_dma_mask(pdev, 0xffffffffULL);
23731 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
23732 if (rc) {
23733 printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n",
23734 pci_name(pdev));
23735 @@ -929,6 +934,7 @@
23736 unsigned long base;
23737 void *mmio_base;
23738 unsigned int board_idx = (unsigned int) ent->driver_data;
23739 + int pci_dev_busy = 0;
23740 int rc;
23741
23742 VPRINTK("ENTER\n");
23743 @@ -941,8 +947,10 @@
23744 return rc;
23745
23746 rc = pci_request_regions(pdev, DRV_NAME);
23747 - if (rc)
23748 + if (rc) {
23749 + pci_dev_busy = 1;
23750 goto err_out;
23751 + }
23752
23753 pci_enable_intx(pdev);
23754
23755 @@ -1002,7 +1010,8 @@
23756 err_out_regions:
23757 pci_release_regions(pdev);
23758 err_out:
23759 - pci_disable_device(pdev);
23760 + if (!pci_dev_busy)
23761 + pci_disable_device(pdev);
23762 return rc;
23763 }
23764
23765 diff -Nur linux-2.4.29/drivers/scsi/aic7xxx/aic79xx_pci.c linux-mips/drivers/scsi/aic7xxx/aic79xx_pci.c
23766 --- linux-2.4.29/drivers/scsi/aic7xxx/aic79xx_pci.c 2003-08-25 13:44:42.000000000 +0200
23767 +++ linux-mips/drivers/scsi/aic7xxx/aic79xx_pci.c 2005-03-26 11:47:34.828935512 +0100
23768 @@ -451,8 +451,10 @@
23769 * or read prefetching could be initiated by the
23770 * CPU or host bridge. Our device does not support
23771 * either, so look for data corruption and/or flaged
23772 - * PCI errors.
23773 + * PCI errors. First pause without causing another
23774 + * chip reset.
23775 */
23776 + hcntrl &= ~CHIPRST;
23777 ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
23778 while (ahd_is_paused(ahd) == 0)
23779 ;
23780 diff -Nur linux-2.4.29/drivers/scsi/aic7xxx/aic7xxx_pci.c linux-mips/drivers/scsi/aic7xxx/aic7xxx_pci.c
23781 --- linux-2.4.29/drivers/scsi/aic7xxx/aic7xxx_pci.c 2003-08-25 13:44:42.000000000 +0200
23782 +++ linux-mips/drivers/scsi/aic7xxx/aic7xxx_pci.c 2005-03-26 11:47:34.831935020 +0100
23783 @@ -1284,8 +1284,10 @@
23784 * or read prefetching could be initiated by the
23785 * CPU or host bridge. Our device does not support
23786 * either, so look for data corruption and/or flagged
23787 - * PCI errors.
23788 + * PCI errors. First pause without causing another
23789 + * chip reset.
23790 */
23791 + hcntrl &= ~CHIPRST;
23792 ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
23793 while (ahc_is_paused(ahc) == 0)
23794 ;
23795 diff -Nur linux-2.4.29/drivers/scsi/ata_piix.c linux-mips/drivers/scsi/ata_piix.c
23796 --- linux-2.4.29/drivers/scsi/ata_piix.c 2005-01-19 15:10:01.000000000 +0100
23797 +++ linux-mips/drivers/scsi/ata_piix.c 2005-03-26 11:47:32.450325897 +0100
23798 @@ -139,6 +139,8 @@
23799
23800 .bmdma_setup = ata_bmdma_setup,
23801 .bmdma_start = ata_bmdma_start,
23802 + .bmdma_stop = ata_bmdma_stop,
23803 + .bmdma_status = ata_bmdma_status,
23804 .qc_prep = ata_qc_prep,
23805 .qc_issue = ata_qc_issue_prot,
23806
23807 @@ -164,6 +166,8 @@
23808
23809 .bmdma_setup = ata_bmdma_setup,
23810 .bmdma_start = ata_bmdma_start,
23811 + .bmdma_stop = ata_bmdma_stop,
23812 + .bmdma_status = ata_bmdma_status,
23813 .qc_prep = ata_qc_prep,
23814 .qc_issue = ata_qc_issue_prot,
23815
23816 diff -Nur linux-2.4.29/drivers/scsi/Config.in linux-mips/drivers/scsi/Config.in
23817 --- linux-2.4.29/drivers/scsi/Config.in 2005-01-19 15:09:59.000000000 +0100
23818 +++ linux-mips/drivers/scsi/Config.in 2005-03-26 11:47:32.437328030 +0100
23819 @@ -73,6 +73,7 @@
23820 dep_tristate ' ServerWorks Frodo / Apple K2 SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_SVW $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL
23821 dep_tristate ' Intel PIIX/ICH SATA support' CONFIG_SCSI_ATA_PIIX $CONFIG_SCSI_SATA $CONFIG_PCI
23822 dep_tristate ' NVIDIA SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_NV $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL
23823 +dep_tristate ' Pacific Digital SATA QStor support' CONFIG_SCSI_SATA_QSTOR $CONFIG_SCSI_SATA $CONFIG_PCI
23824 dep_tristate ' Promise SATA TX2/TX4 support (EXPERIMENTAL)' CONFIG_SCSI_SATA_PROMISE $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL
23825 dep_tristate ' Promise SATA SX4 support (EXPERIMENTAL)' CONFIG_SCSI_SATA_SX4 $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL
23826 dep_tristate ' Silicon Image SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_SIL $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL
23827 diff -Nur linux-2.4.29/drivers/scsi/libata-core.c linux-mips/drivers/scsi/libata-core.c
23828 --- linux-2.4.29/drivers/scsi/libata-core.c 2005-01-19 15:10:03.000000000 +0100
23829 +++ linux-mips/drivers/scsi/libata-core.c 2005-03-26 11:47:32.481320810 +0100
23830 @@ -376,7 +376,7 @@
23831 }
23832
23833 /**
23834 - * ata_check_status - Read device status reg & clear interrupt
23835 + * ata_check_status_pio - Read device status reg & clear interrupt
23836 * @ap: port where the device is
23837 *
23838 * Reads ATA taskfile status register for currently-selected device
23839 @@ -414,6 +414,27 @@
23840 return ata_check_status_pio(ap);
23841 }
23842
23843 +u8 ata_altstatus(struct ata_port *ap)
23844 +{
23845 + if (ap->ops->check_altstatus)
23846 + return ap->ops->check_altstatus(ap);
23847 +
23848 + if (ap->flags & ATA_FLAG_MMIO)
23849 + return readb((void __iomem *)ap->ioaddr.altstatus_addr);
23850 + return inb(ap->ioaddr.altstatus_addr);
23851 +}
23852 +
23853 +u8 ata_chk_err(struct ata_port *ap)
23854 +{
23855 + if (ap->ops->check_err)
23856 + return ap->ops->check_err(ap);
23857 +
23858 + if (ap->flags & ATA_FLAG_MMIO) {
23859 + return readb((void __iomem *) ap->ioaddr.error_addr);
23860 + }
23861 + return inb(ap->ioaddr.error_addr);
23862 +}
23863 +
23864 /**
23865 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
23866 * @tf: Taskfile to convert
23867 @@ -1160,7 +1181,6 @@
23868 printk(KERN_WARNING "ata%u: dev %u not supported, ignoring\n",
23869 ap->id, device);
23870 err_out:
23871 - ata_irq_on(ap); /* re-enable interrupts */
23872 dev->class++; /* converts ATA_DEV_xxx into ATA_DEV_xxx_UNSUP */
23873 DPRINTK("EXIT, err\n");
23874 }
23875 @@ -1668,7 +1688,8 @@
23876 ata_dev_try_classify(ap, 1);
23877
23878 /* re-enable interrupts */
23879 - ata_irq_on(ap);
23880 + if (ap->ioaddr.ctl_addr) /* FIXME: hack. create a hook instead */
23881 + ata_irq_on(ap);
23882
23883 /* is double-select really necessary? */
23884 if (ap->device[1].class != ATA_DEV_NONE)
23885 @@ -1699,6 +1720,69 @@
23886 DPRINTK("EXIT\n");
23887 }
23888
23889 +static void ata_pr_blacklisted(struct ata_port *ap, struct ata_device *dev)
23890 +{
23891 + printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n",
23892 + ap->id, dev->devno);
23893 +}
23894 +
23895 +static const char * ata_dma_blacklist [] = {
23896 + "WDC AC11000H",
23897 + "WDC AC22100H",
23898 + "WDC AC32500H",
23899 + "WDC AC33100H",
23900 + "WDC AC31600H",
23901 + "WDC AC32100H",
23902 + "WDC AC23200L",
23903 + "Compaq CRD-8241B",
23904 + "CRD-8400B",
23905 + "CRD-8480B",
23906 + "CRD-8482B",
23907 + "CRD-84",
23908 + "SanDisk SDP3B",
23909 + "SanDisk SDP3B-64",
23910 + "SANYO CD-ROM CRD",
23911 + "HITACHI CDR-8",
23912 + "HITACHI CDR-8335",
23913 + "HITACHI CDR-8435",
23914 + "Toshiba CD-ROM XM-6202B",
23915 + "CD-532E-A",
23916 + "E-IDE CD-ROM CR-840",
23917 + "CD-ROM Drive/F5A",
23918 + "WPI CDD-820",
23919 + "SAMSUNG CD-ROM SC-148C",
23920 + "SAMSUNG CD-ROM SC",
23921 + "SanDisk SDP3B-64",
23922 + "SAMSUNG CD-ROM SN-124",
23923 + "ATAPI CD-ROM DRIVE 40X MAXIMUM",
23924 + "_NEC DV5800A",
23925 +};
23926 +
23927 +static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev)
23928 +{
23929 + unsigned char model_num[40];
23930 + char *s;
23931 + unsigned int len;
23932 + int i;
23933 +
23934 + ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS,
23935 + sizeof(model_num));
23936 + s = &model_num[0];
23937 + len = strnlen(s, sizeof(model_num));
23938 +
23939 + /* ATAPI specifies that empty space is blank-filled; remove blanks */
23940 + while ((len > 0) && (s[len - 1] == ' ')) {
23941 + len--;
23942 + s[len] = 0;
23943 + }
23944 +
23945 + for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++)
23946 + if (!strncmp(ata_dma_blacklist[i], s, len))
23947 + return 1;
23948 +
23949 + return 0;
23950 +}
23951 +
23952 static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift)
23953 {
23954 struct ata_device *master, *slave;
23955 @@ -1711,17 +1795,37 @@
23956
23957 if (shift == ATA_SHIFT_UDMA) {
23958 mask = ap->udma_mask;
23959 - if (ata_dev_present(master))
23960 + if (ata_dev_present(master)) {
23961 mask &= (master->id[ATA_ID_UDMA_MODES] & 0xff);
23962 - if (ata_dev_present(slave))
23963 + if (ata_dma_blacklisted(ap, master)) {
23964 + mask = 0;
23965 + ata_pr_blacklisted(ap, master);
23966 + }
23967 + }
23968 + if (ata_dev_present(slave)) {
23969 mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff);
23970 + if (ata_dma_blacklisted(ap, slave)) {
23971 + mask = 0;
23972 + ata_pr_blacklisted(ap, slave);
23973 + }
23974 + }
23975 }
23976 else if (shift == ATA_SHIFT_MWDMA) {
23977 mask = ap->mwdma_mask;
23978 - if (ata_dev_present(master))
23979 + if (ata_dev_present(master)) {
23980 mask &= (master->id[ATA_ID_MWDMA_MODES] & 0x07);
23981 - if (ata_dev_present(slave))
23982 + if (ata_dma_blacklisted(ap, master)) {
23983 + mask = 0;
23984 + ata_pr_blacklisted(ap, master);
23985 + }
23986 + }
23987 + if (ata_dev_present(slave)) {
23988 mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07);
23989 + if (ata_dma_blacklisted(ap, slave)) {
23990 + mask = 0;
23991 + ata_pr_blacklisted(ap, slave);
23992 + }
23993 + }
23994 }
23995 else if (shift == ATA_SHIFT_PIO) {
23996 mask = ap->pio_mask;
23997 @@ -2518,10 +2622,10 @@
23998
23999 case ATA_PROT_DMA:
24000 case ATA_PROT_ATAPI_DMA:
24001 - host_stat = ata_bmdma_status(ap);
24002 + host_stat = ap->ops->bmdma_status(ap);
24003
24004 /* before we do anything else, clear DMA-Start bit */
24005 - ata_bmdma_stop(ap);
24006 + ap->ops->bmdma_stop(ap);
24007
24008 /* fall through */
24009
24010 @@ -2530,7 +2634,7 @@
24011 drv_stat = ata_chk_status(ap);
24012
24013 /* ack bmdma irq events */
24014 - ata_bmdma_ack_irq(ap);
24015 + ap->ops->irq_clear(ap);
24016
24017 printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x host_stat 0x%x\n",
24018 ap->id, qc->tf.command, drv_stat, host_stat);
24019 @@ -2669,6 +2773,24 @@
24020 }
24021
24022 /**
24023 + * ata_qc_free - free unused ata_queued_cmd
24024 + * @qc: Command to complete
24025 + *
24026 + * Designed to free unused ata_queued_cmd object
24027 + * in case something prevents using it.
24028 + *
24029 + * LOCKING:
24030 + *
24031 + */
24032 +void ata_qc_free(struct ata_queued_cmd *qc)
24033 +{
24034 + assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */
24035 + assert(qc->waiting == NULL); /* nothing should be waiting */
24036 +
24037 + __ata_qc_complete(qc);
24038 +}
24039 +
24040 +/**
24041 * ata_qc_complete - Complete an active ATA command
24042 * @qc: Command to complete
24043 * @drv_stat: ATA status register contents
24044 @@ -2717,7 +2839,7 @@
24045 return 1;
24046
24047 /* fall through */
24048 -
24049 +
24050 default:
24051 return 0;
24052 }
24053 @@ -2959,7 +3081,43 @@
24054
24055 void ata_bmdma_irq_clear(struct ata_port *ap)
24056 {
24057 - ata_bmdma_ack_irq(ap);
24058 + if (ap->flags & ATA_FLAG_MMIO) {
24059 + void __iomem *mmio = ((void __iomem *) ap->ioaddr.bmdma_addr) + ATA_DMA_STATUS;
24060 + writeb(readb(mmio), mmio);
24061 + } else {
24062 + unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
24063 + outb(inb(addr), addr);
24064 + }
24065 +
24066 +}
24067 +
24068 +u8 ata_bmdma_status(struct ata_port *ap)
24069 +{
24070 + u8 host_stat;
24071 + if (ap->flags & ATA_FLAG_MMIO) {
24072 + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
24073 + host_stat = readb(mmio + ATA_DMA_STATUS);
24074 + } else
24075 + host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
24076 + return host_stat;
24077 +}
24078 +
24079 +void ata_bmdma_stop(struct ata_port *ap)
24080 +{
24081 + if (ap->flags & ATA_FLAG_MMIO) {
24082 + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
24083 +
24084 + /* clear start/stop bit */
24085 + writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
24086 + mmio + ATA_DMA_CMD);
24087 + } else {
24088 + /* clear start/stop bit */
24089 + outb(inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD) & ~ATA_DMA_START,
24090 + ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
24091 + }
24092 +
24093 + /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
24094 + ata_altstatus(ap); /* dummy read */
24095 }
24096
24097 /**
24098 @@ -2989,7 +3147,7 @@
24099 case ATA_PROT_ATAPI_DMA:
24100 case ATA_PROT_ATAPI:
24101 /* check status of DMA engine */
24102 - host_stat = ata_bmdma_status(ap);
24103 + host_stat = ap->ops->bmdma_status(ap);
24104 VPRINTK("ata%u: host_stat 0x%X\n", ap->id, host_stat);
24105
24106 /* if it's not our irq... */
24107 @@ -2997,7 +3155,7 @@
24108 goto idle_irq;
24109
24110 /* before we do anything else, clear DMA-Start bit */
24111 - ata_bmdma_stop(ap);
24112 + ap->ops->bmdma_stop(ap);
24113
24114 /* fall through */
24115
24116 @@ -3016,7 +3174,7 @@
24117 ap->id, qc->tf.protocol, status);
24118
24119 /* ack bmdma irq events */
24120 - ata_bmdma_ack_irq(ap);
24121 + ap->ops->irq_clear(ap);
24122
24123 /* complete taskfile transaction */
24124 ata_qc_complete(qc, status);
24125 @@ -3470,32 +3628,28 @@
24126 }
24127
24128 static struct ata_probe_ent *
24129 -ata_probe_ent_alloc(int n, struct device *dev, struct ata_port_info **port)
24130 +ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
24131 {
24132 struct ata_probe_ent *probe_ent;
24133 - int i;
24134
24135 - probe_ent = kmalloc(sizeof(*probe_ent) * n, GFP_KERNEL);
24136 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
24137 if (!probe_ent) {
24138 printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
24139 pci_name(to_pci_dev(dev)));
24140 return NULL;
24141 }
24142
24143 - memset(probe_ent, 0, sizeof(*probe_ent) * n);
24144 + memset(probe_ent, 0, sizeof(*probe_ent));
24145
24146 - for (i = 0; i < n; i++) {
24147 - INIT_LIST_HEAD(&probe_ent[i].node);
24148 - probe_ent[i].dev = dev;
24149 -
24150 - probe_ent[i].sht = port[i]->sht;
24151 - probe_ent[i].host_flags = port[i]->host_flags;
24152 - probe_ent[i].pio_mask = port[i]->pio_mask;
24153 - probe_ent[i].mwdma_mask = port[i]->mwdma_mask;
24154 - probe_ent[i].udma_mask = port[i]->udma_mask;
24155 - probe_ent[i].port_ops = port[i]->port_ops;
24156 + INIT_LIST_HEAD(&probe_ent->node);
24157 + probe_ent->dev = dev;
24158
24159 - }
24160 + probe_ent->sht = port->sht;
24161 + probe_ent->host_flags = port->host_flags;
24162 + probe_ent->pio_mask = port->pio_mask;
24163 + probe_ent->mwdma_mask = port->mwdma_mask;
24164 + probe_ent->udma_mask = port->udma_mask;
24165 + probe_ent->port_ops = port->port_ops;
24166
24167 return probe_ent;
24168 }
24169 @@ -3505,7 +3659,7 @@
24170 ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
24171 {
24172 struct ata_probe_ent *probe_ent =
24173 - ata_probe_ent_alloc(1, pci_dev_to_dev(pdev), port);
24174 + ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
24175 if (!probe_ent)
24176 return NULL;
24177
24178 @@ -3531,39 +3685,47 @@
24179 return probe_ent;
24180 }
24181
24182 -struct ata_probe_ent *
24183 -ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port)
24184 +static struct ata_probe_ent *
24185 +ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port,
24186 + struct ata_probe_ent **ppe2)
24187 {
24188 - struct ata_probe_ent *probe_ent =
24189 - ata_probe_ent_alloc(2, pci_dev_to_dev(pdev), port);
24190 + struct ata_probe_ent *probe_ent, *probe_ent2;
24191 +
24192 + probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
24193 if (!probe_ent)
24194 return NULL;
24195 + probe_ent2 = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[1]);
24196 + if (!probe_ent2) {
24197 + kfree(probe_ent);
24198 + return NULL;
24199 + }
24200 +
24201 + probe_ent->n_ports = 1;
24202 + probe_ent->irq = 14;
24203
24204 - probe_ent[0].n_ports = 1;
24205 - probe_ent[0].irq = 14;
24206 + probe_ent->hard_port_no = 0;
24207 + probe_ent->legacy_mode = 1;
24208
24209 - probe_ent[0].hard_port_no = 0;
24210 - probe_ent[0].legacy_mode = 1;
24211 + probe_ent2->n_ports = 1;
24212 + probe_ent2->irq = 15;
24213
24214 - probe_ent[1].n_ports = 1;
24215 - probe_ent[1].irq = 15;
24216 + probe_ent2->hard_port_no = 1;
24217 + probe_ent2->legacy_mode = 1;
24218
24219 - probe_ent[1].hard_port_no = 1;
24220 - probe_ent[1].legacy_mode = 1;
24221 -
24222 - probe_ent[0].port[0].cmd_addr = 0x1f0;
24223 - probe_ent[0].port[0].altstatus_addr =
24224 - probe_ent[0].port[0].ctl_addr = 0x3f6;
24225 - probe_ent[0].port[0].bmdma_addr = pci_resource_start(pdev, 4);
24226 -
24227 - probe_ent[1].port[0].cmd_addr = 0x170;
24228 - probe_ent[1].port[0].altstatus_addr =
24229 - probe_ent[1].port[0].ctl_addr = 0x376;
24230 - probe_ent[1].port[0].bmdma_addr = pci_resource_start(pdev, 4)+8;
24231 + probe_ent->port[0].cmd_addr = 0x1f0;
24232 + probe_ent->port[0].altstatus_addr =
24233 + probe_ent->port[0].ctl_addr = 0x3f6;
24234 + probe_ent->port[0].bmdma_addr = pci_resource_start(pdev, 4);
24235 +
24236 + probe_ent2->port[0].cmd_addr = 0x170;
24237 + probe_ent2->port[0].altstatus_addr =
24238 + probe_ent2->port[0].ctl_addr = 0x376;
24239 + probe_ent2->port[0].bmdma_addr = pci_resource_start(pdev, 4)+8;
24240
24241 - ata_std_ports(&probe_ent[0].port[0]);
24242 - ata_std_ports(&probe_ent[1].port[0]);
24243 + ata_std_ports(&probe_ent->port[0]);
24244 + ata_std_ports(&probe_ent2->port[0]);
24245
24246 + *ppe2 = probe_ent2;
24247 return probe_ent;
24248 }
24249
24250 @@ -3587,6 +3749,7 @@
24251 struct ata_port_info *port[2];
24252 u8 tmp8, mask;
24253 unsigned int legacy_mode = 0;
24254 + int disable_dev_on_err = 1;
24255 int rc;
24256
24257 DPRINTK("ENTER\n");
24258 @@ -3597,7 +3760,8 @@
24259 else
24260 port[1] = port[0];
24261
24262 - if ((port[0]->host_flags & ATA_FLAG_NO_LEGACY) == 0) {
24263 + if ((port[0]->host_flags & ATA_FLAG_NO_LEGACY) == 0
24264 + && (pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
24265 /* TODO: support transitioning to native mode? */
24266 pci_read_config_byte(pdev, PCI_CLASS_PROG, &tmp8);
24267 mask = (1 << 2) | (1 << 0);
24268 @@ -3616,18 +3780,22 @@
24269 return rc;
24270
24271 rc = pci_request_regions(pdev, DRV_NAME);
24272 - if (rc)
24273 + if (rc) {
24274 + disable_dev_on_err = 0;
24275 goto err_out;
24276 + }
24277
24278 if (legacy_mode) {
24279 - if (!request_region(0x1f0, 8, "libata"))
24280 + if (!request_region(0x1f0, 8, "libata")) {
24281 + disable_dev_on_err = 0;
24282 printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n");
24283 - else
24284 + } else
24285 legacy_mode |= (1 << 0);
24286
24287 - if (!request_region(0x170, 8, "libata"))
24288 + if (!request_region(0x170, 8, "libata")) {
24289 + disable_dev_on_err = 0;
24290 printk(KERN_WARNING "ata: 0x170 IDE port busy\n");
24291 - else
24292 + } else
24293 legacy_mode |= (1 << 1);
24294 }
24295
24296 @@ -3642,9 +3810,7 @@
24297 goto err_out_regions;
24298
24299 if (legacy_mode) {
24300 - probe_ent = ata_pci_init_legacy_mode(pdev, port);
24301 - if (probe_ent)
24302 - probe_ent2 = &probe_ent[1];
24303 + probe_ent = ata_pci_init_legacy_mode(pdev, port, &probe_ent2);
24304 } else
24305 probe_ent = ata_pci_init_native_mode(pdev, port);
24306 if (!probe_ent) {
24307 @@ -3656,17 +3822,14 @@
24308
24309 spin_lock(&ata_module_lock);
24310 if (legacy_mode) {
24311 - int free = 0;
24312 if (legacy_mode & (1 << 0))
24313 list_add_tail(&probe_ent->node, &ata_probe_list);
24314 else
24315 - free++;
24316 + kfree(probe_ent);
24317 if (legacy_mode & (1 << 1))
24318 list_add_tail(&probe_ent2->node, &ata_probe_list);
24319 else
24320 - free++;
24321 - if (free > 1)
24322 - kfree(probe_ent);
24323 + kfree(probe_ent2);
24324 } else {
24325 list_add_tail(&probe_ent->node, &ata_probe_list);
24326 }
24327 @@ -3681,7 +3844,8 @@
24328 release_region(0x170, 8);
24329 pci_release_regions(pdev);
24330 err_out:
24331 - pci_disable_device(pdev);
24332 + if (disable_dev_on_err)
24333 + pci_disable_device(pdev);
24334 return rc;
24335 }
24336
24337 @@ -3723,15 +3887,12 @@
24338 if (host_set->mmio_base)
24339 iounmap(host_set->mmio_base);
24340
24341 - pci_release_regions(pdev);
24342 -
24343 for (i = 0; i < host_set->n_ports; i++) {
24344 - struct ata_ioports *ioaddr;
24345 -
24346 ap = host_set->ports[i];
24347 - ioaddr = &ap->ioaddr;
24348
24349 if ((ap->flags & ATA_FLAG_NO_LEGACY) == 0) {
24350 + struct ata_ioports *ioaddr = &ap->ioaddr;
24351 +
24352 if (ioaddr->cmd_addr == 0x1f0)
24353 release_region(0x1f0, 8);
24354 else if (ioaddr->cmd_addr == 0x170)
24355 @@ -3740,6 +3901,8 @@
24356 }
24357
24358 kfree(host_set);
24359 +
24360 + pci_release_regions(pdev);
24361 pci_disable_device(pdev);
24362 dev_set_drvdata(dev, NULL);
24363 }
24364 @@ -3839,6 +4002,8 @@
24365 EXPORT_SYMBOL_GPL(ata_tf_to_fis);
24366 EXPORT_SYMBOL_GPL(ata_tf_from_fis);
24367 EXPORT_SYMBOL_GPL(ata_check_status);
24368 +EXPORT_SYMBOL_GPL(ata_altstatus);
24369 +EXPORT_SYMBOL_GPL(ata_chk_err);
24370 EXPORT_SYMBOL_GPL(ata_exec_command);
24371 EXPORT_SYMBOL_GPL(ata_port_start);
24372 EXPORT_SYMBOL_GPL(ata_port_stop);
24373 @@ -3847,6 +4012,8 @@
24374 EXPORT_SYMBOL_GPL(ata_bmdma_setup);
24375 EXPORT_SYMBOL_GPL(ata_bmdma_start);
24376 EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear);
24377 +EXPORT_SYMBOL_GPL(ata_bmdma_status);
24378 +EXPORT_SYMBOL_GPL(ata_bmdma_stop);
24379 EXPORT_SYMBOL_GPL(ata_port_probe);
24380 EXPORT_SYMBOL_GPL(sata_phy_reset);
24381 EXPORT_SYMBOL_GPL(__sata_phy_reset);
24382 @@ -3857,7 +4024,6 @@
24383 EXPORT_SYMBOL_GPL(ata_scsi_error);
24384 EXPORT_SYMBOL_GPL(ata_scsi_detect);
24385 EXPORT_SYMBOL_GPL(ata_add_to_probe_list);
24386 -EXPORT_SYMBOL_GPL(libata_msleep);
24387 EXPORT_SYMBOL_GPL(ssleep);
24388 EXPORT_SYMBOL_GPL(ata_scsi_release);
24389 EXPORT_SYMBOL_GPL(ata_host_intr);
24390 @@ -3867,7 +4033,6 @@
24391
24392 #ifdef CONFIG_PCI
24393 EXPORT_SYMBOL_GPL(pci_test_config_bits);
24394 -EXPORT_SYMBOL_GPL(ata_pci_init_legacy_mode);
24395 EXPORT_SYMBOL_GPL(ata_pci_init_native_mode);
24396 EXPORT_SYMBOL_GPL(ata_pci_init_one);
24397 EXPORT_SYMBOL_GPL(ata_pci_remove_one);
24398 diff -Nur linux-2.4.29/drivers/scsi/libata.h linux-mips/drivers/scsi/libata.h
24399 --- linux-2.4.29/drivers/scsi/libata.h 2005-01-19 15:10:03.000000000 +0100
24400 +++ linux-mips/drivers/scsi/libata.h 2005-03-26 11:47:32.487319825 +0100
24401 @@ -37,6 +37,7 @@
24402 /* libata-core.c */
24403 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
24404 struct ata_device *dev);
24405 +extern void ata_qc_free(struct ata_queued_cmd *qc);
24406 extern int ata_qc_issue(struct ata_queued_cmd *qc);
24407 extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
24408 extern void ata_dev_select(struct ata_port *ap, unsigned int device,
24409 diff -Nur linux-2.4.29/drivers/scsi/libata-scsi.c linux-mips/drivers/scsi/libata-scsi.c
24410 --- linux-2.4.29/drivers/scsi/libata-scsi.c 2005-01-19 15:10:03.000000000 +0100
24411 +++ linux-mips/drivers/scsi/libata-scsi.c 2005-03-26 11:47:32.485320153 +0100
24412 @@ -203,7 +203,7 @@
24413 {0x40, MEDIUM_ERROR, 0x11, 0x04}, // Uncorrectable ECC error Unrecovered read error
24414 /* BBD - block marked bad */
24415 {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error
24416 - {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
24417 + {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
24418 };
24419 static unsigned char stat_table[][4] = {
24420 /* Must be first because BUSY means no other bits valid */
24421 @@ -211,22 +211,22 @@
24422 {0x20, HARDWARE_ERROR, 0x00, 0x00}, // Device fault
24423 {0x08, ABORTED_COMMAND, 0x47, 0x00}, // Timed out in xfer, fake parity for now
24424 {0x04, RECOVERED_ERROR, 0x11, 0x00}, // Recovered ECC error Medium error, recovered
24425 - {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
24426 + {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
24427 };
24428 int i = 0;
24429
24430 cmd->result = SAM_STAT_CHECK_CONDITION;
24431 -
24432 +
24433 /*
24434 * Is this an error we can process/parse
24435 */
24436 -
24437 +
24438 if(drv_stat & ATA_ERR)
24439 /* Read the err bits */
24440 err = ata_chk_err(qc->ap);
24441
24442 /* Display the ATA level error info */
24443 -
24444 +
24445 printk(KERN_WARNING "ata%u: status=0x%02x { ", qc->ap->id, drv_stat);
24446 if(drv_stat & 0x80)
24447 {
24448 @@ -243,7 +243,7 @@
24449 if(drv_stat & 0x01) printk("Error ");
24450 }
24451 printk("}\n");
24452 -
24453 +
24454 if(err)
24455 {
24456 printk(KERN_WARNING "ata%u: error=0x%02x { ", qc->ap->id, err);
24457 @@ -260,11 +260,11 @@
24458 if(err & 0x02) printk("TrackZeroNotFound ");
24459 if(err & 0x01) printk("AddrMarkNotFound ");
24460 printk("}\n");
24461 -
24462 +
24463 /* Should we dump sector info here too ?? */
24464 }
24465 -
24466 -
24467 +
24468 +
24469 /* Look for err */
24470 while(sense_table[i][0] != 0xFF)
24471 {
24472 @@ -283,7 +283,8 @@
24473 /* No immediate match */
24474 if(err)
24475 printk(KERN_DEBUG "ata%u: no sense translation for 0x%02x\n", qc->ap->id, err);
24476 -
24477 +
24478 + i = 0;
24479 /* Fall back to interpreting status bits */
24480 while(stat_table[i][0] != 0xFF)
24481 {
24482 @@ -301,7 +302,7 @@
24483 /* No error ?? */
24484 printk(KERN_ERR "ata%u: called with no error (%02X)!\n", qc->ap->id, drv_stat);
24485 /* additional-sense-code[-qualifier] */
24486 -
24487 +
24488 sb[0] = 0x70;
24489 sb[2] = MEDIUM_ERROR;
24490 sb[7] = 0x0A;
24491 @@ -449,19 +450,24 @@
24492 }
24493
24494 if (lba48) {
24495 + tf->command = ATA_CMD_VERIFY_EXT;
24496 +
24497 tf->hob_nsect = (n_sect >> 8) & 0xff;
24498
24499 tf->hob_lbah = (sect >> 40) & 0xff;
24500 tf->hob_lbam = (sect >> 32) & 0xff;
24501 tf->hob_lbal = (sect >> 24) & 0xff;
24502 - } else
24503 + } else {
24504 + tf->command = ATA_CMD_VERIFY;
24505 +
24506 tf->device |= (sect >> 24) & 0xf;
24507 + }
24508
24509 tf->nsect = n_sect & 0xff;
24510
24511 - tf->hob_lbah = (sect >> 16) & 0xff;
24512 - tf->hob_lbam = (sect >> 8) & 0xff;
24513 - tf->hob_lbal = sect & 0xff;
24514 + tf->lbah = (sect >> 16) & 0xff;
24515 + tf->lbam = (sect >> 8) & 0xff;
24516 + tf->lbal = sect & 0xff;
24517
24518 return 0;
24519 }
24520 @@ -561,7 +567,7 @@
24521 return 1;
24522
24523 /* stores LBA27:24 in lower 4 bits of device reg */
24524 - tf->device |= scsicmd[2];
24525 + tf->device |= scsicmd[6];
24526
24527 qc->nsect = scsicmd[13];
24528 }
24529 @@ -657,6 +663,7 @@
24530 return;
24531
24532 err_out:
24533 + ata_qc_free(qc);
24534 ata_bad_cdb(cmd, done);
24535 DPRINTK("EXIT - badcmd\n");
24536 }
24537 diff -Nur linux-2.4.29/drivers/scsi/Makefile linux-mips/drivers/scsi/Makefile
24538 --- linux-2.4.29/drivers/scsi/Makefile 2005-01-19 15:09:59.000000000 +0100
24539 +++ linux-mips/drivers/scsi/Makefile 2005-03-26 11:47:32.445326717 +0100
24540 @@ -134,6 +134,7 @@
24541 obj-$(CONFIG_SCSI_SATA_SVW) += libata.o sata_svw.o
24542 obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o
24543 obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o
24544 +obj-$(CONFIG_SCSI_SATA_QSTOR) += libata.o sata_qstor.o
24545 obj-$(CONFIG_SCSI_SATA_SIL) += libata.o sata_sil.o
24546 obj-$(CONFIG_SCSI_SATA_VIA) += libata.o sata_via.o
24547 obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o
24548 diff -Nur linux-2.4.29/drivers/scsi/megaraid2.c linux-mips/drivers/scsi/megaraid2.c
24549 --- linux-2.4.29/drivers/scsi/megaraid2.c 2004-11-17 12:54:21.000000000 +0100
24550 +++ linux-mips/drivers/scsi/megaraid2.c 2005-03-26 11:47:33.007234495 +0100
24551 @@ -14,7 +14,7 @@
24552 * - speed-ups (list handling fixes, issued_list, optimizations.)
24553 * - lots of cleanups.
24554 *
24555 - * Version : v2.10.3 (Apr 08, 2004)
24556 + * Version : v2.10.8.2 (July 26, 2004)
24557 *
24558 * Authors: Atul Mukker <Atul.Mukker@lsil.com>
24559 * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com>
24560 @@ -46,7 +46,7 @@
24561
24562 #include "megaraid2.h"
24563
24564 -#ifdef LSI_CONFIG_COMPAT
24565 +#if defined(__x86_64__)
24566 #include <asm/ioctl32.h>
24567 #endif
24568
24569 @@ -90,10 +90,15 @@
24570 static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
24571
24572 /*
24573 + * Lock to protect access to IOCTL
24574 + */
24575 +static struct semaphore megaraid_ioc_mtx;
24576 +
24577 +/*
24578 * The File Operations structure for the serial/ioctl interface of the driver
24579 */
24580 static struct file_operations megadev_fops = {
24581 - .ioctl = megadev_ioctl,
24582 + .ioctl = megadev_ioctl_entry,
24583 .open = megadev_open,
24584 .release = megadev_close,
24585 .owner = THIS_MODULE,
24586 @@ -107,7 +112,7 @@
24587 static struct mcontroller mcontroller[MAX_CONTROLLERS];
24588
24589 /* The current driver version */
24590 -static u32 driver_ver = 0x02100000;
24591 +static u32 driver_ver = 0x02104000;
24592
24593 /* major number used by the device for character interface */
24594 static int major;
24595 @@ -189,6 +194,11 @@
24596 */
24597 mega_reorder_hosts();
24598
24599 + /*
24600 + * Initialize the IOCTL lock
24601 + */
24602 + init_MUTEX( &megaraid_ioc_mtx );
24603 +
24604 #ifdef CONFIG_PROC_FS
24605 mega_proc_dir_entry = proc_mkdir("megaraid", &proc_root);
24606
24607 @@ -223,7 +233,7 @@
24608 "MegaRAID Shutdown routine not registered!!\n");
24609 }
24610
24611 -#ifdef LSI_CONFIG_COMPAT
24612 +#if defined(__x86_64__)
24613 /*
24614 * Register the 32-bit ioctl conversion
24615 */
24616 @@ -273,6 +283,8 @@
24617 unsigned long tbase;
24618 unsigned long flag = 0;
24619 int i, j;
24620 + u8 did_int_pthru_f = 0;
24621 + u8 did_int_data_f = 0;
24622
24623 while((pdev = pci_find_device(pci_vendor, pci_device, pdev))) {
24624
24625 @@ -328,6 +340,7 @@
24626 (subsysvid != HP_SUBSYS_VID) &&
24627 (subsysvid != INTEL_SUBSYS_VID) &&
24628 (subsysvid != FSC_SUBSYS_VID) &&
24629 + (subsysvid != ACER_SUBSYS_VID) &&
24630 (subsysvid != LSI_SUBSYS_VID) ) continue;
24631
24632
24633 @@ -465,6 +478,33 @@
24634
24635 alloc_scb_f = 1;
24636
24637 + /*
24638 + * Allocate memory for ioctls
24639 + */
24640 + adapter->int_pthru = pci_alloc_consistent (
24641 + adapter->dev,
24642 + sizeof(mega_passthru),
24643 + &adapter->int_pthru_dma_hndl );
24644 +
24645 + if( adapter->int_pthru == NULL ) {
24646 + printk(KERN_WARNING "megaraid: out of RAM.\n");
24647 + goto fail_attach;
24648 + }
24649 + else
24650 + did_int_pthru_f = 1;
24651 +
24652 + adapter->int_data = pci_alloc_consistent (
24653 + adapter->dev,
24654 + INT_MEMBLK_SZ,
24655 + &adapter->int_data_dma_hndl );
24656 +
24657 + if( adapter->int_data == NULL ) {
24658 + printk(KERN_WARNING "megaraid: out of RAM.\n");
24659 + goto fail_attach;
24660 + }
24661 + else
24662 + did_int_data_f = 1;
24663 +
24664 /* Request our IRQ */
24665 if( adapter->flag & BOARD_MEMMAP ) {
24666 if(request_irq(irq, megaraid_isr_memmapped, SA_SHIRQ,
24667 @@ -676,6 +716,19 @@
24668 continue;
24669
24670 fail_attach:
24671 + if( did_int_data_f ) {
24672 + pci_free_consistent(
24673 + adapter->dev, INT_MEMBLK_SZ, adapter->int_data,
24674 + adapter->int_data_dma_hndl );
24675 + }
24676 +
24677 + if( did_int_pthru_f ) {
24678 + pci_free_consistent(
24679 + adapter->dev, sizeof(mega_passthru),
24680 + (void*) adapter->int_pthru,
24681 + adapter->int_pthru_dma_hndl );
24682 + }
24683 +
24684 if( did_setup_mbox_f ) {
24685 pci_free_consistent(adapter->dev, sizeof(mbox64_t),
24686 (void *)adapter->una_mbox64,
24687 @@ -937,6 +990,78 @@
24688
24689
24690 /**
24691 + * issue_scb()
24692 + * @adapter - pointer to our soft state
24693 + * @scb - scsi control block
24694 + *
24695 + * Post a command to the card if the mailbox is available, otherwise return
24696 + * busy. We also take the scb from the pending list if the mailbox is
24697 + * available.
24698 + */
24699 +static inline int
24700 +issue_scb(adapter_t *adapter, scb_t *scb)
24701 +{
24702 + volatile mbox64_t *mbox64 = adapter->mbox64;
24703 + volatile mbox_t *mbox = adapter->mbox;
24704 + unsigned int i = 0;
24705 +
24706 + if(unlikely(mbox->busy)) {
24707 + do {
24708 + udelay(1);
24709 + i++;
24710 + } while( mbox->busy && (i < max_mbox_busy_wait) );
24711 +
24712 + if(mbox->busy) return -1;
24713 + }
24714 +
24715 + /* Copy mailbox data into host structure */
24716 + memcpy((char *)mbox, (char *)scb->raw_mbox, 16);
24717 +
24718 + mbox->cmdid = scb->idx; /* Set cmdid */
24719 + mbox->busy = 1; /* Set busy */
24720 +
24721 +
24722 + /*
24723 + * Increment the pending queue counter
24724 + */
24725 + atomic_inc(&adapter->pend_cmds);
24726 +
24727 + switch (mbox->cmd) {
24728 + case MEGA_MBOXCMD_EXTPTHRU:
24729 + if( !adapter->has_64bit_addr ) break;
24730 + // else fall through
24731 + case MEGA_MBOXCMD_LREAD64:
24732 + case MEGA_MBOXCMD_LWRITE64:
24733 + case MEGA_MBOXCMD_PASSTHRU64:
24734 + mbox64->xfer_segment_lo = mbox->xferaddr;
24735 + mbox64->xfer_segment_hi = 0;
24736 + mbox->xferaddr = 0xFFFFFFFF;
24737 + break;
24738 + default:
24739 + mbox64->xfer_segment_lo = 0;
24740 + mbox64->xfer_segment_hi = 0;
24741 + }
24742 +
24743 + /*
24744 + * post the command
24745 + */
24746 + scb->state |= SCB_ISSUED;
24747 +
24748 + if( likely(adapter->flag & BOARD_MEMMAP) ) {
24749 + mbox->poll = 0;
24750 + mbox->ack = 0;
24751 + WRINDOOR(adapter, adapter->mbox_dma | 0x1);
24752 + }
24753 + else {
24754 + irq_enable(adapter);
24755 + issue_command(adapter);
24756 + }
24757 +
24758 + return 0;
24759 +}
24760 +
24761 +
24762 +/**
24763 * mega_runpendq()
24764 * @adapter - pointer to our soft state
24765 *
24766 @@ -949,52 +1074,26 @@
24767 __mega_runpendq(adapter);
24768 }
24769
24770 -/*
24771 - * megaraid_queue()
24772 - * @scmd - Issue this scsi command
24773 - * @done - the callback hook into the scsi mid-layer
24774 - *
24775 - * The command queuing entry point for the mid-layer.
24776 - */
24777 -static int
24778 -megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
24779 -{
24780 - adapter_t *adapter;
24781 - scb_t *scb;
24782 - int busy=0;
24783 -
24784 - adapter = (adapter_t *)scmd->host->hostdata;
24785 -
24786 - scmd->scsi_done = done;
24787
24788 +static void
24789 +__mega_runpendq(adapter_t *adapter)
24790 +{
24791 + scb_t *scb;
24792 + struct list_head *pos, *next;
24793
24794 - /*
24795 - * Allocate and build a SCB request
24796 - * busy flag will be set if mega_build_cmd() command could not
24797 - * allocate scb. We will return non-zero status in that case.
24798 - * NOTE: scb can be null even though certain commands completed
24799 - * successfully, e.g., MODE_SENSE and TEST_UNIT_READY, we would
24800 - * return 0 in that case.
24801 - */
24802 + /* Issue any pending commands to the card */
24803 + list_for_each_safe(pos, next, &adapter->pending_list) {
24804
24805 - scb = mega_build_cmd(adapter, scmd, &busy);
24806 + scb = list_entry(pos, scb_t, list);
24807
24808 - if(scb) {
24809 - scb->state |= SCB_PENDQ;
24810 - list_add_tail(&scb->list, &adapter->pending_list);
24811 + if( !(scb->state & SCB_ISSUED) ) {
24812
24813 - /*
24814 - * Check if the HBA is in quiescent state, e.g., during a
24815 - * delete logical drive opertion. If it is, don't run
24816 - * the pending_list.
24817 - */
24818 - if(atomic_read(&adapter->quiescent) == 0) {
24819 - mega_runpendq(adapter);
24820 + if( issue_scb(adapter, scb) != 0 )
24821 + return;
24822 }
24823 - return 0;
24824 }
24825
24826 - return busy;
24827 + return;
24828 }
24829
24830
24831 @@ -1068,25 +1167,136 @@
24832 }
24833
24834 /*
24835 - * If "delete logical drive" feature is enabled on this controller.
24836 - * Do only if at least one delete logical drive operation was done.
24837 - *
24838 - * Also, after logical drive deletion, instead of logical drive number,
24839 + * If "delete logical drive" feature is enabled on this controller,
24840 * the value returned should be 0x80+logical drive id.
24841 - *
24842 - * These is valid only for IO commands.
24843 */
24844 + if (adapter->support_random_del)
24845 + ldrv_num += 0x80;
24846
24847 - if (adapter->support_random_del && adapter->read_ldidmap )
24848 - switch (cmd->cmnd[0]) {
24849 - case READ_6: /* fall through */
24850 - case WRITE_6: /* fall through */
24851 - case READ_10: /* fall through */
24852 - case WRITE_10:
24853 - ldrv_num += 0x80;
24854 + return ldrv_num;
24855 +}
24856 +
24857 +/*
24858 + * Wait until the controller's mailbox is available
24859 + */
24860 +static inline int
24861 +mega_busywait_mbox (adapter_t *adapter)
24862 +{
24863 + if (adapter->mbox->busy)
24864 + return __mega_busywait_mbox(adapter);
24865 + return 0;
24866 +}
24867 +
24868 +
24869 +/**
24870 + * megaraid_iombox_ack_sequence - interrupt ack sequence for IO mapped HBAs
24871 + * @adapter - controller's soft state
24872 + *
24873 + * Interrupt ackrowledgement sequence for IO mapped HBAs
24874 + */
24875 +static inline void
24876 +megaraid_iombox_ack_sequence(adapter_t *adapter)
24877 +{
24878 + u8 status;
24879 + u8 nstatus;
24880 + u8 completed[MAX_FIRMWARE_STATUS];
24881 + u8 byte;
24882 + int i;
24883 +
24884 +
24885 + /*
24886 + * loop till F/W has more commands for us to complete.
24887 + */
24888 + do {
24889 + /* Check if a valid interrupt is pending */
24890 + byte = irq_state(adapter);
24891 + if( (byte & VALID_INTR_BYTE) == 0 ) {
24892 + return;
24893 }
24894 + set_irq_state(adapter, byte);
24895
24896 - return ldrv_num;
24897 + while ((nstatus = adapter->mbox->numstatus) == 0xFF) {
24898 + cpu_relax();
24899 + }
24900 + adapter->mbox->numstatus = 0xFF;
24901 +
24902 + for (i = 0; i < nstatus; i++) {
24903 + while ((completed[i] = adapter->mbox->completed[i])
24904 + == 0xFF) {
24905 + cpu_relax();
24906 + }
24907 +
24908 + adapter->mbox->completed[i] = 0xFF;
24909 + }
24910 +
24911 + // we must read the valid status now
24912 + if ((status = adapter->mbox->status) == 0xFF) {
24913 + printk(KERN_WARNING
24914 + "megaraid critical: status 0xFF from firmware.\n");
24915 + }
24916 + adapter->mbox->status = 0xFF;
24917 +
24918 + /*
24919 + * decrement the pending queue counter
24920 + */
24921 + atomic_sub(nstatus, &adapter->pend_cmds);
24922 +
24923 + /* Acknowledge interrupt */
24924 + irq_ack(adapter);
24925 +
24926 + mega_cmd_done(adapter, completed, nstatus, status);
24927 +
24928 + } while(1);
24929 +}
24930 +
24931 +
24932 +
24933 +/*
24934 + * megaraid_queue()
24935 + * @scmd - Issue this scsi command
24936 + * @done - the callback hook into the scsi mid-layer
24937 + *
24938 + * The command queuing entry point for the mid-layer.
24939 + */
24940 +static int
24941 +megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
24942 +{
24943 + adapter_t *adapter;
24944 + scb_t *scb;
24945 + int busy=0;
24946 +
24947 + adapter = (adapter_t *)scmd->host->hostdata;
24948 +
24949 + scmd->scsi_done = done;
24950 +
24951 +
24952 + /*
24953 + * Allocate and build a SCB request
24954 + * busy flag will be set if mega_build_cmd() command could not
24955 + * allocate scb. We will return non-zero status in that case.
24956 + * NOTE: scb can be null even though certain commands completed
24957 + * successfully, e.g., MODE_SENSE and TEST_UNIT_READY, we would
24958 + * return 0 in that case.
24959 + */
24960 +
24961 + scb = mega_build_cmd(adapter, scmd, &busy);
24962 +
24963 + if(scb) {
24964 + scb->state |= SCB_PENDQ;
24965 + list_add_tail(&scb->list, &adapter->pending_list);
24966 +
24967 + /*
24968 + * Check if the HBA is in quiescent state, e.g., during a
24969 + * delete logical drive opertion. If it is, don't run
24970 + * the pending_list.
24971 + */
24972 + if(atomic_read(&adapter->quiescent) == 0) {
24973 + mega_runpendq(adapter);
24974 + }
24975 + return 0;
24976 + }
24977 +
24978 + return busy;
24979 }
24980
24981
24982 @@ -1112,7 +1322,6 @@
24983 mbox_t *mbox;
24984 long seg;
24985 char islogical;
24986 - int max_ldrv_num;
24987 int channel = 0;
24988 int target = 0;
24989 int ldrv_num = 0; /* logical drive number */
24990 @@ -1184,24 +1393,6 @@
24991 }
24992
24993 ldrv_num = mega_get_ldrv_num(adapter, cmd, channel);
24994 -
24995 -
24996 - max_ldrv_num = (adapter->flag & BOARD_40LD) ?
24997 - MAX_LOGICAL_DRIVES_40LD : MAX_LOGICAL_DRIVES_8LD;
24998 -
24999 - /*
25000 - * max_ldrv_num increases by 0x80 if some logical drive was
25001 - * deleted.
25002 - */
25003 - if(adapter->read_ldidmap)
25004 - max_ldrv_num += 0x80;
25005 -
25006 - if(ldrv_num > max_ldrv_num ) {
25007 - cmd->result = (DID_BAD_TARGET << 16);
25008 - cmd->scsi_done(cmd);
25009 - return NULL;
25010 - }
25011 -
25012 }
25013 else {
25014 if( cmd->lun > 7) {
25015 @@ -1671,111 +1862,6 @@
25016 }
25017
25018
25019 -static void
25020 -__mega_runpendq(adapter_t *adapter)
25021 -{
25022 - scb_t *scb;
25023 - struct list_head *pos, *next;
25024 -
25025 - /* Issue any pending commands to the card */
25026 - list_for_each_safe(pos, next, &adapter->pending_list) {
25027 -
25028 - scb = list_entry(pos, scb_t, list);
25029 -
25030 - if( !(scb->state & SCB_ISSUED) ) {
25031 -
25032 - if( issue_scb(adapter, scb) != 0 )
25033 - return;
25034 - }
25035 - }
25036 -
25037 - return;
25038 -}
25039 -
25040 -
25041 -/**
25042 - * issue_scb()
25043 - * @adapter - pointer to our soft state
25044 - * @scb - scsi control block
25045 - *
25046 - * Post a command to the card if the mailbox is available, otherwise return
25047 - * busy. We also take the scb from the pending list if the mailbox is
25048 - * available.
25049 - */
25050 -static int
25051 -issue_scb(adapter_t *adapter, scb_t *scb)
25052 -{
25053 - volatile mbox64_t *mbox64 = adapter->mbox64;
25054 - volatile mbox_t *mbox = adapter->mbox;
25055 - unsigned int i = 0;
25056 -
25057 - if(unlikely(mbox->busy)) {
25058 - do {
25059 - udelay(1);
25060 - i++;
25061 - } while( mbox->busy && (i < max_mbox_busy_wait) );
25062 -
25063 - if(mbox->busy) return -1;
25064 - }
25065 -
25066 - /* Copy mailbox data into host structure */
25067 - memcpy((char *)mbox, (char *)scb->raw_mbox, 16);
25068 -
25069 - mbox->cmdid = scb->idx; /* Set cmdid */
25070 - mbox->busy = 1; /* Set busy */
25071 -
25072 -
25073 - /*
25074 - * Increment the pending queue counter
25075 - */
25076 - atomic_inc(&adapter->pend_cmds);
25077 -
25078 - switch (mbox->cmd) {
25079 - case MEGA_MBOXCMD_EXTPTHRU:
25080 - if( !adapter->has_64bit_addr ) break;
25081 - // else fall through
25082 - case MEGA_MBOXCMD_LREAD64:
25083 - case MEGA_MBOXCMD_LWRITE64:
25084 - case MEGA_MBOXCMD_PASSTHRU64:
25085 - mbox64->xfer_segment_lo = mbox->xferaddr;
25086 - mbox64->xfer_segment_hi = 0;
25087 - mbox->xferaddr = 0xFFFFFFFF;
25088 - break;
25089 - default:
25090 - mbox64->xfer_segment_lo = 0;
25091 - mbox64->xfer_segment_hi = 0;
25092 - }
25093 -
25094 - /*
25095 - * post the command
25096 - */
25097 - scb->state |= SCB_ISSUED;
25098 -
25099 - if( likely(adapter->flag & BOARD_MEMMAP) ) {
25100 - mbox->poll = 0;
25101 - mbox->ack = 0;
25102 - WRINDOOR(adapter, adapter->mbox_dma | 0x1);
25103 - }
25104 - else {
25105 - irq_enable(adapter);
25106 - issue_command(adapter);
25107 - }
25108 -
25109 - return 0;
25110 -}
25111 -
25112 -
25113 -/*
25114 - * Wait until the controller's mailbox is available
25115 - */
25116 -static inline int
25117 -mega_busywait_mbox (adapter_t *adapter)
25118 -{
25119 - if (adapter->mbox->busy)
25120 - return __mega_busywait_mbox(adapter);
25121 - return 0;
25122 -}
25123 -
25124 /**
25125 * issue_scb_block()
25126 * @adapter - pointer to our soft state
25127 @@ -1865,77 +1951,47 @@
25128 // invalidate the completed command id array. After command
25129 // completion, firmware would write the valid id.
25130 for (i = 0; i < MAX_FIRMWARE_STATUS; i++) {
25131 - mbox->completed[i] = 0xFF;
25132 - }
25133 -
25134 - return status;
25135 -
25136 -bug_blocked_mailbox:
25137 - printk(KERN_WARNING "megaraid: Blocked mailbox......!!\n");
25138 - udelay (1000);
25139 - return -1;
25140 -}
25141 -
25142 -
25143 -/**
25144 - * megaraid_iombox_ack_sequence - interrupt ack sequence for IO mapped HBAs
25145 - * @adapter - controller's soft state
25146 - *
25147 - * Interrupt ackrowledgement sequence for IO mapped HBAs
25148 - */
25149 -static inline void
25150 -megaraid_iombox_ack_sequence(adapter_t *adapter)
25151 -{
25152 - u8 status;
25153 - u8 nstatus;
25154 - u8 completed[MAX_FIRMWARE_STATUS];
25155 - u8 byte;
25156 - int i;
25157 -
25158 -
25159 - /*
25160 - * loop till F/W has more commands for us to complete.
25161 - */
25162 - do {
25163 - /* Check if a valid interrupt is pending */
25164 - byte = irq_state(adapter);
25165 - if( (byte & VALID_INTR_BYTE) == 0 ) {
25166 - return;
25167 - }
25168 - set_irq_state(adapter, byte);
25169 + mbox->completed[i] = 0xFF;
25170 + }
25171
25172 - while ((nstatus = adapter->mbox->numstatus) == 0xFF) {
25173 - cpu_relax();
25174 - }
25175 - adapter->mbox->numstatus = 0xFF;
25176 + return status;
25177
25178 - for (i = 0; i < nstatus; i++) {
25179 - while ((completed[i] = adapter->mbox->completed[i])
25180 - == 0xFF) {
25181 - cpu_relax();
25182 - }
25183 +bug_blocked_mailbox:
25184 + printk(KERN_WARNING "megaraid: Blocked mailbox......!!\n");
25185 + udelay (1000);
25186 + return -1;
25187 +}
25188
25189 - adapter->mbox->completed[i] = 0xFF;
25190 - }
25191
25192 - // we must read the valid status now
25193 - if ((status = adapter->mbox->status) == 0xFF) {
25194 - printk(KERN_WARNING
25195 - "megaraid critical: status 0xFF from firmware.\n");
25196 - }
25197 - adapter->mbox->status = 0xFF;
25198 +/**
25199 + * megaraid_isr_iomapped()
25200 + * @irq - irq
25201 + * @devp - pointer to our soft state
25202 + * @regs - unused
25203 + *
25204 + * Interrupt service routine for io-mapped controllers.
25205 + * Find out if our device is interrupting. If yes, acknowledge the interrupt
25206 + * and service the completed commands.
25207 + */
25208 +static void
25209 +megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
25210 +{
25211 + adapter_t *adapter = devp;
25212 + unsigned long flags;
25213
25214 - /*
25215 - * decrement the pending queue counter
25216 - */
25217 - atomic_sub(nstatus, &adapter->pend_cmds);
25218
25219 - /* Acknowledge interrupt */
25220 - irq_ack(adapter);
25221 + spin_lock_irqsave(adapter->host_lock, flags);
25222
25223 - mega_cmd_done(adapter, completed, nstatus, status);
25224 + megaraid_iombox_ack_sequence(adapter);
25225
25226 - } while(1);
25227 + /* Loop through any pending requests */
25228 + if( atomic_read(&adapter->quiescent ) == 0) {
25229 + mega_runpendq(adapter);
25230 + }
25231 +
25232 + spin_unlock_irqrestore(adapter->host_lock, flags);
25233 +
25234 + return;
25235 }
25236
25237
25238 @@ -2007,38 +2063,6 @@
25239
25240
25241 /**
25242 - * megaraid_isr_iomapped()
25243 - * @irq - irq
25244 - * @devp - pointer to our soft state
25245 - * @regs - unused
25246 - *
25247 - * Interrupt service routine for io-mapped controllers.
25248 - * Find out if our device is interrupting. If yes, acknowledge the interrupt
25249 - * and service the completed commands.
25250 - */
25251 -static void
25252 -megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
25253 -{
25254 - adapter_t *adapter = devp;
25255 - unsigned long flags;
25256 -
25257 -
25258 - spin_lock_irqsave(adapter->host_lock, flags);
25259 -
25260 - megaraid_iombox_ack_sequence(adapter);
25261 -
25262 - /* Loop through any pending requests */
25263 - if( atomic_read(&adapter->quiescent ) == 0) {
25264 - mega_runpendq(adapter);
25265 - }
25266 -
25267 - spin_unlock_irqrestore(adapter->host_lock, flags);
25268 -
25269 - return;
25270 -}
25271 -
25272 -
25273 -/**
25274 * megaraid_isr_memmapped()
25275 * @irq - irq
25276 * @devp - pointer to our soft state
25277 @@ -2069,7 +2093,6 @@
25278 return;
25279 }
25280
25281 -
25282 /**
25283 * mega_cmd_done()
25284 * @adapter - pointer to our soft state
25285 @@ -2381,7 +2404,6 @@
25286 list_add(&scb->list, &adapter->free_list);
25287 }
25288
25289 -
25290 static int
25291 __mega_busywait_mbox (adapter_t *adapter)
25292 {
25293 @@ -2412,6 +2434,10 @@
25294
25295 cmd = scb->cmd;
25296
25297 + /* return 0 elements if no data transfer */
25298 + if (!cmd->request_buffer || !cmd->request_bufflen)
25299 + return 0;
25300 +
25301 /* Scatter-gather not used */
25302 if( !cmd->use_sg ) {
25303
25304 @@ -2535,7 +2561,6 @@
25305 enquiry3->pdrv_state[i] = inquiry->pdrv_info.pdrv_state[i];
25306 }
25307
25308 -
25309 static inline void
25310 mega_free_sgl(adapter_t *adapter)
25311 {
25312 @@ -2666,6 +2691,13 @@
25313 pci_free_consistent(adapter->dev, sizeof(mbox64_t),
25314 (void *)adapter->una_mbox64, adapter->una_mbox64_dma);
25315
25316 + pci_free_consistent( adapter->dev, sizeof(mega_passthru),
25317 + (void*) adapter->int_pthru,
25318 + adapter->int_pthru_dma_hndl );
25319 +
25320 + pci_free_consistent( adapter->dev, INT_MEMBLK_SZ, adapter->int_data,
25321 + adapter->int_data_dma_hndl );
25322 +
25323 hba_count--;
25324
25325 if( hba_count == 0 ) {
25326 @@ -2694,7 +2726,7 @@
25327 */
25328 scsi_unregister(host);
25329
25330 -#ifdef LSI_CONFIG_COMPAT
25331 +#if defined(__x86_64__)
25332 unregister_ioctl32_conversion(MEGAIOCCMD);
25333 #endif
25334
25335 @@ -2736,30 +2768,36 @@
25336 }
25337
25338
25339 -/**
25340 - * megaraid_abort - abort the scsi command
25341 - * @scp - command to be aborted
25342 - *
25343 - * Abort a previous SCSI request. Only commands on the pending list can be
25344 - * aborted. All the commands issued to the F/W must complete.
25345 - */
25346 static int
25347 megaraid_abort(Scsi_Cmnd *scp)
25348 {
25349 adapter_t *adapter;
25350 struct list_head *pos, *next;
25351 scb_t *scb;
25352 - long iter;
25353 - int rval = SUCCESS;
25354 +
25355 + printk("megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n",
25356 + scp->serial_number, scp->cmnd[0], scp->channel,
25357 + scp->target, scp->lun);
25358
25359 adapter = (adapter_t *)scp->host->hostdata;
25360
25361 - ASSERT( spin_is_locked(adapter->host_lock) );
25362 + /*
25363 + * Check if hw_error flag was set in previous RESET call. If it was,
25364 + * then FW is hanging and unlikely to function. We can return FAILURE
25365 + * from here and expect the RESET handler to be called.
25366 + */
25367
25368 - printk("megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n",
25369 - scp->serial_number, scp->cmnd[0], scp->channel, scp->target,
25370 - scp->lun);
25371 + if (adapter->hw_error) {
25372 + printk("megaraid: hw error, cannot abort\n");
25373 + return FAILED;
25374 + }
25375 +
25376 + ASSERT( spin_is_locked(adapter->host_lock) );
25377
25378 + /*
25379 + * If cmd is waiting to be issued to FW, ABORT it with SUCEESS. If it
25380 + * has already been issued, return FAILURE and expect RESET later.
25381 + */
25382
25383 list_for_each_safe( pos, next, &adapter->pending_list ) {
25384
25385 @@ -2769,15 +2807,11 @@
25386
25387 scb->state |= SCB_ABORT;
25388
25389 - /*
25390 - * Check if this command was never issued. If this is
25391 - * the case, take it off from the pending list and
25392 - * complete.
25393 - */
25394 if( !(scb->state & SCB_ISSUED) ) {
25395
25396 - printk(KERN_WARNING
25397 - "megaraid: %ld:%d, driver owner.\n",
25398 + /* Not issued to the FW yet; ABORT it */
25399 +
25400 + printk( "megaraid: %ld:%d, driver owner.\n",
25401 scp->serial_number, scb->idx);
25402
25403 scp->result = (DID_ABORT << 16);
25404 @@ -2786,67 +2820,31 @@
25405
25406 scp->scsi_done(scp);
25407
25408 - break;
25409 + return SUCCESS;
25410 + }
25411 + else {
25412 + /* Issued to the FW; can do nothing */
25413 + return FAILED;
25414 }
25415 }
25416 }
25417
25418 /*
25419 - * By this time, either all commands are completed or aborted by
25420 - * mid-layer. Do not return until all the commands are actually
25421 - * completed by the firmware
25422 + * cmd is _not_ in our pending_list. Most likely we completed the cmd
25423 */
25424 - iter = 0;
25425 - while( atomic_read(&adapter->pend_cmds) > 0 ) {
25426 - /*
25427 - * Perform the ack sequence, since interrupts are not
25428 - * available right now!
25429 - */
25430 - if( adapter->flag & BOARD_MEMMAP ) {
25431 - megaraid_memmbox_ack_sequence(adapter);
25432 - }
25433 - else {
25434 - megaraid_iombox_ack_sequence(adapter);
25435 - }
25436 -
25437 - /*
25438 - * print a message once every second only
25439 - */
25440 - if( !(iter % 1000) ) {
25441 - printk(
25442 - "megaraid: Waiting for %d commands to flush: iter:%ld\n",
25443 - atomic_read(&adapter->pend_cmds), iter);
25444 - }
25445 -
25446 - if( iter++ < MBOX_ABORT_SLEEP*1000 ) {
25447 - mdelay(1);
25448 - }
25449 - else {
25450 - printk(KERN_WARNING
25451 - "megaraid: critical hardware error!\n");
25452 -
25453 - rval = FAILED;
25454 -
25455 - break;
25456 - }
25457 - }
25458 -
25459 - if( rval == SUCCESS ) {
25460 - printk(KERN_INFO
25461 - "megaraid: abort sequence successfully completed.\n");
25462 - }
25463 -
25464 - return rval;
25465 + return SUCCESS;
25466 }
25467
25468
25469 static int
25470 megaraid_reset(Scsi_Cmnd *cmd)
25471 {
25472 - adapter_t *adapter;
25473 - megacmd_t mc;
25474 - long iter;
25475 - int rval = SUCCESS;
25476 + DECLARE_WAIT_QUEUE_HEAD(wq);
25477 + int i;
25478 + scb_t *scb;
25479 + adapter_t *adapter;
25480 + struct list_head *pos, *next;
25481 + int rval;
25482
25483 adapter = (adapter_t *)cmd->host->hostdata;
25484
25485 @@ -2856,31 +2854,54 @@
25486 cmd->serial_number, cmd->cmnd[0], cmd->channel, cmd->target,
25487 cmd->lun);
25488
25489 + /*
25490 + * Check if hw_error flag was set in previous RESET call. If it was,
25491 + * then we needn't do any handling here. The controller will be marked
25492 + * offline soon
25493 + */
25494
25495 -#if MEGA_HAVE_CLUSTERING
25496 - mc.cmd = MEGA_CLUSTER_CMD;
25497 - mc.opcode = MEGA_RESET_RESERVATIONS;
25498 -
25499 - spin_unlock_irq(adapter->host_lock);
25500 - if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) {
25501 - printk(KERN_WARNING
25502 - "megaraid: reservation reset failed.\n");
25503 + if (adapter->hw_error) {
25504 + printk("megaraid: hw error, cannot reset\n");
25505 + return FAILED;
25506 }
25507 - else {
25508 - printk(KERN_INFO "megaraid: reservation reset.\n");
25509 +
25510 + /*
25511 + * Return all the pending cmds to the mid-layer with the cmd result
25512 + * DID_RESET. Make sure you don't return the cmds ISSUED to FW.
25513 + */
25514 + list_for_each_safe( pos, next, &adapter->pending_list ) {
25515 +
25516 + scb = list_entry(pos, scb_t, list);
25517 + scb->state |= SCB_RESET;
25518 +
25519 + if( !(scb->state & SCB_ISSUED) ) {
25520 +
25521 + /* Not issued to the FW; return with RESET */
25522 + cmd->result = (DID_RESET << 16);
25523 +
25524 + mega_free_scb(adapter, scb);
25525 + cmd->scsi_done(cmd);
25526 + }
25527 }
25528 - spin_lock_irq(adapter->host_lock);
25529 -#endif
25530
25531 /*
25532 - * Do not return until all the commands are actually completed by the
25533 - * firmware
25534 + * Under exceptional conditions, FW may take up to 3 mins to complete
25535 + * processing all pending commands. We'll wait for maximum 3 mins to
25536 + * see if all outstanding commands are completed.
25537 */
25538 - iter = 0;
25539 - while( atomic_read(&adapter->pend_cmds) > 0 ) {
25540 +
25541 + if (atomic_read(&adapter->pend_cmds) == 0)
25542 + return SUCCESS;
25543 +
25544 + printk("megaraid: %d pending cmds; max wait %d seconds\n",
25545 + atomic_read(&adapter->pend_cmds), MBOX_RESET_WAIT );
25546 +
25547 + for(i=0; (i<MBOX_RESET_WAIT)&&(atomic_read(&adapter->pend_cmds)); i++){
25548 +
25549 + ASSERT( spin_is_locked(adapter->host_lock) );
25550 +
25551 /*
25552 - * Perform the ack sequence, since interrupts are not
25553 - * available right now!
25554 + * Perform the ack sequence, since interrupts are unavailable
25555 */
25556 if( adapter->flag & BOARD_MEMMAP ) {
25557 megaraid_memmbox_ack_sequence(adapter);
25558 @@ -2889,55 +2910,35 @@
25559 megaraid_iombox_ack_sequence(adapter);
25560 }
25561
25562 - /*
25563 - * print a message once every second only
25564 - */
25565 - if( !(iter % 1000) ) {
25566 - printk(
25567 - "megaraid: Waiting for %d commands to flush: iter:%ld\n",
25568 - atomic_read(&adapter->pend_cmds), iter);
25569 - }
25570 + spin_unlock(adapter->host_lock);
25571
25572 - if( iter++ < MBOX_RESET_SLEEP*1000 ) {
25573 - mdelay(1);
25574 + /* Print a message once every 5 seconds */
25575 + if (!(i % 5)) {
25576 + printk("megaraid: pending %d; remaining %d seconds\n",
25577 + atomic_read(&adapter->pend_cmds),
25578 + MBOX_RESET_WAIT - i);
25579 }
25580 - else {
25581 - printk(KERN_WARNING
25582 - "megaraid: critical hardware error!\n");
25583
25584 - rval = FAILED;
25585 -
25586 - break;
25587 - }
25588 - }
25589 + sleep_on_timeout(&wq, HZ);
25590
25591 - if( rval == SUCCESS ) {
25592 - printk(KERN_INFO
25593 - "megaraid: reset sequence successfully completed.\n");
25594 + spin_lock(adapter->host_lock);
25595 }
25596
25597 - return rval;
25598 -}
25599 -
25600 + /*
25601 + * If after 3 mins there are still outstanding cmds, set the hw_error
25602 + * flag so that we can return from subsequent ABORT/RESET handlers
25603 + * without any processing
25604 + */
25605
25606 -/**
25607 - * mega_allocate_inquiry()
25608 - * @dma_handle - handle returned for dma address
25609 - * @pdev - handle to pci device
25610 - *
25611 - * allocates memory for inquiry structure
25612 - */
25613 -static inline caddr_t
25614 -mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
25615 -{
25616 - return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
25617 -}
25618 + rval = SUCCESS;
25619 + if (atomic_read(&adapter->pend_cmds)) {
25620
25621 + adapter->hw_error = 1;
25622 + printk("megaraid: critical hardware error!\n" );
25623 + rval = FAILED;
25624 + }
25625
25626 -static inline void
25627 -mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
25628 -{
25629 - pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
25630 + return rval;
25631 }
25632
25633
25634 @@ -3199,6 +3200,26 @@
25635 return len;
25636 }
25637
25638 +/**
25639 + * mega_allocate_inquiry()
25640 + * @dma_handle - handle returned for dma address
25641 + * @pdev - handle to pci device
25642 + *
25643 + * allocates memory for inquiry structure
25644 + */
25645 +static inline caddr_t
25646 +mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
25647 +{
25648 + return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
25649 +}
25650 +
25651 +
25652 +static inline void
25653 +mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
25654 +{
25655 + pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
25656 +}
25657 +
25658
25659 /**
25660 * proc_rebuild_rate()
25661 @@ -3988,6 +4009,7 @@
25662 megaraid_reboot_notify (struct notifier_block *this, unsigned long code,
25663 void *unused)
25664 {
25665 + DECLARE_WAIT_QUEUE_HEAD(wq);
25666 adapter_t *adapter;
25667 struct Scsi_Host *host;
25668 u8 raw_mbox[sizeof(mbox_t)];
25669 @@ -4040,10 +4062,10 @@
25670 printk(KERN_INFO "megaraid: cache flush delay: ");
25671 for( i = 9; i >= 0; i-- ) {
25672 printk("\b\b\b[%d]", i);
25673 - mdelay(1000);
25674 + sleep_on_timeout(&wq, HZ);
25675 }
25676 printk("\b\b\b[done]\n");
25677 - mdelay(1000);
25678 + sleep_on_timeout(&wq, HZ);
25679
25680 return NOTIFY_DONE;
25681 }
25682 @@ -4150,17 +4172,27 @@
25683 }
25684
25685
25686 -#ifdef LSI_CONFIG_COMPAT
25687 +#if defined(__x86_64__)
25688 static int
25689 megadev_compat_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
25690 struct file *filep)
25691 {
25692 struct inode *inode = filep->f_dentry->d_inode;
25693
25694 - return megadev_ioctl(inode, filep, cmd, arg);
25695 + return megadev_ioctl_entry(inode, filep, cmd, arg);
25696 }
25697 #endif
25698
25699 +static int
25700 +megadev_ioctl_entry(struct inode *inode, struct file *filep, unsigned int cmd,
25701 + unsigned long arg)
25702 +{
25703 + int rval;
25704 + down( &megaraid_ioc_mtx );
25705 + rval = megadev_ioctl( inode, filep, cmd, arg );
25706 + up( &megaraid_ioc_mtx );
25707 + return rval;
25708 +}
25709
25710 /**
25711 * megadev_ioctl()
25712 @@ -4184,9 +4216,8 @@
25713 int rval;
25714 mega_passthru *upthru; /* user address for passthru */
25715 mega_passthru *pthru; /* copy user passthru here */
25716 - dma_addr_t pthru_dma_hndl;
25717 void *data = NULL; /* data to be transferred */
25718 - dma_addr_t data_dma_hndl; /* dma handle for data xfer area */
25719 + dma_addr_t data_dma_hndl = 0;
25720 megacmd_t mc;
25721 megastat_t *ustats;
25722 int num_ldrv;
25723 @@ -4302,7 +4333,7 @@
25724 /*
25725 * Which adapter
25726 */
25727 - if( (adapno = GETADAP(uioc.adapno)) >= hba_count )
25728 + if( (adapno = GETADAP(uioc.adapno)) >= hba_count )
25729 return (-ENODEV);
25730
25731 adapter = hba_soft_state[adapno];
25732 @@ -4358,13 +4389,7 @@
25733 if( uioc.uioc_rmbox[0] == MEGA_MBOXCMD_PASSTHRU ) {
25734 /* Passthru commands */
25735
25736 - pthru = pci_alloc_consistent(pdev,
25737 - sizeof(mega_passthru),
25738 - &pthru_dma_hndl);
25739 -
25740 - if( pthru == NULL ) {
25741 - return (-ENOMEM);
25742 - }
25743 + pthru = adapter->int_pthru;
25744
25745 /*
25746 * The user passthru structure
25747 @@ -4376,29 +4401,27 @@
25748 */
25749 if( copy_from_user(pthru, (char *)upthru,
25750 sizeof(mega_passthru)) ) {
25751 -
25752 - pci_free_consistent(pdev,
25753 - sizeof(mega_passthru), pthru,
25754 - pthru_dma_hndl);
25755 -
25756 return (-EFAULT);
25757 }
25758
25759 /*
25760 - * Is there a data transfer
25761 + * Is there a data transfer; If the data transfer
25762 + * length is <= INT_MEMBLK_SZ, usr the buffer
25763 + * allocated at the load time. Otherwise, allocate it
25764 + * here.
25765 */
25766 - if( pthru->dataxferlen ) {
25767 - data = pci_alloc_consistent(pdev,
25768 - pthru->dataxferlen,
25769 - &data_dma_hndl);
25770 -
25771 - if( data == NULL ) {
25772 - pci_free_consistent(pdev,
25773 - sizeof(mega_passthru),
25774 - pthru,
25775 - pthru_dma_hndl);
25776 + if (pthru->dataxferlen) {
25777 + if (pthru->dataxferlen > INT_MEMBLK_SZ) {
25778 + data = pci_alloc_consistent (
25779 + pdev,
25780 + pthru->dataxferlen,
25781 + &data_dma_hndl );
25782
25783 - return (-ENOMEM);
25784 + if (data == NULL)
25785 + return (-ENOMEM);
25786 + }
25787 + else {
25788 + data = adapter->int_data;
25789 }
25790
25791 /*
25792 @@ -4406,7 +4429,11 @@
25793 * address at just allocated memory
25794 */
25795 uxferaddr = pthru->dataxferaddr;
25796 - pthru->dataxferaddr = data_dma_hndl;
25797 + if (data_dma_hndl)
25798 + pthru->dataxferaddr = data_dma_hndl;
25799 + else
25800 + pthru->dataxferaddr =
25801 + adapter->int_data_dma_hndl;
25802 }
25803
25804
25805 @@ -4421,14 +4448,14 @@
25806 (char *)((ulong)uxferaddr),
25807 pthru->dataxferlen) ) {
25808 rval = (-EFAULT);
25809 - goto freemem_and_return;
25810 + goto freedata_and_return;
25811 }
25812 }
25813
25814 memset(&mc, 0, sizeof(megacmd_t));
25815
25816 mc.cmd = MEGA_MBOXCMD_PASSTHRU;
25817 - mc.xferaddr = (u32)pthru_dma_hndl;
25818 + mc.xferaddr = (u32)adapter->int_pthru_dma_hndl;
25819
25820 /*
25821 * Issue the command
25822 @@ -4437,7 +4464,7 @@
25823
25824 rval = mega_n_to_m((void *)arg, &mc);
25825
25826 - if( rval ) goto freemem_and_return;
25827 + if( rval ) goto freedata_and_return;
25828
25829
25830 /*
25831 @@ -4456,18 +4483,14 @@
25832 */
25833 copy_to_user(upthru->reqsensearea,
25834 pthru->reqsensearea, 14);
25835 -
25836 -freemem_and_return:
25837 - if( pthru->dataxferlen ) {
25838 - pci_free_consistent(pdev,
25839 - pthru->dataxferlen, data,
25840 - data_dma_hndl);
25841 +freedata_and_return:
25842 + if (data_dma_hndl) {
25843 + pci_free_consistent( pdev, pthru->dataxferlen,
25844 + data, data_dma_hndl );
25845 }
25846
25847 - pci_free_consistent(pdev, sizeof(mega_passthru),
25848 - pthru, pthru_dma_hndl);
25849 -
25850 return rval;
25851 +
25852 }
25853 else {
25854 /* DCMD commands */
25855 @@ -4476,13 +4499,18 @@
25856 * Is there a data transfer
25857 */
25858 if( uioc.xferlen ) {
25859 - data = pci_alloc_consistent(pdev,
25860 - uioc.xferlen, &data_dma_hndl);
25861 + if (uioc.xferlen > INT_MEMBLK_SZ) {
25862 + data = pci_alloc_consistent(
25863 + pdev,
25864 + uioc.xferlen,
25865 + &data_dma_hndl );
25866
25867 - if( data == NULL ) {
25868 - return (-ENOMEM);
25869 + if (data == NULL)
25870 + return (-ENOMEM);
25871 + }
25872 + else {
25873 + data = adapter->int_data;
25874 }
25875 -
25876 uxferaddr = MBOX(uioc)->xferaddr;
25877 }
25878
25879 @@ -4497,9 +4525,9 @@
25880 (char *)((ulong)uxferaddr),
25881 uioc.xferlen) ) {
25882
25883 - pci_free_consistent(pdev,
25884 - uioc.xferlen, data,
25885 - data_dma_hndl);
25886 + pci_free_consistent(
25887 + pdev, uioc.xferlen,
25888 + data, data_dma_hndl );
25889
25890 return (-EFAULT);
25891 }
25892 @@ -4507,7 +4535,10 @@
25893
25894 memcpy(&mc, MBOX(uioc), sizeof(megacmd_t));
25895
25896 - mc.xferaddr = (u32)data_dma_hndl;
25897 + if (data_dma_hndl )
25898 + mc.xferaddr = (u32)data_dma_hndl;
25899 + else
25900 + mc.xferaddr = (u32)(adapter->int_data_dma_hndl);
25901
25902 /*
25903 * Issue the command
25904 @@ -4517,12 +4548,10 @@
25905 rval = mega_n_to_m((void *)arg, &mc);
25906
25907 if( rval ) {
25908 - if( uioc.xferlen ) {
25909 - pci_free_consistent(pdev,
25910 - uioc.xferlen, data,
25911 - data_dma_hndl);
25912 + if (data_dma_hndl) {
25913 + pci_free_consistent( pdev, uioc.xferlen,
25914 + data, data_dma_hndl );
25915 }
25916 -
25917 return rval;
25918 }
25919
25920 @@ -4537,10 +4566,9 @@
25921 }
25922 }
25923
25924 - if( uioc.xferlen ) {
25925 - pci_free_consistent(pdev,
25926 - uioc.xferlen, data,
25927 - data_dma_hndl);
25928 + if (data_dma_hndl) {
25929 + pci_free_consistent( pdev, uioc.xferlen,
25930 + data, data_dma_hndl );
25931 }
25932
25933 return rval;
25934 @@ -4725,19 +4753,22 @@
25935 else {
25936 uioc_mimd = (struct uioctl_t *)arg;
25937
25938 - if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) )
25939 + if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) ) {
25940 return (-EFAULT);
25941 + }
25942
25943 if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) {
25944
25945 umc = (megacmd_t *)uioc_mimd->mbox;
25946 - if (copy_from_user(&kmc, umc, sizeof(megacmd_t)))
25947 + if (copy_from_user(&kmc, umc, sizeof(megacmd_t))) {
25948 return -EFAULT;
25949 + }
25950
25951 upthru = (mega_passthru *)((ulong)kmc.xferaddr);
25952
25953 - if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
25954 + if( put_user(mc->status, (u8 *)&upthru->scsistatus) ){
25955 return (-EFAULT);
25956 + }
25957 }
25958 }
25959
25960 @@ -5148,7 +5179,6 @@
25961 }
25962
25963
25964 -
25965 /**
25966 * mega_reorder_hosts()
25967 *
25968 @@ -5363,6 +5393,7 @@
25969 }
25970
25971
25972 +
25973 /** mega_internal_dev_inquiry()
25974 * @adapter - pointer to our soft state
25975 * @ch - channel for this device
25976 diff -Nur linux-2.4.29/drivers/scsi/megaraid2.h linux-mips/drivers/scsi/megaraid2.h
25977 --- linux-2.4.29/drivers/scsi/megaraid2.h 2004-11-17 12:54:21.000000000 +0100
25978 +++ linux-mips/drivers/scsi/megaraid2.h 2005-03-26 11:47:33.143212178 +0100
25979 @@ -6,7 +6,7 @@
25980
25981
25982 #define MEGARAID_VERSION \
25983 - "v2.10.3 (Release Date: Thu Apr 8 16:16:05 EDT 2004)\n"
25984 + "v2.10.8.2 (Release Date: Mon Jul 26 12:15:51 EDT 2004)\n"
25985
25986 /*
25987 * Driver features - change the values to enable or disable features in the
25988 @@ -82,6 +82,7 @@
25989 #define LSI_SUBSYS_VID 0x1000
25990 #define INTEL_SUBSYS_VID 0x8086
25991 #define FSC_SUBSYS_VID 0x1734
25992 +#define ACER_SUBSYS_VID 0x1025
25993
25994 #define HBA_SIGNATURE 0x3344
25995 #define HBA_SIGNATURE_471 0xCCCC
25996 @@ -978,6 +979,15 @@
25997 cmds */
25998
25999 int has_cluster; /* cluster support on this HBA */
26000 +
26001 +#define INT_MEMBLK_SZ (28*1024)
26002 + mega_passthru *int_pthru; /*internal pthru*/
26003 + dma_addr_t int_pthru_dma_hndl;
26004 + caddr_t int_data; /*internal data*/
26005 + dma_addr_t int_data_dma_hndl;
26006 +
26007 + int hw_error;
26008 +
26009 }adapter_t;
26010
26011
26012 @@ -1085,18 +1095,21 @@
26013
26014 #define MBOX_ABORT_SLEEP 60
26015 #define MBOX_RESET_SLEEP 30
26016 +#define MBOX_RESET_WAIT 180
26017
26018 const char *megaraid_info (struct Scsi_Host *);
26019
26020 static int megaraid_detect(Scsi_Host_Template *);
26021 static void mega_find_card(Scsi_Host_Template *, u16, u16);
26022 static int mega_query_adapter(adapter_t *);
26023 -static int issue_scb(adapter_t *, scb_t *);
26024 +static inline int issue_scb(adapter_t *, scb_t *);
26025 static int mega_setup_mailbox(adapter_t *);
26026
26027 static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
26028 static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *);
26029 +static inline scb_t *mega_allocate_scb(adapter_t *, Scsi_Cmnd *);
26030 static void __mega_runpendq(adapter_t *);
26031 +static inline void mega_runpendq(adapter_t *);
26032 static int issue_scb_block(adapter_t *, u_char *);
26033
26034 static void megaraid_isr_memmapped(int, void *, struct pt_regs *);
26035 @@ -1113,6 +1126,7 @@
26036
26037 static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
26038 u32 *buffer, u32 *length);
26039 +static inline int mega_busywait_mbox (adapter_t *);
26040 static int __mega_busywait_mbox (adapter_t *);
26041 static void mega_cmd_done(adapter_t *, u8 [], int, int);
26042 static inline void mega_free_sgl (adapter_t *adapter);
26043 @@ -1123,15 +1137,13 @@
26044 unsigned long, void *);
26045 static int megadev_open (struct inode *, struct file *);
26046
26047 -#if defined(CONFIG_COMPAT) || defined( __x86_64__) || defined(IA32_EMULATION)
26048 -#define LSI_CONFIG_COMPAT
26049 -#endif
26050 -
26051 -#ifdef LSI_CONFIG_COMPAT
26052 +#if defined(__x86_64__)
26053 static int megadev_compat_ioctl(unsigned int, unsigned int, unsigned long,
26054 struct file *);
26055 #endif
26056
26057 +static int megadev_ioctl_entry (struct inode *, struct file *, unsigned int,
26058 + unsigned long);
26059 static int megadev_ioctl (struct inode *, struct file *, unsigned int,
26060 unsigned long);
26061 static int mega_m_to_n(void *, nitioctl_t *);
26062 @@ -1164,6 +1176,8 @@
26063
26064 static int mega_adapinq(adapter_t *, dma_addr_t);
26065 static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
26066 +static inline caddr_t mega_allocate_inquiry(dma_addr_t *, struct pci_dev *);
26067 +static inline void mega_free_inquiry(caddr_t, dma_addr_t, struct pci_dev *);
26068 static int mega_print_inquiry(char *, char *);
26069 #endif
26070
26071 @@ -1174,6 +1188,7 @@
26072 scb_t *, Scsi_Cmnd *, int, int);
26073 static void mega_enum_raid_scsi(adapter_t *);
26074 static void mega_get_boot_drv(adapter_t *);
26075 +static inline int mega_get_ldrv_num(adapter_t *, Scsi_Cmnd *, int);
26076 static int mega_support_random_del(adapter_t *);
26077 static int mega_del_logdrv(adapter_t *, int);
26078 static int mega_do_del_logdrv(adapter_t *, int);
26079 diff -Nur linux-2.4.29/drivers/scsi/NCR53C9x.h linux-mips/drivers/scsi/NCR53C9x.h
26080 --- linux-2.4.29/drivers/scsi/NCR53C9x.h 2004-02-18 14:36:31.000000000 +0100
26081 +++ linux-mips/drivers/scsi/NCR53C9x.h 2003-12-15 19:19:51.000000000 +0100
26082 @@ -144,12 +144,7 @@
26083
26084 #ifndef MULTIPLE_PAD_SIZES
26085
26086 -#ifdef CONFIG_CPU_HAS_WB
26087 -#include <asm/wbflush.h>
26088 -#define esp_write(__reg, __val) do{(__reg) = (__val); wbflush();} while(0)
26089 -#else
26090 -#define esp_write(__reg, __val) ((__reg) = (__val))
26091 -#endif
26092 +#define esp_write(__reg, __val) do{(__reg) = (__val); iob();} while(0)
26093 #define esp_read(__reg) (__reg)
26094
26095 struct ESP_regs {
26096 diff -Nur linux-2.4.29/drivers/scsi/osst.c linux-mips/drivers/scsi/osst.c
26097 --- linux-2.4.29/drivers/scsi/osst.c 2004-08-08 01:26:05.000000000 +0200
26098 +++ linux-mips/drivers/scsi/osst.c 2005-03-26 11:47:33.149211193 +0100
26099 @@ -5505,7 +5505,6 @@
26100 read: osst_read,
26101 write: osst_write,
26102 ioctl: osst_ioctl,
26103 - llseek: no_llseek,
26104 open: os_scsi_tape_open,
26105 flush: os_scsi_tape_flush,
26106 release: os_scsi_tape_close,
26107 diff -Nur linux-2.4.29/drivers/scsi/sata_nv.c linux-mips/drivers/scsi/sata_nv.c
26108 --- linux-2.4.29/drivers/scsi/sata_nv.c 2005-01-19 15:10:03.000000000 +0100
26109 +++ linux-mips/drivers/scsi/sata_nv.c 2005-03-26 11:47:33.156210045 +0100
26110 @@ -20,6 +20,10 @@
26111 * If you do not delete the provisions above, a recipient may use your
26112 * version of this file under either the OSL or the GPL.
26113 *
26114 + * 0.06
26115 + * - Added generic SATA support by using a pci_device_id that filters on
26116 + * the IDE storage class code.
26117 + *
26118 * 0.03
26119 * - Fixed a bug where the hotplug handlers for non-CK804/MCP04 were using
26120 * mmio_base, which is only set for the CK804/MCP04 case.
26121 @@ -44,7 +48,7 @@
26122 #include <linux/libata.h>
26123
26124 #define DRV_NAME "sata_nv"
26125 -#define DRV_VERSION "0.5"
26126 +#define DRV_VERSION "0.6"
26127
26128 #define NV_PORTS 2
26129 #define NV_PIO_MASK 0x1f
26130 @@ -95,7 +99,8 @@
26131 #define NV_MCP_SATA_CFG_20_SATA_SPACE_EN 0x04
26132
26133 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
26134 -irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
26135 +static irqreturn_t nv_interrupt (int irq, void *dev_instance,
26136 + struct pt_regs *regs);
26137 static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg);
26138 static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
26139 static void nv_host_stop (struct ata_host_set *host_set);
26140 @@ -108,6 +113,7 @@
26141
26142 enum nv_host_type
26143 {
26144 + GENERIC,
26145 NFORCE2,
26146 NFORCE3,
26147 CK804
26148 @@ -128,6 +134,9 @@
26149 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
26150 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,
26151 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
26152 + { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
26153 + PCI_ANY_ID, PCI_ANY_ID,
26154 + PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
26155 { 0, } /* terminate list */
26156 };
26157
26158 @@ -136,7 +145,6 @@
26159 struct nv_host_desc
26160 {
26161 enum nv_host_type host_type;
26162 - unsigned long host_flags;
26163 void (*enable_hotplug)(struct ata_probe_ent *probe_ent);
26164 void (*disable_hotplug)(struct ata_host_set *host_set);
26165 void (*check_hotplug)(struct ata_host_set *host_set);
26166 @@ -144,21 +152,24 @@
26167 };
26168 static struct nv_host_desc nv_device_tbl[] = {
26169 {
26170 + .host_type = GENERIC,
26171 + .enable_hotplug = NULL,
26172 + .disable_hotplug= NULL,
26173 + .check_hotplug = NULL,
26174 + },
26175 + {
26176 .host_type = NFORCE2,
26177 - .host_flags = 0x00000000,
26178 .enable_hotplug = nv_enable_hotplug,
26179 .disable_hotplug= nv_disable_hotplug,
26180 .check_hotplug = nv_check_hotplug,
26181 },
26182 {
26183 .host_type = NFORCE3,
26184 - .host_flags = 0x00000000,
26185 .enable_hotplug = nv_enable_hotplug,
26186 .disable_hotplug= nv_disable_hotplug,
26187 .check_hotplug = nv_check_hotplug,
26188 },
26189 { .host_type = CK804,
26190 - .host_flags = NV_HOST_FLAGS_SCR_MMIO,
26191 .enable_hotplug = nv_enable_hotplug_ck804,
26192 .disable_hotplug= nv_disable_hotplug_ck804,
26193 .check_hotplug = nv_check_hotplug_ck804,
26194 @@ -168,6 +179,7 @@
26195 struct nv_host
26196 {
26197 struct nv_host_desc *host_desc;
26198 + unsigned long host_flags;
26199 };
26200
26201 static struct pci_driver nv_pci_driver = {
26202 @@ -207,6 +219,8 @@
26203 .phy_reset = sata_phy_reset,
26204 .bmdma_setup = ata_bmdma_setup,
26205 .bmdma_start = ata_bmdma_start,
26206 + .bmdma_stop = ata_bmdma_stop,
26207 + .bmdma_status = ata_bmdma_status,
26208 .qc_prep = ata_qc_prep,
26209 .qc_issue = ata_qc_issue_prot,
26210 .eng_timeout = ata_eng_timeout,
26211 @@ -245,7 +259,8 @@
26212 MODULE_DEVICE_TABLE(pci, nv_pci_tbl);
26213 MODULE_VERSION(DRV_VERSION);
26214
26215 -irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
26216 +static irqreturn_t nv_interrupt (int irq, void *dev_instance,
26217 + struct pt_regs *regs)
26218 {
26219 struct ata_host_set *host_set = dev_instance;
26220 struct nv_host *host = host_set->private_data;
26221 @@ -285,8 +300,8 @@
26222 if (sc_reg > SCR_CONTROL)
26223 return 0xffffffffU;
26224
26225 - if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
26226 - return readl(ap->ioaddr.scr_addr + (sc_reg * 4));
26227 + if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
26228 + return readl((void*)ap->ioaddr.scr_addr + (sc_reg * 4));
26229 else
26230 return inl(ap->ioaddr.scr_addr + (sc_reg * 4));
26231 }
26232 @@ -299,8 +314,8 @@
26233 if (sc_reg > SCR_CONTROL)
26234 return;
26235
26236 - if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
26237 - writel(val, ap->ioaddr.scr_addr + (sc_reg * 4));
26238 + if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
26239 + writel(val, (void*)ap->ioaddr.scr_addr + (sc_reg * 4));
26240 else
26241 outl(val, ap->ioaddr.scr_addr + (sc_reg * 4));
26242 }
26243 @@ -322,7 +337,16 @@
26244 struct nv_host *host;
26245 struct ata_port_info *ppi;
26246 struct ata_probe_ent *probe_ent;
26247 + int pci_dev_busy = 0;
26248 int rc;
26249 + u32 bar;
26250 +
26251 + // Make sure this is a SATA controller by counting the number of bars
26252 + // (NVIDIA SATA controllers will always have six bars). Otherwise,
26253 + // it's an IDE controller and we ignore it.
26254 + for (bar=0; bar<6; bar++)
26255 + if (pci_resource_start(pdev, bar) == 0)
26256 + return -ENODEV;
26257
26258 if (!printed_version++)
26259 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
26260 @@ -332,8 +356,10 @@
26261 goto err_out;
26262
26263 rc = pci_request_regions(pdev, DRV_NAME);
26264 - if (rc)
26265 + if (rc) {
26266 + pci_dev_busy = 1;
26267 goto err_out_disable;
26268 + }
26269
26270 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
26271 if (rc)
26272 @@ -350,11 +376,15 @@
26273 if (!host)
26274 goto err_out_free_ent;
26275
26276 + memset(host, 0, sizeof(struct nv_host));
26277 host->host_desc = &nv_device_tbl[ent->driver_data];
26278
26279 probe_ent->private_data = host;
26280
26281 - if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
26282 + if (pci_resource_flags(pdev, 5) & IORESOURCE_MEM)
26283 + host->host_flags |= NV_HOST_FLAGS_SCR_MMIO;
26284 +
26285 + if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
26286 unsigned long base;
26287
26288 probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
26289 @@ -395,7 +425,8 @@
26290 err_out_regions:
26291 pci_release_regions(pdev);
26292 err_out_disable:
26293 - pci_disable_device(pdev);
26294 + if (!pci_dev_busy)
26295 + pci_disable_device(pdev);
26296 err_out:
26297 return rc;
26298 }
26299 diff -Nur linux-2.4.29/drivers/scsi/sata_promise.c linux-mips/drivers/scsi/sata_promise.c
26300 --- linux-2.4.29/drivers/scsi/sata_promise.c 2005-01-19 15:10:03.000000000 +0100
26301 +++ linux-mips/drivers/scsi/sata_promise.c 2005-03-26 11:47:33.159209552 +0100
26302 @@ -42,8 +42,6 @@
26303 #define DRV_NAME "sata_promise"
26304 #define DRV_VERSION "1.01"
26305
26306 -#define msleep libata_msleep /* 2.4-specific */
26307 -
26308 enum {
26309 PDC_PKT_SUBMIT = 0x40, /* Command packet pointer addr */
26310 PDC_INT_SEQMASK = 0x40, /* Mask of asserted SEQ INTs */
26311 @@ -158,10 +156,18 @@
26312 board_2037x },
26313 { PCI_VENDOR_ID_PROMISE, 0x3376, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26314 board_2037x },
26315 + { PCI_VENDOR_ID_PROMISE, 0x3574, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26316 + board_2037x },
26317 + { PCI_VENDOR_ID_PROMISE, 0x3d75, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26318 + board_2037x },
26319 +
26320 { PCI_VENDOR_ID_PROMISE, 0x3318, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26321 board_20319 },
26322 { PCI_VENDOR_ID_PROMISE, 0x3319, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26323 board_20319 },
26324 + { PCI_VENDOR_ID_PROMISE, 0x3d18, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26325 + board_20319 },
26326 +
26327 { } /* terminate list */
26328 };
26329
26330 @@ -408,9 +414,11 @@
26331 return IRQ_NONE;
26332 }
26333
26334 - spin_lock(&host_set->lock);
26335 + spin_lock(&host_set->lock);
26336 +
26337 + writel(mask, mmio_base + PDC_INT_SEQMASK);
26338
26339 - for (i = 0; i < host_set->n_ports; i++) {
26340 + for (i = 0; i < host_set->n_ports; i++) {
26341 VPRINTK("port %u\n", i);
26342 ap = host_set->ports[i];
26343 tmp = mask & (1 << (i + 1));
26344 @@ -548,6 +556,7 @@
26345 unsigned long base;
26346 void *mmio_base;
26347 unsigned int board_idx = (unsigned int) ent->driver_data;
26348 + int pci_dev_busy = 0;
26349 int rc;
26350
26351 if (!printed_version++)
26352 @@ -562,8 +571,10 @@
26353 return rc;
26354
26355 rc = pci_request_regions(pdev, DRV_NAME);
26356 - if (rc)
26357 + if (rc) {
26358 + pci_dev_busy = 1;
26359 goto err_out;
26360 + }
26361
26362 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
26363 if (rc)
26364 @@ -637,7 +648,8 @@
26365 err_out_regions:
26366 pci_release_regions(pdev);
26367 err_out:
26368 - pci_disable_device(pdev);
26369 + if (!pci_dev_busy)
26370 + pci_disable_device(pdev);
26371 return rc;
26372 }
26373
26374 diff -Nur linux-2.4.29/drivers/scsi/sata_qstor.c linux-mips/drivers/scsi/sata_qstor.c
26375 --- linux-2.4.29/drivers/scsi/sata_qstor.c 1970-01-01 01:00:00.000000000 +0100
26376 +++ linux-mips/drivers/scsi/sata_qstor.c 2005-03-18 13:13:28.000000000 +0100
26377 @@ -0,0 +1,717 @@
26378 +/*
26379 + * sata_qstor.c - Pacific Digital Corporation QStor SATA
26380 + *
26381 + * Maintained by: Mark Lord <mlord@pobox.com>
26382 + *
26383 + * Copyright 2005 Pacific Digital Corporation.
26384 + * (OSL/GPL code release authorized by Jalil Fadavi).
26385 + *
26386 + * The contents of this file are subject to the Open
26387 + * Software License version 1.1 that can be found at
26388 + * http://www.opensource.org/licenses/osl-1.1.txt and is included herein
26389 + * by reference.
26390 + *
26391 + * Alternatively, the contents of this file may be used under the terms
26392 + * of the GNU General Public License version 2 (the "GPL") as distributed
26393 + * in the kernel source COPYING file, in which case the provisions of
26394 + * the GPL are applicable instead of the above. If you wish to allow
26395 + * the use of your version of this file only under the terms of the
26396 + * GPL and not to allow others to use your version of this file under
26397 + * the OSL, indicate your decision by deleting the provisions above and
26398 + * replace them with the notice and other provisions required by the GPL.
26399 + * If you do not delete the provisions above, a recipient may use your
26400 + * version of this file under either the OSL or the GPL.
26401 + *
26402 + */
26403 +
26404 +#include <linux/kernel.h>
26405 +#include <linux/module.h>
26406 +#include <linux/pci.h>
26407 +#include <linux/init.h>
26408 +#include <linux/blkdev.h>
26409 +#include <linux/delay.h>
26410 +#include <linux/interrupt.h>
26411 +#include <linux/sched.h>
26412 +#include "scsi.h"
26413 +#include <scsi/scsi_host.h>
26414 +#include <asm/io.h>
26415 +#include <linux/libata.h>
26416 +
26417 +#define DRV_NAME "sata_qstor"
26418 +#define DRV_VERSION "0.04"
26419 +
26420 +enum {
26421 + QS_PORTS = 4,
26422 + QS_MAX_PRD = LIBATA_MAX_PRD,
26423 + QS_CPB_ORDER = 6,
26424 + QS_CPB_BYTES = (1 << QS_CPB_ORDER),
26425 + QS_PRD_BYTES = QS_MAX_PRD * 16,
26426 + QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES,
26427 +
26428 + QS_DMA_BOUNDARY = ~0UL,
26429 +
26430 + /* global register offsets */
26431 + QS_HCF_CNFG3 = 0x0003, /* host configuration offset */
26432 + QS_HID_HPHY = 0x0004, /* host physical interface info */
26433 + QS_HCT_CTRL = 0x00e4, /* global interrupt mask offset */
26434 + QS_HST_SFF = 0x0100, /* host status fifo offset */
26435 + QS_HVS_SERD3 = 0x0393, /* PHY enable offset */
26436 +
26437 + /* global control bits */
26438 + QS_HPHY_64BIT = (1 << 1), /* 64-bit bus detected */
26439 + QS_CNFG3_GSRST = 0x01, /* global chip reset */
26440 + QS_SERD3_PHY_ENA = 0xf0, /* PHY detection ENAble*/
26441 +
26442 + /* per-channel register offsets */
26443 + QS_CCF_CPBA = 0x0710, /* chan CPB base address */
26444 + QS_CCF_CSEP = 0x0718, /* chan CPB separation factor */
26445 + QS_CFC_HUFT = 0x0800, /* host upstream fifo threshold */
26446 + QS_CFC_HDFT = 0x0804, /* host downstream fifo threshold */
26447 + QS_CFC_DUFT = 0x0808, /* dev upstream fifo threshold */
26448 + QS_CFC_DDFT = 0x080c, /* dev downstream fifo threshold */
26449 + QS_CCT_CTR0 = 0x0900, /* chan control-0 offset */
26450 + QS_CCT_CTR1 = 0x0901, /* chan control-1 offset */
26451 + QS_CCT_CFF = 0x0a00, /* chan command fifo offset */
26452 +
26453 + /* channel control bits */
26454 + QS_CTR0_REG = (1 << 1), /* register mode (vs. pkt mode) */
26455 + QS_CTR0_CLER = (1 << 2), /* clear channel errors */
26456 + QS_CTR1_RDEV = (1 << 1), /* sata phy/comms reset */
26457 + QS_CTR1_RCHN = (1 << 4), /* reset channel logic */
26458 + QS_CCF_RUN_PKT = 0x107, /* RUN a new dma PKT */
26459 +
26460 + /* pkt sub-field headers */
26461 + QS_HCB_HDR = 0x01, /* Host Control Block header */
26462 + QS_DCB_HDR = 0x02, /* Device Control Block header */
26463 +
26464 + /* pkt HCB flag bits */
26465 + QS_HF_DIRO = (1 << 0), /* data DIRection Out */
26466 + QS_HF_DAT = (1 << 3), /* DATa pkt */
26467 + QS_HF_IEN = (1 << 4), /* Interrupt ENable */
26468 + QS_HF_VLD = (1 << 5), /* VaLiD pkt */
26469 +
26470 + /* pkt DCB flag bits */
26471 + QS_DF_PORD = (1 << 2), /* Pio OR Dma */
26472 + QS_DF_ELBA = (1 << 3), /* Extended LBA (lba48) */
26473 +
26474 + /* PCI device IDs */
26475 + board_2068_idx = 0, /* QStor 4-port SATA/RAID */
26476 +};
26477 +
26478 +typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
26479 +
26480 +struct qs_port_priv {
26481 + u8 *pkt;
26482 + dma_addr_t pkt_dma;
26483 + qs_state_t state;
26484 +};
26485 +
26486 +static u32 qs_scr_read (struct ata_port *ap, unsigned int sc_reg);
26487 +static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
26488 +static int qs_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
26489 +static irqreturn_t qs_intr (int irq, void *dev_instance, struct pt_regs *regs);
26490 +static int qs_port_start(struct ata_port *ap);
26491 +static void qs_host_stop(struct ata_host_set *host_set);
26492 +static void qs_port_stop(struct ata_port *ap);
26493 +static void qs_phy_reset(struct ata_port *ap);
26494 +static void qs_qc_prep(struct ata_queued_cmd *qc);
26495 +static int qs_qc_issue(struct ata_queued_cmd *qc);
26496 +static int qs_check_atapi_dma(struct ata_queued_cmd *qc);
26497 +static void qs_bmdma_stop(struct ata_port *ap);
26498 +static u8 qs_bmdma_status(struct ata_port *ap);
26499 +static void qs_irq_clear(struct ata_port *ap);
26500 +static void qs_eng_timeout(struct ata_port *ap);
26501 +
26502 +static Scsi_Host_Template qs_ata_sht = {
26503 + .module = THIS_MODULE,
26504 + .name = DRV_NAME,
26505 + .detect = ata_scsi_detect,
26506 + .release = ata_scsi_release,
26507 + .ioctl = ata_scsi_ioctl,
26508 + .queuecommand = ata_scsi_queuecmd,
26509 + .eh_strategy_handler = ata_scsi_error,
26510 + .can_queue = ATA_DEF_QUEUE,
26511 + .this_id = ATA_SHT_THIS_ID,
26512 + .sg_tablesize = QS_MAX_PRD,
26513 + .max_sectors = ATA_MAX_SECTORS,
26514 + .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
26515 + .use_new_eh_code = ATA_SHT_NEW_EH_CODE,
26516 + .emulated = ATA_SHT_EMULATED,
26517 + //FIXME .use_clustering = ATA_SHT_USE_CLUSTERING,
26518 + .use_clustering = ENABLE_CLUSTERING,
26519 + .proc_name = DRV_NAME,
26520 + .bios_param = ata_std_bios_param,
26521 +};
26522 +
26523 +static struct ata_port_operations qs_ata_ops = {
26524 + .port_disable = ata_port_disable,
26525 + .tf_load = ata_tf_load,
26526 + .tf_read = ata_tf_read,
26527 + .check_status = ata_check_status,
26528 + .check_atapi_dma = qs_check_atapi_dma,
26529 + .exec_command = ata_exec_command,
26530 + .dev_select = ata_std_dev_select,
26531 + .phy_reset = qs_phy_reset,
26532 + .qc_prep = qs_qc_prep,
26533 + .qc_issue = qs_qc_issue,
26534 + .eng_timeout = qs_eng_timeout,
26535 + .irq_handler = qs_intr,
26536 + .irq_clear = qs_irq_clear,
26537 + .scr_read = qs_scr_read,
26538 + .scr_write = qs_scr_write,
26539 + .port_start = qs_port_start,
26540 + .port_stop = qs_port_stop,
26541 + .host_stop = qs_host_stop,
26542 + .bmdma_stop = qs_bmdma_stop,
26543 + .bmdma_status = qs_bmdma_status,
26544 +};
26545 +
26546 +static struct ata_port_info qs_port_info[] = {
26547 + /* board_2068_idx */
26548 + {
26549 + .sht = &qs_ata_sht,
26550 + .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
26551 + ATA_FLAG_SATA_RESET |
26552 + //FIXME ATA_FLAG_SRST |
26553 + ATA_FLAG_MMIO,
26554 + .pio_mask = 0x10, /* pio4 */
26555 + .udma_mask = 0x7f, /* udma0-6 */
26556 + .port_ops = &qs_ata_ops,
26557 + },
26558 +};
26559 +
26560 +static struct pci_device_id qs_ata_pci_tbl[] = {
26561 + { PCI_VENDOR_ID_PDC, 0x2068, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26562 + board_2068_idx },
26563 +
26564 + { } /* terminate list */
26565 +};
26566 +
26567 +static struct pci_driver qs_ata_pci_driver = {
26568 + .name = DRV_NAME,
26569 + .id_table = qs_ata_pci_tbl,
26570 + .probe = qs_ata_init_one,
26571 + .remove = ata_pci_remove_one,
26572 +};
26573 +
26574 +static int qs_check_atapi_dma(struct ata_queued_cmd *qc)
26575 +{
26576 + return 1; /* ATAPI DMA not supported */
26577 +}
26578 +
26579 +static void qs_bmdma_stop(struct ata_port *ap)
26580 +{
26581 + /* nothing */
26582 +}
26583 +
26584 +static u8 qs_bmdma_status(struct ata_port *ap)
26585 +{
26586 + return 0;
26587 +}
26588 +
26589 +static void qs_irq_clear(struct ata_port *ap)
26590 +{
26591 + /* nothing */
26592 +}
26593 +
26594 +static inline void qs_enter_reg_mode(struct ata_port *ap)
26595 +{
26596 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26597 +
26598 + writeb(QS_CTR0_REG, chan + QS_CCT_CTR0);
26599 + readb(chan + QS_CCT_CTR0); /* flush */
26600 +}
26601 +
26602 +static inline void qs_reset_channel_logic(struct ata_port *ap)
26603 +{
26604 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26605 +
26606 + writeb(QS_CTR1_RCHN, chan + QS_CCT_CTR1);
26607 + readb(chan + QS_CCT_CTR0); /* flush */
26608 + qs_enter_reg_mode(ap);
26609 +}
26610 +
26611 +static void qs_phy_reset(struct ata_port *ap)
26612 +{
26613 + struct qs_port_priv *pp = ap->private_data;
26614 +
26615 + pp->state = qs_state_idle;
26616 + qs_reset_channel_logic(ap);
26617 + sata_phy_reset(ap);
26618 +}
26619 +
26620 +static void qs_eng_timeout(struct ata_port *ap)
26621 +{
26622 + struct qs_port_priv *pp = ap->private_data;
26623 +
26624 + if (pp->state != qs_state_idle) /* healthy paranoia */
26625 + pp->state = qs_state_mmio;
26626 + qs_reset_channel_logic(ap);
26627 + ata_eng_timeout(ap);
26628 +}
26629 +
26630 +static u32 qs_scr_read (struct ata_port *ap, unsigned int sc_reg)
26631 +{
26632 + if (sc_reg > SCR_CONTROL)
26633 + return ~0U;
26634 + return readl((void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
26635 +}
26636 +
26637 +static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
26638 +{
26639 + if (sc_reg > SCR_CONTROL)
26640 + return;
26641 + writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
26642 +}
26643 +
26644 +static void qs_fill_sg(struct ata_queued_cmd *qc)
26645 +{
26646 + struct scatterlist *sg = qc->sg;
26647 + struct ata_port *ap = qc->ap;
26648 + struct qs_port_priv *pp = ap->private_data;
26649 + unsigned int nelem;
26650 + u8 *prd = pp->pkt + QS_CPB_BYTES;
26651 +
26652 + assert(sg != NULL);
26653 + assert(qc->n_elem > 0);
26654 +
26655 + for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) {
26656 + u64 addr;
26657 + u32 len;
26658 +
26659 + addr = sg_dma_address(sg);
26660 + *(__le64 *)prd = cpu_to_le64(addr);
26661 + prd += sizeof(u64);
26662 +
26663 + len = sg_dma_len(sg);
26664 + *(__le32 *)prd = cpu_to_le32(len);
26665 + prd += sizeof(u64);
26666 +
26667 + VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem,
26668 + (unsigned long long)addr, len);
26669 + }
26670 +}
26671 +
26672 +static void qs_qc_prep(struct ata_queued_cmd *qc)
26673 +{
26674 + struct qs_port_priv *pp = qc->ap->private_data;
26675 + u8 dflags = QS_DF_PORD, *buf = pp->pkt;
26676 + u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD;
26677 + u64 addr;
26678 +
26679 + VPRINTK("ENTER\n");
26680 +
26681 + qs_enter_reg_mode(qc->ap);
26682 + if (qc->tf.protocol != ATA_PROT_DMA) {
26683 + ata_qc_prep(qc);
26684 + return;
26685 + }
26686 +
26687 + qs_fill_sg(qc);
26688 +
26689 + if ((qc->tf.flags & ATA_TFLAG_WRITE))
26690 + hflags |= QS_HF_DIRO;
26691 + if ((qc->tf.flags & ATA_TFLAG_LBA48))
26692 + dflags |= QS_DF_ELBA;
26693 +
26694 + /* host control block (HCB) */
26695 + buf[ 0] = QS_HCB_HDR;
26696 + buf[ 1] = hflags;
26697 + *(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE);
26698 + *(__le32 *)(&buf[ 8]) = cpu_to_le32(qc->n_elem);
26699 + addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES;
26700 + *(__le64 *)(&buf[16]) = cpu_to_le64(addr);
26701 +
26702 + /* device control block (DCB) */
26703 + buf[24] = QS_DCB_HDR;
26704 + buf[28] = dflags;
26705 +
26706 + /* frame information structure (FIS) */
26707 + ata_tf_to_fis(&qc->tf, &buf[32], 0);
26708 +}
26709 +
26710 +static inline void qs_packet_start(struct ata_queued_cmd *qc)
26711 +{
26712 + struct ata_port *ap = qc->ap;
26713 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26714 +
26715 + VPRINTK("ENTER, ap %p\n", ap);
26716 +
26717 + writeb(QS_CTR0_CLER, chan + QS_CCT_CTR0);
26718 + wmb(); /* flush PRDs and pkt to memory */
26719 + writel(QS_CCF_RUN_PKT, chan + QS_CCT_CFF);
26720 + readl(chan + QS_CCT_CFF); /* flush */
26721 +}
26722 +
26723 +static int qs_qc_issue(struct ata_queued_cmd *qc)
26724 +{
26725 + struct qs_port_priv *pp = qc->ap->private_data;
26726 +
26727 + switch (qc->tf.protocol) {
26728 + case ATA_PROT_DMA:
26729 +
26730 + pp->state = qs_state_pkt;
26731 + qs_packet_start(qc);
26732 + return 0;
26733 +
26734 + case ATA_PROT_ATAPI_DMA:
26735 + BUG();
26736 + break;
26737 +
26738 + default:
26739 + break;
26740 + }
26741 +
26742 + pp->state = qs_state_mmio;
26743 + return ata_qc_issue_prot(qc);
26744 +}
26745 +
26746 +static inline unsigned int qs_intr_pkt(struct ata_host_set *host_set)
26747 +{
26748 + unsigned int handled = 0;
26749 + u8 sFFE;
26750 + u8 __iomem *mmio_base = host_set->mmio_base;
26751 +
26752 + do {
26753 + u32 sff0 = readl(mmio_base + QS_HST_SFF);
26754 + u32 sff1 = readl(mmio_base + QS_HST_SFF + 4);
26755 + u8 sEVLD = (sff1 >> 30) & 0x01; /* valid flag */
26756 + sFFE = sff1 >> 31; /* empty flag */
26757 +
26758 + if (sEVLD) {
26759 + u8 sDST = sff0 >> 16; /* dev status */
26760 + u8 sHST = sff1 & 0x3f; /* host status */
26761 + unsigned int port_no = (sff1 >> 8) & 0x03;
26762 + struct ata_port *ap = host_set->ports[port_no];
26763 +
26764 + DPRINTK("SFF=%08x%08x: sCHAN=%u sHST=%d sDST=%02x\n",
26765 + sff1, sff0, port_no, sHST, sDST);
26766 + handled = 1;
26767 + if (ap && (!(ap->flags & ATA_FLAG_PORT_DISABLED))) {
26768 + struct ata_queued_cmd *qc;
26769 + struct qs_port_priv *pp = ap->private_data;
26770 + if (!pp || pp->state != qs_state_pkt)
26771 + continue;
26772 + qc = ata_qc_from_tag(ap, ap->active_tag);
26773 + if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
26774 + switch (sHST) {
26775 + case 0: /* sucessful CPB */
26776 + case 3: /* device error */
26777 + pp->state = qs_state_idle;
26778 + qs_enter_reg_mode(qc->ap);
26779 + ata_qc_complete(qc, sDST);
26780 + break;
26781 + default:
26782 + break;
26783 + }
26784 + }
26785 + }
26786 + }
26787 + } while (!sFFE);
26788 + return handled;
26789 +}
26790 +
26791 +static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
26792 +{
26793 + unsigned int handled = 0, port_no;
26794 +
26795 + for (port_no = 0; port_no < host_set->n_ports; ++port_no) {
26796 + struct ata_port *ap;
26797 + ap = host_set->ports[port_no];
26798 + if (ap && (!(ap->flags & ATA_FLAG_PORT_DISABLED))) {
26799 + struct ata_queued_cmd *qc;
26800 + struct qs_port_priv *pp = ap->private_data;
26801 + if (!pp || pp->state != qs_state_mmio)
26802 + continue;
26803 + qc = ata_qc_from_tag(ap, ap->active_tag);
26804 + if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
26805 +
26806 + /* check main status, clearing INTRQ */
26807 + u8 status = ata_chk_status(ap);
26808 + if ((status & ATA_BUSY))
26809 + continue;
26810 + DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n",
26811 + ap->id, qc->tf.protocol, status);
26812 +
26813 + /* complete taskfile transaction */
26814 + pp->state = qs_state_idle;
26815 + ata_qc_complete(qc, status);
26816 + handled = 1;
26817 + }
26818 + }
26819 + }
26820 + return handled;
26821 +}
26822 +
26823 +static irqreturn_t qs_intr(int irq, void *dev_instance, struct pt_regs *regs)
26824 +{
26825 + struct ata_host_set *host_set = dev_instance;
26826 + unsigned int handled = 0;
26827 +
26828 + VPRINTK("ENTER\n");
26829 +
26830 + spin_lock(&host_set->lock);
26831 + handled = qs_intr_pkt(host_set) | qs_intr_mmio(host_set);
26832 + spin_unlock(&host_set->lock);
26833 +
26834 + VPRINTK("EXIT\n");
26835 +
26836 + return IRQ_RETVAL(handled);
26837 +}
26838 +
26839 +static void qs_ata_setup_port(struct ata_ioports *port, unsigned long base)
26840 +{
26841 + port->cmd_addr =
26842 + port->data_addr = base + 0x400;
26843 + port->error_addr =
26844 + port->feature_addr = base + 0x408; /* hob_feature = 0x409 */
26845 + port->nsect_addr = base + 0x410; /* hob_nsect = 0x411 */
26846 + port->lbal_addr = base + 0x418; /* hob_lbal = 0x419 */
26847 + port->lbam_addr = base + 0x420; /* hob_lbam = 0x421 */
26848 + port->lbah_addr = base + 0x428; /* hob_lbah = 0x429 */
26849 + port->device_addr = base + 0x430;
26850 + port->status_addr =
26851 + port->command_addr = base + 0x438;
26852 + port->altstatus_addr =
26853 + port->ctl_addr = base + 0x440;
26854 + port->scr_addr = base + 0xc00;
26855 +}
26856 +
26857 +static int qs_port_start(struct ata_port *ap)
26858 +{
26859 + struct device *dev = ap->host_set->dev;
26860 + struct qs_port_priv *pp;
26861 + void __iomem *mmio_base = ap->host_set->mmio_base;
26862 + void __iomem *chan = mmio_base + (ap->port_no * 0x4000);
26863 + u64 addr;
26864 + int rc;
26865 +
26866 + rc = ata_port_start(ap);
26867 + if (rc)
26868 + return rc;
26869 + qs_enter_reg_mode(ap);
26870 + pp = kcalloc(1, sizeof(*pp), GFP_KERNEL);
26871 + if (!pp) {
26872 + rc = -ENOMEM;
26873 + goto err_out;
26874 + }
26875 + pp->pkt = dma_alloc_coherent(dev, QS_PKT_BYTES, &pp->pkt_dma,
26876 + GFP_KERNEL);
26877 + if (!pp->pkt) {
26878 + rc = -ENOMEM;
26879 + goto err_out_kfree;
26880 + }
26881 + memset(pp->pkt, 0, QS_PKT_BYTES);
26882 + ap->private_data = pp;
26883 +
26884 + addr = (u64)pp->pkt_dma;
26885 + writel((u32) addr, chan + QS_CCF_CPBA);
26886 + writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4);
26887 + return 0;
26888 +
26889 +err_out_kfree:
26890 + kfree(pp);
26891 +err_out:
26892 + ata_port_stop(ap);
26893 + return rc;
26894 +}
26895 +
26896 +static void qs_port_stop(struct ata_port *ap)
26897 +{
26898 + struct device *dev = ap->host_set->dev;
26899 + struct qs_port_priv *pp = ap->private_data;
26900 +
26901 + if (pp != NULL) {
26902 + ap->private_data = NULL;
26903 + if (pp->pkt != NULL)
26904 + dma_free_coherent(dev, QS_PKT_BYTES, pp->pkt,
26905 + pp->pkt_dma);
26906 + kfree(pp);
26907 + }
26908 + ata_port_stop(ap);
26909 +}
26910 +
26911 +static void qs_host_stop(struct ata_host_set *host_set)
26912 +{
26913 + void __iomem *mmio_base = host_set->mmio_base;
26914 +
26915 + writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
26916 + writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
26917 +}
26918 +
26919 +static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
26920 +{
26921 + void __iomem *mmio_base = pe->mmio_base;
26922 + unsigned int port_no;
26923 +
26924 + writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
26925 + writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
26926 +
26927 + /* reset each channel in turn */
26928 + for (port_no = 0; port_no < pe->n_ports; ++port_no) {
26929 + u8 __iomem *chan = mmio_base + (port_no * 0x4000);
26930 + writeb(QS_CTR1_RDEV|QS_CTR1_RCHN, chan + QS_CCT_CTR1);
26931 + writeb(QS_CTR0_REG, chan + QS_CCT_CTR0);
26932 + readb(chan + QS_CCT_CTR0); /* flush */
26933 + }
26934 + writeb(QS_SERD3_PHY_ENA, mmio_base + QS_HVS_SERD3); /* enable phy */
26935 +
26936 + for (port_no = 0; port_no < pe->n_ports; ++port_no) {
26937 + u8 __iomem *chan = mmio_base + (port_no * 0x4000);
26938 + /* set FIFO depths to same settings as Windows driver */
26939 + writew(32, chan + QS_CFC_HUFT);
26940 + writew(32, chan + QS_CFC_HDFT);
26941 + writew(10, chan + QS_CFC_DUFT);
26942 + writew( 8, chan + QS_CFC_DDFT);
26943 + /* set CPB size in bytes, as a power of two */
26944 + writeb(QS_CPB_ORDER, chan + QS_CCF_CSEP);
26945 + }
26946 + writeb(1, mmio_base + QS_HCT_CTRL); /* enable host interrupts */
26947 +}
26948 +
26949 +/*
26950 + * The QStor understands 64-bit buses, and uses 64-bit fields
26951 + * for DMA pointers regardless of bus width. We just have to
26952 + * make sure our DMA masks are set appropriately for whatever
26953 + * bridge lies between us and the QStor, and then the DMA mapping
26954 + * code will ensure we only ever "see" appropriate buffer addresses.
26955 + * If we're 32-bit limited somewhere, then our 64-bit fields will
26956 + * just end up with zeros in the upper 32-bits, without any special
26957 + * logic required outside of this routine (below).
26958 + */
26959 +static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
26960 +{
26961 + u32 bus_info = readl(mmio_base + QS_HID_HPHY);
26962 + int rc, have_64bit_bus = (bus_info & QS_HPHY_64BIT);
26963 +
26964 + if (have_64bit_bus &&
26965 + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
26966 + /* do nothing */
26967 + } else {
26968 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
26969 + if (rc) {
26970 + printk(KERN_ERR DRV_NAME
26971 + "(%s): 32-bit DMA enable failed\n",
26972 + pci_name(pdev));
26973 + return rc;
26974 + }
26975 + }
26976 + return 0;
26977 +}
26978 +
26979 +static int qs_ata_init_one(struct pci_dev *pdev,
26980 + const struct pci_device_id *ent)
26981 +{
26982 + static int printed_version;
26983 + struct ata_probe_ent *probe_ent = NULL;
26984 + void __iomem *mmio_base;
26985 + unsigned int board_idx = (unsigned int) ent->driver_data;
26986 + int rc, port_no;
26987 +
26988 + if (!printed_version++)
26989 + printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
26990 +
26991 + rc = pci_enable_device(pdev);
26992 + if (rc)
26993 + return rc;
26994 +
26995 + rc = pci_request_regions(pdev, DRV_NAME);
26996 + if (rc)
26997 + goto err_out;
26998 +
26999 + if ((pci_resource_flags(pdev, 4) & IORESOURCE_MEM) == 0) {
27000 + rc = -ENODEV;
27001 + goto err_out_regions;
27002 + }
27003 +
27004 + mmio_base = ioremap(pci_resource_start(pdev, 4),
27005 + pci_resource_len(pdev, 4));
27006 + if (mmio_base == NULL) {
27007 + rc = -ENOMEM;
27008 + goto err_out_regions;
27009 + }
27010 +
27011 + rc = qs_set_dma_masks(pdev, mmio_base);
27012 + if (rc)
27013 + goto err_out_iounmap;
27014 +
27015 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
27016 + if (probe_ent == NULL) {
27017 + rc = -ENOMEM;
27018 + goto err_out_iounmap;
27019 + }
27020 +
27021 + memset(probe_ent, 0, sizeof(*probe_ent));
27022 + probe_ent->dev = pci_dev_to_dev(pdev);
27023 + INIT_LIST_HEAD(&probe_ent->node);
27024 +
27025 + probe_ent->sht = qs_port_info[board_idx].sht;
27026 + probe_ent->host_flags = qs_port_info[board_idx].host_flags;
27027 + probe_ent->pio_mask = qs_port_info[board_idx].pio_mask;
27028 + probe_ent->mwdma_mask = qs_port_info[board_idx].mwdma_mask;
27029 + probe_ent->udma_mask = qs_port_info[board_idx].udma_mask;
27030 + probe_ent->port_ops = qs_port_info[board_idx].port_ops;
27031 +
27032 + probe_ent->irq = pdev->irq;
27033 + probe_ent->irq_flags = SA_SHIRQ;
27034 + probe_ent->mmio_base = mmio_base;
27035 + probe_ent->n_ports = QS_PORTS;
27036 +
27037 + for (port_no = 0; port_no < probe_ent->n_ports; ++port_no) {
27038 + unsigned long chan = (unsigned long)mmio_base +
27039 + (port_no * 0x4000);
27040 + qs_ata_setup_port(&probe_ent->port[port_no], chan);
27041 + }
27042 +
27043 + pci_set_master(pdev);
27044 +
27045 + /* initialize adapter */
27046 + qs_host_init(board_idx, probe_ent);
27047 +
27048 + ata_add_to_probe_list(probe_ent);
27049 + return 0;
27050 +
27051 +err_out_iounmap:
27052 + iounmap(mmio_base);
27053 +err_out_regions:
27054 + pci_release_regions(pdev);
27055 +err_out:
27056 + pci_disable_device(pdev);
27057 + return rc;
27058 +}
27059 +
27060 +static int __init qs_ata_init(void)
27061 +{
27062 + int rc;
27063 +
27064 + rc = pci_module_init(&qs_ata_pci_driver);
27065 + if (rc)
27066 + return rc;
27067 +
27068 + rc = scsi_register_module(MODULE_SCSI_HA, &qs_ata_sht);
27069 + if (rc) {
27070 + rc = -ENODEV;
27071 + goto err_out;
27072 + }
27073 +
27074 + return 0;
27075 +
27076 +err_out:
27077 + pci_unregister_driver(&qs_ata_pci_driver);
27078 + return rc;
27079 +}
27080 +
27081 +static void __exit qs_ata_exit(void)
27082 +{
27083 + scsi_unregister_module(MODULE_SCSI_HA, &qs_ata_sht);
27084 + pci_unregister_driver(&qs_ata_pci_driver);
27085 +}
27086 +
27087 +MODULE_AUTHOR("Mark Lord");
27088 +MODULE_DESCRIPTION("Pacific Digital Corporation QStor SATA low-level driver");
27089 +MODULE_LICENSE("GPL");
27090 +MODULE_DEVICE_TABLE(pci, qs_ata_pci_tbl);
27091 +MODULE_VERSION(DRV_VERSION);
27092 +
27093 +module_init(qs_ata_init);
27094 +module_exit(qs_ata_exit);
27095 diff -Nur linux-2.4.29/drivers/scsi/sata_sil.c linux-mips/drivers/scsi/sata_sil.c
27096 --- linux-2.4.29/drivers/scsi/sata_sil.c 2005-01-19 15:10:03.000000000 +0100
27097 +++ linux-mips/drivers/scsi/sata_sil.c 2005-03-26 11:47:33.241196096 +0100
27098 @@ -71,12 +71,14 @@
27099 { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
27100 { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
27101 { 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 },
27102 + { 0x1002, 0x436e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
27103 + { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
27104 { } /* terminate list */
27105 };
27106
27107
27108 /* TODO firmware versions should be added - eric */
27109 -struct sil_drivelist {
27110 +static const struct sil_drivelist {
27111 const char * product;
27112 unsigned int quirk;
27113 } sil_blacklist [] = {
27114 @@ -84,10 +86,12 @@
27115 { "ST330013AS", SIL_QUIRK_MOD15WRITE },
27116 { "ST340017AS", SIL_QUIRK_MOD15WRITE },
27117 { "ST360015AS", SIL_QUIRK_MOD15WRITE },
27118 + { "ST380013AS", SIL_QUIRK_MOD15WRITE },
27119 { "ST380023AS", SIL_QUIRK_MOD15WRITE },
27120 { "ST3120023AS", SIL_QUIRK_MOD15WRITE },
27121 { "ST3160023AS", SIL_QUIRK_MOD15WRITE },
27122 { "ST3120026AS", SIL_QUIRK_MOD15WRITE },
27123 + { "ST3200822AS", SIL_QUIRK_MOD15WRITE },
27124 { "ST340014ASL", SIL_QUIRK_MOD15WRITE },
27125 { "ST360014ASL", SIL_QUIRK_MOD15WRITE },
27126 { "ST380011ASL", SIL_QUIRK_MOD15WRITE },
27127 @@ -136,6 +140,8 @@
27128 .post_set_mode = sil_post_set_mode,
27129 .bmdma_setup = ata_bmdma_setup,
27130 .bmdma_start = ata_bmdma_start,
27131 + .bmdma_stop = ata_bmdma_stop,
27132 + .bmdma_status = ata_bmdma_status,
27133 .qc_prep = ata_qc_prep,
27134 .qc_issue = ata_qc_issue_prot,
27135 .eng_timeout = ata_eng_timeout,
27136 @@ -333,6 +339,7 @@
27137 void *mmio_base;
27138 int rc;
27139 unsigned int i;
27140 + int pci_dev_busy = 0;
27141 u32 tmp, irq_mask;
27142
27143 if (!printed_version++)
27144 @@ -347,8 +354,10 @@
27145 return rc;
27146
27147 rc = pci_request_regions(pdev, DRV_NAME);
27148 - if (rc)
27149 + if (rc) {
27150 + pci_dev_busy = 1;
27151 goto err_out;
27152 + }
27153
27154 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27155 if (rc)
27156 @@ -430,7 +439,8 @@
27157 err_out_regions:
27158 pci_release_regions(pdev);
27159 err_out:
27160 - pci_disable_device(pdev);
27161 + if (!pci_dev_busy)
27162 + pci_disable_device(pdev);
27163 return rc;
27164 }
27165
27166 diff -Nur linux-2.4.29/drivers/scsi/sata_sis.c linux-mips/drivers/scsi/sata_sis.c
27167 --- linux-2.4.29/drivers/scsi/sata_sis.c 2005-01-19 15:10:03.000000000 +0100
27168 +++ linux-mips/drivers/scsi/sata_sis.c 2005-03-26 11:47:33.244195604 +0100
27169 @@ -103,6 +103,8 @@
27170 .phy_reset = sata_phy_reset,
27171 .bmdma_setup = ata_bmdma_setup,
27172 .bmdma_start = ata_bmdma_start,
27173 + .bmdma_stop = ata_bmdma_stop,
27174 + .bmdma_status = ata_bmdma_status,
27175 .qc_prep = ata_qc_prep,
27176 .qc_issue = ata_qc_issue_prot,
27177 .eng_timeout = ata_eng_timeout,
27178 @@ -201,14 +203,17 @@
27179 int rc;
27180 u32 genctl;
27181 struct ata_port_info *ppi;
27182 + int pci_dev_busy = 0;
27183
27184 rc = pci_enable_device(pdev);
27185 if (rc)
27186 return rc;
27187
27188 rc = pci_request_regions(pdev, DRV_NAME);
27189 - if (rc)
27190 + if (rc) {
27191 + pci_dev_busy = 1;
27192 goto err_out;
27193 + }
27194
27195 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27196 if (rc)
27197 @@ -255,7 +260,8 @@
27198 pci_release_regions(pdev);
27199
27200 err_out:
27201 - pci_disable_device(pdev);
27202 + if (!pci_dev_busy)
27203 + pci_disable_device(pdev);
27204 return rc;
27205
27206 }
27207 diff -Nur linux-2.4.29/drivers/scsi/sata_svw.c linux-mips/drivers/scsi/sata_svw.c
27208 --- linux-2.4.29/drivers/scsi/sata_svw.c 2005-01-19 15:10:03.000000000 +0100
27209 +++ linux-mips/drivers/scsi/sata_svw.c 2005-03-26 11:47:33.246195276 +0100
27210 @@ -156,7 +156,7 @@
27211 * spin_lock_irqsave(host_set lock)
27212 */
27213
27214 -void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
27215 +static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
27216 {
27217 struct ata_port *ap = qc->ap;
27218 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
27219 @@ -186,7 +186,7 @@
27220 * spin_lock_irqsave(host_set lock)
27221 */
27222
27223 -void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
27224 +static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
27225 {
27226 struct ata_port *ap = qc->ap;
27227 void *mmio = (void *) ap->ioaddr.bmdma_addr;
27228 @@ -302,6 +302,8 @@
27229 .phy_reset = sata_phy_reset,
27230 .bmdma_setup = k2_bmdma_setup_mmio,
27231 .bmdma_start = k2_bmdma_start_mmio,
27232 + .bmdma_stop = ata_bmdma_stop,
27233 + .bmdma_status = ata_bmdma_status,
27234 .qc_prep = ata_qc_prep,
27235 .qc_issue = ata_qc_issue_prot,
27236 .eng_timeout = ata_eng_timeout,
27237 @@ -339,6 +341,7 @@
27238 struct ata_probe_ent *probe_ent = NULL;
27239 unsigned long base;
27240 void *mmio_base;
27241 + int pci_dev_busy = 0;
27242 int rc;
27243
27244 if (!printed_version++)
27245 @@ -360,8 +363,10 @@
27246
27247 /* Request PCI regions */
27248 rc = pci_request_regions(pdev, DRV_NAME);
27249 - if (rc)
27250 + if (rc) {
27251 + pci_dev_busy = 1;
27252 goto err_out;
27253 + }
27254
27255 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27256 if (rc)
27257 @@ -429,7 +434,8 @@
27258 err_out_regions:
27259 pci_release_regions(pdev);
27260 err_out:
27261 - pci_disable_device(pdev);
27262 + if (!pci_dev_busy)
27263 + pci_disable_device(pdev);
27264 return rc;
27265 }
27266
27267 diff -Nur linux-2.4.29/drivers/scsi/sata_sx4.c linux-mips/drivers/scsi/sata_sx4.c
27268 --- linux-2.4.29/drivers/scsi/sata_sx4.c 2005-01-19 15:10:03.000000000 +0100
27269 +++ linux-mips/drivers/scsi/sata_sx4.c 2005-03-26 11:47:33.249194784 +0100
27270 @@ -1191,8 +1191,7 @@
27271 error = 0;
27272 break;
27273 }
27274 - set_current_state(TASK_UNINTERRUPTIBLE);
27275 - schedule_timeout((i * 100) * HZ / 1000 + 1);
27276 + msleep(i*100);
27277 }
27278 return error;
27279 }
27280 @@ -1225,8 +1224,7 @@
27281 readl(mmio + PDC_TIME_CONTROL);
27282
27283 /* Wait 3 seconds */
27284 - set_current_state(TASK_UNINTERRUPTIBLE);
27285 - schedule_timeout(3 * HZ);
27286 + msleep(3000);
27287
27288 /*
27289 When timer is enabled, counter is decreased every internal
27290 @@ -1369,6 +1367,7 @@
27291 void *mmio_base, *dimm_mmio = NULL;
27292 struct pdc_host_priv *hpriv = NULL;
27293 unsigned int board_idx = (unsigned int) ent->driver_data;
27294 + int pci_dev_busy = 0;
27295 int rc;
27296
27297 if (!printed_version++)
27298 @@ -1383,8 +1382,10 @@
27299 return rc;
27300
27301 rc = pci_request_regions(pdev, DRV_NAME);
27302 - if (rc)
27303 + if (rc) {
27304 + pci_dev_busy = 1;
27305 goto err_out;
27306 + }
27307
27308 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27309 if (rc)
27310 @@ -1469,7 +1470,8 @@
27311 err_out_regions:
27312 pci_release_regions(pdev);
27313 err_out:
27314 - pci_disable_device(pdev);
27315 + if (!pci_dev_busy)
27316 + pci_disable_device(pdev);
27317 return rc;
27318 }
27319
27320 diff -Nur linux-2.4.29/drivers/scsi/sata_uli.c linux-mips/drivers/scsi/sata_uli.c
27321 --- linux-2.4.29/drivers/scsi/sata_uli.c 2005-01-19 15:10:03.000000000 +0100
27322 +++ linux-mips/drivers/scsi/sata_uli.c 2005-03-26 11:47:33.252194291 +0100
27323 @@ -98,6 +98,8 @@
27324
27325 .bmdma_setup = ata_bmdma_setup,
27326 .bmdma_start = ata_bmdma_start,
27327 + .bmdma_stop = ata_bmdma_stop,
27328 + .bmdma_status = ata_bmdma_status,
27329 .qc_prep = ata_qc_prep,
27330 .qc_issue = ata_qc_issue_prot,
27331
27332 @@ -186,14 +188,17 @@
27333 struct ata_port_info *ppi;
27334 int rc;
27335 unsigned int board_idx = (unsigned int) ent->driver_data;
27336 + int pci_dev_busy = 0;
27337
27338 rc = pci_enable_device(pdev);
27339 if (rc)
27340 return rc;
27341
27342 rc = pci_request_regions(pdev, DRV_NAME);
27343 - if (rc)
27344 + if (rc) {
27345 + pci_dev_busy = 1;
27346 goto err_out;
27347 + }
27348
27349 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27350 if (rc)
27351 @@ -256,7 +261,8 @@
27352 pci_release_regions(pdev);
27353
27354 err_out:
27355 - pci_disable_device(pdev);
27356 + if (!pci_dev_busy)
27357 + pci_disable_device(pdev);
27358 return rc;
27359
27360 }
27361 diff -Nur linux-2.4.29/drivers/scsi/sata_via.c linux-mips/drivers/scsi/sata_via.c
27362 --- linux-2.4.29/drivers/scsi/sata_via.c 2005-01-19 15:10:03.000000000 +0100
27363 +++ linux-mips/drivers/scsi/sata_via.c 2005-03-26 11:47:33.268191666 +0100
27364 @@ -24,6 +24,11 @@
27365 If you do not delete the provisions above, a recipient may use your
27366 version of this file under either the OSL or the GPL.
27367
27368 + ----------------------------------------------------------------------
27369 +
27370 + To-do list:
27371 + * VT6421 PATA support
27372 +
27373 */
27374
27375 #include <linux/kernel.h>
27376 @@ -38,11 +43,14 @@
27377 #include <asm/io.h>
27378
27379 #define DRV_NAME "sata_via"
27380 -#define DRV_VERSION "1.0"
27381 +#define DRV_VERSION "1.1"
27382
27383 -enum {
27384 - via_sata = 0,
27385 +enum board_ids_enum {
27386 + vt6420,
27387 + vt6421,
27388 +};
27389
27390 +enum {
27391 SATA_CHAN_ENAB = 0x40, /* SATA channel enable */
27392 SATA_INT_GATE = 0x41, /* SATA interrupt gating */
27393 SATA_NATIVE_MODE = 0x42, /* Native mode enable */
27394 @@ -50,10 +58,8 @@
27395
27396 PORT0 = (1 << 1),
27397 PORT1 = (1 << 0),
27398 -
27399 - ENAB_ALL = PORT0 | PORT1,
27400 -
27401 - INT_GATE_ALL = PORT0 | PORT1,
27402 + ALL_PORTS = PORT0 | PORT1,
27403 + N_PORTS = 2,
27404
27405 NATIVE_MODE_ALL = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4),
27406
27407 @@ -66,7 +72,8 @@
27408 static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
27409
27410 static struct pci_device_id svia_pci_tbl[] = {
27411 - { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, via_sata },
27412 + { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 },
27413 + { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 },
27414
27415 { } /* terminate list */
27416 };
27417 @@ -111,6 +118,9 @@
27418
27419 .bmdma_setup = ata_bmdma_setup,
27420 .bmdma_start = ata_bmdma_start,
27421 + .bmdma_stop = ata_bmdma_stop,
27422 + .bmdma_status = ata_bmdma_status,
27423 +
27424 .qc_prep = ata_qc_prep,
27425 .qc_issue = ata_qc_issue_prot,
27426
27427 @@ -159,18 +169,132 @@
27428 8, 4, 8, 4, 16, 256
27429 };
27430
27431 +static const unsigned int vt6421_bar_sizes[] = {
27432 + 16, 16, 16, 16, 32, 128
27433 +};
27434 +
27435 static unsigned long svia_scr_addr(unsigned long addr, unsigned int port)
27436 {
27437 return addr + (port * 128);
27438 }
27439
27440 +static unsigned long vt6421_scr_addr(unsigned long addr, unsigned int port)
27441 +{
27442 + return addr + (port * 64);
27443 +}
27444 +
27445 +static void vt6421_init_addrs(struct ata_probe_ent *probe_ent,
27446 + struct pci_dev *pdev,
27447 + unsigned int port)
27448 +{
27449 + unsigned long reg_addr = pci_resource_start(pdev, port);
27450 + unsigned long bmdma_addr = pci_resource_start(pdev, 4) + (port * 8);
27451 + unsigned long scr_addr;
27452 +
27453 + probe_ent->port[port].cmd_addr = reg_addr;
27454 + probe_ent->port[port].altstatus_addr =
27455 + probe_ent->port[port].ctl_addr = (reg_addr + 8) | ATA_PCI_CTL_OFS;
27456 + probe_ent->port[port].bmdma_addr = bmdma_addr;
27457 +
27458 + scr_addr = vt6421_scr_addr(pci_resource_start(pdev, 5), port);
27459 + probe_ent->port[port].scr_addr = scr_addr;
27460 +
27461 + ata_std_ports(&probe_ent->port[port]);
27462 +}
27463 +
27464 +static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
27465 +{
27466 + struct ata_probe_ent *probe_ent;
27467 + struct ata_port_info *ppi = &svia_port_info;
27468 +
27469 + probe_ent = ata_pci_init_native_mode(pdev, &ppi);
27470 + if (!probe_ent)
27471 + return NULL;
27472 +
27473 + probe_ent->port[0].scr_addr =
27474 + svia_scr_addr(pci_resource_start(pdev, 5), 0);
27475 + probe_ent->port[1].scr_addr =
27476 + svia_scr_addr(pci_resource_start(pdev, 5), 1);
27477 +
27478 + return probe_ent;
27479 +}
27480 +
27481 +static struct ata_probe_ent *vt6421_init_probe_ent(struct pci_dev *pdev)
27482 +{
27483 + struct ata_probe_ent *probe_ent;
27484 + unsigned int i;
27485 +
27486 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
27487 + if (!probe_ent)
27488 + return NULL;
27489 +
27490 + memset(probe_ent, 0, sizeof(*probe_ent));
27491 + probe_ent->dev = pci_dev_to_dev(pdev);
27492 + INIT_LIST_HEAD(&probe_ent->node);
27493 +
27494 + probe_ent->sht = &svia_sht;
27495 + probe_ent->host_flags = ATA_FLAG_SATA | ATA_FLAG_SATA_RESET |
27496 + ATA_FLAG_NO_LEGACY;
27497 + probe_ent->port_ops = &svia_sata_ops;
27498 + probe_ent->n_ports = N_PORTS;
27499 + probe_ent->irq = pdev->irq;
27500 + probe_ent->irq_flags = SA_SHIRQ;
27501 + probe_ent->pio_mask = 0x1f;
27502 + probe_ent->mwdma_mask = 0x07;
27503 + probe_ent->udma_mask = 0x7f;
27504 +
27505 + for (i = 0; i < N_PORTS; i++)
27506 + vt6421_init_addrs(probe_ent, pdev, i);
27507 +
27508 + return probe_ent;
27509 +}
27510 +
27511 +static void svia_configure(struct pci_dev *pdev)
27512 +{
27513 + u8 tmp8;
27514 +
27515 + pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
27516 + printk(KERN_INFO DRV_NAME "(%s): routed to hard irq line %d\n",
27517 + pci_name(pdev),
27518 + (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
27519 +
27520 + /* make sure SATA channels are enabled */
27521 + pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8);
27522 + if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
27523 + printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channels (0x%x)\n",
27524 + pci_name(pdev), (int) tmp8);
27525 + tmp8 |= ALL_PORTS;
27526 + pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8);
27527 + }
27528 +
27529 + /* make sure interrupts for each channel sent to us */
27530 + pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8);
27531 + if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
27532 + printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel interrupts (0x%x)\n",
27533 + pci_name(pdev), (int) tmp8);
27534 + tmp8 |= ALL_PORTS;
27535 + pci_write_config_byte(pdev, SATA_INT_GATE, tmp8);
27536 + }
27537 +
27538 + /* make sure native mode is enabled */
27539 + pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8);
27540 + if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) {
27541 + printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel native mode (0x%x)\n",
27542 + pci_name(pdev), (int) tmp8);
27543 + tmp8 |= NATIVE_MODE_ALL;
27544 + pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
27545 + }
27546 +}
27547 +
27548 static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
27549 {
27550 static int printed_version;
27551 unsigned int i;
27552 int rc;
27553 - struct ata_port_info *ppi;
27554 struct ata_probe_ent *probe_ent;
27555 + int board_id = (int) ent->driver_data;
27556 + const int *bar_sizes;
27557 + int pci_dev_busy = 0;
27558 u8 tmp8;
27559
27560 if (!printed_version++)
27561 @@ -181,20 +305,28 @@
27562 return rc;
27563
27564 rc = pci_request_regions(pdev, DRV_NAME);
27565 - if (rc)
27566 + if (rc) {
27567 + pci_dev_busy = 1;
27568 goto err_out;
27569 + }
27570
27571 - pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8);
27572 - if (tmp8 & SATA_2DEV) {
27573 - printk(KERN_ERR DRV_NAME "(%s): SATA master/slave not supported (0x%x)\n",
27574 - pci_name(pdev), (int) tmp8);
27575 - rc = -EIO;
27576 - goto err_out_regions;
27577 + if (board_id == vt6420) {
27578 + pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8);
27579 + if (tmp8 & SATA_2DEV) {
27580 + printk(KERN_ERR DRV_NAME "(%s): SATA master/slave not supported (0x%x)\n",
27581 + pci_name(pdev), (int) tmp8);
27582 + rc = -EIO;
27583 + goto err_out_regions;
27584 + }
27585 +
27586 + bar_sizes = &svia_bar_sizes[0];
27587 + } else {
27588 + bar_sizes = &vt6421_bar_sizes[0];
27589 }
27590
27591 for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++)
27592 if ((pci_resource_start(pdev, i) == 0) ||
27593 - (pci_resource_len(pdev, i) < svia_bar_sizes[i])) {
27594 + (pci_resource_len(pdev, i) < bar_sizes[i])) {
27595 printk(KERN_ERR DRV_NAME "(%s): invalid PCI BAR %u (sz 0x%lx, val 0x%lx)\n",
27596 pci_name(pdev), i,
27597 pci_resource_start(pdev, i),
27598 @@ -207,8 +339,11 @@
27599 if (rc)
27600 goto err_out_regions;
27601
27602 - ppi = &svia_port_info;
27603 - probe_ent = ata_pci_init_native_mode(pdev, &ppi);
27604 + if (board_id == vt6420)
27605 + probe_ent = vt6420_init_probe_ent(pdev);
27606 + else
27607 + probe_ent = vt6421_init_probe_ent(pdev);
27608 +
27609 if (!probe_ent) {
27610 printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
27611 pci_name(pdev));
27612 @@ -216,42 +351,7 @@
27613 goto err_out_regions;
27614 }
27615
27616 - probe_ent->port[0].scr_addr =
27617 - svia_scr_addr(pci_resource_start(pdev, 5), 0);
27618 - probe_ent->port[1].scr_addr =
27619 - svia_scr_addr(pci_resource_start(pdev, 5), 1);
27620 -
27621 - pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
27622 - printk(KERN_INFO DRV_NAME "(%s): routed to hard irq line %d\n",
27623 - pci_name(pdev),
27624 - (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
27625 -
27626 - /* make sure SATA channels are enabled */
27627 - pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8);
27628 - if ((tmp8 & ENAB_ALL) != ENAB_ALL) {
27629 - printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channels (0x%x)\n",
27630 - pci_name(pdev), (int) tmp8);
27631 - tmp8 |= ENAB_ALL;
27632 - pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8);
27633 - }
27634 -
27635 - /* make sure interrupts for each channel sent to us */
27636 - pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8);
27637 - if ((tmp8 & INT_GATE_ALL) != INT_GATE_ALL) {
27638 - printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel interrupts (0x%x)\n",
27639 - pci_name(pdev), (int) tmp8);
27640 - tmp8 |= INT_GATE_ALL;
27641 - pci_write_config_byte(pdev, SATA_INT_GATE, tmp8);
27642 - }
27643 -
27644 - /* make sure native mode is enabled */
27645 - pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8);
27646 - if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) {
27647 - printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel native mode (0x%x)\n",
27648 - pci_name(pdev), (int) tmp8);
27649 - tmp8 |= NATIVE_MODE_ALL;
27650 - pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
27651 - }
27652 + svia_configure(pdev);
27653
27654 pci_set_master(pdev);
27655
27656 @@ -262,7 +362,8 @@
27657 err_out_regions:
27658 pci_release_regions(pdev);
27659 err_out:
27660 - pci_disable_device(pdev);
27661 + if (!pci_dev_busy)
27662 + pci_disable_device(pdev);
27663 return rc;
27664 }
27665
27666 diff -Nur linux-2.4.29/drivers/scsi/sata_vsc.c linux-mips/drivers/scsi/sata_vsc.c
27667 --- linux-2.4.29/drivers/scsi/sata_vsc.c 2005-01-19 15:10:03.000000000 +0100
27668 +++ linux-mips/drivers/scsi/sata_vsc.c 2005-03-26 11:47:33.270191338 +0100
27669 @@ -155,7 +155,8 @@
27670 *
27671 * Read the interrupt register and process for the devices that have them pending.
27672 */
27673 -irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
27674 +static irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance,
27675 + struct pt_regs *regs)
27676 {
27677 struct ata_host_set *host_set = dev_instance;
27678 unsigned int i;
27679 @@ -218,6 +219,8 @@
27680 .phy_reset = sata_phy_reset,
27681 .bmdma_setup = ata_bmdma_setup,
27682 .bmdma_start = ata_bmdma_start,
27683 + .bmdma_stop = ata_bmdma_stop,
27684 + .bmdma_status = ata_bmdma_status,
27685 .qc_prep = ata_qc_prep,
27686 .qc_issue = ata_qc_issue_prot,
27687 .eng_timeout = ata_eng_timeout,
27688 @@ -256,6 +259,7 @@
27689 static int printed_version;
27690 struct ata_probe_ent *probe_ent = NULL;
27691 unsigned long base;
27692 + int pci_dev_busy = 0;
27693 void *mmio_base;
27694 int rc;
27695
27696 @@ -275,13 +279,15 @@
27697 }
27698
27699 rc = pci_request_regions(pdev, DRV_NAME);
27700 - if (rc)
27701 + if (rc) {
27702 + pci_dev_busy = 1;
27703 goto err_out;
27704 + }
27705
27706 /*
27707 * Use 32 bit DMA mask, because 64 bit address support is poor.
27708 */
27709 - rc = pci_set_dma_mask(pdev, 0xFFFFFFFFULL);
27710 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
27711 if (rc)
27712 goto err_out_regions;
27713
27714 @@ -348,7 +354,8 @@
27715 err_out_regions:
27716 pci_release_regions(pdev);
27717 err_out:
27718 - pci_disable_device(pdev);
27719 + if (!pci_dev_busy)
27720 + pci_disable_device(pdev);
27721 return rc;
27722 }
27723
27724 diff -Nur linux-2.4.29/drivers/scsi/sd.c linux-mips/drivers/scsi/sd.c
27725 --- linux-2.4.29/drivers/scsi/sd.c 2003-08-25 13:44:42.000000000 +0200
27726 +++ linux-mips/drivers/scsi/sd.c 2005-03-26 11:47:33.274190681 +0100
27727 @@ -1220,7 +1220,7 @@
27728 goto cleanup_gendisks_part;
27729 memset(sd_gendisks[i].part, 0, (SCSI_DISKS_PER_MAJOR << 4) * sizeof(struct hd_struct));
27730 sd_gendisks[i].sizes = sd_sizes + (i * SCSI_DISKS_PER_MAJOR << 4);
27731 - sd_gendisks[i].nr_real = 0;
27732 + sd_gendisks[i].nr_real = SCSI_DISKS_PER_MAJOR;
27733 sd_gendisks[i].real_devices =
27734 (void *) (rscsi_disks + i * SCSI_DISKS_PER_MAJOR);
27735 }
27736 @@ -1333,7 +1333,6 @@
27737 rscsi_disks[i].device = SDp;
27738 rscsi_disks[i].has_part_table = 0;
27739 sd_template.nr_dev++;
27740 - SD_GENDISK(i).nr_real++;
27741 devnum = i % SCSI_DISKS_PER_MAJOR;
27742 SD_GENDISK(i).de_arr[devnum] = SDp->de;
27743 if (SDp->removable)
27744 @@ -1447,7 +1446,6 @@
27745 SDp->attached--;
27746 sd_template.dev_noticed--;
27747 sd_template.nr_dev--;
27748 - SD_GENDISK(i).nr_real--;
27749 return;
27750 }
27751 return;
27752 diff -Nur linux-2.4.29/drivers/scsi/st.c linux-mips/drivers/scsi/st.c
27753 --- linux-2.4.29/drivers/scsi/st.c 2005-01-19 15:10:04.000000000 +0100
27754 +++ linux-mips/drivers/scsi/st.c 2005-03-26 11:47:33.279189861 +0100
27755 @@ -1641,7 +1641,7 @@
27756 if (STps->drv_block >= 0)
27757 STps->drv_block += 1;
27758 (STp->buffer)->buffer_bytes = 0;
27759 - return (-EIO);
27760 + return (-ENOMEM);
27761 }
27762 (STp->buffer)->buffer_bytes = bytes - transfer;
27763 } else {
27764 @@ -3778,7 +3778,6 @@
27765 read: st_read,
27766 write: st_write,
27767 ioctl: st_ioctl,
27768 - llseek: no_llseek,
27769 open: st_open,
27770 flush: st_flush,
27771 release: st_release,
27772 diff -Nur linux-2.4.29/drivers/scsi/sym53c8xx.c linux-mips/drivers/scsi/sym53c8xx.c
27773 --- linux-2.4.29/drivers/scsi/sym53c8xx.c 2004-04-14 15:05:32.000000000 +0200
27774 +++ linux-mips/drivers/scsi/sym53c8xx.c 2005-03-26 11:47:34.823936333 +0100
27775 @@ -13182,7 +13182,7 @@
27776 ** descriptors.
27777 */
27778 if (chip && (chip->features & FE_DAC)) {
27779 - if (pci_set_dma_mask(pdev, (u64) 0xffffffffff))
27780 + if (pci_set_dma_mask(pdev, (u64) 0xffffffffffULL))
27781 chip->features &= ~FE_DAC_IN_USE;
27782 else
27783 chip->features |= FE_DAC_IN_USE;
27784 diff -Nur linux-2.4.29/drivers/sound/au1550_i2s.c linux-mips/drivers/sound/au1550_i2s.c
27785 --- linux-2.4.29/drivers/sound/au1550_i2s.c 2005-01-19 15:10:04.000000000 +0100
27786 +++ linux-mips/drivers/sound/au1550_i2s.c 2005-03-26 11:47:35.065896621 +0100
27787 @@ -41,6 +41,7 @@
27788 * 675 Mass Ave, Cambridge, MA 02139, USA.
27789 *
27790 */
27791 +
27792 #include <linux/version.h>
27793 #include <linux/module.h>
27794 #include <linux/string.h>
27795 @@ -62,7 +63,45 @@
27796 #include <asm/uaccess.h>
27797 #include <asm/hardirq.h>
27798 #include <asm/au1000.h>
27799 +
27800 +#if defined(CONFIG_SOC_AU1550)
27801 #include <asm/pb1550.h>
27802 +#endif
27803 +
27804 +#if defined(CONFIG_MIPS_PB1200)
27805 +#define WM8731
27806 +#define WM_MODE_USB
27807 +#include <asm/pb1200.h>
27808 +#endif
27809 +
27810 +#if defined(CONFIG_MIPS_FICMMP)
27811 +#define WM8721
27812 +#define WM_MODE_NORMAL
27813 +#include <asm/ficmmp.h>
27814 +#endif
27815 +
27816 +
27817 +#define WM_VOLUME_MIN 47
27818 +#define WM_VOLUME_SCALE 80
27819 +
27820 +#if defined(WM8731)
27821 + /* OSS interface to the wm i2s.. */
27822 + #define CODEC_NAME "Wolfson WM8731 I2S"
27823 + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM | SOUND_MASK_LINE)
27824 + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK | SOUND_MASK_MIC)
27825 + #define WM_I2S_RECORD_MASK (SOUND_MASK_MIC | SOUND_MASK_LINE1 | SOUND_MASK_LINE)
27826 +#elif defined(WM8721)
27827 + #define CODEC_NAME "Wolfson WM8721 I2S"
27828 + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM)
27829 + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK)
27830 + #define WM_I2S_RECORD_MASK (0)
27831 +#endif
27832 +
27833 +
27834 +#define supported_mixer(FOO) ((FOO >= 0) && \
27835 + (FOO < SOUND_MIXER_NRDEVICES) && \
27836 + WM_I2S_SUPPORTED_MASK & (1<<FOO) )
27837 +
27838 #include <asm/au1xxx_psc.h>
27839 #include <asm/au1xxx_dbdma.h>
27840
27841 @@ -98,13 +137,51 @@
27842 * 0 = no VRA, 1 = use VRA if codec supports it
27843 * The framework is here, but we currently force no VRA.
27844 */
27845 +#if defined(CONFIG_MIPS_PB1200) | defined(CONFIG_MIPS_PB1550)
27846 static int vra = 0;
27847 +#elif defined(CONFIG_MIPS_FICMMP)
27848 +static int vra = 1;
27849 +#endif
27850 +
27851 +#define WM_REG_L_HEADPHONE_OUT 0x02
27852 +#define WM_REG_R_HEADPHONE_OUT 0x03
27853 +#define WM_REG_ANALOGUE_AUDIO_PATH_CTRL 0x04
27854 +#define WM_REG_DIGITAL_AUDIO_PATH_CTRL 0x05
27855 +#define WM_REG_POWER_DOWN_CTRL 0x06
27856 +#define WM_REG_DIGITAL_AUDIO_IF 0x07
27857 +#define WM_REG_SAMPLING_CONTROL 0x08
27858 +#define WM_REG_ACTIVE_CTRL 0x09
27859 +#define WM_REG_RESET 0x0F
27860 +#define WM_SC_SR_96000 (0x7<<2)
27861 +#define WM_SC_SR_88200 (0xF<<2)
27862 +#define WM_SC_SR_48000 (0x0<<2)
27863 +#define WM_SC_SR_44100 (0x8<<2)
27864 +#define WM_SC_SR_32000 (0x6<<2)
27865 +#define WM_SC_SR_8018 (0x9<<2)
27866 +#define WM_SC_SR_8000 (0x1<<2)
27867 +#define WM_SC_MODE_USB 1
27868 +#define WM_SC_MODE_NORMAL 0
27869 +#define WM_SC_BOSR_250FS (0<<1)
27870 +#define WM_SC_BOSR_272FS (1<<1)
27871 +#define WM_SC_BOSR_256FS (0<<1)
27872 +#define WM_SC_BOSR_128FS (0<<1)
27873 +#define WM_SC_BOSR_384FS (1<<1)
27874 +#define WM_SC_BOSR_192FS (1<<1)
27875 +
27876 +#define WS_64FS 31
27877 +#define WS_96FS 47
27878 +#define WS_128FS 63
27879 +#define WS_192FS 95
27880 +
27881 +#define MIN_Q_COUNT 2
27882 +
27883 MODULE_PARM(vra, "i");
27884 MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it");
27885
27886 static struct au1550_state {
27887 /* soundcore stuff */
27888 int dev_audio;
27889 + int dev_mixer;
27890
27891 spinlock_t lock;
27892 struct semaphore open_sem;
27893 @@ -114,6 +191,11 @@
27894 int no_vra;
27895 volatile psc_i2s_t *psc_addr;
27896
27897 + int level_line;
27898 + int level_mic;
27899 + int level_left;
27900 + int level_right;
27901 +
27902 struct dmabuf {
27903 u32 dmanr;
27904 unsigned sample_rate;
27905 @@ -195,60 +277,224 @@
27906 }
27907 }
27908
27909 -/* Just a place holder. The Wolfson codec is a write only device,
27910 - * so we would have to keep a local copy of the data.
27911 - */
27912 -#if 0
27913 -static u8
27914 -rdcodec(u8 addr)
27915 -{
27916 - return 0 /* data */;
27917 -}
27918 -#endif
27919 -
27920 -
27921 static void
27922 -wrcodec(u8 ctlreg, u8 val)
27923 +wrcodec(u8 ctlreg, u16 val)
27924 {
27925 int rcnt;
27926 extern int pb1550_wm_codec_write(u8 addr, u8 reg, u8 val);
27927 -
27928 /* The codec is a write only device, with a 16-bit control/data
27929 * word. Although it is written as two bytes on the I2C, the
27930 * format is actually 7 bits of register and 9 bits of data.
27931 * The ls bit of the first byte is the ms bit of the data.
27932 */
27933 rcnt = 0;
27934 - while ((pb1550_wm_codec_write((0x36 >> 1), ctlreg, val) != 1)
27935 - && (rcnt < 50)) {
27936 + while ((pb1550_wm_codec_write((0x36 >> 1),
27937 + (ctlreg << 1) | ((val >> 8) & 0x01),
27938 + (u8) (val & 0x00FF)) != 1) &&
27939 + (rcnt < 50)) {
27940 rcnt++;
27941 -#if 0
27942 - printk("Codec write retry %02x %02x\n", ctlreg, val);
27943 -#endif
27944 }
27945 +
27946 + au1550_delay(10);
27947 +}
27948 +
27949 +static int
27950 +au1550_open_mixdev(struct inode *inode, struct file *file)
27951 +{
27952 + file->private_data = &au1550_state;
27953 + return 0;
27954 +}
27955 +
27956 +static int
27957 +au1550_release_mixdev(struct inode *inode, struct file *file)
27958 +{
27959 + return 0;
27960 +}
27961 +
27962 +static int wm_i2s_read_mixer(struct au1550_state *s, int oss_channel)
27963 +{
27964 + int ret = 0;
27965 +
27966 + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
27967 + /* nice stereo mixers .. */
27968 +
27969 + ret = s->level_left | (s->level_right << 8);
27970 + } else if (oss_channel == SOUND_MIXER_MIC) {
27971 + ret = 0;
27972 + /* TODO: Implement read mixer for input/output codecs */
27973 + }
27974 +
27975 + return ret;
27976 }
27977
27978 +static void wm_i2s_write_mixer(struct au1550_state *s, int oss_channel, unsigned int left, unsigned int right)
27979 +{
27980 + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
27981 + /* stereo mixers */
27982 + s->level_left = left;
27983 + s->level_right = right;
27984 +
27985 + right = (right * WM_VOLUME_SCALE) / 100;
27986 + left = (left * WM_VOLUME_SCALE) / 100;
27987 + if (right > WM_VOLUME_SCALE)
27988 + right = WM_VOLUME_SCALE;
27989 + if (left > WM_VOLUME_SCALE)
27990 + left = WM_VOLUME_SCALE;
27991 +
27992 + right += WM_VOLUME_MIN;
27993 + left += WM_VOLUME_MIN;
27994 +
27995 + wrcodec(WM_REG_L_HEADPHONE_OUT, left);
27996 + wrcodec(WM_REG_R_HEADPHONE_OUT, right);
27997 +
27998 + }else if (oss_channel == SOUND_MIXER_MIC) {
27999 + /* TODO: implement write mixer for input/output codecs */
28000 + }
28001 +}
28002 +
28003 +/* a thin wrapper for write_mixer */
28004 +static void wm_i2s_set_mixer(struct au1550_state *s, unsigned int oss_mixer, unsigned int val )
28005 +{
28006 + unsigned int left,right;
28007 +
28008 + /* cleanse input a little */
28009 + right = ((val >> 8) & 0xff) ;
28010 + left = (val & 0xff) ;
28011 +
28012 + if (right > 100) right = 100;
28013 + if (left > 100) left = 100;
28014 +
28015 + wm_i2s_write_mixer(s, oss_mixer, left, right);
28016 +}
28017 +
28018 +static int
28019 +au1550_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
28020 +{
28021 + struct au1550_state *s = (struct au1550_state *)file->private_data;
28022 +
28023 + int i, val = 0;
28024 +
28025 + if (cmd == SOUND_MIXER_INFO) {
28026 + mixer_info info;
28027 + strncpy(info.id, CODEC_NAME, sizeof(info.id));
28028 + strncpy(info.name, CODEC_NAME, sizeof(info.name));
28029 + info.modify_counter = 0;
28030 + if (copy_to_user((void *)arg, &info, sizeof(info)))
28031 + return -EFAULT;
28032 + return 0;
28033 + }
28034 + if (cmd == SOUND_OLD_MIXER_INFO) {
28035 + _old_mixer_info info;
28036 + strncpy(info.id, CODEC_NAME, sizeof(info.id));
28037 + strncpy(info.name, CODEC_NAME, sizeof(info.name));
28038 + if (copy_to_user((void *)arg, &info, sizeof(info)))
28039 + return -EFAULT;
28040 + return 0;
28041 + }
28042 +
28043 + if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
28044 + return -EINVAL;
28045 +
28046 + if (cmd == OSS_GETVERSION)
28047 + return put_user(SOUND_VERSION, (int *)arg);
28048 +
28049 + if (_SIOC_DIR(cmd) == _SIOC_READ) {
28050 + switch (_IOC_NR(cmd)) {
28051 + case SOUND_MIXER_RECSRC: /* give them the current record src */
28052 + val = 0;
28053 + /*
28054 + if (!codec->recmask_io) {
28055 + val = 0;
28056 + } else {
28057 + val = codec->recmask_io(codec, 1, 0);
28058 + }*/
28059 + break;
28060 +
28061 + case SOUND_MIXER_DEVMASK: /* give them the supported mixers */
28062 + val = WM_I2S_SUPPORTED_MASK;
28063 + break;
28064 +
28065 + case SOUND_MIXER_RECMASK:
28066 + /* Arg contains a bit for each supported recording
28067 + * source */
28068 + val = WM_I2S_RECORD_MASK;
28069 + break;
28070 +
28071 + case SOUND_MIXER_STEREODEVS:
28072 + /* Mixer channels supporting stereo */
28073 + val = WM_I2S_STEREO_MASK;
28074 + break;
28075 +
28076 + case SOUND_MIXER_CAPS:
28077 + val = SOUND_CAP_EXCL_INPUT;
28078 + break;
28079 +
28080 + default: /* read a specific mixer */
28081 + i = _IOC_NR(cmd);
28082 +
28083 + if (!supported_mixer(i))
28084 + return -EINVAL;
28085 +
28086 + val = wm_i2s_read_mixer(s, i);
28087 + break;
28088 + }
28089 + return put_user(val, (int *)arg);
28090 + }
28091 +
28092 + if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
28093 + if (get_user(val, (int *)arg))
28094 + return -EFAULT;
28095 +
28096 + switch (_IOC_NR(cmd)) {
28097 + case SOUND_MIXER_RECSRC:
28098 + /* Arg contains a bit for each recording source */
28099 + if (!WM_I2S_RECORD_MASK)
28100 + return -EINVAL;
28101 + if (!val)
28102 + return 0;
28103 + if (!(val &= WM_I2S_RECORD_MASK))
28104 + return -EINVAL;
28105 +
28106 + return 0;
28107 + default: /* write a specific mixer */
28108 + i = _IOC_NR(cmd);
28109 +
28110 + if (!supported_mixer(i))
28111 + return -EINVAL;
28112 +
28113 + wm_i2s_set_mixer(s, i, val);
28114 +
28115 + return 0;
28116 + }
28117 +}
28118 + return -EINVAL;
28119 +}
28120 +
28121 +static loff_t
28122 +au1550_llseek(struct file *file, loff_t offset, int origin)
28123 +{
28124 + return -ESPIPE;
28125 +}
28126 +
28127 +static /*const */ struct file_operations au1550_mixer_fops = {
28128 + owner:THIS_MODULE,
28129 + llseek:au1550_llseek,
28130 + ioctl:au1550_ioctl_mixdev,
28131 + open:au1550_open_mixdev,
28132 + release:au1550_release_mixdev,
28133 +};
28134 +
28135 void
28136 -codec_init(void)
28137 +codec_init(struct au1550_state *s)
28138 {
28139 - wrcodec(0x1e, 0x00); /* Reset */
28140 - au1550_delay(200);
28141 - wrcodec(0x0c, 0x00); /* Power up everything */
28142 - au1550_delay(10);
28143 - wrcodec(0x12, 0x00); /* Deactivate codec */
28144 - au1550_delay(10);
28145 - wrcodec(0x08, 0x10); /* Select DAC outputs to line out */
28146 - au1550_delay(10);
28147 - wrcodec(0x0a, 0x00); /* Disable output mute */
28148 - au1550_delay(10);
28149 - wrcodec(0x05, 0x70); /* lower output volume on headphone */
28150 - au1550_delay(10);
28151 - wrcodec(0x0e, 0x02); /* Set slave, 16-bit, I2S modes */
28152 - au1550_delay(10);
28153 - wrcodec(0x10, 0x01); /* 12MHz (USB), 250fs */
28154 - au1550_delay(10);
28155 - wrcodec(0x12, 0x01); /* Activate codec */
28156 - au1550_delay(10);
28157 + wrcodec(WM_REG_RESET, 0x00); /* Reset */
28158 + wrcodec(WM_REG_POWER_DOWN_CTRL, 0x00); /* Power up everything */
28159 + wrcodec(WM_REG_ACTIVE_CTRL, 0x00); /* Deactivate codec */
28160 + wrcodec(WM_REG_ANALOGUE_AUDIO_PATH_CTRL, 0x10); /* Select DAC outputs to line out */
28161 + wrcodec(WM_REG_DIGITAL_AUDIO_PATH_CTRL, 0x00); /* Disable output mute */
28162 + wm_i2s_write_mixer(s, SOUND_MIXER_PCM, 74, 74);
28163 + wrcodec(WM_REG_DIGITAL_AUDIO_IF, 0x02); /* Set slave, 16-bit, I2S modes */
28164 + wrcodec(WM_REG_ACTIVE_CTRL, 0x01); /* Activate codec */
28165 }
28166
28167 /* stop the ADC before calling */
28168 @@ -256,27 +502,16 @@
28169 set_adc_rate(struct au1550_state *s, unsigned rate)
28170 {
28171 struct dmabuf *adc = &s->dma_adc;
28172 - struct dmabuf *dac = &s->dma_dac;
28173
28174 - if (s->no_vra) {
28175 - /* calc SRC factor
28176 - */
28177 + #if defined(WM_MODE_USB)
28178 adc->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
28179 adc->sample_rate = SAMP_RATE / adc->src_factor;
28180 return;
28181 - }
28182 + #else
28183 + //TODO: Need code for normal mode
28184 + #endif
28185
28186 adc->src_factor = 1;
28187 -
28188 -
28189 -#if 0
28190 - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
28191 -
28192 - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
28193 -
28194 - adc->sample_rate = rate;
28195 - dac->sample_rate = rate;
28196 -#endif
28197 }
28198
28199 /* stop the DAC before calling */
28200 @@ -284,26 +519,89 @@
28201 set_dac_rate(struct au1550_state *s, unsigned rate)
28202 {
28203 struct dmabuf *dac = &s->dma_dac;
28204 - struct dmabuf *adc = &s->dma_adc;
28205
28206 - if (s->no_vra) {
28207 - /* calc SRC factor
28208 - */
28209 - dac->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
28210 - dac->sample_rate = SAMP_RATE / dac->src_factor;
28211 - return;
28212 + u16 sr, ws, div, bosr, mode;
28213 + volatile psc_i2s_t* ip = (volatile psc_i2s_t *)I2S_PSC_BASE;
28214 + u32 cfg;
28215 +
28216 + #if defined(CONFIG_MIPS_FICMMP)
28217 + rate = ficmmp_set_i2s_sample_rate(rate);
28218 + #endif
28219 +
28220 + switch(rate)
28221 + {
28222 + case 96000:
28223 + sr = WM_SC_SR_96000;
28224 + ws = WS_64FS;
28225 + div = PSC_I2SCFG_DIV2;
28226 + break;
28227 + case 88200:
28228 + sr = WM_SC_SR_88200;
28229 + ws = WS_64FS;
28230 + div = PSC_I2SCFG_DIV2;
28231 + break;
28232 + case 44100:
28233 + sr = WM_SC_SR_44100;
28234 + ws = WS_128FS;
28235 + div = PSC_I2SCFG_DIV2;
28236 + break;
28237 + case 48000:
28238 + sr = WM_SC_SR_48000;
28239 + ws = WS_128FS;
28240 + div = PSC_I2SCFG_DIV2;
28241 + break;
28242 + case 32000:
28243 + sr = WM_SC_SR_32000;
28244 + ws = WS_96FS;
28245 + div = PSC_I2SCFG_DIV4;
28246 + break;
28247 + case 8018:
28248 + sr = WM_SC_SR_8018;
28249 + ws = WS_128FS;
28250 + div = PSC_I2SCFG_DIV2;
28251 + break;
28252 + case 8000:
28253 + default:
28254 + sr = WM_SC_SR_8000;
28255 + ws = WS_96FS;
28256 + div = PSC_I2SCFG_DIV16;
28257 + break;
28258 }
28259
28260 + #if defined(WM_MODE_USB)
28261 + mode = WM_SC_MODE_USB;
28262 + #else
28263 + mode = WM_SC_MODE_NORMAL;
28264 + #endif
28265 +
28266 + bosr = 0;
28267 +
28268 dac->src_factor = 1;
28269 + dac->sample_rate = rate;
28270
28271 -#if 0
28272 - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
28273 + /* Deactivate codec */
28274 + wrcodec(WM_REG_ACTIVE_CTRL, 0x00);
28275
28276 - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
28277 + /* Disable I2S controller */
28278 + ip->psc_i2scfg &= ~PSC_I2SCFG_DE_ENABLE;
28279 + /* Wait for device disabled */
28280 + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 1);
28281 +
28282 + cfg = ip->psc_i2scfg;
28283 + /* Clear WS and DIVIDER values */
28284 + cfg &= ~(PSC_I2SCFG_WS_MASK | PSC_I2SCFG_DIV_MASK);
28285 + cfg |= PSC_I2SCFG_WS(ws) | div;
28286 + /* Reconfigure and enable */
28287 + ip->psc_i2scfg = cfg | PSC_I2SCFG_DE_ENABLE;
28288
28289 - adc->sample_rate = rate;
28290 - dac->sample_rate = rate;
28291 -#endif
28292 + /* Wait for device enabled */
28293 + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 0);
28294 +
28295 + /* Set appropriate sampling rate */
28296 + wrcodec(WM_REG_SAMPLING_CONTROL, bosr | mode | sr);
28297 +
28298 + /* Activate codec */
28299 + wrcodec(WM_REG_ACTIVE_CTRL, 0x01);
28300 }
28301
28302 static void
28303 @@ -354,8 +652,7 @@
28304 ip->psc_i2spcr = PSC_I2SPCR_RP;
28305 au_sync();
28306
28307 - /* Wait for Receive Busy to show disabled.
28308 - */
28309 + /* Wait for Receive Busy to show disabled. */
28310 do {
28311 stat = ip->psc_i2sstat;
28312 au_sync();
28313 @@ -463,7 +760,6 @@
28314 if (db->num_channels == 1)
28315 db->cnt_factor *= 2;
28316 db->cnt_factor *= db->src_factor;
28317 -
28318 db->count = 0;
28319 db->dma_qcount = 0;
28320 db->nextIn = db->nextOut = db->rawbuf;
28321 @@ -546,12 +842,13 @@
28322 if (i2s_stat & (PSC_I2SSTAT_TF | PSC_I2SSTAT_TR | PSC_I2SSTAT_TF))
28323 dbg("I2S status = 0x%08x", i2s_stat);
28324 #endif
28325 +
28326 db->dma_qcount--;
28327
28328 if (db->count >= db->fragsize) {
28329 - if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
28330 - db->fragsize) == 0) {
28331 - err("qcount < 2 and no ring room!");
28332 + if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, db->fragsize) == 0)
28333 + {
28334 + err("qcount < MIN_Q_COUNT and no ring room!");
28335 }
28336 db->nextOut += db->fragsize;
28337 if (db->nextOut >= db->rawbuf + db->dmasize)
28338 @@ -606,65 +903,43 @@
28339
28340 }
28341
28342 -static loff_t
28343 -au1550_llseek(struct file *file, loff_t offset, int origin)
28344 -{
28345 - return -ESPIPE;
28346 -}
28347 -
28348 -
28349 -#if 0
28350 -static int
28351 -au1550_open_mixdev(struct inode *inode, struct file *file)
28352 -{
28353 - file->private_data = &au1550_state;
28354 - return 0;
28355 -}
28356 -
28357 -static int
28358 -au1550_release_mixdev(struct inode *inode, struct file *file)
28359 -{
28360 - return 0;
28361 -}
28362 -
28363 -static int
28364 -mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
28365 - unsigned long arg)
28366 -{
28367 - return codec->mixer_ioctl(codec, cmd, arg);
28368 -}
28369 -
28370 -static int
28371 -au1550_ioctl_mixdev(struct inode *inode, struct file *file,
28372 - unsigned int cmd, unsigned long arg)
28373 -{
28374 - struct au1550_state *s = (struct au1550_state *)file->private_data;
28375 - struct ac97_codec *codec = s->codec;
28376 -
28377 - return mixdev_ioctl(codec, cmd, arg);
28378 -}
28379 -
28380 -static /*const */ struct file_operations au1550_mixer_fops = {
28381 - owner:THIS_MODULE,
28382 - llseek:au1550_llseek,
28383 - ioctl:au1550_ioctl_mixdev,
28384 - open:au1550_open_mixdev,
28385 - release:au1550_release_mixdev,
28386 -};
28387 -#endif
28388 -
28389 static int
28390 drain_dac(struct au1550_state *s, int nonblock)
28391 {
28392 unsigned long flags;
28393 int count, tmo;
28394
28395 + struct dmabuf *db = &s->dma_dac;
28396 +
28397 + //DPRINTF();
28398 if (s->dma_dac.mapped || !s->dma_dac.ready || s->dma_dac.stopped)
28399 return 0;
28400
28401 for (;;) {
28402 spin_lock_irqsave(&s->lock, flags);
28403 - count = s->dma_dac.count;
28404 + count = db->count;
28405 +
28406 + /* Pad the ddma buffer with zeros if the amount remaining
28407 + * is not a multiple of fragsize */
28408 + if(count % db->fragsize != 0)
28409 + {
28410 + int pad = db->fragsize - (count % db->fragsize);
28411 + char* bufptr = db->nextIn;
28412 + char* bufend = db->rawbuf + db->dmasize;
28413 +
28414 + if((bufend - bufptr) < pad)
28415 + printk("Error! ddma padding is bigger than available ring space!\n");
28416 + else
28417 + {
28418 + memset((void*)bufptr, 0, pad);
28419 + count += pad;
28420 + db->nextIn += pad;
28421 + db->count += pad;
28422 + if (db->dma_qcount == 0)
28423 + start_dac(s);
28424 + db->dma_qcount++;
28425 + }
28426 + }
28427 spin_unlock_irqrestore(&s->lock, flags);
28428 if (count <= 0)
28429 break;
28430 @@ -672,9 +947,9 @@
28431 break;
28432 if (nonblock)
28433 return -EBUSY;
28434 - tmo = 1000 * count / (s->no_vra ?
28435 - SAMP_RATE : s->dma_dac.sample_rate);
28436 + tmo = 1000 * count / s->dma_dac.sample_rate;
28437 tmo /= s->dma_dac.dma_bytes_per_sample;
28438 +
28439 au1550_delay(tmo);
28440 }
28441 if (signal_pending(current))
28442 @@ -698,8 +973,7 @@
28443 * If interpolating (no VRA), duplicate every audio frame src_factor times.
28444 */
28445 static int
28446 -translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf,
28447 - int dmacount)
28448 +translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf, int dmacount)
28449 {
28450 int sample, i;
28451 int interp_bytes_per_sample;
28452 @@ -737,11 +1011,12 @@
28453
28454 /* duplicate every audio frame src_factor times
28455 */
28456 - for (i = 0; i < db->src_factor; i++)
28457 + for (i = 0; i < db->src_factor; i++) {
28458 memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
28459 + dmabuf += interp_bytes_per_sample;
28460 + }
28461
28462 userbuf += db->user_bytes_per_sample;
28463 - dmabuf += interp_bytes_per_sample;
28464 }
28465
28466 return num_samples * interp_bytes_per_sample;
28467 @@ -996,15 +1271,14 @@
28468 * on the dma queue. If the queue count reaches zero,
28469 * we know the dma has stopped.
28470 */
28471 - while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
28472 + while ((db->dma_qcount < MIN_Q_COUNT) && (db->count >= db->fragsize)) {
28473 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
28474 db->fragsize) == 0) {
28475 - err("qcount < 2 and no ring room!");
28476 + err("qcount < MIN_Q_COUNT and no ring room!");
28477 }
28478 db->nextOut += db->fragsize;
28479 if (db->nextOut >= db->rawbuf + db->dmasize)
28480 db->nextOut -= db->dmasize;
28481 - db->count -= db->fragsize;
28482 db->total_bytes += db->dma_fragsize;
28483 if (db->dma_qcount == 0)
28484 start_dac(s);
28485 @@ -1017,7 +1291,6 @@
28486 buffer += usercnt;
28487 ret += usercnt;
28488 } /* while (count > 0) */
28489 -
28490 out:
28491 up(&s->sem);
28492 out2:
28493 @@ -1371,9 +1644,6 @@
28494 s->dma_dac.cnt_factor;
28495 abinfo.fragstotal = s->dma_dac.numfrag;
28496 abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;
28497 -#ifdef AU1000_VERBOSE_DEBUG
28498 - dbg("bytes=%d, fragments=%d", abinfo.bytes, abinfo.fragments);
28499 -#endif
28500 return copy_to_user((void *) arg, &abinfo,
28501 sizeof(abinfo)) ? -EFAULT : 0;
28502
28503 @@ -1536,13 +1806,9 @@
28504 case SNDCTL_DSP_SETSYNCRO:
28505 case SOUND_PCM_READ_FILTER:
28506 return -EINVAL;
28507 + default: break;
28508 }
28509 -
28510 -#if 0
28511 - return mixdev_ioctl(s->codec, cmd, arg);
28512 -#else
28513 return 0;
28514 -#endif
28515 }
28516
28517
28518 @@ -1664,15 +1930,15 @@
28519 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
28520 MODULE_DESCRIPTION("Au1550 Audio Driver");
28521
28522 +#if defined(WM_MODE_USB)
28523 /* Set up an internal clock for the PSC3. This will then get
28524 * driven out of the Au1550 as the master.
28525 */
28526 static void
28527 intclk_setup(void)
28528 {
28529 - uint clk, rate, stat;
28530 -
28531 - /* Wire up Freq4 as a clock for the PSC3.
28532 + uint clk, rate;
28533 + /* Wire up Freq4 as a clock for the PSC.
28534 * We know SMBus uses Freq3.
28535 * By making changes to this rate, plus the word strobe
28536 * size, we can make fine adjustments to the actual data rate.
28537 @@ -1700,11 +1966,17 @@
28538 */
28539 clk = au_readl(SYS_CLKSRC);
28540 au_sync();
28541 +#if defined(CONFIG_SOC_AU1550)
28542 clk &= ~0x01f00000;
28543 clk |= (6 << 22);
28544 +#elif defined(CONFIG_SOC_AU1200)
28545 + clk &= ~0x3e000000;
28546 + clk |= (6 << 27);
28547 +#endif
28548 au_writel(clk, SYS_CLKSRC);
28549 au_sync();
28550 }
28551 +#endif
28552
28553 static int __devinit
28554 au1550_probe(void)
28555 @@ -1724,6 +1996,11 @@
28556 init_MUTEX(&s->open_sem);
28557 spin_lock_init(&s->lock);
28558
28559 + /* CPLD Mux for I2s */
28560 +
28561 +#if defined(CONFIG_MIPS_PB1200)
28562 + bcsr->resets |= BCSR_RESETS_PCS1MUX;
28563 +#endif
28564
28565 s->psc_addr = (volatile psc_i2s_t *)I2S_PSC_BASE;
28566 ip = s->psc_addr;
28567 @@ -1765,9 +2042,8 @@
28568
28569 if ((s->dev_audio = register_sound_dsp(&au1550_audio_fops, -1)) < 0)
28570 goto err_dev1;
28571 -#if 0
28572 - if ((s->codec->dev_mixer =
28573 - register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
28574 +#if 1
28575 + if ((s->dev_mixer = register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
28576 goto err_dev2;
28577 #endif
28578
28579 @@ -1777,7 +2053,6 @@
28580 proc_au1550_dump, NULL);
28581 #endif /* AU1550_DEBUG */
28582
28583 - intclk_setup();
28584
28585 /* The GPIO for the appropriate PSC was configured by the
28586 * board specific start up.
28587 @@ -1786,7 +2061,12 @@
28588 */
28589 ip->psc_ctrl = PSC_CTRL_DISABLE; /* Disable PSC */
28590 au_sync();
28591 +#if defined(WM_MODE_USB)
28592 + intclk_setup();
28593 ip->psc_sel = (PSC_SEL_CLK_INTCLK | PSC_SEL_PS_I2SMODE);
28594 +#else
28595 + ip->psc_sel = (PSC_SEL_CLK_EXTCLK | PSC_SEL_PS_I2SMODE);
28596 +#endif
28597 au_sync();
28598
28599 /* Enable PSC
28600 @@ -1806,42 +2086,18 @@
28601 * Actual I2S mode (first bit delayed by one clock).
28602 * Master mode (We provide the clock from the PSC).
28603 */
28604 - val = PSC_I2SCFG_SET_LEN(16);
28605 -#ifdef TRY_441KHz
28606 - /* This really should be 250, but it appears that all of the
28607 - * PLLs, dividers and so on in the chain shift it. That's the
28608 - * problem with sourceing the clock instead of letting the very
28609 - * stable codec provide it. But, the PSC doesn't appear to want
28610 - * to work in slave mode, so this is what we get. It's not
28611 - * studio quality timing, but it's good enough for listening
28612 - * to mp3s.
28613 - */
28614 - val |= PSC_I2SCFG_SET_WS(252);
28615 -#else
28616 - val |= PSC_I2SCFG_SET_WS(250);
28617 -#endif
28618 - val |= PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
28619 +
28620 + val = PSC_I2SCFG_SET_LEN(16) | PSC_I2SCFG_WS(WS_128FS) | PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
28621 PSC_I2SCFG_BI | PSC_I2SCFG_XM;
28622
28623 - ip->psc_i2scfg = val;
28624 - au_sync();
28625 - val |= PSC_I2SCFG_DE_ENABLE;
28626 - ip->psc_i2scfg = val;
28627 - au_sync();
28628 + ip->psc_i2scfg = val | PSC_I2SCFG_DE_ENABLE;
28629
28630 - /* Wait for Device ready.
28631 - */
28632 - do {
28633 - val = ip->psc_i2sstat;
28634 - au_sync();
28635 - } while ((val & PSC_I2SSTAT_DR) == 0);
28636 + set_dac_rate(s, 8000); //Set default rate
28637
28638 - val = ip->psc_i2scfg;
28639 - au_sync();
28640 + codec_init(s);
28641
28642 - codec_init();
28643 + s->no_vra = vra ? 0 : 1;
28644
28645 - s->no_vra = 1;
28646 if (s->no_vra)
28647 info("no VRA, interpolating and decimating");
28648
28649 @@ -1866,6 +2122,8 @@
28650 err_dev2:
28651 unregister_sound_dsp(s->dev_audio);
28652 #endif
28653 + err_dev2:
28654 + unregister_sound_dsp(s->dev_audio);
28655 err_dev1:
28656 au1xxx_dbdma_chan_free(s->dma_adc.dmanr);
28657 err_dma2:
28658 diff -Nur linux-2.4.29/drivers/sound/au1550_psc.c linux-mips/drivers/sound/au1550_psc.c
28659 --- linux-2.4.29/drivers/sound/au1550_psc.c 2005-01-19 15:10:04.000000000 +0100
28660 +++ linux-mips/drivers/sound/au1550_psc.c 2005-01-31 12:59:41.000000000 +0100
28661 @@ -30,6 +30,7 @@
28662 * 675 Mass Ave, Cambridge, MA 02139, USA.
28663 *
28664 */
28665 +
28666 #include <linux/version.h>
28667 #include <linux/module.h>
28668 #include <linux/string.h>
28669 @@ -63,6 +64,14 @@
28670 #include <asm/db1x00.h>
28671 #endif
28672
28673 +#ifdef CONFIG_MIPS_PB1200
28674 +#include <asm/pb1200.h>
28675 +#endif
28676 +
28677 +#ifdef CONFIG_MIPS_DB1200
28678 +#include <asm/db1200.h>
28679 +#endif
28680 +
28681 #undef OSS_DOCUMENTED_MIXER_SEMANTICS
28682
28683 #define AU1550_MODULE_NAME "Au1550 psc audio"
28684 @@ -521,7 +530,14 @@
28685 spin_unlock_irqrestore(&s->lock, flags);
28686 }
28687
28688 -
28689 +/*
28690 + NOTE: The xmit slots cannot be changed on the fly when in full-duplex
28691 + because the AC'97 block must be stopped/started. When using this driver
28692 + in full-duplex (in & out at the same time), the DMA engine will stop if
28693 + you disable the block.
28694 + TODO: change implementation to properly restart adc/dac after setting
28695 + xmit slots.
28696 +*/
28697 static void
28698 set_xmit_slots(int num_channels)
28699 {
28700 @@ -565,6 +581,14 @@
28701 } while ((stat & PSC_AC97STAT_DR) == 0);
28702 }
28703
28704 +/*
28705 + NOTE: The recv slots cannot be changed on the fly when in full-duplex
28706 + because the AC'97 block must be stopped/started. When using this driver
28707 + in full-duplex (in & out at the same time), the DMA engine will stop if
28708 + you disable the block.
28709 + TODO: change implementation to properly restart adc/dac after setting
28710 + recv slots.
28711 +*/
28712 static void
28713 set_recv_slots(int num_channels)
28714 {
28715 @@ -608,7 +632,6 @@
28716
28717 spin_lock_irqsave(&s->lock, flags);
28718
28719 - set_xmit_slots(db->num_channels);
28720 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);
28721 au_sync();
28722 au_writel(PSC_AC97PCR_TS, PSC_AC97PCR);
28723 @@ -640,7 +663,6 @@
28724 db->nextIn -= db->dmasize;
28725 }
28726
28727 - set_recv_slots(db->num_channels);
28728 au1xxx_dbdma_start(db->dmanr);
28729 au_writel(PSC_AC97PCR_RC, PSC_AC97PCR);
28730 au_sync();
28731 @@ -752,12 +774,16 @@
28732 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
28733 dbg("AC97C status = 0x%08x", ac97c_stat);
28734 #endif
28735 + /* There is a possiblity that we are getting 1 interrupt for
28736 + multiple descriptors. Use ddma api to find out how many
28737 + completed.
28738 + */
28739 db->dma_qcount--;
28740
28741 if (db->count >= db->fragsize) {
28742 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
28743 db->fragsize) == 0) {
28744 - err("qcount < 2 and no ring room!");
28745 + err("qcount < 2 and no ring room1!");
28746 }
28747 db->nextOut += db->fragsize;
28748 if (db->nextOut >= db->rawbuf + db->dmasize)
28749 @@ -941,11 +967,12 @@
28750
28751 /* duplicate every audio frame src_factor times
28752 */
28753 - for (i = 0; i < db->src_factor; i++)
28754 + for (i = 0; i < db->src_factor; i++) {
28755 memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
28756 + dmabuf += interp_bytes_per_sample;
28757 + }
28758
28759 userbuf += db->user_bytes_per_sample;
28760 - dmabuf += interp_bytes_per_sample;
28761 }
28762
28763 return num_samples * interp_bytes_per_sample;
28764 @@ -1203,7 +1230,7 @@
28765 while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
28766 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
28767 db->fragsize) == 0) {
28768 - err("qcount < 2 and no ring room!");
28769 + err("qcount < 2 and no ring room!0");
28770 }
28771 db->nextOut += db->fragsize;
28772 if (db->nextOut >= db->rawbuf + db->dmasize)
28773 @@ -1481,6 +1508,7 @@
28774 return -EINVAL;
28775 stop_adc(s);
28776 s->dma_adc.num_channels = val;
28777 + set_recv_slots(val);
28778 if ((ret = prog_dmabuf_adc(s)))
28779 return ret;
28780 }
28781 @@ -1538,6 +1566,7 @@
28782 }
28783
28784 s->dma_dac.num_channels = val;
28785 + set_xmit_slots(val);
28786 if ((ret = prog_dmabuf_dac(s)))
28787 return ret;
28788 }
28789 @@ -1832,10 +1861,8 @@
28790 down(&s->open_sem);
28791 }
28792
28793 - stop_dac(s);
28794 - stop_adc(s);
28795 -
28796 if (file->f_mode & FMODE_READ) {
28797 + stop_adc(s);
28798 s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags =
28799 s->dma_adc.subdivision = s->dma_adc.total_bytes = 0;
28800 s->dma_adc.num_channels = 1;
28801 @@ -1846,6 +1873,7 @@
28802 }
28803
28804 if (file->f_mode & FMODE_WRITE) {
28805 + stop_dac(s);
28806 s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags =
28807 s->dma_dac.subdivision = s->dma_dac.total_bytes = 0;
28808 s->dma_dac.num_channels = 1;
28809 @@ -2091,6 +2119,9 @@
28810 ac97_read_proc, &s->codec);
28811 #endif
28812
28813 + set_xmit_slots(1);
28814 + set_recv_slots(1);
28815 +
28816 return 0;
28817
28818 err_dev3:
28819 diff -Nur linux-2.4.29/drivers/tc/lk201.c linux-mips/drivers/tc/lk201.c
28820 --- linux-2.4.29/drivers/tc/lk201.c 2004-02-18 14:36:31.000000000 +0100
28821 +++ linux-mips/drivers/tc/lk201.c 2004-09-28 02:53:04.000000000 +0200
28822 @@ -5,7 +5,7 @@
28823 * for more details.
28824 *
28825 * Copyright (C) 1999-2002 Harald Koerfgen <hkoerfg@web.de>
28826 - * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
28827 + * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki
28828 */
28829
28830 #include <linux/config.h>
28831 @@ -23,8 +23,8 @@
28832 #include <asm/keyboard.h>
28833 #include <asm/dec/tc.h>
28834 #include <asm/dec/machtype.h>
28835 +#include <asm/dec/serial.h>
28836
28837 -#include "zs.h"
28838 #include "lk201.h"
28839
28840 /*
28841 @@ -55,19 +55,20 @@
28842 unsigned char kbd_sysrq_key = -1;
28843 #endif
28844
28845 -#define KEYB_LINE 3
28846 +#define KEYB_LINE_ZS 3
28847 +#define KEYB_LINE_DZ 0
28848
28849 -static int __init lk201_init(struct dec_serial *);
28850 -static void __init lk201_info(struct dec_serial *);
28851 -static void lk201_kbd_rx_char(unsigned char, unsigned char);
28852 +static int __init lk201_init(void *);
28853 +static void __init lk201_info(void *);
28854 +static void lk201_rx_char(unsigned char, unsigned char);
28855
28856 -struct zs_hook lk201_kbdhook = {
28857 +static struct dec_serial_hook lk201_hook = {
28858 .init_channel = lk201_init,
28859 .init_info = lk201_info,
28860 .rx_char = NULL,
28861 .poll_rx_char = NULL,
28862 .poll_tx_char = NULL,
28863 - .cflags = B4800 | CS8 | CSTOPB | CLOCAL
28864 + .cflags = B4800 | CS8 | CSTOPB | CLOCAL,
28865 };
28866
28867 /*
28868 @@ -93,28 +94,28 @@
28869 LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
28870 };
28871
28872 -static struct dec_serial* lk201kbd_info;
28873 +static void *lk201_handle;
28874
28875 -static int lk201_send(struct dec_serial *info, unsigned char ch)
28876 +static int lk201_send(unsigned char ch)
28877 {
28878 - if (info->hook->poll_tx_char(info, ch)) {
28879 + if (lk201_hook.poll_tx_char(lk201_handle, ch)) {
28880 printk(KERN_ERR "lk201: transmit timeout\n");
28881 return -EIO;
28882 }
28883 return 0;
28884 }
28885
28886 -static inline int lk201_get_id(struct dec_serial *info)
28887 +static inline int lk201_get_id(void)
28888 {
28889 - return lk201_send(info, LK_CMD_REQ_ID);
28890 + return lk201_send(LK_CMD_REQ_ID);
28891 }
28892
28893 -static int lk201_reset(struct dec_serial *info)
28894 +static int lk201_reset(void)
28895 {
28896 int i, r;
28897
28898 for (i = 0; i < sizeof(lk201_reset_string); i++) {
28899 - r = lk201_send(info, lk201_reset_string[i]);
28900 + r = lk201_send(lk201_reset_string[i]);
28901 if (r < 0)
28902 return r;
28903 }
28904 @@ -203,24 +204,26 @@
28905
28906 static int write_kbd_rate(struct kbd_repeat *rep)
28907 {
28908 - struct dec_serial* info = lk201kbd_info;
28909 int delay, rate;
28910 int i;
28911
28912 delay = rep->delay / 5;
28913 rate = rep->rate;
28914 for (i = 0; i < 4; i++) {
28915 - if (info->hook->poll_tx_char(info, LK_CMD_RPT_RATE(i)))
28916 + if (lk201_hook.poll_tx_char(lk201_handle,
28917 + LK_CMD_RPT_RATE(i)))
28918 return 1;
28919 - if (info->hook->poll_tx_char(info, LK_PARAM_DELAY(delay)))
28920 + if (lk201_hook.poll_tx_char(lk201_handle,
28921 + LK_PARAM_DELAY(delay)))
28922 return 1;
28923 - if (info->hook->poll_tx_char(info, LK_PARAM_RATE(rate)))
28924 + if (lk201_hook.poll_tx_char(lk201_handle,
28925 + LK_PARAM_RATE(rate)))
28926 return 1;
28927 }
28928 return 0;
28929 }
28930
28931 -static int lk201kbd_rate(struct kbd_repeat *rep)
28932 +static int lk201_kbd_rate(struct kbd_repeat *rep)
28933 {
28934 if (rep == NULL)
28935 return -EINVAL;
28936 @@ -237,10 +240,8 @@
28937 return 0;
28938 }
28939
28940 -static void lk201kd_mksound(unsigned int hz, unsigned int ticks)
28941 +static void lk201_kd_mksound(unsigned int hz, unsigned int ticks)
28942 {
28943 - struct dec_serial* info = lk201kbd_info;
28944 -
28945 if (!ticks)
28946 return;
28947
28948 @@ -253,20 +254,19 @@
28949 ticks = 7;
28950 ticks = 7 - ticks;
28951
28952 - if (info->hook->poll_tx_char(info, LK_CMD_ENB_BELL))
28953 + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_ENB_BELL))
28954 return;
28955 - if (info->hook->poll_tx_char(info, LK_PARAM_VOLUME(ticks)))
28956 + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_VOLUME(ticks)))
28957 return;
28958 - if (info->hook->poll_tx_char(info, LK_CMD_BELL))
28959 + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_BELL))
28960 return;
28961 }
28962
28963 void kbd_leds(unsigned char leds)
28964 {
28965 - struct dec_serial* info = lk201kbd_info;
28966 unsigned char l = 0;
28967
28968 - if (!info) /* FIXME */
28969 + if (!lk201_handle) /* FIXME */
28970 return;
28971
28972 /* FIXME -- Only Hold and Lock LEDs for now. --macro */
28973 @@ -275,13 +275,13 @@
28974 if (leds & LED_CAP)
28975 l |= LK_LED_LOCK;
28976
28977 - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_ON))
28978 + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_ON))
28979 return;
28980 - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(l)))
28981 + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(l)))
28982 return;
28983 - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_OFF))
28984 + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_OFF))
28985 return;
28986 - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(~l)))
28987 + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(~l)))
28988 return;
28989 }
28990
28991 @@ -307,7 +307,7 @@
28992 return 0x80;
28993 }
28994
28995 -static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat)
28996 +static void lk201_rx_char(unsigned char ch, unsigned char fl)
28997 {
28998 static unsigned char id[6];
28999 static int id_i;
29000 @@ -316,9 +316,8 @@
29001 static int prev_scancode;
29002 unsigned char c = scancodeRemap[ch];
29003
29004 - if (stat && stat != TTY_OVERRUN) {
29005 - printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n",
29006 - stat);
29007 + if (fl != TTY_NORMAL && fl != TTY_OVERRUN) {
29008 + printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n", fl);
29009 return;
29010 }
29011
29012 @@ -335,7 +334,7 @@
29013 /* OK, the power-up concluded. */
29014 lk201_report(id);
29015 if (id[2] == LK_STAT_PWRUP_OK)
29016 - lk201_get_id(lk201kbd_info);
29017 + lk201_get_id();
29018 else {
29019 id_i = 0;
29020 printk(KERN_ERR "lk201: keyboard power-up "
29021 @@ -345,7 +344,7 @@
29022 /* We got the ID; report it and start operation. */
29023 id_i = 0;
29024 lk201_id(id);
29025 - lk201_reset(lk201kbd_info);
29026 + lk201_reset();
29027 }
29028 return;
29029 }
29030 @@ -398,29 +397,28 @@
29031 tasklet_schedule(&keyboard_tasklet);
29032 }
29033
29034 -static void __init lk201_info(struct dec_serial *info)
29035 +static void __init lk201_info(void *handle)
29036 {
29037 }
29038
29039 -static int __init lk201_init(struct dec_serial *info)
29040 +static int __init lk201_init(void *handle)
29041 {
29042 /* First install handlers. */
29043 - lk201kbd_info = info;
29044 - kbd_rate = lk201kbd_rate;
29045 - kd_mksound = lk201kd_mksound;
29046 + lk201_handle = handle;
29047 + kbd_rate = lk201_kbd_rate;
29048 + kd_mksound = lk201_kd_mksound;
29049
29050 - info->hook->rx_char = lk201_kbd_rx_char;
29051 + lk201_hook.rx_char = lk201_rx_char;
29052
29053 /* Then just issue a reset -- the handlers will do the rest. */
29054 - lk201_send(info, LK_CMD_POWER_UP);
29055 + lk201_send(LK_CMD_POWER_UP);
29056
29057 return 0;
29058 }
29059
29060 void __init kbd_init_hw(void)
29061 {
29062 - extern int register_zs_hook(unsigned int, struct zs_hook *);
29063 - extern int unregister_zs_hook(unsigned int);
29064 + int keyb_line;
29065
29066 /* Maxine uses LK501 at the Access.Bus. */
29067 if (!LK_IFACE)
29068 @@ -428,19 +426,15 @@
29069
29070 printk(KERN_INFO "lk201: DECstation LK keyboard driver v0.05.\n");
29071
29072 - if (LK_IFACE_ZS) {
29073 - /*
29074 - * kbd_init_hw() is being called before
29075 - * rs_init() so just register the kbd hook
29076 - * and let zs_init do the rest :-)
29077 - */
29078 - if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
29079 - unregister_zs_hook(KEYB_LINE);
29080 - } else {
29081 - /*
29082 - * TODO: modify dz.c to allow similar hooks
29083 - * for LK201 handling on DS2100, DS3100, and DS5000/200
29084 - */
29085 - printk(KERN_ERR "lk201: support for DZ11 not yet ready.\n");
29086 - }
29087 + /*
29088 + * kbd_init_hw() is being called before
29089 + * rs_init() so just register the kbd hook
29090 + * and let zs_init do the rest :-)
29091 + */
29092 + if (LK_IFACE_ZS)
29093 + keyb_line = KEYB_LINE_ZS;
29094 + else
29095 + keyb_line = KEYB_LINE_DZ;
29096 + if (!register_dec_serial_hook(keyb_line, &lk201_hook))
29097 + unregister_dec_serial_hook(keyb_line);
29098 }
29099 diff -Nur linux-2.4.29/drivers/tc/zs.c linux-mips/drivers/tc/zs.c
29100 --- linux-2.4.29/drivers/tc/zs.c 2005-01-19 15:10:05.000000000 +0100
29101 +++ linux-mips/drivers/tc/zs.c 2004-12-27 05:13:50.000000000 +0100
29102 @@ -68,6 +68,8 @@
29103 #include <asm/bitops.h>
29104 #include <asm/uaccess.h>
29105 #include <asm/bootinfo.h>
29106 +#include <asm/dec/serial.h>
29107 +
29108 #ifdef CONFIG_DECSTATION
29109 #include <asm/dec/interrupts.h>
29110 #include <asm/dec/machtype.h>
29111 @@ -160,8 +162,8 @@
29112 #ifdef CONFIG_SERIAL_DEC_CONSOLE
29113 static struct console sercons;
29114 #endif
29115 -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) \
29116 - && !defined(MODULE)
29117 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
29118 + !defined(MODULE)
29119 static unsigned long break_pressed; /* break, really ... */
29120 #endif
29121
29122 @@ -196,7 +198,6 @@
29123 /*
29124 * Debugging.
29125 */
29126 -#undef SERIAL_DEBUG_INTR
29127 #undef SERIAL_DEBUG_OPEN
29128 #undef SERIAL_DEBUG_FLOW
29129 #undef SERIAL_DEBUG_THROTTLE
29130 @@ -221,10 +222,6 @@
29131 static struct termios *serial_termios[NUM_CHANNELS];
29132 static struct termios *serial_termios_locked[NUM_CHANNELS];
29133
29134 -#ifndef MIN
29135 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
29136 -#endif
29137 -
29138 /*
29139 * tmp_buf is used as a temporary buffer by serial_write. We need to
29140 * lock it in case the copy_from_user blocks while swapping in a page,
29141 @@ -386,8 +383,6 @@
29142 * -----------------------------------------------------------------------
29143 */
29144
29145 -static int tty_break; /* Set whenever BREAK condition is detected. */
29146 -
29147 /*
29148 * This routine is used by the interrupt handler to schedule
29149 * processing in the software interrupt portion of the driver.
29150 @@ -414,20 +409,15 @@
29151 if (!tty && (!info->hook || !info->hook->rx_char))
29152 continue;
29153
29154 - if (tty_break) {
29155 - tty_break = 0;
29156 -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
29157 - if (info->line == sercons.index) {
29158 - if (!break_pressed) {
29159 - break_pressed = jiffies;
29160 - goto ignore_char;
29161 - }
29162 - break_pressed = 0;
29163 - }
29164 -#endif
29165 + flag = TTY_NORMAL;
29166 + if (info->tty_break) {
29167 + info->tty_break = 0;
29168 flag = TTY_BREAK;
29169 if (info->flags & ZILOG_SAK)
29170 do_SAK(tty);
29171 + /* Ignore the null char got when BREAK is removed. */
29172 + if (ch == 0)
29173 + continue;
29174 } else {
29175 if (stat & Rx_OVR) {
29176 flag = TTY_OVERRUN;
29177 @@ -435,20 +425,22 @@
29178 flag = TTY_FRAME;
29179 } else if (stat & PAR_ERR) {
29180 flag = TTY_PARITY;
29181 - } else
29182 - flag = 0;
29183 - if (flag)
29184 + }
29185 + if (flag != TTY_NORMAL)
29186 /* reset the error indication */
29187 write_zsreg(info->zs_channel, R0, ERR_RES);
29188 }
29189
29190 -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
29191 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
29192 + !defined(MODULE)
29193 if (break_pressed && info->line == sercons.index) {
29194 - if (ch != 0 &&
29195 - time_before(jiffies, break_pressed + HZ*5)) {
29196 + /* Ignore the null char got when BREAK is removed. */
29197 + if (ch == 0)
29198 + continue;
29199 + if (time_before(jiffies, break_pressed + HZ * 5)) {
29200 handle_sysrq(ch, regs, NULL, NULL);
29201 break_pressed = 0;
29202 - goto ignore_char;
29203 + continue;
29204 }
29205 break_pressed = 0;
29206 }
29207 @@ -459,23 +451,7 @@
29208 return;
29209 }
29210
29211 - if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
29212 - static int flip_buf_ovf;
29213 - ++flip_buf_ovf;
29214 - continue;
29215 - }
29216 - tty->flip.count++;
29217 - {
29218 - static int flip_max_cnt;
29219 - if (flip_max_cnt < tty->flip.count)
29220 - flip_max_cnt = tty->flip.count;
29221 - }
29222 -
29223 - *tty->flip.flag_buf_ptr++ = flag;
29224 - *tty->flip.char_buf_ptr++ = ch;
29225 -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
29226 - ignore_char:
29227 -#endif
29228 + tty_insert_flip_char(tty, ch, flag);
29229 }
29230 if (tty)
29231 tty_flip_buffer_push(tty);
29232 @@ -517,11 +493,15 @@
29233 /* Get status from Read Register 0 */
29234 stat = read_zsreg(info->zs_channel, R0);
29235
29236 - if (stat & BRK_ABRT) {
29237 -#ifdef SERIAL_DEBUG_INTR
29238 - printk("handling break....");
29239 + if ((stat & BRK_ABRT) && !(info->read_reg_zero & BRK_ABRT)) {
29240 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
29241 + !defined(MODULE)
29242 + if (info->line == sercons.index) {
29243 + if (!break_pressed)
29244 + break_pressed = jiffies;
29245 + } else
29246 #endif
29247 - tty_break = 1;
29248 + info->tty_break = 1;
29249 }
29250
29251 if (info->zs_channel != info->zs_chan_a) {
29252 @@ -957,7 +937,7 @@
29253 save_flags(flags);
29254 while (1) {
29255 cli();
29256 - c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
29257 + c = min(count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
29258 SERIAL_XMIT_SIZE - info->xmit_head));
29259 if (c <= 0)
29260 break;
29261 @@ -965,7 +945,7 @@
29262 if (from_user) {
29263 down(&tmp_buf_sem);
29264 copy_from_user(tmp_buf, buf, c);
29265 - c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
29266 + c = min(c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
29267 SERIAL_XMIT_SIZE - info->xmit_head));
29268 memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
29269 up(&tmp_buf_sem);
29270 @@ -1282,46 +1262,48 @@
29271 }
29272
29273 switch (cmd) {
29274 - case TIOCMGET:
29275 - error = verify_area(VERIFY_WRITE, (void *) arg,
29276 - sizeof(unsigned int));
29277 - if (error)
29278 - return error;
29279 - return get_modem_info(info, (unsigned int *) arg);
29280 - case TIOCMBIS:
29281 - case TIOCMBIC:
29282 - case TIOCMSET:
29283 - return set_modem_info(info, cmd, (unsigned int *) arg);
29284 - case TIOCGSERIAL:
29285 - error = verify_area(VERIFY_WRITE, (void *) arg,
29286 - sizeof(struct serial_struct));
29287 - if (error)
29288 - return error;
29289 - return get_serial_info(info,
29290 - (struct serial_struct *) arg);
29291 - case TIOCSSERIAL:
29292 - return set_serial_info(info,
29293 - (struct serial_struct *) arg);
29294 - case TIOCSERGETLSR: /* Get line status register */
29295 - error = verify_area(VERIFY_WRITE, (void *) arg,
29296 - sizeof(unsigned int));
29297 - if (error)
29298 - return error;
29299 - else
29300 - return get_lsr_info(info, (unsigned int *) arg);
29301 + case TIOCMGET:
29302 + error = verify_area(VERIFY_WRITE, (void *)arg,
29303 + sizeof(unsigned int));
29304 + if (error)
29305 + return error;
29306 + return get_modem_info(info, (unsigned int *)arg);
29307
29308 - case TIOCSERGSTRUCT:
29309 - error = verify_area(VERIFY_WRITE, (void *) arg,
29310 - sizeof(struct dec_serial));
29311 - if (error)
29312 - return error;
29313 - copy_from_user((struct dec_serial *) arg,
29314 - info, sizeof(struct dec_serial));
29315 - return 0;
29316 + case TIOCMBIS:
29317 + case TIOCMBIC:
29318 + case TIOCMSET:
29319 + return set_modem_info(info, cmd, (unsigned int *)arg);
29320
29321 - default:
29322 - return -ENOIOCTLCMD;
29323 - }
29324 + case TIOCGSERIAL:
29325 + error = verify_area(VERIFY_WRITE, (void *)arg,
29326 + sizeof(struct serial_struct));
29327 + if (error)
29328 + return error;
29329 + return get_serial_info(info, (struct serial_struct *)arg);
29330 +
29331 + case TIOCSSERIAL:
29332 + return set_serial_info(info, (struct serial_struct *)arg);
29333 +
29334 + case TIOCSERGETLSR: /* Get line status register */
29335 + error = verify_area(VERIFY_WRITE, (void *)arg,
29336 + sizeof(unsigned int));
29337 + if (error)
29338 + return error;
29339 + else
29340 + return get_lsr_info(info, (unsigned int *)arg);
29341 +
29342 + case TIOCSERGSTRUCT:
29343 + error = verify_area(VERIFY_WRITE, (void *)arg,
29344 + sizeof(struct dec_serial));
29345 + if (error)
29346 + return error;
29347 + copy_from_user((struct dec_serial *)arg, info,
29348 + sizeof(struct dec_serial));
29349 + return 0;
29350 +
29351 + default:
29352 + return -ENOIOCTLCMD;
29353 + }
29354 return 0;
29355 }
29356
29357 @@ -1446,7 +1428,8 @@
29358 static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
29359 {
29360 struct dec_serial *info = (struct dec_serial *) tty->driver_data;
29361 - unsigned long orig_jiffies, char_time;
29362 + unsigned long orig_jiffies;
29363 + int char_time;
29364
29365 if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
29366 return;
29367 @@ -1462,7 +1445,7 @@
29368 if (char_time == 0)
29369 char_time = 1;
29370 if (timeout)
29371 - char_time = MIN(char_time, timeout);
29372 + char_time = min(char_time, timeout);
29373 while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
29374 current->state = TASK_INTERRUPTIBLE;
29375 schedule_timeout(char_time);
29376 @@ -1714,7 +1697,7 @@
29377
29378 static void __init show_serial_version(void)
29379 {
29380 - printk("DECstation Z8530 serial driver version 0.08\n");
29381 + printk("DECstation Z8530 serial driver version 0.09\n");
29382 }
29383
29384 /* Initialize Z8530s zs_channels
29385 @@ -1994,8 +1977,9 @@
29386 * polling I/O routines
29387 */
29388 static int
29389 -zs_poll_tx_char(struct dec_serial *info, unsigned char ch)
29390 +zs_poll_tx_char(void *handle, unsigned char ch)
29391 {
29392 + struct dec_serial *info = handle;
29393 struct dec_zschannel *chan = info->zs_channel;
29394 int ret;
29395
29396 @@ -2017,8 +2001,9 @@
29397 }
29398
29399 static int
29400 -zs_poll_rx_char(struct dec_serial *info)
29401 +zs_poll_rx_char(void *handle)
29402 {
29403 + struct dec_serial *info = handle;
29404 struct dec_zschannel *chan = info->zs_channel;
29405 int ret;
29406
29407 @@ -2038,12 +2023,13 @@
29408 return -ENODEV;
29409 }
29410
29411 -unsigned int register_zs_hook(unsigned int channel, struct zs_hook *hook)
29412 +int register_zs_hook(unsigned int channel, struct dec_serial_hook *hook)
29413 {
29414 struct dec_serial *info = &zs_soft[channel];
29415
29416 if (info->hook) {
29417 - printk(__FUNCTION__": line %d has already a hook registered\n", channel);
29418 + printk("%s: line %d has already a hook registered\n",
29419 + __FUNCTION__, channel);
29420
29421 return 0;
29422 } else {
29423 @@ -2055,7 +2041,7 @@
29424 }
29425 }
29426
29427 -unsigned int unregister_zs_hook(unsigned int channel)
29428 +int unregister_zs_hook(unsigned int channel)
29429 {
29430 struct dec_serial *info = &zs_soft[channel];
29431
29432 @@ -2063,8 +2049,8 @@
29433 info->hook = NULL;
29434 return 1;
29435 } else {
29436 - printk(__FUNCTION__": trying to unregister hook on line %d,"
29437 - " but none is registered\n", channel);
29438 + printk("%s: trying to unregister hook on line %d,"
29439 + " but none is registered\n", __FUNCTION__, channel);
29440 return 0;
29441 }
29442 }
29443 @@ -2319,22 +2305,23 @@
29444 write_zsreg(chan, 9, nine);
29445 }
29446
29447 -static int kgdbhook_init_channel(struct dec_serial* info)
29448 +static int kgdbhook_init_channel(void *handle)
29449 {
29450 return 0;
29451 }
29452
29453 -static void kgdbhook_init_info(struct dec_serial* info)
29454 +static void kgdbhook_init_info(void *handle)
29455 {
29456 }
29457
29458 -static void kgdbhook_rx_char(struct dec_serial* info,
29459 - unsigned char ch, unsigned char stat)
29460 +static void kgdbhook_rx_char(void *handle, unsigned char ch, unsigned char fl)
29461 {
29462 + struct dec_serial *info = handle;
29463 +
29464 + if (fl != TTY_NORMAL)
29465 + return;
29466 if (ch == 0x03 || ch == '$')
29467 breakpoint();
29468 - if (stat & (Rx_OVR|FRM_ERR|PAR_ERR))
29469 - write_zsreg(info->zs_channel, 0, ERR_RES);
29470 }
29471
29472 /* This sets up the serial port we're using, and turns on
29473 @@ -2360,11 +2347,11 @@
29474 * for /dev/ttyb which is determined in setup_arch() from the
29475 * boot command line flags.
29476 */
29477 -struct zs_hook zs_kgdbhook = {
29478 - init_channel : kgdbhook_init_channel,
29479 - init_info : kgdbhook_init_info,
29480 - cflags : B38400|CS8|CLOCAL,
29481 - rx_char : kgdbhook_rx_char,
29482 +struct dec_serial_hook zs_kgdbhook = {
29483 + .init_channel = kgdbhook_init_channel,
29484 + .init_info = kgdbhook_init_info,
29485 + .rx_char = kgdbhook_rx_char,
29486 + .cflags = B38400 | CS8 | CLOCAL,
29487 }
29488
29489 void __init zs_kgdb_hook(int tty_num)
29490 diff -Nur linux-2.4.29/drivers/tc/zs.h linux-mips/drivers/tc/zs.h
29491 --- linux-2.4.29/drivers/tc/zs.h 2004-02-18 14:36:31.000000000 +0100
29492 +++ linux-mips/drivers/tc/zs.h 2004-07-01 15:28:54.000000000 +0200
29493 @@ -1,14 +1,18 @@
29494 /*
29495 - * macserial.h: Definitions for the Macintosh Z8530 serial driver.
29496 + * drivers/tc/zs.h: Definitions for the DECstation Z85C30 serial driver.
29497 *
29498 * Adapted from drivers/sbus/char/sunserial.h by Paul Mackerras.
29499 + * Adapted from drivers/macintosh/macserial.h by Harald Koerfgen.
29500 *
29501 * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au)
29502 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
29503 + * Copyright (C) 2004 Maciej W. Rozycki
29504 */
29505 #ifndef _DECSERIAL_H
29506 #define _DECSERIAL_H
29507
29508 +#include <asm/dec/serial.h>
29509 +
29510 #define NUM_ZSREGS 16
29511
29512 struct serial_struct {
29513 @@ -89,63 +93,50 @@
29514 unsigned char curregs[NUM_ZSREGS];
29515 };
29516
29517 -struct dec_serial;
29518 -
29519 -struct zs_hook {
29520 - int (*init_channel)(struct dec_serial* info);
29521 - void (*init_info)(struct dec_serial* info);
29522 - void (*rx_char)(unsigned char ch, unsigned char stat);
29523 - int (*poll_rx_char)(struct dec_serial* info);
29524 - int (*poll_tx_char)(struct dec_serial* info,
29525 - unsigned char ch);
29526 - unsigned cflags;
29527 -};
29528 -
29529 struct dec_serial {
29530 - struct dec_serial *zs_next; /* For IRQ servicing chain */
29531 - struct dec_zschannel *zs_channel; /* Channel registers */
29532 - struct dec_zschannel *zs_chan_a; /* A side registers */
29533 - unsigned char read_reg_zero;
29534 -
29535 - char soft_carrier; /* Use soft carrier on this channel */
29536 - char break_abort; /* Is serial console in, so process brk/abrt */
29537 - struct zs_hook *hook; /* Hook on this channel */
29538 - char is_cons; /* Is this our console. */
29539 - unsigned char tx_active; /* character is being xmitted */
29540 - unsigned char tx_stopped; /* output is suspended */
29541 -
29542 - /* We need to know the current clock divisor
29543 - * to read the bps rate the chip has currently
29544 - * loaded.
29545 + struct dec_serial *zs_next; /* For IRQ servicing chain. */
29546 + struct dec_zschannel *zs_channel; /* Channel registers. */
29547 + struct dec_zschannel *zs_chan_a; /* A side registers. */
29548 + unsigned char read_reg_zero;
29549 +
29550 + struct dec_serial_hook *hook; /* Hook on this channel. */
29551 + int tty_break; /* Set on BREAK condition. */
29552 + int is_cons; /* Is this our console. */
29553 + int tx_active; /* Char is being xmitted. */
29554 + int tx_stopped; /* Output is suspended. */
29555 +
29556 + /*
29557 + * We need to know the current clock divisor
29558 + * to read the bps rate the chip has currently loaded.
29559 */
29560 - unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
29561 - int zs_baud;
29562 + int clk_divisor; /* May be 1, 16, 32, or 64. */
29563 + int zs_baud;
29564
29565 - char change_needed;
29566 + char change_needed;
29567
29568 int magic;
29569 int baud_base;
29570 int port;
29571 int irq;
29572 - int flags; /* defined in tty.h */
29573 - int type; /* UART type */
29574 + int flags; /* Defined in tty.h. */
29575 + int type; /* UART type. */
29576 struct tty_struct *tty;
29577 int read_status_mask;
29578 int ignore_status_mask;
29579 int timeout;
29580 int xmit_fifo_size;
29581 int custom_divisor;
29582 - int x_char; /* xon/xoff character */
29583 + int x_char; /* XON/XOFF character. */
29584 int close_delay;
29585 unsigned short closing_wait;
29586 unsigned short closing_wait2;
29587 unsigned long event;
29588 unsigned long last_active;
29589 int line;
29590 - int count; /* # of fd on device */
29591 - int blocked_open; /* # of blocked opens */
29592 - long session; /* Session of opening process */
29593 - long pgrp; /* pgrp of opening process */
29594 + int count; /* # of fds on device. */
29595 + int blocked_open; /* # of blocked opens. */
29596 + long session; /* Sess of opening process. */
29597 + long pgrp; /* Pgrp of opening process. */
29598 unsigned char *xmit_buf;
29599 int xmit_head;
29600 int xmit_tail;
29601 diff -Nur linux-2.4.29/drivers/usb/devio.c linux-mips/drivers/usb/devio.c
29602 --- linux-2.4.29/drivers/usb/devio.c 2004-11-17 12:54:21.000000000 +0100
29603 +++ linux-mips/drivers/usb/devio.c 2005-03-26 11:47:35.208873156 +0100
29604 @@ -1132,6 +1132,8 @@
29605 /* ifno might usefully be passed ... */
29606 retval = driver->ioctl (ps->dev, ctrl.ioctl_code, buf);
29607 /* size = min_t(int, size, retval)? */
29608 + if (retval == -ENOIOCTLCMD)
29609 + retval = -ENOTTY;
29610 }
29611 }
29612
29613 @@ -1146,24 +1148,10 @@
29614 return retval;
29615 }
29616
29617 -static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
29618 +static int usbdev_ioctl_exclusive(struct dev_state *ps, struct inode *inode,
29619 + unsigned int cmd, unsigned long arg)
29620 {
29621 - struct dev_state *ps = (struct dev_state *)file->private_data;
29622 - int ret = -ENOIOCTLCMD;
29623 -
29624 - if (!(file->f_mode & FMODE_WRITE))
29625 - return -EPERM;
29626 - down_read(&ps->devsem);
29627 - if (!ps->dev) {
29628 - up_read(&ps->devsem);
29629 - return -ENODEV;
29630 - }
29631 -
29632 - /*
29633 - * grab device's exclusive_access mutex to prevent its driver from
29634 - * using this device while it is being accessed by us.
29635 - */
29636 - down(&ps->dev->exclusive_access);
29637 + int ret;
29638
29639 switch (cmd) {
29640 case USBDEVFS_CONTROL:
29641 @@ -1194,14 +1182,6 @@
29642 inode->i_mtime = CURRENT_TIME;
29643 break;
29644
29645 - case USBDEVFS_GETDRIVER:
29646 - ret = proc_getdriver(ps, (void *)arg);
29647 - break;
29648 -
29649 - case USBDEVFS_CONNECTINFO:
29650 - ret = proc_connectinfo(ps, (void *)arg);
29651 - break;
29652 -
29653 case USBDEVFS_SETINTERFACE:
29654 ret = proc_setintf(ps, (void *)arg);
29655 break;
29656 @@ -1220,6 +1200,53 @@
29657 ret = proc_unlinkurb(ps, (void *)arg);
29658 break;
29659
29660 + case USBDEVFS_CLAIMINTERFACE:
29661 + ret = proc_claiminterface(ps, (void *)arg);
29662 + break;
29663 +
29664 + case USBDEVFS_RELEASEINTERFACE:
29665 + ret = proc_releaseinterface(ps, (void *)arg);
29666 + break;
29667 +
29668 + case USBDEVFS_IOCTL:
29669 + ret = proc_ioctl(ps, (void *) arg);
29670 + break;
29671 +
29672 + default:
29673 + ret = -ENOTTY;
29674 + }
29675 + return ret;
29676 +}
29677 +
29678 +static int usbdev_ioctl(struct inode *inode, struct file *file,
29679 + unsigned int cmd, unsigned long arg)
29680 +{
29681 + struct dev_state *ps = file->private_data;
29682 + int ret;
29683 +
29684 + if (!(file->f_mode & FMODE_WRITE))
29685 + return -EPERM;
29686 + down_read(&ps->devsem);
29687 + if (!ps->dev) {
29688 + up_read(&ps->devsem);
29689 + return -ENODEV;
29690 + }
29691 +
29692 + /*
29693 + * Some ioctls don't touch the device and can be called without
29694 + * grabbing its exclusive_access mutex; they are handled in this
29695 + * switch. Other ioctls which need exclusive_access are handled in
29696 + * usbdev_ioctl_exclusive().
29697 + */
29698 + switch (cmd) {
29699 + case USBDEVFS_GETDRIVER:
29700 + ret = proc_getdriver(ps, (void *)arg);
29701 + break;
29702 +
29703 + case USBDEVFS_CONNECTINFO:
29704 + ret = proc_connectinfo(ps, (void *)arg);
29705 + break;
29706 +
29707 case USBDEVFS_REAPURB:
29708 ret = proc_reapurb(ps, (void *)arg);
29709 break;
29710 @@ -1232,19 +1259,28 @@
29711 ret = proc_disconnectsignal(ps, (void *)arg);
29712 break;
29713
29714 + case USBDEVFS_CONTROL:
29715 + case USBDEVFS_BULK:
29716 + case USBDEVFS_RESETEP:
29717 + case USBDEVFS_RESET:
29718 + case USBDEVFS_CLEAR_HALT:
29719 + case USBDEVFS_SETINTERFACE:
29720 + case USBDEVFS_SETCONFIGURATION:
29721 + case USBDEVFS_SUBMITURB:
29722 + case USBDEVFS_DISCARDURB:
29723 case USBDEVFS_CLAIMINTERFACE:
29724 - ret = proc_claiminterface(ps, (void *)arg);
29725 - break;
29726 -
29727 case USBDEVFS_RELEASEINTERFACE:
29728 - ret = proc_releaseinterface(ps, (void *)arg);
29729 - break;
29730 -
29731 case USBDEVFS_IOCTL:
29732 - ret = proc_ioctl(ps, (void *) arg);
29733 + ret = -ERESTARTSYS;
29734 + if (down_interruptible(&ps->dev->exclusive_access) == 0) {
29735 + ret = usbdev_ioctl_exclusive(ps, inode, cmd, arg);
29736 + up(&ps->dev->exclusive_access);
29737 + }
29738 break;
29739 +
29740 + default:
29741 + ret = -ENOTTY;
29742 }
29743 - up(&ps->dev->exclusive_access);
29744 up_read(&ps->devsem);
29745 if (ret >= 0)
29746 inode->i_atime = CURRENT_TIME;
29747 diff -Nur linux-2.4.29/drivers/usb/hid-core.c linux-mips/drivers/usb/hid-core.c
29748 --- linux-2.4.29/drivers/usb/hid-core.c 2004-11-17 12:54:21.000000000 +0100
29749 +++ linux-mips/drivers/usb/hid-core.c 2005-03-26 11:47:35.374845916 +0100
29750 @@ -1064,18 +1064,31 @@
29751 static void hid_ctrl(struct urb *urb)
29752 {
29753 struct hid_device *hid = urb->context;
29754 + unsigned long flags;
29755
29756 if (urb->status)
29757 warn("ctrl urb status %d received", urb->status);
29758
29759 + spin_lock_irqsave(&hid->outlock, flags);
29760 +
29761 hid->outtail = (hid->outtail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
29762
29763 - if (hid->outhead != hid->outtail)
29764 - hid_submit_out(hid);
29765 + if (hid->outhead != hid->outtail) {
29766 + if (hid_submit_out(hid)) {
29767 + clear_bit(HID_OUT_RUNNING, &hid->iofl);
29768 + }
29769 + spin_unlock_irqrestore(&hid->outlock, flags);
29770 + return;
29771 + }
29772 +
29773 + clear_bit(HID_OUT_RUNNING, &hid->iofl);
29774 + spin_unlock_irqrestore(&hid->outlock, flags);
29775 }
29776
29777 void hid_write_report(struct hid_device *hid, struct hid_report *report)
29778 {
29779 + unsigned long flags;
29780 +
29781 if (hid->report_enum[report->type].numbered) {
29782 hid->out[hid->outhead].buffer[0] = report->id;
29783 hid_output_report(report, hid->out[hid->outhead].buffer + 1);
29784 @@ -1087,13 +1100,18 @@
29785
29786 hid->out[hid->outhead].dr.wValue = cpu_to_le16(((report->type + 1) << 8) | report->id);
29787
29788 + spin_lock_irqsave(&hid->outlock, flags);
29789 +
29790 hid->outhead = (hid->outhead + 1) & (HID_CONTROL_FIFO_SIZE - 1);
29791
29792 if (hid->outhead == hid->outtail)
29793 hid->outtail = (hid->outtail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
29794
29795 - if (hid->urbout.status != -EINPROGRESS)
29796 - hid_submit_out(hid);
29797 + if (!test_and_set_bit(HID_OUT_RUNNING, &hid->iofl))
29798 + if (hid_submit_out(hid))
29799 + clear_bit(HID_OUT_RUNNING, &hid->iofl);
29800 +
29801 + spin_unlock_irqrestore(&hid->outlock, flags);
29802 }
29803
29804 int hid_open(struct hid_device *hid)
29805 @@ -1333,6 +1351,8 @@
29806 return NULL;
29807 }
29808
29809 + spin_lock_init(&hid->outlock);
29810 +
29811 hid->version = hdesc->bcdHID;
29812 hid->country = hdesc->bCountryCode;
29813 hid->dev = dev;
29814 diff -Nur linux-2.4.29/drivers/usb/hiddev.c linux-mips/drivers/usb/hiddev.c
29815 --- linux-2.4.29/drivers/usb/hiddev.c 2004-08-08 01:26:05.000000000 +0200
29816 +++ linux-mips/drivers/usb/hiddev.c 2005-03-26 11:47:35.743785364 +0100
29817 @@ -328,6 +328,7 @@
29818 }
29819
29820 schedule();
29821 + set_current_state(TASK_INTERRUPTIBLE);
29822 }
29823
29824 set_current_state(TASK_RUNNING);
29825 diff -Nur linux-2.4.29/drivers/usb/hid.h linux-mips/drivers/usb/hid.h
29826 --- linux-2.4.29/drivers/usb/hid.h 2003-08-25 13:44:42.000000000 +0200
29827 +++ linux-mips/drivers/usb/hid.h 2005-03-26 11:47:35.742785528 +0100
29828 @@ -302,6 +302,8 @@
29829 #define HID_CLAIMED_INPUT 1
29830 #define HID_CLAIMED_HIDDEV 2
29831
29832 +#define HID_OUT_RUNNING 2
29833 +
29834 struct hid_input {
29835 struct list_head list;
29836 struct hid_report *report;
29837 @@ -322,12 +324,15 @@
29838 struct usb_device *dev; /* USB device */
29839 int ifnum; /* USB interface number */
29840
29841 + unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
29842 +
29843 struct urb urb; /* USB URB structure */
29844 char buffer[HID_BUFFER_SIZE]; /* Rx buffer */
29845
29846 struct urb urbout; /* Output URB */
29847 struct hid_control_fifo out[HID_CONTROL_FIFO_SIZE]; /* Transmit buffer */
29848 unsigned char outhead, outtail; /* Tx buffer head & tail */
29849 + spinlock_t outlock; /* Output fifo spinlock */
29850
29851 unsigned claimed; /* Claimed by hidinput, hiddev? */
29852 unsigned quirks; /* Various quirks the device can pull on us */
29853 diff -Nur linux-2.4.29/drivers/usb/serial/ftdi_sio.c linux-mips/drivers/usb/serial/ftdi_sio.c
29854 --- linux-2.4.29/drivers/usb/serial/ftdi_sio.c 2005-01-19 15:10:07.000000000 +0100
29855 +++ linux-mips/drivers/usb/serial/ftdi_sio.c 2005-03-26 11:47:35.754783559 +0100
29856 @@ -737,8 +737,6 @@
29857 };
29858
29859
29860 -
29861 -
29862 static struct usb_serial_device_type ftdi_userdev_device = {
29863 .owner = THIS_MODULE,
29864 .name = "FTDI SIO compatible",
29865 @@ -1240,15 +1238,6 @@
29866 } /* ftdi_HE_TIRA1_startup */
29867
29868
29869 -/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
29870 - * it is called when the usb device is disconnected
29871 - *
29872 - * usbserial:usb_serial_disconnect
29873 - * calls __serial_close for each open of the port
29874 - * shutdown is called then (ie ftdi_shutdown)
29875 - */
29876 -
29877 -
29878 /* Startup for the 8U232AM chip */
29879 static int ftdi_userdev_startup (struct usb_serial *serial)
29880 {
29881 @@ -1273,6 +1262,14 @@
29882 }
29883
29884
29885 +/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
29886 + * it is called when the usb device is disconnected
29887 + *
29888 + * usbserial:usb_serial_disconnect
29889 + * calls __serial_close for each open of the port
29890 + * shutdown is called then (ie ftdi_shutdown)
29891 + */
29892 +
29893 static void ftdi_shutdown (struct usb_serial *serial)
29894 { /* ftdi_shutdown */
29895
29896 @@ -1382,6 +1379,7 @@
29897 struct usb_serial *serial;
29898 unsigned int c_cflag = port->tty->termios->c_cflag;
29899 char buf[1];
29900 + int err;
29901
29902 dbg("%s", __FUNCTION__);
29903
29904 @@ -1412,8 +1410,9 @@
29905
29906 /* shutdown our bulk read */
29907 if (port->read_urb) {
29908 - if(usb_unlink_urb (port->read_urb)<0)
29909 - err("Error unlinking urb");
29910 + err = usb_unlink_urb (port->read_urb);
29911 + if (err < 0 && err != -ENODEV)
29912 + err("Error unlinking urb (%d)", err);
29913 }
29914 /* unlink the running write urbs */
29915
29916 diff -Nur linux-2.4.29/drivers/usb/serial/mct_u232.c linux-mips/drivers/usb/serial/mct_u232.c
29917 --- linux-2.4.29/drivers/usb/serial/mct_u232.c 2005-01-19 15:10:08.000000000 +0100
29918 +++ linux-mips/drivers/usb/serial/mct_u232.c 2005-03-26 11:47:35.755783395 +0100
29919 @@ -86,26 +86,14 @@
29920 #include "usb-serial.h"
29921 #include "mct_u232.h"
29922
29923 -
29924 /*
29925 * Version Information
29926 */
29927 -#define DRIVER_VERSION "v1.2"
29928 +#define DRIVER_VERSION "z2.0" /* Linux in-kernel version */
29929 #define DRIVER_AUTHOR "Wolfgang Grandegger <wolfgang@ces.ch>"
29930 #define DRIVER_DESC "Magic Control Technology USB-RS232 converter driver"
29931
29932 /*
29933 - * Some not properly written applications do not handle the return code of
29934 - * write() correctly. This can result in character losses. A work-a-round
29935 - * can be compiled in with the following definition. This work-a-round
29936 - * should _NOT_ be part of an 'official' kernel release, of course!
29937 - */
29938 -#undef FIX_WRITE_RETURN_CODE_PROBLEM
29939 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
29940 -static int write_blocking; /* disabled by default */
29941 -#endif
29942 -
29943 -/*
29944 * Function prototypes
29945 */
29946 static int mct_u232_startup (struct usb_serial *serial);
29947 @@ -114,13 +102,6 @@
29948 struct file *filp);
29949 static void mct_u232_close (struct usb_serial_port *port,
29950 struct file *filp);
29951 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
29952 -static int mct_u232_write (struct usb_serial_port *port,
29953 - int from_user,
29954 - const unsigned char *buf,
29955 - int count);
29956 -static void mct_u232_write_bulk_callback (struct urb *urb);
29957 -#endif
29958 static void mct_u232_read_int_callback (struct urb *urb);
29959 static void mct_u232_set_termios (struct usb_serial_port *port,
29960 struct termios * old);
29961 @@ -147,7 +128,7 @@
29962
29963 static struct usb_serial_device_type mct_u232_device = {
29964 .owner = THIS_MODULE,
29965 - .name = "Magic Control Technology USB-RS232",
29966 + .name = "MCT U232",
29967 .id_table = id_table_combined,
29968 .num_interrupt_in = 2,
29969 .num_bulk_in = 0,
29970 @@ -155,10 +136,6 @@
29971 .num_ports = 1,
29972 .open = mct_u232_open,
29973 .close = mct_u232_close,
29974 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
29975 - .write = mct_u232_write,
29976 - .write_bulk_callback = mct_u232_write_bulk_callback,
29977 -#endif
29978 .read_int_callback = mct_u232_read_int_callback,
29979 .ioctl = mct_u232_ioctl,
29980 .set_termios = mct_u232_set_termios,
29981 @@ -167,9 +144,14 @@
29982 .shutdown = mct_u232_shutdown,
29983 };
29984
29985 +struct mct_u232_interval_kludge {
29986 + int ecnt; /* Error counter */
29987 + int ibase; /* Initial interval value */
29988 +};
29989
29990 struct mct_u232_private {
29991 spinlock_t lock;
29992 + struct mct_u232_interval_kludge ik[2];
29993 unsigned int control_state; /* Modem Line Setting (TIOCM) */
29994 unsigned char last_lcr; /* Line Control Register */
29995 unsigned char last_lsr; /* Line Status Register */
29996 @@ -359,17 +341,13 @@
29997 struct mct_u232_private *priv;
29998 struct usb_serial_port *port, *rport;
29999
30000 - /* allocate the private data structure */
30001 priv = kmalloc(sizeof(struct mct_u232_private), GFP_KERNEL);
30002 if (!priv)
30003 return -ENOMEM;
30004 - /* set initial values for control structures */
30005 + memset(priv, 0, sizeof(struct mct_u232_private));
30006 spin_lock_init(&priv->lock);
30007 - priv->control_state = 0;
30008 - priv->last_lsr = 0;
30009 - priv->last_msr = 0;
30010 serial->port->private = priv;
30011 -
30012 +
30013 init_waitqueue_head(&serial->port->write_wait);
30014
30015 /* Puh, that's dirty */
30016 @@ -383,20 +361,27 @@
30017 rport->interrupt_in_urb = NULL;
30018 port->read_urb->context = port;
30019
30020 + priv->ik[0].ibase = port->read_urb->interval;
30021 + priv->ik[1].ibase = port->interrupt_in_urb->interval;
30022 +
30023 return (0);
30024 } /* mct_u232_startup */
30025
30026
30027 static void mct_u232_shutdown (struct usb_serial *serial)
30028 {
30029 + struct mct_u232_private *priv;
30030 int i;
30031
30032 dbg("%s", __FUNCTION__);
30033
30034 for (i=0; i < serial->num_ports; ++i) {
30035 /* My special items, the standard routines free my urbs */
30036 - if (serial->port[i].private)
30037 - kfree(serial->port[i].private);
30038 + priv = serial->port[i].private;
30039 + if (priv) {
30040 + serial->port[i].private = NULL;
30041 + kfree(priv);
30042 + }
30043 }
30044 } /* mct_u232_shutdown */
30045
30046 @@ -448,16 +433,20 @@
30047 spin_unlock_irqrestore(&priv->lock, flags);
30048
30049 port->read_urb->dev = port->serial->dev;
30050 + port->read_urb->interval = priv->ik[0].ibase;
30051 retval = usb_submit_urb(port->read_urb);
30052 if (retval) {
30053 - err("usb_submit_urb(read bulk) failed");
30054 + err("usb_submit_urb(read bulk) failed pipe 0x%x err %d",
30055 + port->read_urb->pipe, retval);
30056 goto exit;
30057 }
30058
30059 port->interrupt_in_urb->dev = port->serial->dev;
30060 + port->interrupt_in_urb->interval = priv->ik[1].ibase;
30061 retval = usb_submit_urb(port->interrupt_in_urb);
30062 if (retval)
30063 - err(" usb_submit_urb(read int) failed");
30064 + err(" usb_submit_urb(read int) failed pipe 0x%x err %d",
30065 + port->interrupt_in_urb->pipe, retval);
30066
30067 exit:
30068 return 0;
30069 @@ -476,109 +465,22 @@
30070 }
30071 } /* mct_u232_close */
30072
30073 -
30074 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
30075 -/* The generic routines work fine otherwise */
30076 -
30077 -static int mct_u232_write (struct usb_serial_port *port, int from_user,
30078 - const unsigned char *buf, int count)
30079 +static void mct_u232_error_step (struct urb *urb,
30080 + struct mct_u232_private *priv, int n)
30081 {
30082 - struct usb_serial *serial = port->serial;
30083 - int result, bytes_sent, size;
30084 -
30085 - dbg("%s - port %d", __FUNCTION__, port->number);
30086 -
30087 - if (count == 0) {
30088 - dbg("%s - write request of 0 bytes", __FUNCTION__);
30089 - return (0);
30090 - }
30091 -
30092 - /* only do something if we have a bulk out endpoint */
30093 - if (!serial->num_bulk_out)
30094 - return(0);;
30095 -
30096 - /* another write is still pending? */
30097 - if (port->write_urb->status == -EINPROGRESS) {
30098 - dbg("%s - already writing", __FUNCTION__);
30099 - return (0);
30100 - }
30101 -
30102 - bytes_sent = 0;
30103 - while (count > 0) {
30104 - size = (count > port->bulk_out_size) ? port->bulk_out_size : count;
30105 -
30106 - usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf);
30107 -
30108 - if (from_user) {
30109 - if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) {
30110 - return -EFAULT;
30111 - }
30112 - }
30113 - else {
30114 - memcpy (port->write_urb->transfer_buffer, buf, size);
30115 - }
30116 -
30117 - /* set up our urb */
30118 - FILL_BULK_URB(port->write_urb, serial->dev,
30119 - usb_sndbulkpipe(serial->dev,
30120 - port->bulk_out_endpointAddress),
30121 - port->write_urb->transfer_buffer, size,
30122 - ((serial->type->write_bulk_callback) ?
30123 - serial->type->write_bulk_callback :
30124 - mct_u232_write_bulk_callback),
30125 - port);
30126 -
30127 - /* send the data out the bulk port */
30128 - result = usb_submit_urb(port->write_urb);
30129 - if (result) {
30130 - err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
30131 - return result;
30132 - }
30133 -
30134 - bytes_sent += size;
30135 - if (write_blocking)
30136 - interruptible_sleep_on(&port->write_wait);
30137 - else
30138 - break;
30139 -
30140 - buf += size;
30141 - count -= size;
30142 - }
30143 -
30144 - return bytes_sent;
30145 -} /* mct_u232_write */
30146 -
30147 -static void mct_u232_write_bulk_callback (struct urb *urb)
30148 -{
30149 - struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
30150 - struct usb_serial *serial = port->serial;
30151 - struct tty_struct *tty = port->tty;
30152 -
30153 - dbg("%s - port %d", __FUNCTION__, port->number);
30154 -
30155 - if (!serial) {
30156 - dbg("%s - bad serial pointer, exiting", __FUNCTION__);
30157 - return;
30158 - }
30159 + struct mct_u232_interval_kludge *ikp = &priv->ik[n];
30160
30161 - if (urb->status) {
30162 - dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
30163 - urb->status);
30164 - return;
30165 - }
30166 -
30167 - if (write_blocking) {
30168 - wake_up_interruptible(&port->write_wait);
30169 - tty_wakeup(tty);
30170 + if (ikp->ecnt >= 2) {
30171 + if (urb->interval)
30172 + err("%s - too many errors: "
30173 + "status %d pipe 0x%x interval %d",
30174 + __FUNCTION__,
30175 + urb->status, urb->pipe, urb->interval);
30176 + urb->interval = 0;
30177 } else {
30178 - /* from generic_write_bulk_callback */
30179 - queue_task(&port->tqueue, &tq_immediate);
30180 - mark_bh(IMMEDIATE_BH);
30181 + ++ikp->ecnt;
30182 }
30183 -
30184 - return;
30185 -} /* mct_u232_write_bulk_callback */
30186 -#endif
30187 +}
30188
30189 static void mct_u232_read_int_callback (struct urb *urb)
30190 {
30191 @@ -589,21 +491,37 @@
30192 unsigned char *data = urb->transfer_buffer;
30193 unsigned long flags;
30194
30195 - dbg("%s - port %d", __FUNCTION__, port->number);
30196 -
30197 /* The urb might have been killed. */
30198 if (urb->status) {
30199 - dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
30200 - urb->status);
30201 + dbg("%s - nonzero status %d, pipe 0x%x flags 0x%x interval %d",
30202 + __FUNCTION__,
30203 + urb->status, urb->pipe, urb->transfer_flags, urb->interval);
30204 + /*
30205 + * The bad stuff happens when a device is disconnected.
30206 + * This can cause us to spin while trying to resubmit.
30207 + * Unfortunately, in kernel 2.4 error codes are wildly
30208 + * different between controllers, so the status is useless.
30209 + * Instead we just refuse to spin too much.
30210 + */
30211 + if (urb == port->read_urb)
30212 + mct_u232_error_step(urb, priv, 0);
30213 + if (urb == port->interrupt_in_urb)
30214 + mct_u232_error_step(urb, priv, 1);
30215 return;
30216 }
30217 if (!serial) {
30218 dbg("%s - bad serial pointer, exiting", __FUNCTION__);
30219 return;
30220 }
30221 -
30222 +
30223 + dbg("%s - port %d", __FUNCTION__, port->number);
30224 usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
30225
30226 + if (urb == port->read_urb)
30227 + priv->ik[0].ecnt = 0;
30228 + if (urb == port->interrupt_in_urb)
30229 + priv->ik[1].ecnt = 0;
30230 +
30231 /*
30232 * Work-a-round: handle the 'usual' bulk-in pipe here
30233 */
30234 @@ -660,7 +578,6 @@
30235 /* INT urbs are automatically re-submitted */
30236 } /* mct_u232_read_int_callback */
30237
30238 -
30239 static void mct_u232_set_termios (struct usb_serial_port *port,
30240 struct termios *old_termios)
30241 {
30242 @@ -781,6 +698,21 @@
30243 } /* mct_u232_break_ctl */
30244
30245
30246 +static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file)
30247 +{
30248 + struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
30249 + unsigned int control_state;
30250 + unsigned long flags;
30251 +
30252 + dbg("%s", __FUNCTION__);
30253 +
30254 + spin_lock_irqsave(&priv->lock, flags);
30255 + control_state = priv->control_state;
30256 + spin_unlock_irqrestore(&priv->lock, flags);
30257 +
30258 + return control_state;
30259 +}
30260 +
30261 static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
30262 unsigned int cmd, unsigned long arg)
30263 {
30264 @@ -794,8 +726,8 @@
30265 /* Based on code from acm.c and others */
30266 switch (cmd) {
30267 case TIOCMGET:
30268 - return put_user(priv->control_state, (unsigned long *) arg);
30269 - break;
30270 + mask = mct_u232_tiocmget(port, file);
30271 + return put_user(mask, (unsigned long *) arg);
30272
30273 case TIOCMSET: /* Turns on and off the lines as specified by the mask */
30274 case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
30275 @@ -865,12 +797,5 @@
30276 MODULE_DESCRIPTION( DRIVER_DESC );
30277 MODULE_LICENSE("GPL");
30278
30279 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
30280 -MODULE_PARM(write_blocking, "i");
30281 -MODULE_PARM_DESC(write_blocking,
30282 - "The write function will block to write out all data");
30283 -#endif
30284 -
30285 MODULE_PARM(debug, "i");
30286 MODULE_PARM_DESC(debug, "Debug enabled or not");
30287 -
30288 diff -Nur linux-2.4.29/drivers/usb/storage/transport.c linux-mips/drivers/usb/storage/transport.c
30289 --- linux-2.4.29/drivers/usb/storage/transport.c 2004-11-17 12:54:21.000000000 +0100
30290 +++ linux-mips/drivers/usb/storage/transport.c 2005-03-26 11:47:35.757783067 +0100
30291 @@ -1181,6 +1181,13 @@
30292
30293 /* if the command transfered well, then we go to the data stage */
30294 if (result == 0) {
30295 +
30296 + /* Genesys Logic interface chips need a 100us delay between
30297 + * the command phase and the data phase. Some systems need
30298 + * even more, probably because of clock rate inaccuracies. */
30299 + if (us->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS)
30300 + udelay(110);
30301 +
30302 /* send/receive data payload, if there is any */
30303 if (bcb->DataTransferLength) {
30304 usb_stor_transfer(srb, us);
30305 diff -Nur linux-2.4.29/drivers/usb/storage/usb.c linux-mips/drivers/usb/storage/usb.c
30306 --- linux-2.4.29/drivers/usb/storage/usb.c 2004-11-17 12:54:21.000000000 +0100
30307 +++ linux-mips/drivers/usb/storage/usb.c 2005-03-26 11:47:35.758782903 +0100
30308 @@ -996,6 +996,15 @@
30309 */
30310 ss->htmplt.proc_dir = (void *)ss;
30311
30312 + /* According to the technical support people at Genesys Logic,
30313 + * devices using their chips have problems transferring more
30314 + * than 32 KB at a time. In practice people have found that
30315 + * 64 KB works okay and that's what Windows does. But we'll
30316 + * be conservative.
30317 + */
30318 + if (ss->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS)
30319 + ss->htmplt.max_sectors = 64;
30320 +
30321 /* Just before we start our control thread, initialize
30322 * the device if it needs initialization */
30323 if (unusual_dev && unusual_dev->initFunction)
30324 diff -Nur linux-2.4.29/drivers/usb/storage/usb.h linux-mips/drivers/usb/storage/usb.h
30325 --- linux-2.4.29/drivers/usb/storage/usb.h 2004-08-08 01:26:05.000000000 +0200
30326 +++ linux-mips/drivers/usb/storage/usb.h 2005-03-26 11:47:35.759782739 +0100
30327 @@ -193,4 +193,7 @@
30328 /* Function to fill an inquiry response. See usb.c for details */
30329 extern void fill_inquiry_response(struct us_data *us,
30330 unsigned char *data, unsigned int data_len);
30331 +
30332 +/* Vendor ID list for devices that require special handling */
30333 +#define USB_VENDOR_ID_GENESYS 0x05e3 /* Genesys Logic */
30334 #endif
30335 diff -Nur linux-2.4.29/drivers/video/au1200fb.c linux-mips/drivers/video/au1200fb.c
30336 --- linux-2.4.29/drivers/video/au1200fb.c 1970-01-01 01:00:00.000000000 +0100
30337 +++ linux-mips/drivers/video/au1200fb.c 2005-03-13 09:04:16.000000000 +0100
30338 @@ -0,0 +1,1564 @@
30339 +/*
30340 + * BRIEF MODULE DESCRIPTION
30341 + * Au1200 LCD Driver.
30342 + *
30343 + * Copyright 2004 AMD
30344 + * Author: AMD
30345 + *
30346 + * Based on:
30347 + * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
30348 + * Created 28 Dec 1997 by Geert Uytterhoeven
30349 + *
30350 + * This program is free software; you can redistribute it and/or modify it
30351 + * under the terms of the GNU General Public License as published by the
30352 + * Free Software Foundation; either version 2 of the License, or (at your
30353 + * option) any later version.
30354 + *
30355 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
30356 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30357 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
30358 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30359 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30360 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30361 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30362 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30363 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30364 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30365 + *
30366 + * You should have received a copy of the GNU General Public License along
30367 + * with this program; if not, write to the Free Software Foundation, Inc.,
30368 + * 675 Mass Ave, Cambridge, MA 02139, USA.
30369 + */
30370 +
30371 +#include <linux/module.h>
30372 +#include <linux/kernel.h>
30373 +#include <linux/errno.h>
30374 +#include <linux/string.h>
30375 +#include <linux/mm.h>
30376 +#include <linux/tty.h>
30377 +#include <linux/slab.h>
30378 +#include <linux/delay.h>
30379 +#include <linux/fb.h>
30380 +#include <linux/init.h>
30381 +#include <asm/uaccess.h>
30382 +
30383 +#include <asm/au1000.h>
30384 +#include <asm/au1xxx_gpio.h>
30385 +#include "au1200fb.h"
30386 +
30387 +#include <video/fbcon.h>
30388 +#include <video/fbcon-cfb16.h>
30389 +#include <video/fbcon-cfb32.h>
30390 +#define CMAPSIZE 16
30391 +
30392 +#define AU1200_LCD_GET_WINENABLE 1
30393 +#define AU1200_LCD_SET_WINENABLE 2
30394 +#define AU1200_LCD_GET_WINLOCATION 3
30395 +#define AU1200_LCD_SET_WINLOCATION 4
30396 +#define AU1200_LCD_GET_WINSIZE 5
30397 +#define AU1200_LCD_SET_WINSIZE 6
30398 +#define AU1200_LCD_GET_BACKCOLOR 7
30399 +#define AU1200_LCD_SET_BACKCOLOR 8
30400 +#define AU1200_LCD_GET_COLORKEY 9
30401 +#define AU1200_LCD_SET_COLORKEY 10
30402 +#define AU1200_LCD_GET_PANEL 11
30403 +#define AU1200_LCD_SET_PANEL 12
30404 +
30405 +typedef struct au1200_lcd_getset_t
30406 +{
30407 + unsigned int subcmd;
30408 + union {
30409 + struct {
30410 + int enable;
30411 + } winenable;
30412 + struct {
30413 + int x, y;
30414 + } winlocation;
30415 + struct {
30416 + int hsz, vsz;
30417 + } winsize;
30418 + struct {
30419 + unsigned int color;
30420 + } backcolor;
30421 + struct {
30422 + unsigned int key;
30423 + unsigned int mask;
30424 + } colorkey;
30425 + struct {
30426 + int panel;
30427 + char desc[80];
30428 + } panel;
30429 + };
30430 +} au1200_lcd_getset_t;
30431 +
30432 +AU1200_LCD *lcd = (AU1200_LCD *)AU1200_LCD_ADDR;
30433 +static int window_index = 0; /* default is zero */
30434 +static int panel_index = -1; /* default is call board_au1200fb_panel */
30435 +
30436 +struct window_settings
30437 +{
30438 + unsigned char name[64];
30439 + uint32 mode_backcolor;
30440 + uint32 mode_colorkey;
30441 + uint32 mode_colorkeymsk;
30442 + struct
30443 + {
30444 + int xres;
30445 + int yres;
30446 + int xpos;
30447 + int ypos;
30448 + uint32 mode_winctrl1; /* winctrl1[FRM,CCO,PO,PIPE] */
30449 + uint32 mode_winenable;
30450 + } w[4];
30451 +};
30452 +
30453 +struct panel_settings
30454 +{
30455 + unsigned char name[64];
30456 + /* panel physical dimensions */
30457 + uint32 Xres;
30458 + uint32 Yres;
30459 + /* panel timings */
30460 + uint32 mode_screen;
30461 + uint32 mode_horztiming;
30462 + uint32 mode_verttiming;
30463 + uint32 mode_clkcontrol;
30464 + uint32 mode_pwmdiv;
30465 + uint32 mode_pwmhi;
30466 + uint32 mode_outmask;
30467 + uint32 mode_fifoctrl;
30468 + uint32 mode_toyclksrc;
30469 + uint32 mode_backlight;
30470 + uint32 mode_auxpll;
30471 + int (*device_init)(void);
30472 + int (*device_shutdown)(void);
30473 +};
30474 +
30475 +#if defined(__BIG_ENDIAN)
30476 +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_00
30477 +#else
30478 +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_01
30479 +#endif
30480 +
30481 +extern int board_au1200fb_panel (void);
30482 +extern int board_au1200fb_panel_init (void);
30483 +extern int board_au1200fb_panel_shutdown (void);
30484 +
30485 +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
30486 +extern int board_au1200fb_focus_init_hdtv(void);
30487 +extern int board_au1200fb_focus_init_component(void);
30488 +extern int board_au1200fb_focus_init_cvsv(void);
30489 +extern int board_au1200fb_focus_shutdown(void);
30490 +#endif
30491 +
30492 +/*
30493 + * Default window configurations
30494 + */
30495 +static struct window_settings windows[] =
30496 +{
30497 + { /* Index 0 */
30498 + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
30499 + /* mode_backcolor */ 0x006600ff,
30500 + /* mode_colorkey,msk*/ 0, 0,
30501 + {
30502 + {
30503 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30504 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30505 + /* mode_winenable*/ LCD_WINENABLE_WEN0,
30506 + },
30507 + {
30508 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30509 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30510 + /* mode_winenable*/ 0,
30511 + },
30512 + {
30513 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30514 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
30515 + /* mode_winenable*/ 0,
30516 + },
30517 + {
30518 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30519 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
30520 + /* mode_winenable*/ 0,
30521 + },
30522 + },
30523 + },
30524 +
30525 + { /* Index 1 */
30526 + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
30527 + /* mode_backcolor */ 0x006600ff,
30528 + /* mode_colorkey,msk*/ 0, 0,
30529 + {
30530 + {
30531 + /* xres, yres, xpos, ypos */ 320, 240, 5, 5,
30532 +#if 0
30533 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30534 +#endif
30535 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_24BPP|LCD_WINCTRL1_PO_00,
30536 + /* mode_winenable*/ LCD_WINENABLE_WEN0,
30537 + },
30538 + {
30539 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30540 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30541 + /* mode_winenable*/ 0,
30542 + },
30543 + {
30544 + /* xres, yres, xpos, ypos */ 100, 100, 0, 0,
30545 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
30546 + /* mode_winenable*/ 0/*LCD_WINENABLE_WEN2*/,
30547 + },
30548 + {
30549 + /* xres, yres, xpos, ypos */ 200, 25, 0, 0,
30550 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
30551 + /* mode_winenable*/ 0,
30552 + },
30553 + },
30554 + },
30555 + /* Need VGA 640 @ 24bpp, @ 32bpp */
30556 + /* Need VGA 800 @ 24bpp, @ 32bpp */
30557 + /* Need VGA 1024 @ 24bpp, @ 32bpp */
30558 +} ;
30559 +
30560 +/*
30561 + * Controller configurations for various panels.
30562 + */
30563 +static struct panel_settings panels[] =
30564 +{
30565 + { /* Index 0: QVGA 320x240 H:33.3kHz V:110Hz */
30566 + "VGA_320x240",
30567 + 320, 240,
30568 + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
30569 + /* mode_horztiming */ 0x00c4623b,
30570 + /* mode_verttiming */ 0x00502814,
30571 + /* mode_clkcontrol */ 0x00020002, /* /4=24Mhz */
30572 + /* mode_pwmdiv */ 0x00000000,
30573 + /* mode_pwmhi */ 0x00000000,
30574 + /* mode_outmask */ 0x00FFFFFF,
30575 + /* mode_fifoctrl */ 0x2f2f2f2f,
30576 + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
30577 + /* mode_backlight */ 0x00000000,
30578 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30579 + /* device_init */ NULL,
30580 + /* device_shutdown */ NULL,
30581 + },
30582 +
30583 + { /* Index 1: VGA 640x480 H:30.3kHz V:58Hz */
30584 + "VGA_640x480",
30585 + 640, 480,
30586 + /* mode_screen */ 0x13f9df80,
30587 + /* mode_horztiming */ 0x003c5859,
30588 + /* mode_verttiming */ 0x00741201,
30589 + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
30590 + /* mode_pwmdiv */ 0x00000000,
30591 + /* mode_pwmhi */ 0x00000000,
30592 + /* mode_outmask */ 0x00FFFFFF,
30593 + /* mode_fifoctrl */ 0x2f2f2f2f,
30594 + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
30595 + /* mode_backlight */ 0x00000000,
30596 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30597 + /* device_init */ NULL,
30598 + /* device_shutdown */ NULL,
30599 + },
30600 +
30601 + { /* Index 2: SVGA 800x600 H:46.1kHz V:69Hz */
30602 + "SVGA_800x600",
30603 + 800, 600,
30604 + /* mode_screen */ 0x18fa5780,
30605 + /* mode_horztiming */ 0x00dc7e77,
30606 + /* mode_verttiming */ 0x00584805,
30607 + /* mode_clkcontrol */ 0x00020000, /* /2=48Mhz */
30608 + /* mode_pwmdiv */ 0x00000000,
30609 + /* mode_pwmhi */ 0x00000000,
30610 + /* mode_outmask */ 0x00FFFFFF,
30611 + /* mode_fifoctrl */ 0x2f2f2f2f,
30612 + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
30613 + /* mode_backlight */ 0x00000000,
30614 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30615 + /* device_init */ NULL,
30616 + /* device_shutdown */ NULL,
30617 + },
30618 +
30619 + { /* Index 3: XVGA 1024x768 H:56.2kHz V:70Hz */
30620 + "XVGA_1024x768",
30621 + 1024, 768,
30622 + /* mode_screen */ 0x1ffaff80,
30623 + /* mode_horztiming */ 0x007d0e57,
30624 + /* mode_verttiming */ 0x00740a01,
30625 + /* mode_clkcontrol */ 0x000A0000, /* /1 */
30626 + /* mode_pwmdiv */ 0x00000000,
30627 + /* mode_pwmhi */ 0x00000000,
30628 + /* mode_outmask */ 0x00FFFFFF,
30629 + /* mode_fifoctrl */ 0x2f2f2f2f,
30630 + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
30631 + /* mode_backlight */ 0x00000000,
30632 + /* mode_auxpll */ 6, /* 72MHz AUXPLL */
30633 + /* device_init */ NULL,
30634 + /* device_shutdown */ NULL,
30635 + },
30636 +
30637 + { /* Index 4: XVGA 1280x1024 H:68.5kHz V:65Hz */
30638 + "XVGA_1280x1024",
30639 + 1280, 1024,
30640 + /* mode_screen */ 0x27fbff80,
30641 + /* mode_horztiming */ 0x00cdb2c7,
30642 + /* mode_verttiming */ 0x00600002,
30643 + /* mode_clkcontrol */ 0x000A0000, /* /1 */
30644 + /* mode_pwmdiv */ 0x00000000,
30645 + /* mode_pwmhi */ 0x00000000,
30646 + /* mode_outmask */ 0x00FFFFFF,
30647 + /* mode_fifoctrl */ 0x2f2f2f2f,
30648 + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
30649 + /* mode_backlight */ 0x00000000,
30650 + /* mode_auxpll */ 10, /* 120MHz AUXPLL */
30651 + /* device_init */ NULL,
30652 + /* device_shutdown */ NULL,
30653 + },
30654 +
30655 + { /* Index 5: Samsung 1024x768 TFT */
30656 + "Samsung_1024x768_TFT",
30657 + 1024, 768,
30658 + /* mode_screen */ 0x1ffaff80,
30659 + /* mode_horztiming */ 0x018cc677,
30660 + /* mode_verttiming */ 0x00241217,
30661 + /* mode_clkcontrol */ 0x00000000, /* SCB 0x1 /4=24Mhz */
30662 + /* mode_pwmdiv */ 0x8000063f, /* SCB 0x0 */
30663 + /* mode_pwmhi */ 0x03400000, /* SCB 0x0 */
30664 + /* mode_outmask */ 0x00fcfcfc,
30665 + /* mode_fifoctrl */ 0x2f2f2f2f,
30666 + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
30667 + /* mode_backlight */ 0x00000000,
30668 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30669 + /* device_init */ board_au1200fb_panel_init,
30670 + /* device_shutdown */ board_au1200fb_panel_shutdown,
30671 + },
30672 +
30673 + { /* Index 6: Toshiba 640x480 TFT */
30674 + "Toshiba_640x480_TFT",
30675 + 640, 480,
30676 + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
30677 + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(96) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(51),
30678 + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(11) | LCD_VERTTIMING_VND2_N(32) ,
30679 + /* mode_clkcontrol */ 0x00000000, /* /4=24Mhz */
30680 + /* mode_pwmdiv */ 0x8000063f,
30681 + /* mode_pwmhi */ 0x03400000,
30682 + /* mode_outmask */ 0x00fcfcfc,
30683 + /* mode_fifoctrl */ 0x2f2f2f2f,
30684 + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
30685 + /* mode_backlight */ 0x00000000,
30686 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30687 + /* device_init */ board_au1200fb_panel_init,
30688 + /* device_shutdown */ board_au1200fb_panel_shutdown,
30689 + },
30690 +
30691 + { /* Index 7: Sharp 320x240 TFT */
30692 + "Sharp_320x240_TFT",
30693 + 320, 240,
30694 + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
30695 + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(60) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(2),
30696 + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(2) | LCD_VERTTIMING_VND2_N(5) ,
30697 + /* mode_clkcontrol */ LCD_CLKCONTROL_PCD_N(7), /* /16=6Mhz */
30698 + /* mode_pwmdiv */ 0x8000063f,
30699 + /* mode_pwmhi */ 0x03400000,
30700 + /* mode_outmask */ 0x00fcfcfc,
30701 + /* mode_fifoctrl */ 0x2f2f2f2f,
30702 + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
30703 + /* mode_backlight */ 0x00000000,
30704 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30705 + /* device_init */ board_au1200fb_panel_init,
30706 + /* device_shutdown */ board_au1200fb_panel_shutdown,
30707 + },
30708 + { /* Index 8: Toppoly TD070WGCB2 7" 854x480 TFT */
30709 + "Toppoly_TD070WGCB2",
30710 + 854, 480,
30711 + /* mode_screen */ LCD_SCREEN_SX_N(854) | LCD_SCREEN_SY_N(480),
30712 + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(44) | LCD_HORZTIMING_HND1_N(44) | LCD_HORZTIMING_HPW_N(114),
30713 + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(20) | LCD_VERTTIMING_VND1_N(21) | LCD_VERTTIMING_VPW_N(4),
30714 + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
30715 + /* mode_pwmdiv */ 0x8000063f,
30716 + /* mode_pwmhi */ 0x03400000,
30717 + /* mode_outmask */ 0x00FCFCFC,
30718 + /* mode_fifoctrl */ 0x2f2f2f2f,
30719 + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
30720 + /* mode_backlight */ 0x00000000,
30721 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30722 + /* device_init */ board_au1200fb_panel_init,
30723 + /* device_shutdown */ board_au1200fb_panel_shutdown,
30724 + },
30725 +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
30726 + { /* Index 9: Focus FS453 TV-Out 640x480 */
30727 + "FS453_640x480 (Composite/S-Video)",
30728 + 640, 480,
30729 + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
30730 + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
30731 + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
30732 + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
30733 + /* mode_pwmdiv */ 0x00000000,
30734 + /* mode_pwmhi */ 0x00000000,
30735 + /* mode_outmask */ 0x00FFFFFF,
30736 + /* mode_fifoctrl */ 0x2f2f2f2f,
30737 + /* mode_toyclksrc */ 0x00000000,
30738 + /* mode_backlight */ 0x00000000,
30739 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30740 + /* device_init */ board_au1200fb_focus_init_cvsv,
30741 + /* device_shutdown */ board_au1200fb_focus_shutdown,
30742 + },
30743 +
30744 + { /* Index 10: Focus FS453 TV-Out 640x480 */
30745 + "FS453_640x480 (Component Video)",
30746 + 640, 480,
30747 + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
30748 + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
30749 + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
30750 + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
30751 + /* mode_pwmdiv */ 0x00000000,
30752 + /* mode_pwmhi */ 0x00000000,
30753 + /* mode_outmask */ 0x00FFFFFF,
30754 + /* mode_fifoctrl */ 0x2f2f2f2f,
30755 + /* mode_toyclksrc */ 0x00000000,
30756 + /* mode_backlight */ 0x00000000,
30757 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30758 + /* device_init */ board_au1200fb_focus_init_component,
30759 + /* device_shutdown */ board_au1200fb_focus_shutdown,
30760 + },
30761 +
30762 + { /* Index 11: Focus FS453 TV-Out 640x480 */
30763 + "FS453_640x480 (HDTV)",
30764 + 720, 480,
30765 + /* mode_screen */ LCD_SCREEN_SX_N(720) | LCD_SCREEN_SY_N(480),
30766 + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(28) | LCD_HORZTIMING_HND1_N(46) | LCD_HORZTIMING_HPW_N(64),
30767 + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(7) | LCD_VERTTIMING_VND1_N(31) | LCD_VERTTIMING_VPW_N(7),
30768 + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
30769 + /* mode_pwmdiv */ 0x00000000,
30770 + /* mode_pwmhi */ 0x00000000,
30771 + /* mode_outmask */ 0x00FFFFFF,
30772 + /* mode_fifoctrl */ 0x2f2f2f2f,
30773 + /* mode_toyclksrc */ 0x00000000,
30774 + /* mode_backlight */ 0x00000000,
30775 + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
30776 + /* device_init */ board_au1200fb_focus_init_hdtv,
30777 + /* device_shutdown */ board_au1200fb_focus_shutdown,
30778 + },
30779 +#endif
30780 +};
30781 +
30782 +#define NUM_PANELS (sizeof(panels) / sizeof(struct panel_settings))
30783 +
30784 +static struct window_settings *win;
30785 +static struct panel_settings *panel;
30786 +
30787 +struct au1200fb_info {
30788 + struct fb_info_gen gen;
30789 + unsigned long fb_virt_start;
30790 + unsigned long fb_size;
30791 + unsigned long fb_phys;
30792 + int mmaped;
30793 + int nohwcursor;
30794 + int noblanking;
30795 +
30796 + struct { unsigned red, green, blue, pad; } palette[256];
30797 +
30798 +#if defined(FBCON_HAS_CFB16)
30799 + u16 fbcon_cmap16[16];
30800 +#endif
30801 +#if defined(FBCON_HAS_CFB32)
30802 + u32 fbcon_cmap32[16];
30803 +#endif
30804 +};
30805 +
30806 +
30807 +struct au1200fb_par {
30808 + struct fb_var_screeninfo var;
30809 +
30810 + int line_length; /* in bytes */
30811 + int cmap_len; /* color-map length */
30812 +};
30813 +
30814 +#ifndef CONFIG_FB_AU1200_DEVS
30815 +#define CONFIG_FB_AU1200_DEVS 1
30816 +#endif
30817 +
30818 +static struct au1200fb_info fb_infos[CONFIG_FB_AU1200_DEVS];
30819 +static struct au1200fb_par fb_pars[CONFIG_FB_AU1200_DEVS];
30820 +static struct display disps[CONFIG_FB_AU1200_DEVS];
30821 +
30822 +int au1200fb_init(void);
30823 +void au1200fb_setup(char *options, int *ints);
30824 +static int au1200fb_mmap(struct fb_info *fb, struct file *file,
30825 + struct vm_area_struct *vma);
30826 +static int au1200_blank(int blank_mode, struct fb_info_gen *info);
30827 +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
30828 + u_long arg, int con, struct fb_info *info);
30829 +
30830 +void au1200_nocursor(struct display *p, int mode, int xx, int yy){};
30831 +
30832 +static int au1200_setlocation (int plane, int xpos, int ypos);
30833 +static int au1200_setsize (int plane, int xres, int yres);
30834 +static void au1200_setmode(int plane);
30835 +static void au1200_setpanel (struct panel_settings *newpanel);
30836 +
30837 +static struct fb_ops au1200fb_ops = {
30838 + owner: THIS_MODULE,
30839 + fb_get_fix: fbgen_get_fix,
30840 + fb_get_var: fbgen_get_var,
30841 + fb_set_var: fbgen_set_var,
30842 + fb_get_cmap: fbgen_get_cmap,
30843 + fb_set_cmap: fbgen_set_cmap,
30844 + fb_pan_display: fbgen_pan_display,
30845 + fb_ioctl: au1200fb_ioctl,
30846 + fb_mmap: au1200fb_mmap,
30847 +};
30848 +
30849 +
30850 +static int
30851 +winbpp (unsigned int winctrl1)
30852 +{
30853 + /* how many bytes of memory are needed for each pixel format */
30854 + switch (winctrl1 & LCD_WINCTRL1_FRM)
30855 + {
30856 + case LCD_WINCTRL1_FRM_1BPP: return 1; break;
30857 + case LCD_WINCTRL1_FRM_2BPP: return 2; break;
30858 + case LCD_WINCTRL1_FRM_4BPP: return 4; break;
30859 + case LCD_WINCTRL1_FRM_8BPP: return 8; break;
30860 + case LCD_WINCTRL1_FRM_12BPP: return 16; break;
30861 + case LCD_WINCTRL1_FRM_16BPP655: return 16; break;
30862 + case LCD_WINCTRL1_FRM_16BPP565: return 16; break;
30863 + case LCD_WINCTRL1_FRM_16BPP556: return 16; break;
30864 + case LCD_WINCTRL1_FRM_16BPPI1555: return 16; break;
30865 + case LCD_WINCTRL1_FRM_16BPPI5551: return 16; break;
30866 + case LCD_WINCTRL1_FRM_16BPPA1555: return 16; break;
30867 + case LCD_WINCTRL1_FRM_16BPPA5551: return 16; break;
30868 + case LCD_WINCTRL1_FRM_24BPP: return 32; break;
30869 + case LCD_WINCTRL1_FRM_32BPP: return 32; break;
30870 + default: return 0; break;
30871 + }
30872 +}
30873 +
30874 +static int
30875 +fbinfo2index (struct fb_info *fb_info)
30876 +{
30877 + int i;
30878 + for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i)
30879 + {
30880 + if (fb_info == (struct fb_info *)(&fb_infos[i]))
30881 + return i;
30882 + }
30883 + printk("au1200fb: ERROR: fbinfo2index failed!\n");
30884 + return -1;
30885 +}
30886 +
30887 +static void au1200_detect(void)
30888 +{
30889 + /*
30890 + * This function should detect the current video mode settings
30891 + * and store it as the default video mode
30892 + * Yeh, well, we're not going to change any settings so we're
30893 + * always stuck with the default ...
30894 + */
30895 +}
30896 +
30897 +static int au1200_encode_fix(struct fb_fix_screeninfo *fix,
30898 + const void *_par, struct fb_info_gen *_info)
30899 +{
30900 + struct au1200fb_info *info = (struct au1200fb_info *) _info;
30901 + struct au1200fb_par *par = (struct au1200fb_par *) _par;
30902 + int plane;
30903 +
30904 + plane = fbinfo2index(info);
30905 +
30906 + memset(fix, 0, sizeof(struct fb_fix_screeninfo));
30907 +
30908 + fix->smem_start = info->fb_phys;
30909 + fix->smem_len = info->fb_size;
30910 + fix->type = FB_TYPE_PACKED_PIXELS;
30911 + fix->type_aux = 0;
30912 + fix->visual = (par->var.bits_per_pixel == 8) ?
30913 + FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
30914 + fix->ywrapstep = 0;
30915 + fix->xpanstep = 1;
30916 + fix->ypanstep = 1;
30917 + /* FIX!!!! why doesn't par->line_length work???? it does for au1100 */
30918 + fix->line_length = fb_pars[plane].line_length; /*par->line_length;*/
30919 + return 0;
30920 +}
30921 +
30922 +static void set_color_bitfields(struct fb_var_screeninfo *var, int plane)
30923 +{
30924 + if (var->bits_per_pixel == 8)
30925 + {
30926 + var->red.offset = 0;
30927 + var->red.length = 8;
30928 + var->green.offset = 0;
30929 + var->green.length = 8;
30930 + var->blue.offset = 0;
30931 + var->blue.length = 8;
30932 + var->transp.offset = 0;
30933 + var->transp.length = 0;
30934 + }
30935 + else
30936 +
30937 + if (var->bits_per_pixel == 16)
30938 + {
30939 + /* FIX!!! How does CCO affect this ? */
30940 + /* FIX!!! Not exactly sure how many of these work with FB */
30941 + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
30942 + {
30943 + case LCD_WINCTRL1_FRM_16BPP655:
30944 + var->red.offset = 10;
30945 + var->red.length = 6;
30946 + var->green.offset = 5;
30947 + var->green.length = 5;
30948 + var->blue.offset = 0;
30949 + var->blue.length = 5;
30950 + var->transp.offset = 0;
30951 + var->transp.length = 0;
30952 + break;
30953 +
30954 + case LCD_WINCTRL1_FRM_16BPP565:
30955 + var->red.offset = 11;
30956 + var->red.length = 5;
30957 + var->green.offset = 5;
30958 + var->green.length = 6;
30959 + var->blue.offset = 0;
30960 + var->blue.length = 5;
30961 + var->transp.offset = 0;
30962 + var->transp.length = 0;
30963 + break;
30964 +
30965 + case LCD_WINCTRL1_FRM_16BPP556:
30966 + var->red.offset = 11;
30967 + var->red.length = 5;
30968 + var->green.offset = 6;
30969 + var->green.length = 5;
30970 + var->blue.offset = 0;
30971 + var->blue.length = 6;
30972 + var->transp.offset = 0;
30973 + var->transp.length = 0;
30974 + break;
30975 +
30976 + case LCD_WINCTRL1_FRM_16BPPI1555:
30977 + var->red.offset = 10;
30978 + var->red.length = 5;
30979 + var->green.offset = 5;
30980 + var->green.length = 5;
30981 + var->blue.offset = 0;
30982 + var->blue.length = 5;
30983 + var->transp.offset = 0;
30984 + var->transp.length = 0;
30985 + break;
30986 +
30987 + case LCD_WINCTRL1_FRM_16BPPI5551:
30988 + var->red.offset = 11;
30989 + var->red.length = 5;
30990 + var->green.offset = 6;
30991 + var->green.length = 5;
30992 + var->blue.offset = 1;
30993 + var->blue.length = 5;
30994 + var->transp.offset = 0;
30995 + var->transp.length = 0;
30996 + break;
30997 +
30998 + case LCD_WINCTRL1_FRM_16BPPA1555:
30999 + var->red.offset = 10;
31000 + var->red.length = 5;
31001 + var->green.offset = 5;
31002 + var->green.length = 5;
31003 + var->blue.offset = 0;
31004 + var->blue.length = 5;
31005 + var->transp.offset = 15;
31006 + var->transp.length = 1;
31007 + break;
31008 +
31009 + case LCD_WINCTRL1_FRM_16BPPA5551:
31010 + var->red.offset = 11;
31011 + var->red.length = 5;
31012 + var->green.offset = 6;
31013 + var->green.length = 5;
31014 + var->blue.offset = 1;
31015 + var->blue.length = 5;
31016 + var->transp.offset = 0;
31017 + var->transp.length = 1;
31018 + break;
31019 +
31020 + default:
31021 + printk("ERROR: Invalid PIXEL FORMAT!!!\n"); break;
31022 + }
31023 + }
31024 + else
31025 +
31026 + if (var->bits_per_pixel == 32)
31027 + {
31028 + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
31029 + {
31030 + case LCD_WINCTRL1_FRM_24BPP:
31031 + var->red.offset = 16;
31032 + var->red.length = 8;
31033 + var->green.offset = 8;
31034 + var->green.length = 8;
31035 + var->blue.offset = 0;
31036 + var->blue.length = 8;
31037 + var->transp.offset = 0;
31038 + var->transp.length = 0;
31039 + break;
31040 +
31041 + case LCD_WINCTRL1_FRM_32BPP:
31042 + var->red.offset = 16;
31043 + var->red.length = 8;
31044 + var->green.offset = 8;
31045 + var->green.length = 8;
31046 + var->blue.offset = 0;
31047 + var->blue.length = 8;
31048 + var->transp.offset = 24;
31049 + var->transp.length = 8;
31050 + break;
31051 + }
31052 + }
31053 + var->red.msb_right = 0;
31054 + var->green.msb_right = 0;
31055 + var->blue.msb_right = 0;
31056 + var->transp.msb_right = 0;
31057 +#if 0
31058 +printk("set_color_bitfields(a=%d, r=%d..%d, g=%d..%d, b=%d..%d)\n",
31059 + var->transp.offset,
31060 + var->red.offset+var->red.length-1, var->red.offset,
31061 + var->green.offset+var->green.length-1, var->green.offset,
31062 + var->blue.offset+var->blue.length-1, var->blue.offset);
31063 +#endif
31064 +}
31065 +
31066 +static int au1200_decode_var(const struct fb_var_screeninfo *var,
31067 + void *_par, struct fb_info_gen *_info)
31068 +{
31069 + struct au1200fb_par *par = (struct au1200fb_par *)_par;
31070 + int plane, bpp;
31071 +
31072 + plane = fbinfo2index((struct fb_info *)_info);
31073 +
31074 + /*
31075 + * Don't allow setting any of these yet: xres and yres don't
31076 + * make sense for LCD panels.
31077 + */
31078 + if (var->xres != win->w[plane].xres ||
31079 + var->yres != win->w[plane].yres ||
31080 + var->xres != win->w[plane].xres ||
31081 + var->yres != win->w[plane].yres) {
31082 + return -EINVAL;
31083 + }
31084 +
31085 + bpp = winbpp(win->w[plane].mode_winctrl1);
31086 + if(var->bits_per_pixel != bpp) {
31087 + /* on au1200, window pixel format is independent of panel pixel */
31088 + printk("WARNING: bits_per_pizel != panel->bpp\n");
31089 + }
31090 +
31091 + memset(par, 0, sizeof(struct au1200fb_par));
31092 + par->var = *var;
31093 +
31094 + /* FIX!!! */
31095 + switch (var->bits_per_pixel) {
31096 + case 8:
31097 + par->var.bits_per_pixel = 8;
31098 + break;
31099 + case 16:
31100 + par->var.bits_per_pixel = 16;
31101 + break;
31102 + case 24:
31103 + case 32:
31104 + par->var.bits_per_pixel = 32;
31105 + break;
31106 + default:
31107 + printk("color depth %d bpp not supported\n",
31108 + var->bits_per_pixel);
31109 + return -EINVAL;
31110 +
31111 + }
31112 + set_color_bitfields(&par->var, plane);
31113 + /* FIX!!! what is this for 24/32bpp? */
31114 + par->cmap_len = (par->var.bits_per_pixel == 8) ? 256 : 16;
31115 + return 0;
31116 +}
31117 +
31118 +static int au1200_encode_var(struct fb_var_screeninfo *var,
31119 + const void *par, struct fb_info_gen *_info)
31120 +{
31121 + *var = ((struct au1200fb_par *)par)->var;
31122 + return 0;
31123 +}
31124 +
31125 +static void
31126 +au1200_get_par(void *_par, struct fb_info_gen *_info)
31127 +{
31128 + int index;
31129 +
31130 + index = fbinfo2index((struct fb_info *)_info);
31131 + *(struct au1200fb_par *)_par = fb_pars[index];
31132 +}
31133 +
31134 +static void au1200_set_par(const void *par, struct fb_info_gen *info)
31135 +{
31136 + /* nothing to do: we don't change any settings */
31137 +}
31138 +
31139 +static int au1200_getcolreg(unsigned regno, unsigned *red, unsigned *green,
31140 + unsigned *blue, unsigned *transp,
31141 + struct fb_info *info)
31142 +{
31143 + struct au1200fb_info* i = (struct au1200fb_info*)info;
31144 +
31145 + if (regno > 255)
31146 + return 1;
31147 +
31148 + *red = i->palette[regno].red;
31149 + *green = i->palette[regno].green;
31150 + *blue = i->palette[regno].blue;
31151 + *transp = 0;
31152 +
31153 + return 0;
31154 +}
31155 +
31156 +static int au1200_setcolreg(unsigned regno, unsigned red, unsigned green,
31157 + unsigned blue, unsigned transp,
31158 + struct fb_info *info)
31159 +{
31160 + struct au1200fb_info* i = (struct au1200fb_info *)info;
31161 + u32 rgbcol;
31162 + int plane, bpp;
31163 +
31164 + plane = fbinfo2index((struct fb_info *)info);
31165 + bpp = winbpp(win->w[plane].mode_winctrl1);
31166 +
31167 + if (regno > 255)
31168 + return 1;
31169 +
31170 + i->palette[regno].red = red;
31171 + i->palette[regno].green = green;
31172 + i->palette[regno].blue = blue;
31173 +
31174 + switch(bpp) {
31175 +#ifdef FBCON_HAS_CFB8
31176 + case 8:
31177 + red >>= 10;
31178 + green >>= 10;
31179 + blue >>= 10;
31180 + panel_reg->lcd_pallettebase[regno] = (blue&0x1f) |
31181 + ((green&0x3f)<<5) | ((red&0x1f)<<11);
31182 + break;
31183 +#endif
31184 +#ifdef FBCON_HAS_CFB16
31185 +/* FIX!!!! depends upon pixel format */
31186 + case 16:
31187 + i->fbcon_cmap16[regno] =
31188 + ((red & 0xf800) >> 0) |
31189 + ((green & 0xfc00) >> 5) |
31190 + ((blue & 0xf800) >> 11);
31191 + break;
31192 +#endif
31193 +#ifdef FBCON_HAS_CFB32
31194 + case 32:
31195 + i->fbcon_cmap32[regno] =
31196 + (((u32 )transp & 0xff00) << 16) |
31197 + (((u32 )red & 0xff00) << 8) |
31198 + (((u32 )green & 0xff00)) |
31199 + (((u32 )blue & 0xff00) >> 8);
31200 + break;
31201 +#endif
31202 + default:
31203 + printk("unsupported au1200_setcolreg(%d)\n", bpp);
31204 + break;
31205 + }
31206 +
31207 + return 0;
31208 +}
31209 +
31210 +
31211 +static int au1200_blank(int blank_mode, struct fb_info_gen *_info)
31212 +{
31213 + struct au1200fb_info *fb_info = (struct au1200fb_info *)_info;
31214 + int plane;
31215 +
31216 + /* Short-circuit screen blanking */
31217 + if (fb_info->noblanking)
31218 + return 0;
31219 +
31220 + plane = fbinfo2index((struct fb_info *)_info);
31221 +
31222 + switch (blank_mode) {
31223 + case VESA_NO_BLANKING:
31224 + /* printk("turn on panel\n"); */
31225 + au1200_setpanel(panel);
31226 + break;
31227 +
31228 + case VESA_VSYNC_SUSPEND:
31229 + case VESA_HSYNC_SUSPEND:
31230 + case VESA_POWERDOWN:
31231 + /* printk("turn off panel\n"); */
31232 + au1200_setpanel(NULL);
31233 + break;
31234 + default:
31235 + break;
31236 +
31237 + }
31238 + return 0;
31239 +}
31240 +
31241 +static void au1200_set_disp(const void *unused, struct display *disp,
31242 + struct fb_info_gen *info)
31243 +{
31244 + struct au1200fb_info *fb_info;
31245 + int plane;
31246 +
31247 + fb_info = (struct au1200fb_info *)info;
31248 +
31249 + disp->screen_base = (char *)fb_info->fb_virt_start;
31250 +
31251 + switch (disp->var.bits_per_pixel) {
31252 +#ifdef FBCON_HAS_CFB8
31253 + case 8:
31254 + disp->dispsw = &fbcon_cfb8;
31255 + if (fb_info->nohwcursor)
31256 + fbcon_cfb8.cursor = au1200_nocursor;
31257 + break;
31258 +#endif
31259 +#ifdef FBCON_HAS_CFB16
31260 + case 16:
31261 + disp->dispsw = &fbcon_cfb16;
31262 + disp->dispsw_data = fb_info->fbcon_cmap16;
31263 + if (fb_info->nohwcursor)
31264 + fbcon_cfb16.cursor = au1200_nocursor;
31265 + break;
31266 +#endif
31267 +#ifdef FBCON_HAS_CFB32
31268 + case 32:
31269 + disp->dispsw = &fbcon_cfb32;
31270 + disp->dispsw_data = fb_info->fbcon_cmap32;
31271 + if (fb_info->nohwcursor)
31272 + fbcon_cfb32.cursor = au1200_nocursor;
31273 + break;
31274 +#endif
31275 + default:
31276 + disp->dispsw = &fbcon_dummy;
31277 + disp->dispsw_data = NULL;
31278 + break;
31279 + }
31280 +}
31281 +
31282 +static int
31283 +au1200fb_mmap(struct fb_info *_fb,
31284 + struct file *file,
31285 + struct vm_area_struct *vma)
31286 +{
31287 + unsigned int len;
31288 + unsigned long start=0, off;
31289 +
31290 + struct au1200fb_info *fb_info = (struct au1200fb_info *)_fb;
31291 +
31292 + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
31293 + return -EINVAL;
31294 + }
31295 +
31296 + start = fb_info->fb_phys & PAGE_MASK;
31297 + len = PAGE_ALIGN((start & ~PAGE_MASK) + fb_info->fb_size);
31298 +
31299 + off = vma->vm_pgoff << PAGE_SHIFT;
31300 +
31301 + if ((vma->vm_end - vma->vm_start + off) > len) {
31302 + return -EINVAL;
31303 + }
31304 +
31305 + off += start;
31306 + vma->vm_pgoff = off >> PAGE_SHIFT;
31307 +
31308 + pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
31309 + pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
31310 +
31311 + /* This is an IO map - tell maydump to skip this VMA */
31312 + vma->vm_flags |= VM_IO;
31313 +
31314 + if (io_remap_page_range(vma->vm_start, off,
31315 + vma->vm_end - vma->vm_start,
31316 + vma->vm_page_prot)) {
31317 + return -EAGAIN;
31318 + }
31319 +
31320 + fb_info->mmaped = 1;
31321 + return 0;
31322 +}
31323 +
31324 +int au1200_pan_display(const struct fb_var_screeninfo *var,
31325 + struct fb_info_gen *info)
31326 +{
31327 + return 0;
31328 +}
31329 +
31330 +
31331 +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
31332 + u_long arg, int con, struct fb_info *info)
31333 +{
31334 + int plane;
31335 +
31336 + plane = fbinfo2index(info);
31337 +
31338 + /* printk("au1200fb: ioctl %d on plane %d\n", cmd, plane); */
31339 +
31340 + if (cmd == 0x46FF)
31341 + {
31342 + au1200_lcd_getset_t iodata;
31343 +
31344 + if (copy_from_user(&iodata, (void *) arg, sizeof(au1200_lcd_getset_t)))
31345 + return -EFAULT;
31346 +
31347 + switch (iodata.subcmd)
31348 + {
31349 + case AU1200_LCD_GET_WINENABLE:
31350 + iodata.winenable.enable = (lcd->winenable & (1<<plane)) ? 1 : 0;
31351 + break;
31352 + case AU1200_LCD_SET_WINENABLE:
31353 + {
31354 + u32 winenable;
31355 + winenable = lcd->winenable;
31356 + winenable &= ~(1<<plane);
31357 + winenable |= (iodata.winenable.enable) ? (1<<plane) : 0;
31358 + lcd->winenable = winenable;
31359 + }
31360 + break;
31361 + case AU1200_LCD_GET_WINLOCATION:
31362 + iodata.winlocation.x =
31363 + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OX) >> 21;
31364 + iodata.winlocation.y =
31365 + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OY) >> 10;
31366 + break;
31367 + case AU1200_LCD_SET_WINLOCATION:
31368 + au1200_setlocation(plane, iodata.winlocation.x, iodata.winlocation.y);
31369 + break;
31370 + case AU1200_LCD_GET_WINSIZE:
31371 + iodata.winsize.hsz =
31372 + (lcd->window[plane].winctrl1 & LCD_WINCTRL1_SZX) >> 11;
31373 + iodata.winsize.vsz =
31374 + (lcd->window[plane].winctrl0 & LCD_WINCTRL1_SZY) >> 0;
31375 + break;
31376 + case AU1200_LCD_SET_WINSIZE:
31377 + au1200_setsize(plane, iodata.winsize.hsz, iodata.winsize.vsz);
31378 + break;
31379 + case AU1200_LCD_GET_BACKCOLOR:
31380 + iodata.backcolor.color = lcd->backcolor;
31381 + break;
31382 + case AU1200_LCD_SET_BACKCOLOR:
31383 + lcd->backcolor = iodata.backcolor.color;
31384 + break;
31385 + case AU1200_LCD_GET_COLORKEY:
31386 + iodata.colorkey.key = lcd->colorkey;
31387 + iodata.colorkey.mask = lcd->colorkeymsk;
31388 + break;
31389 + case AU1200_LCD_SET_COLORKEY:
31390 + lcd->colorkey = iodata.colorkey.key;
31391 + lcd->colorkeymsk = iodata.colorkey.mask;
31392 + break;
31393 + case AU1200_LCD_GET_PANEL:
31394 + iodata.panel.panel = panel_index;
31395 + break;
31396 + case AU1200_LCD_SET_PANEL:
31397 + if ((iodata.panel.panel >= 0) && (iodata.panel.panel < NUM_PANELS))
31398 + {
31399 + struct panel_settings *newpanel;
31400 + panel_index = iodata.panel.panel;
31401 + newpanel = &panels[panel_index];
31402 + au1200_setpanel(newpanel);
31403 + }
31404 + break;
31405 + }
31406 +
31407 + return copy_to_user((void *) arg, &iodata, sizeof(au1200_lcd_getset_t)) ? -EFAULT : 0;
31408 + }
31409 +
31410 + return -EINVAL;
31411 +}
31412 +
31413 +static struct fbgen_hwswitch au1200_switch = {
31414 + au1200_detect,
31415 + au1200_encode_fix,
31416 + au1200_decode_var,
31417 + au1200_encode_var,
31418 + au1200_get_par,
31419 + au1200_set_par,
31420 + au1200_getcolreg,
31421 + au1200_setcolreg,
31422 + au1200_pan_display,
31423 + au1200_blank,
31424 + au1200_set_disp
31425 +};
31426 +
31427 +static void au1200_setpanel (struct panel_settings *newpanel)
31428 +{
31429 + /*
31430 + * Perform global setup/init of LCD controller
31431 + */
31432 + uint32 winenable;
31433 +
31434 + /* Make sure all windows disabled */
31435 + winenable = lcd->winenable;
31436 + lcd->winenable = 0;
31437 +
31438 + /*
31439 + * Ensure everything is disabled before reconfiguring
31440 + */
31441 + if (lcd->screen & LCD_SCREEN_SEN)
31442 + {
31443 + /* Wait for vertical sync period */
31444 + lcd->intstatus = LCD_INT_SS;
31445 + while ((lcd->intstatus & LCD_INT_SS) == 0)
31446 + ;
31447 +
31448 + lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/
31449 +
31450 + do
31451 + {
31452 + lcd->intstatus = lcd->intstatus; /*clear interrupts*/
31453 + }
31454 + /*wait for controller to shut down*/
31455 + while ((lcd->intstatus & LCD_INT_SD) == 0);
31456 +
31457 + /* Call shutdown of current panel (if up) */
31458 + /* this must occur last, because if an external clock is driving
31459 + the controller, the clock cannot be turned off before first
31460 + shutting down the controller.
31461 + */
31462 + if (panel->device_shutdown != NULL) panel->device_shutdown();
31463 + }
31464 +
31465 + /* Check if only needing to turn off panel */
31466 + if (panel == NULL) return;
31467 +
31468 + panel = newpanel;
31469 +
31470 + printk("Panel(%s), %dx%d\n", panel->name, panel->Xres, panel->Yres);
31471 +
31472 + /*
31473 + * Setup clocking if internal LCD clock source (assumes sys_auxpll valid)
31474 + */
31475 + if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
31476 + {
31477 + uint32 sys_clksrc;
31478 + /* WARNING! This should really be a check since other peripherals can
31479 + be affected by changins sys_auxpll */
31480 + au_writel(panel->mode_auxpll, SYS_AUXPLL);
31481 + sys_clksrc = au_readl(SYS_CLKSRC) & ~0x0000001f;
31482 + sys_clksrc |= panel->mode_toyclksrc;
31483 + au_writel(sys_clksrc, SYS_CLKSRC);
31484 + }
31485 +
31486 + /*
31487 + * Configure panel timings
31488 + */
31489 + lcd->screen = panel->mode_screen;
31490 + lcd->horztiming = panel->mode_horztiming;
31491 + lcd->verttiming = panel->mode_verttiming;
31492 + lcd->clkcontrol = panel->mode_clkcontrol;
31493 + lcd->pwmdiv = panel->mode_pwmdiv;
31494 + lcd->pwmhi = panel->mode_pwmhi;
31495 + lcd->outmask = panel->mode_outmask;
31496 + lcd->fifoctrl = panel->mode_fifoctrl;
31497 + au_sync();
31498 +
31499 + /* FIX!!! Check window settings to make sure still valid for new geometry */
31500 + au1200_setlocation(0, win->w[0].xpos, win->w[0].ypos);
31501 + au1200_setlocation(1, win->w[1].xpos, win->w[1].ypos);
31502 + au1200_setlocation(2, win->w[2].xpos, win->w[2].ypos);
31503 + au1200_setlocation(3, win->w[3].xpos, win->w[3].ypos);
31504 + lcd->winenable = winenable;
31505 +
31506 + /*
31507 + * Re-enable screen now that it is configured
31508 + */
31509 + lcd->screen |= LCD_SCREEN_SEN;
31510 + au_sync();
31511 +
31512 + /* Call init of panel */
31513 + if (panel->device_init != NULL) panel->device_init();
31514 +
31515 +#if 0
31516 +#define D(X) printk("%25s: %08X\n", #X, X)
31517 + D(lcd->screen);
31518 + D(lcd->horztiming);
31519 + D(lcd->verttiming);
31520 + D(lcd->clkcontrol);
31521 + D(lcd->pwmdiv);
31522 + D(lcd->pwmhi);
31523 + D(lcd->outmask);
31524 + D(lcd->fifoctrl);
31525 + D(lcd->window[0].winctrl0);
31526 + D(lcd->window[0].winctrl1);
31527 + D(lcd->window[0].winctrl2);
31528 + D(lcd->window[0].winbuf0);
31529 + D(lcd->window[0].winbuf1);
31530 + D(lcd->window[0].winbufctrl);
31531 + D(lcd->window[1].winctrl0);
31532 + D(lcd->window[1].winctrl1);
31533 + D(lcd->window[1].winctrl2);
31534 + D(lcd->window[1].winbuf0);
31535 + D(lcd->window[1].winbuf1);
31536 + D(lcd->window[1].winbufctrl);
31537 + D(lcd->window[2].winctrl0);
31538 + D(lcd->window[2].winctrl1);
31539 + D(lcd->window[2].winctrl2);
31540 + D(lcd->window[2].winbuf0);
31541 + D(lcd->window[2].winbuf1);
31542 + D(lcd->window[2].winbufctrl);
31543 + D(lcd->window[3].winctrl0);
31544 + D(lcd->window[3].winctrl1);
31545 + D(lcd->window[3].winctrl2);
31546 + D(lcd->window[3].winbuf0);
31547 + D(lcd->window[3].winbuf1);
31548 + D(lcd->window[3].winbufctrl);
31549 + D(lcd->winenable);
31550 + D(lcd->intenable);
31551 + D(lcd->intstatus);
31552 + D(lcd->backcolor);
31553 + D(lcd->winenable);
31554 + D(lcd->colorkey);
31555 + D(lcd->colorkeymsk);
31556 + D(lcd->hwc.cursorctrl);
31557 + D(lcd->hwc.cursorpos);
31558 + D(lcd->hwc.cursorcolor0);
31559 + D(lcd->hwc.cursorcolor1);
31560 + D(lcd->hwc.cursorcolor2);
31561 + D(lcd->hwc.cursorcolor3);
31562 +#endif
31563 +}
31564 +
31565 +static int au1200_setsize (int plane, int xres, int yres)
31566 +{
31567 +#if 0
31568 + uint32 winctrl0, winctrl1, winenable;
31569 + int xsz, ysz;
31570 +
31571 + /* FIX!!! X*Y can not surpass allocated memory */
31572 +
31573 + printk("setsize: x %d y %d\n", xres, yres);
31574 + winctrl1 = lcd->window[plane].winctrl1;
31575 + printk("org winctrl1 %08X\n", winctrl1);
31576 + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
31577 +
31578 + xres -= 1;
31579 + yres -= 1;
31580 + winctrl1 |= (xres << 11);
31581 + winctrl1 |= (yres << 0);
31582 +
31583 + printk("new winctrl1 %08X\n", winctrl1);
31584 +
31585 + /*winenable = lcd->winenable & (1 << plane); */
31586 + /*lcd->winenable &= ~(1 << plane); */
31587 + lcd->window[plane].winctrl1 = winctrl1;
31588 + /*lcd->winenable |= winenable; */
31589 +#endif
31590 + return 0;
31591 +}
31592 +
31593 +static int au1200_setlocation (int plane, int xpos, int ypos)
31594 +{
31595 + uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
31596 + int xsz, ysz;
31597 +
31598 + /* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
31599 +
31600 + winctrl0 = lcd->window[plane].winctrl0;
31601 + winctrl1 = lcd->window[plane].winctrl1;
31602 + winctrl0 &= (LCD_WINCTRL0_A | LCD_WINCTRL0_AEN);
31603 + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
31604 +
31605 + /* Check for off-screen adjustments */
31606 + xsz = win->w[plane].xres;
31607 + ysz = win->w[plane].yres;
31608 + if ((xpos + win->w[plane].xres) > panel->Xres)
31609 + {
31610 + /* Off-screen to the right */
31611 + xsz = panel->Xres - xpos; /* off by 1 ??? */
31612 + /*printk("off screen right\n");*/
31613 + }
31614 +
31615 + if ((ypos + win->w[plane].yres) > panel->Yres)
31616 + {
31617 + /* Off-screen to the bottom */
31618 + ysz = panel->Yres - ypos; /* off by 1 ??? */
31619 + /*printk("off screen bottom\n");*/
31620 + }
31621 +
31622 + if (xpos < 0)
31623 + {
31624 + /* Off-screen to the left */
31625 + xsz = win->w[plane].xres + xpos;
31626 + fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
31627 + xpos = 0;
31628 + /*printk("off screen left\n");*/
31629 + }
31630 +
31631 + if (ypos < 0)
31632 + {
31633 + /* Off-screen to the top */
31634 + ysz = win->w[plane].yres + ypos;
31635 + fb_offset += ((0 - ypos) * fb_pars[plane].line_length);
31636 + ypos = 0;
31637 + /*printk("off screen top\n");*/
31638 + }
31639 +
31640 + /* record settings */
31641 + win->w[plane].xpos = xpos;
31642 + win->w[plane].ypos = ypos;
31643 +
31644 + xsz -= 1;
31645 + ysz -= 1;
31646 + winctrl0 |= (xpos << 21);
31647 + winctrl0 |= (ypos << 10);
31648 + winctrl1 |= (xsz << 11);
31649 + winctrl1 |= (ysz << 0);
31650 +
31651 + /* Disable the window while making changes, then restore WINEN */
31652 + winenable = lcd->winenable & (1 << plane);
31653 + lcd->winenable &= ~(1 << plane);
31654 + lcd->window[plane].winctrl0 = winctrl0;
31655 + lcd->window[plane].winctrl1 = winctrl1;
31656 + lcd->window[plane].winbuf0 =
31657 + lcd->window[plane].winbuf1 = fb_infos[plane].fb_phys + fb_offset;
31658 + lcd->window[plane].winbufctrl = 0; /* select winbuf0 */
31659 + lcd->winenable |= winenable;
31660 +
31661 + return 0;
31662 +}
31663 +
31664 +static void au1200_setmode(int plane)
31665 +{
31666 + /* Window/plane setup */
31667 + lcd->window[plane].winctrl1 = ( 0
31668 + | LCD_WINCTRL1_PRI_N(plane)
31669 + | win->w[plane].mode_winctrl1 /* FRM,CCO,PO,PIPE */
31670 + ) ;
31671 +
31672 + au1200_setlocation(plane, win->w[plane].xpos, win->w[plane].ypos);
31673 +
31674 + lcd->window[plane].winctrl2 = ( 0
31675 + | LCD_WINCTRL2_CKMODE_00
31676 + | LCD_WINCTRL2_DBM
31677 +/* | LCD_WINCTRL2_RAM */
31678 + | LCD_WINCTRL2_BX_N(fb_pars[plane].line_length)
31679 + | LCD_WINCTRL2_SCX_1
31680 + | LCD_WINCTRL2_SCY_1
31681 + ) ;
31682 + lcd->winenable |= win->w[plane].mode_winenable;
31683 + au_sync();
31684 +
31685 +}
31686 +
31687 +static unsigned long
31688 +au1200fb_alloc_fbmem (unsigned long size)
31689 +{
31690 + /* __get_free_pages() fulfills a max request of 2MB */
31691 + /* do multiple requests to obtain large contigous mem */
31692 +#define MAX_GFP 0x00200000
31693 +
31694 + unsigned long mem, amem, alloced = 0, allocsize;
31695 +
31696 + size += 0x1000;
31697 + allocsize = (size < MAX_GFP) ? size : MAX_GFP;
31698 +
31699 + /* Get first chunk */
31700 + mem = (unsigned long )
31701 + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
31702 + if (mem != 0) alloced = allocsize;
31703 +
31704 + /* Get remaining, contiguous chunks */
31705 + while (alloced < size)
31706 + {
31707 + amem = (unsigned long )
31708 + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
31709 + if (amem != 0)
31710 + alloced += allocsize;
31711 +
31712 + /* check for contiguous mem alloced */
31713 + if ((amem == 0) || (amem + allocsize) != mem)
31714 + break;
31715 + else
31716 + mem = amem;
31717 + }
31718 + return mem;
31719 +}
31720 +
31721 +int __init au1200fb_init(void)
31722 +{
31723 + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
31724 + struct au1200fb_info *fb_info;
31725 + struct display *disp;
31726 + struct au1200fb_par *par;
31727 + unsigned long page;
31728 + int plane, bpp;
31729 +
31730 + /*
31731 + * Get the panel information/display mode
31732 + */
31733 + if (panel_index < 0)
31734 + panel_index = board_au1200fb_panel();
31735 + if ((panel_index < 0) || (panel_index >= num_panels)) {
31736 + printk("ERROR: INVALID PANEL %d\n", panel_index);
31737 + return -EINVAL;
31738 + }
31739 + panel = &panels[panel_index];
31740 + win = &windows[window_index];
31741 +
31742 + printk("au1200fb: Panel %d %s\n", panel_index, panel->name);
31743 + printk("au1200fb: Win %d %s\n", window_index, win->name);
31744 +
31745 + /* Global setup/init */
31746 + au1200_setpanel(panel);
31747 + lcd->intenable = 0;
31748 + lcd->intstatus = ~0;
31749 + lcd->backcolor = win->mode_backcolor;
31750 + lcd->winenable = 0;
31751 +
31752 + /* Setup Color Key - FIX!!! */
31753 + lcd->colorkey = win->mode_colorkey;
31754 + lcd->colorkeymsk = win->mode_colorkeymsk;
31755 +
31756 + /* Setup HWCursor - FIX!!! Need to support this eventually */
31757 + lcd->hwc.cursorctrl = 0;
31758 + lcd->hwc.cursorpos = 0;
31759 + lcd->hwc.cursorcolor0 = 0;
31760 + lcd->hwc.cursorcolor1 = 0;
31761 + lcd->hwc.cursorcolor2 = 0;
31762 + lcd->hwc.cursorcolor3 = 0;
31763 +
31764 + /* Register each plane as a frame buffer device */
31765 + for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane)
31766 + {
31767 + fb_info = &fb_infos[plane];
31768 + disp = &disps[plane];
31769 + par = &fb_pars[plane];
31770 +
31771 + bpp = winbpp(win->w[plane].mode_winctrl1);
31772 + if (win->w[plane].xres == 0)
31773 + win->w[plane].xres = panel->Xres;
31774 + if (win->w[plane].yres == 0)
31775 + win->w[plane].yres = panel->Yres;
31776 +
31777 + par->var.xres =
31778 + par->var.xres_virtual = win->w[plane].xres;
31779 + par->var.yres =
31780 + par->var.yres_virtual = win->w[plane].yres;
31781 + par->var.bits_per_pixel = bpp;
31782 + par->line_length = win->w[plane].xres * bpp / 8; /* in bytes */
31783 + /*
31784 + * Allocate LCD framebuffer from system memory
31785 + * Set page reserved so that mmap will work. This is necessary
31786 + * since we'll be remapping normal memory.
31787 + */
31788 + fb_info->fb_size = (win->w[plane].xres * win->w[plane].yres * bpp) / 8;
31789 + fb_info->fb_virt_start = au1200fb_alloc_fbmem(fb_info->fb_size);
31790 + if (!fb_info->fb_virt_start) {
31791 + printk("Unable to allocate fb memory\n");
31792 + return -ENOMEM;
31793 + }
31794 + fb_info->fb_phys = virt_to_bus((void *)fb_info->fb_virt_start);
31795 + for (page = fb_info->fb_virt_start;
31796 + page < PAGE_ALIGN(fb_info->fb_virt_start + fb_info->fb_size);
31797 + page += PAGE_SIZE) {
31798 + SetPageReserved(virt_to_page(page));
31799 + }
31800 + /* Convert to kseg1 */
31801 + fb_info->fb_virt_start =
31802 + (void *)((u32)fb_info->fb_virt_start | 0xA0000000);
31803 + /* FIX!!! may wish to avoid this to save startup time??? */
31804 + memset((void *)fb_info->fb_virt_start, 0, fb_info->fb_size);
31805 +
31806 + fb_info->gen.parsize = sizeof(struct au1200fb_par);
31807 + fb_info->gen.fbhw = &au1200_switch;
31808 + strcpy(fb_info->gen.info.modename, "Au1200 LCD");
31809 + fb_info->gen.info.changevar = NULL;
31810 + fb_info->gen.info.node = -1;
31811 +
31812 + fb_info->gen.info.fbops = &au1200fb_ops;
31813 + fb_info->gen.info.disp = disp;
31814 + fb_info->gen.info.switch_con = &fbgen_switch;
31815 + fb_info->gen.info.updatevar = &fbgen_update_var;
31816 + fb_info->gen.info.blank = &fbgen_blank;
31817 + fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
31818 +
31819 + fb_info->nohwcursor = 1;
31820 + fb_info->noblanking = 1;
31821 +
31822 + /* This should give a reasonable default video mode */
31823 + fbgen_get_var(&disp->var, -1, &fb_info->gen.info);
31824 + fbgen_do_set_var(&disp->var, 1, &fb_info->gen);
31825 + fbgen_set_disp(-1, &fb_info->gen);
31826 + fbgen_install_cmap(0, &fb_info->gen);
31827 +
31828 + /* Turn on plane */
31829 + au1200_setmode(plane);
31830 +
31831 + if (register_framebuffer(&fb_info->gen.info) < 0)
31832 + return -EINVAL;
31833 +
31834 + printk(KERN_INFO "fb%d: %s plane %d @ %08X (%d x %d x %d)\n",
31835 + GET_FB_IDX(fb_info->gen.info.node),
31836 + fb_info->gen.info.modename, plane, fb_info->fb_phys,
31837 + win->w[plane].xres, win->w[plane].yres, bpp);
31838 + }
31839 + /* uncomment this if your driver cannot be unloaded */
31840 + /* MOD_INC_USE_COUNT; */
31841 + return 0;
31842 +}
31843 +
31844 +void au1200fb_setup(char *options, int *ints)
31845 +{
31846 + char* this_opt;
31847 + int i;
31848 + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
31849 +
31850 + if (!options || !*options)
31851 + return;
31852 +
31853 + for(this_opt=strtok(options, ","); this_opt;
31854 + this_opt=strtok(NULL, ",")) {
31855 + if (!strncmp(this_opt, "panel:", 6)) {
31856 + int i;
31857 + long int li;
31858 + char *endptr;
31859 + this_opt += 6;
31860 +
31861 + /* Panel name can be name, "bs" for board-switch, or number/index */
31862 + li = simple_strtol(this_opt, &endptr, 0);
31863 + if (*endptr == '\0') {
31864 + panel_index = (int)li;
31865 + }
31866 + else if (strcmp(this_opt, "bs") == 0) {
31867 + panel_index = board_au1200fb_panel();
31868 + }
31869 + else
31870 + for (i=0; i<num_panels; i++) {
31871 + if (!strcmp(this_opt, panels[i].name)) {
31872 + panel_index = i;
31873 + break;
31874 + }
31875 + }
31876 + }
31877 + else if (!strncmp(this_opt, "nohwcursor", 10)) {
31878 + printk("nohwcursor\n");
31879 + fb_infos[0].nohwcursor = 1;
31880 + }
31881 + }
31882 +
31883 + printk("au1200fb: Panel %d %s\n", panel_index,
31884 + panels[panel_index].name);
31885 +}
31886 +
31887 +
31888 +
31889 +#ifdef MODULE
31890 +MODULE_LICENSE("GPL");
31891 +MODULE_DESCRIPTION("Au1200 LCD framebuffer driver");
31892 +
31893 +void au1200fb_cleanup(struct fb_info *info)
31894 +{
31895 + unregister_framebuffer(info);
31896 +}
31897 +
31898 +module_init(au1200fb_init);
31899 +module_exit(au1200fb_cleanup);
31900 +#endif /* MODULE */
31901 +
31902 +
31903 diff -Nur linux-2.4.29/drivers/video/au1200fb.h linux-mips/drivers/video/au1200fb.h
31904 --- linux-2.4.29/drivers/video/au1200fb.h 1970-01-01 01:00:00.000000000 +0100
31905 +++ linux-mips/drivers/video/au1200fb.h 2005-02-11 22:16:44.000000000 +0100
31906 @@ -0,0 +1,288 @@
31907 +/*
31908 + * BRIEF MODULE DESCRIPTION
31909 + * Hardware definitions for the Au1200 LCD controller
31910 + *
31911 + * Copyright 2004 AMD
31912 + * Author: AMD
31913 + *
31914 + * This program is free software; you can redistribute it and/or modify it
31915 + * under the terms of the GNU General Public License as published by the
31916 + * Free Software Foundation; either version 2 of the License, or (at your
31917 + * option) any later version.
31918 + *
31919 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
31920 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31921 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
31922 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31923 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31924 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
31925 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31926 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31927 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31928 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31929 + *
31930 + * You should have received a copy of the GNU General Public License along
31931 + * with this program; if not, write to the Free Software Foundation, Inc.,
31932 + * 675 Mass Ave, Cambridge, MA 02139, USA.
31933 + */
31934 +
31935 +#ifndef _AU1200LCD_H
31936 +#define _AU1200LCD_H
31937 +
31938 +/********************************************************************/
31939 +#define AU1200_LCD_ADDR 0xB5000000
31940 +
31941 +#define uint8 unsigned char
31942 +#define uint32 unsigned int
31943 +
31944 +typedef volatile struct
31945 +{
31946 + uint32 reserved0;
31947 + uint32 screen;
31948 + uint32 backcolor;
31949 + uint32 horztiming;
31950 + uint32 verttiming;
31951 + uint32 clkcontrol;
31952 + uint32 pwmdiv;
31953 + uint32 pwmhi;
31954 + uint32 reserved1;
31955 + uint32 winenable;
31956 + uint32 colorkey;
31957 + uint32 colorkeymsk;
31958 + struct
31959 + {
31960 + uint32 cursorctrl;
31961 + uint32 cursorpos;
31962 + uint32 cursorcolor0;
31963 + uint32 cursorcolor1;
31964 + uint32 cursorcolor2;
31965 + uint32 cursorcolor3;
31966 + } hwc;
31967 + uint32 intstatus;
31968 + uint32 intenable;
31969 + uint32 outmask;
31970 + uint32 fifoctrl;
31971 + uint32 reserved2[(0x0100-0x0058)/4];
31972 + struct
31973 + {
31974 + uint32 winctrl0;
31975 + uint32 winctrl1;
31976 + uint32 winctrl2;
31977 + uint32 winbuf0;
31978 + uint32 winbuf1;
31979 + uint32 winbufctrl;
31980 + uint32 winreserved0;
31981 + uint32 winreserved1;
31982 + } window[4];
31983 +
31984 + uint32 reserved3[(0x0400-0x0180)/4];
31985 +
31986 + uint32 palette[(0x0800-0x0400)/4];
31987 +
31988 + uint8 cursorpattern[256];
31989 +
31990 +} AU1200_LCD;
31991 +
31992 +/* lcd_screen */
31993 +#define LCD_SCREEN_SEN (1<<31)
31994 +#define LCD_SCREEN_SX (0x07FF<<19)
31995 +#define LCD_SCREEN_SY (0x07FF<< 8)
31996 +#define LCD_SCREEN_SWP (1<<7)
31997 +#define LCD_SCREEN_SWD (1<<6)
31998 +#define LCD_SCREEN_ST (7<<0)
31999 +#define LCD_SCREEN_ST_TFT (0<<0)
32000 +#define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
32001 +#define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
32002 +#define LCD_SCREEN_ST_CSTN (1<<0)
32003 +#define LCD_SCREEN_ST_CDSTN (2<<0)
32004 +#define LCD_SCREEN_ST_M8STN (3<<0)
32005 +#define LCD_SCREEN_ST_M4STN (4<<0)
32006 +
32007 +/* lcd_backcolor */
32008 +#define LCD_BACKCOLOR_SBGR (0xFF<<16)
32009 +#define LCD_BACKCOLOR_SBGG (0xFF<<8)
32010 +#define LCD_BACKCOLOR_SBGB (0xFF<<0)
32011 +#define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
32012 +#define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
32013 +#define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
32014 +
32015 +/* lcd_winenable */
32016 +#define LCD_WINENABLE_WEN3 (1<<3)
32017 +#define LCD_WINENABLE_WEN2 (1<<2)
32018 +#define LCD_WINENABLE_WEN1 (1<<1)
32019 +#define LCD_WINENABLE_WEN0 (1<<0)
32020 +
32021 +/* lcd_colorkey */
32022 +#define LCD_COLORKEY_CKR (0xFF<<16)
32023 +#define LCD_COLORKEY_CKG (0xFF<<8)
32024 +#define LCD_COLORKEY_CKB (0xFF<<0)
32025 +#define LCD_COLORKEY_CKR_N(N) ((N)<<16)
32026 +#define LCD_COLORKEY_CKG_N(N) ((N)<<8)
32027 +#define LCD_COLORKEY_CKB_N(N) ((N)<<0)
32028 +
32029 +/* lcd_colorkeymsk */
32030 +#define LCD_COLORKEYMSK_CKMR (0xFF<<16)
32031 +#define LCD_COLORKEYMSK_CKMG (0xFF<<8)
32032 +#define LCD_COLORKEYMSK_CKMB (0xFF<<0)
32033 +#define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
32034 +#define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
32035 +#define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
32036 +
32037 +/* lcd windows control 0 */
32038 +#define LCD_WINCTRL0_OX (0x07FF<<21)
32039 +#define LCD_WINCTRL0_OY (0x07FF<<10)
32040 +#define LCD_WINCTRL0_A (0x00FF<<2)
32041 +#define LCD_WINCTRL0_AEN (1<<1)
32042 +#define LCD_WINCTRL0_OX_N(N) ((N)<<21)
32043 +#define LCD_WINCTRL0_OY_N(N) ((N)<<10)
32044 +#define LCD_WINCTRL0_A_N(N) ((N)<<2)
32045 +
32046 +/* lcd windows control 1 */
32047 +#define LCD_WINCTRL1_PRI (3<<30)
32048 +#define LCD_WINCTRL1_PIPE (1<<29)
32049 +#define LCD_WINCTRL1_FRM (0xF<<25)
32050 +#define LCD_WINCTRL1_CCO (1<<24)
32051 +#define LCD_WINCTRL1_PO (3<<22)
32052 +#define LCD_WINCTRL1_SZX (0x07FF<<11)
32053 +#define LCD_WINCTRL1_SZY (0x07FF<<0)
32054 +#define LCD_WINCTRL1_FRM_1BPP (0<<25)
32055 +#define LCD_WINCTRL1_FRM_2BPP (1<<25)
32056 +#define LCD_WINCTRL1_FRM_4BPP (2<<25)
32057 +#define LCD_WINCTRL1_FRM_8BPP (3<<25)
32058 +#define LCD_WINCTRL1_FRM_12BPP (4<<25)
32059 +#define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
32060 +#define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
32061 +#define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
32062 +#define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
32063 +#define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
32064 +#define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
32065 +#define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
32066 +#define LCD_WINCTRL1_FRM_24BPP (12<<25)
32067 +#define LCD_WINCTRL1_FRM_32BPP (13<<25)
32068 +#define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
32069 +#define LCD_WINCTRL1_PO_00 (0<<22)
32070 +#define LCD_WINCTRL1_PO_01 (1<<22)
32071 +#define LCD_WINCTRL1_PO_10 (2<<22)
32072 +#define LCD_WINCTRL1_PO_11 (3<<22)
32073 +#define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
32074 +#define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
32075 +
32076 +/* lcd windows control 2 */
32077 +#define LCD_WINCTRL2_CKMODE (3<<24)
32078 +#define LCD_WINCTRL2_DBM (1<<23)
32079 +#define LCD_WINCTRL2_RAM (3<<21)
32080 +#define LCD_WINCTRL2_BX (0x1FFF<<8)
32081 +#define LCD_WINCTRL2_SCX (0xF<<4)
32082 +#define LCD_WINCTRL2_SCY (0xF<<0)
32083 +#define LCD_WINCTRL2_CKMODE_00 (0<<24)
32084 +#define LCD_WINCTRL2_CKMODE_01 (1<<24)
32085 +#define LCD_WINCTRL2_CKMODE_10 (2<<24)
32086 +#define LCD_WINCTRL2_CKMODE_11 (3<<24)
32087 +#define LCD_WINCTRL2_RAM_NONE (0<<21)
32088 +#define LCD_WINCTRL2_RAM_PALETTE (1<<21)
32089 +#define LCD_WINCTRL2_RAM_GAMMA (2<<21)
32090 +#define LCD_WINCTRL2_RAM_BUFFER (3<<21)
32091 +#define LCD_WINCTRL2_BX_N(N) ((N)<<8)
32092 +#define LCD_WINCTRL2_SCX_1 (0<<4)
32093 +#define LCD_WINCTRL2_SCX_2 (1<<4)
32094 +#define LCD_WINCTRL2_SCX_4 (2<<4)
32095 +#define LCD_WINCTRL2_SCY_1 (0<<0)
32096 +#define LCD_WINCTRL2_SCY_2 (1<<0)
32097 +#define LCD_WINCTRL2_SCY_4 (2<<0)
32098 +
32099 +/* lcd windows buffer control */
32100 +#define LCD_WINBUFCTRL_DB (1<<1)
32101 +#define LCD_WINBUFCTRL_DBN (1<<0)
32102 +
32103 +/* lcd_intstatus, lcd_intenable */
32104 +#define LCD_INT_IFO (0xF<<14)
32105 +#define LCD_INT_IFU (0xF<<10)
32106 +#define LCD_INT_OFO (1<<9)
32107 +#define LCD_INT_OFU (1<<8)
32108 +#define LCD_INT_WAIT (1<<3)
32109 +#define LCD_INT_SD (1<<2)
32110 +#define LCD_INT_SA (1<<1)
32111 +#define LCD_INT_SS (1<<0)
32112 +
32113 +/* lcd_horztiming */
32114 +#define LCD_HORZTIMING_HND2 (0x1FF<<18)
32115 +#define LCD_HORZTIMING_HND1 (0x1FF<<9)
32116 +#define LCD_HORZTIMING_HPW (0x1FF<<0)
32117 +#define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
32118 +#define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
32119 +#define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
32120 +
32121 +/* lcd_verttiming */
32122 +#define LCD_VERTTIMING_VND2 (0x1FF<<18)
32123 +#define LCD_VERTTIMING_VND1 (0x1FF<<9)
32124 +#define LCD_VERTTIMING_VPW (0x1FF<<0)
32125 +#define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
32126 +#define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
32127 +#define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
32128 +
32129 +/* lcd_clkcontrol */
32130 +#define LCD_CLKCONTROL_EXT (1<<22)
32131 +#define LCD_CLKCONTROL_DELAY (3<<20)
32132 +#define LCD_CLKCONTROL_CDD (1<<19)
32133 +#define LCD_CLKCONTROL_IB (1<<18)
32134 +#define LCD_CLKCONTROL_IC (1<<17)
32135 +#define LCD_CLKCONTROL_IH (1<<16)
32136 +#define LCD_CLKCONTROL_IV (1<<15)
32137 +#define LCD_CLKCONTROL_BF (0x1F<<10)
32138 +#define LCD_CLKCONTROL_PCD (0x3FF<<0)
32139 +#define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
32140 +#define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
32141 +
32142 +/* lcd_pwmdiv */
32143 +#define LCD_PWMDIV_EN (1<<31)
32144 +#define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
32145 +#define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
32146 +
32147 +/* lcd_pwmhi */
32148 +#define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
32149 +#define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
32150 +#define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
32151 +#define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
32152 +
32153 +/* lcd_hwccon */
32154 +#define LCD_HWCCON_EN (1<<0)
32155 +
32156 +/* lcd_cursorpos */
32157 +#define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
32158 +#define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
32159 +#define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
32160 +#define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
32161 +#define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
32162 +#define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
32163 +#define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
32164 +#define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
32165 +
32166 +/* lcd_cursorcolor */
32167 +#define LCD_CURSORCOLOR_HWCA (0xFF<<24)
32168 +#define LCD_CURSORCOLOR_HWCR (0xFF<<16)
32169 +#define LCD_CURSORCOLOR_HWCG (0xFF<<8)
32170 +#define LCD_CURSORCOLOR_HWCB (0xFF<<0)
32171 +#define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
32172 +#define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
32173 +#define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
32174 +#define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
32175 +
32176 +/* lcd_fifoctrl */
32177 +#define LCD_FIFOCTRL_F3IF (1<<29)
32178 +#define LCD_FIFOCTRL_F3REQ (0x1F<<24)
32179 +#define LCD_FIFOCTRL_F2IF (1<<29)
32180 +#define LCD_FIFOCTRL_F2REQ (0x1F<<16)
32181 +#define LCD_FIFOCTRL_F1IF (1<<29)
32182 +#define LCD_FIFOCTRL_F1REQ (0x1F<<8)
32183 +#define LCD_FIFOCTRL_F0IF (1<<29)
32184 +#define LCD_FIFOCTRL_F0REQ (0x1F<<0)
32185 +#define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
32186 +#define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
32187 +#define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
32188 +#define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
32189 +
32190 +/* lcd_outmask */
32191 +#define LCD_OUTMASK_MASK (0x00FFFFFF)
32192 +
32193 +/********************************************************************/
32194 +#endif /* _AU1200LCD_H */
32195 diff -Nur linux-2.4.29/drivers/video/Config.in linux-mips/drivers/video/Config.in
32196 --- linux-2.4.29/drivers/video/Config.in 2004-02-18 14:36:31.000000000 +0100
32197 +++ linux-mips/drivers/video/Config.in 2005-03-26 11:47:35.761782411 +0100
32198 @@ -87,8 +87,8 @@
32199 if [ "$CONFIG_HP300" = "y" ]; then
32200 define_bool CONFIG_FB_HP300 y
32201 fi
32202 - if [ "$ARCH" = "alpha" ]; then
32203 - tristate ' TGA framebuffer support' CONFIG_FB_TGA
32204 + if [ "$ARCH" = "alpha" -o "$CONFIG_TC" = "y" ]; then
32205 + tristate ' TGA/SFB+ framebuffer support' CONFIG_FB_TGA
32206 fi
32207 if [ "$CONFIG_X86" = "y" ]; then
32208 bool ' VESA VGA graphics console' CONFIG_FB_VESA
32209 @@ -121,6 +121,17 @@
32210 hex ' Framebuffer Base Address' CONFIG_E1355_FB_BASE a8200000
32211 fi
32212 fi
32213 + if [ "$CONFIG_SOC_AU1100" = "y" ]; then
32214 + bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
32215 + fi
32216 +
32217 + if [ "$CONFIG_SOC_AU1200" = "y" ]; then
32218 + bool ' Au1200 LCD Driver' CONFIG_FB_AU1200
32219 + if [ "$CONFIG_FB_AU1200" = "y" ]; then
32220 + int ' Number of planes (1 to 4)' CONFIG_FB_AU1200_DEVS 1
32221 + fi
32222 + fi
32223 +
32224 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
32225 if [ "$CONFIG_PCI" != "n" ]; then
32226 tristate ' Matrox acceleration (EXPERIMENTAL)' CONFIG_FB_MATROX
32227 @@ -178,9 +189,6 @@
32228 bool ' Use CRT on Pb1100 ' CONFIG_PB1500_CRT
32229 bool ' Use TFT Panel on Pb1100 ' CONFIG_PB1500_TFT
32230 fi
32231 - if [ "$CONFIG_SOC_AU1100" = "y" ]; then
32232 - bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
32233 - fi
32234 fi
32235 fi
32236 fi
32237 diff -Nur linux-2.4.29/drivers/video/fbmem.c linux-mips/drivers/video/fbmem.c
32238 --- linux-2.4.29/drivers/video/fbmem.c 2005-01-19 15:10:09.000000000 +0100
32239 +++ linux-mips/drivers/video/fbmem.c 2005-03-26 11:47:36.031738105 +0100
32240 @@ -139,6 +139,8 @@
32241 extern int e1356fb_setup(char*);
32242 extern int au1100fb_init(void);
32243 extern int au1100fb_setup(char*);
32244 +extern int au1200fb_init(void);
32245 +extern int au1200fb_setup(char*);
32246 extern int pvr2fb_init(void);
32247 extern int pvr2fb_setup(char*);
32248 extern int sstfb_init(void);
32249 @@ -331,6 +333,9 @@
32250 #ifdef CONFIG_FB_AU1100
32251 { "au1100fb", au1100fb_init, au1100fb_setup },
32252 #endif
32253 +#ifdef CONFIG_FB_AU1200
32254 + { "au1200fb", au1200fb_init, au1200fb_setup },
32255 +#endif
32256 #ifdef CONFIG_FB_IT8181
32257 { "it8181fb", it8181fb_init, it8181fb_setup },
32258 #endif
32259 diff -Nur linux-2.4.29/drivers/video/ims332.h linux-mips/drivers/video/ims332.h
32260 --- linux-2.4.29/drivers/video/ims332.h 1970-01-01 01:00:00.000000000 +0100
32261 +++ linux-mips/drivers/video/ims332.h 2003-12-22 17:02:20.000000000 +0100
32262 @@ -0,0 +1,275 @@
32263 +/*
32264 + * linux/drivers/video/ims332.h
32265 + *
32266 + * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
32267 + *
32268 + * This file is subject to the terms and conditions of the GNU General
32269 + * Public License. See the file COPYING in the main directory of this
32270 + * archive for more details.
32271 + */
32272 +#include <linux/types.h>
32273 +
32274 +/*
32275 + * IMS332 16-bit wide, 128-bit aligned registers.
32276 + */
32277 +struct _ims332_reg {
32278 + volatile u16 r;
32279 + u16 pad[7];
32280 +};
32281 +
32282 +struct _ims332_regs {
32283 +#define IMS332_BOOT_PLL_MUTLIPLIER 0x00001f
32284 +#define IMS332_BOOT_CLOCK_SOURCE_SEL 0x000020
32285 +#define IMS332_BOOT_ADDRESS_ALIGNMENT 0x000040
32286 +#define IMS332_BOOT_WRITE_ZERO 0xffff80
32287 + struct _ims332_reg boot;
32288 + struct _ims332_reg pad0[0x020 - 0x000];
32289 + struct _ims332_reg half_sync;
32290 + struct _ims332_reg back_porch;
32291 + struct _ims332_reg display;
32292 + struct _ims332_reg short_display;
32293 + struct _ims332_reg broad_pulse;
32294 + struct _ims332_reg vsync;
32295 + struct _ims332_reg vpre_equalise;
32296 + struct _ims332_reg vpost_equalise;
32297 + struct _ims332_reg vblank;
32298 + struct _ims332_reg vdisplay;
32299 + struct _ims332_reg line_time;
32300 + struct _ims332_reg line_start;
32301 + struct _ims332_reg mem_init;
32302 + struct _ims332_reg transfer_delay;
32303 + struct _ims332_reg pad1[0x03f - 0x02e];
32304 + struct _ims332_reg pixel_address_mask;
32305 + struct _ims332_reg pad2[0x05f - 0x040];
32306 +
32307 +#define IMS332_CTRL_A_BOOT_ENABLE_VTG 0x000001
32308 +#define IMS332_CTRL_A_SCREEN_FORMAT 0x000002
32309 +#define IMS332_CTRL_A_INTERLACED_STANDARD 0x000004
32310 +#define IMS332_CTRL_A_OPERATING_MODE 0x000008
32311 +#define IMS332_CTRL_A_FRAME_FLYBACK_PATTERN 0x000010
32312 +#define IMS332_CTRL_A_DIGITAL_SYNC_FORMAT 0x000020
32313 +#define IMS332_CTRL_A_ANALOGUE_VIDEO_FORMAT 0x000040
32314 +#define IMS332_CTRL_A_BLANK_LEVEL 0x000080
32315 +#define IMS332_CTRL_A_BLANK_IO 0x000100
32316 +#define IMS332_CTRL_A_BLANK_FUNCTION_SWITCH 0x000200
32317 +#define IMS332_CTRL_A_FORCE_BLANKING 0x000400
32318 +#define IMS332_CTRL_A_TURN_OFF_BLANKING 0x000800
32319 +#define IMS332_CTRL_A_VRAM_ADDRESS_INCREMENT 0x003000
32320 +#define IMS332_CTRL_A_TURN_OFF_DMA 0x004000
32321 +#define IMS332_CTRL_A_SYNC_DELAY 0x038000
32322 +#define IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING 0x040000
32323 +#define IMS332_CTRL_A_DELAYED_SAMPLING 0x080000
32324 +#define IMS332_CTRL_A_BITS_PER_PIXEL 0x700000
32325 +#define IMS332_CTRL_A_CURSOR_DISABLE 0x800000
32326 + struct _ims332_reg config_control_a;
32327 + struct _ims332_reg pad3[0x06f - 0x060];
32328 +
32329 +#define IMS332_CTRL_B_WRITE_ZERO 0xffffff
32330 + struct _ims332_reg config_control_b;
32331 + struct _ims332_reg pad4[0x07f - 0x070];
32332 + struct _ims332_reg screen_top;
32333 + struct _ims332_reg pad5[0x0a0 - 0x080];
32334 + /* cursor color palette, 3 entries, reg no. 0xa1 - 0xa3 */
32335 + struct _ims332_reg cursor_color_palette0;
32336 + struct _ims332_reg cursor_color_palette1;
32337 + struct _ims332_reg cursor_color_palette2;
32338 + struct _ims332_reg pad6[0x0bf - 0x0a3];
32339 + struct _ims332_reg rgb_frame_checksum0;
32340 + struct _ims332_reg rgb_frame_checksum1;
32341 + struct _ims332_reg rgb_frame_checksum2;
32342 + struct _ims332_reg pad7[0x0c6 - 0x0c2];
32343 + struct _ims332_reg cursor_start;
32344 + struct _ims332_reg pad8[0x0ff - 0x0c7];
32345 + /* color palette, 256 entries of form 0x00BBGGRR, reg no. 0x100 - 0x1ff */
32346 + struct _ims332_reg color_palette[0x1ff - 0x0ff];
32347 + /* hardware cursor bitmap, reg no. 0x200 - 0x3ff */
32348 + struct _ims332_reg cursor_ram[0x3ff - 0x1ff];
32349 +};
32350 +
32351 +/*
32352 + * In the functions below we use some weird looking helper variables to
32353 + * access most members of this struct, otherwise the compiler splits
32354 + * the read/write in two byte accesses.
32355 + */
32356 +struct ims332_regs {
32357 + struct _ims332_regs rw;
32358 + char pad0[0x80000 - sizeof (struct _ims332_regs)];
32359 + struct _ims332_regs r;
32360 + char pad1[0xa0000 - (sizeof (struct _ims332_regs) + 0x80000)];
32361 + struct _ims332_regs w;
32362 +} __attribute__((packed));
32363 +
32364 +static inline void ims332_control_reg_bits(struct ims332_regs *regs, u32 mask,
32365 + u32 val)
32366 +{
32367 + volatile u16 *ctr = &(regs->r.config_control_a.r);
32368 + volatile u16 *ctw = &(regs->w.config_control_a.r);
32369 + u32 ctrl;
32370 +
32371 + mb();
32372 + ctrl = *ctr;
32373 + rmb();
32374 + ctrl |= ((regs->rw.boot.r << 8) & 0x00ff0000);
32375 + ctrl |= val & mask;
32376 + ctrl &= ~(~val & mask);
32377 + wmb();
32378 + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
32379 + wmb();
32380 + *ctw = ctrl & 0xffff;
32381 +}
32382 +
32383 +/* FIXME: This is maxinefb specific. */
32384 +static inline void ims332_bootstrap(struct ims332_regs *regs)
32385 +{
32386 + volatile u16 *ctw = &(regs->w.config_control_a.r);
32387 + u32 ctrl = IMS332_CTRL_A_BOOT_ENABLE_VTG | IMS332_CTRL_A_TURN_OFF_DMA;
32388 +
32389 + /* bootstrap sequence */
32390 + mb();
32391 + regs->rw.boot.r = 0;
32392 + wmb();
32393 + *ctw = 0;
32394 +
32395 + /* init control A register */
32396 + wmb();
32397 + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
32398 + wmb();
32399 + *ctw = ctrl & 0xffff;
32400 +}
32401 +
32402 +static inline void ims332_blank_screen(struct ims332_regs *regs, int blank)
32403 +{
32404 + ims332_control_reg_bits(regs, IMS332_CTRL_A_FORCE_BLANKING,
32405 + blank ? IMS332_CTRL_A_FORCE_BLANKING : 0);
32406 +}
32407 +
32408 +static inline void ims332_set_color_depth(struct ims332_regs *regs, u32 depth)
32409 +{
32410 + u32 dp;
32411 + u32 mask = (IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING
32412 + | IMS332_CTRL_A_DELAYED_SAMPLING
32413 + | IMS332_CTRL_A_BITS_PER_PIXEL);
32414 +
32415 + switch (depth) {
32416 + case 1: dp = 0 << 20; break;
32417 + case 2: dp = 1 << 20; break;
32418 + case 4: dp = 2 << 20; break;
32419 + case 8: dp = 3 << 20; break;
32420 + case 15: dp = (4 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
32421 + case 16: dp = (5 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
32422 + default: return;
32423 + }
32424 + ims332_control_reg_bits(regs, mask, dp);
32425 +
32426 + if (depth <= 8) {
32427 + volatile u16 *pmask = &(regs->w.pixel_address_mask.r);
32428 + u32 dm = (1 << depth) - 1;
32429 +
32430 + wmb();
32431 + regs->rw.boot.r = dm << 8;
32432 + wmb();
32433 + *pmask = dm << 8 | dm;
32434 + }
32435 +}
32436 +
32437 +static inline void ims332_set_screen_top(struct ims332_regs *regs, u16 top)
32438 +{
32439 + volatile u16 *st = &(regs->w.screen_top.r);
32440 +
32441 + mb();
32442 + *st = top & 0xffff;
32443 +}
32444 +
32445 +static inline void ims332_enable_cursor(struct ims332_regs *regs, int on)
32446 +{
32447 + ims332_control_reg_bits(regs, IMS332_CTRL_A_CURSOR_DISABLE,
32448 + on ? 0 : IMS332_CTRL_A_CURSOR_DISABLE);
32449 +}
32450 +
32451 +static inline void ims332_position_cursor(struct ims332_regs *regs,
32452 + u16 x, u16 y)
32453 +{
32454 + volatile u16 *cp = &(regs->w.cursor_start.r);
32455 + u32 val = ((x & 0xfff) << 12) | (y & 0xfff);
32456 +
32457 + if (x > 2303 || y > 2303)
32458 + return;
32459 +
32460 + mb();
32461 + regs->rw.boot.r = (val >> 8) & 0xff00;
32462 + wmb();
32463 + *cp = val & 0xffff;
32464 +}
32465 +
32466 +static inline void ims332_set_font(struct ims332_regs *regs, u8 fgc,
32467 + u16 width, u16 height)
32468 +{
32469 + volatile u16 *cp0 = &(regs->w.cursor_color_palette0.r);
32470 + int i;
32471 +
32472 + mb();
32473 + for (i = 0; i < 0x200; i++) {
32474 + volatile u16 *cram = &(regs->w.cursor_ram[i].r);
32475 +
32476 + if (height << 6 <= i << 3)
32477 + *cram = 0x0000;
32478 + else if (width <= i % 8 << 3)
32479 + *cram = 0x0000;
32480 + else if (((width >> 3) & 0xffff) > i % 8)
32481 + *cram = 0x5555;
32482 + else
32483 + *cram = 0x5555 & ~(0xffff << (width % 8 << 1));
32484 + wmb();
32485 + }
32486 + regs->rw.boot.r = fgc << 8;
32487 + wmb();
32488 + *cp0 = fgc << 8 | fgc;
32489 +}
32490 +
32491 +static inline void ims332_read_cmap(struct ims332_regs *regs, u8 reg,
32492 + u8* red, u8* green, u8* blue)
32493 +{
32494 + volatile u16 *rptr = &(regs->r.color_palette[reg].r);
32495 + u16 val;
32496 +
32497 + mb();
32498 + val = *rptr;
32499 + *red = val & 0xff;
32500 + *green = (val >> 8) & 0xff;
32501 + rmb();
32502 + *blue = (regs->rw.boot.r >> 8) & 0xff;
32503 +}
32504 +
32505 +static inline void ims332_write_cmap(struct ims332_regs *regs, u8 reg,
32506 + u8 red, u8 green, u8 blue)
32507 +{
32508 + volatile u16 *wptr = &(regs->w.color_palette[reg].r);
32509 +
32510 + mb();
32511 + regs->rw.boot.r = blue << 8;
32512 + wmb();
32513 + *wptr = (green << 8) + red;
32514 +}
32515 +
32516 +static inline void ims332_dump_regs(struct ims332_regs *regs)
32517 +{
32518 + int i;
32519 +
32520 + printk(__FUNCTION__);
32521 + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG, 0);
32522 + for (i = 0; i < 0x100; i++) {
32523 + volatile u16 *cpad = (u16 *)((char *)(&regs->r) + sizeof(struct _ims332_reg) * i);
32524 + u32 val;
32525 +
32526 + val = *cpad;
32527 + rmb();
32528 + val |= regs->rw.boot.r << 8;
32529 + rmb();
32530 + if (! (i % 8))
32531 + printk("\n%02x:", i);
32532 + printk(" %06x", val);
32533 + }
32534 + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG,
32535 + IMS332_CTRL_A_BOOT_ENABLE_VTG);
32536 + printk("\n");
32537 +}
32538 diff -Nur linux-2.4.29/drivers/video/Makefile linux-mips/drivers/video/Makefile
32539 --- linux-2.4.29/drivers/video/Makefile 2004-02-18 14:36:31.000000000 +0100
32540 +++ linux-mips/drivers/video/Makefile 2005-03-26 11:47:35.762782246 +0100
32541 @@ -87,6 +87,7 @@
32542 obj-$(CONFIG_FB_MAXINE) += maxinefb.o
32543 obj-$(CONFIG_FB_TX3912) += tx3912fb.o
32544 obj-$(CONFIG_FB_AU1100) += au1100fb.o fbgen.o
32545 +obj-$(CONFIG_FB_AU1200) += au1200fb.o fbgen.o
32546 obj-$(CONFIG_FB_IT8181) += it8181fb.o fbgen.o
32547
32548 subdir-$(CONFIG_STI_CONSOLE) += sti
32549 diff -Nur linux-2.4.29/drivers/video/maxinefb.h linux-mips/drivers/video/maxinefb.h
32550 --- linux-2.4.29/drivers/video/maxinefb.h 2003-08-25 13:44:42.000000000 +0200
32551 +++ linux-mips/drivers/video/maxinefb.h 1970-01-01 01:00:00.000000000 +0100
32552 @@ -1,38 +0,0 @@
32553 -/*
32554 - * linux/drivers/video/maxinefb.h
32555 - *
32556 - * DECstation 5000/xx onboard framebuffer support, Copyright (C) 1999 by
32557 - * Michael Engel <engel@unix-ag.org> and Karsten Merker <merker@guug.de>
32558 - * This file is subject to the terms and conditions of the GNU General
32559 - * Public License. See the file COPYING in the main directory of this
32560 - * archive for more details.
32561 - */
32562 -
32563 -#include <asm/addrspace.h>
32564 -
32565 -/*
32566 - * IMS332 video controller register base address
32567 - */
32568 -#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000)
32569 -
32570 -/*
32571 - * Begin of DECstation 5000/xx onboard framebuffer memory, default resolution
32572 - * is 1024x768x8
32573 - */
32574 -#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000)
32575 -
32576 -/*
32577 - * The IMS 332 video controller used in the DECstation 5000/xx series
32578 - * uses 32 bits wide registers; the following defines declare the
32579 - * register numbers, to get the real offset, these have to be multiplied
32580 - * by four.
32581 - */
32582 -
32583 -#define IMS332_REG_CURSOR_RAM 0x200 /* hardware cursor bitmap */
32584 -
32585 -/*
32586 - * The color palette entries have the form 0x00BBGGRR
32587 - */
32588 -#define IMS332_REG_COLOR_PALETTE 0x100 /* color palette, 256 entries */
32589 -#define IMS332_REG_CURSOR_COLOR_PALETTE 0x0a1 /* cursor color palette, */
32590 - /* 3 entries */
32591 diff -Nur linux-2.4.29/drivers/video/newport_con.c linux-mips/drivers/video/newport_con.c
32592 --- linux-2.4.29/drivers/video/newport_con.c 2003-08-25 13:44:42.000000000 +0200
32593 +++ linux-mips/drivers/video/newport_con.c 2004-09-23 15:32:29.000000000 +0200
32594 @@ -22,6 +22,7 @@
32595 #include <linux/module.h>
32596 #include <linux/slab.h>
32597
32598 +#include <asm/io.h>
32599 #include <asm/uaccess.h>
32600 #include <asm/system.h>
32601 #include <asm/page.h>
32602 @@ -77,7 +78,7 @@
32603 static inline void newport_render_background(int xstart, int ystart,
32604 int xend, int yend, int ci)
32605 {
32606 - newport_wait();
32607 + newport_wait(npregs);
32608 npregs->set.wrmask = 0xffffffff;
32609 npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
32610 NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
32611 @@ -94,7 +95,7 @@
32612 unsigned short i;
32613
32614 for (i = 0; i < 16; i++) {
32615 - newport_bfwait();
32616 + newport_bfwait(npregs);
32617 newport_cmap_setaddr(npregs, color_table[i]);
32618 newport_cmap_setrgb(npregs,
32619 default_red[i],
32620 @@ -107,7 +108,7 @@
32621 unsigned long i;
32622
32623 for (i = 0; i < LINUX_LOGO_COLORS; i++) {
32624 - newport_bfwait();
32625 + newport_bfwait(npregs);
32626 newport_cmap_setaddr(npregs, i + 0x20);
32627 newport_cmap_setrgb(npregs,
32628 linux_logo_red[i],
32629 @@ -115,13 +116,13 @@
32630 linux_logo_blue[i]);
32631 }
32632
32633 - newport_wait();
32634 + newport_wait(npregs);
32635 npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
32636 NPORT_DMODE0_CHOST);
32637
32638 npregs->set.xystarti = ((newport_xsize - LOGO_W) << 16) | (0);
32639 npregs->set.xyendi = ((newport_xsize - 1) << 16);
32640 - newport_wait();
32641 + newport_wait(npregs);
32642
32643 for (i = 0; i < LOGO_W * LOGO_H; i++)
32644 npregs->go.hostrw0 = linux_logo[i] << 24;
32645 @@ -133,7 +134,7 @@
32646 if (logo_active)
32647 return;
32648
32649 - newport_wait();
32650 + newport_wait(npregs);
32651 npregs->set.wrmask = 0xffffffff;
32652 npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
32653 NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
32654 @@ -155,7 +156,7 @@
32655 unsigned short treg;
32656 int i;
32657
32658 - newport_wait();
32659 + newport_wait(npregs);
32660 treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
32661 newport_vc2_set(npregs, VC2_IREG_CONTROL,
32662 (treg | VC2_CTRL_EVIDEO));
32663 @@ -165,7 +166,7 @@
32664 npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
32665 NPORT_DMODE_W2 | VC2_PROTOCOL);
32666 for (i = 0; i < 128; i++) {
32667 - newport_bfwait();
32668 + newport_bfwait(npregs);
32669 if (i == 92 || i == 94)
32670 npregs->set.dcbdata0.byshort.s1 = 0xff00;
32671 else
32672 @@ -205,7 +206,7 @@
32673 npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
32674 NPORT_DMODE_W2 | VC2_PROTOCOL);
32675 for (i = 0; i < 128; i++) {
32676 - newport_bfwait();
32677 + newport_bfwait(npregs);
32678 linetable[i] = npregs->set.dcbdata0.byshort.s1;
32679 }
32680
32681 @@ -216,12 +217,12 @@
32682 npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
32683 NPORT_DMODE_W2 | VC2_PROTOCOL);
32684 do {
32685 - newport_bfwait();
32686 + newport_bfwait(npregs);
32687 treg = npregs->set.dcbdata0.byshort.s1;
32688 if ((treg & 1) == 0)
32689 cols += (treg >> 7) & 0xfe;
32690 if ((treg & 0x80) == 0) {
32691 - newport_bfwait();
32692 + newport_bfwait(npregs);
32693 treg = npregs->set.dcbdata0.byshort.s1;
32694 }
32695 } while ((treg & 0x8000) == 0);
32696 @@ -291,16 +292,16 @@
32697
32698 if (!sgi_gfxaddr)
32699 return NULL;
32700 - npregs = (struct newport_regs *) (KSEG1 + sgi_gfxaddr);
32701 + npregs = (struct newport_regs *) /* ioremap cannot fail */
32702 + ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
32703 npregs->cset.config = NPORT_CFG_GD0;
32704
32705 - if (newport_wait()) {
32706 - return NULL;
32707 - }
32708 + if (newport_wait(npregs))
32709 + goto out_unmap;
32710
32711 npregs->set.xstarti = TESTVAL;
32712 if (npregs->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
32713 - return NULL;
32714 + goto out_unmap;
32715
32716 for (i = 0; i < MAX_NR_CONSOLES; i++)
32717 font_data[i] = FONT_DATA;
32718 @@ -310,6 +311,10 @@
32719 newport_get_screensize();
32720
32721 return "SGI Newport";
32722 +
32723 +out_unmap:
32724 + iounmap((void *)npregs);
32725 + return NULL;
32726 }
32727
32728 static void newport_init(struct vc_data *vc, int init)
32729 @@ -363,7 +368,7 @@
32730 (charattr & 0xf0) >> 4);
32731
32732 /* Set the color and drawing mode. */
32733 - newport_wait();
32734 + newport_wait(npregs);
32735 npregs->set.colori = charattr & 0xf;
32736 npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
32737 NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
32738 @@ -372,7 +377,7 @@
32739 /* Set coordinates for bitmap operation. */
32740 npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
32741 npregs->set.xyendi = ((xpos + 7) << 16);
32742 - newport_wait();
32743 + newport_wait(npregs);
32744
32745 /* Go, baby, go... */
32746 RENDER(npregs, p);
32747 @@ -396,7 +401,7 @@
32748 xpos + ((count - 1) << 3), ypos,
32749 (charattr & 0xf0) >> 4);
32750
32751 - newport_wait();
32752 + newport_wait(npregs);
32753
32754 /* Set the color and drawing mode. */
32755 npregs->set.colori = charattr & 0xf;
32756 @@ -407,7 +412,7 @@
32757 for (i = 0; i < count; i++, xpos += 8) {
32758 p = &font_data[vc->vc_num][(scr_readw(s++) & 0xff) << 4];
32759
32760 - newport_wait();
32761 + newport_wait(npregs);
32762
32763 /* Set coordinates for bitmap operation. */
32764 npregs->set.xystarti =
32765 @@ -689,7 +694,7 @@
32766 xe = xs;
32767 xs = tmp;
32768 }
32769 - newport_wait();
32770 + newport_wait(npregs);
32771 npregs->set.drawmode0 = (NPORT_DMODE0_S2S | NPORT_DMODE0_BLOCK |
32772 NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
32773 | NPORT_DMODE0_STOPY);
32774 @@ -706,35 +711,35 @@
32775 #define DUMMY (void *) newport_dummy
32776
32777 const struct consw newport_con = {
32778 - con_startup: newport_startup,
32779 - con_init: newport_init,
32780 - con_deinit: newport_deinit,
32781 - con_clear: newport_clear,
32782 - con_putc: newport_putc,
32783 - con_putcs: newport_putcs,
32784 - con_cursor: newport_cursor,
32785 - con_scroll: newport_scroll,
32786 - con_bmove: newport_bmove,
32787 - con_switch: newport_switch,
32788 - con_blank: newport_blank,
32789 - con_font_op: newport_font_op,
32790 - con_set_palette: newport_set_palette,
32791 - con_scrolldelta: newport_scrolldelta,
32792 - con_set_origin: DUMMY,
32793 - con_save_screen: DUMMY
32794 + .con_startup = newport_startup,
32795 + .con_init = newport_init,
32796 + .con_deinit = newport_deinit,
32797 + .con_clear = newport_clear,
32798 + .con_putc = newport_putc,
32799 + .con_putcs = newport_putcs,
32800 + .con_cursor = newport_cursor,
32801 + .con_scroll = newport_scroll,
32802 + .con_bmove = newport_bmove,
32803 + .con_switch = newport_switch,
32804 + .con_blank = newport_blank,
32805 + .con_font_op = newport_font_op,
32806 + .con_set_palette = newport_set_palette,
32807 + .con_scrolldelta = newport_scrolldelta,
32808 + .con_set_origin = DUMMY,
32809 + .con_save_screen = DUMMY
32810 };
32811
32812 #ifdef MODULE
32813 static int __init newport_console_init(void)
32814 {
32815 take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
32816 -
32817 return 0;
32818 }
32819
32820 static void __exit newport_console_exit(void)
32821 {
32822 give_up_console(&newport_con);
32823 + iounmap((void *)npregs);
32824 }
32825
32826 module_init(newport_console_init);
32827 diff -Nur linux-2.4.29/drivers/video/tgafb.c linux-mips/drivers/video/tgafb.c
32828 --- linux-2.4.29/drivers/video/tgafb.c 2001-11-14 23:52:20.000000000 +0100
32829 +++ linux-mips/drivers/video/tgafb.c 2004-10-30 01:15:02.000000000 +0200
32830 @@ -45,6 +45,15 @@
32831 #include <linux/console.h>
32832 #include <asm/io.h>
32833
32834 +#ifdef CONFIG_TC
32835 +#include <asm/dec/tc.h>
32836 +#else
32837 +static int search_tc_card(const char *) { return -1; }
32838 +static void claim_tc_card(int) { }
32839 +static void release_tc_card(int) { }
32840 +static unsigned long get_tc_base_addr(int) { return 0; }
32841 +#endif
32842 +
32843 #include <video/fbcon.h>
32844 #include <video/fbcon-cfb8.h>
32845 #include <video/fbcon-cfb32.h>
32846 @@ -84,10 +93,10 @@
32847 };
32848
32849 static unsigned int deep_presets[4] = {
32850 - 0x00014000,
32851 - 0x0001440d,
32852 + 0x00004000,
32853 + 0x0000440d,
32854 0xffffffff,
32855 - 0x0001441d
32856 + 0x0000441d
32857 };
32858
32859 static unsigned int rasterop_presets[4] = {
32860 @@ -131,6 +140,13 @@
32861 0,
32862 FB_VMODE_NONINTERLACED
32863 }},
32864 + { "1280x1024-72", { /* mode #0 of PMAGD boards */
32865 + 1280, 1024, 1280, 1024, 0, 0, 0, 0,
32866 + {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
32867 + 0, 0, -1, -1, FB_ACCELF_TEXT, 7692, 232, 32, 34, 3, 160, 3,
32868 + FB_SYNC_ON_GREEN,
32869 + FB_VMODE_NONINTERLACED
32870 + }},
32871 { "800x600-56", {
32872 800, 600, 800, 600, 0, 0, 0, 0,
32873 {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
32874 @@ -488,7 +504,8 @@
32875 continue;
32876
32877 mb();
32878 - TGA_WRITE_REG(deep_presets[fb_info.tga_type], TGA_DEEP_REG);
32879 + TGA_WRITE_REG(deep_presets[fb_info.tga_type] |
32880 + (par->sync_on_green ? 0x0 : 0x00010000), TGA_DEEP_REG);
32881 while (TGA_READ_REG(TGA_CMD_STAT_REG) & 1) /* wait for not busy */
32882 continue;
32883 mb();
32884 @@ -548,7 +565,7 @@
32885 BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_0, 0x40);
32886 BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_1, 0x08);
32887 BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_2,
32888 - (par->sync_on_green ? 0x80 : 0x40));
32889 + (par->sync_on_green ? 0xc0 : 0x40));
32890
32891 BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_0, 0xff);
32892 BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_1, 0xff);
32893 @@ -921,19 +938,34 @@
32894 int __init tgafb_init(void)
32895 {
32896 struct pci_dev *pdev;
32897 + int slot;
32898
32899 pdev = pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA, NULL);
32900 if (!pdev)
32901 + slot = search_tc_card("PMAGD");
32902 + if (!pdev && slot < 0)
32903 return -ENXIO;
32904
32905 /* divine board type */
32906
32907 - fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start, 0);
32908 - fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
32909 - fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
32910 - fb_info.tga_fb_base = (fb_info.tga_mem_base
32911 + if (pdev) {
32912 + fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start,
32913 + 0);
32914 + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
32915 + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
32916 + fb_info.tga_fb_base = (fb_info.tga_mem_base
32917 + fb_offset_presets[fb_info.tga_type]);
32918 - pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
32919 + pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
32920 +
32921 + } else {
32922 + claim_tc_card(slot);
32923 + fb_info.tga_mem_base = get_tc_base_addr(slot);
32924 + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f; /* ? */
32925 + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
32926 + fb_info.tga_fb_base = (fb_info.tga_mem_base
32927 + + fb_offset_presets[fb_info.tga_type]);
32928 + fb_info.tga_chip_rev = TGA_READ_REG(TGA_START_REG) & 0xff;
32929 + }
32930
32931 /* setup framebuffer */
32932
32933 @@ -950,40 +982,62 @@
32934 fb_info.gen.fbhw = &tgafb_hwswitch;
32935 fb_info.gen.fbhw->detect();
32936
32937 - printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n", fb_info.tga_chip_rev);
32938 - printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
32939 - pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
32940 + if (pdev) {
32941 + printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n",
32942 + fb_info.tga_chip_rev);
32943 + printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
32944 + pdev->bus->number,
32945 + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
32946 + } else {
32947 + printk (KERN_INFO "tgafb: SFB+ detected, rev=0x%02x\n",
32948 + fb_info.tga_chip_rev);
32949 + }
32950
32951 switch (fb_info.tga_type)
32952 {
32953 case TGA_TYPE_8PLANE:
32954 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
32955 + if (pdev)
32956 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
32957 + else
32958 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E1");
32959 break;
32960
32961 case TGA_TYPE_24PLANE:
32962 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
32963 + if (pdev)
32964 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
32965 + else
32966 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E2");
32967 break;
32968
32969 case TGA_TYPE_24PLUSZ:
32970 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
32971 + if (pdev)
32972 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
32973 + else
32974 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E3");
32975 break;
32976 }
32977
32978 /* This should give a reasonable default video mode */
32979
32980 if (!default_var_valid) {
32981 - default_var = tgafb_predefined[0].var;
32982 + if (pdev)
32983 + default_var = tgafb_predefined[0].var;
32984 + else
32985 + default_var = tgafb_predefined[1].var;
32986 }
32987 fbgen_get_var(&disp.var, -1, &fb_info.gen.info);
32988 disp.var.activate = FB_ACTIVATE_NOW;
32989 fbgen_do_set_var(&disp.var, 1, &fb_info.gen);
32990 fbgen_set_disp(-1, &fb_info.gen);
32991 fbgen_install_cmap(0, &fb_info.gen);
32992 - if (register_framebuffer(&fb_info.gen.info) < 0)
32993 + if (register_framebuffer(&fb_info.gen.info) < 0) {
32994 + if (slot >= 0)
32995 + release_tc_card(slot);
32996 return -EINVAL;
32997 - printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
32998 + }
32999 + printk(KERN_INFO "fb%d: %s frame buffer device at 0x%llx\n",
33000 GET_FB_IDX(fb_info.gen.info.node), fb_info.gen.info.modename,
33001 - pdev->resource[0].start);
33002 + fb_info.tga_mem_base);
33003 return 0;
33004 }
33005
33006 diff -Nur linux-2.4.29/drivers/video/tgafb.h linux-mips/drivers/video/tgafb.h
33007 --- linux-2.4.29/drivers/video/tgafb.h 2000-04-12 18:47:28.000000000 +0200
33008 +++ linux-mips/drivers/video/tgafb.h 2004-10-30 01:15:02.000000000 +0200
33009 @@ -36,6 +36,7 @@
33010 #define TGA_RASTEROP_REG 0x0034
33011 #define TGA_PIXELSHIFT_REG 0x0038
33012 #define TGA_DEEP_REG 0x0050
33013 +#define TGA_START_REG 0x0054
33014 #define TGA_PIXELMASK_REG 0x005c
33015 #define TGA_CURSOR_BASE_REG 0x0060
33016 #define TGA_HORIZ_REG 0x0064
33017 diff -Nur linux-2.4.29/fs/binfmt_elf.c linux-mips/fs/binfmt_elf.c
33018 --- linux-2.4.29/fs/binfmt_elf.c 2005-01-19 15:10:10.000000000 +0100
33019 +++ linux-mips/fs/binfmt_elf.c 2005-01-13 11:59:03.000000000 +0100
33020 @@ -660,6 +660,9 @@
33021 bprm->argc++;
33022 }
33023 }
33024 + } else {
33025 + /* Executables without an interpreter also need a personality */
33026 + SET_PERSONALITY(elf_ex, ibcs2_interpreter);
33027 }
33028
33029 /* Flush all traces of the currently running executable */
33030 @@ -1208,7 +1211,11 @@
33031 elf.e_entry = 0;
33032 elf.e_phoff = sizeof(elf);
33033 elf.e_shoff = 0;
33034 +#ifdef ELF_CORE_EFLAGS
33035 + elf.e_flags = ELF_CORE_EFLAGS;
33036 +#else
33037 elf.e_flags = 0;
33038 +#endif
33039 elf.e_ehsize = sizeof(elf);
33040 elf.e_phentsize = sizeof(struct elf_phdr);
33041 elf.e_phnum = segs+1; /* Include notes */
33042 diff -Nur linux-2.4.29/fs/ext3/fsync.c linux-mips/fs/ext3/fsync.c
33043 --- linux-2.4.29/fs/ext3/fsync.c 2002-11-29 00:53:15.000000000 +0100
33044 +++ linux-mips/fs/ext3/fsync.c 2005-03-26 11:47:36.070731705 +0100
33045 @@ -69,7 +69,7 @@
33046 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
33047 ret |= fsync_inode_data_buffers(inode);
33048
33049 - ext3_force_commit(inode->i_sb);
33050 + ret |= ext3_force_commit(inode->i_sb);
33051
33052 return ret;
33053 }
33054 diff -Nur linux-2.4.29/fs/ext3/super.c linux-mips/fs/ext3/super.c
33055 --- linux-2.4.29/fs/ext3/super.c 2004-11-17 12:54:21.000000000 +0100
33056 +++ linux-mips/fs/ext3/super.c 2005-03-26 11:47:36.071731541 +0100
33057 @@ -1608,12 +1608,13 @@
33058
33059 static int ext3_sync_fs(struct super_block *sb)
33060 {
33061 + int err;
33062 tid_t target;
33063
33064 sb->s_dirt = 0;
33065 target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
33066 - log_wait_commit(EXT3_SB(sb)->s_journal, target);
33067 - return 0;
33068 + err = log_wait_commit(EXT3_SB(sb)->s_journal, target);
33069 + return err;
33070 }
33071
33072 /*
33073 diff -Nur linux-2.4.29/fs/file_table.c linux-mips/fs/file_table.c
33074 --- linux-2.4.29/fs/file_table.c 2004-11-17 12:54:21.000000000 +0100
33075 +++ linux-mips/fs/file_table.c 2005-03-26 11:47:36.063732854 +0100
33076 @@ -46,6 +46,7 @@
33077 f->f_version = ++event;
33078 f->f_uid = current->fsuid;
33079 f->f_gid = current->fsgid;
33080 + f->f_maxcount = INT_MAX;
33081 list_add(&f->f_list, &anon_list);
33082 file_list_unlock();
33083 return f;
33084 @@ -91,6 +92,8 @@
33085 filp->f_uid = current->fsuid;
33086 filp->f_gid = current->fsgid;
33087 filp->f_op = dentry->d_inode->i_fop;
33088 + filp->f_maxcount = INT_MAX;
33089 +
33090 if (filp->f_op->open)
33091 return filp->f_op->open(dentry->d_inode, filp);
33092 else
33093 diff -Nur linux-2.4.29/fs/jbd/commit.c linux-mips/fs/jbd/commit.c
33094 --- linux-2.4.29/fs/jbd/commit.c 2004-02-18 14:36:31.000000000 +0100
33095 +++ linux-mips/fs/jbd/commit.c 2005-03-26 11:47:36.078730392 +0100
33096 @@ -92,7 +92,7 @@
33097 struct buffer_head *wbuf[64];
33098 int bufs;
33099 int flags;
33100 - int err;
33101 + int err = 0;
33102 unsigned long blocknr;
33103 char *tagp = NULL;
33104 journal_header_t *header;
33105 @@ -299,6 +299,8 @@
33106 spin_unlock(&journal_datalist_lock);
33107 unlock_journal(journal);
33108 wait_on_buffer(bh);
33109 + if (unlikely(!buffer_uptodate(bh)))
33110 + err = -EIO;
33111 /* the journal_head may have been removed now */
33112 lock_journal(journal);
33113 goto write_out_data;
33114 @@ -326,6 +328,8 @@
33115 spin_unlock(&journal_datalist_lock);
33116 unlock_journal(journal);
33117 wait_on_buffer(bh);
33118 + if (unlikely(!buffer_uptodate(bh)))
33119 + err = -EIO;
33120 lock_journal(journal);
33121 spin_lock(&journal_datalist_lock);
33122 continue; /* List may have changed */
33123 @@ -351,6 +355,9 @@
33124 }
33125 spin_unlock(&journal_datalist_lock);
33126
33127 + if (err)
33128 + __journal_abort_hard(journal);
33129 +
33130 /*
33131 * If we found any dirty or locked buffers, then we should have
33132 * looped back up to the write_out_data label. If there weren't
33133 @@ -541,6 +548,8 @@
33134 if (buffer_locked(bh)) {
33135 unlock_journal(journal);
33136 wait_on_buffer(bh);
33137 + if (unlikely(!buffer_uptodate(bh)))
33138 + err = -EIO;
33139 lock_journal(journal);
33140 goto wait_for_iobuf;
33141 }
33142 @@ -602,6 +611,8 @@
33143 if (buffer_locked(bh)) {
33144 unlock_journal(journal);
33145 wait_on_buffer(bh);
33146 + if (unlikely(!buffer_uptodate(bh)))
33147 + err = -EIO;
33148 lock_journal(journal);
33149 goto wait_for_ctlbuf;
33150 }
33151 @@ -650,6 +661,8 @@
33152 bh->b_end_io = journal_end_buffer_io_sync;
33153 submit_bh(WRITE, bh);
33154 wait_on_buffer(bh);
33155 + if (unlikely(!buffer_uptodate(bh)))
33156 + err = -EIO;
33157 put_bh(bh); /* One for getblk() */
33158 journal_unlock_journal_head(descriptor);
33159 }
33160 @@ -661,6 +674,9 @@
33161
33162 skip_commit: /* The journal should be unlocked by now. */
33163
33164 + if (err)
33165 + __journal_abort_hard(journal);
33166 +
33167 /* Call any callbacks that had been registered for handles in this
33168 * transaction. It is up to the callback to free any allocated
33169 * memory.
33170 diff -Nur linux-2.4.29/fs/jbd/journal.c linux-mips/fs/jbd/journal.c
33171 --- linux-2.4.29/fs/jbd/journal.c 2004-11-17 12:54:21.000000000 +0100
33172 +++ linux-mips/fs/jbd/journal.c 2005-03-26 11:47:36.079730228 +0100
33173 @@ -582,8 +582,10 @@
33174 * Wait for a specified commit to complete.
33175 * The caller may not hold the journal lock.
33176 */
33177 -void log_wait_commit (journal_t *journal, tid_t tid)
33178 +int log_wait_commit (journal_t *journal, tid_t tid)
33179 {
33180 + int err = 0;
33181 +
33182 lock_kernel();
33183 #ifdef CONFIG_JBD_DEBUG
33184 lock_journal(journal);
33185 @@ -600,6 +602,12 @@
33186 sleep_on(&journal->j_wait_done_commit);
33187 }
33188 unlock_kernel();
33189 +
33190 + if (unlikely(is_journal_aborted(journal))) {
33191 + printk(KERN_EMERG "journal commit I/O error\n");
33192 + err = -EIO;
33193 + }
33194 + return err;
33195 }
33196
33197 /*
33198 @@ -1326,7 +1334,7 @@
33199
33200 /* Wait for the log commit to complete... */
33201 if (transaction)
33202 - log_wait_commit(journal, transaction->t_tid);
33203 + err = log_wait_commit(journal, transaction->t_tid);
33204
33205 /* ...and flush everything in the log out to disk. */
33206 lock_journal(journal);
33207 diff -Nur linux-2.4.29/fs/jbd/transaction.c linux-mips/fs/jbd/transaction.c
33208 --- linux-2.4.29/fs/jbd/transaction.c 2004-08-08 01:26:05.000000000 +0200
33209 +++ linux-mips/fs/jbd/transaction.c 2005-03-26 11:47:36.081729900 +0100
33210 @@ -1484,7 +1484,7 @@
33211 * to wait for the commit to complete.
33212 */
33213 if (handle->h_sync && !(current->flags & PF_MEMALLOC))
33214 - log_wait_commit(journal, tid);
33215 + err = log_wait_commit(journal, tid);
33216 }
33217 kfree(handle);
33218 return err;
33219 @@ -1509,7 +1509,7 @@
33220 goto out;
33221 }
33222 handle->h_sync = 1;
33223 - journal_stop(handle);
33224 + ret = journal_stop(handle);
33225 out:
33226 unlock_kernel();
33227 return ret;
33228 diff -Nur linux-2.4.29/fs/jfs/jfs_defragfs.h linux-mips/fs/jfs/jfs_defragfs.h
33229 --- linux-2.4.29/fs/jfs/jfs_defragfs.h 2002-11-29 00:53:15.000000000 +0100
33230 +++ linux-mips/fs/jfs/jfs_defragfs.h 1970-01-01 01:00:00.000000000 +0100
33231 @@ -1,51 +0,0 @@
33232 -/*
33233 - * Copyright (c) International Business Machines Corp., 2000-2001
33234 - *
33235 - * This program is free software; you can redistribute it and/or modify
33236 - * it under the terms of the GNU General Public License as published by
33237 - * the Free Software Foundation; either version 2 of the License, or
33238 - * (at your option) any later version.
33239 - *
33240 - * This program is distributed in the hope that it will be useful,
33241 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
33242 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
33243 - * the GNU General Public License for more details.
33244 - *
33245 - * You should have received a copy of the GNU General Public License
33246 - * along with this program; if not, write to the Free Software
33247 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33248 - */
33249 -#ifndef _H_JFS_DEFRAGFS
33250 -#define _H_JFS_DEFRAGFS
33251 -
33252 -/*
33253 - * defragfs parameter list
33254 - */
33255 -struct defragfs {
33256 - uint flag; /* 4: */
33257 - u8 dev; /* 1: */
33258 - u8 pad[3]; /* 3: */
33259 - s32 fileset; /* 4: */
33260 - u32 inostamp; /* 4: */
33261 - u32 ino; /* 4: */
33262 - u32 gen; /* 4: */
33263 - s64 xoff; /* 8: */
33264 - s64 old_xaddr; /* 8: */
33265 - s64 new_xaddr; /* 8: */
33266 - s32 xlen; /* 4: */
33267 -};
33268 -
33269 -/* plist flag */
33270 -#define DEFRAGFS_SYNC 0x80000000
33271 -#define DEFRAGFS_COMMIT 0x40000000
33272 -#define DEFRAGFS_RELOCATE 0x10000000
33273 -
33274 -#define INODE_TYPE 0x0000F000 /* IFREG or IFDIR */
33275 -
33276 -#define EXTENT_TYPE 0x000000ff
33277 -#define DTPAGE 0x00000001
33278 -#define XTPAGE 0x00000002
33279 -#define DATAEXT 0x00000004
33280 -#define EAEXT 0x00000008
33281 -
33282 -#endif /* _H_JFS_DEFRAGFS */
33283 diff -Nur linux-2.4.29/fs/jfs/jfs_imap.c linux-mips/fs/jfs/jfs_imap.c
33284 --- linux-2.4.29/fs/jfs/jfs_imap.c 2005-01-19 15:10:10.000000000 +0100
33285 +++ linux-mips/fs/jfs/jfs_imap.c 2005-03-26 11:47:36.085729244 +0100
33286 @@ -486,7 +486,6 @@
33287 /* read the page of fixed disk inode (AIT) in raw mode */
33288 mp = read_metapage(ip, address << sbi->l2nbperpage, PSIZE, 1);
33289 if (mp == NULL) {
33290 - ip->i_sb = NULL;
33291 ip->i_nlink = 1; /* Don't want iput() deleting it */
33292 iput(ip);
33293 return (NULL);
33294 @@ -499,7 +498,6 @@
33295 /* copy on-disk inode to in-memory inode */
33296 if ((copy_from_dinode(dp, ip)) != 0) {
33297 /* handle bad return by returning NULL for ip */
33298 - ip->i_sb = NULL;
33299 ip->i_nlink = 1; /* Don't want iput() deleting it */
33300 iput(ip);
33301 /* release the page */
33302 diff -Nur linux-2.4.29/fs/jfs/jfs_metapage.c linux-mips/fs/jfs/jfs_metapage.c
33303 --- linux-2.4.29/fs/jfs/jfs_metapage.c 2004-11-17 12:54:21.000000000 +0100
33304 +++ linux-mips/fs/jfs/jfs_metapage.c 2005-03-26 11:47:36.086729079 +0100
33305 @@ -298,14 +298,14 @@
33306 mp = search_hash(hash_ptr, mapping, lblock);
33307 if (mp) {
33308 page_found:
33309 - mp->count++;
33310 - lock_metapage(mp);
33311 - spin_unlock(&meta_lock);
33312 if (test_bit(META_stale, &mp->flag)) {
33313 - release_metapage(mp);
33314 - yield(); /* Let other waiters release it, too */
33315 + spin_unlock(&meta_lock);
33316 + yield();
33317 goto again;
33318 }
33319 + mp->count++;
33320 + lock_metapage(mp);
33321 + spin_unlock(&meta_lock);
33322 if (test_bit(META_discard, &mp->flag)) {
33323 if (!new) {
33324 jfs_error(inode->i_sb,
33325 @@ -518,7 +518,6 @@
33326 }
33327
33328 if (mp->page) {
33329 - /* Releasing spinlock, we have to check mp->count later */
33330 set_bit(META_stale, &mp->flag);
33331 spin_unlock(&meta_lock);
33332 kunmap(mp->page);
33333 @@ -555,12 +554,6 @@
33334 list_del(&mp->synclist);
33335 LOGSYNC_UNLOCK(log);
33336 }
33337 - if (mp->count) {
33338 - /* Someone else is trying to get this metpage */
33339 - unlock_metapage(mp);
33340 - spin_unlock(&meta_lock);
33341 - return;
33342 - }
33343 remove_from_hash(mp, meta_hash(mp->mapping, mp->index));
33344 spin_unlock(&meta_lock);
33345
33346 @@ -589,12 +582,8 @@
33347 mp = search_hash(hash_ptr, mapping, lblock);
33348 if (mp) {
33349 if (test_bit(META_stale, &mp->flag)) {
33350 - /* Racing with release_metapage */
33351 - mp->count++;
33352 - lock_metapage(mp);
33353 spin_unlock(&meta_lock);
33354 - /* racing release_metapage should be done now */
33355 - release_metapage(mp);
33356 + yield();
33357 goto again;
33358 }
33359
33360 diff -Nur linux-2.4.29/fs/jfs/jfs_unicode.c linux-mips/fs/jfs/jfs_unicode.c
33361 --- linux-2.4.29/fs/jfs/jfs_unicode.c 2004-04-14 15:05:40.000000000 +0200
33362 +++ linux-mips/fs/jfs/jfs_unicode.c 2005-03-26 11:47:36.089728587 +0100
33363 @@ -1,5 +1,5 @@
33364 /*
33365 - * Copyright (c) International Business Machines Corp., 2000-2002
33366 + * Copyright (C) International Business Machines Corp., 2000-2005
33367 *
33368 * This program is free software; you can redistribute it and/or modify
33369 * it under the terms of the GNU General Public License as published by
33370 @@ -18,7 +18,7 @@
33371
33372 #include <linux/fs.h>
33373 #include <linux/slab.h>
33374 -#include "jfs_types.h"
33375 +#include "jfs_incore.h"
33376 #include "jfs_filsys.h"
33377 #include "jfs_unicode.h"
33378 #include "jfs_debug.h"
33379 @@ -34,17 +34,40 @@
33380 {
33381 int i;
33382 int outlen = 0;
33383 + static int warn_again = 5; /* Only warn up to 5 times total */
33384 + int warn = !!warn_again; /* once per string */
33385
33386 - for (i = 0; (i < len) && from[i]; i++) {
33387 - int charlen;
33388 - charlen =
33389 - codepage->uni2char(le16_to_cpu(from[i]), &to[outlen],
33390 - NLS_MAX_CHARSET_SIZE);
33391 - if (charlen > 0) {
33392 - outlen += charlen;
33393 - } else {
33394 - to[outlen++] = '?';
33395 + if (codepage) {
33396 + for (i = 0; (i < len) && from[i]; i++) {
33397 + int charlen;
33398 + charlen =
33399 + codepage->uni2char(le16_to_cpu(from[i]),
33400 + &to[outlen],
33401 + NLS_MAX_CHARSET_SIZE);
33402 + if (charlen > 0)
33403 + outlen += charlen;
33404 + else
33405 + to[outlen++] = '?';
33406 }
33407 + } else {
33408 + for (i = 0; (i < len) && from[i]; i++) {
33409 + if (le16_to_cpu(from[i]) & 0xff00) {
33410 + if (warn) {
33411 + warn--;
33412 + warn_again--;
33413 + printk(KERN_ERR
33414 + "non-latin1 character 0x%x found in JFS file name\n",
33415 + le16_to_cpu(from[i]));
33416 + printk(KERN_ERR
33417 + "mount with iocharset=utf8 to access\n");
33418 + }
33419 + to[i] = '?';
33420 + }
33421 + else
33422 + to[i] = (char) (le16_to_cpu(from[i]));
33423 + }
33424 + outlen = i;
33425 +
33426 }
33427 to[outlen] = 0;
33428 return outlen;
33429 @@ -56,20 +79,27 @@
33430 * FUNCTION: Convert character string to unicode string
33431 *
33432 */
33433 -static int jfs_strtoUCS(wchar_t * to, const char *from, int len,
33434 +static int jfs_strtoUCS(wchar_t * to, const unsigned char *from, int len,
33435 struct nls_table *codepage)
33436 {
33437 int charlen;
33438 int i;
33439
33440 - for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
33441 - charlen = codepage->char2uni(from, len, &to[i]);
33442 - if (charlen < 1) {
33443 - jfs_err("jfs_strtoUCS: char2uni returned %d.", charlen);
33444 - jfs_err("charset = %s, char = 0x%x",
33445 - codepage->charset, (unsigned char) *from);
33446 - return charlen;
33447 + if (codepage) {
33448 + for (i = 0; len && *from; i++, from += charlen, len -= charlen)
33449 + {
33450 + charlen = codepage->char2uni(from, len, &to[i]);
33451 + if (charlen < 1) {
33452 + jfs_err("jfs_strtoUCS: char2uni returned %d.",
33453 + charlen);
33454 + jfs_err("charset = %s, char = 0x%x",
33455 + codepage->charset, *from);
33456 + return charlen;
33457 + }
33458 }
33459 + } else {
33460 + for (i = 0; (i < len) && from[i]; i++)
33461 + to[i] = (wchar_t) from[i];
33462 }
33463
33464 to[i] = 0;
33465 @@ -82,9 +112,9 @@
33466 * FUNCTION: Allocate and translate to unicode string
33467 *
33468 */
33469 -int get_UCSname(struct component_name * uniName, struct dentry *dentry,
33470 - struct nls_table *nls_tab)
33471 +int get_UCSname(struct component_name * uniName, struct dentry *dentry)
33472 {
33473 + struct nls_table *nls_tab = JFS_SBI(dentry->d_sb)->nls_tab;
33474 int length = dentry->d_name.len;
33475
33476 if (length > JFS_NAME_MAX)
33477 diff -Nur linux-2.4.29/fs/jfs/jfs_unicode.h linux-mips/fs/jfs/jfs_unicode.h
33478 --- linux-2.4.29/fs/jfs/jfs_unicode.h 2002-11-29 00:53:15.000000000 +0100
33479 +++ linux-mips/fs/jfs/jfs_unicode.h 2005-03-26 11:47:36.095727603 +0100
33480 @@ -1,6 +1,6 @@
33481 /*
33482 - * Copyright (c) International Business Machines Corp., 2000-2002
33483 - * Portions Copyright (c) Christoph Hellwig, 2001-2002
33484 + * Copyright (C) International Business Machines Corp., 2000-2002
33485 + * Portions Copyright (C) Christoph Hellwig, 2001-2002
33486 *
33487 * This program is free software; you can redistribute it and/or modify
33488 * it under the terms of the GNU General Public License as published by
33489 @@ -30,8 +30,7 @@
33490
33491 extern signed char UniUpperTable[512];
33492 extern UNICASERANGE UniUpperRange[];
33493 -extern int get_UCSname(struct component_name *, struct dentry *,
33494 - struct nls_table *);
33495 +extern int get_UCSname(struct component_name *, struct dentry *);
33496 extern int jfs_strfromUCS_le(char *, const wchar_t *, int, struct nls_table *);
33497
33498 #define free_UCSname(COMP) kfree((COMP)->name)
33499 diff -Nur linux-2.4.29/fs/jfs/namei.c linux-mips/fs/jfs/namei.c
33500 --- linux-2.4.29/fs/jfs/namei.c 2004-08-08 01:26:06.000000000 +0200
33501 +++ linux-mips/fs/jfs/namei.c 2005-03-26 11:47:36.096727438 +0100
33502 @@ -74,7 +74,7 @@
33503 * search parent directory for entry/freespace
33504 * (dtSearch() returns parent directory page pinned)
33505 */
33506 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33507 + if ((rc = get_UCSname(&dname, dentry)))
33508 goto out1;
33509
33510 /*
33511 @@ -195,7 +195,7 @@
33512 * search parent directory for entry/freespace
33513 * (dtSearch() returns parent directory page pinned)
33514 */
33515 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33516 + if ((rc = get_UCSname(&dname, dentry)))
33517 goto out1;
33518
33519 /*
33520 @@ -318,9 +318,8 @@
33521 goto out;
33522 }
33523
33524 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) {
33525 + if ((rc = get_UCSname(&dname, dentry)))
33526 goto out;
33527 - }
33528
33529 tid = txBegin(dip->i_sb, 0);
33530
33531 @@ -437,7 +436,7 @@
33532
33533 jfs_info("jfs_unlink: dip:0x%p name:%s", dip, dentry->d_name.name);
33534
33535 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33536 + if ((rc = get_UCSname(&dname, dentry)))
33537 goto out;
33538
33539 IWRITE_LOCK(ip);
33540 @@ -780,7 +779,7 @@
33541 /*
33542 * scan parent directory for entry/freespace
33543 */
33544 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(ip->i_sb)->nls_tab)))
33545 + if ((rc = get_UCSname(&dname, dentry)))
33546 goto out;
33547
33548 if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
33549 @@ -865,7 +864,7 @@
33550 * (dtSearch() returns parent directory page pinned)
33551 */
33552
33553 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33554 + if ((rc = get_UCSname(&dname, dentry)))
33555 goto out1;
33556
33557 /*
33558 @@ -1044,12 +1043,10 @@
33559 old_ip = old_dentry->d_inode;
33560 new_ip = new_dentry->d_inode;
33561
33562 - if ((rc = get_UCSname(&old_dname, old_dentry,
33563 - JFS_SBI(old_dir->i_sb)->nls_tab)))
33564 + if ((rc = get_UCSname(&old_dname, old_dentry)))
33565 goto out1;
33566
33567 - if ((rc = get_UCSname(&new_dname, new_dentry,
33568 - JFS_SBI(old_dir->i_sb)->nls_tab)))
33569 + if ((rc = get_UCSname(&new_dname, new_dentry)))
33570 goto out2;
33571
33572 /*
33573 @@ -1301,7 +1298,7 @@
33574
33575 jfs_info("jfs_mknod: %s", dentry->d_name.name);
33576
33577 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dir->i_sb)->nls_tab)))
33578 + if ((rc = get_UCSname(&dname, dentry)))
33579 goto out;
33580
33581 ip = ialloc(dir, mode);
33582 @@ -1376,8 +1373,7 @@
33583 else if (strcmp(name, "..") == 0)
33584 inum = PARENT(dip);
33585 else {
33586 - if ((rc =
33587 - get_UCSname(&key, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33588 + if ((rc = get_UCSname(&key, dentry)))
33589 return ERR_PTR(rc);
33590 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
33591 free_UCSname(&key);
33592 diff -Nur linux-2.4.29/fs/jfs/super.c linux-mips/fs/jfs/super.c
33593 --- linux-2.4.29/fs/jfs/super.c 2004-08-08 01:26:06.000000000 +0200
33594 +++ linux-mips/fs/jfs/super.c 2005-03-26 11:47:36.101726618 +0100
33595 @@ -1,5 +1,5 @@
33596 /*
33597 - * Copyright (C) International Business Machines Corp., 2000-2003
33598 + * Copyright (C) International Business Machines Corp., 2000-2005
33599 * Portions Copyright (C) Christoph Hellwig, 2001-2002
33600 *
33601 * This program is free software; you can redistribute it and/or modify
33602 @@ -155,8 +155,10 @@
33603 rc = jfs_umount(sb);
33604 if (rc)
33605 jfs_err("jfs_umount failed with return code %d", rc);
33606 - unload_nls(sbi->nls_tab);
33607 - sbi->nls_tab = NULL;
33608 + if (sbi->nls_tab) {
33609 + unload_nls(sbi->nls_tab);
33610 + sbi->nls_tab = NULL;
33611 + }
33612
33613 kfree(sbi);
33614 }
33615 @@ -182,7 +184,7 @@
33616 static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
33617 int *flag)
33618 {
33619 - void *nls_map = NULL;
33620 + void *nls_map = (void *)-1; /* -1: no change; NULL: none */
33621 char *this_char;
33622 char *value;
33623 struct jfs_sb_info *sbi = JFS_SBI(sb);
33624 @@ -222,13 +224,12 @@
33625 } else if (!strcmp(this_char, "iocharset")) {
33626 if (!value || !*value)
33627 goto needs_arg;
33628 - if (nls_map) /* specified iocharset twice! */
33629 + if (nls_map && nls_map != (void *) -1)
33630 unload_nls(nls_map);
33631 - nls_map = load_nls(value);
33632 - if (!nls_map) {
33633 - printk(KERN_ERR "JFS: charset not found\n");
33634 - goto cleanup;
33635 - }
33636 + if (!strcmp(value, "none"))
33637 + nls_map = NULL;
33638 + else
33639 + nls_map = load_nls(value);
33640 } else if (!strcmp(this_char, "resize")) {
33641 if (!value || !*value) {
33642 *newLVSize = jfs_get_volume_size(sb);
33643 @@ -250,9 +251,9 @@
33644 goto cleanup;
33645 }
33646 }
33647 - if (nls_map) {
33648 + if (nls_map != (void *) -1) {
33649 /* Discard old (if remount) */
33650 - if (sbi->nls_tab)
33651 + if (sbi->nls_tab && sbi->nls_tab != (void *) -1)
33652 unload_nls(sbi->nls_tab);
33653 sbi->nls_tab = nls_map;
33654 }
33655 @@ -260,7 +261,7 @@
33656 needs_arg:
33657 printk(KERN_ERR "JFS: %s needs an argument\n", this_char);
33658 cleanup:
33659 - if (nls_map)
33660 + if (nls_map && nls_map != (void *) -1)
33661 unload_nls(nls_map);
33662 return 0;
33663 }
33664 @@ -328,6 +329,8 @@
33665 /* initialize the mount flag and determine the default error handler */
33666 flag = JFS_ERR_REMOUNT_RO;
33667
33668 + /* nls_tab will be set to NULL if no character mapping is requested */
33669 + sbi->nls_tab = (void *) -1;
33670 if (!parse_options((char *) data, sb, &newLVSize, &flag)) {
33671 kfree(sbi);
33672 return NULL;
33673 @@ -378,7 +381,7 @@
33674 if (!sb->s_root)
33675 goto out_no_root;
33676
33677 - if (!sbi->nls_tab)
33678 + if (sbi->nls_tab == (void *) -1)
33679 sbi->nls_tab = load_nls_default();
33680
33681 /* logical blocks are represented by 40 bits in pxd_t, etc. */
33682 diff -Nur linux-2.4.29/fs/nfsd/vfs.c linux-mips/fs/nfsd/vfs.c
33683 --- linux-2.4.29/fs/nfsd/vfs.c 2004-11-17 12:54:21.000000000 +0100
33684 +++ linux-mips/fs/nfsd/vfs.c 2005-03-26 11:47:36.103726290 +0100
33685 @@ -466,6 +466,8 @@
33686 atomic_set(&filp->f_count, 1);
33687 filp->f_dentry = dentry;
33688 filp->f_vfsmnt = fhp->fh_export->ex_mnt;
33689 + filp->f_maxcount = INT_MAX;
33690 +
33691 if (access & MAY_WRITE) {
33692 filp->f_flags = O_WRONLY|O_LARGEFILE;
33693 filp->f_mode = FMODE_WRITE;
33694 diff -Nur linux-2.4.29/fs/partitions/sgi.c linux-mips/fs/partitions/sgi.c
33695 --- linux-2.4.29/fs/partitions/sgi.c 2001-10-02 05:03:26.000000000 +0200
33696 +++ linux-mips/fs/partitions/sgi.c 2004-08-11 22:30:07.000000000 +0200
33697 @@ -17,6 +17,11 @@
33698 #include "check.h"
33699 #include "sgi.h"
33700
33701 +#if CONFIG_BLK_DEV_MD
33702 +extern void md_autodetect_dev(kdev_t dev);
33703 +#endif
33704 +
33705 +
33706 int sgi_partition(struct gendisk *hd, struct block_device *bdev, unsigned long first_sector, int current_minor)
33707 {
33708 int i, csum, magic;
33709 @@ -77,6 +82,10 @@
33710 if(!blocks)
33711 continue;
33712 add_gd_partition(hd, current_minor, start, blocks);
33713 +#ifdef CONFIG_BLK_DEV_MD
33714 + if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION)
33715 + md_autodetect_dev(MKDEV(hd->major, current_minor));
33716 +#endif
33717 current_minor++;
33718 }
33719 printk("\n");
33720 diff -Nur linux-2.4.29/fs/proc/array.c linux-mips/fs/proc/array.c
33721 --- linux-2.4.29/fs/proc/array.c 2005-01-19 15:10:11.000000000 +0100
33722 +++ linux-mips/fs/proc/array.c 2004-11-29 18:47:18.000000000 +0100
33723 @@ -368,15 +368,15 @@
33724 task->cmin_flt,
33725 task->maj_flt,
33726 task->cmaj_flt,
33727 - task->times.tms_utime,
33728 - task->times.tms_stime,
33729 - task->times.tms_cutime,
33730 - task->times.tms_cstime,
33731 + hz_to_std(task->times.tms_utime),
33732 + hz_to_std(task->times.tms_stime),
33733 + hz_to_std(task->times.tms_cutime),
33734 + hz_to_std(task->times.tms_cstime),
33735 priority,
33736 nice,
33737 0UL /* removed */,
33738 task->it_real_value,
33739 - task->start_time,
33740 + hz_to_std(task->start_time),
33741 vsize,
33742 mm ? mm->rss : 0, /* you might want to shift this left 3 */
33743 task->rlim[RLIMIT_RSS].rlim_cur,
33744 @@ -615,14 +615,14 @@
33745
33746 len = sprintf(buffer,
33747 "cpu %lu %lu\n",
33748 - task->times.tms_utime,
33749 - task->times.tms_stime);
33750 + hz_to_std(task->times.tms_utime),
33751 + hz_to_std(task->times.tms_stime));
33752
33753 for (i = 0 ; i < smp_num_cpus; i++)
33754 len += sprintf(buffer + len, "cpu%d %lu %lu\n",
33755 i,
33756 - task->per_cpu_utime[cpu_logical_map(i)],
33757 - task->per_cpu_stime[cpu_logical_map(i)]);
33758 + hz_to_std(task->per_cpu_utime[cpu_logical_map(i)]),
33759 + hz_to_std(task->per_cpu_stime[cpu_logical_map(i)]));
33760
33761 return len;
33762 }
33763 diff -Nur linux-2.4.29/fs/proc/kcore.c linux-mips/fs/proc/kcore.c
33764 --- linux-2.4.29/fs/proc/kcore.c 2004-08-08 01:26:06.000000000 +0200
33765 +++ linux-mips/fs/proc/kcore.c 2005-03-26 11:47:36.107725633 +0100
33766 @@ -136,7 +136,10 @@
33767 }
33768 *elf_buflen = sizeof(struct elfhdr) +
33769 (*num_vma + 2)*sizeof(struct elf_phdr) +
33770 - 3 * sizeof(struct memelfnote);
33771 + 3 * (sizeof(struct elf_note) + 4) +
33772 + sizeof(struct elf_prstatus) +
33773 + sizeof(struct elf_prpsinfo) +
33774 + sizeof(struct task_struct);
33775 *elf_buflen = PAGE_ALIGN(*elf_buflen);
33776 return (size - PAGE_OFFSET + *elf_buflen);
33777 }
33778 @@ -279,7 +282,7 @@
33779
33780 memset(&prstatus, 0, sizeof(struct elf_prstatus));
33781
33782 - nhdr->p_filesz = notesize(&notes[0]);
33783 + nhdr->p_filesz += notesize(&notes[0]);
33784 bufp = storenote(&notes[0], bufp);
33785
33786 /* set up the process info */
33787 @@ -296,7 +299,7 @@
33788 strcpy(prpsinfo.pr_fname, "vmlinux");
33789 strncpy(prpsinfo.pr_psargs, saved_command_line, ELF_PRARGSZ);
33790
33791 - nhdr->p_filesz = notesize(&notes[1]);
33792 + nhdr->p_filesz += notesize(&notes[1]);
33793 bufp = storenote(&notes[1], bufp);
33794
33795 /* set up the task structure */
33796 @@ -305,7 +308,7 @@
33797 notes[2].datasz = sizeof(struct task_struct);
33798 notes[2].data = current;
33799
33800 - nhdr->p_filesz = notesize(&notes[2]);
33801 + nhdr->p_filesz += notesize(&notes[2]);
33802 bufp = storenote(&notes[2], bufp);
33803
33804 } /* end elf_kcore_store_hdr() */
33805 diff -Nur linux-2.4.29/fs/proc/proc_misc.c linux-mips/fs/proc/proc_misc.c
33806 --- linux-2.4.29/fs/proc/proc_misc.c 2004-08-08 01:26:06.000000000 +0200
33807 +++ linux-mips/fs/proc/proc_misc.c 2004-08-14 20:39:01.000000000 +0200
33808 @@ -308,16 +308,16 @@
33809 {
33810 int i, len = 0;
33811 extern unsigned long total_forks;
33812 - unsigned long jif = jiffies;
33813 + unsigned long jif = hz_to_std(jiffies);
33814 unsigned int sum = 0, user = 0, nice = 0, system = 0;
33815 int major, disk;
33816
33817 for (i = 0 ; i < smp_num_cpus; i++) {
33818 int cpu = cpu_logical_map(i), j;
33819
33820 - user += kstat.per_cpu_user[cpu];
33821 - nice += kstat.per_cpu_nice[cpu];
33822 - system += kstat.per_cpu_system[cpu];
33823 + user += hz_to_std(kstat.per_cpu_user[cpu]);
33824 + nice += hz_to_std(kstat.per_cpu_nice[cpu]);
33825 + system += hz_to_std(kstat.per_cpu_system[cpu]);
33826 #if !defined(CONFIG_ARCH_S390)
33827 for (j = 0 ; j < NR_IRQS ; j++)
33828 sum += kstat.irqs[cpu][j];
33829 @@ -331,10 +331,10 @@
33830 proc_sprintf(page, &off, &len,
33831 "cpu%d %u %u %u %lu\n",
33832 i,
33833 - kstat.per_cpu_user[cpu_logical_map(i)],
33834 - kstat.per_cpu_nice[cpu_logical_map(i)],
33835 - kstat.per_cpu_system[cpu_logical_map(i)],
33836 - jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
33837 + hz_to_std(kstat.per_cpu_user[cpu_logical_map(i)]),
33838 + hz_to_std(kstat.per_cpu_nice[cpu_logical_map(i)]),
33839 + hz_to_std(kstat.per_cpu_system[cpu_logical_map(i)]),
33840 + jif - hz_to_std( kstat.per_cpu_user[cpu_logical_map(i)] \
33841 + kstat.per_cpu_nice[cpu_logical_map(i)] \
33842 + kstat.per_cpu_system[cpu_logical_map(i)]));
33843 proc_sprintf(page, &off, &len,
33844 diff -Nur linux-2.4.29/fs/proc/proc_tty.c linux-mips/fs/proc/proc_tty.c
33845 --- linux-2.4.29/fs/proc/proc_tty.c 2005-01-19 15:10:11.000000000 +0100
33846 +++ linux-mips/fs/proc/proc_tty.c 2005-03-26 11:47:36.107725633 +0100
33847 @@ -129,7 +129,7 @@
33848 }
33849
33850 /*
33851 - * Thsi function is called by register_tty_driver() to handle
33852 + * This function is called by tty_register_driver() to handle
33853 * registering the driver's /proc handler into /proc/tty/driver/<foo>
33854 */
33855 void proc_tty_register_driver(struct tty_driver *driver)
33856 @@ -152,7 +152,7 @@
33857 }
33858
33859 /*
33860 - * This function is called by unregister_tty_driver()
33861 + * This function is called by tty_unregister_driver()
33862 */
33863 void proc_tty_unregister_driver(struct tty_driver *driver)
33864 {
33865 diff -Nur linux-2.4.29/fs/read_write.c linux-mips/fs/read_write.c
33866 --- linux-2.4.29/fs/read_write.c 2003-08-25 13:44:43.000000000 +0200
33867 +++ linux-mips/fs/read_write.c 2005-03-26 11:47:36.064732690 +0100
33868 @@ -40,6 +40,28 @@
33869 return -EISDIR;
33870 }
33871
33872 +int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count)
33873 +{
33874 + struct inode *inode;
33875 + loff_t pos;
33876 +
33877 + if (unlikely(count > file->f_maxcount))
33878 + goto Einval;
33879 +
33880 + pos = *ppos;
33881 +
33882 + if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
33883 + goto Einval;
33884 +
33885 + inode = file->f_dentry->d_inode;
33886 + if (inode->i_flock && MANDATORY_LOCK(inode))
33887 + return locks_mandatory_area(read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, inode, file, *ppos, count);
33888 + return 0;
33889 +
33890 +Einval:
33891 + return -EINVAL;
33892 +}
33893 +
33894 loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
33895 {
33896 long long retval;
33897 @@ -168,8 +190,8 @@
33898 file = fget(fd);
33899 if (file) {
33900 if (file->f_mode & FMODE_READ) {
33901 - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
33902 - file, file->f_pos, count);
33903 + ret = rw_verify_area(READ, file, &file->f_pos, count);
33904 +
33905 if (!ret) {
33906 ssize_t (*read)(struct file *, char *, size_t, loff_t *);
33907 ret = -EINVAL;
33908 @@ -193,9 +215,7 @@
33909 file = fget(fd);
33910 if (file) {
33911 if (file->f_mode & FMODE_WRITE) {
33912 - struct inode *inode = file->f_dentry->d_inode;
33913 - ret = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file,
33914 - file->f_pos, count);
33915 + ret = rw_verify_area(WRITE, file, &file->f_pos, count);
33916 if (!ret) {
33917 ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
33918 ret = -EINVAL;
33919 @@ -224,7 +244,6 @@
33920 ssize_t ret, i;
33921 io_fn_t fn;
33922 iov_fn_t fnv;
33923 - struct inode *inode;
33924
33925 /*
33926 * First get the "struct iovec" from user memory and
33927 @@ -275,12 +294,11 @@
33928 goto out;
33929 }
33930
33931 - inode = file->f_dentry->d_inode;
33932 /* VERIFY_WRITE actually means a read, as we write to user space */
33933 - ret = locks_verify_area((type == VERIFY_WRITE
33934 - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
33935 - inode, file, file->f_pos, tot_len);
33936 - if (ret) goto out;
33937 + ret = rw_verify_area((type == VERIFY_WRITE ? READ : WRITE),
33938 + file, &file->f_pos, tot_len);
33939 + if (ret)
33940 + goto out;
33941
33942 fnv = (type == VERIFY_WRITE ? file->f_op->readv : file->f_op->writev);
33943 if (fnv) {
33944 @@ -383,8 +401,8 @@
33945 goto bad_file;
33946 if (!(file->f_mode & FMODE_READ))
33947 goto out;
33948 - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
33949 - file, pos, count);
33950 + ret = rw_verify_area(READ, file, &pos, count);
33951 +
33952 if (ret)
33953 goto out;
33954 ret = -EINVAL;
33955 @@ -414,8 +432,8 @@
33956 goto bad_file;
33957 if (!(file->f_mode & FMODE_WRITE))
33958 goto out;
33959 - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
33960 - file, pos, count);
33961 + ret = rw_verify_area(WRITE, file, &pos, count);
33962 +
33963 if (ret)
33964 goto out;
33965 ret = -EINVAL;
33966 diff -Nur linux-2.4.29/include/asm-alpha/param.h linux-mips/include/asm-alpha/param.h
33967 --- linux-2.4.29/include/asm-alpha/param.h 2000-11-08 08:37:31.000000000 +0100
33968 +++ linux-mips/include/asm-alpha/param.h 2000-11-28 04:59:03.000000000 +0100
33969 @@ -13,6 +13,9 @@
33970 # else
33971 # define HZ 1200
33972 # endif
33973 +#ifdef __KERNEL__
33974 +# define hz_to_std(a) (a)
33975 +#endif
33976 #endif
33977
33978 #define EXEC_PAGESIZE 8192
33979 diff -Nur linux-2.4.29/include/asm-i386/acpi.h linux-mips/include/asm-i386/acpi.h
33980 --- linux-2.4.29/include/asm-i386/acpi.h 2004-08-08 01:26:06.000000000 +0200
33981 +++ linux-mips/include/asm-i386/acpi.h 2005-03-26 11:47:36.177714147 +0100
33982 @@ -121,6 +121,8 @@
33983 extern int acpi_strict;
33984 extern int acpi_disabled;
33985 extern int acpi_ht;
33986 +extern int acpi_skip_timer_override;
33987 +void __init check_acpi_pci(void);
33988 static inline void disable_acpi(void)
33989 {
33990 acpi_disabled = 1;
33991 diff -Nur linux-2.4.29/include/asm-i386/param.h linux-mips/include/asm-i386/param.h
33992 --- linux-2.4.29/include/asm-i386/param.h 2000-10-27 20:04:43.000000000 +0200
33993 +++ linux-mips/include/asm-i386/param.h 2000-11-23 03:00:55.000000000 +0100
33994 @@ -3,6 +3,9 @@
33995
33996 #ifndef HZ
33997 #define HZ 100
33998 +#ifdef __KERNEL__
33999 +#define hz_to_std(a) (a)
34000 +#endif
34001 #endif
34002
34003 #define EXEC_PAGESIZE 4096
34004 diff -Nur linux-2.4.29/include/asm-i386/pci-direct.h linux-mips/include/asm-i386/pci-direct.h
34005 --- linux-2.4.29/include/asm-i386/pci-direct.h 1970-01-01 01:00:00.000000000 +0100
34006 +++ linux-mips/include/asm-i386/pci-direct.h 2005-03-18 13:13:30.000000000 +0100
34007 @@ -0,0 +1 @@
34008 +#include "asm-x86_64/pci-direct.h"
34009 diff -Nur linux-2.4.29/include/asm-ia64/param.h linux-mips/include/asm-ia64/param.h
34010 --- linux-2.4.29/include/asm-ia64/param.h 2004-04-14 15:05:40.000000000 +0200
34011 +++ linux-mips/include/asm-ia64/param.h 2004-04-16 05:14:20.000000000 +0200
34012 @@ -7,9 +7,15 @@
34013 * Based on <asm-i386/param.h>.
34014 *
34015 * Modified 1998, 1999, 2002-2003
34016 - * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
34017 + * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
34018 */
34019
34020 +#include <linux/config.h>
34021 +
34022 +#ifdef __KERNEL__
34023 +#define hz_to_std(a) (a)
34024 +#endif
34025 +
34026 #define EXEC_PAGESIZE 65536
34027
34028 #ifndef NGROUPS
34029 diff -Nur linux-2.4.29/include/asm-m68k/param.h linux-mips/include/asm-m68k/param.h
34030 --- linux-2.4.29/include/asm-m68k/param.h 2001-01-04 22:00:55.000000000 +0100
34031 +++ linux-mips/include/asm-m68k/param.h 2001-01-11 05:02:45.000000000 +0100
34032 @@ -3,6 +3,9 @@
34033
34034 #ifndef HZ
34035 #define HZ 100
34036 +#ifdef __KERNEL__
34037 +#define hz_to_std(a) (a)
34038 +#endif
34039 #endif
34040
34041 #define EXEC_PAGESIZE 8192
34042 diff -Nur linux-2.4.29/include/asm-mips/au1000_gpio.h linux-mips/include/asm-mips/au1000_gpio.h
34043 --- linux-2.4.29/include/asm-mips/au1000_gpio.h 2002-11-29 00:53:15.000000000 +0100
34044 +++ linux-mips/include/asm-mips/au1000_gpio.h 2005-01-31 12:59:48.000000000 +0100
34045 @@ -30,6 +30,13 @@
34046 * 675 Mass Ave, Cambridge, MA 02139, USA.
34047 */
34048
34049 +/*
34050 + * Revision history
34051 + * 01/31/02 0.01 Initial release. Steve Longerbeam, MontaVista
34052 + * 10/12/03 0.1 Added Au1100/Au1500, GPIO2, and bit operations. K.C. Nishio, AMD
34053 + * 08/05/04 0.11 Added Au1550 and Au1200. K.C. Nishio
34054 + */
34055 +
34056 #ifndef __AU1000_GPIO_H
34057 #define __AU1000_GPIO_H
34058
34059 @@ -44,13 +51,94 @@
34060 #define AU1000GPIO_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 4, int)
34061 #define AU1000GPIO_AVAIL_MASK _IOR (AU1000GPIO_IOC_MAGIC, 5, int)
34062
34063 +// bit operations
34064 +#define AU1000GPIO_BIT_READ _IOW (AU1000GPIO_IOC_MAGIC, 6, int)
34065 +#define AU1000GPIO_BIT_SET _IOW (AU1000GPIO_IOC_MAGIC, 7, int)
34066 +#define AU1000GPIO_BIT_CLEAR _IOW (AU1000GPIO_IOC_MAGIC, 8, int)
34067 +#define AU1000GPIO_BIT_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 9, int)
34068 +#define AU1000GPIO_BIT_INIT _IOW (AU1000GPIO_IOC_MAGIC, 10, int)
34069 +#define AU1000GPIO_BIT_TERM _IOW (AU1000GPIO_IOC_MAGIC, 11, int)
34070 +
34071 +/* set this major numer same as the CRIS GPIO driver */
34072 +#define AU1X00_GPIO_MAJOR (120)
34073 +
34074 +#define ENABLED_ZERO (0)
34075 +#define ENABLED_ONE (1)
34076 +#define ENABLED_10 (0x2)
34077 +#define ENABLED_11 (0x3)
34078 +#define ENABLED_111 (0x7)
34079 +#define NOT_AVAIL (-1)
34080 +#define AU1X00_MAX_PRIMARY_GPIO (32)
34081 +
34082 +#define AU1000_GPIO_MINOR_MAX AU1X00_MAX_PRIMARY_GPIO
34083 +/* Au1100, 1500, 1550 and 1200 have the secondary GPIO block */
34084 +#define AU1XX0_GPIO_MINOR_MAX (48)
34085 +
34086 +#define AU1X00_GPIO_NAME "gpio"
34087 +
34088 +/* GPIO pins which are not multiplexed */
34089 +#if defined(CONFIG_SOC_AU1000)
34090 + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
34091 + #define NATIVE_GPIO2PIN (0)
34092 +#elif defined(CONFIG_SOC_AU1100)
34093 + #define NATIVE_GPIOPIN ((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20) | (1 << 19) | (1 << 18) | \
34094 + (1 << 17) | (1 << 16) | (1 << 7) | (1 << 1) | (1 << 0))
34095 + #define NATIVE_GPIO2PIN (0)
34096 +#elif defined(CONFIG_SOC_AU1500)
34097 + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
34098 + /* exclude the PCI reset output signal: GPIO[200], DMA_REQ2 and DMA_REQ3 */
34099 + #define NATIVE_GPIO2PIN (0xfffe & ~((1 << 9) | (1 << 8)))
34100 +#elif defined(CONFIG_SOC_AU1550)
34101 + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 6) | (1 << 1) | (1 << 0))
34102 + /* please refere Au1550 Data Book, chapter 15 */
34103 + #define NATIVE_GPIO2PIN (1 << 5)
34104 +#elif defined(CONFIG_SOC_AU1200)
34105 + #define NATIVE_GPIOPIN ((1 << 7) | (1 << 5))
34106 + #define NATIVE_GPIO2PIN (0)
34107 +#endif
34108 +
34109 +/* minor as u32 */
34110 +#define MINOR_TO_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? minor : (minor - AU1X00_MAX_PRIMARY_GPIO))
34111 +#define IS_PRIMARY_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? 1 : 0)
34112 +
34113 +/*
34114 + * pin to minor mapping.
34115 + * GPIO0-GPIO31, minor=0-31.
34116 + * GPIO200-GPIO215, minor=32-47.
34117 + */
34118 +typedef struct _au1x00_gpio_bit_ctl {
34119 + int direction; // The direction of this GPIO pin. 0: IN, 1: OUT.
34120 + int data; // Pin output when itized (0/1), or at the term. 0/1/-1 (tristate).
34121 +} au1x00_gpio_bit_ctl;
34122 +
34123 +typedef struct _au1x00_gpio_driver {
34124 + const char *driver_name;
34125 + const char *name;
34126 + int name_base; /* offset of printed name */
34127 + short major; /* major device number */
34128 + short minor_start; /* start of minor device number*/
34129 + short num; /* number of devices */
34130 +} au1x00_gpio_driver;
34131 +
34132 #ifdef __KERNEL__
34133 -extern u32 get_au1000_avail_gpio_mask(void);
34134 -extern int au1000gpio_tristate(u32 data);
34135 -extern int au1000gpio_in(u32 *data);
34136 -extern int au1000gpio_set(u32 data);
34137 -extern int au1000gpio_clear(u32 data);
34138 -extern int au1000gpio_out(u32 data);
34139 +extern u32 get_au1000_avail_gpio_mask(u32 *avail_gpio2);
34140 +extern int au1000gpio_tristate(u32 minor, u32 data);
34141 +extern int au1000gpio_in(u32 minor, u32 *data);
34142 +extern int au1000gpio_set(u32 minor, u32 data);
34143 +extern int au1000gpio_clear(u32 minor, u32 data);
34144 +extern int au1000gpio_out(u32 minor, u32 data);
34145 +extern int au1000gpio_bit_read(u32 minor, u32 *read_data);
34146 +extern int au1000gpio_bit_set(u32 minor);
34147 +extern int au1000gpio_bit_clear(u32 minor);
34148 +extern int au1000gpio_bit_tristate(u32 minor);
34149 +extern int check_minor_to_gpio(u32 minor);
34150 +extern int au1000gpio_bit_init(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
34151 +extern int au1000gpio_bit_term(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
34152 +
34153 +extern void gpio_register_devfs (au1x00_gpio_driver *driver, unsigned int flags, unsigned minor);
34154 +extern void gpio_unregister_devfs (au1x00_gpio_driver *driver, unsigned minor);
34155 +extern int gpio_register_driver(au1x00_gpio_driver *driver);
34156 +extern int gpio_unregister_driver(au1x00_gpio_driver *driver);
34157 #endif
34158
34159 #endif
34160 diff -Nur linux-2.4.29/include/asm-mips/au1000.h linux-mips/include/asm-mips/au1000.h
34161 --- linux-2.4.29/include/asm-mips/au1000.h 2005-01-19 15:10:11.000000000 +0100
34162 +++ linux-mips/include/asm-mips/au1000.h 2005-01-31 12:59:48.000000000 +0100
34163 @@ -160,28 +160,356 @@
34164 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
34165 #endif
34166
34167 -/* SDRAM Controller */
34168 +/*
34169 + * SDRAM Register Offsets
34170 + */
34171 #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
34172 -#define MEM_SDMODE0 0xB4000000
34173 -#define MEM_SDMODE1 0xB4000004
34174 -#define MEM_SDMODE2 0xB4000008
34175 -
34176 -#define MEM_SDADDR0 0xB400000C
34177 -#define MEM_SDADDR1 0xB4000010
34178 -#define MEM_SDADDR2 0xB4000014
34179 -
34180 -#define MEM_SDREFCFG 0xB4000018
34181 -#define MEM_SDPRECMD 0xB400001C
34182 -#define MEM_SDAUTOREF 0xB4000020
34183 -
34184 -#define MEM_SDWRMD0 0xB4000024
34185 -#define MEM_SDWRMD1 0xB4000028
34186 -#define MEM_SDWRMD2 0xB400002C
34187 +#define MEM_SDMODE0 (0x0000)
34188 +#define MEM_SDMODE1 (0x0004)
34189 +#define MEM_SDMODE2 (0x0008)
34190 +#define MEM_SDADDR0 (0x000C)
34191 +#define MEM_SDADDR1 (0x0010)
34192 +#define MEM_SDADDR2 (0x0014)
34193 +#define MEM_SDREFCFG (0x0018)
34194 +#define MEM_SDPRECMD (0x001C)
34195 +#define MEM_SDAUTOREF (0x0020)
34196 +#define MEM_SDWRMD0 (0x0024)
34197 +#define MEM_SDWRMD1 (0x0028)
34198 +#define MEM_SDWRMD2 (0x002C)
34199 +#define MEM_SDSLEEP (0x0030)
34200 +#define MEM_SDSMCKE (0x0034)
34201 +
34202 +#ifndef ASSEMBLER
34203 +/*typedef volatile struct
34204 +{
34205 + uint32 sdmode0;
34206 + uint32 sdmode1;
34207 + uint32 sdmode2;
34208 + uint32 sdaddr0;
34209 + uint32 sdaddr1;
34210 + uint32 sdaddr2;
34211 + uint32 sdrefcfg;
34212 + uint32 sdautoref;
34213 + uint32 sdwrmd0;
34214 + uint32 sdwrmd1;
34215 + uint32 sdwrmd2;
34216 + uint32 sdsleep;
34217 + uint32 sdsmcke;
34218 +
34219 +} AU1X00_SDRAM;*/
34220 +#endif
34221 +
34222 +/*
34223 + * MEM_SDMODE register content definitions
34224 + */
34225 +#define MEM_SDMODE_F (1<<22)
34226 +#define MEM_SDMODE_SR (1<<21)
34227 +#define MEM_SDMODE_BS (1<<20)
34228 +#define MEM_SDMODE_RS (3<<18)
34229 +#define MEM_SDMODE_CS (7<<15)
34230 +#define MEM_SDMODE_TRAS (15<<11)
34231 +#define MEM_SDMODE_TMRD (3<<9)
34232 +#define MEM_SDMODE_TWR (3<<7)
34233 +#define MEM_SDMODE_TRP (3<<5)
34234 +#define MEM_SDMODE_TRCD (3<<3)
34235 +#define MEM_SDMODE_TCL (7<<0)
34236 +
34237 +#define MEM_SDMODE_BS_2Bank (0<<20)
34238 +#define MEM_SDMODE_BS_4Bank (1<<20)
34239 +#define MEM_SDMODE_RS_11Row (0<<18)
34240 +#define MEM_SDMODE_RS_12Row (1<<18)
34241 +#define MEM_SDMODE_RS_13Row (2<<18)
34242 +#define MEM_SDMODE_RS_N(N) ((N)<<18)
34243 +#define MEM_SDMODE_CS_7Col (0<<15)
34244 +#define MEM_SDMODE_CS_8Col (1<<15)
34245 +#define MEM_SDMODE_CS_9Col (2<<15)
34246 +#define MEM_SDMODE_CS_10Col (3<<15)
34247 +#define MEM_SDMODE_CS_11Col (4<<15)
34248 +#define MEM_SDMODE_CS_N(N) ((N)<<15)
34249 +#define MEM_SDMODE_TRAS_N(N) ((N)<<11)
34250 +#define MEM_SDMODE_TMRD_N(N) ((N)<<9)
34251 +#define MEM_SDMODE_TWR_N(N) ((N)<<7)
34252 +#define MEM_SDMODE_TRP_N(N) ((N)<<5)
34253 +#define MEM_SDMODE_TRCD_N(N) ((N)<<3)
34254 +#define MEM_SDMODE_TCL_N(N) ((N)<<0)
34255 +
34256 +/*
34257 + * MEM_SDADDR register contents definitions
34258 + */
34259 +#define MEM_SDADDR_E (1<<20)
34260 +#define MEM_SDADDR_CSBA (0x03FF<<10)
34261 +#define MEM_SDADDR_CSMASK (0x03FF<<0)
34262 +#define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
34263 +#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
34264 +
34265 +/*
34266 + * MEM_SDREFCFG register content definitions
34267 + */
34268 +#define MEM_SDREFCFG_TRC (15<<28)
34269 +#define MEM_SDREFCFG_TRPM (3<<26)
34270 +#define MEM_SDREFCFG_E (1<<25)
34271 +#define MEM_SDREFCFG_RE (0x1ffffff<<0)
34272 +#define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
34273 +#define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
34274 +#define MEM_SDREFCFG_REF_N(N) (N)
34275 +#endif
34276 +
34277 +/***********************************************************************/
34278 +
34279 +/*
34280 + * Au1550 SDRAM Register Offsets
34281 + */
34282 +
34283 +/***********************************************************************/
34284 +
34285 +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
34286 +#define MEM_SDMODE0 (0x0800)
34287 +#define MEM_SDMODE1 (0x0808)
34288 +#define MEM_SDMODE2 (0x0810)
34289 +#define MEM_SDADDR0 (0x0820)
34290 +#define MEM_SDADDR1 (0x0828)
34291 +#define MEM_SDADDR2 (0x0830)
34292 +#define MEM_SDCONFIGA (0x0840)
34293 +#define MEM_SDCONFIGB (0x0848)
34294 +#define MEM_SDSTAT (0x0850)
34295 +#define MEM_SDERRADDR (0x0858)
34296 +#define MEM_SDSTRIDE0 (0x0860)
34297 +#define MEM_SDSTRIDE1 (0x0868)
34298 +#define MEM_SDSTRIDE2 (0x0870)
34299 +#define MEM_SDWRMD0 (0x0880)
34300 +#define MEM_SDWRMD1 (0x0888)
34301 +#define MEM_SDWRMD2 (0x0890)
34302 +#define MEM_SDPRECMD (0x08C0)
34303 +#define MEM_SDAUTOREF (0x08C8)
34304 +#define MEM_SDSREF (0x08D0)
34305 +#define MEM_SDSLEEP MEM_SDSREF
34306 +
34307 +#ifndef ASSEMBLER
34308 +/*typedef volatile struct
34309 +{
34310 + uint32 sdmode0;
34311 + uint32 reserved0;
34312 + uint32 sdmode1;
34313 + uint32 reserved1;
34314 + uint32 sdmode2;
34315 + uint32 reserved2[3];
34316 + uint32 sdaddr0;
34317 + uint32 reserved3;
34318 + uint32 sdaddr1;
34319 + uint32 reserved4;
34320 + uint32 sdaddr2;
34321 + uint32 reserved5[3];
34322 + uint32 sdconfiga;
34323 + uint32 reserved6;
34324 + uint32 sdconfigb;
34325 + uint32 reserved7;
34326 + uint32 sdstat;
34327 + uint32 reserved8;
34328 + uint32 sderraddr;
34329 + uint32 reserved9;
34330 + uint32 sdstride0;
34331 + uint32 reserved10;
34332 + uint32 sdstride1;
34333 + uint32 reserved11;
34334 + uint32 sdstride2;
34335 + uint32 reserved12[3];
34336 + uint32 sdwrmd0;
34337 + uint32 reserved13;
34338 + uint32 sdwrmd1;
34339 + uint32 reserved14;
34340 + uint32 sdwrmd2;
34341 + uint32 reserved15[11];
34342 + uint32 sdprecmd;
34343 + uint32 reserved16;
34344 + uint32 sdautoref;
34345 + uint32 reserved17;
34346 + uint32 sdsref;
34347 +
34348 +} AU1550_SDRAM;*/
34349 +#endif
34350 +#endif
34351 +
34352 +/*
34353 + * Physical base addresses for integrated peripherals
34354 + */
34355 +
34356 +#ifdef CONFIG_SOC_AU1000
34357 +#define MEM_PHYS_ADDR 0x14000000
34358 +#define STATIC_MEM_PHYS_ADDR 0x14001000
34359 +#define DMA0_PHYS_ADDR 0x14002000
34360 +#define DMA1_PHYS_ADDR 0x14002100
34361 +#define DMA2_PHYS_ADDR 0x14002200
34362 +#define DMA3_PHYS_ADDR 0x14002300
34363 +#define DMA4_PHYS_ADDR 0x14002400
34364 +#define DMA5_PHYS_ADDR 0x14002500
34365 +#define DMA6_PHYS_ADDR 0x14002600
34366 +#define DMA7_PHYS_ADDR 0x14002700
34367 +#define IC0_PHYS_ADDR 0x10400000
34368 +#define IC1_PHYS_ADDR 0x11800000
34369 +#define AC97_PHYS_ADDR 0x10000000
34370 +#define USBH_PHYS_ADDR 0x10100000
34371 +#define USBD_PHYS_ADDR 0x10200000
34372 +#define IRDA_PHYS_ADDR 0x10300000
34373 +#define MAC0_PHYS_ADDR 0x10500000
34374 +#define MAC1_PHYS_ADDR 0x10510000
34375 +#define MACEN_PHYS_ADDR 0x10520000
34376 +#define MACDMA0_PHYS_ADDR 0x14004000
34377 +#define MACDMA1_PHYS_ADDR 0x14004200
34378 +#define I2S_PHYS_ADDR 0x11000000
34379 +#define UART0_PHYS_ADDR 0x11100000
34380 +#define UART1_PHYS_ADDR 0x11200000
34381 +#define UART2_PHYS_ADDR 0x11300000
34382 +#define UART3_PHYS_ADDR 0x11400000
34383 +#define SSI0_PHYS_ADDR 0x11600000
34384 +#define SSI1_PHYS_ADDR 0x11680000
34385 +#define SYS_PHYS_ADDR 0x11900000
34386 +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
34387 +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
34388 +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
34389 +#endif
34390 +
34391 +/********************************************************************/
34392
34393 -#define MEM_SDSLEEP 0xB4000030
34394 -#define MEM_SDSMCKE 0xB4000034
34395 +#ifdef CONFIG_SOC_AU1500
34396 +#define MEM_PHYS_ADDR 0x14000000
34397 +#define STATIC_MEM_PHYS_ADDR 0x14001000
34398 +#define DMA0_PHYS_ADDR 0x14002000
34399 +#define DMA1_PHYS_ADDR 0x14002100
34400 +#define DMA2_PHYS_ADDR 0x14002200
34401 +#define DMA3_PHYS_ADDR 0x14002300
34402 +#define DMA4_PHYS_ADDR 0x14002400
34403 +#define DMA5_PHYS_ADDR 0x14002500
34404 +#define DMA6_PHYS_ADDR 0x14002600
34405 +#define DMA7_PHYS_ADDR 0x14002700
34406 +#define IC0_PHYS_ADDR 0x10400000
34407 +#define IC1_PHYS_ADDR 0x11800000
34408 +#define AC97_PHYS_ADDR 0x10000000
34409 +#define USBH_PHYS_ADDR 0x10100000
34410 +#define USBD_PHYS_ADDR 0x10200000
34411 +#define PCI_PHYS_ADDR 0x14005000
34412 +#define MAC0_PHYS_ADDR 0x11500000
34413 +#define MAC1_PHYS_ADDR 0x11510000
34414 +#define MACEN_PHYS_ADDR 0x11520000
34415 +#define MACDMA0_PHYS_ADDR 0x14004000
34416 +#define MACDMA1_PHYS_ADDR 0x14004200
34417 +#define I2S_PHYS_ADDR 0x11000000
34418 +#define UART0_PHYS_ADDR 0x11100000
34419 +#define UART3_PHYS_ADDR 0x11400000
34420 +#define GPIO2_PHYS_ADDR 0x11700000
34421 +#define SYS_PHYS_ADDR 0x11900000
34422 +#define PCI_MEM_PHYS_ADDR 0x400000000
34423 +#define PCI_IO_PHYS_ADDR 0x500000000
34424 +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
34425 +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
34426 +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
34427 +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
34428 +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
34429 #endif
34430
34431 +/********************************************************************/
34432 +
34433 +#ifdef CONFIG_SOC_AU1100
34434 +#define MEM_PHYS_ADDR 0x14000000
34435 +#define STATIC_MEM_PHYS_ADDR 0x14001000
34436 +#define DMA0_PHYS_ADDR 0x14002000
34437 +#define DMA1_PHYS_ADDR 0x14002100
34438 +#define DMA2_PHYS_ADDR 0x14002200
34439 +#define DMA3_PHYS_ADDR 0x14002300
34440 +#define DMA4_PHYS_ADDR 0x14002400
34441 +#define DMA5_PHYS_ADDR 0x14002500
34442 +#define DMA6_PHYS_ADDR 0x14002600
34443 +#define DMA7_PHYS_ADDR 0x14002700
34444 +#define IC0_PHYS_ADDR 0x10400000
34445 +#define SD0_PHYS_ADDR 0x10600000
34446 +#define SD1_PHYS_ADDR 0x10680000
34447 +#define IC1_PHYS_ADDR 0x11800000
34448 +#define AC97_PHYS_ADDR 0x10000000
34449 +#define USBH_PHYS_ADDR 0x10100000
34450 +#define USBD_PHYS_ADDR 0x10200000
34451 +#define IRDA_PHYS_ADDR 0x10300000
34452 +#define MAC0_PHYS_ADDR 0x10500000
34453 +#define MACEN_PHYS_ADDR 0x10520000
34454 +#define MACDMA0_PHYS_ADDR 0x14004000
34455 +#define MACDMA1_PHYS_ADDR 0x14004200
34456 +#define I2S_PHYS_ADDR 0x11000000
34457 +#define UART0_PHYS_ADDR 0x11100000
34458 +#define UART1_PHYS_ADDR 0x11200000
34459 +#define UART3_PHYS_ADDR 0x11400000
34460 +#define SSI0_PHYS_ADDR 0x11600000
34461 +#define SSI1_PHYS_ADDR 0x11680000
34462 +#define GPIO2_PHYS_ADDR 0x11700000
34463 +#define SYS_PHYS_ADDR 0x11900000
34464 +#define LCD_PHYS_ADDR 0x15000000
34465 +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
34466 +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
34467 +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
34468 +#endif
34469 +
34470 +/***********************************************************************/
34471 +
34472 +#ifdef CONFIG_SOC_AU1550
34473 +#define MEM_PHYS_ADDR 0x14000000
34474 +#define STATIC_MEM_PHYS_ADDR 0x14001000
34475 +#define IC0_PHYS_ADDR 0x10400000
34476 +#define IC1_PHYS_ADDR 0x11800000
34477 +#define USBH_PHYS_ADDR 0x14020000
34478 +#define USBD_PHYS_ADDR 0x10200000
34479 +#define PCI_PHYS_ADDR 0x14005000
34480 +#define MAC0_PHYS_ADDR 0x10500000
34481 +#define MAC1_PHYS_ADDR 0x10510000
34482 +#define MACEN_PHYS_ADDR 0x10520000
34483 +#define MACDMA0_PHYS_ADDR 0x14004000
34484 +#define MACDMA1_PHYS_ADDR 0x14004200
34485 +#define UART0_PHYS_ADDR 0x11100000
34486 +#define UART1_PHYS_ADDR 0x11200000
34487 +#define UART3_PHYS_ADDR 0x11400000
34488 +#define GPIO2_PHYS_ADDR 0x11700000
34489 +#define SYS_PHYS_ADDR 0x11900000
34490 +#define DDMA_PHYS_ADDR 0x14002000
34491 +#define PE_PHYS_ADDR 0x14008000
34492 +#define PSC0_PHYS_ADDR 0x11A00000
34493 +#define PSC1_PHYS_ADDR 0x11B00000
34494 +#define PSC2_PHYS_ADDR 0x10A00000
34495 +#define PSC3_PHYS_ADDR 0x10B00000
34496 +#define PCI_MEM_PHYS_ADDR 0x400000000
34497 +#define PCI_IO_PHYS_ADDR 0x500000000
34498 +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
34499 +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
34500 +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
34501 +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
34502 +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
34503 +#endif
34504 +
34505 +/***********************************************************************/
34506 +
34507 +#ifdef CONFIG_SOC_AU1200
34508 +#define MEM_PHYS_ADDR 0x14000000
34509 +#define STATIC_MEM_PHYS_ADDR 0x14001000
34510 +#define AES_PHYS_ADDR 0x10300000
34511 +#define CIM_PHYS_ADDR 0x14004000
34512 +#define IC0_PHYS_ADDR 0x10400000
34513 +#define IC1_PHYS_ADDR 0x11800000
34514 +#define USBM_PHYS_ADDR 0x14020000
34515 +#define USBH_PHYS_ADDR 0x14020100
34516 +#define UART0_PHYS_ADDR 0x11100000
34517 +#define UART1_PHYS_ADDR 0x11200000
34518 +#define GPIO2_PHYS_ADDR 0x11700000
34519 +#define SYS_PHYS_ADDR 0x11900000
34520 +#define DDMA_PHYS_ADDR 0x14002000
34521 +#define PSC0_PHYS_ADDR 0x11A00000
34522 +#define PSC1_PHYS_ADDR 0x11B00000
34523 +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
34524 +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
34525 +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
34526 +#define SD0_PHYS_ADDR 0x10600000
34527 +#define SD1_PHYS_ADDR 0x10680000
34528 +#define LCD_PHYS_ADDR 0x15000000
34529 +#define SWCNT_PHYS_ADDR 0x1110010C
34530 +#define MAEFE_PHYS_ADDR 0x14012000
34531 +#define MAEBE_PHYS_ADDR 0x14010000
34532 +#endif
34533 +
34534 +
34535 /* Static Bus Controller */
34536 #define MEM_STCFG0 0xB4001000
34537 #define MEM_STTIME0 0xB4001004
34538 @@ -367,7 +695,7 @@
34539 #define AU1000_MAC0_ENABLE 0xB0520000
34540 #define AU1000_MAC1_ENABLE 0xB0520004
34541 #define NUM_ETH_INTERFACES 2
34542 -#endif // CONFIG_SOC_AU1000
34543 +#endif /* CONFIG_SOC_AU1000 */
34544
34545 /* Au1500 */
34546 #ifdef CONFIG_SOC_AU1500
34547 @@ -438,7 +766,7 @@
34548 #define AU1500_MAC0_ENABLE 0xB1520000
34549 #define AU1500_MAC1_ENABLE 0xB1520004
34550 #define NUM_ETH_INTERFACES 2
34551 -#endif // CONFIG_SOC_AU1500
34552 +#endif /* CONFIG_SOC_AU1500 */
34553
34554 /* Au1100 */
34555 #ifdef CONFIG_SOC_AU1100
34556 @@ -483,6 +811,22 @@
34557 #define AU1000_GPIO_13 45
34558 #define AU1000_GPIO_14 46
34559 #define AU1000_GPIO_15 47
34560 +#define AU1000_GPIO_16 48
34561 +#define AU1000_GPIO_17 49
34562 +#define AU1000_GPIO_18 50
34563 +#define AU1000_GPIO_19 51
34564 +#define AU1000_GPIO_20 52
34565 +#define AU1000_GPIO_21 53
34566 +#define AU1000_GPIO_22 54
34567 +#define AU1000_GPIO_23 55
34568 +#define AU1000_GPIO_24 56
34569 +#define AU1000_GPIO_25 57
34570 +#define AU1000_GPIO_26 58
34571 +#define AU1000_GPIO_27 59
34572 +#define AU1000_GPIO_28 60
34573 +#define AU1000_GPIO_29 61
34574 +#define AU1000_GPIO_30 62
34575 +#define AU1000_GPIO_31 63
34576
34577 #define UART0_ADDR 0xB1100000
34578 #define UART1_ADDR 0xB1200000
34579 @@ -494,7 +838,7 @@
34580 #define AU1100_ETH0_BASE 0xB0500000
34581 #define AU1100_MAC0_ENABLE 0xB0520000
34582 #define NUM_ETH_INTERFACES 1
34583 -#endif // CONFIG_SOC_AU1100
34584 +#endif /* CONFIG_SOC_AU1100 */
34585
34586 #ifdef CONFIG_SOC_AU1550
34587 #define AU1550_UART0_INT 0
34588 @@ -511,14 +855,14 @@
34589 #define AU1550_PSC1_INT 11
34590 #define AU1550_PSC2_INT 12
34591 #define AU1550_PSC3_INT 13
34592 -#define AU1550_TOY_INT 14
34593 -#define AU1550_TOY_MATCH0_INT 15
34594 -#define AU1550_TOY_MATCH1_INT 16
34595 -#define AU1550_TOY_MATCH2_INT 17
34596 -#define AU1550_RTC_INT 18
34597 -#define AU1550_RTC_MATCH0_INT 19
34598 -#define AU1550_RTC_MATCH1_INT 20
34599 -#define AU1550_RTC_MATCH2_INT 21
34600 +#define AU1000_TOY_INT 14
34601 +#define AU1000_TOY_MATCH0_INT 15
34602 +#define AU1000_TOY_MATCH1_INT 16
34603 +#define AU1000_TOY_MATCH2_INT 17
34604 +#define AU1000_RTC_INT 18
34605 +#define AU1000_RTC_MATCH0_INT 19
34606 +#define AU1000_RTC_MATCH1_INT 20
34607 +#define AU1000_RTC_MATCH2_INT 21
34608 #define AU1550_NAND_INT 23
34609 #define AU1550_USB_DEV_REQ_INT 24
34610 #define AU1550_USB_DEV_SUS_INT 25
34611 @@ -573,7 +917,7 @@
34612 #define AU1550_MAC0_ENABLE 0xB0520000
34613 #define AU1550_MAC1_ENABLE 0xB0520004
34614 #define NUM_ETH_INTERFACES 2
34615 -#endif // CONFIG_SOC_AU1550
34616 +#endif /* CONFIG_SOC_AU1550 */
34617
34618 #ifdef CONFIG_SOC_AU1200
34619 #define AU1200_UART0_INT 0
34620 @@ -590,14 +934,14 @@
34621 #define AU1200_PSC1_INT 11
34622 #define AU1200_AES_INT 12
34623 #define AU1200_CAMERA_INT 13
34624 -#define AU1200_TOY_INT 14
34625 -#define AU1200_TOY_MATCH0_INT 15
34626 -#define AU1200_TOY_MATCH1_INT 16
34627 -#define AU1200_TOY_MATCH2_INT 17
34628 -#define AU1200_RTC_INT 18
34629 -#define AU1200_RTC_MATCH0_INT 19
34630 -#define AU1200_RTC_MATCH1_INT 20
34631 -#define AU1200_RTC_MATCH2_INT 21
34632 +#define AU1000_TOY_INT 14
34633 +#define AU1000_TOY_MATCH0_INT 15
34634 +#define AU1000_TOY_MATCH1_INT 16
34635 +#define AU1000_TOY_MATCH2_INT 17
34636 +#define AU1000_RTC_INT 18
34637 +#define AU1000_RTC_MATCH0_INT 19
34638 +#define AU1000_RTC_MATCH1_INT 20
34639 +#define AU1000_RTC_MATCH2_INT 21
34640 #define AU1200_NAND_INT 23
34641 #define AU1200_GPIO_204 24
34642 #define AU1200_GPIO_205 25
34643 @@ -605,6 +949,7 @@
34644 #define AU1200_GPIO_207 27
34645 #define AU1200_GPIO_208_215 28 // Logical OR of 208:215
34646 #define AU1200_USB_INT 29
34647 +#define AU1000_USB_HOST_INT AU1200_USB_INT
34648 #define AU1200_LCD_INT 30
34649 #define AU1200_MAE_BOTH_INT 31
34650 #define AU1000_GPIO_0 32
34651 @@ -643,21 +988,36 @@
34652 #define UART0_ADDR 0xB1100000
34653 #define UART1_ADDR 0xB1200000
34654
34655 -#define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
34656 -#define USB_HOST_CONFIG 0xB4027ffc
34657 +#define USB_UOC_BASE 0x14020020
34658 +#define USB_UOC_LEN 0x20
34659 +#define USB_OHCI_BASE 0x14020100
34660 +#define USB_OHCI_LEN 0x100
34661 +#define USB_EHCI_BASE 0x14020200
34662 +#define USB_EHCI_LEN 0x100
34663 +#define USB_UDC_BASE 0x14022000
34664 +#define USB_UDC_LEN 0x2000
34665 +#define USB_MSR_BASE 0xB4020000
34666 +#define USB_MSR_MCFG 4
34667 +#define USBMSRMCFG_OMEMEN 0
34668 +#define USBMSRMCFG_OBMEN 1
34669 +#define USBMSRMCFG_EMEMEN 2
34670 +#define USBMSRMCFG_EBMEN 3
34671 +#define USBMSRMCFG_DMEMEN 4
34672 +#define USBMSRMCFG_DBMEN 5
34673 +#define USBMSRMCFG_GMEMEN 6
34674 +#define USBMSRMCFG_OHCCLKEN 16
34675 +#define USBMSRMCFG_EHCCLKEN 17
34676 +#define USBMSRMCFG_UDCCLKEN 18
34677 +#define USBMSRMCFG_PHYPLLEN 19
34678 +#define USBMSRMCFG_RDCOMB 30
34679 +#define USBMSRMCFG_PFEN 31
34680
34681 -// these are here for prototyping on au1550 (do not exist on au1200)
34682 -#define AU1200_ETH0_BASE 0xB0500000
34683 -#define AU1200_ETH1_BASE 0xB0510000
34684 -#define AU1200_MAC0_ENABLE 0xB0520000
34685 -#define AU1200_MAC1_ENABLE 0xB0520004
34686 -#define NUM_ETH_INTERFACES 2
34687 -#endif // CONFIG_SOC_AU1200
34688 +#endif /* CONFIG_SOC_AU1200 */
34689
34690 #define AU1000_LAST_INTC0_INT 31
34691 +#define AU1000_LAST_INTC1_INT 63
34692 #define AU1000_MAX_INTR 63
34693
34694 -
34695 /* Programmable Counters 0 and 1 */
34696 #define SYS_BASE 0xB1900000
34697 #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
34698 @@ -728,6 +1088,8 @@
34699 #define I2S_CONTROL_D (1<<1)
34700 #define I2S_CONTROL_CE (1<<0)
34701
34702 +#ifndef CONFIG_SOC_AU1200
34703 +
34704 /* USB Host Controller */
34705 #define USB_OHCI_LEN 0x00100000
34706
34707 @@ -773,6 +1135,8 @@
34708 #define USBDEV_ENABLE (1<<1)
34709 #define USBDEV_CE (1<<0)
34710
34711 +#endif /* !CONFIG_SOC_AU1200 */
34712 +
34713 /* Ethernet Controllers */
34714
34715 /* 4 byte offsets from AU1000_ETH_BASE */
34716 @@ -1171,6 +1535,37 @@
34717 #define SYS_PF_PSC1_S1 (1 << 1)
34718 #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
34719
34720 +/* Au1200 Only */
34721 +#ifdef CONFIG_SOC_AU1200
34722 +#define SYS_PINFUNC_DMA (1<<31)
34723 +#define SYS_PINFUNC_S0A (1<<30)
34724 +#define SYS_PINFUNC_S1A (1<<29)
34725 +#define SYS_PINFUNC_LP0 (1<<28)
34726 +#define SYS_PINFUNC_LP1 (1<<27)
34727 +#define SYS_PINFUNC_LD16 (1<<26)
34728 +#define SYS_PINFUNC_LD8 (1<<25)
34729 +#define SYS_PINFUNC_LD1 (1<<24)
34730 +#define SYS_PINFUNC_LD0 (1<<23)
34731 +#define SYS_PINFUNC_P1A (3<<21)
34732 +#define SYS_PINFUNC_P1B (1<<20)
34733 +#define SYS_PINFUNC_FS3 (1<<19)
34734 +#define SYS_PINFUNC_P0A (3<<17)
34735 +#define SYS_PINFUNC_CS (1<<16)
34736 +#define SYS_PINFUNC_CIM (1<<15)
34737 +#define SYS_PINFUNC_P1C (1<<14)
34738 +#define SYS_PINFUNC_U1T (1<<12)
34739 +#define SYS_PINFUNC_U1R (1<<11)
34740 +#define SYS_PINFUNC_EX1 (1<<10)
34741 +#define SYS_PINFUNC_EX0 (1<<9)
34742 +#define SYS_PINFUNC_U0R (1<<8)
34743 +#define SYS_PINFUNC_MC (1<<7)
34744 +#define SYS_PINFUNC_S0B (1<<6)
34745 +#define SYS_PINFUNC_S0C (1<<5)
34746 +#define SYS_PINFUNC_P0B (1<<4)
34747 +#define SYS_PINFUNC_U0T (1<<3)
34748 +#define SYS_PINFUNC_S1B (1<<2)
34749 +#endif
34750 +
34751 #define SYS_TRIOUTRD 0xB1900100
34752 #define SYS_TRIOUTCLR 0xB1900100
34753 #define SYS_OUTPUTRD 0xB1900108
34754 @@ -1298,7 +1693,6 @@
34755 #define SD1_XMIT_FIFO 0xB0680000
34756 #define SD1_RECV_FIFO 0xB0680004
34757
34758 -
34759 #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
34760 /* Au1500 PCI Controller */
34761 #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
34762 @@ -1388,9 +1782,60 @@
34763
34764 #endif
34765
34766 +#ifndef _LANGUAGE_ASSEMBLY
34767 +typedef volatile struct
34768 +{
34769 + /* 0x0000 */ u32 toytrim;
34770 + /* 0x0004 */ u32 toywrite;
34771 + /* 0x0008 */ u32 toymatch0;
34772 + /* 0x000C */ u32 toymatch1;
34773 + /* 0x0010 */ u32 toymatch2;
34774 + /* 0x0014 */ u32 cntrctrl;
34775 + /* 0x0018 */ u32 scratch0;
34776 + /* 0x001C */ u32 scratch1;
34777 + /* 0x0020 */ u32 freqctrl0;
34778 + /* 0x0024 */ u32 freqctrl1;
34779 + /* 0x0028 */ u32 clksrc;
34780 + /* 0x002C */ u32 pinfunc;
34781 + /* 0x0030 */ u32 reserved0;
34782 + /* 0x0034 */ u32 wakemsk;
34783 + /* 0x0038 */ u32 endian;
34784 + /* 0x003C */ u32 powerctrl;
34785 + /* 0x0040 */ u32 toyread;
34786 + /* 0x0044 */ u32 rtctrim;
34787 + /* 0x0048 */ u32 rtcwrite;
34788 + /* 0x004C */ u32 rtcmatch0;
34789 + /* 0x0050 */ u32 rtcmatch1;
34790 + /* 0x0054 */ u32 rtcmatch2;
34791 + /* 0x0058 */ u32 rtcread;
34792 + /* 0x005C */ u32 wakesrc;
34793 + /* 0x0060 */ u32 cpupll;
34794 + /* 0x0064 */ u32 auxpll;
34795 + /* 0x0068 */ u32 reserved1;
34796 + /* 0x006C */ u32 reserved2;
34797 + /* 0x0070 */ u32 reserved3;
34798 + /* 0x0074 */ u32 reserved4;
34799 + /* 0x0078 */ u32 slppwr;
34800 + /* 0x007C */ u32 sleep;
34801 + /* 0x0080 */ u32 reserved5[32];
34802 + /* 0x0100 */ u32 trioutrd;
34803 +#define trioutclr trioutrd
34804 + /* 0x0104 */ u32 reserved6;
34805 + /* 0x0108 */ u32 outputrd;
34806 +#define outputset outputrd
34807 + /* 0x010C */ u32 outputclr;
34808 + /* 0x0110 */ u32 pinstaterd;
34809 +#define pininputen pinstaterd
34810 +
34811 +} AU1X00_SYS;
34812 +
34813 +static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
34814 +
34815 +#endif
34816 /* Processor information base on prid.
34817 * Copied from PowerPC.
34818 */
34819 +#ifndef _LANGUAGE_ASSEMBLY
34820 struct cpu_spec {
34821 /* CPU is matched via (PRID & prid_mask) == prid_value */
34822 unsigned int prid_mask;
34823 @@ -1404,3 +1849,6 @@
34824 extern struct cpu_spec cpu_specs[];
34825 extern struct cpu_spec *cur_cpu_spec[];
34826 #endif
34827 +
34828 +#endif
34829 +
34830 diff -Nur linux-2.4.29/include/asm-mips/au1000_pcmcia.h linux-mips/include/asm-mips/au1000_pcmcia.h
34831 --- linux-2.4.29/include/asm-mips/au1000_pcmcia.h 2005-01-19 15:10:11.000000000 +0100
34832 +++ linux-mips/include/asm-mips/au1000_pcmcia.h 2005-01-31 12:59:48.000000000 +0100
34833 @@ -38,16 +38,41 @@
34834 #define AU1X_SOCK0_PHYS_MEM 0xF80000000
34835
34836 /* pcmcia socket 1 needs external glue logic so the memory map
34837 - * differs from board to board.
34838 + * differs from board to board. the general rule is that
34839 + * static bus address bit 26 should be used to decode socket 0
34840 + * from socket 1. alas, some boards dont follow this...
34841 + * These really belong in a board-specific header file...
34842 */
34843 -#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500)
34844 -#define AU1X_SOCK1_IO 0xF08000000
34845 -#define AU1X_SOCK1_PHYS_ATTR 0xF48000000
34846 -#define AU1X_SOCK1_PHYS_MEM 0xF88000000
34847 -#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
34848 -#define AU1X_SOCK1_IO 0xF04000000
34849 -#define AU1X_SOCK1_PHYS_ATTR 0xF44000000
34850 -#define AU1X_SOCK1_PHYS_MEM 0xF84000000
34851 +#ifdef CONFIG_MIPS_PB1000
34852 +#define SOCK1_DECODE (1<<27)
34853 +#endif
34854 +#ifdef CONFIG_MIPS_DB1000
34855 +#define SOCK1_DECODE (1<<26)
34856 +#endif
34857 +#ifdef CONFIG_MIPS_DB1500
34858 +#define SOCK1_DECODE (1<<26)
34859 +#endif
34860 +#ifdef CONFIG_MIPS_DB1100
34861 +#define SOCK1_DECODE (1<<26)
34862 +#endif
34863 +#ifdef CONFIG_MIPS_DB1550
34864 +#define SOCK1_DECODE (1<<26)
34865 +#endif
34866 +#ifdef CONFIG_MIPS_DB1200
34867 +#define SOCK1_DECODE (1<<26)
34868 +#endif
34869 +#ifdef CONFIG_MIPS_PB1550
34870 +#define SOCK1_DECODE (1<<26)
34871 +#endif
34872 +#ifdef CONFIG_MIPS_PB1200
34873 +#define SOCK1_DECODE (1<<26)
34874 +#endif
34875 +
34876 +/* The board has a second PCMCIA socket */
34877 +#ifdef SOCK1_DECODE
34878 +#define AU1X_SOCK1_IO (0xF00000000|SOCK1_DECODE)
34879 +#define AU1X_SOCK1_PHYS_ATTR (0xF40000000|SOCK1_DECODE)
34880 +#define AU1X_SOCK1_PHYS_MEM (0xF80000000|SOCK1_DECODE)
34881 #endif
34882
34883 struct pcmcia_state {
34884 diff -Nur linux-2.4.29/include/asm-mips/au1100_mmc.h linux-mips/include/asm-mips/au1100_mmc.h
34885 --- linux-2.4.29/include/asm-mips/au1100_mmc.h 2005-01-19 15:10:11.000000000 +0100
34886 +++ linux-mips/include/asm-mips/au1100_mmc.h 2005-01-31 12:59:48.000000000 +0100
34887 @@ -39,16 +39,22 @@
34888 #define __ASM_AU1100_MMC_H
34889
34890
34891 -#define NUM_AU1100_MMC_CONTROLLERS 2
34892 -
34893 -
34894 -#define AU1100_SD_IRQ 2
34895 -
34896 +#if defined(CONFIG_SOC_AU1100)
34897 +#define NUM_MMC_CONTROLLERS 2
34898 +#define AU1X_MMC_INT AU1100_SD_INT
34899 +#endif
34900 +
34901 +#if defined(CONFIG_SOC_AU1200)
34902 +#define NUM_MMC_CONTROLLERS 2
34903 +#define AU1X_MMC_INT AU1200_SD_INT
34904 +#endif
34905
34906 #define SD0_BASE 0xB0600000
34907 #define SD1_BASE 0xB0680000
34908
34909
34910 +
34911 +
34912 /*
34913 * Register offsets.
34914 */
34915 @@ -201,5 +207,12 @@
34916 #define SD_CMD_RT_1B (0x00810000)
34917
34918
34919 +/* support routines required on a platform-specific basis */
34920 +extern void mmc_card_inserted(int _n_, int *_res_);
34921 +extern void mmc_card_writable(int _n_, int *_res_);
34922 +extern void mmc_power_on(int _n_);
34923 +extern void mmc_power_off(int _n_);
34924 +
34925 +
34926 #endif /* __ASM_AU1100_MMC_H */
34927
34928 diff -Nur linux-2.4.29/include/asm-mips/au1xxx_dbdma.h linux-mips/include/asm-mips/au1xxx_dbdma.h
34929 --- linux-2.4.29/include/asm-mips/au1xxx_dbdma.h 2005-01-19 15:10:11.000000000 +0100
34930 +++ linux-mips/include/asm-mips/au1xxx_dbdma.h 2005-01-31 12:59:48.000000000 +0100
34931 @@ -43,7 +43,7 @@
34932 #define DDMA_GLOBAL_BASE 0xb4003000
34933 #define DDMA_CHANNEL_BASE 0xb4002000
34934
34935 -typedef struct dbdma_global {
34936 +typedef volatile struct dbdma_global {
34937 u32 ddma_config;
34938 u32 ddma_intstat;
34939 u32 ddma_throttle;
34940 @@ -60,7 +60,7 @@
34941
34942 /* The structure of a DMA Channel.
34943 */
34944 -typedef struct au1xxx_dma_channel {
34945 +typedef volatile struct au1xxx_dma_channel {
34946 u32 ddma_cfg; /* See below */
34947 u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */
34948 u32 ddma_statptr; /* word aligned pointer to status word */
34949 @@ -96,7 +96,7 @@
34950 /* "Standard" DDMA Descriptor.
34951 * Must be 32-byte aligned.
34952 */
34953 -typedef struct au1xxx_ddma_desc {
34954 +typedef volatile struct au1xxx_ddma_desc {
34955 u32 dscr_cmd0; /* See below */
34956 u32 dscr_cmd1; /* See below */
34957 u32 dscr_source0; /* source phys address */
34958 @@ -105,6 +105,12 @@
34959 u32 dscr_dest1; /* See below */
34960 u32 dscr_stat; /* completion status */
34961 u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */
34962 + /* First 32bytes are HW specific!!!
34963 + Lets have some SW data following.. make sure its 32bytes
34964 + */
34965 + u32 sw_status;
34966 + u32 sw_context;
34967 + u32 sw_reserved[6];
34968 } au1x_ddma_desc_t;
34969
34970 #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */
34971 @@ -123,6 +129,8 @@
34972 #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */
34973 #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */
34974
34975 +#define SW_STATUS_INUSE (1<<0)
34976 +
34977 /* Command 0 device IDs.
34978 */
34979 #ifdef CONFIG_SOC_AU1550
34980 @@ -169,8 +177,8 @@
34981 #define DSCR_CMD0_SDMS_RX0 9
34982 #define DSCR_CMD0_SDMS_TX1 10
34983 #define DSCR_CMD0_SDMS_RX1 11
34984 -#define DSCR_CMD0_AES_TX 12
34985 -#define DSCR_CMD0_AES_RX 13
34986 +#define DSCR_CMD0_AES_TX 13
34987 +#define DSCR_CMD0_AES_RX 12
34988 #define DSCR_CMD0_PSC0_TX 14
34989 #define DSCR_CMD0_PSC0_RX 15
34990 #define DSCR_CMD0_PSC1_TX 16
34991 @@ -189,6 +197,10 @@
34992 #define DSCR_CMD0_THROTTLE 30
34993 #define DSCR_CMD0_ALWAYS 31
34994 #define DSCR_NDEV_IDS 32
34995 +/* THis macro is used to find/create custom device types */
34996 +#define DSCR_DEV2CUSTOM_ID(x,d) (((((x)&0xFFFF)<<8)|0x32000000)|((d)&0xFF))
34997 +#define DSCR_CUSTOM2DEV_ID(x) ((x)&0xFF)
34998 +
34999
35000 #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
35001 #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
35002 @@ -277,6 +289,43 @@
35003 */
35004 #define NUM_DBDMA_CHANS 16
35005
35006 +/*
35007 + * Ddma API definitions
35008 + * FIXME: may not fit to this header file
35009 + */
35010 +typedef struct dbdma_device_table {
35011 + u32 dev_id;
35012 + u32 dev_flags;
35013 + u32 dev_tsize;
35014 + u32 dev_devwidth;
35015 + u32 dev_physaddr; /* If FIFO */
35016 + u32 dev_intlevel;
35017 + u32 dev_intpolarity;
35018 +} dbdev_tab_t;
35019 +
35020 +
35021 +typedef struct dbdma_chan_config {
35022 + spinlock_t lock;
35023 +
35024 + u32 chan_flags;
35025 + u32 chan_index;
35026 + dbdev_tab_t *chan_src;
35027 + dbdev_tab_t *chan_dest;
35028 + au1x_dma_chan_t *chan_ptr;
35029 + au1x_ddma_desc_t *chan_desc_base;
35030 + au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
35031 + void *chan_callparam;
35032 + void (*chan_callback)(int, void *, struct pt_regs *);
35033 +} chan_tab_t;
35034 +
35035 +#define DEV_FLAGS_INUSE (1 << 0)
35036 +#define DEV_FLAGS_ANYUSE (1 << 1)
35037 +#define DEV_FLAGS_OUT (1 << 2)
35038 +#define DEV_FLAGS_IN (1 << 3)
35039 +#define DEV_FLAGS_BURSTABLE (1 << 4)
35040 +#define DEV_FLAGS_SYNC (1 << 5)
35041 +/* end Ddma API definitions */
35042 +
35043 /* External functions for drivers to use.
35044 */
35045 /* Use this to allocate a dbdma channel. The device ids are one of the
35046 @@ -299,8 +348,8 @@
35047
35048 /* Put buffers on source/destination descriptors.
35049 */
35050 -u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes);
35051 -u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes);
35052 +u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
35053 +u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
35054
35055 /* Get a buffer from the destination descriptor.
35056 */
35057 @@ -314,5 +363,25 @@
35058 void au1xxx_dbdma_chan_free(u32 chanid);
35059 void au1xxx_dbdma_dump(u32 chanid);
35060
35061 +u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
35062 +
35063 +u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
35064 +
35065 +/*
35066 + Some compatibilty macros --
35067 + Needed to make changes to API without breaking existing drivers
35068 +*/
35069 +#define au1xxx_dbdma_put_source(chanid,buf,nbytes)_au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
35070 +#define au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
35071 +
35072 +#define au1xxx_dbdma_put_dest(chanid,buf,nbytes) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
35073 +#define au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
35074 +
35075 +/*
35076 + * Flags for the put_source/put_dest functions.
35077 + */
35078 +#define DDMA_FLAGS_IE (1<<0)
35079 +#define DDMA_FLAGS_NOIE (1<<1)
35080 +
35081 #endif /* _LANGUAGE_ASSEMBLY */
35082 #endif /* _AU1000_DBDMA_H_ */
35083 diff -Nur linux-2.4.29/include/asm-mips/au1xxx_gpio.h linux-mips/include/asm-mips/au1xxx_gpio.h
35084 --- linux-2.4.29/include/asm-mips/au1xxx_gpio.h 1970-01-01 01:00:00.000000000 +0100
35085 +++ linux-mips/include/asm-mips/au1xxx_gpio.h 2005-01-30 09:01:28.000000000 +0100
35086 @@ -0,0 +1,22 @@
35087 +
35088 +
35089 +#ifndef __AU1XXX_GPIO_H
35090 +#define __AU1XXX_GPIO_H
35091 +
35092 +void au1xxx_gpio1_set_inputs(void);
35093 +void au1xxx_gpio_tristate(int signal);
35094 +void au1xxx_gpio_write(int signal, int value);
35095 +int au1xxx_gpio_read(int signal);
35096 +
35097 +typedef volatile struct
35098 +{
35099 + u32 dir;
35100 + u32 reserved;
35101 + u32 output;
35102 + u32 pinstate;
35103 + u32 inten;
35104 + u32 enable;
35105 +
35106 +} AU1X00_GPIO2;
35107 +
35108 +#endif //__AU1XXX_GPIO_H
35109 diff -Nur linux-2.4.29/include/asm-mips/au1xxx_psc.h linux-mips/include/asm-mips/au1xxx_psc.h
35110 --- linux-2.4.29/include/asm-mips/au1xxx_psc.h 2005-01-19 15:10:11.000000000 +0100
35111 +++ linux-mips/include/asm-mips/au1xxx_psc.h 2005-01-31 12:59:49.000000000 +0100
35112 @@ -41,6 +41,11 @@
35113 #define PSC3_BASE_ADDR 0xb0d00000
35114 #endif
35115
35116 +#ifdef CONFIG_SOC_AU1200
35117 +#define PSC0_BASE_ADDR 0xb1a00000
35118 +#define PSC1_BASE_ADDR 0xb1b00000
35119 +#endif
35120 +
35121 /* The PSC select and control registers are common to
35122 * all protocols.
35123 */
35124 @@ -226,6 +231,8 @@
35125 #define PSC_I2SCFG_DD_DISABLE (1 << 27)
35126 #define PSC_I2SCFG_DE_ENABLE (1 << 26)
35127 #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
35128 +#define PSC_I2SCFG_WS(n) ((n&0xFF)<<16)
35129 +#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
35130 #define PSC_I2SCFG_WI (1 << 15)
35131
35132 #define PSC_I2SCFG_DIV_MASK (3 << 13)
35133 diff -Nur linux-2.4.29/include/asm-mips/bootinfo.h linux-mips/include/asm-mips/bootinfo.h
35134 --- linux-2.4.29/include/asm-mips/bootinfo.h 2004-02-18 14:36:32.000000000 +0100
35135 +++ linux-mips/include/asm-mips/bootinfo.h 2005-01-31 12:59:49.000000000 +0100
35136 @@ -180,6 +180,9 @@
35137 #define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */
35138 #define MACH_CSB250 8 /* Cogent Au1500 */
35139 #define MACH_PB1550 9 /* Au1550-based eval board */
35140 +#define MACH_PB1200 10 /* Au1200-based eval board */
35141 +#define MACH_DB1550 11 /* Au1550-based eval board */
35142 +#define MACH_DB1200 12 /* Au1200-based eval board */
35143
35144 /*
35145 * Valid machtype for group NEC_VR41XX
35146 diff -Nur linux-2.4.29/include/asm-mips/db1200.h linux-mips/include/asm-mips/db1200.h
35147 --- linux-2.4.29/include/asm-mips/db1200.h 1970-01-01 01:00:00.000000000 +0100
35148 +++ linux-mips/include/asm-mips/db1200.h 2005-01-30 09:02:45.000000000 +0100
35149 @@ -0,0 +1,214 @@
35150 +/*
35151 + * AMD Alchemy DB1200 Referrence Board
35152 + * Board Registers defines.
35153 + *
35154 + * ########################################################################
35155 + *
35156 + * This program is free software; you can distribute it and/or modify it
35157 + * under the terms of the GNU General Public License (Version 2) as
35158 + * published by the Free Software Foundation.
35159 + *
35160 + * This program is distributed in the hope it will be useful, but WITHOUT
35161 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35162 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
35163 + * for more details.
35164 + *
35165 + * You should have received a copy of the GNU General Public License along
35166 + * with this program; if not, write to the Free Software Foundation, Inc.,
35167 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
35168 + *
35169 + * ########################################################################
35170 + *
35171 + *
35172 + */
35173 +#ifndef __ASM_DB1200_H
35174 +#define __ASM_DB1200_H
35175 +
35176 +#include <linux/types.h>
35177 +
35178 +// This is defined in au1000.h with bogus value
35179 +#undef AU1X00_EXTERNAL_INT
35180 +
35181 +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
35182 +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
35183 +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
35184 +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
35185 +
35186 +/* SPI and SMB are muxed on the Pb1200 board.
35187 + Refer to board documentation.
35188 + */
35189 +#define SPI_PSC_BASE PSC0_BASE_ADDR
35190 +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
35191 +/* AC97 and I2S are muxed on the Pb1200 board.
35192 + Refer to board documentation.
35193 + */
35194 +#define AC97_PSC_BASE PSC1_BASE_ADDR
35195 +#define I2S_PSC_BASE PSC1_BASE_ADDR
35196 +
35197 +#define BCSR_KSEG1_ADDR 0xB9800000
35198 +
35199 +typedef volatile struct
35200 +{
35201 + /*00*/ u16 whoami;
35202 + u16 reserved0;
35203 + /*04*/ u16 status;
35204 + u16 reserved1;
35205 + /*08*/ u16 switches;
35206 + u16 reserved2;
35207 + /*0C*/ u16 resets;
35208 + u16 reserved3;
35209 +
35210 + /*10*/ u16 pcmcia;
35211 + u16 reserved4;
35212 + /*14*/ u16 board;
35213 + u16 reserved5;
35214 + /*18*/ u16 disk_leds;
35215 + u16 reserved6;
35216 + /*1C*/ u16 system;
35217 + u16 reserved7;
35218 +
35219 + /*20*/ u16 intclr;
35220 + u16 reserved8;
35221 + /*24*/ u16 intset;
35222 + u16 reserved9;
35223 + /*28*/ u16 intclr_mask;
35224 + u16 reserved10;
35225 + /*2C*/ u16 intset_mask;
35226 + u16 reserved11;
35227 +
35228 + /*30*/ u16 sig_status;
35229 + u16 reserved12;
35230 + /*34*/ u16 int_status;
35231 + u16 reserved13;
35232 + /*38*/ u16 reserved14;
35233 + u16 reserved15;
35234 + /*3C*/ u16 reserved16;
35235 + u16 reserved17;
35236 +
35237 +} BCSR;
35238 +
35239 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
35240 +
35241 +/*
35242 + * Register bit definitions for the BCSRs
35243 + */
35244 +#define BCSR_WHOAMI_DCID 0x000F
35245 +#define BCSR_WHOAMI_CPLD 0x00F0
35246 +#define BCSR_WHOAMI_BOARD 0x0F00
35247 +
35248 +#define BCSR_STATUS_PCMCIA0VS 0x0003
35249 +#define BCSR_STATUS_PCMCIA1VS 0x000C
35250 +#define BCSR_STATUS_SWAPBOOT 0x0040
35251 +#define BCSR_STATUS_FLASHBUSY 0x0100
35252 +#define BCSR_STATUS_IDECBLID 0x0200
35253 +#define BCSR_STATUS_SD0WP 0x0400
35254 +#define BCSR_STATUS_U0RXD 0x1000
35255 +#define BCSR_STATUS_U1RXD 0x2000
35256 +
35257 +#define BCSR_SWITCHES_OCTAL 0x00FF
35258 +#define BCSR_SWITCHES_DIP_1 0x0080
35259 +#define BCSR_SWITCHES_DIP_2 0x0040
35260 +#define BCSR_SWITCHES_DIP_3 0x0020
35261 +#define BCSR_SWITCHES_DIP_4 0x0010
35262 +#define BCSR_SWITCHES_DIP_5 0x0008
35263 +#define BCSR_SWITCHES_DIP_6 0x0004
35264 +#define BCSR_SWITCHES_DIP_7 0x0002
35265 +#define BCSR_SWITCHES_DIP_8 0x0001
35266 +#define BCSR_SWITCHES_ROTARY 0x0F00
35267 +
35268 +#define BCSR_RESETS_ETH 0x0001
35269 +#define BCSR_RESETS_CAMERA 0x0002
35270 +#define BCSR_RESETS_DC 0x0004
35271 +#define BCSR_RESETS_IDE 0x0008
35272 +#define BCSR_RESETS_TV 0x0010
35273 +/* not resets but in the same register */
35274 +#define BCSR_RESETS_PWMR1mUX 0x0800
35275 +#define BCSR_RESETS_PCS0MUX 0x1000
35276 +#define BCSR_RESETS_PCS1MUX 0x2000
35277 +#define BCSR_RESETS_SPISEL 0x4000
35278 +
35279 +#define BCSR_PCMCIA_PC0VPP 0x0003
35280 +#define BCSR_PCMCIA_PC0VCC 0x000C
35281 +#define BCSR_PCMCIA_PC0DRVEN 0x0010
35282 +#define BCSR_PCMCIA_PC0RST 0x0080
35283 +#define BCSR_PCMCIA_PC1VPP 0x0300
35284 +#define BCSR_PCMCIA_PC1VCC 0x0C00
35285 +#define BCSR_PCMCIA_PC1DRVEN 0x1000
35286 +#define BCSR_PCMCIA_PC1RST 0x8000
35287 +
35288 +#define BCSR_BOARD_LCDVEE 0x0001
35289 +#define BCSR_BOARD_LCDVDD 0x0002
35290 +#define BCSR_BOARD_LCDBL 0x0004
35291 +#define BCSR_BOARD_CAMSNAP 0x0010
35292 +#define BCSR_BOARD_CAMPWR 0x0020
35293 +#define BCSR_BOARD_SD0PWR 0x0040
35294 +
35295 +#define BCSR_LEDS_DECIMALS 0x0003
35296 +#define BCSR_LEDS_LED0 0x0100
35297 +#define BCSR_LEDS_LED1 0x0200
35298 +#define BCSR_LEDS_LED2 0x0400
35299 +#define BCSR_LEDS_LED3 0x0800
35300 +
35301 +#define BCSR_SYSTEM_POWEROFF 0x4000
35302 +#define BCSR_SYSTEM_RESET 0x8000
35303 +
35304 +/* Bit positions for the different interrupt sources */
35305 +#define BCSR_INT_IDE 0x0001
35306 +#define BCSR_INT_ETH 0x0002
35307 +#define BCSR_INT_PC0 0x0004
35308 +#define BCSR_INT_PC0STSCHG 0x0008
35309 +#define BCSR_INT_PC1 0x0010
35310 +#define BCSR_INT_PC1STSCHG 0x0020
35311 +#define BCSR_INT_DC 0x0040
35312 +#define BCSR_INT_FLASHBUSY 0x0080
35313 +#define BCSR_INT_PC0INSERT 0x0100
35314 +#define BCSR_INT_PC0EJECT 0x0200
35315 +#define BCSR_INT_PC1INSERT 0x0400
35316 +#define BCSR_INT_PC1EJECT 0x0800
35317 +#define BCSR_INT_SD0INSERT 0x1000
35318 +#define BCSR_INT_SD0EJECT 0x2000
35319 +
35320 +#define AU1XXX_SMC91111_PHYS_ADDR (0x19000300)
35321 +#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
35322 +
35323 +#define AU1XXX_ATA_PHYS_ADDR (0x18800000)
35324 +#define AU1XXX_ATA_PHYS_LEN (0x100)
35325 +#define AU1XXX_ATA_REG_OFFSET (5)
35326 +#define AU1XXX_ATA_INT DB1200_IDE_INT
35327 +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
35328 +#define AU1XXX_ATA_RQSIZE 128
35329 +
35330 +#define NAND_PHYS_ADDR 0x20000000
35331 +
35332 +/*
35333 + * External Interrupts for Pb1200 as of 8/6/2004.
35334 + * Bit positions in the CPLD registers can be calculated by taking
35335 + * the interrupt define and subtracting the DB1200_INT_BEGIN value.
35336 + * *example: IDE bis pos is = 64 - 64
35337 + ETH bit pos is = 65 - 64
35338 + */
35339 +#define DB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
35340 +#define DB1200_IDE_INT (DB1200_INT_BEGIN + 0)
35341 +#define DB1200_ETH_INT (DB1200_INT_BEGIN + 1)
35342 +#define DB1200_PC0_INT (DB1200_INT_BEGIN + 2)
35343 +#define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3)
35344 +#define DB1200_PC1_INT (DB1200_INT_BEGIN + 4)
35345 +#define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5)
35346 +#define DB1200_DC_INT (DB1200_INT_BEGIN + 6)
35347 +#define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7)
35348 +#define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8)
35349 +#define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9)
35350 +#define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10)
35351 +#define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11)
35352 +#define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12)
35353 +#define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13)
35354 +
35355 +#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
35356 +
35357 +/* For drivers/pcmcia/au1000_db1x00.c */
35358 +#define BOARD_PC0_INT DB1200_PC0_INT
35359 +#define BOARD_PC1_INT DB1200_PC1_INT
35360 +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
35361 +
35362 +#endif /* __ASM_DB1200_H */
35363 +
35364 diff -Nur linux-2.4.29/include/asm-mips/db1x00.h linux-mips/include/asm-mips/db1x00.h
35365 --- linux-2.4.29/include/asm-mips/db1x00.h 2005-01-19 15:10:11.000000000 +0100
35366 +++ linux-mips/include/asm-mips/db1x00.h 2005-01-31 12:59:49.000000000 +0100
35367 @@ -1,5 +1,5 @@
35368 /*
35369 - * AMD Alchemy DB1x00 Reference Boards
35370 + * AMD Alchemy DB1x00 Reference Boards (BUT NOT DB1200)
35371 *
35372 * Copyright 2001 MontaVista Software Inc.
35373 * Author: MontaVista Software, Inc.
35374 @@ -36,9 +36,18 @@
35375 #define AC97_PSC_BASE PSC1_BASE_ADDR
35376 #define SMBUS_PSC_BASE PSC2_BASE_ADDR
35377 #define I2S_PSC_BASE PSC3_BASE_ADDR
35378 +#define NAND_CS 1
35379 +/* for drivers/pcmcia/au1000_db1x00.c */
35380 +#define BOARD_PC0_INT AU1000_GPIO_3
35381 +#define BOARD_PC1_INT AU1000_GPIO_5
35382 +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
35383
35384 #else
35385 #define BCSR_KSEG1_ADDR 0xAE000000
35386 +/* for drivers/pcmcia/au1000_db1x00.c */
35387 +#define BOARD_PC0_INT AU1000_GPIO_2
35388 +#define BOARD_PC1_INT AU1000_GPIO_5
35389 +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
35390 #endif
35391
35392 /*
35393 @@ -66,6 +75,7 @@
35394
35395 } BCSR;
35396
35397 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
35398
35399 /*
35400 * Register/mask bit definitions for the BCSRs
35401 @@ -130,14 +140,6 @@
35402
35403 #define BCSR_SWRESET_RESET 0x0080
35404
35405 -/* PCMCIA Db1x00 specific defines */
35406 -#define PCMCIA_MAX_SOCK 1
35407 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
35408 -
35409 -/* VPP/VCC */
35410 -#define SET_VCC_VPP(VCC, VPP, SLOT)\
35411 - ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
35412 -
35413 /* MTD CONFIG OPTIONS */
35414 #if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
35415 #define DB1X00_BOTH_BANKS
35416 @@ -147,48 +149,15 @@
35417 #define DB1X00_USER_ONLY
35418 #endif
35419
35420 -/* SD controller macros */
35421 -/*
35422 - * Detect card.
35423 - */
35424 -#define mmc_card_inserted(_n_, _res_) \
35425 - do { \
35426 - BCSR * const bcsr = (BCSR *)0xAE000000; \
35427 - unsigned long mmc_wp, board_specific; \
35428 - if ((_n_)) { \
35429 - mmc_wp = BCSR_BOARD_SD1_WP; \
35430 - } else { \
35431 - mmc_wp = BCSR_BOARD_SD0_WP; \
35432 - } \
35433 - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
35434 - if (!(board_specific & mmc_wp)) {/* low means card present */ \
35435 - *(int *)(_res_) = 1; \
35436 - } else { \
35437 - *(int *)(_res_) = 0; \
35438 - } \
35439 - } while (0)
35440 -
35441 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
35442 /*
35443 - * Apply power to card slot(s).
35444 + * Daughter card information.
35445 */
35446 -#define mmc_power_on(_n_) \
35447 - do { \
35448 - BCSR * const bcsr = (BCSR *)0xAE000000; \
35449 - unsigned long mmc_pwr, mmc_wp, board_specific; \
35450 - if ((_n_)) { \
35451 - mmc_pwr = BCSR_BOARD_SD1_PWR; \
35452 - mmc_wp = BCSR_BOARD_SD1_WP; \
35453 - } else { \
35454 - mmc_pwr = BCSR_BOARD_SD0_PWR; \
35455 - mmc_wp = BCSR_BOARD_SD0_WP; \
35456 - } \
35457 - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
35458 - if (!(board_specific & mmc_wp)) {/* low means card present */ \
35459 - board_specific |= mmc_pwr; \
35460 - au_writel(board_specific, (int)(&bcsr->specific)); \
35461 - au_sync(); \
35462 - } \
35463 - } while (0)
35464 +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_8)
35465 +/* DC_IDE */
35466 +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
35467 +#define AU1XXX_ATA_REG_OFFSET (5)
35468 +#endif /* CONFIG_MIPS_DB1550 */
35469
35470 #endif /* __ASM_DB1X00_H */
35471
35472 diff -Nur linux-2.4.29/include/asm-mips/ficmmp.h linux-mips/include/asm-mips/ficmmp.h
35473 --- linux-2.4.29/include/asm-mips/ficmmp.h 1970-01-01 01:00:00.000000000 +0100
35474 +++ linux-mips/include/asm-mips/ficmmp.h 2005-01-30 09:01:28.000000000 +0100
35475 @@ -0,0 +1,156 @@
35476 +/*
35477 + * FIC MMP
35478 + *
35479 + * ########################################################################
35480 + *
35481 + * This program is free software; you can distribute it and/or modify it
35482 + * under the terms of the GNU General Public License (Version 2) as
35483 + * published by the Free Software Foundation.
35484 + *
35485 + * This program is distributed in the hope it will be useful, but WITHOUT
35486 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35487 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
35488 + * for more details.
35489 + *
35490 + * You should have received a copy of the GNU General Public License along
35491 + * with this program; if not, write to the Free Software Foundation, Inc.,
35492 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
35493 + *
35494 + * ########################################################################
35495 + *
35496 + *
35497 + */
35498 +#ifndef __ASM_FICMMP_H
35499 +#define __ASM_FICMMP_H
35500 +
35501 +#include <linux/types.h>
35502 +#include <asm/au1000.h>
35503 +#include <asm/au1xxx_gpio.h>
35504 +
35505 +// This is defined in au1000.h with bogus value
35506 +#undef AU1X00_EXTERNAL_INT
35507 +
35508 +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
35509 +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
35510 +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
35511 +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
35512 +/* SPI and SMB are muxed on the Pb1200 board.
35513 + Refer to board documentation.
35514 + */
35515 +#define SPI_PSC_BASE PSC0_BASE_ADDR
35516 +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
35517 +/* AC97 and I2S are muxed on the Pb1200 board.
35518 + Refer to board documentation.
35519 + */
35520 +#define AC97_PSC_BASE PSC1_BASE_ADDR
35521 +#define I2S_PSC_BASE PSC1_BASE_ADDR
35522 +
35523 +
35524 +/*
35525 + * SMSC LAN91C111
35526 + */
35527 +#define AU1XXX_SMC91111_PHYS_ADDR (0xAC000300)
35528 +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_5
35529 +
35530 +/* DC_IDE and DC_ETHERNET */
35531 +#define FICMMP_IDE_INT AU1000_GPIO_4
35532 +
35533 +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
35534 +#define AU1XXX_ATA_REG_OFFSET (5)
35535 +/*
35536 +#define AU1XXX_ATA_BASE (0x0C800000)
35537 +#define AU1XXX_ATA_END (0x0CFFFFFF)
35538 +#define AU1XXX_ATA_MEM_SIZE (AU1XXX_ATA_END - AU1XXX_ATA_BASE +1)
35539 +
35540 +#define AU1XXX_ATA_REG_OFFSET (5)
35541 +*/
35542 +/* VPP/VCC */
35543 +#define SET_VCC_VPP(VCC, VPP, SLOT)\
35544 + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
35545 +
35546 +
35547 +#define FICMMP_CONFIG_BASE 0xAD000000
35548 +#define FICMMP_CONFIG_ENABLE 13
35549 +
35550 +#define FICMMP_CONFIG_I2SFREQ(N) (N<<0)
35551 +#define FICMMP_CONFIG_I2SXTAL0 (1<<0)
35552 +#define FICMMP_CONFIG_I2SXTAL1 (1<<1)
35553 +#define FICMMP_CONFIG_I2SXTAL2 (1<<2)
35554 +#define FICMMP_CONFIG_I2SXTAL3 (1<<3)
35555 +#define FICMMP_CONFIG_ADV1 (1<<4)
35556 +#define FICMMP_CONFIG_IDERST (1<<5)
35557 +#define FICMMP_CONFIG_LCMEN (1<<6)
35558 +#define FICMMP_CONFIG_CAMPWDN (1<<7)
35559 +#define FICMMP_CONFIG_USBPWREN (1<<8)
35560 +#define FICMMP_CONFIG_LCMPWREN (1<<9)
35561 +#define FICMMP_CONFIG_TVOUTPWREN (1<<10)
35562 +#define FICMMP_CONFIG_RS232PWREN (1<<11)
35563 +#define FICMMP_CONFIG_LCMDATAOUT (1<<12)
35564 +#define FICMMP_CONFIG_TVODATAOUT (1<<13)
35565 +#define FICMMP_CONFIG_ADV3 (1<<14)
35566 +#define FICMMP_CONFIG_ADV4 (1<<15)
35567 +
35568 +#define I2S_FREQ_8_192 (0x0)
35569 +#define I2S_FREQ_11_2896 (0x1)
35570 +#define I2S_FREQ_12_288 (0x2)
35571 +#define I2S_FREQ_24_576 (0x3)
35572 +//#define I2S_FREQ_12_288 (0x4)
35573 +#define I2S_FREQ_16_9344 (0x5)
35574 +#define I2S_FREQ_18_432 (0x6)
35575 +#define I2S_FREQ_36_864 (0x7)
35576 +#define I2S_FREQ_16_384 (0x8)
35577 +#define I2S_FREQ_22_5792 (0x9)
35578 +//#define I2S_FREQ_24_576 (0x10)
35579 +#define I2S_FREQ_49_152 (0x11)
35580 +//#define I2S_FREQ_24_576 (0x12)
35581 +#define I2S_FREQ_33_8688 (0x13)
35582 +//#define I2S_FREQ_36_864 (0x14)
35583 +#define I2S_FREQ_73_728 (0x15)
35584 +
35585 +#define FICMMP_IDE_PWR 9
35586 +#define FICMMP_FOCUS_RST 2
35587 +
35588 +static __inline void ficmmp_config_set(u16 bits)
35589 +{
35590 + extern u16 ficmmp_config;
35591 + //printk("set_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config | bits);
35592 + ficmmp_config |= bits;
35593 + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
35594 +}
35595 +
35596 +static __inline void ficmmp_config_clear(u16 bits)
35597 +{
35598 + extern u16 ficmmp_config;
35599 +// printk("clear_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config & ~bits);
35600 + ficmmp_config &= ~bits;
35601 + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
35602 +}
35603 +
35604 +static __inline void ficmmp_config_init(void)
35605 +{
35606 + au1xxx_gpio_write(FICMMP_CONFIG_ENABLE, 0); //Enable configuration latch
35607 + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT | FICMMP_CONFIG_TVODATAOUT | FICMMP_CONFIG_IDERST); //Disable display data buffers
35608 + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(I2S_FREQ_36_864));
35609 +}
35610 +
35611 +static __inline u32 ficmmp_set_i2s_sample_rate(u32 rate)
35612 +{
35613 + u32 freq;
35614 +
35615 + switch(rate)
35616 + {
35617 + case 88200:
35618 + case 44100:
35619 + case 8018: freq = I2S_FREQ_11_2896; break;
35620 + case 48000:
35621 + case 32000: //freq = I2S_FREQ_18_432; break;
35622 + case 8000: freq = I2S_FREQ_12_288; break;
35623 + default: freq = I2S_FREQ_12_288; rate = 8000;
35624 + }
35625 + ficmmp_config_clear(FICMMP_CONFIG_I2SFREQ(0xF));
35626 + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(freq));
35627 + return rate;
35628 +}
35629 +
35630 +#endif /* __ASM_FICMMP_H */
35631 +
35632 diff -Nur linux-2.4.29/include/asm-mips/hazards.h linux-mips/include/asm-mips/hazards.h
35633 --- linux-2.4.29/include/asm-mips/hazards.h 2004-02-18 14:36:32.000000000 +0100
35634 +++ linux-mips/include/asm-mips/hazards.h 2004-11-25 23:18:38.000000000 +0100
35635 @@ -3,7 +3,7 @@
35636 * License. See the file "COPYING" in the main directory of this archive
35637 * for more details.
35638 *
35639 - * Copyright (C) 2003 Ralf Baechle
35640 + * Copyright (C) 2003, 2004 Ralf Baechle
35641 */
35642 #ifndef _ASM_HAZARDS_H
35643 #define _ASM_HAZARDS_H
35644 @@ -12,38 +12,185 @@
35645
35646 #ifdef __ASSEMBLY__
35647
35648 + .macro _ssnop
35649 + sll $0, $0, 1
35650 + .endm
35651 +
35652 /*
35653 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
35654 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
35655 * for data translations should not occur for 3 cpu cycles.
35656 */
35657 #ifdef CONFIG_CPU_RM9000
35658 -#define rm9000_tlb_hazard \
35659 +
35660 +#define mtc0_tlbw_hazard \
35661 + .set push; \
35662 + .set mips32; \
35663 + _ssnop; _ssnop; _ssnop; _ssnop; \
35664 + .set pop
35665 +
35666 +#define tlbw_eret_hazard \
35667 .set push; \
35668 .set mips32; \
35669 - ssnop; ssnop; ssnop; ssnop; \
35670 + _ssnop; _ssnop; _ssnop; _ssnop; \
35671 .set pop
35672 +
35673 #else
35674 -#define rm9000_tlb_hazard
35675 +
35676 +/*
35677 + * The taken branch will result in a two cycle penalty for the two killed
35678 + * instructions on R4000 / R4400. Other processors only have a single cycle
35679 + * hazard so this is nice trick to have an optimal code for a range of
35680 + * processors.
35681 + */
35682 +#define mtc0_tlbw_hazard \
35683 + b . + 8
35684 +#define tlbw_eret_hazard
35685 #endif
35686
35687 +/*
35688 + * mtc0->mfc0 hazard
35689 + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
35690 + * It is a MIPS32R2 processor so ehb will clear the hazard.
35691 + */
35692 +
35693 +#ifdef CONFIG_CPU_MIPSR2
35694 +/*
35695 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
35696 + */
35697 + .macro ehb
35698 + sll $0, $0, 3
35699 + .endm
35700 +
35701 +#define irq_enable_hazard \
35702 + ehb # irq_enable_hazard
35703 +
35704 +#define irq_disable_hazard \
35705 + ehb # irq_disable_hazard
35706 +
35707 #else
35708
35709 +#define irq_enable_hazard
35710 +#define irq_disable_hazard
35711 +
35712 +#endif
35713 +
35714 +#else /* __ASSEMBLY__ */
35715 +
35716 /*
35717 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
35718 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
35719 * for data translations should not occur for 3 cpu cycles.
35720 */
35721 #ifdef CONFIG_CPU_RM9000
35722 -#define rm9000_tlb_hazard() \
35723 +
35724 +#define mtc0_tlbw_hazard() \
35725 __asm__ __volatile__( \
35726 ".set\tmips32\n\t" \
35727 - "ssnop; ssnop; ssnop; ssnop\n\t" \
35728 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
35729 + ".set\tmips0")
35730 +
35731 +#define tlbw_use_hazard() \
35732 + __asm__ __volatile__( \
35733 + ".set\tmips32\n\t" \
35734 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
35735 ".set\tmips0")
35736 #else
35737 -#define rm9000_tlb_hazard() do { } while (0)
35738 +
35739 +/*
35740 + * Overkill warning ...
35741 + */
35742 +#define mtc0_tlbw_hazard() \
35743 + __asm__ __volatile__( \
35744 + ".set noreorder\n\t" \
35745 + "nop; nop; nop; nop; nop; nop;\n\t" \
35746 + ".set reorder\n\t")
35747 +
35748 +#define tlbw_use_hazard() \
35749 + __asm__ __volatile__( \
35750 + ".set noreorder\n\t" \
35751 + "nop; nop; nop; nop; nop; nop;\n\t" \
35752 + ".set reorder\n\t")
35753 +
35754 #endif
35755
35756 +/*
35757 + * mtc0->mfc0 hazard
35758 + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
35759 + * It is a MIPS32R2 processor so ehb will clear the hazard.
35760 + */
35761 +
35762 +#ifdef CONFIG_CPU_MIPSR2
35763 +/*
35764 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
35765 + */
35766 +__asm__(
35767 + " .macro ehb \n\t"
35768 + " sll $0, $0, 3 \n\t"
35769 + " .endm \n\t"
35770 + " \n\t"
35771 + " .macro\tirq_enable_hazard \n\t"
35772 + " ehb \n\t"
35773 + " .endm \n\t"
35774 + " \n\t"
35775 + " .macro\tirq_disable_hazard \n\t"
35776 + " ehb \n\t"
35777 + " .endm");
35778 +
35779 +#define irq_enable_hazard() \
35780 + __asm__ __volatile__( \
35781 + "ehb\t\t\t\t# irq_enable_hazard")
35782 +
35783 +#define irq_disable_hazard() \
35784 + __asm__ __volatile__( \
35785 + "ehb\t\t\t\t# irq_disable_hazard")
35786 +
35787 +#elif defined(CONFIG_CPU_R10000)
35788 +
35789 +/*
35790 + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
35791 + */
35792 +
35793 +__asm__(
35794 + " .macro\tirq_enable_hazard \n\t"
35795 + " .endm \n\t"
35796 + " \n\t"
35797 + " .macro\tirq_disable_hazard \n\t"
35798 + " .endm");
35799 +
35800 +#define irq_enable_hazard() do { } while (0)
35801 +#define irq_disable_hazard() do { } while (0)
35802 +
35803 +#else
35804 +
35805 +/*
35806 + * Default for classic MIPS processors. Assume worst case hazards but don't
35807 + * care about the irq_enable_hazard - sooner or later the hardware will
35808 + * enable it and we don't care when exactly.
35809 + */
35810 +
35811 +__asm__(
35812 + " .macro _ssnop \n\t"
35813 + " sll $0, $2, 1 \n\t"
35814 + " .endm \n\t"
35815 + " \n\t"
35816 + " # \n\t"
35817 + " # There is a hazard but we do not care \n\t"
35818 + " # \n\t"
35819 + " .macro\tirq_enable_hazard \n\t"
35820 + " .endm \n\t"
35821 + " \n\t"
35822 + " .macro\tirq_disable_hazard \n\t"
35823 + " _ssnop; _ssnop; _ssnop \n\t"
35824 + " .endm");
35825 +
35826 +#define irq_enable_hazard() do { } while (0)
35827 +#define irq_disable_hazard() \
35828 + __asm__ __volatile__( \
35829 + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
35830 +
35831 #endif
35832
35833 +#endif /* __ASSEMBLY__ */
35834 +
35835 #endif /* _ASM_HAZARDS_H */
35836 diff -Nur linux-2.4.29/include/asm-mips/mipsregs.h linux-mips/include/asm-mips/mipsregs.h
35837 --- linux-2.4.29/include/asm-mips/mipsregs.h 2005-01-19 15:10:12.000000000 +0100
35838 +++ linux-mips/include/asm-mips/mipsregs.h 2005-03-26 11:47:36.210708732 +0100
35839 @@ -757,10 +757,18 @@
35840 #define read_c0_config1() __read_32bit_c0_register($16, 1)
35841 #define read_c0_config2() __read_32bit_c0_register($16, 2)
35842 #define read_c0_config3() __read_32bit_c0_register($16, 3)
35843 +#define read_c0_config4() __read_32bit_c0_register($16, 4)
35844 +#define read_c0_config5() __read_32bit_c0_register($16, 5)
35845 +#define read_c0_config6() __read_32bit_c0_register($16, 6)
35846 +#define read_c0_config7() __read_32bit_c0_register($16, 7)
35847 #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
35848 #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
35849 #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
35850 #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
35851 +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
35852 +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
35853 +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
35854 +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
35855
35856 /*
35857 * The WatchLo register. There may be upto 8 of them.
35858 @@ -874,42 +882,34 @@
35859 */
35860 static inline void tlb_probe(void)
35861 {
35862 - rm9000_tlb_hazard();
35863 __asm__ __volatile__(
35864 ".set noreorder\n\t"
35865 "tlbp\n\t"
35866 ".set reorder");
35867 - rm9000_tlb_hazard();
35868 }
35869
35870 static inline void tlb_read(void)
35871 {
35872 - rm9000_tlb_hazard();
35873 __asm__ __volatile__(
35874 ".set noreorder\n\t"
35875 "tlbr\n\t"
35876 ".set reorder");
35877 - rm9000_tlb_hazard();
35878 }
35879
35880 static inline void tlb_write_indexed(void)
35881 {
35882 - rm9000_tlb_hazard();
35883 __asm__ __volatile__(
35884 ".set noreorder\n\t"
35885 "tlbwi\n\t"
35886 ".set reorder");
35887 - rm9000_tlb_hazard();
35888 }
35889
35890 static inline void tlb_write_random(void)
35891 {
35892 - rm9000_tlb_hazard();
35893 __asm__ __volatile__(
35894 ".set noreorder\n\t"
35895 "tlbwr\n\t"
35896 ".set reorder");
35897 - rm9000_tlb_hazard();
35898 }
35899
35900 /*
35901 diff -Nur linux-2.4.29/include/asm-mips/mmu_context.h linux-mips/include/asm-mips/mmu_context.h
35902 --- linux-2.4.29/include/asm-mips/mmu_context.h 2005-01-19 15:10:12.000000000 +0100
35903 +++ linux-mips/include/asm-mips/mmu_context.h 2004-11-22 14:38:29.000000000 +0100
35904 @@ -27,7 +27,7 @@
35905 #define TLBMISS_HANDLER_SETUP_PGD(pgd) \
35906 pgd_current[smp_processor_id()] = (unsigned long)(pgd)
35907 #define TLBMISS_HANDLER_SETUP() \
35908 - write_c0_context((unsigned long) smp_processor_id() << (23 + 3)); \
35909 + write_c0_context((unsigned long) smp_processor_id() << 23); \
35910 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
35911 extern unsigned long pgd_current[];
35912
35913 diff -Nur linux-2.4.29/include/asm-mips/pb1100.h linux-mips/include/asm-mips/pb1100.h
35914 --- linux-2.4.29/include/asm-mips/pb1100.h 2003-08-25 13:44:44.000000000 +0200
35915 +++ linux-mips/include/asm-mips/pb1100.h 2005-01-31 12:59:49.000000000 +0100
35916 @@ -1,5 +1,5 @@
35917 /*
35918 - * Alchemy Semi PB1100 Referrence Board
35919 + * AMD Alchemy PB1100 Reference Boards
35920 *
35921 * Copyright 2001 MontaVista Software Inc.
35922 * Author: MontaVista Software, Inc.
35923 @@ -27,55 +27,108 @@
35924 #ifndef __ASM_PB1100_H
35925 #define __ASM_PB1100_H
35926
35927 -#define PB1100_IDENT 0xAE000000
35928 -#define BOARD_STATUS_REG 0xAE000004
35929 - #define PB1100_ROM_SEL (1<<15)
35930 - #define PB1100_ROM_SIZ (1<<14)
35931 - #define PB1100_SWAP_BOOT (1<<13)
35932 - #define PB1100_FLASH_WP (1<<12)
35933 - #define PB1100_ROM_H_STS (1<<11)
35934 - #define PB1100_ROM_L_STS (1<<10)
35935 - #define PB1100_FLASH_H_STS (1<<9)
35936 - #define PB1100_FLASH_L_STS (1<<8)
35937 - #define PB1100_SRAM_SIZ (1<<7)
35938 - #define PB1100_TSC_BUSY (1<<6)
35939 - #define PB1100_PCMCIA_VS_MASK (3<<4)
35940 - #define PB1100_RS232_CD (1<<3)
35941 - #define PB1100_RS232_CTS (1<<2)
35942 - #define PB1100_RS232_DSR (1<<1)
35943 - #define PB1100_RS232_RI (1<<0)
35944 -
35945 -#define PB1100_IRDA_RS232 0xAE00000C
35946 - #define PB1100_IRDA_FULL (0<<14) /* full power */
35947 - #define PB1100_IRDA_SHUTDOWN (1<<14)
35948 - #define PB1100_IRDA_TT (2<<14) /* 2/3 power */
35949 - #define PB1100_IRDA_OT (3<<14) /* 1/3 power */
35950 - #define PB1100_IRDA_FIR (1<<13)
35951 -
35952 -#define PCMCIA_BOARD_REG 0xAE000010
35953 - #define PB1100_SD_WP1_RO (1<<15) /* read only */
35954 - #define PB1100_SD_WP0_RO (1<<14) /* read only */
35955 - #define PB1100_SD_PWR1 (1<<11) /* applies power to SD1 */
35956 - #define PB1100_SD_PWR0 (1<<10) /* applies power to SD0 */
35957 - #define PB1100_SEL_SD_CONN1 (1<<9)
35958 - #define PB1100_SEL_SD_CONN0 (1<<8)
35959 - #define PC_DEASSERT_RST (1<<7)
35960 - #define PC_DRV_EN (1<<4)
35961 -
35962 -#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
35963 -
35964 -#define PB1100_RST_VDDI 0xAE00001C
35965 - #define PB1100_SOFT_RESET (1<<15) /* clear to reset the board */
35966 - #define PB1100_VDDI_MASK (0x1F)
35967 +#define BCSR_KSEG1_ADDR 0xAE000000
35968 +
35969 +/*
35970 + * Overlay data structure of the Pb1100 board registers.
35971 + * Registers located at physical 0E0000xx, KSEG1 0xAE0000xx
35972 + */
35973 +typedef volatile struct
35974 +{
35975 + /*00*/ unsigned short whoami;
35976 + unsigned short reserved0;
35977 + /*04*/ unsigned short status;
35978 + unsigned short reserved1;
35979 + /*08*/ unsigned short switches;
35980 + unsigned short reserved2;
35981 + /*0C*/ unsigned short resets;
35982 + unsigned short reserved3;
35983 + /*10*/ unsigned short pcmcia;
35984 + unsigned short reserved4;
35985 + /*14*/ unsigned short graphics;
35986 + unsigned short reserved5;
35987 + /*18*/ unsigned short leds;
35988 + unsigned short reserved6;
35989 + /*1C*/ unsigned short swreset;
35990 + unsigned short reserved7;
35991 +
35992 +} BCSR;
35993
35994 -#define PB1100_LEDS 0xAE000018
35995
35996 -/* 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
35997 - * 7:0 is the LED Display's decimal points.
35998 +/*
35999 + * Register/mask bit definitions for the BCSRs
36000 */
36001 -#define PB1100_HEX_LED 0xAE000018
36002 +#define BCSR_WHOAMI_DCID 0x000F
36003 +#define BCSR_WHOAMI_CPLD 0x00F0
36004 +#define BCSR_WHOAMI_BOARD 0x0F00
36005 +
36006 +#define BCSR_STATUS_RS232_RI 0x0001
36007 +#define BCSR_STATUS_RS232_DSR 0x0002
36008 +#define BCSR_STATUS_RS232_CTS 0x0004
36009 +#define BCSR_STATUS_RS232_CD 0x0008
36010 +#define BCSR_STATUS_PCMCIA_VS_MASK 0x0030
36011 +#define BCSR_STATUS_TSC_BUSY 0x0040
36012 +#define BCSR_STATUS_SRAM_SIZ 0x0080
36013 +#define BCSR_STATUS_FLASH_L_STS 0x0100
36014 +#define BCSR_STATUS_FLASH_H_STS 0x0200
36015 +#define BCSR_STATUS_ROM_H_STS 0x0400
36016 +#define BCSR_STATUS_ROM_L_STS 0x0800
36017 +#define BCSR_STATUS_FLASH_WP 0x1000
36018 +#define BCSR_STATUS_SWAP_BOOT 0x2000
36019 +#define BCSR_STATUS_ROM_SIZ 0x4000
36020 +#define BCSR_STATUS_ROM_SEL 0x8000
36021 +
36022 +#define BCSR_SWITCHES_DIP 0x00FF
36023 +#define BCSR_SWITCHES_DIP_1 0x0080
36024 +#define BCSR_SWITCHES_DIP_2 0x0040
36025 +#define BCSR_SWITCHES_DIP_3 0x0020
36026 +#define BCSR_SWITCHES_DIP_4 0x0010
36027 +#define BCSR_SWITCHES_DIP_5 0x0008
36028 +#define BCSR_SWITCHES_DIP_6 0x0004
36029 +#define BCSR_SWITCHES_DIP_7 0x0002
36030 +#define BCSR_SWITCHES_DIP_8 0x0001
36031 +#define BCSR_SWITCHES_ROTARY 0x0F00
36032 +#define BCSR_SWITCHES_SDO_CL 0x8000
36033 +
36034 +#define BCSR_RESETS_PHY0 0x0001
36035 +#define BCSR_RESETS_PHY1 0x0002
36036 +#define BCSR_RESETS_DC 0x0004
36037 +#define BCSR_RESETS_RS232_RTS 0x0100
36038 +#define BCSR_RESETS_RS232_DTR 0x0200
36039 +#define BCSR_RESETS_FIR_SEL 0x2000
36040 +#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
36041 +#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
36042 +#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
36043 +#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
36044 +#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
36045 +
36046 +#define BCSR_PCMCIA_PC0VPP 0x0003
36047 +#define BCSR_PCMCIA_PC0VCC 0x000C
36048 +#define BCSR_PCMCIA_PC0_DR_VEN 0x0010
36049 +#define BCSR_PCMCIA_PC0RST 0x0080
36050 +#define BCSR_PCMCIA_SEL_SD_CON0 0x0100
36051 +#define BCSR_PCMCIA_SEL_SD_CON1 0x0200
36052 +#define BCSR_PCMCIA_SD0_PWR 0x0400
36053 +#define BCSR_PCMCIA_SD1_PWR 0x0800
36054 +#define BCSR_PCMCIA_SD0_WP 0x4000
36055 +#define BCSR_PCMCIA_SD1_WP 0x8000
36056 +
36057 +#define PB1100_G_CONTROL 0xAE000014
36058 +#define BCSR_GRAPHICS_GPX_SMPASS 0x0010
36059 +#define BCSR_GRAPHICS_GPX_BIG_ENDIAN 0x0020
36060 +#define BCSR_GRAPHICS_GPX_RST 0x0040
36061 +
36062 +#define BCSR_LEDS_DECIMALS 0x00FF
36063 +#define BCSR_LEDS_LED0 0x0100
36064 +#define BCSR_LEDS_LED1 0x0200
36065 +#define BCSR_LEDS_LED2 0x0400
36066 +#define BCSR_LEDS_LED3 0x0800
36067 +
36068 +#define BCSR_SWRESET_RESET 0x0080
36069 +#define BCSR_VDDI_VDI 0x001F
36070
36071 -/* PCMCIA PB1100 specific defines */
36072 +
36073 + /* PCMCIA Pb1x00 specific defines */
36074 #define PCMCIA_MAX_SOCK 0
36075 #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
36076
36077 @@ -83,3 +136,4 @@
36078 #define SET_VCC_VPP(VCC, VPP) (((VCC)<<2) | ((VPP)<<0))
36079
36080 #endif /* __ASM_PB1100_H */
36081 +
36082 diff -Nur linux-2.4.29/include/asm-mips/pb1200.h linux-mips/include/asm-mips/pb1200.h
36083 --- linux-2.4.29/include/asm-mips/pb1200.h 1970-01-01 01:00:00.000000000 +0100
36084 +++ linux-mips/include/asm-mips/pb1200.h 2005-01-30 09:01:28.000000000 +0100
36085 @@ -0,0 +1,244 @@
36086 +/*
36087 + * AMD Alchemy PB1200 Referrence Board
36088 + * Board Registers defines.
36089 + *
36090 + * ########################################################################
36091 + *
36092 + * This program is free software; you can distribute it and/or modify it
36093 + * under the terms of the GNU General Public License (Version 2) as
36094 + * published by the Free Software Foundation.
36095 + *
36096 + * This program is distributed in the hope it will be useful, but WITHOUT
36097 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
36098 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
36099 + * for more details.
36100 + *
36101 + * You should have received a copy of the GNU General Public License along
36102 + * with this program; if not, write to the Free Software Foundation, Inc.,
36103 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
36104 + *
36105 + * ########################################################################
36106 + *
36107 + *
36108 + */
36109 +#ifndef __ASM_PB1200_H
36110 +#define __ASM_PB1200_H
36111 +
36112 +#include <linux/types.h>
36113 +
36114 +// This is defined in au1000.h with bogus value
36115 +#undef AU1X00_EXTERNAL_INT
36116 +
36117 +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
36118 +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
36119 +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
36120 +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
36121 +
36122 +/* SPI and SMB are muxed on the Pb1200 board.
36123 + Refer to board documentation.
36124 + */
36125 +#define SPI_PSC_BASE PSC0_BASE_ADDR
36126 +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
36127 +/* AC97 and I2S are muxed on the Pb1200 board.
36128 + Refer to board documentation.
36129 + */
36130 +#define AC97_PSC_BASE PSC1_BASE_ADDR
36131 +#define I2S_PSC_BASE PSC1_BASE_ADDR
36132 +
36133 +#define BCSR_KSEG1_ADDR 0xAD800000
36134 +
36135 +typedef volatile struct
36136 +{
36137 + /*00*/ u16 whoami;
36138 + u16 reserved0;
36139 + /*04*/ u16 status;
36140 + u16 reserved1;
36141 + /*08*/ u16 switches;
36142 + u16 reserved2;
36143 + /*0C*/ u16 resets;
36144 + u16 reserved3;
36145 +
36146 + /*10*/ u16 pcmcia;
36147 + u16 reserved4;
36148 + /*14*/ u16 board;
36149 + u16 reserved5;
36150 + /*18*/ u16 disk_leds;
36151 + u16 reserved6;
36152 + /*1C*/ u16 system;
36153 + u16 reserved7;
36154 +
36155 + /*20*/ u16 intclr;
36156 + u16 reserved8;
36157 + /*24*/ u16 intset;
36158 + u16 reserved9;
36159 + /*28*/ u16 intclr_mask;
36160 + u16 reserved10;
36161 + /*2C*/ u16 intset_mask;
36162 + u16 reserved11;
36163 +
36164 + /*30*/ u16 sig_status;
36165 + u16 reserved12;
36166 + /*34*/ u16 int_status;
36167 + u16 reserved13;
36168 + /*38*/ u16 reserved14;
36169 + u16 reserved15;
36170 + /*3C*/ u16 reserved16;
36171 + u16 reserved17;
36172 +
36173 +} BCSR;
36174 +
36175 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
36176 +
36177 +/*
36178 + * Register bit definitions for the BCSRs
36179 + */
36180 +#define BCSR_WHOAMI_DCID 0x000F
36181 +#define BCSR_WHOAMI_CPLD 0x00F0
36182 +#define BCSR_WHOAMI_BOARD 0x0F00
36183 +
36184 +#define BCSR_STATUS_PCMCIA0VS 0x0003
36185 +#define BCSR_STATUS_PCMCIA1VS 0x000C
36186 +#define BCSR_STATUS_SWAPBOOT 0x0040
36187 +#define BCSR_STATUS_FLASHBUSY 0x0100
36188 +#define BCSR_STATUS_IDECBLID 0x0200
36189 +#define BCSR_STATUS_SD0WP 0x0400
36190 +#define BCSR_STATUS_SD1WP 0x0800
36191 +#define BCSR_STATUS_U0RXD 0x1000
36192 +#define BCSR_STATUS_U1RXD 0x2000
36193 +
36194 +#define BCSR_SWITCHES_OCTAL 0x00FF
36195 +#define BCSR_SWITCHES_DIP_1 0x0080
36196 +#define BCSR_SWITCHES_DIP_2 0x0040
36197 +#define BCSR_SWITCHES_DIP_3 0x0020
36198 +#define BCSR_SWITCHES_DIP_4 0x0010
36199 +#define BCSR_SWITCHES_DIP_5 0x0008
36200 +#define BCSR_SWITCHES_DIP_6 0x0004
36201 +#define BCSR_SWITCHES_DIP_7 0x0002
36202 +#define BCSR_SWITCHES_DIP_8 0x0001
36203 +#define BCSR_SWITCHES_ROTARY 0x0F00
36204 +
36205 +#define BCSR_RESETS_ETH 0x0001
36206 +#define BCSR_RESETS_CAMERA 0x0002
36207 +#define BCSR_RESETS_DC 0x0004
36208 +#define BCSR_RESETS_IDE 0x0008
36209 +/* not resets but in the same register */
36210 +#define BCSR_RESETS_WSCFSM 0x0800
36211 +#define BCSR_RESETS_PCS0MUX 0x1000
36212 +#define BCSR_RESETS_PCS1MUX 0x2000
36213 +#define BCSR_RESETS_SPISEL 0x4000
36214 +#define BCSR_RESETS_SD1MUX 0x8000
36215 +
36216 +#define BCSR_PCMCIA_PC0VPP 0x0003
36217 +#define BCSR_PCMCIA_PC0VCC 0x000C
36218 +#define BCSR_PCMCIA_PC0DRVEN 0x0010
36219 +#define BCSR_PCMCIA_PC0RST 0x0080
36220 +#define BCSR_PCMCIA_PC1VPP 0x0300
36221 +#define BCSR_PCMCIA_PC1VCC 0x0C00
36222 +#define BCSR_PCMCIA_PC1DRVEN 0x1000
36223 +#define BCSR_PCMCIA_PC1RST 0x8000
36224 +
36225 +#define BCSR_BOARD_LCDVEE 0x0001
36226 +#define BCSR_BOARD_LCDVDD 0x0002
36227 +#define BCSR_BOARD_LCDBL 0x0004
36228 +#define BCSR_BOARD_CAMSNAP 0x0010
36229 +#define BCSR_BOARD_CAMPWR 0x0020
36230 +#define BCSR_BOARD_SD0PWR 0x0040
36231 +#define BCSR_BOARD_SD1PWR 0x0080
36232 +
36233 +#define BCSR_LEDS_DECIMALS 0x00FF
36234 +#define BCSR_LEDS_LED0 0x0100
36235 +#define BCSR_LEDS_LED1 0x0200
36236 +#define BCSR_LEDS_LED2 0x0400
36237 +#define BCSR_LEDS_LED3 0x0800
36238 +
36239 +#define BCSR_SYSTEM_VDDI 0x001F
36240 +#define BCSR_SYSTEM_POWEROFF 0x4000
36241 +#define BCSR_SYSTEM_RESET 0x8000
36242 +
36243 +/* Bit positions for the different interrupt sources */
36244 +#define BCSR_INT_IDE 0x0001
36245 +#define BCSR_INT_ETH 0x0002
36246 +#define BCSR_INT_PC0 0x0004
36247 +#define BCSR_INT_PC0STSCHG 0x0008
36248 +#define BCSR_INT_PC1 0x0010
36249 +#define BCSR_INT_PC1STSCHG 0x0020
36250 +#define BCSR_INT_DC 0x0040
36251 +#define BCSR_INT_FLASHBUSY 0x0080
36252 +#define BCSR_INT_PC0INSERT 0x0100
36253 +#define BCSR_INT_PC0EJECT 0x0200
36254 +#define BCSR_INT_PC1INSERT 0x0400
36255 +#define BCSR_INT_PC1EJECT 0x0800
36256 +#define BCSR_INT_SD0INSERT 0x1000
36257 +#define BCSR_INT_SD0EJECT 0x2000
36258 +#define BCSR_INT_SD1INSERT 0x4000
36259 +#define BCSR_INT_SD1EJECT 0x8000
36260 +
36261 +#define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300)
36262 +#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
36263 +
36264 +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
36265 +#define AU1XXX_ATA_PHYS_LEN (0x100)
36266 +#define AU1XXX_ATA_REG_OFFSET (5)
36267 +#define AU1XXX_ATA_INT PB1200_IDE_INT
36268 +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
36269 +#define AU1XXX_ATA_RQSIZE 128
36270 +
36271 +#define NAND_PHYS_ADDR 0x1C000000
36272 +
36273 +/* Timing values as described in databook, * ns value stripped of
36274 + * lower 2 bits.
36275 + * These defines are here rather than an SOC1200 generic file because
36276 + * the parts chosen on another board may be different and may require
36277 + * different timings.
36278 + */
36279 +#define NAND_T_H (18 >> 2)
36280 +#define NAND_T_PUL (30 >> 2)
36281 +#define NAND_T_SU (30 >> 2)
36282 +#define NAND_T_WH (30 >> 2)
36283 +
36284 +/* Bitfield shift amounts */
36285 +#define NAND_T_H_SHIFT 0
36286 +#define NAND_T_PUL_SHIFT 4
36287 +#define NAND_T_SU_SHIFT 8
36288 +#define NAND_T_WH_SHIFT 12
36289 +
36290 +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
36291 + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
36292 + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
36293 + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
36294 +
36295 +
36296 +/*
36297 + * External Interrupts for Pb1200 as of 8/6/2004.
36298 + * Bit positions in the CPLD registers can be calculated by taking
36299 + * the interrupt define and subtracting the PB1200_INT_BEGIN value.
36300 + * *example: IDE bis pos is = 64 - 64
36301 + ETH bit pos is = 65 - 64
36302 + */
36303 +#define PB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
36304 +#define PB1200_IDE_INT (PB1200_INT_BEGIN + 0)
36305 +#define PB1200_ETH_INT (PB1200_INT_BEGIN + 1)
36306 +#define PB1200_PC0_INT (PB1200_INT_BEGIN + 2)
36307 +#define PB1200_PC0_STSCHG_INT (PB1200_INT_BEGIN + 3)
36308 +#define PB1200_PC1_INT (PB1200_INT_BEGIN + 4)
36309 +#define PB1200_PC1_STSCHG_INT (PB1200_INT_BEGIN + 5)
36310 +#define PB1200_DC_INT (PB1200_INT_BEGIN + 6)
36311 +#define PB1200_FLASHBUSY_INT (PB1200_INT_BEGIN + 7)
36312 +#define PB1200_PC0_INSERT_INT (PB1200_INT_BEGIN + 8)
36313 +#define PB1200_PC0_EJECT_INT (PB1200_INT_BEGIN + 9)
36314 +#define PB1200_PC1_INSERT_INT (PB1200_INT_BEGIN + 10)
36315 +#define PB1200_PC1_EJECT_INT (PB1200_INT_BEGIN + 11)
36316 +#define PB1200_SD0_INSERT_INT (PB1200_INT_BEGIN + 12)
36317 +#define PB1200_SD0_EJECT_INT (PB1200_INT_BEGIN + 13)
36318 +#define PB1200_SD1_INSERT_INT (PB1200_INT_BEGIN + 14)
36319 +#define PB1200_SD1_EJECT_INT (PB1200_INT_BEGIN + 15)
36320 +
36321 +#define PB1200_INT_END (PB1200_INT_BEGIN + 15)
36322 +
36323 +/* For drivers/pcmcia/au1000_db1x00.c */
36324 +#define BOARD_PC0_INT PB1200_PC0_INT
36325 +#define BOARD_PC1_INT PB1200_PC1_INT
36326 +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
36327 +
36328 +#endif /* __ASM_PB1200_H */
36329 +
36330 diff -Nur linux-2.4.29/include/asm-mips/pb1550.h linux-mips/include/asm-mips/pb1550.h
36331 --- linux-2.4.29/include/asm-mips/pb1550.h 2005-01-19 15:10:12.000000000 +0100
36332 +++ linux-mips/include/asm-mips/pb1550.h 2005-01-31 12:59:49.000000000 +0100
36333 @@ -30,13 +30,11 @@
36334
36335 #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
36336 #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
36337 -#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
36338 -#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
36339 -
36340 #define SPI_PSC_BASE PSC0_BASE_ADDR
36341 #define AC97_PSC_BASE PSC1_BASE_ADDR
36342 #define SMBUS_PSC_BASE PSC2_BASE_ADDR
36343 #define I2S_PSC_BASE PSC3_BASE_ADDR
36344 +#define NAND_CS 1
36345
36346 #define BCSR_PHYS_ADDR 0xAF000000
36347
36348 @@ -160,9 +158,23 @@
36349 #define NAND_T_SU_SHIFT 8
36350 #define NAND_T_WH_SHIFT 12
36351
36352 -#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
36353 - ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
36354 - ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
36355 - ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
36356 +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
36357 + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
36358 + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
36359 + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
36360 +
36361 +/*
36362 + * Daughter card information.
36363 + */
36364 +#define DAUGHTER_CARD_BASE (0xAC000000)
36365 +#define DAUGHTER_CARD_MEM_SIZE (0xADFFFFFF - DAUGHTER_CARD_BASE + 1)
36366 +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_3)
36367 +
36368 +/* DC_IDE and DC_ETHERNET */
36369 +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
36370 +#define AU1XXX_ATA_REG_OFFSET (5)
36371 +
36372 +#define AU1XXX_SMC91111_PHYS_ADDR (0x0C000300)
36373 +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_3
36374
36375 #endif /* __ASM_PB1550_H */
36376 diff -Nur linux-2.4.29/include/asm-mips/tx4927/tx4927.h linux-mips/include/asm-mips/tx4927/tx4927.h
36377 --- linux-2.4.29/include/asm-mips/tx4927/tx4927.h 2003-08-25 13:44:44.000000000 +0200
36378 +++ linux-mips/include/asm-mips/tx4927/tx4927.h 2004-11-22 19:02:10.000000000 +0100
36379 @@ -88,8 +88,8 @@
36380
36381
36382 /* TX4927 Configuration registers (64-bit registers) */
36383 -#define TX4927_CONFIG_BASE 0xe300
36384 -#define TX4927_CONFIG_CCFG 0xe300
36385 +#define TX4927_CONFIG_BASE 0xe000
36386 +#define TX4927_CONFIG_CCFG 0xe000
36387 #define TX4927_CONFIG_CCFG_RESERVED_42_63 BM_63_42
36388 #define TX4927_CONFIG_CCFG_WDRST BM_41_41
36389 #define TX4927_CONFIG_CCFG_WDREXEN BM_40_40
36390 @@ -124,14 +124,14 @@
36391 #define TX4927_CONFIG_CCFG_ENDIAN BM_02_02
36392 #define TX4927_CONFIG_CCFG_ARMODE BM_01_01
36393 #define TX4927_CONFIG_CCFG_ACEHOLD BM_00_00
36394 -#define TX4927_CONFIG_REVID 0xe308
36395 +#define TX4927_CONFIG_REVID 0xe008
36396 #define TX4927_CONFIG_REVID_RESERVED_32_63 BM_32_63
36397 #define TX4927_CONFIG_REVID_PCODE BM_16_31
36398 #define TX4927_CONFIG_REVID_MJERREV BM_12_15
36399 #define TX4927_CONFIG_REVID_MINEREV BM_08_11
36400 #define TX4927_CONFIG_REVID_MJREV BM_04_07
36401 #define TX4927_CONFIG_REVID_MINREV BM_00_03
36402 -#define TX4927_CONFIG_PCFG 0xe310
36403 +#define TX4927_CONFIG_PCFG 0xe010
36404 #define TX4927_CONFIG_PCFG_RESERVED_57_63 BM_57_63
36405 #define TX4927_CONFIG_PCFG_DRVDATA BM_56_56
36406 #define TX4927_CONFIG_PCFG_DRVCB BM_55_55
36407 @@ -197,10 +197,10 @@
36408 #define TX4927_CONFIG_PCFG_DMASEL0_SIO1 BM_00_00
36409 #define TX4927_CONFIG_PCFG_DMASEL0_ACLC0 BM_01_01
36410 #define TX4927_CONFIG_PCFG_DMASEL0_ACLC2 BM_00_01
36411 -#define TX4927_CONFIG_TOEA 0xe318
36412 +#define TX4927_CONFIG_TOEA 0xe018
36413 #define TX4927_CONFIG_TOEA_RESERVED_36_63 BM_36_63
36414 #define TX4927_CONFIG_TOEA_TOEA BM_00_35
36415 -#define TX4927_CONFIG_CLKCTR 0xe320
36416 +#define TX4927_CONFIG_CLKCTR 0xe020
36417 #define TX4927_CONFIG_CLKCTR_RESERVED_26_63 BM_26_63
36418 #define TX4927_CONFIG_CLKCTR_ACLCKD BM_25_25
36419 #define TX4927_CONFIG_CLKCTR_PIOCKD BM_24_24
36420 @@ -223,7 +223,7 @@
36421 #define TX4927_CONFIG_CLKCTR_TM2RST BM_02_02
36422 #define TX4927_CONFIG_CLKCTR_SIO0RST BM_01_01
36423 #define TX4927_CONFIG_CLKCTR_SIO1RST BM_00_00
36424 -#define TX4927_CONFIG_GARBC 0xe330
36425 +#define TX4927_CONFIG_GARBC 0xe030
36426 #define TX4927_CONFIG_GARBC_RESERVED_10_63 BM_10_63
36427 #define TX4927_CONFIG_GARBC_SET_09 BM_09_09
36428 #define TX4927_CONFIG_GARBC_ARBMD BM_08_08
36429 @@ -243,7 +243,7 @@
36430 #define TX4927_CONFIG_GARBC_PRIORITY_H3_PDMAC BM_00_00
36431 #define TX4927_CONFIG_GARBC_PRIORITY_H3_DMAC BM_01_01
36432 #define TX4927_CONFIG_GARBC_PRIORITY_H3_BAD_VALUE BM_00_01
36433 -#define TX4927_CONFIG_RAMP 0xe348
36434 +#define TX4927_CONFIG_RAMP 0xe048
36435 #define TX4927_CONFIG_RAMP_RESERVED_20_63 BM_20_63
36436 #define TX4927_CONFIG_RAMP_RAMP BM_00_19
36437 #define TX4927_CONFIG_LIMIT 0xefff
36438 @@ -456,7 +456,7 @@
36439 #define TX4927_ACLC_ACINTSTS 0xf710
36440 #define TX4927_ACLC_ACINTMSTS 0xf714
36441 #define TX4927_ACLC_ACINTEN 0xf718
36442 -#define TX4927_ACLC_ACINTDIS 0xfR71c
36443 +#define TX4927_ACLC_ACINTDIS 0xf71c
36444 #define TX4927_ACLC_ACSEMAPH 0xf720
36445 #define TX4927_ACLC_ACGPIDAT 0xf740
36446 #define TX4927_ACLC_ACGPODAT 0xf744
36447 diff -Nur linux-2.4.29/include/asm-mips/unistd.h linux-mips/include/asm-mips/unistd.h
36448 --- linux-2.4.29/include/asm-mips/unistd.h 2005-01-19 15:10:12.000000000 +0100
36449 +++ linux-mips/include/asm-mips/unistd.h 2004-11-24 21:30:06.000000000 +0100
36450 @@ -760,7 +760,7 @@
36451 if (__a3 == 0) \
36452 return (type) __v0; \
36453 errno = __v0; \
36454 - return -1; \
36455 + return (type)-1; \
36456 }
36457
36458 /*
36459 @@ -788,7 +788,7 @@
36460 if (__a3 == 0) \
36461 return (type) __v0; \
36462 errno = __v0; \
36463 - return -1; \
36464 + return (type)-1; \
36465 }
36466
36467 #define _syscall2(type,name,atype,a,btype,b) \
36468 @@ -813,7 +813,7 @@
36469 if (__a3 == 0) \
36470 return (type) __v0; \
36471 errno = __v0; \
36472 - return -1; \
36473 + return (type)-1; \
36474 }
36475
36476 #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
36477 @@ -839,7 +839,7 @@
36478 if (__a3 == 0) \
36479 return (type) __v0; \
36480 errno = __v0; \
36481 - return -1; \
36482 + return (type)-1; \
36483 }
36484
36485 #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
36486 @@ -865,7 +865,7 @@
36487 if (__a3 == 0) \
36488 return (type) __v0; \
36489 errno = __v0; \
36490 - return -1; \
36491 + return (type)-1; \
36492 }
36493
36494 #if (_MIPS_SIM == _MIPS_SIM_ABI32)
36495 @@ -902,7 +902,7 @@
36496 if (__a3 == 0) \
36497 return (type) __v0; \
36498 errno = __v0; \
36499 - return -1; \
36500 + return (type)-1; \
36501 }
36502
36503 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36504 @@ -935,7 +935,7 @@
36505 if (__a3 == 0) \
36506 return (type) __v0; \
36507 errno = __v0; \
36508 - return -1; \
36509 + return (type)-1; \
36510 }
36511
36512 #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
36513 @@ -966,7 +966,7 @@
36514 if (__a3 == 0) \
36515 return (type) __v0; \
36516 errno = __v0; \
36517 - return -1; \
36518 + return (type)-1; \
36519 }
36520
36521 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36522 @@ -995,7 +995,7 @@
36523 if (__a3 == 0) \
36524 return (type) __v0; \
36525 errno = __v0; \
36526 - return -1; \
36527 + return (type)-1; \
36528 }
36529
36530 #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
36531 diff -Nur linux-2.4.29/include/asm-mips64/hazards.h linux-mips/include/asm-mips64/hazards.h
36532 --- linux-2.4.29/include/asm-mips64/hazards.h 2004-02-18 14:36:32.000000000 +0100
36533 +++ linux-mips/include/asm-mips64/hazards.h 2004-11-25 23:18:38.000000000 +0100
36534 @@ -3,7 +3,7 @@
36535 * License. See the file "COPYING" in the main directory of this archive
36536 * for more details.
36537 *
36538 - * Copyright (C) 2003 Ralf Baechle
36539 + * Copyright (C) 2003, 2004 Ralf Baechle
36540 */
36541 #ifndef _ASM_HAZARDS_H
36542 #define _ASM_HAZARDS_H
36543 @@ -12,37 +12,185 @@
36544
36545 #ifdef __ASSEMBLY__
36546
36547 + .macro _ssnop
36548 + sll $0, $0, 1
36549 + .endm
36550 +
36551 /*
36552 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
36553 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
36554 * for data translations should not occur for 3 cpu cycles.
36555 */
36556 #ifdef CONFIG_CPU_RM9000
36557 -#define rm9000_tlb_hazard \
36558 +
36559 +#define mtc0_tlbw_hazard \
36560 + .set push; \
36561 + .set mips32; \
36562 + _ssnop; _ssnop; _ssnop; _ssnop; \
36563 + .set pop
36564 +
36565 +#define tlbw_eret_hazard \
36566 + .set push; \
36567 .set mips32; \
36568 - ssnop; ssnop; ssnop; ssnop; \
36569 - .set mips0
36570 + _ssnop; _ssnop; _ssnop; _ssnop; \
36571 + .set pop
36572 +
36573 #else
36574 -#define rm9000_tlb_hazard
36575 +
36576 +/*
36577 + * The taken branch will result in a two cycle penalty for the two killed
36578 + * instructions on R4000 / R4400. Other processors only have a single cycle
36579 + * hazard so this is nice trick to have an optimal code for a range of
36580 + * processors.
36581 + */
36582 +#define mtc0_tlbw_hazard \
36583 + b . + 8
36584 +#define tlbw_eret_hazard
36585 #endif
36586
36587 +/*
36588 + * mtc0->mfc0 hazard
36589 + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
36590 + * It is a MIPS32R2 processor so ehb will clear the hazard.
36591 + */
36592 +
36593 +#ifdef CONFIG_CPU_MIPSR2
36594 +/*
36595 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
36596 + */
36597 + .macro ehb
36598 + sll $0, $0, 3
36599 + .endm
36600 +
36601 +#define irq_enable_hazard \
36602 + ehb # irq_enable_hazard
36603 +
36604 +#define irq_disable_hazard \
36605 + ehb # irq_disable_hazard
36606 +
36607 #else
36608
36609 +#define irq_enable_hazard
36610 +#define irq_disable_hazard
36611 +
36612 +#endif
36613 +
36614 +#else /* __ASSEMBLY__ */
36615 +
36616 /*
36617 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
36618 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
36619 * for data translations should not occur for 3 cpu cycles.
36620 */
36621 #ifdef CONFIG_CPU_RM9000
36622 -#define rm9000_tlb_hazard() \
36623 +
36624 +#define mtc0_tlbw_hazard() \
36625 + __asm__ __volatile__( \
36626 + ".set\tmips32\n\t" \
36627 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
36628 + ".set\tmips0")
36629 +
36630 +#define tlbw_use_hazard() \
36631 __asm__ __volatile__( \
36632 ".set\tmips32\n\t" \
36633 - "ssnop; ssnop; ssnop; ssnop\n\t" \
36634 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
36635 ".set\tmips0")
36636 #else
36637 -#define rm9000_tlb_hazard() do { } while (0)
36638 +
36639 +/*
36640 + * Overkill warning ...
36641 + */
36642 +#define mtc0_tlbw_hazard() \
36643 + __asm__ __volatile__( \
36644 + ".set noreorder\n\t" \
36645 + "nop; nop; nop; nop; nop; nop;\n\t" \
36646 + ".set reorder\n\t")
36647 +
36648 +#define tlbw_use_hazard() \
36649 + __asm__ __volatile__( \
36650 + ".set noreorder\n\t" \
36651 + "nop; nop; nop; nop; nop; nop;\n\t" \
36652 + ".set reorder\n\t")
36653 +
36654 #endif
36655
36656 +/*
36657 + * mtc0->mfc0 hazard
36658 + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
36659 + * It is a MIPS32R2 processor so ehb will clear the hazard.
36660 + */
36661 +
36662 +#ifdef CONFIG_CPU_MIPSR2
36663 +/*
36664 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
36665 + */
36666 +__asm__(
36667 + " .macro ehb \n\t"
36668 + " sll $0, $0, 3 \n\t"
36669 + " .endm \n\t"
36670 + " \n\t"
36671 + " .macro\tirq_enable_hazard \n\t"
36672 + " ehb \n\t"
36673 + " .endm \n\t"
36674 + " \n\t"
36675 + " .macro\tirq_disable_hazard \n\t"
36676 + " ehb \n\t"
36677 + " .endm");
36678 +
36679 +#define irq_enable_hazard() \
36680 + __asm__ __volatile__( \
36681 + "ehb\t\t\t\t# irq_enable_hazard")
36682 +
36683 +#define irq_disable_hazard() \
36684 + __asm__ __volatile__( \
36685 + "ehb\t\t\t\t# irq_disable_hazard")
36686 +
36687 +#elif defined(CONFIG_CPU_R10000)
36688 +
36689 +/*
36690 + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
36691 + */
36692 +
36693 +__asm__(
36694 + " .macro\tirq_enable_hazard \n\t"
36695 + " .endm \n\t"
36696 + " \n\t"
36697 + " .macro\tirq_disable_hazard \n\t"
36698 + " .endm");
36699 +
36700 +#define irq_enable_hazard() do { } while (0)
36701 +#define irq_disable_hazard() do { } while (0)
36702 +
36703 +#else
36704 +
36705 +/*
36706 + * Default for classic MIPS processors. Assume worst case hazards but don't
36707 + * care about the irq_enable_hazard - sooner or later the hardware will
36708 + * enable it and we don't care when exactly.
36709 + */
36710 +
36711 +__asm__(
36712 + " .macro _ssnop \n\t"
36713 + " sll $0, $2, 1 \n\t"
36714 + " .endm \n\t"
36715 + " \n\t"
36716 + " # \n\t"
36717 + " # There is a hazard but we do not care \n\t"
36718 + " # \n\t"
36719 + " .macro\tirq_enable_hazard \n\t"
36720 + " .endm \n\t"
36721 + " \n\t"
36722 + " .macro\tirq_disable_hazard \n\t"
36723 + " _ssnop; _ssnop; _ssnop \n\t"
36724 + " .endm");
36725 +
36726 +#define irq_enable_hazard() do { } while (0)
36727 +#define irq_disable_hazard() \
36728 + __asm__ __volatile__( \
36729 + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
36730 +
36731 #endif
36732
36733 +#endif /* __ASSEMBLY__ */
36734 +
36735 #endif /* _ASM_HAZARDS_H */
36736 diff -Nur linux-2.4.29/include/asm-mips64/mipsregs.h linux-mips/include/asm-mips64/mipsregs.h
36737 --- linux-2.4.29/include/asm-mips64/mipsregs.h 2005-01-19 15:10:12.000000000 +0100
36738 +++ linux-mips/include/asm-mips64/mipsregs.h 2005-03-26 11:47:36.406676569 +0100
36739 @@ -757,10 +757,18 @@
36740 #define read_c0_config1() __read_32bit_c0_register($16, 1)
36741 #define read_c0_config2() __read_32bit_c0_register($16, 2)
36742 #define read_c0_config3() __read_32bit_c0_register($16, 3)
36743 +#define read_c0_config4() __read_32bit_c0_register($16, 4)
36744 +#define read_c0_config5() __read_32bit_c0_register($16, 5)
36745 +#define read_c0_config6() __read_32bit_c0_register($16, 6)
36746 +#define read_c0_config7() __read_32bit_c0_register($16, 7)
36747 #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
36748 #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
36749 #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
36750 #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
36751 +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
36752 +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
36753 +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
36754 +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
36755
36756 /*
36757 * The WatchLo register. There may be upto 8 of them.
36758 @@ -856,42 +864,34 @@
36759 */
36760 static inline void tlb_probe(void)
36761 {
36762 - rm9000_tlb_hazard();
36763 __asm__ __volatile__(
36764 ".set noreorder\n\t"
36765 "tlbp\n\t"
36766 ".set reorder");
36767 - rm9000_tlb_hazard();
36768 }
36769
36770 static inline void tlb_read(void)
36771 {
36772 - rm9000_tlb_hazard();
36773 __asm__ __volatile__(
36774 ".set noreorder\n\t"
36775 "tlbr\n\t"
36776 ".set reorder");
36777 - rm9000_tlb_hazard();
36778 }
36779
36780 static inline void tlb_write_indexed(void)
36781 {
36782 - rm9000_tlb_hazard();
36783 __asm__ __volatile__(
36784 ".set noreorder\n\t"
36785 "tlbwi\n\t"
36786 ".set reorder");
36787 - rm9000_tlb_hazard();
36788 }
36789
36790 static inline void tlb_write_random(void)
36791 {
36792 - rm9000_tlb_hazard();
36793 __asm__ __volatile__(
36794 ".set noreorder\n\t"
36795 "tlbwr\n\t"
36796 ".set reorder");
36797 - rm9000_tlb_hazard();
36798 }
36799
36800 /*
36801 diff -Nur linux-2.4.29/include/asm-mips64/unistd.h linux-mips/include/asm-mips64/unistd.h
36802 --- linux-2.4.29/include/asm-mips64/unistd.h 2005-01-19 15:10:12.000000000 +0100
36803 +++ linux-mips/include/asm-mips64/unistd.h 2004-11-24 21:30:06.000000000 +0100
36804 @@ -760,7 +760,7 @@
36805 if (__a3 == 0) \
36806 return (type) __v0; \
36807 errno = __v0; \
36808 - return -1; \
36809 + return (type)-1; \
36810 }
36811
36812 /*
36813 @@ -788,7 +788,7 @@
36814 if (__a3 == 0) \
36815 return (type) __v0; \
36816 errno = __v0; \
36817 - return -1; \
36818 + return (type)-1; \
36819 }
36820
36821 #define _syscall2(type,name,atype,a,btype,b) \
36822 @@ -813,7 +813,7 @@
36823 if (__a3 == 0) \
36824 return (type) __v0; \
36825 errno = __v0; \
36826 - return -1; \
36827 + return (type)-1; \
36828 }
36829
36830 #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
36831 @@ -839,7 +839,7 @@
36832 if (__a3 == 0) \
36833 return (type) __v0; \
36834 errno = __v0; \
36835 - return -1; \
36836 + return (type)-1; \
36837 }
36838
36839 #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
36840 @@ -865,7 +865,7 @@
36841 if (__a3 == 0) \
36842 return (type) __v0; \
36843 errno = __v0; \
36844 - return -1; \
36845 + return (type)-1; \
36846 }
36847
36848 #if (_MIPS_SIM == _MIPS_SIM_ABI32)
36849 @@ -902,7 +902,7 @@
36850 if (__a3 == 0) \
36851 return (type) __v0; \
36852 errno = __v0; \
36853 - return -1; \
36854 + return (type)-1; \
36855 }
36856
36857 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36858 @@ -935,7 +935,7 @@
36859 if (__a3 == 0) \
36860 return (type) __v0; \
36861 errno = __v0; \
36862 - return -1; \
36863 + return (type)-1; \
36864 }
36865
36866 #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
36867 @@ -966,7 +966,7 @@
36868 if (__a3 == 0) \
36869 return (type) __v0; \
36870 errno = __v0; \
36871 - return -1; \
36872 + return (type)-1; \
36873 }
36874
36875 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36876 @@ -995,7 +995,7 @@
36877 if (__a3 == 0) \
36878 return (type) __v0; \
36879 errno = __v0; \
36880 - return -1; \
36881 + return (type)-1; \
36882 }
36883
36884 #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
36885 diff -Nur linux-2.4.29/include/asm-ppc/param.h linux-mips/include/asm-ppc/param.h
36886 --- linux-2.4.29/include/asm-ppc/param.h 2003-06-13 16:51:38.000000000 +0200
36887 +++ linux-mips/include/asm-ppc/param.h 2003-07-05 05:23:46.000000000 +0200
36888 @@ -3,6 +3,9 @@
36889
36890 #ifndef HZ
36891 #define HZ 100
36892 +#ifdef __KERNEL__
36893 +#define hz_to_std(a) (a)
36894 +#endif
36895 #endif
36896
36897 #define EXEC_PAGESIZE 4096
36898 diff -Nur linux-2.4.29/include/asm-ppc/processor.h linux-mips/include/asm-ppc/processor.h
36899 --- linux-2.4.29/include/asm-ppc/processor.h 2004-04-14 15:05:40.000000000 +0200
36900 +++ linux-mips/include/asm-ppc/processor.h 2005-03-26 11:47:36.510659503 +0100
36901 @@ -678,7 +678,7 @@
36902 #define PVR_440GP_RC2 0x40200481
36903 #define PVR_440GX_RA 0x51b21850
36904 #define PVR_440GX_RB 0x51b21851
36905 -#define PVR_440GX_RB1 0x51b21852
36906 +#define PVR_440GX_RC 0x51b21892
36907 #define PVR_601 0x00010000
36908 #define PVR_602 0x00050000
36909 #define PVR_603 0x00030000
36910 diff -Nur linux-2.4.29/include/asm-s390/param.h linux-mips/include/asm-s390/param.h
36911 --- linux-2.4.29/include/asm-s390/param.h 2001-02-13 23:13:44.000000000 +0100
36912 +++ linux-mips/include/asm-s390/param.h 2001-03-09 21:34:48.000000000 +0100
36913 @@ -11,6 +11,9 @@
36914
36915 #ifndef HZ
36916 #define HZ 100
36917 +#ifdef __KERNEL__
36918 +#define hz_to_std(a) (a)
36919 +#endif
36920 #endif
36921
36922 #define EXEC_PAGESIZE 4096
36923 diff -Nur linux-2.4.29/include/asm-sh/param.h linux-mips/include/asm-sh/param.h
36924 --- linux-2.4.29/include/asm-sh/param.h 2001-01-04 22:19:13.000000000 +0100
36925 +++ linux-mips/include/asm-sh/param.h 2001-01-11 05:02:45.000000000 +0100
36926 @@ -3,6 +3,9 @@
36927
36928 #ifndef HZ
36929 #define HZ 100
36930 +#ifdef __KERNEL__
36931 +#define hz_to_std(a) (a)
36932 +#endif
36933 #endif
36934
36935 #define EXEC_PAGESIZE 4096
36936 diff -Nur linux-2.4.29/include/asm-sparc/param.h linux-mips/include/asm-sparc/param.h
36937 --- linux-2.4.29/include/asm-sparc/param.h 2000-10-30 23:34:12.000000000 +0100
36938 +++ linux-mips/include/asm-sparc/param.h 2000-11-23 03:00:56.000000000 +0100
36939 @@ -4,6 +4,9 @@
36940
36941 #ifndef HZ
36942 #define HZ 100
36943 +#ifdef __KERNEL__
36944 +#define hz_to_std(a) (a)
36945 +#endif
36946 #endif
36947
36948 #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
36949 diff -Nur linux-2.4.29/include/asm-sparc/system.h linux-mips/include/asm-sparc/system.h
36950 --- linux-2.4.29/include/asm-sparc/system.h 2004-02-18 14:36:32.000000000 +0100
36951 +++ linux-mips/include/asm-sparc/system.h 2005-03-26 11:47:36.945588121 +0100
36952 @@ -295,11 +295,11 @@
36953 #define wmb() mb()
36954 #define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
36955 #define set_wmb(__var, __value) set_mb(__var, __value)
36956 -#define smp_mb() __asm__ __volatile__("":::"memory");
36957 -#define smp_rmb() __asm__ __volatile__("":::"memory");
36958 -#define smp_wmb() __asm__ __volatile__("":::"memory");
36959 +#define smp_mb() __asm__ __volatile__("":::"memory")
36960 +#define smp_rmb() __asm__ __volatile__("":::"memory")
36961 +#define smp_wmb() __asm__ __volatile__("":::"memory")
36962
36963 -#define nop() __asm__ __volatile__ ("nop");
36964 +#define nop() __asm__ __volatile__ ("nop")
36965
36966 /* This has special calling conventions */
36967 #ifndef CONFIG_SMP
36968 diff -Nur linux-2.4.29/include/asm-sparc64/atomic.h linux-mips/include/asm-sparc64/atomic.h
36969 --- linux-2.4.29/include/asm-sparc64/atomic.h 2001-07-20 03:11:13.000000000 +0200
36970 +++ linux-mips/include/asm-sparc64/atomic.h 2005-03-26 11:47:36.964585003 +0100
36971 @@ -8,31 +8,59 @@
36972 #ifndef __ARCH_SPARC64_ATOMIC__
36973 #define __ARCH_SPARC64_ATOMIC__
36974
36975 +#include <linux/config.h>
36976 +
36977 typedef struct { volatile int counter; } atomic_t;
36978 #define ATOMIC_INIT(i) { (i) }
36979
36980 #define atomic_read(v) ((v)->counter)
36981 #define atomic_set(v, i) (((v)->counter) = i)
36982
36983 -extern int __atomic_add(int, atomic_t *);
36984 -extern int __atomic_sub(int, atomic_t *);
36985 +extern void atomic_add(int, atomic_t *);
36986 +extern void atomic_sub(int, atomic_t *);
36987 +
36988 +extern int atomic_add_ret(int, atomic_t *);
36989 +extern int atomic_sub_ret(int, atomic_t *);
36990 +
36991 +#define atomic_dec_return(v) atomic_sub_ret(1, v)
36992 +
36993 +#define atomic_inc_return(v) atomic_add_ret(1, v)
36994 +
36995 +#define atomic_sub_return(i, v) atomic_sub_ret(i, v)
36996 +
36997 +#define atomic_add_return(i, v) atomic_add_ret(i, v)
36998 +
36999 +/*
37000 + * atomic_inc_and_test - increment and test
37001 + * @v: pointer of type atomic_t
37002 + *
37003 + * Atomically increments @v by 1
37004 + * and returns true if the result is zero, or false for all
37005 + * other cases.
37006 + */
37007 +#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
37008 +
37009 +#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
37010
37011 -#define atomic_add(i, v) ((void)__atomic_add(i, v))
37012 -#define atomic_sub(i, v) ((void)__atomic_sub(i, v))
37013 +#define atomic_dec_and_test(v) (atomic_sub_ret(1, v) == 0)
37014
37015 -#define atomic_dec_return(v) __atomic_sub(1, v)
37016 -#define atomic_inc_return(v) __atomic_add(1, v)
37017 +#define atomic_inc(v) atomic_add(1, v)
37018
37019 -#define atomic_sub_and_test(i, v) (__atomic_sub(i, v) == 0)
37020 -#define atomic_dec_and_test(v) (__atomic_sub(1, v) == 0)
37021 +#define atomic_dec(v) atomic_sub(1, v)
37022
37023 -#define atomic_inc(v) ((void)__atomic_add(1, v))
37024 -#define atomic_dec(v) ((void)__atomic_sub(1, v))
37025 +#define atomic_add_negative(i, v) (atomic_add_ret(i, v) < 0)
37026
37027 /* Atomic operations are already serializing */
37028 +#ifdef CONFIG_SMP
37029 +#define smp_mb__before_atomic_dec() membar("#StoreLoad | #LoadLoad")
37030 +#define smp_mb__after_atomic_dec() membar("#StoreLoad | #StoreStore")
37031 +#define smp_mb__before_atomic_inc() membar("#StoreLoad | #LoadLoad")
37032 +#define smp_mb__after_atomic_inc() membar("#StoreLoad | #StoreStore")
37033 +#else
37034 #define smp_mb__before_atomic_dec() barrier()
37035 #define smp_mb__after_atomic_dec() barrier()
37036 #define smp_mb__before_atomic_inc() barrier()
37037 #define smp_mb__after_atomic_inc() barrier()
37038 +#endif
37039
37040 #endif /* !(__ARCH_SPARC64_ATOMIC__) */
37041 diff -Nur linux-2.4.29/include/asm-sparc64/bitops.h linux-mips/include/asm-sparc64/bitops.h
37042 --- linux-2.4.29/include/asm-sparc64/bitops.h 2001-12-21 18:42:03.000000000 +0100
37043 +++ linux-mips/include/asm-sparc64/bitops.h 2005-03-26 11:47:37.017576306 +0100
37044 @@ -1,4 +1,4 @@
37045 -/* $Id$
37046 +/* $Id$
37047 * bitops.h: Bit string operations on the V9.
37048 *
37049 * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
37050 @@ -7,114 +7,126 @@
37051 #ifndef _SPARC64_BITOPS_H
37052 #define _SPARC64_BITOPS_H
37053
37054 +#include <linux/config.h>
37055 +#include <linux/compiler.h>
37056 #include <asm/byteorder.h>
37057
37058 -extern long ___test_and_set_bit(unsigned long nr, volatile void *addr);
37059 -extern long ___test_and_clear_bit(unsigned long nr, volatile void *addr);
37060 -extern long ___test_and_change_bit(unsigned long nr, volatile void *addr);
37061 -
37062 -#define test_and_set_bit(nr,addr) ({___test_and_set_bit(nr,addr)!=0;})
37063 -#define test_and_clear_bit(nr,addr) ({___test_and_clear_bit(nr,addr)!=0;})
37064 -#define test_and_change_bit(nr,addr) ({___test_and_change_bit(nr,addr)!=0;})
37065 -#define set_bit(nr,addr) ((void)___test_and_set_bit(nr,addr))
37066 -#define clear_bit(nr,addr) ((void)___test_and_clear_bit(nr,addr))
37067 -#define change_bit(nr,addr) ((void)___test_and_change_bit(nr,addr))
37068 +extern int test_and_set_bit(unsigned long nr, volatile void *addr);
37069 +extern int test_and_clear_bit(unsigned long nr, volatile void *addr);
37070 +extern int test_and_change_bit(unsigned long nr, volatile void *addr);
37071 +extern void set_bit(unsigned long nr, volatile void *addr);
37072 +extern void clear_bit(unsigned long nr, volatile void *addr);
37073 +extern void change_bit(unsigned long nr, volatile void *addr);
37074
37075 /* "non-atomic" versions... */
37076 -#define __set_bit(X,Y) \
37077 -do { unsigned long __nr = (X); \
37078 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37079 - *__m |= (1UL << (__nr & 63)); \
37080 -} while (0)
37081 -#define __clear_bit(X,Y) \
37082 -do { unsigned long __nr = (X); \
37083 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37084 - *__m &= ~(1UL << (__nr & 63)); \
37085 -} while (0)
37086 -#define __change_bit(X,Y) \
37087 -do { unsigned long __nr = (X); \
37088 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37089 - *__m ^= (1UL << (__nr & 63)); \
37090 -} while (0)
37091 -#define __test_and_set_bit(X,Y) \
37092 -({ unsigned long __nr = (X); \
37093 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37094 - long __old = *__m; \
37095 - long __mask = (1UL << (__nr & 63)); \
37096 - *__m = (__old | __mask); \
37097 - ((__old & __mask) != 0); \
37098 -})
37099 -#define __test_and_clear_bit(X,Y) \
37100 -({ unsigned long __nr = (X); \
37101 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37102 - long __old = *__m; \
37103 - long __mask = (1UL << (__nr & 63)); \
37104 - *__m = (__old & ~__mask); \
37105 - ((__old & __mask) != 0); \
37106 -})
37107 -#define __test_and_change_bit(X,Y) \
37108 -({ unsigned long __nr = (X); \
37109 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37110 - long __old = *__m; \
37111 - long __mask = (1UL << (__nr & 63)); \
37112 - *__m = (__old ^ __mask); \
37113 - ((__old & __mask) != 0); \
37114 -})
37115
37116 -#define smp_mb__before_clear_bit() do { } while(0)
37117 -#define smp_mb__after_clear_bit() do { } while(0)
37118 +static __inline__ void __set_bit(int nr, volatile void *addr)
37119 +{
37120 + unsigned long *m;
37121 +
37122 + m = ((unsigned long *)addr) + (nr >> 6);
37123 + *m |= (1UL << (nr & 63));
37124 +}
37125 +
37126 +static __inline__ void __clear_bit(int nr, volatile void *addr)
37127 +{
37128 + unsigned long *m;
37129 +
37130 + m = ((unsigned long *)addr) + (nr >> 6);
37131 + *m &= ~(1UL << (nr & 63));
37132 +}
37133
37134 -extern __inline__ int test_bit(int nr, __const__ void *addr)
37135 +static __inline__ void __change_bit(int nr, volatile void *addr)
37136 {
37137 - return (1UL & (((__const__ long *) addr)[nr >> 6] >> (nr & 63))) != 0UL;
37138 + unsigned long *m;
37139 +
37140 + m = ((unsigned long *)addr) + (nr >> 6);
37141 + *m ^= (1UL << (nr & 63));
37142 +}
37143 +
37144 +static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
37145 +{
37146 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37147 + unsigned long old = *m;
37148 + unsigned long mask = (1UL << (nr & 63));
37149 +
37150 + *m = (old | mask);
37151 + return ((old & mask) != 0);
37152 +}
37153 +
37154 +static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
37155 +{
37156 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37157 + unsigned long old = *m;
37158 + unsigned long mask = (1UL << (nr & 63));
37159 +
37160 + *m = (old & ~mask);
37161 + return ((old & mask) != 0);
37162 +}
37163 +
37164 +static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
37165 +{
37166 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37167 + unsigned long old = *m;
37168 + unsigned long mask = (1UL << (nr & 63));
37169 +
37170 + *m = (old ^ mask);
37171 + return ((old & mask) != 0);
37172 +}
37173 +
37174 +#ifdef CONFIG_SMP
37175 +#define smp_mb__before_clear_bit() membar("#StoreLoad | #LoadLoad")
37176 +#define smp_mb__after_clear_bit() membar("#StoreLoad | #StoreStore")
37177 +#else
37178 +#define smp_mb__before_clear_bit() barrier()
37179 +#define smp_mb__after_clear_bit() barrier()
37180 +#endif
37181 +
37182 +static __inline__ int test_bit(int nr, __const__ volatile void *_addr)
37183 +{
37184 + __const__ unsigned long *addr;
37185 +
37186 + addr = (__const__ unsigned long *) _addr;
37187 +
37188 + return (1UL & ((addr)[nr >> 6] >> (nr & 63))) != 0UL;
37189 }
37190
37191 /* The easy/cheese version for now. */
37192 -extern __inline__ unsigned long ffz(unsigned long word)
37193 +static __inline__ unsigned long ffz(unsigned long word)
37194 {
37195 unsigned long result;
37196
37197 -#ifdef ULTRA_HAS_POPULATION_COUNT /* Thanks for nothing Sun... */
37198 - __asm__ __volatile__(
37199 -" brz,pn %0, 1f\n"
37200 -" neg %0, %%g1\n"
37201 -" xnor %0, %%g1, %%g2\n"
37202 -" popc %%g2, %0\n"
37203 -"1: " : "=&r" (result)
37204 - : "0" (word)
37205 - : "g1", "g2");
37206 -#else
37207 -#if 1 /* def EASY_CHEESE_VERSION */
37208 result = 0;
37209 while(word & 1) {
37210 result++;
37211 word >>= 1;
37212 }
37213 -#else
37214 - unsigned long tmp;
37215 + return result;
37216 +}
37217
37218 - result = 0;
37219 - tmp = ~word & -~word;
37220 - if (!(unsigned)tmp) {
37221 - tmp >>= 32;
37222 - result = 32;
37223 - }
37224 - if (!(unsigned short)tmp) {
37225 - tmp >>= 16;
37226 - result += 16;
37227 - }
37228 - if (!(unsigned char)tmp) {
37229 - tmp >>= 8;
37230 - result += 8;
37231 +/**
37232 + * __ffs - find first bit in word.
37233 + * @word: The word to search
37234 + *
37235 + * Undefined if no bit exists, so code should check against 0 first.
37236 + */
37237 +static __inline__ unsigned long __ffs(unsigned long word)
37238 +{
37239 + unsigned long result = 0;
37240 +
37241 + while (!(word & 1UL)) {
37242 + result++;
37243 + word >>= 1;
37244 }
37245 - if (tmp & 0xf0) result += 4;
37246 - if (tmp & 0xcc) result += 2;
37247 - if (tmp & 0xaa) result ++;
37248 -#endif
37249 -#endif
37250 return result;
37251 }
37252
37253 +/*
37254 + * fls: find last bit set.
37255 + */
37256 +
37257 +#define fls(x) generic_fls(x)
37258 +
37259 #ifdef __KERNEL__
37260
37261 /*
37262 @@ -122,8 +134,12 @@
37263 * the libc and compiler builtin ffs routines, therefore
37264 * differs in spirit from the above ffz (man ffs).
37265 */
37266 -
37267 -#define ffs(x) generic_ffs(x)
37268 +static __inline__ int ffs(int x)
37269 +{
37270 + if (!x)
37271 + return 0;
37272 + return __ffs((unsigned long)x) + 1;
37273 +}
37274
37275 /*
37276 * hweightN: returns the hamming weight (i.e. the number
37277 @@ -132,7 +148,15 @@
37278
37279 #ifdef ULTRA_HAS_POPULATION_COUNT
37280
37281 -extern __inline__ unsigned int hweight32(unsigned int w)
37282 +static __inline__ unsigned int hweight64(unsigned long w)
37283 +{
37284 + unsigned int res;
37285 +
37286 + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w));
37287 + return res;
37288 +}
37289 +
37290 +static __inline__ unsigned int hweight32(unsigned int w)
37291 {
37292 unsigned int res;
37293
37294 @@ -140,7 +164,7 @@
37295 return res;
37296 }
37297
37298 -extern __inline__ unsigned int hweight16(unsigned int w)
37299 +static __inline__ unsigned int hweight16(unsigned int w)
37300 {
37301 unsigned int res;
37302
37303 @@ -148,7 +172,7 @@
37304 return res;
37305 }
37306
37307 -extern __inline__ unsigned int hweight8(unsigned int w)
37308 +static __inline__ unsigned int hweight8(unsigned int w)
37309 {
37310 unsigned int res;
37311
37312 @@ -158,6 +182,7 @@
37313
37314 #else
37315
37316 +#define hweight64(x) generic_hweight64(x)
37317 #define hweight32(x) generic_hweight32(x)
37318 #define hweight16(x) generic_hweight16(x)
37319 #define hweight8(x) generic_hweight8(x)
37320 @@ -170,7 +195,7 @@
37321 * on Linus's ALPHA routines, which are pretty portable BTW.
37322 */
37323
37324 -extern __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
37325 +static __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
37326 {
37327 unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
37328 unsigned long result = offset & ~63UL;
37329 @@ -211,15 +236,12 @@
37330 #define find_first_zero_bit(addr, size) \
37331 find_next_zero_bit((addr), (size), 0)
37332
37333 -extern long ___test_and_set_le_bit(int nr, volatile void *addr);
37334 -extern long ___test_and_clear_le_bit(int nr, volatile void *addr);
37335 -
37336 -#define test_and_set_le_bit(nr,addr) ({___test_and_set_le_bit(nr,addr)!=0;})
37337 -#define test_and_clear_le_bit(nr,addr) ({___test_and_clear_le_bit(nr,addr)!=0;})
37338 -#define set_le_bit(nr,addr) ((void)___test_and_set_le_bit(nr,addr))
37339 -#define clear_le_bit(nr,addr) ((void)___test_and_clear_le_bit(nr,addr))
37340 +#define test_and_set_le_bit(nr,addr) \
37341 + test_and_set_bit((nr) ^ 0x38, (addr))
37342 +#define test_and_clear_le_bit(nr,addr) \
37343 + test_and_clear_bit((nr) ^ 0x38, (addr))
37344
37345 -extern __inline__ int test_le_bit(int nr, __const__ void * addr)
37346 +static __inline__ int test_le_bit(int nr, __const__ void *addr)
37347 {
37348 int mask;
37349 __const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
37350 @@ -232,7 +254,7 @@
37351 #define find_first_zero_le_bit(addr, size) \
37352 find_next_zero_le_bit((addr), (size), 0)
37353
37354 -extern __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
37355 +static __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
37356 {
37357 unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
37358 unsigned long result = offset & ~63UL;
37359 @@ -271,18 +293,41 @@
37360
37361 #ifdef __KERNEL__
37362
37363 -#define ext2_set_bit test_and_set_le_bit
37364 -#define ext2_clear_bit test_and_clear_le_bit
37365 -#define ext2_test_bit test_le_bit
37366 -#define ext2_find_first_zero_bit find_first_zero_le_bit
37367 -#define ext2_find_next_zero_bit find_next_zero_le_bit
37368 +#define __set_le_bit(nr, addr) \
37369 + __set_bit((nr) ^ 0x38, (addr))
37370 +#define __clear_le_bit(nr, addr) \
37371 + __clear_bit((nr) ^ 0x38, (addr))
37372 +#define __test_and_clear_le_bit(nr, addr) \
37373 + __test_and_clear_bit((nr) ^ 0x38, (addr))
37374 +#define __test_and_set_le_bit(nr, addr) \
37375 + __test_and_set_bit((nr) ^ 0x38, (addr))
37376 +
37377 +#define ext2_set_bit(nr,addr) \
37378 + __test_and_set_le_bit((nr),(unsigned long *)(addr))
37379 +#define ext2_set_bit_atomic(lock,nr,addr) \
37380 + test_and_set_le_bit((nr),(unsigned long *)(addr))
37381 +#define ext2_clear_bit(nr,addr) \
37382 + __test_and_clear_le_bit((nr),(unsigned long *)(addr))
37383 +#define ext2_clear_bit_atomic(lock,nr,addr) \
37384 + test_and_clear_le_bit((nr),(unsigned long *)(addr))
37385 +#define ext2_test_bit(nr,addr) \
37386 + test_le_bit((nr),(unsigned long *)(addr))
37387 +#define ext2_find_first_zero_bit(addr, size) \
37388 + find_first_zero_le_bit((unsigned long *)(addr), (size))
37389 +#define ext2_find_next_zero_bit(addr, size, off) \
37390 + find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
37391
37392 /* Bitmap functions for the minix filesystem. */
37393 -#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
37394 -#define minix_set_bit(nr,addr) set_bit(nr,addr)
37395 -#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
37396 -#define minix_test_bit(nr,addr) test_bit(nr,addr)
37397 -#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
37398 +#define minix_test_and_set_bit(nr,addr) \
37399 + test_and_set_bit((nr),(unsigned long *)(addr))
37400 +#define minix_set_bit(nr,addr) \
37401 + set_bit((nr),(unsigned long *)(addr))
37402 +#define minix_test_and_clear_bit(nr,addr) \
37403 + test_and_clear_bit((nr),(unsigned long *)(addr))
37404 +#define minix_test_bit(nr,addr) \
37405 + test_bit((nr),(unsigned long *)(addr))
37406 +#define minix_find_first_zero_bit(addr,size) \
37407 + find_first_zero_bit((unsigned long *)(addr),(size))
37408
37409 #endif /* __KERNEL__ */
37410
37411 diff -Nur linux-2.4.29/include/asm-sparc64/param.h linux-mips/include/asm-sparc64/param.h
37412 --- linux-2.4.29/include/asm-sparc64/param.h 2000-10-30 23:34:12.000000000 +0100
37413 +++ linux-mips/include/asm-sparc64/param.h 2000-11-23 03:00:56.000000000 +0100
37414 @@ -4,6 +4,9 @@
37415
37416 #ifndef HZ
37417 #define HZ 100
37418 +#ifdef __KERNEL__
37419 +#define hz_to_std(a) (a)
37420 +#endif
37421 #endif
37422
37423 #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
37424 diff -Nur linux-2.4.29/include/asm-sparc64/system.h linux-mips/include/asm-sparc64/system.h
37425 --- linux-2.4.29/include/asm-sparc64/system.h 2003-06-13 16:51:38.000000000 +0200
37426 +++ linux-mips/include/asm-sparc64/system.h 2005-03-26 11:47:37.092563999 +0100
37427 @@ -106,9 +106,9 @@
37428
37429 #define nop() __asm__ __volatile__ ("nop")
37430
37431 -#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory");
37432 +#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory")
37433 #define mb() \
37434 - membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad");
37435 + membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
37436 #define rmb() membar("#LoadLoad")
37437 #define wmb() membar("#StoreStore")
37438 #define set_mb(__var, __value) \
37439 @@ -121,9 +121,9 @@
37440 #define smp_rmb() rmb()
37441 #define smp_wmb() wmb()
37442 #else
37443 -#define smp_mb() __asm__ __volatile__("":::"memory");
37444 -#define smp_rmb() __asm__ __volatile__("":::"memory");
37445 -#define smp_wmb() __asm__ __volatile__("":::"memory");
37446 +#define smp_mb() __asm__ __volatile__("":::"memory")
37447 +#define smp_rmb() __asm__ __volatile__("":::"memory")
37448 +#define smp_wmb() __asm__ __volatile__("":::"memory")
37449 #endif
37450
37451 #define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
37452 @@ -246,6 +246,7 @@
37453 extern __inline__ unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
37454 {
37455 __asm__ __volatile__(
37456 +" membar #StoreLoad | #LoadLoad\n"
37457 " mov %0, %%g5\n"
37458 "1: lduw [%2], %%g7\n"
37459 " cas [%2], %%g7, %0\n"
37460 @@ -262,6 +263,7 @@
37461 extern __inline__ unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
37462 {
37463 __asm__ __volatile__(
37464 +" membar #StoreLoad | #LoadLoad\n"
37465 " mov %0, %%g5\n"
37466 "1: ldx [%2], %%g7\n"
37467 " casx [%2], %%g7, %0\n"
37468 @@ -306,7 +308,8 @@
37469 extern __inline__ unsigned long
37470 __cmpxchg_u32(volatile int *m, int old, int new)
37471 {
37472 - __asm__ __volatile__("cas [%2], %3, %0\n\t"
37473 + __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n"
37474 + "cas [%2], %3, %0\n\t"
37475 "membar #StoreLoad | #StoreStore"
37476 : "=&r" (new)
37477 : "0" (new), "r" (m), "r" (old)
37478 @@ -318,7 +321,8 @@
37479 extern __inline__ unsigned long
37480 __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
37481 {
37482 - __asm__ __volatile__("casx [%2], %3, %0\n\t"
37483 + __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n"
37484 + "casx [%2], %3, %0\n\t"
37485 "membar #StoreLoad | #StoreStore"
37486 : "=&r" (new)
37487 : "0" (new), "r" (m), "r" (old)
37488 diff -Nur linux-2.4.29/include/asm-x86_64/acpi.h linux-mips/include/asm-x86_64/acpi.h
37489 --- linux-2.4.29/include/asm-x86_64/acpi.h 2004-08-08 01:26:06.000000000 +0200
37490 +++ linux-mips/include/asm-x86_64/acpi.h 2005-03-26 11:47:37.164552184 +0100
37491 @@ -118,6 +118,7 @@
37492 extern int acpi_strict;
37493 extern int acpi_disabled;
37494 extern int acpi_ht;
37495 +extern int acpi_skip_timer_override;
37496 static inline void disable_acpi(void)
37497 {
37498 acpi_disabled = 1;
37499 diff -Nur linux-2.4.29/include/linux/ata.h linux-mips/include/linux/ata.h
37500 --- linux-2.4.29/include/linux/ata.h 2005-01-19 15:10:12.000000000 +0100
37501 +++ linux-mips/include/linux/ata.h 2005-03-26 11:47:37.226542010 +0100
37502 @@ -123,6 +123,8 @@
37503 ATA_CMD_PIO_WRITE_EXT = 0x34,
37504 ATA_CMD_SET_FEATURES = 0xEF,
37505 ATA_CMD_PACKET = 0xA0,
37506 + ATA_CMD_VERIFY = 0x40,
37507 + ATA_CMD_VERIFY_EXT = 0x42,
37508
37509 /* SETFEATURES stuff */
37510 SETFEATURES_XFER = 0x03,
37511 diff -Nur linux-2.4.29/include/linux/brlock.h linux-mips/include/linux/brlock.h
37512 --- linux-2.4.29/include/linux/brlock.h 2002-11-29 00:53:15.000000000 +0100
37513 +++ linux-mips/include/linux/brlock.h 2005-03-26 11:47:37.233540861 +0100
37514 @@ -18,16 +18,6 @@
37515 * Registry idea and naming [ crutial! :-) ] by:
37516 *
37517 * David S. Miller <davem@redhat.com>
37518 - *
37519 - * David has an implementation that doesn't use atomic operations in
37520 - * the read branch via memory ordering tricks - i guess we need to
37521 - * split this up into a per-arch thing? The atomicity issue is a
37522 - * secondary item in profiles, at least on x86 platforms.
37523 - *
37524 - * The atomic op version overhead is indeed a big deal on
37525 - * load-locked/store-conditional cpus (ALPHA/MIPS/PPC) and
37526 - * compare-and-swap cpus (Sparc64). So we control which
37527 - * implementation to use with a __BRLOCK_USE_ATOMICS define. -DaveM
37528 */
37529
37530 /* Register bigreader lock indices here. */
37531 @@ -45,17 +35,7 @@
37532 #include <linux/cache.h>
37533 #include <linux/spinlock.h>
37534
37535 -#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
37536 -#define __BRLOCK_USE_ATOMICS
37537 -#else
37538 -#undef __BRLOCK_USE_ATOMICS
37539 -#endif
37540 -
37541 -#ifdef __BRLOCK_USE_ATOMICS
37542 -typedef rwlock_t brlock_read_lock_t;
37543 -#else
37544 typedef unsigned int brlock_read_lock_t;
37545 -#endif
37546
37547 /*
37548 * align last allocated index to the next cacheline:
37549 @@ -65,39 +45,14 @@
37550
37551 extern brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX];
37552
37553 -#ifndef __BRLOCK_USE_ATOMICS
37554 struct br_wrlock {
37555 spinlock_t lock;
37556 } __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
37557
37558 extern struct br_wrlock __br_write_locks[__BR_IDX_MAX];
37559 -#endif
37560
37561 extern void __br_lock_usage_bug (void);
37562
37563 -#ifdef __BRLOCK_USE_ATOMICS
37564 -
37565 -static inline void br_read_lock (enum brlock_indices idx)
37566 -{
37567 - /*
37568 - * This causes a link-time bug message if an
37569 - * invalid index is used:
37570 - */
37571 - if (idx >= __BR_END)
37572 - __br_lock_usage_bug();
37573 -
37574 - read_lock(&__brlock_array[smp_processor_id()][idx]);
37575 -}
37576 -
37577 -static inline void br_read_unlock (enum brlock_indices idx)
37578 -{
37579 - if (idx >= __BR_END)
37580 - __br_lock_usage_bug();
37581 -
37582 - read_unlock(&__brlock_array[smp_processor_id()][idx]);
37583 -}
37584 -
37585 -#else /* ! __BRLOCK_USE_ATOMICS */
37586 static inline void br_read_lock (enum brlock_indices idx)
37587 {
37588 unsigned int *ctr;
37589 @@ -149,7 +104,6 @@
37590 wmb();
37591 (*ctr)--;
37592 }
37593 -#endif /* __BRLOCK_USE_ATOMICS */
37594
37595 /* write path not inlined - it's rare and larger */
37596
37597 diff -Nur linux-2.4.29/include/linux/fs.h linux-mips/include/linux/fs.h
37598 --- linux-2.4.29/include/linux/fs.h 2004-11-17 12:54:22.000000000 +0100
37599 +++ linux-mips/include/linux/fs.h 2005-03-26 11:47:37.386515755 +0100
37600 @@ -576,6 +576,7 @@
37601 unsigned int f_uid, f_gid;
37602 int f_error;
37603
37604 + size_t f_maxcount;
37605 unsigned long f_version;
37606
37607 /* needed for tty driver, and maybe others */
37608 @@ -1056,14 +1057,7 @@
37609 return 0;
37610 }
37611
37612 -static inline int locks_verify_area(int read_write, struct inode *inode,
37613 - struct file *filp, loff_t offset,
37614 - size_t count)
37615 -{
37616 - if (inode->i_flock && MANDATORY_LOCK(inode))
37617 - return locks_mandatory_area(read_write, inode, filp, offset, count);
37618 - return 0;
37619 -}
37620 +extern int rw_verify_area(int, struct file *, loff_t *, size_t);
37621
37622 static inline int locks_verify_truncate(struct inode *inode,
37623 struct file *filp,
37624 diff -Nur linux-2.4.29/include/linux/i2c-algo-au1550.h linux-mips/include/linux/i2c-algo-au1550.h
37625 --- linux-2.4.29/include/linux/i2c-algo-au1550.h 1970-01-01 01:00:00.000000000 +0100
37626 +++ linux-mips/include/linux/i2c-algo-au1550.h 2004-07-07 02:38:02.000000000 +0200
37627 @@ -0,0 +1,31 @@
37628 +/*
37629 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
37630 + *
37631 + * This program is free software; you can redistribute it and/or modify
37632 + * it under the terms of the GNU General Public License as published by
37633 + * the Free Software Foundation; either version 2 of the License, or
37634 + * (at your option) any later version.
37635 + *
37636 + * This program is distributed in the hope that it will be useful,
37637 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
37638 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37639 + * GNU General Public License for more details.
37640 + *
37641 + * You should have received a copy of the GNU General Public License
37642 + * along with this program; if not, write to the Free Software
37643 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37644 + */
37645 +
37646 +#ifndef I2C_ALGO_AU1550_H
37647 +#define I2C_ALGO_AU1550_H 1
37648 +
37649 +struct i2c_algo_au1550_data {
37650 + u32 psc_base;
37651 + int xfer_timeout;
37652 + int ack_timeout;
37653 +};
37654 +
37655 +int i2c_au1550_add_bus(struct i2c_adapter *);
37656 +int i2c_au1550_del_bus(struct i2c_adapter *);
37657 +
37658 +#endif /* I2C_ALGO_AU1550_H */
37659 diff -Nur linux-2.4.29/include/linux/i2c-id.h linux-mips/include/linux/i2c-id.h
37660 --- linux-2.4.29/include/linux/i2c-id.h 2004-02-18 14:36:32.000000000 +0100
37661 +++ linux-mips/include/linux/i2c-id.h 2004-07-07 02:38:02.000000000 +0200
37662 @@ -156,6 +156,8 @@
37663
37664 #define I2C_ALGO_SGI 0x130000 /* SGI algorithm */
37665
37666 +#define I2C_ALGO_AU1550 0x140000 /* Alchemy Au1550 PSC */
37667 +
37668 #define I2C_ALGO_EXP 0x800000 /* experimental */
37669
37670 #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
37671 @@ -204,6 +206,9 @@
37672 #define I2C_HW_SGI_VINO 0x00
37673 #define I2C_HW_SGI_MACE 0x01
37674
37675 +/* --- Au1550 PSC adapters */
37676 +#define I2C_HW_AU1550_PSC 0x00
37677 +
37678 /* --- SMBus only adapters */
37679 #define I2C_HW_SMBUS_PIIX4 0x00
37680 #define I2C_HW_SMBUS_ALI15X3 0x01
37681 diff -Nur linux-2.4.29/include/linux/jbd.h linux-mips/include/linux/jbd.h
37682 --- linux-2.4.29/include/linux/jbd.h 2004-11-17 12:54:22.000000000 +0100
37683 +++ linux-mips/include/linux/jbd.h 2005-03-26 11:47:37.416510832 +0100
37684 @@ -848,7 +848,7 @@
37685
37686 extern int log_space_left (journal_t *); /* Called with journal locked */
37687 extern tid_t log_start_commit (journal_t *, transaction_t *);
37688 -extern void log_wait_commit (journal_t *, tid_t);
37689 +extern int log_wait_commit (journal_t *, tid_t);
37690 extern int log_do_checkpoint (journal_t *, int);
37691
37692 extern void log_wait_for_space(journal_t *, int nblocks);
37693 diff -Nur linux-2.4.29/include/linux/libata-compat.h linux-mips/include/linux/libata-compat.h
37694 --- linux-2.4.29/include/linux/libata-compat.h 2005-01-19 15:10:12.000000000 +0100
37695 +++ linux-mips/include/linux/libata-compat.h 2005-03-26 11:47:37.456504268 +0100
37696 @@ -1,8 +1,16 @@
37697 #ifndef __LIBATA_COMPAT_H__
37698 #define __LIBATA_COMPAT_H__
37699
37700 +#include <linux/types.h>
37701 #include <linux/delay.h>
37702 #include <linux/pci.h>
37703 +#include <linux/slab.h>
37704 +
37705 +typedef u32 __le32;
37706 +typedef u64 __le64;
37707 +
37708 +#define DMA_64BIT_MASK 0xffffffffffffffffULL
37709 +#define DMA_32BIT_MASK 0x00000000ffffffffULL
37710
37711 #define MODULE_VERSION(ver_str)
37712
37713 @@ -10,11 +18,6 @@
37714 struct pci_dev pdev;
37715 };
37716
37717 -static inline void libata_msleep(unsigned long msecs)
37718 -{
37719 - msleep(msecs);
37720 -}
37721 -
37722 static inline struct pci_dev *to_pci_dev(struct device *dev)
37723 {
37724 return (struct pci_dev *) dev;
37725 @@ -47,4 +50,13 @@
37726 #define dev_set_drvdata(dev,ptr) \
37727 pci_set_drvdata(to_pci_dev(dev),(ptr))
37728
37729 +static inline void *kcalloc(size_t nmemb, size_t size, int flags)
37730 +{
37731 + size_t total = nmemb * size;
37732 + void *mem = kmalloc(total, flags);
37733 + if (mem)
37734 + memset(mem, 0, total);
37735 + return mem;
37736 +}
37737 +
37738 #endif /* __LIBATA_COMPAT_H__ */
37739 diff -Nur linux-2.4.29/include/linux/libata.h linux-mips/include/linux/libata.h
37740 --- linux-2.4.29/include/linux/libata.h 2005-01-19 15:10:12.000000000 +0100
37741 +++ linux-mips/include/linux/libata.h 2005-03-26 11:47:37.460503612 +0100
37742 @@ -335,6 +335,8 @@
37743
37744 void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
37745 u8 (*check_status)(struct ata_port *ap);
37746 + u8 (*check_altstatus)(struct ata_port *ap);
37747 + u8 (*check_err)(struct ata_port *ap);
37748 void (*dev_select)(struct ata_port *ap, unsigned int device);
37749
37750 void (*phy_reset) (struct ata_port *ap);
37751 @@ -361,6 +363,9 @@
37752 void (*port_stop) (struct ata_port *ap);
37753
37754 void (*host_stop) (struct ata_host_set *host_set);
37755 +
37756 + void (*bmdma_stop) (struct ata_port *ap);
37757 + u8 (*bmdma_status) (struct ata_port *ap);
37758 };
37759
37760 struct ata_port_info {
37761 @@ -401,6 +406,8 @@
37762 extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
37763 extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
37764 extern u8 ata_check_status(struct ata_port *ap);
37765 +extern u8 ata_altstatus(struct ata_port *ap);
37766 +extern u8 ata_chk_err(struct ata_port *ap);
37767 extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf);
37768 extern int ata_port_start (struct ata_port *ap);
37769 extern void ata_port_stop (struct ata_port *ap);
37770 @@ -416,6 +423,8 @@
37771 unsigned int ofs, unsigned int len);
37772 extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
37773 extern void ata_bmdma_start (struct ata_queued_cmd *qc);
37774 +extern void ata_bmdma_stop(struct ata_port *ap);
37775 +extern u8 ata_bmdma_status(struct ata_port *ap);
37776 extern void ata_bmdma_irq_clear(struct ata_port *ap);
37777 extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat);
37778 extern void ata_eng_timeout(struct ata_port *ap);
37779 @@ -435,8 +444,6 @@
37780
37781 extern struct ata_probe_ent *
37782 ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port);
37783 -extern struct ata_probe_ent *
37784 -ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port);
37785 extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
37786
37787 #endif /* CONFIG_PCI */
37788 @@ -453,26 +460,11 @@
37789 (dev->class == ATA_DEV_ATAPI));
37790 }
37791
37792 -static inline u8 ata_chk_err(struct ata_port *ap)
37793 -{
37794 - if (ap->flags & ATA_FLAG_MMIO) {
37795 - return readb((void __iomem *) ap->ioaddr.error_addr);
37796 - }
37797 - return inb(ap->ioaddr.error_addr);
37798 -}
37799 -
37800 static inline u8 ata_chk_status(struct ata_port *ap)
37801 {
37802 return ap->ops->check_status(ap);
37803 }
37804
37805 -static inline u8 ata_altstatus(struct ata_port *ap)
37806 -{
37807 - if (ap->flags & ATA_FLAG_MMIO)
37808 - return readb((void __iomem *)ap->ioaddr.altstatus_addr);
37809 - return inb(ap->ioaddr.altstatus_addr);
37810 -}
37811 -
37812 static inline void ata_pause(struct ata_port *ap)
37813 {
37814 ata_altstatus(ap);
37815 @@ -596,46 +588,6 @@
37816 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
37817 }
37818
37819 -static inline void ata_bmdma_stop(struct ata_port *ap)
37820 -{
37821 - if (ap->flags & ATA_FLAG_MMIO) {
37822 - void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
37823 -
37824 - /* clear start/stop bit */
37825 - writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
37826 - mmio + ATA_DMA_CMD);
37827 - } else {
37828 - /* clear start/stop bit */
37829 - outb(inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD) & ~ATA_DMA_START,
37830 - ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
37831 - }
37832 -
37833 - /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
37834 - ata_altstatus(ap); /* dummy read */
37835 -}
37836 -
37837 -static inline void ata_bmdma_ack_irq(struct ata_port *ap)
37838 -{
37839 - if (ap->flags & ATA_FLAG_MMIO) {
37840 - void __iomem *mmio = ((void __iomem *) ap->ioaddr.bmdma_addr) + ATA_DMA_STATUS;
37841 - writeb(readb(mmio), mmio);
37842 - } else {
37843 - unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
37844 - outb(inb(addr), addr);
37845 - }
37846 -}
37847 -
37848 -static inline u8 ata_bmdma_status(struct ata_port *ap)
37849 -{
37850 - u8 host_stat;
37851 - if (ap->flags & ATA_FLAG_MMIO) {
37852 - void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
37853 - host_stat = readb(mmio + ATA_DMA_STATUS);
37854 - } else
37855 - host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
37856 - return host_stat;
37857 -}
37858 -
37859 static inline int ata_try_flush_cache(struct ata_device *dev)
37860 {
37861 return ata_id_wcache_enabled(dev->id) ||
37862 diff -Nur linux-2.4.29/include/linux/netfilter_ipv4/ip_conntrack.h linux-mips/include/linux/netfilter_ipv4/ip_conntrack.h
37863 --- linux-2.4.29/include/linux/netfilter_ipv4/ip_conntrack.h 2004-11-17 12:54:22.000000000 +0100
37864 +++ linux-mips/include/linux/netfilter_ipv4/ip_conntrack.h 2005-03-26 11:47:37.735458485 +0100
37865 @@ -249,10 +249,9 @@
37866 /* Call me when a conntrack is destroyed. */
37867 extern void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack);
37868
37869 -extern int ip_ct_no_defrag;
37870 /* Returns new sk_buff, or NULL */
37871 struct sk_buff *
37872 -ip_ct_gather_frags(struct sk_buff *skb);
37873 +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user);
37874
37875 /* Delete all conntracks which match. */
37876 extern void
37877 diff -Nur linux-2.4.29/include/linux/netlink.h linux-mips/include/linux/netlink.h
37878 --- linux-2.4.29/include/linux/netlink.h 2005-01-19 15:10:12.000000000 +0100
37879 +++ linux-mips/include/linux/netlink.h 2005-03-26 11:47:37.463503119 +0100
37880 @@ -117,10 +117,9 @@
37881
37882 /*
37883 * skb should fit one page. This choice is good for headerless malloc.
37884 - *
37885 - * FIXME: What is the best size for SLAB???? --ANK
37886 */
37887 -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF))
37888 +#define NLMSG_GOODORDER 0
37889 +#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER))
37890
37891
37892 struct netlink_callback
37893 diff -Nur linux-2.4.29/include/linux/pci_ids.h linux-mips/include/linux/pci_ids.h
37894 --- linux-2.4.29/include/linux/pci_ids.h 2005-01-19 15:10:12.000000000 +0100
37895 +++ linux-mips/include/linux/pci_ids.h 2005-03-26 11:47:37.534491468 +0100
37896 @@ -1937,7 +1937,6 @@
37897 #define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
37898 #define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
37899 #define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7
37900 -#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
37901 #define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
37902 #define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
37903 #define PCI_DEVICE_ID_INTEL_ESB_0 0x25a0
37904 diff -Nur linux-2.4.29/include/linux/sched.h linux-mips/include/linux/sched.h
37905 --- linux-2.4.29/include/linux/sched.h 2005-01-19 15:10:12.000000000 +0100
37906 +++ linux-mips/include/linux/sched.h 2004-11-29 18:47:18.000000000 +0100
37907 @@ -617,6 +617,10 @@
37908 extern int in_group_p(gid_t);
37909 extern int in_egroup_p(gid_t);
37910
37911 +extern ATTRIB_NORET void cpu_idle(void);
37912 +
37913 +extern void release_task(struct task_struct * p);
37914 +
37915 extern void proc_caches_init(void);
37916 extern void flush_signals(struct task_struct *);
37917 extern void flush_signal_handlers(struct task_struct *);
37918 diff -Nur linux-2.4.29/include/linux/serial.h linux-mips/include/linux/serial.h
37919 --- linux-2.4.29/include/linux/serial.h 2002-08-03 02:39:45.000000000 +0200
37920 +++ linux-mips/include/linux/serial.h 2004-07-31 02:17:57.000000000 +0200
37921 @@ -75,7 +75,8 @@
37922 #define PORT_16654 11
37923 #define PORT_16850 12
37924 #define PORT_RSA 13 /* RSA-DV II/S card */
37925 -#define PORT_MAX 13
37926 +#define PORT_SB1250 14
37927 +#define PORT_MAX 14
37928
37929 #define SERIAL_IO_PORT 0
37930 #define SERIAL_IO_HUB6 1
37931 diff -Nur linux-2.4.29/include/linux/skbuff.h linux-mips/include/linux/skbuff.h
37932 --- linux-2.4.29/include/linux/skbuff.h 2004-08-08 01:26:06.000000000 +0200
37933 +++ linux-mips/include/linux/skbuff.h 2005-03-26 11:47:37.600480638 +0100
37934 @@ -290,15 +290,11 @@
37935
37936 static inline void kfree_skb(struct sk_buff *skb)
37937 {
37938 - if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
37939 - __kfree_skb(skb);
37940 -}
37941 -
37942 -/* Use this if you didn't touch the skb state [for fast switching] */
37943 -static inline void kfree_skb_fast(struct sk_buff *skb)
37944 -{
37945 - if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
37946 - kfree_skbmem(skb);
37947 + if (likely(atomic_read(&skb->users) == 1))
37948 + smp_rmb();
37949 + else if (likely(!atomic_dec_and_test(&skb->users)))
37950 + return;
37951 + __kfree_skb(skb);
37952 }
37953
37954 /**
37955 diff -Nur linux-2.4.29/include/linux/swap.h linux-mips/include/linux/swap.h
37956 --- linux-2.4.29/include/linux/swap.h 2005-01-19 15:10:12.000000000 +0100
37957 +++ linux-mips/include/linux/swap.h 2004-11-29 18:47:18.000000000 +0100
37958 @@ -1,6 +1,12 @@
37959 #ifndef _LINUX_SWAP_H
37960 #define _LINUX_SWAP_H
37961
37962 +#include <linux/config.h>
37963 +
37964 +#define MAX_SWAPFILES 32
37965 +
37966 +#ifdef __KERNEL__
37967 +
37968 #include <linux/spinlock.h>
37969 #include <asm/page.h>
37970
37971 @@ -8,8 +14,6 @@
37972 #define SWAP_FLAG_PRIO_MASK 0x7fff
37973 #define SWAP_FLAG_PRIO_SHIFT 0
37974
37975 -#define MAX_SWAPFILES 32
37976 -
37977 /*
37978 * Magic header for a swap area. The first part of the union is
37979 * what the swap magic looks like for the old (limited to 128MB)
37980 @@ -39,8 +43,6 @@
37981 } info;
37982 };
37983
37984 -#ifdef __KERNEL__
37985 -
37986 /*
37987 * Max bad pages in the new format..
37988 */
37989 diff -Nur linux-2.4.29/include/linux/sysctl.h linux-mips/include/linux/sysctl.h
37990 --- linux-2.4.29/include/linux/sysctl.h 2005-01-19 15:10:13.000000000 +0100
37991 +++ linux-mips/include/linux/sysctl.h 2005-03-26 11:47:37.673468659 +0100
37992 @@ -326,6 +326,7 @@
37993 NET_TCP_BIC_LOW_WINDOW=104,
37994 NET_TCP_DEFAULT_WIN_SCALE=105,
37995 NET_TCP_MODERATE_RCVBUF=106,
37996 + NET_TCP_BIC_BETA=108,
37997 };
37998
37999 enum {
38000 diff -Nur linux-2.4.29/include/net/dst.h linux-mips/include/net/dst.h
38001 --- linux-2.4.29/include/net/dst.h 2003-08-25 13:44:44.000000000 +0200
38002 +++ linux-mips/include/net/dst.h 2005-03-26 11:47:37.821444373 +0100
38003 @@ -104,8 +104,10 @@
38004 static inline
38005 void dst_release(struct dst_entry * dst)
38006 {
38007 - if (dst)
38008 + if (dst) {
38009 + smp_mb__before_atomic_dec();
38010 atomic_dec(&dst->__refcnt);
38011 + }
38012 }
38013
38014 extern void * dst_alloc(struct dst_ops * ops);
38015 diff -Nur linux-2.4.29/include/net/ip.h linux-mips/include/net/ip.h
38016 --- linux-2.4.29/include/net/ip.h 2005-01-19 15:10:13.000000000 +0100
38017 +++ linux-mips/include/net/ip.h 2005-03-26 11:47:37.822444209 +0100
38018 @@ -227,9 +227,19 @@
38019 /*
38020 * Functions provided by ip_fragment.o
38021 */
38022 -
38023 -struct sk_buff *ip_defrag(struct sk_buff *skb);
38024 -extern void ipfrag_flush(void);
38025 +
38026 +enum ip_defrag_users
38027 +{
38028 + IP_DEFRAG_LOCAL_DELIVER,
38029 + IP_DEFRAG_CALL_RA_CHAIN,
38030 + IP_DEFRAG_CONNTRACK_IN,
38031 + IP_DEFRAG_CONNTRACK_OUT,
38032 + IP_DEFRAG_NAT_OUT,
38033 + IP_DEFRAG_VS_OUT,
38034 + IP_DEFRAG_VS_FWD
38035 +};
38036 +
38037 +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user);
38038 extern int ip_frag_nqueues;
38039 extern atomic_t ip_frag_mem;
38040
38041 diff -Nur linux-2.4.29/include/net/tcp.h linux-mips/include/net/tcp.h
38042 --- linux-2.4.29/include/net/tcp.h 2004-11-17 12:54:22.000000000 +0100
38043 +++ linux-mips/include/net/tcp.h 2005-03-26 11:47:37.891432886 +0100
38044 @@ -395,9 +395,8 @@
38045 # define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG)
38046 #endif
38047
38048 -#define BICTCP_1_OVER_BETA 8 /*
38049 - * Fast recovery
38050 - * multiplicative decrease factor
38051 +#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
38052 + * max_cwnd = snd_cwnd * beta
38053 */
38054 #define BICTCP_MAX_INCREMENT 32 /*
38055 * Limit on the amount of
38056 @@ -491,6 +490,7 @@
38057 extern int sysctl_tcp_bic;
38058 extern int sysctl_tcp_bic_fast_convergence;
38059 extern int sysctl_tcp_bic_low_window;
38060 +extern int sysctl_tcp_bic_beta;
38061 extern int sysctl_tcp_default_win_scale;
38062 extern int sysctl_tcp_moderate_rcvbuf;
38063
38064 @@ -1132,15 +1132,16 @@
38065 if (tcp_is_bic(tp)) {
38066 if (sysctl_tcp_bic_fast_convergence &&
38067 tp->snd_cwnd < tp->bictcp.last_max_cwnd)
38068 - tp->bictcp.last_max_cwnd
38069 - = (tp->snd_cwnd * (2*BICTCP_1_OVER_BETA-1))
38070 - / (BICTCP_1_OVER_BETA/2);
38071 + tp->bictcp.last_max_cwnd = (tp->snd_cwnd *
38072 + (BICTCP_BETA_SCALE
38073 + + sysctl_tcp_bic_beta))
38074 + / (2 * BICTCP_BETA_SCALE);
38075 else
38076 tp->bictcp.last_max_cwnd = tp->snd_cwnd;
38077
38078 if (tp->snd_cwnd > sysctl_tcp_bic_low_window)
38079 - return max(tp->snd_cwnd - (tp->snd_cwnd/BICTCP_1_OVER_BETA),
38080 - 2U);
38081 + return max((tp->snd_cwnd * sysctl_tcp_bic_beta)
38082 + / BICTCP_BETA_SCALE, 2U);
38083 }
38084
38085 return max(tp->snd_cwnd >> 1U, 2U);
38086 diff -Nur linux-2.4.29/include/video/newport.h linux-mips/include/video/newport.h
38087 --- linux-2.4.29/include/video/newport.h 2001-04-12 21:20:31.000000000 +0200
38088 +++ linux-mips/include/video/newport.h 2004-09-23 15:32:29.000000000 +0200
38089 @@ -291,8 +291,6 @@
38090 unsigned int _unused2[0x1ef];
38091 struct newport_cregs cgo;
38092 };
38093 -extern struct newport_regs *npregs;
38094 -
38095
38096 typedef struct {
38097 unsigned int drawmode1;
38098 @@ -450,38 +448,26 @@
38099
38100 /* Miscellaneous NEWPORT routines. */
38101 #define BUSY_TIMEOUT 100000
38102 -static __inline__ int newport_wait(void)
38103 +static __inline__ int newport_wait(struct newport_regs *regs)
38104 {
38105 - int i = 0;
38106 + int t = BUSY_TIMEOUT;
38107
38108 - while(i < BUSY_TIMEOUT)
38109 - if(!(npregs->cset.status & NPORT_STAT_GBUSY))
38110 + while (t--)
38111 + if (!(regs->cset.status & NPORT_STAT_GBUSY))
38112 break;
38113 - if(i == BUSY_TIMEOUT)
38114 - return 1;
38115 - return 0;
38116 + return !t;
38117 }
38118
38119 -static __inline__ int newport_bfwait(void)
38120 +static __inline__ int newport_bfwait(struct newport_regs *regs)
38121 {
38122 - int i = 0;
38123 + int t = BUSY_TIMEOUT;
38124
38125 - while(i < BUSY_TIMEOUT)
38126 - if(!(npregs->cset.status & NPORT_STAT_BBUSY))
38127 + while (t--)
38128 + if(!(regs->cset.status & NPORT_STAT_BBUSY))
38129 break;
38130 - if(i == BUSY_TIMEOUT)
38131 - return 1;
38132 - return 0;
38133 + return !t;
38134 }
38135
38136 -/* newport.c and cons_newport.c routines */
38137 -extern struct graphics_ops *newport_probe (int, const char **);
38138 -
38139 -void newport_save (void *);
38140 -void newport_restore (void *);
38141 -void newport_reset (void);
38142 -int newport_ioctl (int card, int cmd, unsigned long arg);
38143 -
38144 /*
38145 * DCBMODE register defines:
38146 */
38147 @@ -564,7 +550,7 @@
38148 {
38149 rex->set.dcbmode = DCB_XMAP0 | XM9_CRS_FIFO_AVAIL |
38150 DCB_DATAWIDTH_1 | R_DCB_XMAP9_PROTOCOL;
38151 - newport_bfwait ();
38152 + newport_bfwait (rex);
38153
38154 while ((rex->set.dcbdata0.bybytes.b3 & 3) != XM9_FIFO_EMPTY)
38155 ;
38156 diff -Nur linux-2.4.29/init/main.c linux-mips/init/main.c
38157 --- linux-2.4.29/init/main.c 2004-11-17 12:54:22.000000000 +0100
38158 +++ linux-mips/init/main.c 2004-11-19 01:28:52.000000000 +0100
38159 @@ -296,7 +296,6 @@
38160
38161
38162 extern void setup_arch(char **);
38163 -extern void cpu_idle(void);
38164
38165 unsigned long wait_init_idle;
38166
38167 diff -Nur linux-2.4.29/kernel/exit.c linux-mips/kernel/exit.c
38168 --- linux-2.4.29/kernel/exit.c 2002-11-29 00:53:15.000000000 +0100
38169 +++ linux-mips/kernel/exit.c 2003-01-11 18:53:18.000000000 +0100
38170 @@ -26,7 +26,7 @@
38171
38172 int getrusage(struct task_struct *, int, struct rusage *);
38173
38174 -static void release_task(struct task_struct * p)
38175 +void release_task(struct task_struct * p)
38176 {
38177 if (p != current) {
38178 #ifdef CONFIG_SMP
38179 diff -Nur linux-2.4.29/kernel/signal.c linux-mips/kernel/signal.c
38180 --- linux-2.4.29/kernel/signal.c 2004-02-18 14:36:32.000000000 +0100
38181 +++ linux-mips/kernel/signal.c 2004-01-20 16:10:34.000000000 +0100
38182 @@ -14,6 +14,7 @@
38183 #include <linux/init.h>
38184 #include <linux/sched.h>
38185
38186 +#include <asm/param.h>
38187 #include <asm/uaccess.h>
38188
38189 /*
38190 @@ -28,6 +29,14 @@
38191 #define SIG_SLAB_DEBUG 0
38192 #endif
38193
38194 +#define DEBUG_SIG 0
38195 +
38196 +#if DEBUG_SIG
38197 +#define SIG_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
38198 +#else
38199 +#define SIG_SLAB_DEBUG 0
38200 +#endif
38201 +
38202 static kmem_cache_t *sigqueue_cachep;
38203
38204 atomic_t nr_queued_signals;
38205 @@ -270,6 +279,11 @@
38206 signal_pending(current));
38207 #endif
38208
38209 +#if DEBUG_SIG
38210 +printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
38211 + signal_pending(current));
38212 +#endif
38213 +
38214 sig = next_signal(current, mask);
38215 if (sig) {
38216 if (current->notifier) {
38217 @@ -293,6 +307,10 @@
38218 printk(" %d -> %d\n", signal_pending(current), sig);
38219 #endif
38220
38221 +#if DEBUG_SIG
38222 +printk(" %d -> %d\n", signal_pending(current), sig);
38223 +#endif
38224 +
38225 return sig;
38226 }
38227
38228 @@ -540,6 +558,11 @@
38229 printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
38230 #endif
38231
38232 +
38233 +#if DEBUG_SIG
38234 +printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
38235 +#endif
38236 +
38237 ret = -EINVAL;
38238 if (sig < 0 || sig > _NSIG)
38239 goto out_nolock;
38240 @@ -778,8 +801,8 @@
38241 info.si_uid = tsk->uid;
38242
38243 /* FIXME: find out whether or not this is supposed to be c*time. */
38244 - info.si_utime = tsk->times.tms_utime;
38245 - info.si_stime = tsk->times.tms_stime;
38246 + info.si_utime = hz_to_std(tsk->times.tms_utime);
38247 + info.si_stime = hz_to_std(tsk->times.tms_stime);
38248
38249 status = tsk->exit_code & 0x7f;
38250 why = SI_KERNEL; /* shouldn't happen */
38251 diff -Nur linux-2.4.29/kernel/sys.c linux-mips/kernel/sys.c
38252 --- linux-2.4.29/kernel/sys.c 2003-11-28 19:26:21.000000000 +0100
38253 +++ linux-mips/kernel/sys.c 2003-11-17 02:07:47.000000000 +0100
38254 @@ -801,16 +801,23 @@
38255
38256 asmlinkage long sys_times(struct tms * tbuf)
38257 {
38258 + struct tms temp;
38259 +
38260 /*
38261 * In the SMP world we might just be unlucky and have one of
38262 * the times increment as we use it. Since the value is an
38263 * atomically safe type this is just fine. Conceptually its
38264 * as if the syscall took an instant longer to occur.
38265 */
38266 - if (tbuf)
38267 - if (copy_to_user(tbuf, &current->times, sizeof(struct tms)))
38268 + if (tbuf) {
38269 + temp.tms_utime = hz_to_std(current->times.tms_utime);
38270 + temp.tms_stime = hz_to_std(current->times.tms_stime);
38271 + temp.tms_cutime = hz_to_std(current->times.tms_cutime);
38272 + temp.tms_cstime = hz_to_std(current->times.tms_cstime);
38273 + if (copy_to_user(tbuf, &temp, sizeof(struct tms)))
38274 return -EFAULT;
38275 - return jiffies;
38276 + }
38277 + return hz_to_std(jiffies);
38278 }
38279
38280 /*
38281 diff -Nur linux-2.4.29/lib/brlock.c linux-mips/lib/brlock.c
38282 --- linux-2.4.29/lib/brlock.c 2004-11-17 12:54:22.000000000 +0100
38283 +++ linux-mips/lib/brlock.c 2005-03-26 11:47:38.065404334 +0100
38284 @@ -15,29 +15,6 @@
38285 #include <linux/sched.h>
38286 #include <linux/brlock.h>
38287
38288 -#ifdef __BRLOCK_USE_ATOMICS
38289 -
38290 -brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX] =
38291 - { [0 ... NR_CPUS-1] = { [0 ... __BR_IDX_MAX-1] = RW_LOCK_UNLOCKED } };
38292 -
38293 -void fastcall __br_write_lock (enum brlock_indices idx)
38294 -{
38295 - int i;
38296 -
38297 - for (i = 0; i < smp_num_cpus; i++)
38298 - write_lock(&__brlock_array[cpu_logical_map(i)][idx]);
38299 -}
38300 -
38301 -void fastcall __br_write_unlock (enum brlock_indices idx)
38302 -{
38303 - int i;
38304 -
38305 - for (i = 0; i < smp_num_cpus; i++)
38306 - write_unlock(&__brlock_array[cpu_logical_map(i)][idx]);
38307 -}
38308 -
38309 -#else /* ! __BRLOCK_USE_ATOMICS */
38310 -
38311 brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX] =
38312 { [0 ... NR_CPUS-1] = { [0 ... __BR_IDX_MAX-1] = 0 } };
38313
38314 @@ -64,6 +41,4 @@
38315 spin_unlock(&__br_write_locks[idx].lock);
38316 }
38317
38318 -#endif /* __BRLOCK_USE_ATOMICS */
38319 -
38320 #endif /* CONFIG_SMP */
38321 diff -Nur linux-2.4.29/lib/Makefile linux-mips/lib/Makefile
38322 --- linux-2.4.29/lib/Makefile 2004-04-14 15:05:40.000000000 +0200
38323 +++ linux-mips/lib/Makefile 2004-04-16 05:14:21.000000000 +0200
38324 @@ -27,6 +27,7 @@
38325 subdir-$(CONFIG_ZLIB_INFLATE) += zlib_inflate
38326 subdir-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate
38327
38328 +-include $(TOPDIR)/arch/$(ARCH)/Makefile.lib
38329 include $(TOPDIR)/drivers/net/Makefile.lib
38330 include $(TOPDIR)/drivers/usb/Makefile.lib
38331 include $(TOPDIR)/drivers/bluetooth/Makefile.lib
38332 diff -Nur linux-2.4.29/MAINTAINERS linux-mips/MAINTAINERS
38333 --- linux-2.4.29/MAINTAINERS 2005-01-19 15:09:24.000000000 +0100
38334 +++ linux-mips/MAINTAINERS 2005-03-26 11:47:05.618729582 +0100
38335 @@ -1058,8 +1058,8 @@
38336 JFS FILESYSTEM
38337 P: Dave Kleikamp
38338 M: shaggy@austin.ibm.com
38339 -L: jfs-discussion@oss.software.ibm.com
38340 -W: http://oss.software.ibm.com/developerworks/opensource/jfs/
38341 +L: jfs-discussion@lists.sourceforge.net
38342 +W: http://jfs.sourceforge.net/
38343 S: Supported
38344
38345 JOYSTICK DRIVER
38346 @@ -1532,7 +1532,7 @@
38347
38348 PPP OVER ETHERNET
38349 P: Michal Ostrowski
38350 -M: mostrows@styx.uwaterloo.ca
38351 +M: mostrows@speakeasy.net
38352 S: Maintained
38353
38354 PRISM54 WIRELESS DRIVER
38355 diff -Nur linux-2.4.29/Makefile linux-mips/Makefile
38356 --- linux-2.4.29/Makefile 2005-01-19 15:10:14.000000000 +0100
38357 +++ linux-mips/Makefile 2005-03-26 11:47:05.686718424 +0100
38358 @@ -1,11 +1,11 @@
38359 VERSION = 2
38360 PATCHLEVEL = 4
38361 -SUBLEVEL = 29
38362 -EXTRAVERSION =
38363 +SUBLEVEL = 30
38364 +EXTRAVERSION = -pre3
38365
38366 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
38367
38368 -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
38369 +ARCH = mips
38370 KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
38371
38372 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
38373 @@ -462,10 +462,11 @@
38374 $(MAKE) -C Documentation/DocBook mrproper
38375
38376 distclean: mrproper
38377 - rm -f core `find . \( -not -type d \) -and \
38378 - \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
38379 - -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
38380 - -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
38381 + find . \( -not -type d \) -and \
38382 + \( -name core -o -name '*.orig' -o -name '*.rej' \
38383 + -o -name '*~' -o -name '*.bak' -o -name '#*#' \
38384 + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \
38385 + -o -name TAGS -o -name tags \) -print | env -i xargs rm -f
38386
38387 backup: mrproper
38388 cd .. && tar cf - linux/ | gzip -9 > backup.gz
38389 @@ -492,7 +493,7 @@
38390 $(MAKE) -C Documentation/DocBook man
38391
38392 sums:
38393 - find . -type f -print | sort | xargs sum > .SUMS
38394 + find . -type f -print | sort | env -i xargs sum > .SUMS
38395
38396 dep-files: scripts/mkdep archdep include/linux/version.h
38397 rm -f .depend .hdepend
38398 diff -Nur linux-2.4.29/mm/filemap.c linux-mips/mm/filemap.c
38399 --- linux-2.4.29/mm/filemap.c 2004-11-17 12:54:22.000000000 +0100
38400 +++ linux-mips/mm/filemap.c 2005-03-26 11:47:38.292367084 +0100
38401 @@ -1870,7 +1870,7 @@
38402 goto fput_in;
38403 if (!in_inode->i_mapping->a_ops->readpage)
38404 goto fput_in;
38405 - retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, in_file->f_pos, count);
38406 + retval = rw_verify_area(READ, in_file, &in_file->f_pos, count);
38407 if (retval)
38408 goto fput_in;
38409
38410 @@ -1887,7 +1887,7 @@
38411 if (!out_file->f_op || !out_file->f_op->write)
38412 goto fput_out;
38413 out_inode = out_file->f_dentry->d_inode;
38414 - retval = locks_verify_area(FLOCK_VERIFY_WRITE, out_inode, out_file, out_file->f_pos, count);
38415 + retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count);
38416 if (retval)
38417 goto fput_out;
38418
38419 @@ -2589,7 +2589,7 @@
38420 long error = -EBADF;
38421 struct file * file;
38422 struct inode * inode;
38423 - unsigned long size, rlim_rss;
38424 + unsigned long size;
38425
38426 /* Doesn't work if there's no mapped file. */
38427 if (!vma->vm_file)
38428 @@ -2605,13 +2605,6 @@
38429 end = vma->vm_end;
38430 end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
38431
38432 - /* Make sure this doesn't exceed the process's max rss. */
38433 - error = -EIO;
38434 - rlim_rss = current->rlim ? current->rlim[RLIMIT_RSS].rlim_cur :
38435 - LONG_MAX; /* default: see resource.h */
38436 - if ((vma->vm_mm->rss + (end - start)) > rlim_rss)
38437 - return error;
38438 -
38439 /* round to cluster boundaries if this isn't a "random" area. */
38440 if (!VM_RandomReadHint(vma)) {
38441 start = CLUSTER_OFFSET(start);
38442 @@ -3268,7 +3261,12 @@
38443 status = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
38444 }
38445
38446 - err = written ? written : status;
38447 + /*
38448 + * generic_osync_inode always returns 0 or negative value.
38449 + * So 'status < written' is always true, and written should
38450 + * be returned if status >= 0.
38451 + */
38452 + err = (status < 0) ? status : written;
38453 out:
38454
38455 return err;
38456 diff -Nur linux-2.4.29/mm/swapfile.c linux-mips/mm/swapfile.c
38457 --- linux-2.4.29/mm/swapfile.c 2004-11-17 12:54:22.000000000 +0100
38458 +++ linux-mips/mm/swapfile.c 2005-03-26 11:47:38.293366920 +0100
38459 @@ -738,8 +738,10 @@
38460 for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
38461 p = swap_info + type;
38462 if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
38463 - if (p->swap_file == nd.dentry)
38464 - break;
38465 + if (p->swap_file == nd.dentry ||
38466 + (S_ISBLK(nd.dentry->d_inode->i_mode) &&
38467 + p->swap_device == nd.dentry->d_inode->i_rdev))
38468 + break;
38469 }
38470 prev = type;
38471 }
38472 diff -Nur linux-2.4.29/net/core/dev.c linux-mips/net/core/dev.c
38473 --- linux-2.4.29/net/core/dev.c 2004-04-14 15:05:41.000000000 +0200
38474 +++ linux-mips/net/core/dev.c 2005-03-26 11:47:38.556323762 +0100
38475 @@ -2180,10 +2180,26 @@
38476 case SIOCSIFNAME:
38477 if (dev->flags&IFF_UP)
38478 return -EBUSY;
38479 - if (__dev_get_by_name(ifr->ifr_newname))
38480 - return -EEXIST;
38481 - memcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
38482 - dev->name[IFNAMSIZ-1] = 0;
38483 + /* Check if name contains a wildcard */
38484 + if (strchr(ifr->ifr_newname, '%')) {
38485 + char format[IFNAMSIZ + 1];
38486 + int ret;
38487 + memcpy(format, ifr->ifr_newname, IFNAMSIZ);
38488 + format[IFNAMSIZ-1] = 0;
38489 + /* Find a free name based on format.
38490 + * dev_alloc_name() replaces "%d" with at max
38491 + * 2 digits, so no name overflow. - Jean II */
38492 + ret = dev_alloc_name(dev, format);
38493 + if (ret < 0)
38494 + return ret;
38495 + /* Copy the new name back to caller. */
38496 + strncpy(ifr->ifr_newname, dev->name, IFNAMSIZ);
38497 + } else {
38498 + if (__dev_get_by_name(ifr->ifr_newname))
38499 + return -EEXIST;
38500 + memcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
38501 + dev->name[IFNAMSIZ-1] = 0;
38502 + }
38503 notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
38504 return 0;
38505
38506 @@ -2316,6 +2332,7 @@
38507 * - return a value
38508 */
38509
38510 + case SIOCSIFNAME:
38511 case SIOCGMIIPHY:
38512 case SIOCGMIIREG:
38513 if (!capable(CAP_NET_ADMIN))
38514 @@ -2351,7 +2368,6 @@
38515 case SIOCDELMULTI:
38516 case SIOCSIFHWBROADCAST:
38517 case SIOCSIFTXQLEN:
38518 - case SIOCSIFNAME:
38519 case SIOCSMIIREG:
38520 case SIOCBONDENSLAVE:
38521 case SIOCBONDRELEASE:
38522 diff -Nur linux-2.4.29/net/core/dst.c linux-mips/net/core/dst.c
38523 --- linux-2.4.29/net/core/dst.c 2003-08-25 13:44:44.000000000 +0200
38524 +++ linux-mips/net/core/dst.c 2005-03-26 11:47:38.557323598 +0100
38525 @@ -142,8 +142,13 @@
38526
38527 void dst_destroy(struct dst_entry * dst)
38528 {
38529 - struct neighbour *neigh = dst->neighbour;
38530 - struct hh_cache *hh = dst->hh;
38531 + struct neighbour *neigh;
38532 + struct hh_cache *hh;
38533 +
38534 + smp_rmb();
38535 +
38536 + neigh = dst->neighbour;
38537 + hh = dst->hh;
38538
38539 dst->hh = NULL;
38540 if (hh && atomic_dec_and_test(&hh->hh_refcnt))
38541 diff -Nur linux-2.4.29/net/core/neighbour.c linux-mips/net/core/neighbour.c
38542 --- linux-2.4.29/net/core/neighbour.c 2005-01-19 15:10:13.000000000 +0100
38543 +++ linux-mips/net/core/neighbour.c 2005-03-26 11:47:38.629311783 +0100
38544 @@ -111,7 +111,7 @@
38545
38546 unsigned long neigh_rand_reach_time(unsigned long base)
38547 {
38548 - return (net_random() % base) + (base>>1);
38549 + return (base ? (net_random() % base) + (base >> 1) : 0);
38550 }
38551
38552
38553 @@ -1469,6 +1469,7 @@
38554
38555 nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ndm));
38556 ndm = NLMSG_DATA(nlh);
38557 + nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0;
38558 ndm->ndm_family = n->ops->family;
38559 ndm->ndm_flags = n->flags;
38560 ndm->ndm_type = n->type;
38561 diff -Nur linux-2.4.29/net/ipv4/ipconfig.c linux-mips/net/ipv4/ipconfig.c
38562 --- linux-2.4.29/net/ipv4/ipconfig.c 2004-11-17 12:54:22.000000000 +0100
38563 +++ linux-mips/net/ipv4/ipconfig.c 2005-03-26 11:47:38.712298163 +0100
38564 @@ -1162,7 +1162,7 @@
38565 if (*cp == ':')
38566 *cp++ = '\0';
38567 addr = in_aton(name);
38568 - strcpy(name, cp);
38569 + memmove(name, cp, strlen(cp) + 1);
38570 } else
38571 addr = INADDR_NONE;
38572
38573 diff -Nur linux-2.4.29/net/ipv4/ip_fragment.c linux-mips/net/ipv4/ip_fragment.c
38574 --- linux-2.4.29/net/ipv4/ip_fragment.c 2004-11-17 12:54:22.000000000 +0100
38575 +++ linux-mips/net/ipv4/ip_fragment.c 2005-03-26 11:47:38.632311291 +0100
38576 @@ -72,6 +72,7 @@
38577 struct ipq {
38578 struct ipq *next; /* linked list pointers */
38579 struct list_head lru_list; /* lru list member */
38580 + u32 user;
38581 u32 saddr;
38582 u32 daddr;
38583 u16 id;
38584 @@ -242,13 +243,13 @@
38585 /* Memory limiting on fragments. Evictor trashes the oldest
38586 * fragment queue until we are back under the threshold.
38587 */
38588 -static void __ip_evictor(int threshold)
38589 +static void ip_evictor(void)
38590 {
38591 struct ipq *qp;
38592 struct list_head *tmp;
38593 int work;
38594
38595 - work = atomic_read(&ip_frag_mem) - threshold;
38596 + work = atomic_read(&ip_frag_mem) - sysctl_ipfrag_low_thresh;
38597 if (work <= 0)
38598 return;
38599
38600 @@ -273,11 +274,6 @@
38601 }
38602 }
38603
38604 -static inline void ip_evictor(void)
38605 -{
38606 - __ip_evictor(sysctl_ipfrag_low_thresh);
38607 -}
38608 -
38609 /*
38610 * Oops, a fragment queue timed out. Kill it and send an ICMP reply.
38611 */
38612 @@ -324,7 +320,8 @@
38613 if(qp->id == qp_in->id &&
38614 qp->saddr == qp_in->saddr &&
38615 qp->daddr == qp_in->daddr &&
38616 - qp->protocol == qp_in->protocol) {
38617 + qp->protocol == qp_in->protocol &&
38618 + qp->user == qp_in->user) {
38619 atomic_inc(&qp->refcnt);
38620 write_unlock(&ipfrag_lock);
38621 qp_in->last_in |= COMPLETE;
38622 @@ -351,7 +348,7 @@
38623 }
38624
38625 /* Add an entry to the 'ipq' queue for a newly received IP datagram. */
38626 -static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph)
38627 +static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user)
38628 {
38629 struct ipq *qp;
38630
38631 @@ -363,6 +360,7 @@
38632 qp->id = iph->id;
38633 qp->saddr = iph->saddr;
38634 qp->daddr = iph->daddr;
38635 + qp->user = user;
38636 qp->len = 0;
38637 qp->meat = 0;
38638 qp->fragments = NULL;
38639 @@ -385,7 +383,7 @@
38640 /* Find the correct entry in the "incomplete datagrams" queue for
38641 * this IP datagram, and create new one, if nothing is found.
38642 */
38643 -static inline struct ipq *ip_find(struct iphdr *iph)
38644 +static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
38645 {
38646 __u16 id = iph->id;
38647 __u32 saddr = iph->saddr;
38648 @@ -399,7 +397,8 @@
38649 if(qp->id == id &&
38650 qp->saddr == saddr &&
38651 qp->daddr == daddr &&
38652 - qp->protocol == protocol) {
38653 + qp->protocol == protocol &&
38654 + qp->user == user) {
38655 atomic_inc(&qp->refcnt);
38656 read_unlock(&ipfrag_lock);
38657 return qp;
38658 @@ -407,7 +406,7 @@
38659 }
38660 read_unlock(&ipfrag_lock);
38661
38662 - return ip_frag_create(hash, iph);
38663 + return ip_frag_create(hash, iph, user);
38664 }
38665
38666 /* Add new segment to existing queue. */
38667 @@ -641,7 +640,7 @@
38668 }
38669
38670 /* Process an incoming IP datagram fragment. */
38671 -struct sk_buff *ip_defrag(struct sk_buff *skb)
38672 +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user)
38673 {
38674 struct iphdr *iph = skb->nh.iph;
38675 struct ipq *qp;
38676 @@ -656,7 +655,7 @@
38677 dev = skb->dev;
38678
38679 /* Lookup (or create) queue header */
38680 - if ((qp = ip_find(iph)) != NULL) {
38681 + if ((qp = ip_find(iph, user)) != NULL) {
38682 struct sk_buff *ret = NULL;
38683
38684 spin_lock(&qp->lock);
38685 @@ -687,8 +686,3 @@
38686 ipfrag_secret_timer.expires = jiffies + sysctl_ipfrag_secret_interval;
38687 add_timer(&ipfrag_secret_timer);
38688 }
38689 -
38690 -void ipfrag_flush(void)
38691 -{
38692 - __ip_evictor(0);
38693 -}
38694 diff -Nur linux-2.4.29/net/ipv4/ip_input.c linux-mips/net/ipv4/ip_input.c
38695 --- linux-2.4.29/net/ipv4/ip_input.c 2004-08-08 01:26:06.000000000 +0200
38696 +++ linux-mips/net/ipv4/ip_input.c 2005-03-26 11:47:38.711298328 +0100
38697 @@ -170,7 +170,7 @@
38698 && ((sk->bound_dev_if == 0)
38699 || (sk->bound_dev_if == skb->dev->ifindex))) {
38700 if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
38701 - skb = ip_defrag(skb);
38702 + skb = ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN);
38703 if (skb == NULL) {
38704 read_unlock(&ip_ra_lock);
38705 return 1;
38706 @@ -291,7 +291,7 @@
38707 */
38708
38709 if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
38710 - skb = ip_defrag(skb);
38711 + skb = ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER);
38712 if (!skb)
38713 return 0;
38714 }
38715 diff -Nur linux-2.4.29/net/ipv4/ipvs/ip_vs_core.c linux-mips/net/ipv4/ipvs/ip_vs_core.c
38716 --- linux-2.4.29/net/ipv4/ipvs/ip_vs_core.c 2005-01-19 15:10:13.000000000 +0100
38717 +++ linux-mips/net/ipv4/ipvs/ip_vs_core.c 2005-03-26 11:47:38.913265180 +0100
38718 @@ -506,7 +506,7 @@
38719
38720 /* reassemble IP fragments, but will it happen in ICMP packets?? */
38721 if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) {
38722 - skb = ip_defrag(skb);
38723 + skb = ip_defrag(skb, IP_DEFRAG_VS_OUT);
38724 if (!skb)
38725 return NF_STOLEN;
38726 *skb_p = skb;
38727 @@ -658,7 +658,7 @@
38728
38729 /* reassemble IP fragments */
38730 if (iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) {
38731 - skb = ip_defrag(skb);
38732 + skb = ip_defrag(skb, IP_DEFRAG_VS_OUT);
38733 if (!skb)
38734 return NF_STOLEN;
38735 iph = skb->nh.iph;
38736 @@ -1164,7 +1164,7 @@
38737 return NF_ACCEPT;
38738
38739 if (iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) {
38740 - skb = ip_defrag(skb);
38741 + skb = ip_defrag(skb, IP_DEFRAG_VS_FWD);
38742 if (!skb)
38743 return NF_STOLEN;
38744 *skb_p = skb;
38745 diff -Nur linux-2.4.29/net/ipv4/netfilter/ip_conntrack_core.c linux-mips/net/ipv4/netfilter/ip_conntrack_core.c
38746 --- linux-2.4.29/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-19 15:10:13.000000000 +0100
38747 +++ linux-mips/net/ipv4/netfilter/ip_conntrack_core.c 2005-03-26 11:47:38.949259273 +0100
38748 @@ -834,7 +834,10 @@
38749
38750 /* Gather fragments. */
38751 if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
38752 - *pskb = ip_ct_gather_frags(*pskb);
38753 + *pskb = ip_ct_gather_frags(*pskb,
38754 + hooknum == NF_IP_PRE_ROUTING ?
38755 + IP_DEFRAG_CONNTRACK_IN :
38756 + IP_DEFRAG_CONNTRACK_OUT);
38757 if (!*pskb)
38758 return NF_STOLEN;
38759 }
38760 @@ -1183,29 +1186,22 @@
38761 WRITE_UNLOCK(&ip_conntrack_lock);
38762 }
38763
38764 -int ip_ct_no_defrag;
38765 -
38766 /* Returns new sk_buff, or NULL */
38767 struct sk_buff *
38768 -ip_ct_gather_frags(struct sk_buff *skb)
38769 +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
38770 {
38771 struct sock *sk = skb->sk;
38772 #ifdef CONFIG_NETFILTER_DEBUG
38773 unsigned int olddebug = skb->nf_debug;
38774 #endif
38775
38776 - if (unlikely(ip_ct_no_defrag)) {
38777 - kfree_skb(skb);
38778 - return NULL;
38779 - }
38780 -
38781 if (sk) {
38782 sock_hold(sk);
38783 skb_orphan(skb);
38784 }
38785
38786 local_bh_disable();
38787 - skb = ip_defrag(skb);
38788 + skb = ip_defrag(skb, user);
38789 local_bh_enable();
38790
38791 if (!skb) {
38792 diff -Nur linux-2.4.29/net/ipv4/netfilter/ip_conntrack_standalone.c linux-mips/net/ipv4/netfilter/ip_conntrack_standalone.c
38793 --- linux-2.4.29/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-19 15:10:13.000000000 +0100
38794 +++ linux-mips/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-03-26 11:47:38.951258945 +0100
38795 @@ -393,13 +393,6 @@
38796 cleanup_inandlocalops:
38797 nf_unregister_hook(&ip_conntrack_local_out_ops);
38798 cleanup_inops:
38799 - /* Frag queues may hold fragments with skb->dst == NULL */
38800 - ip_ct_no_defrag = 1;
38801 - local_bh_disable();
38802 - br_write_lock(BR_NETPROTO_LOCK);
38803 - br_write_unlock(BR_NETPROTO_LOCK);
38804 - ipfrag_flush();
38805 - local_bh_enable();
38806 nf_unregister_hook(&ip_conntrack_in_ops);
38807 cleanup_proc:
38808 proc_net_remove("ip_conntrack");
38809 diff -Nur linux-2.4.29/net/ipv4/netfilter/ip_fw_compat.c linux-mips/net/ipv4/netfilter/ip_fw_compat.c
38810 --- linux-2.4.29/net/ipv4/netfilter/ip_fw_compat.c 2003-11-28 19:26:21.000000000 +0100
38811 +++ linux-mips/net/ipv4/netfilter/ip_fw_compat.c 2005-03-26 11:47:38.979254350 +0100
38812 @@ -108,7 +108,7 @@
38813 (*pskb)->nh.raw, &redirpt, pskb);
38814
38815 if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
38816 - *pskb = ip_ct_gather_frags(*pskb);
38817 + *pskb = ip_ct_gather_frags(*pskb, IP_DEFRAG_CONNTRACK_IN);
38818
38819 if (!*pskb)
38820 return NF_STOLEN;
38821 diff -Nur linux-2.4.29/net/ipv4/netfilter/ip_nat_standalone.c linux-mips/net/ipv4/netfilter/ip_nat_standalone.c
38822 --- linux-2.4.29/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-19 15:10:13.000000000 +0100
38823 +++ linux-mips/net/ipv4/netfilter/ip_nat_standalone.c 2005-03-26 11:47:38.980254186 +0100
38824 @@ -201,7 +201,7 @@
38825 I'm starting to have nightmares about fragments. */
38826
38827 if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
38828 - *pskb = ip_ct_gather_frags(*pskb);
38829 + *pskb = ip_ct_gather_frags(*pskb, IP_DEFRAG_NAT_OUT);
38830
38831 if (!*pskb)
38832 return NF_STOLEN;
38833 diff -Nur linux-2.4.29/net/ipv4/sysctl_net_ipv4.c linux-mips/net/ipv4/sysctl_net_ipv4.c
38834 --- linux-2.4.29/net/ipv4/sysctl_net_ipv4.c 2004-08-08 01:26:06.000000000 +0200
38835 +++ linux-mips/net/ipv4/sysctl_net_ipv4.c 2005-03-26 11:47:38.713297999 +0100
38836 @@ -268,6 +268,9 @@
38837 {NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf",
38838 &sysctl_tcp_moderate_rcvbuf, sizeof(int), 0644, NULL,
38839 &proc_dointvec},
38840 + {NET_TCP_BIC_BETA, "tcp_bic_beta",
38841 + &sysctl_tcp_bic_beta, sizeof(int), 0644, NULL,
38842 + &proc_dointvec},
38843 {0}
38844 };
38845
38846 diff -Nur linux-2.4.29/net/ipv4/tcp_input.c linux-mips/net/ipv4/tcp_input.c
38847 --- linux-2.4.29/net/ipv4/tcp_input.c 2005-01-19 15:10:13.000000000 +0100
38848 +++ linux-mips/net/ipv4/tcp_input.c 2005-03-26 11:47:38.911265508 +0100
38849 @@ -107,6 +107,7 @@
38850 int sysctl_tcp_bic;
38851 int sysctl_tcp_bic_fast_convergence = 1;
38852 int sysctl_tcp_bic_low_window = 14;
38853 +int sysctl_tcp_bic_beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */
38854
38855 #define FLAG_DATA 0x01 /* Incoming frame contained data. */
38856 #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */
38857 @@ -3647,8 +3648,7 @@
38858 while (before(start, end)) {
38859 struct sk_buff *nskb;
38860 int header = skb_headroom(skb);
38861 - int copy = (PAGE_SIZE - sizeof(struct sk_buff) -
38862 - sizeof(struct skb_shared_info) - header - 31)&~15;
38863 + int copy = SKB_MAX_ORDER(header, 0);
38864
38865 /* Too big header? This can happen with IPv6. */
38866 if (copy < 0)
38867 diff -Nur linux-2.4.29/net/netlink/af_netlink.c linux-mips/net/netlink/af_netlink.c
38868 --- linux-2.4.29/net/netlink/af_netlink.c 2005-01-19 15:10:14.000000000 +0100
38869 +++ linux-mips/net/netlink/af_netlink.c 2005-03-26 11:47:39.200218085 +0100
38870 @@ -327,10 +327,11 @@
38871 struct sock **skp;
38872 struct netlink_table *table = &nl_table[sk->protocol];
38873 struct nl_pid_hash *hash = &table->hash;
38874 + u32 pid = nlk_sk(sk)->pid;
38875
38876 netlink_table_grab();
38877 hash->entries--;
38878 - for (skp = hash->table; *skp; skp = &((*skp)->next)) {
38879 + for (skp = nl_pid_hashfn(hash, pid); *skp; skp = &((*skp)->next)) {
38880 if (*skp == sk) {
38881 *skp = sk->next;
38882 __sock_put(sk);
38883 diff -Nur linux-2.4.29/net/netsyms.c linux-mips/net/netsyms.c
38884 --- linux-2.4.29/net/netsyms.c 2005-01-19 15:10:14.000000000 +0100
38885 +++ linux-mips/net/netsyms.c 2005-03-26 11:47:38.458339844 +0100
38886 @@ -287,7 +287,6 @@
38887 EXPORT_SYMBOL(inetdev_by_index);
38888 EXPORT_SYMBOL(in_dev_finish_destroy);
38889 EXPORT_SYMBOL(ip_defrag);
38890 -EXPORT_SYMBOL(ipfrag_flush);
38891
38892 /* Route manipulation */
38893 EXPORT_SYMBOL(ip_rt_ioctl);
38894 diff -Nur linux-2.4.29/net/sched/cls_u32.c linux-mips/net/sched/cls_u32.c
38895 --- linux-2.4.29/net/sched/cls_u32.c 2004-11-17 12:54:22.000000000 +0100
38896 +++ linux-mips/net/sched/cls_u32.c 2005-03-26 11:47:39.202217756 +0100
38897 @@ -70,6 +70,7 @@
38898 {
38899 struct tc_u_hnode *next;
38900 u32 handle;
38901 + u32 prio;
38902 struct tc_u_common *tp_c;
38903 int refcnt;
38904 unsigned divisor;
38905 @@ -271,6 +272,7 @@
38906 root_ht->divisor = 0;
38907 root_ht->refcnt++;
38908 root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000;
38909 + root_ht->prio = tp->prio;
38910
38911 if (tp_c == NULL) {
38912 tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL);
38913 @@ -534,6 +536,7 @@
38914 ht->refcnt = 0;
38915 ht->divisor = divisor;
38916 ht->handle = handle;
38917 + ht->prio = tp->prio;
38918 ht->next = tp_c->hlist;
38919 tp_c->hlist = ht;
38920 *arg = (unsigned long)ht;
38921 @@ -606,6 +609,8 @@
38922 return;
38923
38924 for (ht = tp_c->hlist; ht; ht = ht->next) {
38925 + if (ht->prio != tp->prio)
38926 + continue;
38927 if (arg->count >= arg->skip) {
38928 if (arg->fn(tp, (unsigned long)ht, arg) < 0) {
38929 arg->stop = 1;
38930 diff -Nur linux-2.4.29/net/sched/sch_ingress.c linux-mips/net/sched/sch_ingress.c
38931 --- linux-2.4.29/net/sched/sch_ingress.c 2004-11-17 12:54:22.000000000 +0100
38932 +++ linux-mips/net/sched/sch_ingress.c 2005-03-26 11:47:39.203217592 +0100
38933 @@ -14,6 +14,7 @@
38934 #include <linux/netdevice.h>
38935 #include <linux/rtnetlink.h>
38936 #include <linux/netfilter_ipv4.h>
38937 +#include <linux/netfilter_ipv6.h>
38938 #include <linux/netfilter.h>
38939 #include <linux/smp.h>
38940 #include <net/pkt_sched.h>
38941 @@ -241,6 +242,15 @@
38942 NF_IP_PRI_FILTER + 1
38943 };
38944
38945 +static struct nf_hook_ops ing6_ops =
38946 +{
38947 + { NULL, NULL},
38948 + ing_hook,
38949 + PF_INET6,
38950 + NF_IP6_PRE_ROUTING,
38951 + NF_IP6_PRI_FILTER + 1
38952 +};
38953 +
38954 int ingress_init(struct Qdisc *sch,struct rtattr *opt)
38955 {
38956 struct ingress_qdisc_data *p = PRIV(sch);
38957 @@ -249,8 +259,13 @@
38958 if (nf_register_hook(&ing_ops) < 0) {
38959 printk("ingress qdisc registration error \n");
38960 goto error;
38961 - }
38962 + }
38963 nf_registered++;
38964 + if (nf_register_hook(&ing6_ops) < 0) {
38965 + printk("IPv6 ingress qdisc registration error, " \
38966 + "disabling IPv6 support.\n");
38967 + } else
38968 + nf_registered++;
38969 }
38970
38971 DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
38972 @@ -374,8 +389,11 @@
38973 void cleanup_module(void)
38974 {
38975 unregister_qdisc(&ingress_qdisc_ops);
38976 - if (nf_registered)
38977 + if (nf_registered) {
38978 nf_unregister_hook(&ing_ops);
38979 + if (nf_registered > 1)
38980 + nf_unregister_hook(&ing6_ops);
38981 + }
38982 }
38983 #endif
38984 MODULE_LICENSE("GPL");
38985 diff -Nur linux-2.4.29/net/sched/sch_netem.c linux-mips/net/sched/sch_netem.c
38986 --- linux-2.4.29/net/sched/sch_netem.c 2005-01-19 15:10:14.000000000 +0100
38987 +++ linux-mips/net/sched/sch_netem.c 2005-03-26 11:47:39.283204465 +0100
38988 @@ -180,6 +180,7 @@
38989 if (q->loss && q->loss >= get_crandom(&q->loss_cor)) {
38990 pr_debug("netem_enqueue: random loss\n");
38991 sch->stats.drops++;
38992 + kfree_skb(skb);
38993 return 0; /* lie about loss so TCP doesn't know */
38994 }
38995
38996 diff -Nur linux-2.4.29/net/unix/af_unix.c linux-mips/net/unix/af_unix.c
38997 --- linux-2.4.29/net/unix/af_unix.c 2004-11-17 12:54:22.000000000 +0100
38998 +++ linux-mips/net/unix/af_unix.c 2005-03-26 11:47:39.318198721 +0100
38999 @@ -1686,8 +1686,13 @@
39000 }
39001
39002 spin_lock(&sk->receive_queue.lock);
39003 - if((skb=skb_peek(&sk->receive_queue))!=NULL)
39004 - amount=skb->len;
39005 + if (sk->type == SOCK_STREAM) {
39006 + skb_queue_walk(&sk->receive_queue, skb)
39007 + amount += skb->len;
39008 + } else {
39009 + if((skb=skb_peek(&sk->receive_queue))!=NULL)
39010 + amount=skb->len;
39011 + }
39012 spin_unlock(&sk->receive_queue.lock);
39013 err = put_user(amount, (int *)arg);
39014 break;
39015 diff -Nur linux-2.4.29/scripts/Configure linux-mips/scripts/Configure
39016 --- linux-2.4.29/scripts/Configure 2003-06-13 16:51:39.000000000 +0200
39017 +++ linux-mips/scripts/Configure 2005-03-26 11:47:39.412183296 +0100
39018 @@ -378,15 +378,18 @@
39019 function hex () {
39020 old=$(eval echo "\${$2}")
39021 def=${old:-$3}
39022 - def=${def#*[x,X]}
39023 while :; do
39024 readln "$1 ($2) [$def] " "$def" "$old"
39025 - ans=${ans#*[x,X]}
39026 - if expr "$ans" : '[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
39027 + if expr "$ans" : '0x[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
39028 define_hex "$2" "$ans"
39029 break
39030 else
39031 - help "$2"
39032 + if expr "$ans" : '[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
39033 + define_hex "$2" "0x$ans"
39034 + break
39035 + else
39036 + help "$2"
39037 + fi
39038 fi
39039 done
39040 }
This page took 1.55518 seconds and 5 git commands to generate.