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
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 -------------------------------------------------------------------------- */
16 + if (acpi_skip_timer_override &&
17 + intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
18 + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
22 mp_override_legacy_irq (
24 intsrc->flags.polarity,
29 +#ifdef CONFIG_X86_IOAPIC
33 result = acpi_blacklisted();
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
41 + * Do early PCI probing for bug detection when the main PCI subsystem is
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>
51 +static int __init check_bridge(int vendor, int device)
53 + /* According to Nvidia all timer overrides are bogus. Just ignore
55 + if (vendor == PCI_VENDOR_ID_NVIDIA) {
56 + acpi_skip_timer_override = 1;
61 +void __init check_acpi_pci(void)
65 + /* Assume the machine supports type 1. If not it will
66 + always read ffffffff and should not have any side effect. */
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++) {
74 + class = read_pci_config(num,slot,func,
75 + PCI_CLASS_REVISION);
76 + if (class == 0xffffffff)
79 + if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
82 + vendor = read_pci_config(num, slot, func,
85 + if (check_bridge(vendor&0xffff, vendor >> 16))
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
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
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)
112 - extern int interrupt_line_quirk;
113 + extern int via_interrupt_line_quirk;
114 struct pci_dev *temp_dev;
116 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
117 if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
120 + pin--; /* interrupt pins are numbered starting from 1 */
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))
125 @@ -1134,46 +1136,43 @@
126 if (io_apic_assign_pci_irqs) {
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);
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.
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);
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.
149 + while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
150 + struct pci_dev * bridge = dev->bus->self;
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);
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);
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);
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);
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);
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);
183 + msg = " Probably buggy MP table.";
184 } else if (pci_probe & PCI_BIOS_IRQ_SCAN)
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);
192 /* VIA bridges use interrupt line for apic/pci steering across
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);
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
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
217 __generic_copy_to_user(void *to, const void *from, unsigned long n)
219 + BUG_ON((long) n < 0);
220 if (access_ok(VERIFY_WRITE, to, n))
225 __generic_copy_from_user(void *to, const void *from, unsigned long n)
227 + BUG_ON((long) n < 0);
228 if (access_ok(VERIFY_READ, from, n))
233 __generic_copy_to_user(void *to, const void *from, unsigned long n)
235 + BUG_ON((long) n < 0);
237 if (access_ok(VERIFY_WRITE, to, n))
238 __copy_user(to,from,n);
241 __generic_copy_from_user(void *to, const void *from, unsigned long n)
243 + BUG_ON((long) n < 0);
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
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)
258 unsigned char *workbuf, *wp;
259 unsigned long bufsz, space_avail;
260 @@ -1683,6 +1684,9 @@
263 clen64 = kcmsg32->cmsg_len;
264 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
265 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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;
278 @@ -1856,6 +1861,7 @@
281 cmsg_ptr = (unsigned long)msg_sys.msg_control;
282 + cmsg_len = msg_sys.msg_controllen;
283 msg_sys.msg_flags = 0;
285 if (sock->file->f_flags & O_NONBLOCK)
286 @@ -1882,7 +1888,8 @@
287 * fix it up before we tack on more stuff.
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,
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
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 },
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
362 #include <asm/au1xxx_dbdma.h>
363 #include <asm/system.h>
365 +#include <linux/module.h>
367 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
372 #define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1))
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);
380 -typedef struct dbdma_device_table {
385 - u32 dev_physaddr; /* If FIFO */
387 - u32 dev_intpolarity;
390 -typedef struct dbdma_chan_config {
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 *);
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)
407 static dbdev_tab_t dbdev_tab[] = {
408 #ifdef CONFIG_SOC_AU1550
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 },
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 },
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 },
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 },
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 },
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 },
442 { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
445 { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
446 { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
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 },
467 #define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t))
473 +au1xxx_ddma_add_device(dbdev_tab_t *dev)
476 + dbdev_tab_t *p=NULL;
477 + static u16 new_id=0x1000;
479 + p = find_dbdev_id(0);
482 + memcpy(p, dev, sizeof(dbdev_tab_t));
483 + p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
487 + printk("add_device: id:%x flags:%x padd:%x\n",
488 + p->dev_id, p->dev_flags, p->dev_physaddr );
494 +EXPORT_SYMBOL(au1xxx_ddma_add_device);
496 /* Allocate a channel and return a non-zero descriptor if successful.
501 dbdev_tab_t *stp, *dtp;
503 - volatile au1x_dma_chan_t *cp;
504 + au1x_dma_chan_t *cp;
506 /* We do the intialization on the first channel allocation.
507 * We have to wait because of the interrupt handler initialization
510 dbdma_initialized = 1;
512 - if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS))
515 if ((stp = find_dbdev_id(srcid)) == NULL) return 0;
516 if ((dtp = find_dbdev_id(destid)) == NULL) return 0;
519 /* If kmalloc fails, it is caught below same
520 * as a channel not available.
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;
530 @@ -278,10 +292,11 @@
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;
541 ctp->chan_dest = dtp;
542 ctp->chan_callback = callback;
545 if (dtp->dev_intpolarity)
547 + if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
548 + (dtp->dev_flags & DEV_FLAGS_SYNC))
549 + i |= DDMA_CFG_SYNC;
553 @@ -308,14 +326,14 @@
554 rv = (u32)(&chan_tab_ptr[chan]);
557 - /* Release devices.
559 + /* Release devices */
560 stp->dev_flags &= ~DEV_FLAGS_INUSE;
561 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
566 +EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
568 /* Set the device width if source or destination is a FIFO.
569 * Should be 8, 16, or 32 bits.
574 +EXPORT_SYMBOL(au1xxx_dbdma_set_devwidth);
576 /* Allocate a descriptor ring, initializing as much as possible.
579 * and if we try that first we are likely to not waste larger
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);
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)
596 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
598 /* If source input is fifo, set static address.
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);
606 + src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
609 + if (stp->dev_physaddr)
610 + src0 = stp->dev_physaddr;
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.
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);
622 dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC);
624 + if (dtp->dev_physaddr)
625 + dest0 = dtp->dev_physaddr;
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 );
631 for (i=0; i<entries; i++) {
632 dp->dscr_cmd0 = cmd0;
633 dp->dscr_cmd1 = cmd1;
635 dp->dscr_dest0 = dest0;
636 dp->dscr_dest1 = dest1;
638 + dp->sw_context = dp->sw_status = 0;
639 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
642 @@ -510,13 +544,14 @@
644 return (u32)(ctp->chan_desc_base);
646 +EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
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.
653 -au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
654 +_au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
657 au1x_ddma_desc_t *dp;
658 @@ -543,24 +578,40 @@
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 */
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.
672 ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
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.
681 + dma_cache_wback_inv(buf,nbytes);
682 + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
684 + dma_cache_wback_inv(dp, sizeof(dp));
685 + ctp->chan_ptr->ddma_dbell = 0;
687 /* return something not zero.
691 +EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
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.
698 -au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
699 +_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
702 au1x_ddma_desc_t *dp;
703 @@ -582,11 +633,33 @@
704 if (dp->dscr_cmd0 & DSCR_CMD0_V)
707 - /* Load up buffer address and byte count.
709 + /* Load up buffer address and byte count */
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;
717 dp->dscr_dest0 = virt_to_phys(buf);
718 dp->dscr_cmd1 = nbytes;
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 );
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.
731 + dma_cache_inv(buf,nbytes);
732 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
734 + dma_cache_wback_inv(dp, sizeof(dp));
735 + ctp->chan_ptr->ddma_dbell = 0;
737 /* Get next descriptor pointer.
743 +EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
745 /* Get a destination buffer into the DMA ring.
746 * Normally used to get a full buffer from the ring during fifo
748 au1xxx_dbdma_stop(u32 chanid)
751 - volatile au1x_dma_chan_t *cp;
752 + au1x_dma_chan_t *cp;
753 int halt_timeout = 0;
755 ctp = *((chan_tab_t **)chanid);
757 cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V);
760 +EXPORT_SYMBOL(au1xxx_dbdma_stop);
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)
768 - volatile au1x_dma_chan_t *cp;
769 + au1x_dma_chan_t *cp;
771 ctp = *((chan_tab_t **)chanid);
774 cp->ddma_desptr = virt_to_phys(ctp->cur_ptr);
775 cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */
777 - cp->ddma_dbell = 0xffffffff; /* Make it go */
778 + cp->ddma_dbell = 0;
781 +EXPORT_SYMBOL(au1xxx_dbdma_start);
784 au1xxx_dbdma_reset(u32 chanid)
785 @@ -703,15 +778,21 @@
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.
794 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
795 } while (dp != ctp->chan_desc_base);
797 +EXPORT_SYMBOL(au1xxx_dbdma_reset);
800 au1xxx_get_dma_residue(u32 chanid)
803 - volatile au1x_dma_chan_t *cp;
804 + au1x_dma_chan_t *cp;
807 ctp = *((chan_tab_t **)chanid);
808 @@ -746,15 +827,16 @@
812 +EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
815 dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
818 + u32 intstat, flags;
821 au1x_ddma_desc_t *dp;
822 - volatile au1x_dma_chan_t *cp;
823 + au1x_dma_chan_t *cp;
825 intstat = dbdma_gptr->ddma_intstat;
827 @@ -773,18 +855,26 @@
828 (ctp->chan_callback)(irq, ctp->chan_callparam, regs);
830 ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
835 -au1xxx_dbdma_init(void)
836 +static void au1xxx_dbdma_init(void)
840 dbdma_gptr->ddma_config = 0;
841 dbdma_gptr->ddma_throttle = 0;
842 dbdma_gptr->ddma_inten = 0xffff;
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;
851 + #error Unknown Au1x00 SOC
854 + if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
855 "Au1xxx dbdma", (void *)dbdma_gptr))
856 printk("Can't get 1550 dbdma irq");
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;
866 ctp = *((chan_tab_t **)chanid);
868 @@ -820,15 +911,64 @@
869 dp = ctp->chan_desc_base;
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);
888 +/* Put a descriptor into the DMA ring.
889 + * This updates the source/destination pointers and byte count.
892 +au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr )
895 + au1x_ddma_desc_t *dp;
898 + /* I guess we could check this to be within the
899 + * range of the table......
901 + ctp = *((chan_tab_t **)chanid);
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.
909 + /* If the descriptor is valid, we are way ahead of the DMA
910 + * engine, so just return an error condition.
912 + if (dp->dscr_cmd0 & DSCR_CMD0_V)
915 + /* Load up buffer addresses and byte count.
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;
928 + /* Get next descriptor pointer.
930 + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
932 + /* return something not zero.
937 #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
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
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.
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.
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.
965 +#include <asm/au1000.h>
966 +#include <asm/au1xxx_gpio.h>
969 +#if !defined(CONFIG_SOC_AU1000)
970 +static AU1X00_GPIO2 * const gpio2 = (AU1X00_GPIO2 *)GPIO2_BASE;
972 +#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
974 +int au1xxx_gpio2_read(int signal)
977 +/* gpio2->dir &= ~(0x01 << signal); //Set GPIO to input */
978 + return ((gpio2->pinstate >> signal) & 0x01);
981 +void au1xxx_gpio2_write(int signal, int value)
985 + gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << signal) |
989 +void au1xxx_gpio2_tristate(int signal)
992 + gpio2->dir &= ~(0x01 << signal); /* Set GPIO to input */
996 +int au1xxx_gpio1_read(int signal)
998 +/* gpio1->trioutclr |= (0x01 << signal); */
999 + return ((gpio1->pinstaterd >> signal) & 0x01);
1002 +void au1xxx_gpio1_write(int signal, int value)
1005 + gpio1->outputset = (0x01 << signal);
1007 + gpio1->outputclr = (0x01 << signal); /* Output a Zero */
1010 +void au1xxx_gpio1_tristate(int signal)
1012 + gpio1->trioutclr = (0x01 << signal); /* Tristate signal */
1016 +int au1xxx_gpio_read(int signal)
1019 +#if defined(CONFIG_SOC_AU1000)
1022 + return au1xxx_gpio2_read(signal);
1025 + return au1xxx_gpio1_read(signal);
1028 +void au1xxx_gpio_write(int signal, int value)
1031 +#if defined(CONFIG_SOC_AU1000)
1034 + au1xxx_gpio2_write(signal, value);
1037 + au1xxx_gpio1_write(signal, value);
1040 +void au1xxx_gpio_tristate(int signal)
1043 +#if defined(CONFIG_SOC_AU1000)
1046 + au1xxx_gpio2_tristate(signal);
1049 + au1xxx_gpio1_tristate(signal);
1052 +void au1xxx_gpio1_set_inputs(void)
1054 + gpio1->pininputen = 0;
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 @@
1068 -void startup_match20_interrupt(void)
1069 +void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *))
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 :(
1076 + Give it a bogus "action" pointer -- this will keep it from
1077 + getting auto-probed!
1079 + By setting the status to match that of request_irq() we
1080 + can avoid it. --cgray
1082 + action.dev_id = handler;
1085 + action.name = "Au1xxx TOY";
1086 + action.handler = handler;
1087 + action.next = NULL;
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);
1093 local_enable_irq(AU1000_TOY_MATCH2_INT);
1098 if (!intc0_req0) return;
1100 +#ifdef AU1000_USB_DEV_REQ_INT
1102 * Because of the tight timing of SETUP token to reply
1103 * transactions, the USB devices-side packet complete
1105 do_IRQ(AU1000_USB_DEV_REQ_INT, regs);
1110 irq = au_ffs(intc0_req0) - 1;
1111 intc0_req0 &= ~(1<<irq);
1112 @@ -536,17 +560,7 @@
1114 irq = au_ffs(intc0_req1) - 1;
1115 intc0_req1 &= ~(1<<irq);
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);
1125 - do_IRQ(irq, regs);
1127 + do_IRQ(irq, regs);
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
1135 export-objs = prom.o clocks.o power.o usbdev.o
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
1141 -export-objs += dma.o dbdma.o
1142 +export-objs += dma.o dbdma.o gpio.o
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
1151 #ifdef CONFIG_NONCOHERENT_IO
1153 - * Set the NC bit in controller for pre-AC silicon
1154 + * Set the NC bit in controller for Au1500 pre-AC silicon
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");
1162 printk("Non-coherent PCI accesses enabled\n");
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
1169 static int config_access(unsigned char access_type, struct pci_dev *dev,
1170 unsigned char where, u32 * data)
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;
1177 unsigned long offset, status;
1178 unsigned long cfg_base;
1179 unsigned long flags;
1180 - int error = PCIBIOS_SUCCESSFUL;
1181 unsigned long entryLo0, entryLo1;
1185 last_entryLo0 = last_entryLo1 = 0xffffffff;
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.
1194 if (board_pci_idsel) {
1195 if (board_pci_idsel(device, 1) == 0) {
1196 @@ -271,8 +270,11 @@
1199 local_irq_restore(flags);
1202 + /* Fake out Config space access with no responder */
1203 + *data = 0xFFFFFFFF;
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
1214 static void calibrate_delay(void);
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);
1221 sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK);
1222 sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL);
1224 +#ifndef CONFIG_SOC_AU1200
1225 /* Shutdown USB host/device.
1227 sleep_usbhost_enable = au_readl(USB_HOST_CONFIG);
1230 sleep_usbdev_enable = au_readl(USBD_ENABLE);
1231 au_writel(0, USBD_ENABLE); au_sync();
1234 /* Save interrupt controller state.
1236 @@ -212,14 +213,12 @@
1239 unsigned long wakeup, flags;
1240 - extern void save_and_sleep(void);
1241 + extern unsigned int save_and_sleep(void);
1243 spin_lock_irqsave(&pm_lock,flags);
1247 - flush_cache_all();
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.
1258 au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
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 */
1266 - /* For testing, allow match20 to wake us up.
1268 + /* For testing, allow match20 to wake us up. */
1269 #ifdef SLEEP_TEST_TIMEOUT
1270 wakeup_counter0_set(sleep_ticks);
1272 wakeup = 1 << 8; /* turn on match20 wakeup */
1275 - au_writel(1, SYS_WAKESRC); /* clear cause */
1276 + au_writel(0, SYS_WAKESRC); /* clear cause */
1278 au_writel(wakeup, SYS_WAKEMSK);
1281 + DPRINTK("Entering sleep!\n");
1284 /* after a wakeup, the cpu vectors back to 0x1fc00000 so
1287 restore_core_regs();
1288 spin_unlock_irqrestore(&pm_lock, flags);
1289 + DPRINTK("Leaving sleep!\n");
1299 retval = pm_send_all(PM_RESUME, (void *) 0);
1301 @@ -312,120 +310,9 @@
1305 -static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
1306 - void *buffer, size_t * len)
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,
1316 - unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
1318 - spin_lock_irqsave(&pm_lock, flags);
1322 - /* Parse the new frequency */
1323 - if (*len > TMPBUFLEN - 1) {
1324 - spin_unlock_irqrestore(&pm_lock, flags);
1327 - if (copy_from_user(buf, buffer, *len)) {
1328 - spin_unlock_irqrestore(&pm_lock, flags);
1333 - val = simple_strtoul(p, &p, 0);
1334 - if (val > MAX_CPU_FREQ) {
1335 - spin_unlock_irqrestore(&pm_lock, flags);
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);
1346 - old_baud_base = get_au1x00_uart_baud_base();
1347 - old_cpu_freq = get_au1x00_speed();
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);
1354 - old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
1356 - ((old_refresh * new_cpu_freq) /
1357 - old_cpu_freq) | (au_readl(MEM_SDREFCFG) & ~0x1ffffff);
1359 - au_writel(pll, SYS_CPUPLL);
1361 - au_writel(new_refresh, MEM_SDREFCFG);
1364 - for (i = 0; i < 4; i++) {
1366 - (UART_BASE + UART_MOD_CNTRL +
1367 - i * 0x00100000) == 3) {
1369 - au_readl(UART_BASE + UART_CLK +
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.
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;
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 +
1394 - au_sync_delay(10);
1400 - /* We don't want _any_ interrupts other than
1401 - * match20. Otherwise our calibrate_delay()
1402 - * calculation will be off, potentially a lot.
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);
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},
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
1426 #include <asm/system.h>
1427 #include <asm/au1000.h>
1429 -extern int au_sleep(void);
1431 void au1000_restart(char *command)
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 */
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 */
1461 @@ -163,32 +181,23 @@
1463 void au1000_halt(void)
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);
1470 - while(1); /* should not get here */
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);
1479 - /* should not get here */
1480 - printk(KERN_ERR "Unable to put cpu in sleep mode\n");
1484 + /* Use WAIT in a low-power infinite spin loop */
1486 __asm__(".set\tmips3\n\t"
1493 void au1000_power_off(void)
1495 + extern void board_power_off (void);
1497 + printk(KERN_NOTICE "\n** You can safely turn off the power\n");
1499 + /* Give board a chance to power-off */
1500 + board_power_off();
1502 + /* If board can't power-off, spin forever */
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;
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);
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
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 */
1533 +#else /* CONFIG_USB_EHCI_HCD */
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
1543 +#endif /* CONFIG_USB_EHCI_HCD */
1544 +#endif /* CONFIG_SOC_AU1200 */
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 @@
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
1561 + /* enable OHC clocks, memory and bus mastering */
1562 + au_writel( 0x00D12003, USB_MSR_BASE + 4);
1565 +printk("DEBUG: Reading Au1200 USB2 reg 0x%x\n", au_readl(USB_MSR_BASE + 4));
1568 + /* Au1000, Au1500, Au1100, Au1550 */
1569 + /* enable host controller and wait for reset done */
1570 au_writel(0x08, USB_HOST_CONFIG);
1572 au_writel(0x0E, USB_HOST_CONFIG);
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 */
1580 -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
1583 +#endif /* defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) */
1587 - // Needed if PCI video card in use
1588 + /* Needed if PCI video card in use */
1589 conswitchp = &dummy_con;
1595 #ifdef CONFIG_BLK_DEV_IDE
1596 - /* Board setup takes precedence for unique devices.
1598 + /* Board setup takes precedence for unique devices. */
1599 if ((ide_ops == NULL) || (ide_ops == &no_ide_ops))
1600 ide_ops = &std_ide_ops;
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
1606 #include <asm/addrspace.h>
1607 #include <asm/regdef.h>
1608 #include <asm/stackframe.h>
1609 +#include <asm/au1000.h>
1612 + * Note: This file is *not* conditional on CONFIG_PM since Alchemy sleep
1613 + * need not be tied to any particular power management scheme.
1616 + .extern ___flush_cache_all
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.
1626 + * Save the processor general registers and go to sleep. A wakeup
1627 + * condition will get us back here to restore the registers.
1629 -LEAF(save_and_sleep)
1631 +/* still need to fix alignment issues here */
1632 +save_and_sleep_frmsz = 48
1633 +NESTED(save_and_sleep, save_and_sleep_frmsz, ra)
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)
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.
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)
1678 - sw $24, PT_R24(sp)
1679 - sw $25, PT_R25(sp)
1680 - sw $26, PT_R26(sp)
1681 - sw $27, PT_R27(sp)
1683 - sw $29, PT_R29(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
1692 + sw k0, PT_C0STATUS(sp) // 0x20
1693 mfc0 k0, CP0_CONTEXT
1695 + sw k0, PT_CONTEXT(sp) // 0x1c
1696 mfc0 k0, CP0_PAGEMASK
1698 + sw k0, PT_PAGEMASK(sp) // 0x18
1701 + sw k0, PT_CONFIG(sp) // 0x14
1707 + sw zero, 0(t0) /* Get the processor ready to sleep */
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
1715 + li t0, SYS_SCRATCH0
1716 + li t1, SYS_SCRATCH1
1718 + la k0, resume_from_sleep
1722 + * Flush DCACHE to make sure context is in memory
1730 + la t1,___flush_cache_all /* _flush_cache_all is a function pointer */
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 @@
1741 + /* Put SDRAM to sleep */
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 */
1757 - sw zero, 0x0078(k1) /* get ready to sleep */
1759 +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
1760 + sw zero, MEM_SDPRECMD(a0) /* Precharge */
1761 + sw zero, MEM_SDSREF(a0)
1763 + #lw t0, MEM_SDSTAT(a0)
1764 + #and t0, t0, 0x01000000
1767 + lw t1, MEM_SDSTAT(a0)
1769 + beq zero, t2, refresh_not_set
1772 + li t0, ~0x30000000
1773 + lw t1, MEM_SDCONFIGA(a0)
1775 + sw t1, MEM_SDCONFIGA(a0)
1777 - sw zero, 0x007c(k1) /* Put processor to sleep */
1781 + sw zero, 0(t0) /* Put processor to sleep */
1793 /* This is where we return upon wakeup.
1794 * Reload all of the registers and return.
1803 + lw k0, PT_C0STATUS(sp) // 0x20
1806 + lw k0, PT_CONTEXT(sp) // 0x1c
1807 mtc0 k0, CP0_CONTEXT
1809 + lw k0, PT_PAGEMASK(sp) // 0x18
1810 mtc0 k0, CP0_PAGEMASK
1812 + lw k0, PT_CONFIG(sp) // 0x14
1816 @@ -120,14 +193,6 @@
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)
1831 @@ -136,15 +201,36 @@
1835 - lw $24, PT_R24(sp)
1836 - lw $25, PT_R25(sp)
1837 - lw $26, PT_R26(sp)
1838 - lw $27, PT_R27(sp)
1840 - lw $29, PT_R29(sp)
1847 + /* clear the wake source, but save it as the return value of the function */
1848 + li t0, SYS_WAKESRC
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)
1867 + addu sp, save_and_sleep_frmsz
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
1877 #include <linux/mc146818rtc.h>
1878 #include <linux/timex.h>
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;
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;
1894 au_writel(0, SYS_TOYWRITE);
1895 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
1897 - au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
1898 - au_writel(~0, SYS_WAKESRC);
1900 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
1902 /* setup match20 to interrupt once every 10ms */
1904 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
1906 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
1907 - startup_match20_interrupt();
1908 + startup_match20_interrupt(counter0_irq);
1910 do_gettimeoffset = do_fast_pm_gettimeoffset;
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
1916 #include <asm/au1000.h>
1917 #include <asm/db1x00.h>
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;
1929 +chan_tab_t *ide_read_ch, *ide_write_ch;
1930 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
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 */
1935 -/* not correct for db1550 */
1936 -static BCSR * const bcsr = (BCSR *)0xAE000000;
1937 +extern struct rtc_ops no_rtc_ops;
1939 void board_reset (void)
1942 au_writel(0x00000000, 0xAE00001C);
1945 +void board_power_off (void)
1947 +#ifdef CONFIG_MIPS_MIRAGE
1948 + au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
1952 void __init board_setup(void)
1955 @@ -108,8 +127,42 @@
1956 au_writel(0x02000200, GPIO2_OUTPUT);
1959 +#if defined(CONFIG_AU1XXX_SMC91111)
1960 +#define CPLD_CONTROL (0xAF00000C)
1962 + extern uint32_t au1xxx_smc91111_base;
1963 + extern unsigned int au1xxx_smc91111_irq;
1964 + extern int au1xxx_smc91111_nowait;
1966 + au1xxx_smc91111_base = 0xAC000300;
1967 + au1xxx_smc91111_irq = AU1000_GPIO_8;
1968 + au1xxx_smc91111_nowait = 1;
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);
1976 +#endif /* end CONFIG_SMC91111 */
1979 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
1981 + * Iniz IDE parameters
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);
1989 + * change PIO or PIO+Ddma
1990 + * check the GPIO-6 pin condition. db1550:s6_dot
1992 + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
1995 #ifdef CONFIG_MIPS_DB1000
1996 printk("AMD Alchemy Au1000/Db1000 Board\n");
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
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#
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
2013 obj-y := init.o board_setup.o irqmap.o
2014 obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
2016 +ifdef CONFIG_MIPS_DB1100
2018 +obj-y += mmc_support.o
2019 +export-objs += mmc_support.o
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
2029 + * BRIEF MODULE DESCRIPTION
2031 + * MMC support routines for DB1100.
2034 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
2035 + * Author: Embedded Edge, LLC.
2036 + * Contact: dan@embeddededge.com
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.
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.
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.
2061 +#include <linux/config.h>
2062 +#include <linux/kernel.h>
2063 +#include <linux/module.h>
2064 +#include <linux/init.h>
2066 +#include <asm/irq.h>
2067 +#include <asm/au1000.h>
2068 +#include <asm/au1100_mmc.h>
2069 +#include <asm/db1x00.h>
2072 +/* SD/MMC controller support functions */
2077 +void mmc_card_inserted(int _n_, int *_res_)
2079 + u32 gpios = au_readl(SYS_PINSTATERD);
2080 + u32 emptybit = (_n_) ? (1<<20) : (1<<19);
2081 + *_res_ = ((gpios & emptybit) == 0);
2085 + * Check card write protection.
2087 +void mmc_card_writable(int _n_, int *_res_)
2089 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2090 + unsigned long mmc_wp, board_specific;
2093 + mmc_wp = BCSR_BOARD_SD1_WP;
2095 + mmc_wp = BCSR_BOARD_SD0_WP;
2098 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2100 + if (!(board_specific & mmc_wp)) {/* low means card writable */
2108 + * Apply power to card slot.
2110 +void mmc_power_on(int _n_)
2112 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2113 + unsigned long mmc_pwr, board_specific;
2116 + mmc_pwr = BCSR_BOARD_SD1_PWR;
2118 + mmc_pwr = BCSR_BOARD_SD0_PWR;
2121 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2122 + board_specific |= mmc_pwr;
2124 + au_writel(board_specific, (int)(&bcsr->specific));
2129 + * Remove power from card slot.
2131 +void mmc_power_off(int _n_)
2133 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
2134 + unsigned long mmc_pwr, board_specific;
2137 + mmc_pwr = BCSR_BOARD_SD1_PWR;
2139 + mmc_pwr = BCSR_BOARD_SD0_PWR;
2142 + board_specific = au_readl((unsigned long)(&bcsr->specific));
2143 + board_specific &= ~mmc_pwr;
2145 + au_writel(board_specific, (int)(&bcsr->specific));
2149 +EXPORT_SYMBOL(mmc_card_inserted);
2150 +EXPORT_SYMBOL(mmc_card_writable);
2151 +EXPORT_SYMBOL(mmc_power_on);
2152 +EXPORT_SYMBOL(mmc_power_off);
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
2158 +/* ----------------------------------------------------------------------
2161 + * Copyright (C) 2003 Intrinsyc Software Inc.
2163 + * Intel Personal Media Player buttons
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.
2169 + * May 02, 2003 : Initial version [FB]
2171 + ------------------------------------------------------------------------*/
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>
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>
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"
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)
2205 +#define BUTTON_MASK (\
2215 +#define BUTTON_INVERT (\
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};
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};
2231 +#define BUTTON_COUNT (sizeof (button_map) / sizeof (button_map[0]))
2233 +struct input_dev dev;
2234 +struct timeval cur_tv;
2236 +static unsigned int old_tv_usec = 0;
2238 +static unsigned int read_button_state(void)
2240 + unsigned int state;
2242 + state = au_readl(SYS_PINSTATERD) & BUTTON_MASK; /* get gpio status */
2244 + state ^= BUTTON_INVERT; /* invert main & guide button */
2246 + /* printk("au1200_ibutton.c: button state [0x%X]\r\n",state); */
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()
2254 + unsigned int elapsed_time;
2256 + do_gettimeofday (&cur_tv);
2258 + if (!old_tv_usec) {
2259 + old_tv_usec = cur_tv.tv_usec;
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));
2268 + /* Accounting for rollover */
2269 + elapsed_time = ((1000000 - old_tv_usec + cur_tv.tv_usec));
2272 + if (elapsed_time > 250000) {
2273 + old_tv_usec = 0; /* reset the bounce time */
2280 +/* button interrupt handler */
2281 +static void button_interrupt(int irq, void *dev, struct pt_regs *regs)
2284 + unsigned int i,bit_mask, key_choice;
2287 + /* Report state to upper level */
2289 + button_state = read_button_state() & BUTTON_MASK; /* get new gpio status */
2291 + /* Return if this is a repeated (bouncing) event */
2295 + /* we want to make keystrokes */
2296 + for( i=0; i< BUTTON_COUNT; 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
2316 +button_translate(unsigned char scancode, unsigned char *keycode, char raw_mode)
2318 + static int prev_scancode;
2320 + printk( "ibutton.c: translate: scancode=%x raw_mode=%x\n",
2321 + scancode, raw_mode);
2323 + if (scancode == 0xe0 || scancode == 0xe1) {
2324 + prev_scancode = scancode;
2328 + if (scancode == 0x00 || scancode == 0xff) {
2329 + prev_scancode = 0;
2333 + *keycode = scancode;
2338 +/* init button hardware */
2339 +static int button_hw_init(void)
2341 + unsigned int ipinfunc=0;
2343 + printk("au1200_ibutton.c: Initializing buttons hardware\n");
2345 + // initialize GPIO pin function assignments
2347 + ipinfunc = au_readl(SYS_PINFUNC);
2349 + ipinfunc &= ~(SYS_PINFUNC_DMA | SYS_PINFUNC_S0A | SYS_PINFUNC_S0B);
2350 + au_writel( ipinfunc ,SYS_PINFUNC);
2352 + ipinfunc |= (SYS_PINFUNC_S0C);
2353 + au_writel( ipinfunc ,SYS_PINFUNC);
2358 +/* button driver init */
2359 +static int __init button_init(void)
2362 + unsigned int flag=0;
2364 + printk("au1200_ibutton.c: button_init()\r\n");
2368 + /* register all button irq handler */
2370 + for(i=0; i< sizeof(button_map)/sizeof(button_map[0]); i++)
2372 + /* register irq <-- gpio 1 ,6 ,12 , 17 ,19 , 26 ,28 */
2373 + if(button_map[i] != 0)
2375 + ret = request_irq(AU1000_GPIO_0 + i ,
2376 + &button_interrupt , SA_INTERRUPT ,
2377 + DRIVER_NAME , &dev);
2378 + if(ret) flag |= 1<<i;
2382 + printk("au1200_ibutton.c: request_irq,ret:0x%x\r\n",ret);
2385 + printk("au1200_ibutton.c: request_irq:%X failed\r\n",flag);
2389 + dev.name = DRIVER_NAME;
2390 + dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
2392 + for (i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
2394 + dev.keybit[LONG(button_map[i])] |= BIT(button_map[i]);
2397 + input_register_device(&dev);
2399 + /* ready to receive interrupts */
2404 +/* button driver exit */
2405 +static void __exit button_exit(void)
2409 + for(i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
2411 + if(button_map[i] != 0)
2413 + free_irq( AU1000_GPIO_0 + i, &dev);
2417 + input_unregister_device(&dev);
2419 + printk("au1200_ibutton.c: button_exit()\r\n");
2422 +module_init(button_init);
2423 +module_exit(button_exit);
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
2433 + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
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.
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>
2453 +#if defined(CONFIG_MIPS_FICMMP)
2454 + #define DOCK_GPIO 215
2456 + #error Unsupported Au1xxx Platform
2459 +#define MAKE_FLAG 0x20
2467 +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
2469 +#define DPRINTK(format, args...) do { } while (0)
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.
2477 +struct au1xxx_dock {
2478 + struct fasync_struct *fasync;
2479 + wait_queue_head_t read_wait;
2481 + unsigned int debounce;
2482 + unsigned int current;
2483 + unsigned int last;
2486 +static struct au1xxx_dock dock_info;
2489 +static void dock_timer_periodic(void *data);
2491 +static struct tq_struct dock_task = {
2492 + routine: dock_timer_periodic,
2496 +static int cleanup_flag = 0;
2497 +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
2500 +static unsigned int read_dock_state(void)
2504 + state = au1xxx_gpio_read(DOCK_GPIO);
2506 + /* printk( "Current Dock State: %d\n", state ); */
2512 +static void dock_timer_periodic(void *data)
2514 + struct au1xxx_dock *dock = (struct au1xxx_dock *)data;
2515 + unsigned long dock_state;
2517 + /* If cleanup wants us to die */
2518 + if (cleanup_flag) {
2519 + /* now cleanup_module can return */
2520 + wake_up(&cleanup_wait_queue);
2522 + /* put ourselves back in the task queue */
2523 + queue_task(&dock_task, &tq_timer);
2526 + /* read current dock */
2527 + dock_state = read_dock_state();
2529 + /* if dock states hasn't changed */
2530 + /* save time and be done. */
2531 + if (dock_state == dock->current) {
2535 + if (dock_state == dock->debounce) {
2536 + dock->current = dock_state;
2538 + dock->debounce = dock_state;
2540 + if (dock->current != dock->last) {
2541 + if (waitqueue_active(&dock->read_wait)) {
2542 + wake_up_interruptible(&dock->read_wait);
2548 +static ssize_t au1xxx_dock_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
2550 + struct au1xxx_dock *dock = filp->private_data;
2558 + while (dock->current == dock->last) {
2559 + if (filp->f_flags & O_NONBLOCK) {
2562 + interruptible_sleep_on(&dock->read_wait);
2563 + if (signal_pending(current)) {
2564 + return -ERESTARTSYS;
2568 + cur = dock->current;
2569 + last = dock->last;
2573 + event[0] = cur ? 'D' : 'U';
2581 + err = copy_to_user(buffer, &event, 3);
2590 +static int au1xxx_dock_open(struct inode *inode, struct file *filp)
2592 + struct au1xxx_dock *dock = &dock_info;
2594 + MOD_INC_USE_COUNT;
2596 + filp->private_data = dock;
2598 + if (dock->open_count++ == 0) {
2599 + dock_task.data = dock;
2601 + queue_task(&dock_task, &tq_timer);
2608 +static unsigned int au1xxx_dock_poll(struct file *filp, poll_table *wait)
2610 + struct au1xxx_dock *dock = filp->private_data;
2613 + DPRINTK("start\n");
2614 + poll_wait(filp, &dock->read_wait, wait);
2615 + if (dock->current != dock->last) {
2616 + ret = POLLIN | POLLRDNORM;
2622 +static int au1xxx_dock_release(struct inode *inode, struct file *filp)
2624 + struct au1xxx_dock *dock = filp->private_data;
2626 + DPRINTK("start\n");
2628 + if (--dock->open_count == 0) {
2630 + sleep_on(&cleanup_wait_queue);
2632 + MOD_DEC_USE_COUNT;
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,
2648 + * The au1xxx dock is a misc device:
2650 + * Minor 22 /dev/dock
2652 + * This is /dev/misc/dock if devfs is used.
2655 +static struct miscdevice au1xxx_dock_dev = {
2658 + fops: &au1xxx_dock_fops,
2661 +static int __init au1xxx_dock_init(void)
2663 + struct au1xxx_dock *dock = &dock_info;
2666 + DPRINTK("Initializing dock driver\n");
2667 + dock->open_count = 0;
2669 + init_waitqueue_head(&dock->read_wait);
2672 + /* yamon configures GPIO pins for the dock
2673 + * no initialization needed
2676 + ret = misc_register(&au1xxx_dock_dev);
2678 + DPRINTK("dock driver fully initialized.\n");
2684 +static void __exit au1xxx_dock_exit(void)
2686 + DPRINTK("unloading dock driver\n");
2687 + misc_deregister(&au1xxx_dock_dev);
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
2699 + * BRIEF MODULE DESCRIPTION
2700 + * Alchemy Pb1200 board setup.
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.
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.
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.
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>
2732 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
2733 +#include <linux/ide.h>
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>
2748 +extern struct rtc_ops no_rtc_ops;
2750 +/* value currently in the board configuration register */
2751 +u16 ficmmp_config = 0;
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;
2762 +chan_tab_t *ide_read_ch, *ide_write_ch;
2763 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
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 */
2768 +void board_reset (void)
2770 + au_writel(0, 0xAD80001C);
2773 +void board_power_off (void)
2777 +void __init board_setup(void)
2779 + char *argptr = NULL;
2781 + rtc_ops = &no_rtc_ops;
2783 + ficmmp_config_init(); //Initialize FIC control register
2786 + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
2787 + * but it is board specific code, so put it here.
2789 + pin_func = au_readl(SYS_PINFUNC);
2791 + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
2792 + au_writel(pin_func, SYS_PINFUNC);
2794 + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
2798 +#if defined( CONFIG_I2C_ALGO_AU1550 )
2800 + u32 freq0, clksrc;
2802 + /* Select SMBUS in CPLD */
2803 + /* bcsr->resets &= ~(BCSR_RESETS_PCS0MUX); */
2805 + pin_func = au_readl(SYS_PINFUNC);
2807 + pin_func &= ~(3<<17 | 1<<4);
2808 + /* Set GPIOs correctly */
2809 + pin_func |= 2<<17;
2810 + au_writel(pin_func, SYS_PINFUNC);
2813 + /* The i2c driver depends on 50Mhz clock */
2814 + freq0 = au_readl(SYS_FREQCTRL0);
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);
2821 + freq0 |= SYS_FC_FE1;
2822 + au_writel(freq0, SYS_FREQCTRL0);
2825 + clksrc = au_readl(SYS_CLKSRC);
2827 + clksrc &= ~0x01f00000;
2828 + /* bit 22 is EXTCLK0 for PSC0 */
2829 + clksrc |= (0x3 << 22);
2830 + au_writel(clksrc, SYS_CLKSRC);
2835 +#ifdef CONFIG_FB_AU1200
2836 + argptr = prom_getcmdline();
2837 + strcat(argptr, " video=au1200fb:");
2840 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
2842 + * Iniz IDE parameters
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);
2850 + ide_ops = &au1xxx_ide_ops;
2851 + au1xxx_ide_irq = FICMMP_IDE_INT;
2852 + au1xxx_ide_base = KSEG1ADDR(AU1XXX_ATA_BASE);
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));
2861 + ficmmp_config_clear(FICMMP_CONFIG_IDERST);
2863 + ficmmp_config_set(FICMMP_CONFIG_IDERST);
2867 + * change PIO or PIO+Ddma
2868 + * check the GPIO-5 pin condition. pb1200:s18_dot
2870 +/* switch4ddma = 0; //(au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0; */
2873 + /* The Pb1200 development board uses external MUX for PSC0 to
2874 + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
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);
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));
2893 +board_au1200fb_panel (void)
2895 + au1xxx_gpio_tristate(6);
2897 + if (au1xxx_gpio_read(12) == 0)
2898 + return 9; /* FS453_640x480 (Composite/S-Video) */
2900 + return 7; /* Sharp 320x240 TFT */
2904 +board_au1200fb_panel_init (void)
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);
2914 +board_au1200fb_panel_shutdown (void)
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);
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
2929 + * BRIEF MODULE DESCRIPTION
2930 + * PB1200 board setup
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.
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.
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.
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>
2965 +char **prom_argv, **prom_envp;
2966 +extern void __init prom_init_cmdline(void);
2967 +extern char *prom_getenv(char *envname);
2969 +const char *get_system_type(void)
2971 + return "FIC Multimedia Player (Au1200)";
2974 +u32 mae_memsize = 0;
2976 +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
2978 + unsigned char *memsize_str;
2979 + unsigned long memsize;
2985 + mips_machgroup = MACH_GROUP_ALCHEMY;
2986 + mips_machtype = MACH_PB1000; /* set the platform # */
2987 + prom_init_cmdline();
2989 + memsize_str = prom_getenv("memsize");
2990 + if (!memsize_str) {
2991 + memsize = 0x08000000;
2993 + memsize = simple_strtol(memsize_str, NULL, 0);
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 */
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
3008 + * BRIEF MODULE DESCRIPTION
3009 + * Au1xxx irq map table
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.
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.
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.
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>
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>
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
3066 +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
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
3073 +# Copyright 2000 MontaVista Software Inc.
3074 +# Author: MontaVista Software, Inc.
3075 +# ppopov@mvista.com or source@mvista.com
3077 +# Makefile for the Alchemy Semiconductor FIC board.
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).
3084 +USE_STANDARD_AS_RULE := true
3086 +O_TARGET := ficmmp.o
3088 +obj-y := init.o board_setup.o irqmap.o au1200_ibutton.o au1xxx_dock.o
3091 +obj-y += mmc_support.o
3092 +export-objs +=mmc_support.o
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
3104 +void board_power_off (void)
3108 void __init board_setup(void)
3112 rtc_ops = &no_rtc_ops;
3114 + /* Set GPIO14 high to make CD/DAT1 high for MMC to work */
3115 + au_writel(1<<14, SYS_OUTPUTSET);
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
3125 + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
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.
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>
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)
3154 +#define BUTTON_MASK (\
3167 +#define BUTTON_INVERT (\
3181 +#define MAKE_FLAG 0x20
3189 +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
3191 +#define DPRINTK(format, args...) do { } while (0)
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.
3199 +struct hydrogen3_buttons {
3200 + struct fasync_struct *fasync;
3201 + wait_queue_head_t read_wait;
3203 + unsigned int debounce;
3204 + unsigned int current;
3205 + unsigned int last;
3208 +static struct hydrogen3_buttons buttons_info;
3211 +static void button_timer_periodic(void *data);
3213 +static struct tq_struct button_task = {
3214 + routine: button_timer_periodic,
3218 +static int cleanup_flag = 0;
3219 +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
3222 +static unsigned int read_button_state(void)
3224 + unsigned long state;
3226 + state = inl(SYS_PINSTATERD) & BUTTON_MASK;
3227 + state ^= BUTTON_INVERT;
3229 + DPRINTK( "Current Button State: %d\n", state );
3235 +static void button_timer_periodic(void *data)
3237 + struct hydrogen3_buttons *buttons = (struct hydrogen3_buttons *)data;
3238 + unsigned long button_state;
3240 + // If cleanup wants us to die
3241 + if (cleanup_flag) {
3242 + wake_up(&cleanup_wait_queue); // now cleanup_module can return
3244 + queue_task(&button_task, &tq_timer); // put ourselves back in the task queue
3247 + // read current buttons
3248 + button_state = read_button_state();
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)) {
3256 + if (button_state == buttons->debounce) {
3257 + buttons->current = button_state;
3259 + buttons->debounce = button_state;
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);
3270 +static ssize_t hydrogen3_buttons_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
3272 + struct hydrogen3_buttons *buttons = filp->private_data;
3281 + DPRINTK("start\n");
3285 + while (buttons->current == buttons->last) {
3286 + if (filp->f_flags & O_NONBLOCK) {
3289 + interruptible_sleep_on(&buttons->read_wait);
3290 + if (signal_pending(current)) {
3291 + return -ERESTARTSYS;
3295 + cur = buttons->current;
3296 + last = buttons->last;
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';
3306 + events[index] = bit + 'A';
3307 + last &= ~bit_mask;
3314 + buttons->last = last;
3320 + err = copy_to_user(buffer, events, index);
3329 +static int hydrogen3_buttons_open(struct inode *inode, struct file *filp)
3331 + struct hydrogen3_buttons *buttons = &buttons_info;
3333 + DPRINTK("start\n");
3334 + MOD_INC_USE_COUNT;
3336 + filp->private_data = buttons;
3338 + if (buttons->open_count++ == 0) {
3339 + button_task.data = buttons;
3341 + queue_task(&button_task, &tq_timer);
3348 +static unsigned int hydrogen3_buttons_poll(struct file *filp, poll_table *wait)
3350 + struct hydrogen3_buttons *buttons = filp->private_data;
3353 + DPRINTK("start\n");
3354 + poll_wait(filp, &buttons->read_wait, wait);
3355 + if (buttons->current != buttons->last) {
3356 + ret = POLLIN | POLLRDNORM;
3362 +static int hydrogen3_buttons_release(struct inode *inode, struct file *filp)
3364 + struct hydrogen3_buttons *buttons = filp->private_data;
3366 + DPRINTK("start\n");
3368 + if (--buttons->open_count == 0) {
3370 + sleep_on(&cleanup_wait_queue);
3372 + MOD_DEC_USE_COUNT;
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,
3388 + * The hydrogen3 buttons is a misc device:
3390 + * Minor 22 /dev/buttons
3392 + * This is /dev/misc/buttons if devfs is used.
3395 +static struct miscdevice hydrogen3_buttons_dev = {
3398 + fops: &hydrogen3_buttons_fops,
3401 +static int __init hydrogen3_buttons_init(void)
3403 + struct hydrogen3_buttons *buttons = &buttons_info;
3406 + DPRINTK("Initializing buttons driver\n");
3407 + buttons->open_count = 0;
3409 + init_waitqueue_head(&buttons->read_wait);
3412 + // yamon configures GPIO pins for the buttons
3413 + // no initialization needed
3415 + ret = misc_register(&hydrogen3_buttons_dev);
3417 + DPRINTK("Buttons driver fully initialized.\n");
3423 +static void __exit hydrogen3_buttons_exit(void)
3425 + DPRINTK("unloading buttons driver\n");
3426 + misc_deregister(&hydrogen3_buttons_dev);
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
3437 O_TARGET := hydrogen3.o
3439 -obj-y := init.o board_setup.o irqmap.o
3440 +obj-y := init.o board_setup.o irqmap.o buttons.o
3443 +obj-y += mmc_support.o
3444 +export-objs +=mmc_support.o
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
3453 + * BRIEF MODULE DESCRIPTION
3455 + * MMC support routines for Hydrogen3.
3458 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
3459 + * Author: Embedded Edge, LLC.
3460 + * Contact: dan@embeddededge.com
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.
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.
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.
3485 +#include <linux/config.h>
3486 +#include <linux/kernel.h>
3487 +#include <linux/module.h>
3488 +#include <linux/init.h>
3490 +#include <asm/irq.h>
3491 +#include <asm/au1000.h>
3492 +#include <asm/au1100_mmc.h>
3494 +#define GPIO_17_WP 0x20000
3496 +/* SD/MMC controller support functions */
3501 +void mmc_card_inserted(int _n_, int *_res_)
3503 + u32 gpios = au_readl(SYS_PINSTATERD);
3504 + u32 emptybit = (1<<16);
3505 + *_res_ = ((gpios & emptybit) == 0);
3509 + * Check card write protection.
3511 +void mmc_card_writable(int _n_, int *_res_)
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 */
3523 + * Apply power to card slot.
3525 +void mmc_power_on(int _n_)
3530 + * Remove power from card slot.
3532 +void mmc_power_off(int _n_)
3536 +EXPORT_SYMBOL(mmc_card_inserted);
3537 +EXPORT_SYMBOL(mmc_card_writable);
3538 +EXPORT_SYMBOL(mmc_power_on);
3539 +EXPORT_SYMBOL(mmc_power_off);
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
3546 extern struct rtc_ops no_rtc_ops;
3548 +void board_reset (void)
3550 + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
3551 + au_writel(0x00000000, 0xAE00001C);
3554 void __init board_setup(void)
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
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 */
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
3582 +void board_power_off (void)
3586 void __init board_setup(void)
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
3593 au_writel(0x00000000, 0xAE00001C);
3596 +void board_power_off (void)
3600 void __init board_setup(void)
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
3608 obj-y := init.o board_setup.o irqmap.o
3612 +obj-y += mmc_support.o
3613 +export-objs += mmc_support.o
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
3622 + * BRIEF MODULE DESCRIPTION
3624 + * MMC support routines for PB1100.
3627 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
3628 + * Author: Embedded Edge, LLC.
3629 + * Contact: dan@embeddededge.com
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.
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.
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.
3654 +#include <linux/config.h>
3655 +#include <linux/kernel.h>
3656 +#include <linux/module.h>
3657 +#include <linux/init.h>
3659 +#include <asm/irq.h>
3660 +#include <asm/au1000.h>
3661 +#include <asm/au1100_mmc.h>
3662 +#include <asm/pb1100.h>
3665 +/* SD/MMC controller support functions */
3670 +void mmc_card_inserted(int _n_, int *_res_)
3672 + u32 gpios = au_readl(SYS_PINSTATERD);
3673 + u32 emptybit = (_n_) ? (1<<15) : (1<<14);
3674 + *_res_ = ((gpios & emptybit) == 0);
3678 + * Check card write protection.
3680 +void mmc_card_writable(int _n_, int *_res_)
3682 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3683 + unsigned long mmc_wp, board_specific;
3686 + mmc_wp = BCSR_PCMCIA_SD1_WP;
3688 + mmc_wp = BCSR_PCMCIA_SD0_WP;
3691 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3693 + if (!(board_specific & mmc_wp)) {/* low means card writable */
3701 + * Apply power to card slot.
3703 +void mmc_power_on(int _n_)
3705 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3706 + unsigned long mmc_pwr, board_specific;
3709 + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
3711 + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
3714 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3715 + board_specific |= mmc_pwr;
3717 + au_writel(board_specific, (int)(&bcsr->pcmcia));
3722 + * Remove power from card slot.
3724 +void mmc_power_off(int _n_)
3726 + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3727 + unsigned long mmc_pwr, board_specific;
3730 + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
3732 + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
3735 + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
3736 + board_specific &= ~mmc_pwr;
3738 + au_writel(board_specific, (int)(&bcsr->pcmcia));
3742 +EXPORT_SYMBOL(mmc_card_inserted);
3743 +EXPORT_SYMBOL(mmc_card_writable);
3744 +EXPORT_SYMBOL(mmc_power_on);
3745 +EXPORT_SYMBOL(mmc_power_off);
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
3753 + * BRIEF MODULE DESCRIPTION
3754 + * Alchemy Pb1200 board setup.
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.
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.
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.
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>
3785 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
3786 +#include <linux/ide.h>
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>
3799 +#ifdef CONFIG_MIPS_PB1200
3800 +#include <asm/pb1200.h>
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
3809 +extern struct rtc_ops no_rtc_ops;
3811 +extern void _board_init_irq(void);
3812 +extern void (*board_init_irq)(void);
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;
3823 +chan_tab_t *ide_read_ch, *ide_write_ch;
3824 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
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 */
3829 +void board_reset (void)
3834 +void board_power_off (void)
3836 + bcsr->resets = 0xC000;
3839 +void __init board_setup(void)
3841 + char *argptr = NULL;
3843 + rtc_ops = &no_rtc_ops;
3846 + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
3847 + * but it is board specific code, so put it here.
3849 + pin_func = au_readl(SYS_PINFUNC);
3851 + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
3852 + au_writel(pin_func, SYS_PINFUNC);
3854 + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
3858 +#if defined( CONFIG_I2C_ALGO_AU1550 )
3860 + u32 freq0, clksrc;
3862 + /* Select SMBUS in CPLD */
3863 + bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
3865 + pin_func = au_readl(SYS_PINFUNC);
3867 + pin_func &= ~(3<<17 | 1<<4);
3868 + /* Set GPIOs correctly */
3869 + pin_func |= 2<<17;
3870 + au_writel(pin_func, SYS_PINFUNC);
3873 + /* The i2c driver depends on 50Mhz clock */
3874 + freq0 = au_readl(SYS_FREQCTRL0);
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);
3881 + freq0 |= SYS_FC_FE1;
3882 + au_writel(freq0, SYS_FREQCTRL0);
3885 + clksrc = au_readl(SYS_CLKSRC);
3887 + clksrc &= ~0x01f00000;
3888 + /* bit 22 is EXTCLK0 for PSC0 */
3889 + clksrc |= (0x3 << 22);
3890 + au_writel(clksrc, SYS_CLKSRC);
3895 +#ifdef CONFIG_FB_AU1200
3896 + argptr = prom_getcmdline();
3897 + strcat(argptr, " video=au1200fb:");
3900 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
3902 + * Iniz IDE parameters
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);
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;
3914 + /* The Pb1200 development board uses external MUX for PSC0 to
3915 + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
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);
3927 +#ifdef CONFIG_MIPS_PB1200
3928 + printk("AMD Alchemy Pb1200 Board\n");
3930 +#ifdef CONFIG_MIPS_DB1200
3931 + printk("AMD Alchemy Db1200 Board\n");
3934 + /* Setup Pb1200 External Interrupt Controller */
3936 + extern void (*board_init_irq)(void);
3937 + extern void _board_init_irq(void);
3938 + board_init_irq = _board_init_irq;
3943 +board_au1200fb_panel (void)
3945 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3948 + p = bcsr->switches;
3955 +board_au1200fb_panel_init (void)
3958 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3959 + bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
3964 +board_au1200fb_panel_shutdown (void)
3966 + /* Remove power */
3967 + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
3968 + bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
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
3978 + * BRIEF MODULE DESCRIPTION
3979 + * PB1200 board setup
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.
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.
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.
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>
4014 +char **prom_argv, **prom_envp;
4015 +extern void __init prom_init_cmdline(void);
4016 +extern char *prom_getenv(char *envname);
4018 +const char *get_system_type(void)
4020 + return "AMD Alchemy Au1200/Pb1200";
4023 +u32 mae_memsize = 0;
4025 +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
4027 + unsigned char *memsize_str;
4028 + unsigned long memsize;
4034 + mips_machgroup = MACH_GROUP_ALCHEMY;
4035 + mips_machtype = MACH_PB1000; /* set the platform # */
4036 + prom_init_cmdline();
4038 + memsize_str = prom_getenv("memsize");
4039 + if (!memsize_str) {
4040 + memsize = 0x08000000;
4042 + memsize = simple_strtol(memsize_str, NULL, 0);
4044 + add_memory_region(0, memsize, BOOT_MEM_RAM);
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
4053 + * BRIEF MODULE DESCRIPTION
4054 + * Au1xxx irq map table
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.
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.
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.
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>
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>
4098 +#ifdef CONFIG_MIPS_PB1200
4099 +#include <asm/pb1200.h>
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
4108 +au1xxx_irq_map_t au1xxx_irq_map[] = {
4109 + { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade
4112 +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
4115 + * Support for External interrupts on the PbAu1200 Development platform.
4117 +static volatile int pb1200_cascade_en=0;
4119 +void pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
4121 + unsigned short bisr = bcsr->int_status;
4122 + int extirq_nr = 0;
4124 + /* Clear all the edge interrupts. This has no effect on level */
4125 + bcsr->int_status = bisr;
4126 + for( ; bisr; bisr &= (bisr-1) )
4128 + extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
4129 + /* Ack and dispatch IRQ */
4130 + do_IRQ(extirq_nr,regs);
4134 +inline void pb1200_enable_irq(unsigned int irq_nr)
4136 + bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
4137 + bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN);
4140 +inline void pb1200_disable_irq(unsigned int irq_nr)
4142 + bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
4143 + bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
4146 +static unsigned int pb1200_startup_irq( unsigned int irq_nr )
4148 + if (++pb1200_cascade_en == 1)
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)
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");
4175 + pb1200_enable_irq(irq_nr);
4179 +static void pb1200_shutdown_irq( unsigned int irq_nr )
4181 + pb1200_disable_irq(irq_nr);
4182 + if (--pb1200_cascade_en == 0)
4184 + free_irq(AU1000_GPIO_7,&pb1200_cascade_handler );
4189 +static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
4191 + pb1200_disable_irq( irq_nr );
4194 +static void pb1200_end_irq(unsigned int irq_nr)
4196 + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
4197 + pb1200_enable_irq(irq_nr);
4201 +static struct hw_interrupt_type external_irq_type =
4203 +#ifdef CONFIG_MIPS_PB1200
4206 +#ifdef CONFIG_MIPS_DB1200
4209 + pb1200_startup_irq,
4210 + pb1200_shutdown_irq,
4211 + pb1200_enable_irq,
4212 + pb1200_disable_irq,
4213 + pb1200_mask_and_ack_irq,
4218 +void _board_init_irq(void)
4222 + for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
4224 + irq_desc[irq_nr].handler = &external_irq_type;
4225 + pb1200_disable_irq(irq_nr);
4228 + /* GPIO_7 can not be hooked here, so it is hooked upon first
4229 + request of any source attached to the cascade */
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
4237 +# Copyright 2000 MontaVista Software Inc.
4238 +# Author: MontaVista Software, Inc.
4239 +# ppopov@mvista.com or source@mvista.com
4241 +# Makefile for the Alchemy Semiconductor PB1000 board.
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).
4248 +USE_STANDARD_AS_RULE := true
4250 +O_TARGET := pb1200.o
4252 +obj-y := init.o board_setup.o irqmap.o
4255 +obj-y += mmc_support.o
4256 +export-objs +=mmc_support.o
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
4266 + * BRIEF MODULE DESCRIPTION
4268 + * MMC support routines for PB1200.
4271 + * Copyright (c) 2003-2004 Embedded Edge, LLC.
4272 + * Author: Embedded Edge, LLC.
4273 + * Contact: dan@embeddededge.com
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.
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.
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.
4298 +#include <linux/config.h>
4299 +#include <linux/kernel.h>
4300 +#include <linux/module.h>
4301 +#include <linux/init.h>
4303 +#include <asm/irq.h>
4304 +#include <asm/au1000.h>
4305 +#include <asm/au1100_mmc.h>
4307 +#ifdef CONFIG_MIPS_PB1200
4308 +#include <asm/pb1200.h>
4311 +#ifdef CONFIG_MIPS_DB1200
4312 +/* NOTE: DB1200 only has SD0 pinned out and usable */
4313 +#include <asm/db1200.h>
4316 +/* SD/MMC controller support functions */
4321 +void mmc_card_inserted(int socket, int *result)
4326 +#ifdef CONFIG_MIPS_DB1200
4329 + mask = BCSR_INT_SD1INSERT;
4332 + mask = BCSR_INT_SD0INSERT;
4334 + *result = ((bcsr->sig_status & mask) != 0);
4338 + * Check card write protection.
4340 +void mmc_card_writable(int socket, int *result)
4345 +#ifdef CONFIG_MIPS_DB1200
4348 + mask = BCSR_STATUS_SD1WP;
4351 + mask = BCSR_STATUS_SD0WP;
4353 + /* low means card writable */
4354 + if (!(bcsr->status & mask)) {
4362 + * Apply power to card slot.
4364 +void mmc_power_on(int socket)
4369 +#ifdef CONFIG_MIPS_DB1200
4372 + mask = BCSR_BOARD_SD1PWR;
4375 + mask = BCSR_BOARD_SD0PWR;
4377 + bcsr->board |= mask;
4382 + * Remove power from card slot.
4384 +void mmc_power_off(int socket)
4389 +#ifdef CONFIG_MIPS_DB1200
4392 + mask = BCSR_BOARD_SD1PWR;
4395 + mask = BCSR_BOARD_SD0PWR;
4397 + bcsr->board &= ~mask;
4401 +EXPORT_SYMBOL(mmc_card_inserted);
4402 +EXPORT_SYMBOL(mmc_card_writable);
4403 +EXPORT_SYMBOL(mmc_power_on);
4404 +EXPORT_SYMBOL(mmc_power_off);
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
4410 au_writel(0x00000000, 0xAE00001C);
4413 +void board_power_off (void)
4417 void __init board_setup(void)
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
4425 extern struct rtc_ops no_rtc_ops;
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;
4434 +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
4435 +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
4437 void board_reset (void)
4439 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
4440 au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
4443 +void board_power_off (void)
4445 + /* power off system */
4446 + printk("\n** Powering off Pb1550\n");
4447 + au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
4449 + while(1); /* should not get here */
4452 void __init board_setup(void)
4456 au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
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."
4463 +#define CPLD_CONTROL (0xAF00000C)
4465 + /* set up the Static Bus timing */
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);
4474 +#endif /* end CONFIG_SMC91111 */
4476 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
4478 + * Iniz IDE parameters
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);
4485 + * change PIO or PIO+Ddma
4486 + * check the GPIO-6 pin condition. pb1550:s15_dot
4488 + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
4490 printk("AMD Alchemy Pb1550 Board\n");
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
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 },
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
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
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
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
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
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
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
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
4573 @@ -290,18 +311,24 @@
4574 define_bool CONFIG_NONCOHERENT_IO y
4575 define_bool CONFIG_PC_KEYB y
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
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
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
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
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
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
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 @@
4643 # CONFIG_IPX is not set
4644 # CONFIG_ATALK is not set
4647 -# Appletalk devices
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
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
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
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 @@
4688 # CONFIG_IPX is not set
4689 # CONFIG_ATALK is not set
4692 -# Appletalk devices
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
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
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
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
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
4743 # Disk-On-Chip Device Drivers
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 @@
4751 # CONFIG_IPX is not set
4752 # CONFIG_ATALK is not set
4755 -# Appletalk devices
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
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
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
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 @@
4796 # CONFIG_IPX is not set
4797 # CONFIG_ATALK is not set
4800 -# Appletalk devices
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
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
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 @@
4829 # CONFIG_IPX is not set
4830 # CONFIG_ATALK is not set
4833 -# Appletalk devices
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
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
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
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 @@
4862 # CONFIG_IPX is not set
4863 # CONFIG_ATALK is not set
4866 -# Appletalk devices
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
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
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
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
4907 # Disk-On-Chip Device Drivers
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 @@
4915 # CONFIG_IPX is not set
4916 # CONFIG_ATALK is not set
4919 -# Appletalk devices
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
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
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
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
4960 # Disk-On-Chip Device Drivers
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 @@
4968 # CONFIG_IPX is not set
4969 # CONFIG_ATALK is not set
4972 -# Appletalk devices
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
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
4987 # CONFIG_FB_PM2 is not set
4988 # CONFIG_FB_PM3 is not set
4989 # CONFIG_FB_CYBER2000 is not set
4991 # CONFIG_FB_MATROX is not set
4992 # CONFIG_FB_ATY is not set
4993 # CONFIG_FB_RADEON is not set
4995 # CONFIG_FB_VOODOO1 is not set
4996 # CONFIG_FB_TRIDENT is not set
4997 # CONFIG_FB_E1356 is not set
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
5007 +# Automatically generated make config: don't edit
5011 +# CONFIG_MIPS64 is not set
5014 +# Code maturity level options
5016 +CONFIG_EXPERIMENTAL=y
5019 +# Loadable module support
5022 +# CONFIG_MODVERSIONS is not set
5026 +# Machine selection
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
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
5122 +CONFIG_CPU_LITTLE_ENDIAN=y
5123 +# CONFIG_BUILD_ELF64 is not set
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
5136 +# PCMCIA/CardBus support
5139 +# CONFIG_CARDBUS is not set
5140 +# CONFIG_TCIC is not set
5141 +# CONFIG_I82092 is not set
5142 +# CONFIG_I82365 is not set
5145 +# PCI Hotplug Support
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
5155 +# CONFIG_BSD_PROCESS_ACCT is not set
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"
5171 +# Memory Technology Devices (MTD)
5173 +# CONFIG_MTD is not set
5176 +# Parallel port support
5178 +# CONFIG_PARPORT is not set
5181 +# Plug and Play configuration
5183 +# CONFIG_PNP is not set
5184 +# CONFIG_ISAPNP is not set
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
5206 +# Multi-device support (RAID and LVM)
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
5218 +# Networking options
5221 +# CONFIG_PACKET_MMAP is not set
5222 +# CONFIG_NETLINK_DEV is not set
5224 +# CONFIG_NETFILTER_DEBUG is not set
5228 +CONFIG_IP_MULTICAST=y
5229 +# CONFIG_IP_ADVANCED_ROUTER is not set
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
5242 +# IP: Netfilter Configuration
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
5252 +# IP: Virtual Server Configuration
5254 +# CONFIG_IP_VS is not set
5255 +# CONFIG_IPV6 is not set
5256 +# CONFIG_KHTTPD is not set
5259 +# SCTP Configuration (EXPERIMENTAL)
5261 +# CONFIG_IP_SCTP is not set
5262 +# CONFIG_ATM is not set
5263 +# CONFIG_VLAN_8021Q is not set
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
5282 +# QoS and/or fair queueing
5284 +# CONFIG_NET_SCHED is not set
5289 +# CONFIG_NET_PKTGEN is not set
5292 +# Telephony Support
5294 +# CONFIG_PHONE is not set
5295 +# CONFIG_PHONE_IXJ is not set
5296 +# CONFIG_PHONE_IXJ_PCMCIA is not set
5299 +# ATA/IDE/MFM/RLL support
5304 +# IDE, ATA and ATAPI Block devices
5306 +CONFIG_BLK_DEV_IDE=y
5309 +# Please see Documentation/ide.txt for help/info on IDE drives
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
5326 +# IDE chipset support/bugfixes
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
5347 +# SCSI support type (disk, tape, CD-ROM)
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
5359 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
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
5367 +# SCSI low-level drivers
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
5432 +# PCMCIA SCSI adapter support
5434 +# CONFIG_SCSI_PCMCIA is not set
5437 +# Fusion MPT device support
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
5446 +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
5448 +# CONFIG_IEEE1394 is not set
5451 +# I2O device support
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
5461 +# Network device support
5463 +CONFIG_NETDEVICES=y
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
5476 +# Ethernet (10 or 100Mbit)
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
5494 +# Ethernet (1000 Mbit)
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
5513 +# Wireless LAN (non-hamradio)
5515 +# CONFIG_NET_RADIO is not set
5518 +# Token Ring devices
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
5528 +# CONFIG_WAN is not set
5531 +# PCMCIA network device support
5533 +# CONFIG_NET_PCMCIA is not set
5536 +# Amateur Radio support
5538 +# CONFIG_HAMRADIO is not set
5541 +# IrDA (infrared) support
5543 +# CONFIG_IRDA is not set
5548 +# CONFIG_ISDN is not set
5551 +# Input core support
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
5563 +# Character devices
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
5598 +# CONFIG_I2C is not set
5603 +# CONFIG_BUSMOUSE is not set
5604 +# CONFIG_MOUSE is not set
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
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
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
5661 +# Ftape, the floppy tape device driver
5663 +# CONFIG_FTAPE is not set
5664 +# CONFIG_AGP is not set
5667 +# Direct Rendering Manager (XFree86 DRI support)
5669 +# CONFIG_DRM is not set
5672 +# PCMCIA character devices
5674 +# CONFIG_PCMCIA_SERIAL_CS is not set
5675 +# CONFIG_SYNCLINK_CS is not set
5680 +# CONFIG_QUOTA is not set
5681 +# CONFIG_QFMT_V2 is not set
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
5697 +# CONFIG_JBD_DEBUG is not set
5700 +# CONFIG_UMSDOS_FS is not set
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
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
5720 +# CONFIG_DEVFS_FS is not set
5721 +# CONFIG_DEVFS_MOUNT is not set
5722 +# CONFIG_DEVFS_DEBUG is not set
5724 +# CONFIG_QNX4FS_FS is not set
5725 +# CONFIG_QNX4FS_RW is not set
5726 +# CONFIG_ROMFS_FS is not set
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
5740 +# Network File Systems
5742 +# CONFIG_CODA_FS is not set
5743 +# CONFIG_INTERMEZZO_FS is not set
5746 +# CONFIG_NFS_DIRECTIO is not set
5748 +# CONFIG_NFSD is not set
5749 +# CONFIG_NFSD_V3 is not set
5750 +# CONFIG_NFSD_TCP is not set
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
5769 +# CONFIG_PARTITION_ADVANCED is not set
5770 +CONFIG_MSDOS_PARTITION=y
5771 +# CONFIG_SMB_NLS is not set
5775 +# Native Language Support
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
5817 +# Multimedia devices
5819 +# CONFIG_VIDEO_DEV is not set
5824 +# CONFIG_VGA_CONSOLE is not set
5825 +# CONFIG_MDA_CONSOLE is not set
5828 +# Frame-buffer support
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
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
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
5911 +# CONFIG_USB_DEBUG is not set
5914 +# Miscellaneous USB options
5916 +CONFIG_USB_DEVICEFS=y
5917 +# CONFIG_USB_BANDWIDTH is not set
5920 +# USB Host Controller Drivers
5922 +# CONFIG_USB_EHCI_HCD is not set
5923 +# CONFIG_USB_UHCI is not set
5924 +# CONFIG_USB_UHCI_ALT is not set
5928 +# USB Device Class drivers
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
5948 +# USB Human Interface Devices (HID)
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
5959 +# USB Imaging devices
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
5968 +# USB Multimedia devices
5972 +# Video4Linux support is needed for USB Multimedia device support
5976 +# USB Network adaptors
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
5988 +# CONFIG_USB_USS720 is not set
5991 +# USB Serial Converter support
5993 +# CONFIG_USB_SERIAL is not set
5996 +# USB Miscellaneous drivers
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
6005 +# Support for USB gadgets
6007 +# CONFIG_USB_GADGET is not set
6010 +# Bluetooth support
6012 +# CONFIG_BLUEZ is not set
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
6027 +# Cryptographic options
6029 +# CONFIG_CRYPTO is not set
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
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 @@
6053 # CONFIG_IPX is not set
6054 # CONFIG_ATALK is not set
6057 -# Appletalk devices
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
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
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
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
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
6098 # Disk-On-Chip Device Drivers
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 @@
6106 # CONFIG_IPX is not set
6107 # CONFIG_ATALK is not set
6110 -# Appletalk devices
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
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
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
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 @@
6139 # CONFIG_IPX is not set
6140 # CONFIG_ATALK is not set
6143 -# Appletalk devices
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
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
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
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 @@
6172 # CONFIG_IPX is not set
6173 # CONFIG_ATALK is not set
6176 -# Appletalk devices
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
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
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
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 @@
6205 # CONFIG_IPX is not set
6206 # CONFIG_ATALK is not set
6209 -# Appletalk devices
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
6228 CONFIG_SERIAL_DEC_CONSOLE=y
6231 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
6232 CONFIG_UNIX98_PTYS=y
6233 CONFIG_UNIX98_PTY_COUNT=256
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
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 @@
6250 # CONFIG_IPX is not set
6251 # CONFIG_ATALK is not set
6254 -# Appletalk devices
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
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
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
6282 # Mapping drivers for chip access
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
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
6304 # Disk-On-Chip Device Drivers
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 @@
6312 # CONFIG_IPX is not set
6313 # CONFIG_ATALK is not set
6316 -# Appletalk devices
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
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
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 @@
6345 # CONFIG_IPX is not set
6346 # CONFIG_ATALK is not set
6349 -# Appletalk devices
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
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
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
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 @@
6378 # CONFIG_IPX is not set
6379 # CONFIG_ATALK is not set
6382 -# Appletalk devices
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
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
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
6401 +# Automatically generated make config: don't edit
6405 +# CONFIG_MIPS64 is not set
6408 +# Code maturity level options
6410 +CONFIG_EXPERIMENTAL=y
6413 +# Loadable module support
6416 +# CONFIG_MODVERSIONS is not set
6420 +# Machine selection
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
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
6516 +CONFIG_CPU_LITTLE_ENDIAN=y
6517 +# CONFIG_BUILD_ELF64 is not set
6519 +# CONFIG_PCI is not set
6520 +# CONFIG_PCI_NEW is not set
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
6530 +# CONFIG_BSD_PROCESS_ACCT is not set
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"
6546 +# Memory Technology Devices (MTD)
6548 +# CONFIG_MTD is not set
6551 +# Parallel port support
6553 +# CONFIG_PARPORT is not set
6556 +# Plug and Play configuration
6558 +# CONFIG_PNP is not set
6559 +# CONFIG_ISAPNP is not set
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
6581 +# Multi-device support (RAID and LVM)
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
6593 +# Networking options
6596 +# CONFIG_PACKET_MMAP is not set
6597 +# CONFIG_NETLINK_DEV is not set
6599 +# CONFIG_NETFILTER_DEBUG is not set
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
6614 +# IP: Netfilter Configuration
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
6624 +# IP: Virtual Server Configuration
6626 +# CONFIG_IP_VS is not set
6627 +# CONFIG_IPV6 is not set
6628 +# CONFIG_KHTTPD is not set
6631 +# SCTP Configuration (EXPERIMENTAL)
6633 +# CONFIG_IP_SCTP is not set
6634 +# CONFIG_ATM is not set
6635 +# CONFIG_VLAN_8021Q is not set
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
6654 +# QoS and/or fair queueing
6656 +# CONFIG_NET_SCHED is not set
6661 +# CONFIG_NET_PKTGEN is not set
6664 +# Telephony Support
6666 +# CONFIG_PHONE is not set
6667 +# CONFIG_PHONE_IXJ is not set
6668 +# CONFIG_PHONE_IXJ_PCMCIA is not set
6671 +# ATA/IDE/MFM/RLL support
6676 +# IDE, ATA and ATAPI Block devices
6678 +CONFIG_BLK_DEV_IDE=y
6681 +# Please see Documentation/ide.txt for help/info on IDE drives
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
6698 +# IDE chipset support/bugfixes
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
6718 +# SCSI support type (disk, tape, CD-ROM)
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
6730 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
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
6738 +# SCSI low-level drivers
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
6794 +# Fusion MPT device support
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
6803 +# Network device support
6805 +CONFIG_NETDEVICES=y
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
6818 +# Ethernet (10 or 100Mbit)
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
6834 +# Ethernet (1000 Mbit)
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
6853 +# Wireless LAN (non-hamradio)
6855 +# CONFIG_NET_RADIO is not set
6858 +# Token Ring devices
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
6868 +# CONFIG_WAN is not set
6871 +# Amateur Radio support
6873 +# CONFIG_HAMRADIO is not set
6876 +# IrDA (infrared) support
6878 +# CONFIG_IRDA is not set
6883 +# CONFIG_ISDN is not set
6886 +# Input core support
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
6898 +# Character devices
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
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
6943 +# CONFIG_BUSMOUSE is not set
6944 +# CONFIG_MOUSE is not set
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
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
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
7001 +# Ftape, the floppy tape device driver
7003 +# CONFIG_FTAPE is not set
7004 +# CONFIG_AGP is not set
7007 +# Direct Rendering Manager (XFree86 DRI support)
7009 +# CONFIG_DRM is not set
7014 +# CONFIG_QUOTA is not set
7015 +# CONFIG_QFMT_V2 is not set
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
7031 +# CONFIG_JBD_DEBUG is not set
7034 +# CONFIG_UMSDOS_FS is not set
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
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
7054 +# CONFIG_DEVFS_FS is not set
7055 +# CONFIG_DEVFS_MOUNT is not set
7056 +# CONFIG_DEVFS_DEBUG is not set
7058 +# CONFIG_QNX4FS_FS is not set
7059 +# CONFIG_QNX4FS_RW is not set
7060 +# CONFIG_ROMFS_FS is not set
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
7074 +# Network File Systems
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
7102 +# CONFIG_PARTITION_ADVANCED is not set
7103 +CONFIG_MSDOS_PARTITION=y
7104 +# CONFIG_SMB_NLS is not set
7108 +# Native Language Support
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
7150 +# Multimedia devices
7152 +# CONFIG_VIDEO_DEV is not set
7157 +# CONFIG_VGA_CONSOLE is not set
7158 +# CONFIG_MDA_CONSOLE is not set
7161 +# Frame-buffer support
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
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
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
7227 +# CONFIG_USB is not set
7230 +# Support for USB gadgets
7232 +# CONFIG_USB_GADGET is not set
7235 +# Bluetooth support
7237 +# CONFIG_BLUEZ is not set
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
7252 +# Cryptographic options
7254 +# CONFIG_CRYPTO is not set
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
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
7276 # Mapping drivers for chip access
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
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
7298 # Disk-On-Chip Device Drivers
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 @@
7306 # CONFIG_IPX is not set
7307 # CONFIG_ATALK is not set
7310 -# Appletalk devices
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
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
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
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
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
7349 # Disk-On-Chip Device Drivers
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 @@
7357 # CONFIG_IPX is not set
7358 # CONFIG_ATALK is not set
7361 -# Appletalk devices
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
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
7376 # CONFIG_FB_PM2 is not set
7377 # CONFIG_FB_PM3 is not set
7378 # CONFIG_FB_CYBER2000 is not set
7380 # CONFIG_FB_MATROX is not set
7381 # CONFIG_FB_ATY is not set
7382 # CONFIG_FB_RADEON is not set
7384 # CONFIG_FB_VOODOO1 is not set
7385 # CONFIG_FB_TRIDENT is not set
7386 # CONFIG_FB_E1356 is not set
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
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 @@
7406 # CONFIG_IPX is not set
7407 # CONFIG_ATALK is not set
7410 -# Appletalk devices
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
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
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
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
7450 # Mapping drivers for chip access
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
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
7472 # Disk-On-Chip Device Drivers
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 @@
7480 # CONFIG_IPX is not set
7481 # CONFIG_ATALK is not set
7484 -# Appletalk devices
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
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
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
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 @@
7513 # CONFIG_IPX is not set
7514 # CONFIG_ATALK is not set
7517 -# Appletalk devices
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
7524 CONFIG_QTRONIX_KEYBOARD=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
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
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 @@
7546 # CONFIG_IPX is not set
7547 # CONFIG_ATALK is not set
7550 -# Appletalk devices
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
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
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
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
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
7589 # Disk-On-Chip Device Drivers
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 @@
7597 # CONFIG_IPX is not set
7598 # CONFIG_ATALK is not set
7601 -# Appletalk devices
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
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
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
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 @@
7630 # CONFIG_IPX is not set
7631 # CONFIG_ATALK is not set
7634 -# Appletalk devices
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
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
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
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
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
7681 # CONFIG_MTD_CSTM_MIPS_IXX is not set
7682 # CONFIG_MTD_OCELOT is not set
7685 # Disk-On-Chip Device Drivers
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 @@
7693 # CONFIG_IPX is not set
7694 # CONFIG_ATALK is not set
7697 -# Appletalk devices
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
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
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
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 @@
7726 # CONFIG_IPX is not set
7727 # CONFIG_ATALK is not set
7730 -# Appletalk devices
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
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
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
7756 # CONFIG_COGENT_CSB250 is not set
7758 # CONFIG_MTD_BOSPORUS is not set
7759 # CONFIG_MTD_XXS1500 is not set
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
7769 # Disk-On-Chip Device Drivers
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 @@
7777 # CONFIG_IPX is not set
7778 # CONFIG_ATALK is not set
7781 -# Appletalk devices
7783 -# CONFIG_DEV_APPLETALK is not set
7784 # CONFIG_DECNET is not set
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
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
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
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 @@
7822 # CONFIG_IPX is not set
7823 # CONFIG_ATALK is not set
7826 -# Appletalk devices
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
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
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
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
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
7865 # Disk-On-Chip Device Drivers
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 @@
7873 # CONFIG_IPX is not set
7874 # CONFIG_ATALK is not set
7877 -# Appletalk devices
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
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
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
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 @@
7906 # CONFIG_IPX is not set
7907 # CONFIG_ATALK is not set
7910 -# Appletalk devices
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
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
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
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
7949 # Disk-On-Chip Device Drivers
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 @@
7957 # CONFIG_IPX is not set
7958 # CONFIG_ATALK is not set
7961 -# Appletalk devices
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
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
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
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
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
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
8009 # Disk-On-Chip Device Drivers
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 @@
8017 # CONFIG_IPX is not set
8018 # CONFIG_ATALK is not set
8021 -# Appletalk devices
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
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
8036 # CONFIG_FB_PM2 is not set
8037 # CONFIG_FB_PM3 is not set
8038 # CONFIG_FB_CYBER2000 is not set
8040 # CONFIG_FB_MATROX is not set
8041 # CONFIG_FB_ATY is not set
8042 # CONFIG_FB_RADEON is not set
8044 # CONFIG_FB_VOODOO1 is not set
8045 # CONFIG_FB_TRIDENT is not set
8046 # CONFIG_FB_E1356 is not set
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
8056 +# Automatically generated make config: don't edit
8060 +# CONFIG_MIPS64 is not set
8063 +# Code maturity level options
8065 +CONFIG_EXPERIMENTAL=y
8068 +# Loadable module support
8071 +# CONFIG_MODVERSIONS is not set
8075 +# Machine selection
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
8138 +# CONFIG_MIPS_AU1000 is not set
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
8175 +CONFIG_CPU_LITTLE_ENDIAN=y
8176 +# CONFIG_BUILD_ELF64 is not set
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
8189 +# PCMCIA/CardBus support
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
8199 +# PCI Hotplug Support
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
8209 +# CONFIG_BSD_PROCESS_ACCT is not set
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
8226 +# Memory Technology Devices (MTD)
8228 +# CONFIG_MTD is not set
8231 +# Parallel port support
8233 +# CONFIG_PARPORT is not set
8236 +# Plug and Play configuration
8238 +# CONFIG_PNP is not set
8239 +# CONFIG_ISAPNP is not set
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
8261 +# Multi-device support (RAID and LVM)
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
8273 +# Networking options
8276 +# CONFIG_PACKET_MMAP is not set
8277 +# CONFIG_NETLINK_DEV is not set
8279 +# CONFIG_NETFILTER_DEBUG is not set
8283 +CONFIG_IP_MULTICAST=y
8284 +# CONFIG_IP_ADVANCED_ROUTER is not set
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
8297 +# IP: Netfilter Configuration
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
8307 +# IP: Virtual Server Configuration
8309 +# CONFIG_IP_VS is not set
8310 +# CONFIG_IPV6 is not set
8311 +# CONFIG_KHTTPD is not set
8314 +# SCTP Configuration (EXPERIMENTAL)
8316 +# CONFIG_IP_SCTP is not set
8317 +# CONFIG_ATM is not set
8318 +# CONFIG_VLAN_8021Q is not set
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
8337 +# QoS and/or fair queueing
8339 +# CONFIG_NET_SCHED is not set
8344 +# CONFIG_NET_PKTGEN is not set
8347 +# Telephony Support
8349 +# CONFIG_PHONE is not set
8350 +# CONFIG_PHONE_IXJ is not set
8351 +# CONFIG_PHONE_IXJ_PCMCIA is not set
8354 +# ATA/IDE/MFM/RLL support
8359 +# IDE, ATA and ATAPI Block devices
8361 +CONFIG_BLK_DEV_IDE=y
8364 +# Please see Documentation/ide.txt for help/info on IDE drives
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
8381 +# IDE chipset support/bugfixes
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
8402 +# SCSI support type (disk, tape, CD-ROM)
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
8414 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
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
8422 +# SCSI low-level drivers
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
8487 +# PCMCIA SCSI adapter support
8489 +# CONFIG_SCSI_PCMCIA is not set
8492 +# Fusion MPT device support
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
8501 +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
8503 +# CONFIG_IEEE1394 is not set
8506 +# I2O device support
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
8516 +# Network device support
8518 +CONFIG_NETDEVICES=y
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
8531 +# Ethernet (10 or 100Mbit)
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
8550 +# Ethernet (1000 Mbit)
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
8566 +CONFIG_PPP_MULTILINK=y
8567 +# CONFIG_PPP_FILTER is not set
8569 +# CONFIG_PPP_SYNC_TTY is not set
8570 +CONFIG_PPP_DEFLATE=m
8571 +# CONFIG_PPP_BSDCOMP is not set
8573 +# CONFIG_SLIP is not set
8576 +# Wireless LAN (non-hamradio)
8578 +# CONFIG_NET_RADIO is not set
8581 +# Token Ring devices
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
8591 +# CONFIG_WAN is not set
8594 +# PCMCIA network device support
8596 +# CONFIG_NET_PCMCIA is not set
8599 +# Amateur Radio support
8601 +# CONFIG_HAMRADIO is not set
8604 +# IrDA (infrared) support
8606 +# CONFIG_IRDA is not set
8611 +# CONFIG_ISDN is not set
8614 +# Input core support
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
8626 +# Character devices
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
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
8675 +# CONFIG_BUSMOUSE is not set
8676 +# CONFIG_MOUSE is not set
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
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
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
8733 +# Ftape, the floppy tape device driver
8735 +# CONFIG_FTAPE is not set
8736 +# CONFIG_AGP is not set
8739 +# Direct Rendering Manager (XFree86 DRI support)
8741 +# CONFIG_DRM is not set
8744 +# PCMCIA character devices
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
8754 +# CONFIG_QUOTA is not set
8755 +# CONFIG_QFMT_V2 is not set
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
8771 +# CONFIG_JBD_DEBUG is not set
8774 +# CONFIG_UMSDOS_FS is not set
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
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
8794 +# CONFIG_DEVFS_FS is not set
8795 +# CONFIG_DEVFS_MOUNT is not set
8796 +# CONFIG_DEVFS_DEBUG is not set
8798 +# CONFIG_QNX4FS_FS is not set
8799 +# CONFIG_QNX4FS_RW is not set
8800 +# CONFIG_ROMFS_FS is not set
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
8814 +# Network File Systems
8816 +# CONFIG_CODA_FS is not set
8817 +# CONFIG_INTERMEZZO_FS is not set
8820 +# CONFIG_NFS_DIRECTIO is not set
8822 +# CONFIG_NFSD is not set
8823 +# CONFIG_NFSD_V3 is not set
8824 +# CONFIG_NFSD_TCP is not set
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
8843 +# CONFIG_PARTITION_ADVANCED is not set
8844 +CONFIG_MSDOS_PARTITION=y
8845 +# CONFIG_SMB_NLS is not set
8849 +# Native Language Support
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
8891 +# Multimedia devices
8893 +# CONFIG_VIDEO_DEV is not set
8898 +# CONFIG_VGA_CONSOLE is not set
8899 +# CONFIG_MDA_CONSOLE is not set
8902 +# Frame-buffer support
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
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
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
8988 +# CONFIG_USB_DEBUG is not set
8991 +# Miscellaneous USB options
8993 +CONFIG_USB_DEVICEFS=y
8994 +# CONFIG_USB_BANDWIDTH is not set
8997 +# USB Host Controller Drivers
8999 +# CONFIG_USB_EHCI_HCD is not set
9000 +# CONFIG_USB_UHCI is not set
9001 +# CONFIG_USB_UHCI_ALT is not set
9005 +# USB Device Class drivers
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
9025 +# USB Human Interface Devices (HID)
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
9036 +# USB Imaging devices
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
9045 +# USB Multimedia devices
9049 +# Video4Linux support is needed for USB Multimedia device support
9053 +# USB Network adaptors
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
9065 +# CONFIG_USB_USS720 is not set
9068 +# USB Serial Converter support
9070 +# CONFIG_USB_SERIAL is not set
9073 +# USB Miscellaneous drivers
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
9082 +# Support for USB gadgets
9084 +# CONFIG_USB_GADGET is not set
9087 +# Bluetooth support
9089 +# CONFIG_BLUEZ is not set
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
9104 +# Cryptographic options
9106 +# CONFIG_CRYPTO is not set
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
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
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
9140 # Disk-On-Chip Device Drivers
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 @@
9148 # CONFIG_IPX is not set
9149 # CONFIG_ATALK is not set
9152 -# Appletalk devices
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
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
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
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
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
9193 # Disk-On-Chip Device Drivers
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 @@
9201 # CONFIG_IPX is not set
9202 # CONFIG_ATALK is not set
9205 -# Appletalk devices
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
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
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
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 @@
9234 # CONFIG_IPX is not set
9235 # CONFIG_ATALK is not set
9238 -# Appletalk devices
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
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
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
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 @@
9267 # CONFIG_IPX is not set
9268 # CONFIG_ATALK is not set
9271 -# Appletalk devices
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
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
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
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
9299 # CONFIG_SIBYTE_TBPROF is not set
9300 CONFIG_SIBYTE_GENBUS_IDE=y
9301 CONFIG_SMP_CAPABLE=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 @@
9308 # CONFIG_IPX is not set
9309 # CONFIG_ATALK is not set
9312 -# Appletalk devices
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
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
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
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
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
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
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 @@
9362 # CONFIG_IPX is not set
9363 # CONFIG_ATALK is not set
9366 -# Appletalk devices
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
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
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
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 @@
9407 # CONFIG_IPX is not set
9408 # CONFIG_ATALK is not set
9411 -# Appletalk devices
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
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
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 @@
9452 # CONFIG_IPX is not set
9453 # CONFIG_ATALK is not set
9456 -# Appletalk devices
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
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
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
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
9495 # Disk-On-Chip Device Drivers
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 @@
9503 # CONFIG_IPX is not set
9504 # CONFIG_ATALK is not set
9507 -# Appletalk devices
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
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
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
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 @@
9536 # CONFIG_IPX is not set
9537 # CONFIG_ATALK is not set
9540 -# Appletalk devices
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
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
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
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
9579 # Disk-On-Chip Device Drivers
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 @@
9587 # CONFIG_IPX is not set
9588 # CONFIG_ATALK is not set
9591 -# Appletalk devices
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
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
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
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 @@
9620 # CONFIG_IPX is not set
9621 # CONFIG_ATALK is not set
9624 -# Appletalk devices
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
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
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
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
9667 LEAF(except_vec2_generic)
9673 * This is a very bad place to be. Our cache error
9674 * detection has triggered. If we have write-back data
9677 j cache_parity_error
9680 END(except_vec2_generic)
9685 * Special interrupt vector for embedded MIPS. This is a
9686 * dedicated interrupt vector which reduces interrupt processing
9690 NESTED(except_vec4, 0, sp)
9693 1: j 1b /* Dummy, will be replaced */
9700 * unconditional jump to this vector.
9702 NESTED(except_vec_ejtag_debug, 0, sp)
9705 j ejtag_debug_handler
9708 END(except_vec_ejtag_debug)
9712 * EJTAG debug exception handler.
9714 NESTED(ejtag_debug_handler, PT_SIZE, sp)
9725 END(ejtag_debug_handler)
9728 @@ -132,13 +138,17 @@
9729 * unconditional jump to this vector.
9731 NESTED(except_vec_nmi, 0, sp)
9741 NESTED(nmi_handler, PT_SIZE, sp)
9756 @@ -157,7 +166,20 @@
9757 * Kernel entry point
9759 NESTED(kernel_entry, 16, sp)
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().
9766 + mfc0 t0, CP0_STATUS
9767 + or t0, ST0_CU0|0x1f
9769 + mtc0 t0, CP0_STATUS
9776 * The firmware/bootloader passes argc/argp/envp
9786 * Stack for kernel and init, current variable
9796 @@ -193,17 +215,26 @@
9797 * function after setting up the stack and gp registers.
9802 - mtc0 zero, CP0_WIRED
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().
9812 - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_UX)
9815 + or t0, ST0_CU0|ST0_BEV|0x1f
9816 + xor t0, ST0_BEV|0x1f
9817 + mtc0 t0, CP0_STATUS
9823 + mtc0 zero, CP0_WIRED
9826 - mtc0 t0, CP0_STATUS
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 @@
9844 lw a0, PT_R4(sp) # Restore argument registers
9851 li t0, -EMAXERRNO - 1 # error?
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
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
9866 extern struct rtc_ops no_rtc_ops;
9867 struct rtc_ops *rtc_ops;
9869 +EXPORT_SYMBOL(rtc_ops);
9871 #ifdef CONFIG_PC_KEYB
9872 struct kbd_ops *kbd_ops;
9874 @@ -132,10 +134,6 @@
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);
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)
9891 unsigned int cpu = smp_processor_id();
9892 + unsigned int status_set = ST0_CU0;
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);
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.
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,
9910 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
9912 set_c0_cause(CAUSEF_IV);
9914 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
9915 - write_c0_context(cpu << 23);
9916 + TLBMISS_HANDLER_SETUP();
9918 atomic_inc(&init_mm.mm_count);
9919 current->active_mm = &init_mm;
9921 extern char except_vec4;
9924 - per_cpu_trap_init();
9926 /* Copy the generic exception handler code to it's final destination. */
9927 memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
9929 @@ -1020,10 +1024,5 @@
9931 flush_icache_range(KSEG0, KSEG0 + 0x400);
9933 - atomic_inc(&init_mm.mm_count); /* XXX UP? */
9934 - current->active_mm = &init_mm;
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();
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
9945 * Stub RTC routines to keep Linux from crashing on machine which don't
9948 - * Copyright (C) 1998, 2001 by Ralf Baechle
9949 + * Copyright (C) 1998, 2001, 2005 by Ralf Baechle
9951 #include <linux/kernel.h>
9952 -#include <linux/module.h>
9953 #include <linux/mc146818rtc.h>
9955 static unsigned int shouldnt_happen(void)
9957 .rtc_write_data = (void *) &shouldnt_happen,
9958 .rtc_bcd_mode = (void *) &shouldnt_happen
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
9967 * RTC routines for PC style attached Dallas chip.
9969 - * Copyright (C) 1998, 2001 by Ralf Baechle
9970 + * Copyright (C) 1998, 2001, 05 by Ralf Baechle
9972 -#include <linux/module.h>
9973 #include <linux/mc146818rtc.h>
9977 &std_rtc_write_data,
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
9989 -# Au1000 (Alchemy Semi PB1000) eval board
9990 +# Au1x AMD Alchemy eval boards
9992 ifdef CONFIG_MIPS_PB1000
9993 LIBS += arch/mips/au1000/pb1000/pb1000.o \
9995 LOADADDR := 0x80100000
9999 -# Au1100 (Alchemy Semi PB1100) eval board
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
10009 -# Au1500 (Alchemy Semi PB1500) eval board
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
10019 -# Au1x00 (AMD/Alchemy) eval boards
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
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
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
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
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 @@
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
10077 /* Calculate the parity on a range of bits */
10078 @@ -331,9 +331,9 @@
10079 ((lru >> 4) & 0x3),
10080 ((lru >> 6) & 0x3));
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);
10089 tlo_tmp = taglo & 0xfff3ff;
10090 @@ -474,7 +474,7 @@
10091 : "r" ((way << 13) | addr));
10093 taglo = ((unsigned long long)taglohi << 32) | taglolo;
10094 - pa = (taglo & 0xFFFFFFE000) | addr;
10095 + pa = (taglo & 0xFFFFFFE000ULL) | addr;
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.
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) {
10114 + if (!(read_c0_config7() & (1 << 16)))
10116 + if (c->dcache.waysize > PAGE_SIZE)
10117 + c->dcache.flags |= MIPS_CACHE_ALIASES;
10120 switch (c->cputype) {
10122 @@ -1069,9 +1076,6 @@
10126 - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
10127 - c->dcache.flags |= MIPS_CACHE_ALIASES;
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 @@
10138 mfc0 a2, CP0_BADVADDR; \
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
10152 - rm9000_tlb_hazard
10154 tlbwr # write random tlb entry
10157 - rm9000_tlb_hazard
10158 - eret # return from trap
10161 END(except_vec0_r4000)
10163 /* TLB refill, EXL == 0, R4600 version */
10164 @@ -468,13 +465,10 @@
10165 PTE_PRESENT(k0, k1, nopage_tlbl)
10166 PTE_MAKEVALID(k0, k1)
10168 - rm9000_tlb_hazard
10176 - rm9000_tlb_hazard
10181 @@ -496,13 +490,10 @@
10182 PTE_WRITABLE(k0, k1, nopage_tlbs)
10183 PTE_MAKEWRITE(k0, k1)
10185 - rm9000_tlb_hazard
10193 - rm9000_tlb_hazard
10198 @@ -529,13 +520,10 @@
10200 /* Now reload the entry into the tlb. */
10202 - rm9000_tlb_hazard
10207 - rm9000_tlb_hazard
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
10219 * License. See the file "COPYING" in the main directory of this archive
10220 * for more details.
10222 - * r4xx0.c: R4000 processor variant specific MMU/Cache routines.
10224 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
10225 * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle ralf@gnu.org
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.
10235 +#include <linux/config.h>
10236 #include <linux/init.h>
10237 #include <linux/sched.h>
10238 #include <linux/mm.h>
10240 #include <asm/pgtable.h>
10241 #include <asm/system.h>
10244 -#undef DEBUG_TLBUPDATE
10246 extern char except_vec0_nevada, except_vec0_r4000, except_vec0_r4600;
10248 /* CP0 hazard avoidance. */
10249 @@ -41,33 +33,23 @@
10250 unsigned long old_ctx;
10254 - printk("[tlball]");
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);
10264 entry = read_c0_wired();
10266 /* Blast 'em all away. */
10267 while (entry < current_cpu_data.tlbsize) {
10269 - * Make sure all entries differ. If they're not different
10270 - * MIPS32 will take revenge ...
10272 write_c0_entryhi(KSEG0 + entry*0x2000);
10273 write_c0_index(entry);
10275 + mtc0_tlbw_hazard();
10276 tlb_write_indexed();
10281 + tlbw_use_hazard();
10282 write_c0_entryhi(old_ctx);
10283 local_irq_restore(flags);
10287 int cpu = smp_processor_id();
10289 - if (cpu_context(cpu, mm) != 0) {
10291 - printk("[tlbmm<%d>]", cpu_context(cpu, mm));
10293 + if (cpu_context(cpu, mm) != 0)
10294 drop_mmu_context(mm,cpu);
10298 void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
10300 unsigned long flags;
10304 - printk("[tlbrange<%02x,%08lx,%08lx>]",
10305 - cpu_asid(cpu, mm), start, end);
10307 local_irq_save(flags);
10308 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
10309 size = (size + 1) >> 1;
10312 write_c0_entryhi(start | newpid);
10313 start += (PAGE_SIZE << 1);
10315 + mtc0_tlbw_hazard();
10318 idx = read_c0_index();
10319 @@ -122,10 +96,10 @@
10321 /* Make sure all entries differ. */
10322 write_c0_entryhi(KSEG0 + idx*0x2000);
10324 + mtc0_tlbw_hazard();
10325 tlb_write_indexed();
10328 + tlbw_use_hazard();
10329 write_c0_entryhi(oldpid);
10331 drop_mmu_context(mm, cpu);
10332 @@ -138,34 +112,30 @@
10334 int cpu = smp_processor_id();
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;
10343 - printk("[tlbpage<%d,%08lx>]", cpu_context(cpu, vma->vm_mm),
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);
10352 + mtc0_tlbw_hazard();
10355 idx = read_c0_index();
10356 write_c0_entrylo0(0);
10357 write_c0_entrylo1(0);
10361 /* Make sure all entries differ. */
10362 write_c0_entryhi(KSEG0+idx*0x2000);
10364 + mtc0_tlbw_hazard();
10365 tlb_write_indexed();
10366 + tlbw_use_hazard();
10370 write_c0_entryhi(oldpid);
10371 local_irq_restore(flags);
10373 @@ -185,7 +155,7 @@
10375 local_irq_save(flags);
10376 write_c0_entryhi(page);
10378 + mtc0_tlbw_hazard();
10381 idx = read_c0_index();
10382 @@ -194,18 +164,19 @@
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();
10391 write_c0_entryhi(oldpid);
10393 local_irq_restore(flags);
10396 EXPORT_SYMBOL(local_flush_tlb_one);
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.
10402 + * Updates the TLB with the new pte(s).
10404 void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
10406 @@ -223,25 +194,16 @@
10408 pid = read_c0_entryhi() & ASID_MASK;
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);
10418 local_irq_save(flags);
10419 address &= (PAGE_MASK << 1);
10420 write_c0_entryhi(address | pid);
10421 pgdp = pgd_offset(vma->vm_mm, address);
10423 + mtc0_tlbw_hazard();
10426 pmdp = pmd_offset(pgdp, address);
10427 idx = read_c0_index();
10428 ptep = pte_offset(pmdp, address);
10430 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
10431 write_c0_entrylo0(ptep->pte_high);
10433 @@ -251,15 +213,13 @@
10434 write_c0_entrylo1(pte_val(*ptep) >> 6);
10436 write_c0_entryhi(address | pid);
10439 + mtc0_tlbw_hazard();
10441 tlb_write_random();
10444 tlb_write_indexed();
10447 + tlbw_use_hazard();
10448 write_c0_entryhi(pid);
10450 local_irq_restore(flags);
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();
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);
10466 + mtc0_tlbw_hazard();
10468 tlb_write_random();
10470 tlb_write_indexed();
10472 + tlbw_use_hazard();
10473 local_irq_restore(flags);
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)
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);
10488 + mtc0_tlbw_hazard();
10489 tlb_write_indexed();
10491 + tlbw_use_hazard();
10493 write_c0_entryhi(old_ctx);
10495 @@ -355,17 +317,15 @@
10498 write_c0_index(temp_tlb_entry);
10500 write_c0_pagemask(pagemask);
10501 write_c0_entryhi(entryhi);
10502 write_c0_entrylo0(entrylo0);
10503 write_c0_entrylo1(entrylo1);
10505 + mtc0_tlbw_hazard();
10506 tlb_write_indexed();
10508 + tlbw_use_hazard();
10510 write_c0_entryhi(old_ctx);
10512 write_c0_pagemask(old_pagemask);
10514 local_irq_restore(flags);
10515 @@ -375,7 +335,7 @@
10516 static void __init probe_tlb(unsigned long config)
10518 struct cpuinfo_mips *c = ¤t_cpu_data;
10519 - unsigned int reg;
10520 + unsigned int config1;
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)
10528 - reg = read_c0_config1();
10529 + config1 = read_c0_config1();
10530 if (!((config >> 7) & 3))
10531 panic("No TLB present");
10533 - c->tlbsize = ((reg >> 25) & 0x3f) + 1;
10534 + c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
10537 void __init r4k_tlb_init(void)
10539 - u32 config = read_c0_config();
10540 + unsigned int config = read_c0_config();
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
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
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
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 @@
10592 # CONFIG_IPX is not set
10593 # CONFIG_ATALK is not set
10596 -# Appletalk devices
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
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
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 @@
10637 # CONFIG_IPX is not set
10638 # CONFIG_ATALK is not set
10641 -# Appletalk devices
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
10663 -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
10664 CONFIG_UNIX98_PTYS=y
10665 CONFIG_UNIX98_PTY_COUNT=256
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
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 @@
10682 # CONFIG_IPX is not set
10683 # CONFIG_ATALK is not set
10686 -# Appletalk devices
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
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
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
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
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 @@
10760 # CONFIG_IPX is not set
10761 # CONFIG_ATALK is not set
10764 -# Appletalk devices
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
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
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 @@
10793 # CONFIG_IPX is not set
10794 # CONFIG_ATALK is not set
10797 -# Appletalk devices
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
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
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 @@
10838 # CONFIG_IPX is not set
10839 # CONFIG_ATALK is not set
10842 -# Appletalk devices
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
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
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
10870 # CONFIG_SIBYTE_TBPROF is not set
10871 CONFIG_SIBYTE_GENBUS_IDE=y
10872 CONFIG_SMP_CAPABLE=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 @@
10879 # CONFIG_IPX is not set
10880 # CONFIG_ATALK is not set
10883 -# Appletalk devices
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
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
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
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
10926 +#define TASK_SIZE TASK_SIZE32
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
10937 +#define TASK_SIZE TASK_SIZE32
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
10946 NESTED(kernel_entry, 16, sp) # kernel entry point
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().
10954 + mfc0 t0, CP0_STATUS
10955 + or t0, ST0_CU0|ST0_KX|0x1f
10957 + mtc0 t0, CP0_STATUS
10963 ori sp, 0xf # align stack on 16 byte.
10965 @@ -103,8 +118,6 @@
10969 - CLI # disable interrupts
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
10982 @@ -133,6 +147,23 @@
10983 * function after setting up the stack and gp registers.
10985 NESTED(smp_bootstrap, 16, sp)
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().
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
11003 #ifdef CONFIG_SGI_IP27
11005 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
11006 @@ -146,19 +177,8 @@
11008 #endif /* CONFIG_SGI_IP27 */
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().
11017 - mfc0 t0, CP0_STATUS
11019 - mtc0 t0, CP0_STATUS
11021 jal start_secondary # XXX: IP27: cboot
11025 #endif /* CONFIG_SMP */
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 @@
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);
11054 if (iov != iovstack)
11056 @@ -1189,72 +1187,19 @@
11057 lseek back to original location. They fail just like lseek does on
11058 non-seekable files. */
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)
11066 - struct file * file;
11067 - ssize_t (*read)(struct file *, char *, size_t, loff_t *);
11074 - if (!(file->f_mode & FMODE_READ))
11076 - pos = merge_64(a4, a5);
11077 - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
11078 - file, pos, count);
11082 - if (!file->f_op || !(read = file->f_op->read))
11086 - ret = read(file, buf, count, &pos);
11088 - dnotify_parent(file->f_dentry, DN_ACCESS);
11093 + return sys_pread(fd, buf, count, merge_64(a4, a5));
11096 asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
11097 size_t count, u32 unused, u64 a4, u64 a5)
11100 - struct file * file;
11101 - ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
11103 + return sys_pwrite(fd, buf, count, merge_64(a4, a5));
11110 - if (!(file->f_mode & FMODE_WRITE))
11112 - pos = merge_64(a4, a5);
11113 - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
11114 - file, pos, count);
11118 - if (!file->f_op || !(write = file->f_op->write))
11123 - ret = write(file, buf, count, &pos);
11125 - dnotify_parent(file->f_dentry, DN_MODIFY);
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
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)
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);
11147 clen64 = kcmsg32->cmsg_len;
11148 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
11149 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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;
11157 unsigned long cmsg_ptr;
11158 + __kernel_size_t cmsg_len;
11159 int err, total_len, len = 0;
11161 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
11162 @@ -2923,6 +2873,7 @@
11165 cmsg_ptr = (unsigned long) kern_msg.msg_control;
11166 + cmsg_len = kern_msg.msg_controllen;
11167 kern_msg.msg_flags = 0;
11169 sock = sockfd_lookup(fd, &err);
11170 @@ -2948,7 +2899,8 @@
11171 * to fix it up before we tack on more stuff.
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);
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 @@
11192 ld a0, PT_R4(sp) # Restore argument registers
11199 li t0, -EMAXERRNO - 1 # error?
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 @@
11213 ld a0, PT_R4(sp) # Restore argument registers
11220 li t0, -EMAXERRNO - 1 # error?
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 @@
11234 ld a0, PT_R4(sp) # Restore argument registers
11236 @@ -129,7 +128,7 @@
11243 li t0, -EMAXERRNO - 1 # error?
11245 @@ -576,6 +575,8 @@
11251 .macro sys function, nargs
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 @@
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
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);
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
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);
11282 asmlinkage void sysn32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
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)
11290 unsigned int cpu = smp_processor_id();
11291 + unsigned int status_set = ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX;
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);
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.
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,
11310 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
11311 @@ -825,13 +830,11 @@
11312 set_c0_cause(CAUSEF_IV);
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();
11319 atomic_inc(&init_mm.mm_count);
11320 current->active_mm = &init_mm;
11323 + BUG_ON(current->mm);
11324 enter_lazy_tlb(&init_mm, current, cpu);
11327 @@ -842,8 +845,6 @@
11328 extern char except_vec4;
11331 - per_cpu_trap_init();
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 @@
11338 flush_icache_range(KSEG0, KSEG0 + 0x400);
11340 - atomic_inc(&init_mm.mm_count); /* XXX UP? */
11341 - current->active_mm = &init_mm;
11342 + per_cpu_trap_init();
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 @@
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
11369 /* Calculate the parity on a range of bits */
11370 @@ -331,9 +331,9 @@
11371 ((lru >> 4) & 0x3),
11372 ((lru >> 6) & 0x3));
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);
11381 tlo_tmp = taglo & 0xfff3ff;
11382 @@ -474,7 +474,7 @@
11383 : "r" ((way << 13) | addr));
11385 taglo = ((unsigned long long)taglohi << 32) | taglolo;
11386 - pa = (taglo & 0xFFFFFFE000) | addr;
11387 + pa = (taglo & 0xFFFFFFE000ULL) | addr;
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.
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) {
11406 + if (!(read_c0_config7() & (1 << 16)))
11408 + if (c->dcache.waysize > PAGE_SIZE)
11409 + c->dcache.flags |= MIPS_CACHE_ALIASES;
11412 switch (c->cputype) {
11414 @@ -1070,9 +1077,6 @@
11418 - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
11419 - c->dcache.flags |= MIPS_CACHE_ALIASES;
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
11431 - rm9000_tlb_hazard
11435 - rm9000_tlb_hazard
11438 +1: tlbw_eret_hazard
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
11446 - rm9000_tlb_hazard
11450 - rm9000_tlb_hazard
11453 +1: tlbw_eret_hazard
11455 END(handle_vec1_r4k)
11457 @@ -195,10 +191,9 @@
11458 ld k0, 0(k1) # get even pte
11459 ld k1, 8(k1) # get odd pte
11461 - rm9000_tlb_hazard
11465 - rm9000_tlb_hazard
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
11474 - rm9000_tlb_hazard
11478 - rm9000_tlb_hazard
11481 END(handle_vec1_r10k)
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
11488 - * Carsten Langgaard, carstenl@mips.com
11489 - * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
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.
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.
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.
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.
11515 #include <linux/init.h>
11516 #include <linux/sched.h>
11518 #include <asm/pgtable.h>
11519 #include <asm/system.h>
11522 -#undef DEBUG_TLBUPDATE
11524 extern void except_vec1_r4k(void);
11526 /* CP0 hazard avoidance. */
11527 @@ -46,31 +31,23 @@
11528 unsigned long old_ctx;
11532 - printk("[tlball]");
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);
11543 entry = read_c0_wired();
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);
11553 + mtc0_tlbw_hazard();
11554 tlb_write_indexed();
11559 + tlbw_use_hazard();
11560 write_c0_entryhi(old_ctx);
11561 local_irq_restore(flags);
11565 int cpu = smp_processor_id();
11567 - if (cpu_context(cpu, mm) != 0) {
11569 - printk("[tlbmm<%d>]", mm->context);
11571 + if (cpu_context(cpu, mm) != 0)
11572 drop_mmu_context(mm,cpu);
11576 void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
11578 unsigned long flags;
11582 - printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & ASID_MASK),
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) {
11596 write_c0_entryhi(start | newpid);
11597 start += (PAGE_SIZE << 1);
11599 + mtc0_tlbw_hazard();
11602 idx = read_c0_index();
11603 write_c0_entrylo0(0);
11604 write_c0_entrylo1(0);
11608 /* Make sure all entries differ. */
11609 write_c0_entryhi(XKPHYS+idx*0x2000);
11611 + mtc0_tlbw_hazard();
11612 tlb_write_indexed();
11615 + tlbw_use_hazard();
11616 write_c0_entryhi(oldpid);
11618 drop_mmu_context(mm, cpu);
11619 @@ -145,28 +114,26 @@
11620 unsigned long flags;
11621 unsigned long oldpid, newpid, idx;
11624 - printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
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);
11632 + mtc0_tlbw_hazard();
11635 idx = read_c0_index();
11636 write_c0_entrylo0(0);
11637 write_c0_entrylo1(0);
11641 /* Make sure all entries differ. */
11642 write_c0_entryhi(XKPHYS+idx*0x2000);
11644 + mtc0_tlbw_hazard();
11645 tlb_write_indexed();
11646 + tlbw_use_hazard();
11650 write_c0_entryhi(oldpid);
11651 local_irq_restore(flags);
11653 @@ -186,7 +153,7 @@
11655 local_irq_save(flags);
11656 write_c0_entryhi(page);
11658 + mtc0_tlbw_hazard();
11661 idx = read_c0_index();
11662 @@ -195,10 +162,12 @@
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();
11671 write_c0_entryhi(oldpid);
11673 local_irq_restore(flags);
11676 @@ -208,7 +177,6 @@
11677 void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
11679 unsigned long flags;
11680 - unsigned int asid;
11684 @@ -222,70 +190,58 @@
11686 pid = read_c0_entryhi() & ASID_MASK;
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);
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);
11703 + mtc0_tlbw_hazard();
11706 pmdp = pmd_offset(pgdp, address);
11707 idx = read_c0_index();
11708 ptep = pte_offset(pmdp, address);
11710 write_c0_entrylo0(pte_val(*ptep++) >> 6);
11711 write_c0_entrylo1(pte_val(*ptep) >> 6);
11712 - write_c0_entryhi(address | (pid));
11715 + write_c0_entryhi(address | pid);
11716 + mtc0_tlbw_hazard();
11718 tlb_write_random();
11721 tlb_write_indexed();
11724 + tlbw_use_hazard();
11725 write_c0_entryhi(pid);
11727 local_irq_restore(flags);
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)
11735 - unsigned long flags;
11736 - unsigned long wired;
11737 - unsigned long old_pagemask;
11738 - unsigned long old_ctx;
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);
11748 - write_c0_pagemask(pagemask);
11749 - write_c0_entryhi(entryhi);
11750 - write_c0_entrylo0(entrylo0);
11751 - write_c0_entrylo1(entrylo1);
11753 - tlb_write_indexed();
11756 - write_c0_entryhi(old_ctx);
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;
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);
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();
11782 + write_c0_entryhi(old_ctx);
11784 + write_c0_pagemask(old_pagemask);
11785 + local_flush_tlb_all();
11786 + local_irq_restore(flags);
11790 @@ -317,17 +273,15 @@
11793 write_c0_index(temp_tlb_entry);
11795 write_c0_pagemask(pagemask);
11796 write_c0_entryhi(entryhi);
11797 write_c0_entrylo0(entrylo0);
11798 write_c0_entrylo1(entrylo1);
11800 + mtc0_tlbw_hazard();
11801 tlb_write_indexed();
11803 + tlbw_use_hazard();
11805 write_c0_entryhi(old_ctx);
11807 write_c0_pagemask(old_pagemask);
11809 local_irq_restore(flags);
11810 @@ -348,15 +302,23 @@
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");
11819 c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
11822 void __init r4k_tlb_init(void)
11824 - unsigned long config = read_c0_config();
11825 + unsigned int config = read_c0_config();
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.
11835 write_c0_pagemask(PM_DEFAULT_MASK);
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 @@
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);
11852 if (iov != iovstack)
11854 @@ -2108,7 +2106,8 @@
11855 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
11856 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
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)
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);
11867 clen64 = kcmsg32->cmsg_len;
11868 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
11869 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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;
11877 unsigned long cmsg_ptr;
11878 + __kernel_size_t cmsg_len;
11879 int err, total_len, len = 0;
11881 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
11882 @@ -2239,6 +2242,7 @@
11885 cmsg_ptr = (unsigned long) kern_msg.msg_control;
11886 + cmsg_len = kern_msg.msg_controllen;
11887 kern_msg.msg_flags = 0;
11889 sock = sockfd_lookup(fd, &err);
11890 @@ -2264,7 +2268,8 @@
11891 * to fix it up before we tack on more stuff.
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);
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 @@
11905 0, /*__setup_cpu_440 */
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,
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 @@
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 */
11923 /* We have a pte table, so load the MI_TWC with the attributes
11924 * for this "segment."
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
11932 @@ -369,7 +369,7 @@
11933 * set. All other Linux PTE bits control the behavior
11938 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
11940 #ifdef CONFIG_8xx_CPU6
11941 @@ -388,15 +388,6 @@
11945 -2: mfspr r20, M_TW /* Restore registers */
11949 -#ifdef CONFIG_8xx_CPU6
11952 - b InstructionAccess
11956 #ifdef CONFIG_8xx_CPU6
11957 @@ -422,12 +413,12 @@
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 */
11963 /* We have a pte table, so load fetch the pte from the table.
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
11971 @@ -461,7 +452,7 @@
11972 * set. All other Linux PTE bits control the behavior
11977 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
11979 #ifdef CONFIG_8xx_CPU6
11980 @@ -480,24 +471,6 @@
11985 - /* Copy 20 msb from MD_EPN to DAR since the dcxx instructions fail
11986 - * to update DAR when they cause a DTLB miss.
11988 - mfspr r21, MD_EPN
11990 - rlwimi r20, r21, 0, 0, 19
11993 - mfspr r20, M_TW /* Restore registers */
11997 -#ifdef CONFIG_8xx_CPU6
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 @@
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);
12020 if (iov != iovstack)
12022 @@ -3666,7 +3664,8 @@
12023 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
12024 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
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)
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);
12035 clen64 = kcmsg32->cmsg_len;
12036 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12037 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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;
12045 unsigned long cmsg_ptr;
12046 + __kernel_size_t cmsg_len;
12047 int err, total_len, len = 0;
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 @@
12053 cmsg_ptr = (unsigned long) kern_msg.msg_control;
12054 + cmsg_len = kern_msg.msg_controllen;
12055 kern_msg.msg_flags = 0;
12057 sock = sockfd_lookup(fd, &err);
12058 @@ -3795,7 +3799,8 @@
12059 * to fix it up before we tack on more stuff.
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);
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;
12079 @@ -1145,11 +1144,9 @@
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);
12093 @@ -2600,7 +2597,8 @@
12094 * IPV6_RTHDR ipv6 routing exthdr 32-bit clean
12095 * IPV6_AUTHHDR ipv6 auth exthdr 32-bit clean
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)
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);
12106 clen64 = kcmsg32->cmsg_len;
12107 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12108 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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 @@
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)
12121 if(!msg->msg_control)
12123 @@ -2905,7 +2907,7 @@
12124 * to fix it up before we tack on more stuff.
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);
12132 @@ -2919,14 +2921,14 @@
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)
12139 struct scm_cookie scm;
12141 memset(&scm, 0, sizeof(scm));
12142 size = sock->ops->recvmsg(sock, msg, size, flags, &scm);
12144 - scm_recv32(sock, msg, &scm, flags, cmsg_ptr);
12145 + scm_recv32(sock, msg, &scm, flags, cmsg_ptr, cmsg_len);
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;
12156 /* kernel mode address */
12157 @@ -2986,11 +2989,12 @@
12160 cmsg_ptr = (unsigned long)msg_sys.msg_control;
12161 + cmsg_len = msg_sys.msg_controllen;
12162 msg_sys.msg_flags = 0;
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);
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
12176 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
12177 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
12179 + * 2004-12-25 Krzysztof Helt (krzysztof.h1@wp.pl)
12180 + * - fixed registers constrains in inline assembly declarations
12183 #include <linux/kernel.h>
12184 @@ -125,7 +128,7 @@
12187 : "=r" (rs1), "=r" (rs2)
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 @@
12196 : "=r" (rs1), "=r" (rs2)
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 @@
12205 : "=r" (rs1), "=r" (rs2)
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 @@
12214 : "=r" (rs1), "=r" (rs2)
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 @@
12228 + /* FPU must be disabled on SMP. */
12229 + childregs->psr &= ~PSR_EF;
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 @@
12240 if (!(current->thread.flags & SPARC_FLAG_32BIT))
12243 + usp &= 0xffffffffUL;
12245 return (void *) (usp - len);
12247 @@ -696,6 +698,7 @@
12253 case SIOCGIFMETRIC:
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 @@
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)
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];
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.
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 */
12287 +struct pci_pbm_info *pbm_for_ino(struct pci_controller_info *p, u32 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;
12295 + printk("PCI%d: No ino_bitmap entry for ino[%x], bitmaps "
12296 + "PBM_A[%016lx] PBM_B[%016lx]",
12298 + p->pbm_A.ino_bitmap,
12299 + p->pbm_B.ino_bitmap);
12300 + printk("PCI%d: Using PBM_A, report this problem immediately.\n",
12303 + return &p->pbm_A;
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)
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;
12315 + /* Do not clear the interrupt for the other PCI bus.
12317 + * This "ACK both PBM IRQs" only needs to be performed
12318 + * for chip-wide error interrupts.
12320 + if ((irq & IMAP_INO) == SCHIZO_PCIERR_A_INO ||
12321 + (irq & IMAP_INO) == SCHIZO_PCIERR_B_INO)
12324 + pbm = pbm_for_ino(p, irq);
12325 + if (pbm == &p->pbm_A)
12330 + irq = schizo_irq_build(pbm, NULL,
12331 + (pbm->portid << 6) | (irq & IMAP_INO));
12332 + bucket = __bucket(irq);
12333 + iclr = bucket->iclr;
12335 - iclr += (SCHIZO_PBM_B_REGS_OFF - SCHIZO_PBM_A_REGS_OFF);
12336 upa_writel(ICLR_IDLE, iclr);
12339 @@ -790,7 +828,7 @@
12340 /* Interrogate IOMMU for error status. */
12341 schizo_check_iommu_error(p, UE_ERR);
12343 - schizo_clear_other_err_intr(irq);
12344 + schizo_clear_other_err_intr(p, irq);
12347 #define SCHIZO_CE_AFSR 0x10040UL
12348 @@ -879,7 +917,7 @@
12352 - schizo_clear_other_err_intr(irq);
12353 + schizo_clear_other_err_intr(p, irq);
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);
12374 - schizo_clear_other_err_intr(irq);
12375 + schizo_clear_other_err_intr(p, irq);
12378 #define SCHIZO_SAFARI_ERRLOG 0x10018UL
12379 @@ -1149,7 +1187,7 @@
12380 printk("PCI%d: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n",
12383 - schizo_clear_other_err_intr(irq);
12384 + schizo_clear_other_err_intr(p, irq);
12388 @@ -1157,7 +1195,7 @@
12390 schizo_check_iommu_error(p, SAFARI_ERR);
12392 - schizo_clear_other_err_intr(irq);
12393 + schizo_clear_other_err_intr(p, irq);
12396 /* Nearly identical to PSYCHO equivalents... */
12397 @@ -1171,26 +1209,6 @@
12398 #define SCHIZO_SAFARI_IRQCTRL 0x10010UL
12399 #define SCHIZO_SAFIRQCTRL_EN 0x8000000000000000UL
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 */
12407 -struct pci_pbm_info *pbm_for_ino(struct pci_controller_info *p, u32 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",
12421 /* How the Tomatillo IRQs are routed around is pure guesswork here.
12423 * All the Tomatillo devices I see in prtconf dumps seem to have only
12424 @@ -1964,7 +1982,7 @@
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;
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;
12437 + if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO &&
12438 + pbm->chip_version <= 0x1)
12439 + tmp |= (1UL << 61);
12441 + tmp &= ~(1UL << 61);
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);
12449 schizo_write(pbm->pbm_regs + SCHIZO_PCI_CTRL, tmp);
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)
12457 if (smp_processors_ready) {
12458 - int result = __atomic_add(1, &smp_capture_depth);
12459 + int result = atomic_add_ret(1, &smp_capture_depth);
12461 membar("#StoreStore | #LoadStore");
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);
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);
12477 EXPORT_SYMBOL(atomic_dec_and_lock);
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);
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 @@
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)
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;
12515 + p = kmalloc(second + sizeof (struct msgbuf), GFP_USER);
12519 + up = (struct msgbuf32 *)uptr;
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))
12526 - old_fs = get_fs ();
12527 - set_fs (KERNEL_DS);
12528 - err = sys_msgsnd (first, p, second, third);
12531 + old_fs = get_fs();
12532 + set_fs(KERNEL_DS);
12533 + err = sys_msgsnd(first, p, second, third);
12541 @@ -535,6 +542,9 @@
12542 mm_segment_t old_fs;
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))
12560 @@ -647,18 +657,18 @@
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)
12567 unsigned long raddr;
12568 - u32 *uaddr = (u32 *)A((u32)third);
12569 + u32 *uaddr = (u32 *)A(third);
12574 - err = sys_shmat (first, uptr, second, &raddr);
12575 + err = sys_shmat(first, uptr, second, &raddr);
12578 - err = put_user (raddr, uaddr);
12579 + err = put_user(raddr, uaddr);
12583 @@ -770,6 +780,8 @@
12585 if (!(current->thread.flags & SPARC_FLAG_32BIT))
12588 + usp &= 0xffffffffUL;
12590 return (void *) (usp - len);
12592 @@ -795,9 +807,11 @@
12593 return sys_semtimedop(semid, tsems, nsems, t64);
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)
12600 + u32 ptr = (u32) __ptr;
12601 + u32 fifth = (u32) __fifth;
12603 version = call >> 16; /* hack for backward compatibility */
12605 @@ -806,15 +820,23 @@
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),
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),
12619 + (const struct timespec32 *)
12622 - err = sys_semget (first, second, third);
12623 + err = sys_semget((key_t)first, (int)second,
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));
12633 @@ -823,17 +845,20 @@
12634 if (call <= MSGCTL)
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));
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));
12649 - err = sys_msgget ((key_t) first, second);
12650 + err = sys_msgget((key_t)first, (int)second);
12653 - err = do_sys32_msgctl (first, second, (void *)AA(ptr));
12654 + err = do_sys32_msgctl((int)first, (int)second,
12659 @@ -842,17 +867,18 @@
12660 if (call <= SHMCTL)
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));
12669 - err = sys_shmdt ((char *)AA(ptr));
12670 + err = sys_shmdt((char *)A(ptr));
12673 - err = sys_shmget (first, second, third);
12674 + err = sys_shmget((key_t)first, second, (int)third);
12677 - err = do_sys32_shmctl (first, second, (void *)AA(ptr));
12678 + err = do_sys32_shmctl((int)first, (int)second,
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;
12691 @@ -1140,11 +1165,9 @@
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);
12705 @@ -2160,9 +2183,6 @@
12706 timeout = (timespec_to_jiffies(&ts)
12707 + (ts.tv_sec || ts.tv_nsec));
12709 - current->state = TASK_INTERRUPTIBLE;
12710 - timeout = schedule_timeout(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
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)
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);
12728 clen64 = kcmsg32->cmsg_len;
12729 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
12730 + (clen64 > (orig_cmsg_len + wp - workbuf)))
12732 if (kcmsg32->cmsg_level == SOL_SOCKET &&
12733 kcmsg32->cmsg_type == SO_TIMESTAMP) {
12735 @@ -2782,6 +2806,7 @@
12736 struct sockaddr *uaddr;
12738 unsigned long cmsg_ptr;
12739 + __kernel_size_t cmsg_len;
12740 int err, total_len, len = 0;
12742 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
12743 @@ -2797,6 +2822,7 @@
12746 cmsg_ptr = (unsigned long) kern_msg.msg_control;
12747 + cmsg_len = kern_msg.msg_controllen;
12748 kern_msg.msg_flags = 0;
12750 sock = sockfd_lookup(fd, &err);
12751 @@ -2822,7 +2848,8 @@
12752 * to fix it up before we tack on more stuff.
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);
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 @@
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;
12781 mstk48t59_regs = edev->resource[0].start;
12782 @@ -850,7 +852,8 @@
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;
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
12796 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
12799 +#include <linux/config.h>
12800 #include <asm/asi.h>
12802 + /* On SMP we need to use memory barriers to ensure
12803 + * correct memory operation ordering, nop these out
12804 + * for uniprocessor.
12807 +#define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad
12808 +#define ATOMIC_POST_BARRIER membar #StoreLoad | #StoreStore
12810 +#define ATOMIC_PRE_BARRIER nop
12811 +#define ATOMIC_POST_BARRIER nop
12817 .globl atomic_impl_begin, atomic_impl_end
12819 - .globl __atomic_add
12821 -__atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
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.
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
12839 + .size atomic_add, .-atomic_add
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
12852 + .size atomic_sub, .-atomic_sub
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
12860 cas [%o1], %g5, %g7
12862 - bne,pn %icc, __atomic_add
12863 - membar #StoreLoad | #StoreStore
12865 + add %g7, %o0, %g7
12866 + ATOMIC_POST_BARRIER
12868 - add %g7, %o0, %o0
12870 + .size atomic_add_ret, .-atomic_add_ret
12872 - .globl __atomic_sub
12873 -__atomic_sub: /* %o0 = increment, %o1 = atomic_ptr */
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
12881 cas [%o1], %g5, %g7
12883 - bne,pn %icc, __atomic_sub
12884 - membar #StoreLoad | #StoreStore
12886 + sub %g7, %o0, %g7
12887 + ATOMIC_POST_BARRIER
12889 - sub %g7, %o0, %o0
12891 + .size atomic_sub_ret, .-atomic_sub_ret
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)
12900 +#include <linux/config.h>
12901 #include <asm/asi.h>
12903 + /* On SMP we need to use memory barriers to ensure
12904 + * correct memory operation ordering, nop these out
12905 + * for uniprocessor.
12908 +#define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad
12909 +#define BITOP_POST_BARRIER membar #StoreLoad | #StoreStore
12911 +#define BITOP_PRE_BARRIER nop
12912 +#define BITOP_POST_BARRIER nop
12918 .globl __bitops_begin
12921 - .globl ___test_and_set_bit
12922 -___test_and_set_bit: /* %o0=nr, %o1=addr */
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
12935 -1: andcc %g7, %g5, %o0
12937 - xor %g7, %g5, %g1
12940 casx [%o1], %g7, %g1
12942 - bne,a,pn %xcc, 1b
12945 - membar #StoreLoad | #StoreStore
12947 - .globl ___test_and_clear_bit
12948 -___test_and_clear_bit: /* %o0=nr, %o1=addr */
12950 + and %g7, %g5, %g2
12951 + BITOP_POST_BARRIER
12954 + movrne %g2, 1, %o0
12955 + .size test_and_set_bit, .-test_and_set_bit
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
12968 -1: andcc %g7, %g5, %o0
12970 - xor %g7, %g5, %g1
12972 + andn %g7, %g5, %g1
12973 casx [%o1], %g7, %g1
12975 - bne,a,pn %xcc, 1b
12978 - membar #StoreLoad | #StoreStore
12980 - .globl ___test_and_change_bit
12981 -___test_and_change_bit: /* %o0=nr, %o1=addr */
12983 + and %g7, %g5, %g2
12984 + BITOP_POST_BARRIER
12987 + movrne %g2, 1, %o0
12988 + .size test_and_clear_bit, .-test_and_clear_bit
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
12998 + sllx %g5, %g2, %g5
12999 + add %o1, %g3, %o1
13001 + xor %g7, %g5, %g1
13002 + casx [%o1], %g7, %g1
13005 + and %g7, %g5, %g2
13006 + BITOP_POST_BARRIER
13009 + movrne %g2, 1, %o0
13010 + .size test_and_change_bit, .-test_and_change_bit
13013 + .type set_bit,#function
13014 +set_bit: /* %o0=nr, %o1=addr */
13019 + sllx %g5, %g2, %g5
13020 + add %o1, %g3, %o1
13023 + casx [%o1], %g7, %g1
13029 + .size set_bit, .-set_bit
13032 + .type clear_bit,#function
13033 +clear_bit: /* %o0=nr, %o1=addr */
13038 + sllx %g5, %g2, %g5
13039 + add %o1, %g3, %o1
13041 + andn %g7, %g5, %g1
13042 + casx [%o1], %g7, %g1
13048 + .size clear_bit, .-clear_bit
13050 + .globl change_bit
13051 + .type change_bit,#function
13052 +change_bit: /* %o0=nr, %o1=addr */
13060 -1: and %g7, %g5, %o0
13063 casx [%o1], %g7, %g1
13065 - bne,a,pn %xcc, 1b
13068 - membar #StoreLoad | #StoreStore
13071 - .globl ___test_and_set_le_bit
13072 -___test_and_set_le_bit: /* %o0=nr, %o1=addr */
13077 - sllx %g5, %g2, %g5
13078 - add %o1, %g3, %o1
13079 - lduwa [%o1] ASI_PL, %g7
13080 -1: andcc %g7, %g5, %o0
13082 - xor %g7, %g5, %g1
13083 - casa [%o1] ASI_PL, %g7, %g1
13085 - bne,a,pn %icc, 1b
13086 - lduwa [%o1] ASI_PL, %g7
13088 - membar #StoreLoad | #StoreStore
13090 - .globl ___test_and_clear_le_bit
13091 -___test_and_clear_le_bit: /* %o0=nr, %o1=addr */
13096 - sllx %g5, %g2, %g5
13097 - add %o1, %g3, %o1
13098 - lduwa [%o1] ASI_PL, %g7
13099 -1: andcc %g7, %g5, %o0
13101 - xor %g7, %g5, %g1
13102 - casa [%o1] ASI_PL, %g7, %g1
13104 - bne,a,pn %icc, 1b
13105 - lduwa [%o1] ASI_PL, %g7
13107 - membar #StoreLoad | #StoreStore
13112 + .size change_bit, .-change_bit
13114 .globl __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 @@
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--;
13130 __asm__ __volatile__(
13131 +" membar #StoreLoad | #LoadLoad\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 @@
13141 __read_unlock: /* %o0 = lock_ptr */
13142 + membar #StoreLoad | #LoadLoad
13145 cas [%o0], %g5, %g7
13148 - membar #StoreLoad | #StoreStore
13150 ba,a,pt %xcc, __read_unlock
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
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)
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);
13169 clen64 = kcmsg32->cmsg_len;
13170 + if ((clen64 < CMSG_ALIGN(sizeof(*ucmsg))) ||
13171 + (clen64 > (orig_cmsg_len + wp - workbuf)))
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;
13179 unsigned long cmsg_ptr;
13180 + __kernel_size_t cmsg_len;
13181 int err, total_len, len = 0;
13183 if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
13184 @@ -433,6 +438,7 @@
13187 cmsg_ptr = (unsigned long) kern_msg.msg_control;
13188 + cmsg_len = kern_msg.msg_controllen;
13189 kern_msg.msg_flags = 0;
13191 sock = sockfd_lookup(fd, &err);
13192 @@ -458,7 +464,8 @@
13193 * to fix it up before we tack on more stuff.
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);
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
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 @@
13217 + if (acpi_skip_timer_override &&
13218 + intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
13219 + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
13223 mp_override_legacy_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:
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;
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");
13243 + /* RED-PEN skip them on mptables too? */
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)
13254 - extern int interrupt_line_quirk;
13255 + extern int via_interrupt_line_quirk;
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 @@
13261 /* VIA bridges use interrupt line for apic/pci steering across
13263 - else if (interrupt_line_quirk)
13264 + else if (via_interrupt_line_quirk)
13265 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
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
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 @@
13287 -o <http://oss.software.ibm.com/jfs/>
13288 +o <http://jfs.sourceforge.net/>
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 @@
13299 +CONFIG_SCSI_SATA_QSTOR
13300 + This option enables support for Pacific Digital Serial ATA QStor.
13302 + If unsure, say N.
13304 CONFIG_SCSI_SATA_SX4
13305 This option enables support for Promise Serial ATA SX4.
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
13311 IBM's Journaled File System (JFS) for Linux
13313 -JFS Homepage: http://oss.software.ibm.com/jfs/
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/
13323 The following mount options are supported:
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).
13333 resize=value Resize the volume to <value> blocks. JFS only supports
13334 growing a volume, not shrinking it. This option is only
13336 Please send bugs, comments, cards and letters to shaggy@austin.ibm.com.
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 @@
13346 For now, you can ignore the `flags' parameter. It is there for future use.
13348 - /* Unique ID allocation */
13349 - static int foo_id = 0;
13351 int foo_detect_client(struct i2c_adapter *adapter, int address,
13352 unsigned short flags, int kind)
13354 @@ -518,7 +515,6 @@
13356 /* SENSORS ONLY END */
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 */
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 @@
13369 + extern int via_interrupt_line_quirk;
13371 ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
13373 @@ -383,6 +384,9 @@
13377 + if (via_interrupt_line_quirk)
13378 + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15);
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 ;
13390 - /* Anyone capable of this syscall can do *real bad* things */
13392 - if (!capable(CAP_SYS_ADMIN))
13396 dev = MINOR(inode->i_rdev);
13397 @@ -419,6 +416,20 @@
13400 lo = &nbd_dev[dev];
13402 + /* these are innocent, but.... */
13405 + return put_user(nbd_bytesizes[dev] >> 9, (unsigned long *) arg);
13406 + case BLKGETSIZE64:
13407 + return put_user((u64)nbd_bytesizes[dev], (u64 *) arg);
13410 + /* ... anyone capable of any of the below ioctls can do *real bad*
13412 + if (!capable(CAP_SYS_ADMIN))
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);
13423 - return put_user(nbd_bytesizes[dev] >> 9, (unsigned long *) arg);
13424 - case BLKGETSIZE64:
13425 - return put_user((u64)nbd_bytesizes[dev], (u64 *) arg);
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 @@
13434 static struct miscdevice au1000gpio_miscdev =
13437 + MISC_DYNAMIC_MINOR,
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
13446 + * Driver for Alchemy Au1550 SPI on the PSC.
13448 + * Copyright 2004 Embedded Edge, LLC.
13449 + * dan@embeddededge.com
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.
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.
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.
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>
13484 +#ifdef CONFIG_MIPS_PB1550
13485 +#include <asm/pb1550.h>
13488 +#ifdef CONFIG_MIPS_DB1550
13489 +#include <asm/db1x00.h>
13492 +#ifdef CONFIG_MIPS_PB1200
13493 +#include <asm/pb1200.h>
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
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.
13510 +/* The maximum clock rate specified in the manual is 2mHz.
13512 +#define MAX_BAUD_RATE (2 * 1000000)
13513 +#define PSC_INTCLK_RATE (32 * 1000000)
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.
13521 +static uint spi_datalen;
13524 +au1550spi_master_done( int ms )
13527 + volatile psc_spi_t *sp;
13529 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13531 + /* Loop until MD is set or timeout has expired */
13532 + while(!(sp->psc_spievent & PSC_SPIEVNT_MD) && timeout--) udelay(1000);
13537 + sp->psc_spievent |= PSC_SPIEVNT_MD;
13543 +au1550spi_open(struct inode *inode, struct file *file)
13550 + MOD_INC_USE_COUNT;
13556 +au1550spi_write(struct file *fp, const char *bp, size_t count, loff_t *ppos)
13559 + size_t rcount, retval;
13560 + unsigned char sb, *rp, *wp;
13561 + uint fifoword, pcr, stat;
13562 + volatile psc_spi_t *sp;
13564 + /* Get the number of bytes per transfer.
13566 + bytelen = ((spi_datalen - 1) / 8) + 1;
13568 + /* User needs to send us multiple of this count.
13570 + if ((count % bytelen) != 0)
13573 + rp = wp = (unsigned char *)bp;
13574 + retval = rcount = count;
13576 + /* Reset the FIFO.
13578 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13579 + sp->psc_spipcr = (PSC_SPIPCR_RC | PSC_SPIPCR_TC);
13582 + pcr = sp->psc_spipcr;
13584 + } while (pcr != 0);
13586 + /* Prime the transmit FIFO.
13588 + while (count > 0) {
13590 + for (i=0; i<bytelen; i++) {
13592 + if (get_user(sb, wp) < 0)
13597 + count -= bytelen;
13599 + fifoword |= PSC_SPITXRX_LC;
13600 + sp->psc_spitxrx = fifoword;
13602 + stat = sp->psc_spistat;
13604 + if (stat & PSC_SPISTAT_TF)
13608 + /* Start the transfer.
13610 + sp->psc_spipcr = PSC_SPIPCR_MS;
13613 + /* Now, just keep the transmit fifo full and empty the receive.
13615 + while (count > 0) {
13616 + stat = sp->psc_spistat;
13618 + while ((stat & PSC_SPISTAT_RE) == 0) {
13619 + fifoword = sp->psc_spitxrx;
13621 + for (i=0; i<bytelen; i++) {
13622 + sb = fifoword & 0xff;
13623 + if (put_user(sb, rp) < 0)
13628 + rcount -= bytelen;
13629 + stat = sp->psc_spistat;
13632 + if ((stat & PSC_SPISTAT_TF) == 0) {
13634 + for (i=0; i<bytelen; i++) {
13636 + if (get_user(sb, wp) < 0)
13641 + count -= bytelen;
13643 + fifoword |= PSC_SPITXRX_LC;
13644 + sp->psc_spitxrx = fifoword;
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.
13653 + while (rcount > 0) {
13654 + stat = sp->psc_spistat;
13656 + if ((stat & PSC_SPISTAT_RE) == 0) {
13657 + fifoword = sp->psc_spitxrx;
13659 + for (i=0; i<bytelen; i++) {
13660 + sb = fifoword & 0xff;
13661 + if (put_user(sb, rp) < 0)
13666 + rcount -= bytelen;
13670 + /* Wait for MasterDone event. 30ms timeout */
13671 + if (!au1550spi_master_done(30) ) retval = -EFAULT;
13676 +au1550spi_release(struct inode *inode, struct file *file)
13678 + MOD_DEC_USE_COUNT;
13685 +/* Set the baud rate closest to the request, then return the actual
13686 + * value we are using.
13689 +set_baud_rate(uint baud)
13691 + uint rate, tmpclk, brg, ctl, stat;
13692 + volatile psc_spi_t *sp;
13694 + /* For starters, the input clock is divided by two.
13696 + tmpclk = PSC_INTCLK_RATE/2;
13698 + rate = tmpclk / baud;
13700 + /* The dividers work as follows:
13701 + * baud = tmpclk / (2 * (brg + 1))
13703 + brg = (rate/2) - 1;
13705 + /* Test BRG to ensure it will fit into the 6 bits allocated.
13708 + /* Make sure the device is disabled while we make the change.
13710 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13711 + ctl = sp->psc_spicfg;
13713 + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
13715 + ctl = PSC_SPICFG_CLR_BAUD(ctl);
13716 + ctl |= PSC_SPICFG_SET_BAUD(brg);
13717 + sp->psc_spicfg = ctl;
13720 + /* If the device was running prior to getting here, wait for
13723 + if (ctl & PSC_SPICFG_DE_ENABLE) {
13725 + stat = sp->psc_spistat;
13727 + } while ((stat & PSC_SPISTAT_DR) == 0);
13730 + /* Return the actual value.
13732 + rate = tmpclk / (2 * (brg + 1));
13738 +set_word_len(uint len)
13741 + volatile psc_spi_t *sp;
13743 + if ((len < 4) || (len > 24))
13746 + /* Make sure the device is disabled while we make the change.
13748 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13749 + ctl = sp->psc_spicfg;
13751 + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
13753 + ctl = PSC_SPICFG_CLR_LEN(ctl);
13754 + ctl |= PSC_SPICFG_SET_LEN(len);
13755 + sp->psc_spicfg = ctl;
13758 + /* If the device was running prior to getting here, wait for
13761 + if (ctl & PSC_SPICFG_DE_ENABLE) {
13763 + stat = sp->psc_spistat;
13765 + } while ((stat & PSC_SPISTAT_DR) == 0);
13772 +au1550spi_ioctl(struct inode *inode, struct file *file,
13773 + unsigned int cmd, unsigned long arg)
13781 + case AU1550SPI_WORD_LEN:
13782 + status = set_word_len(arg);
13785 + case AU1550SPI_SET_BAUD:
13786 + if (get_user(val, (u32 *)arg))
13789 + val = set_baud_rate(val);
13790 + if (put_user(val, (u32 *)arg))
13795 + status = -ENOIOCTLCMD;
13803 +static struct file_operations au1550spi_fops =
13805 + owner: THIS_MODULE,
13806 + write: au1550spi_write,
13807 + ioctl: au1550spi_ioctl,
13808 + open: au1550spi_open,
13809 + release: au1550spi_release,
13813 +static struct miscdevice au1550spi_miscdev =
13815 + MISC_DYNAMIC_MINOR,
13822 +au1550spi_init(void)
13824 + uint clk, rate, stat;
13825 + volatile psc_spi_t *sp;
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.
13833 + rate = get_au1x00_speed();
13834 + rate /= PSC_INTCLK_RATE;
13836 + /* The FRDIV in the frequency control is (FRDIV + 1) * 2
13840 + clk = au_readl(SYS_FREQCTRL1);
13842 + clk &= ~SYS_FC_FRDIV3_MASK;
13843 + clk |= (rate << SYS_FC_FRDIV3_BIT);
13844 + clk |= SYS_FC_FE3;
13845 + au_writel(clk, SYS_FREQCTRL1);
13848 + /* Set up the clock source routing to get Freq3 to PSC0_intclk.
13850 + clk = au_readl(SYS_CLKSRC);
13854 + au_writel(clk, SYS_CLKSRC);
13857 + /* Set up GPIO pin function to drive PSC0_SYNC1, which is
13858 + * the SPI Select.
13860 + clk = au_readl(SYS_PINFUNC);
13863 + au_writel(clk, SYS_PINFUNC);
13866 + /* Now, set up the PSC for SPI PIO mode.
13868 + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
13869 + sp->psc_ctrl = PSC_CTRL_DISABLE;
13871 + sp->psc_sel = PSC_SEL_PS_SPIMODE;
13872 + sp->psc_spicfg = 0;
13874 + sp->psc_ctrl = PSC_CTRL_ENABLE;
13877 + stat = sp->psc_spistat;
13879 + } while ((stat & PSC_SPISTAT_SR) == 0);
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);
13885 + sp->psc_spimsk = PSC_SPIMSK_ALLMASK;
13888 + set_baud_rate(1000000);
13890 + sp->psc_spicfg |= PSC_SPICFG_DE_ENABLE;
13892 + stat = sp->psc_spistat;
13894 + } while ((stat & PSC_SPISTAT_DR) == 0);
13896 + misc_register(&au1550spi_miscdev);
13897 + printk("Au1550 SPI driver\n");
13903 +au1550spi_exit(void)
13905 + misc_deregister(&au1550spi_miscdev);
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
13918 -if [ "$CONFIG_MIPS" = "y" -a "$CONFIG_NEW_TIME_C" = "y" ]; then
13919 - tristate 'Generic MIPS RTC Support' CONFIG_MIPS_RTC
13921 if [ "$CONFIG_SGI_IP22" = "y" ]; then
13922 - bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
13923 + tristate 'Dallas DS1286 RTC support' CONFIG_DS1286
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
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
13936 +if [ "$CONFIG_X86" = "y" ]; then
13937 + tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
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
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
13955 * choose the right serial device at boot time
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.
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.
13973 + * Copyright (C) 2004 Maciej W. Rozycki
13976 #include <linux/config.h>
13977 +#include <linux/errno.h>
13978 #include <linux/init.h>
13980 #include <asm/dec/machtype.h>
13981 +#include <asm/dec/serial.h>
13983 +extern int register_zs_hook(unsigned int channel,
13984 + struct dec_serial_hook *hook);
13985 +extern int unregister_zs_hook(unsigned int channel);
13987 +extern int register_dz_hook(unsigned int channel,
13988 + struct dec_serial_hook *hook);
13989 +extern int unregister_dz_hook(unsigned int channel);
13991 +int register_dec_serial_hook(unsigned int channel,
13992 + struct dec_serial_hook *hook)
13995 -extern int zs_init(void);
13997 + return register_zs_hook(channel, hook);
14001 -extern int dz_init(void);
14003 + return register_dz_hook(channel, hook);
14008 -#ifdef CONFIG_SERIAL_DEC_CONSOLE
14010 +int unregister_dec_serial_hook(unsigned int channel)
14013 -extern void zs_serial_console_init(void);
14015 + return unregister_zs_hook(channel);
14019 -extern void dz_serial_console_init(void);
14023 + return unregister_dz_hook(channel);
14028 -/* rs_init - starts up the serial interface -
14029 - handle normal case of starting up the serial interface */
14031 -#ifdef CONFIG_SERIAL_DEC
14032 +extern int zs_init(void);
14033 +extern int dz_init(void);
14036 + * rs_init - starts up the serial interface -
14037 + * handle normal case of starting up the serial interface
14039 int __init rs_init(void)
14042 -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
14044 - return zs_init();
14046 - return dz_init();
14050 - return zs_init();
14052 + return zs_init();
14056 - return dz_init();
14060 + return dz_init();
14065 __initcall(rs_init);
14069 #ifdef CONFIG_SERIAL_DEC_CONSOLE
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);
14077 + * dec_serial_console_init handles the special case of starting
14078 + * up the console on the serial port
14080 void __init dec_serial_console_init(void)
14082 -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
14084 - zs_serial_console_init();
14086 - dz_serial_console_init();
14090 - zs_serial_console_init();
14092 + zs_serial_console_init();
14096 - dz_serial_console_init();
14100 + dz_serial_console_init();
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
14109 * DS1286 Real Time Clock interface for Linux
14111 + * Copyright (C) 2003 TimeSys Corp.
14112 + * S. James Hill (James.Hill@timesys.com)
14113 + * (sjhill@realitydiluted.com)
14115 * Copyright (C) 1998, 1999, 2000 Ralf Baechle
14117 * Based on code written by Paul Gortmaker.
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 @@
14130 +void rtc_ds1286_wait(void)
14132 + unsigned char sec = CMOS_READ(RTC_SECONDS);
14133 + while (sec == CMOS_READ(RTC_SECONDS));
14136 static int ds1286_ioctl(struct inode *inode, struct file *file,
14137 unsigned int cmd, unsigned long arg)
14139 @@ -249,23 +260,22 @@
14141 spin_lock_irq(&ds1286_lock);
14143 - if (ds1286_status & RTC_IS_OPEN)
14145 + if (ds1286_status & RTC_IS_OPEN) {
14146 + spin_unlock_irq(&ds1286_lock);
14150 ds1286_status |= RTC_IS_OPEN;
14152 - spin_lock_irq(&ds1286_lock);
14153 + spin_unlock_irq(&ds1286_lock);
14157 - spin_lock_irq(&ds1286_lock);
14161 static int ds1286_release(struct inode *inode, struct file *file)
14163 + spin_lock_irq(&ds1286_lock);
14164 ds1286_status &= ~RTC_IS_OPEN;
14166 + spin_unlock_irq(&ds1286_lock);
14170 @@ -276,32 +286,6 @@
14175 - * The various file operations we support.
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,
14187 -static struct miscdevice ds1286_dev=
14189 - .minor = RTC_MINOR,
14191 - .fops = &ds1286_fops,
14194 -int __init ds1286_init(void)
14196 - printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
14197 - return misc_register(&ds1286_dev);
14200 static char *days[] = {
14201 "***", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
14203 @@ -528,3 +512,38 @@
14204 BCD_TO_BIN(alm_tm->tm_hour);
14205 alm_tm->tm_sec = 0;
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,
14218 +static struct miscdevice ds1286_dev =
14220 + .minor = RTC_MINOR,
14222 + .fops = &ds1286_fops,
14225 +static int __init ds1286_init(void)
14227 + printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
14228 + return misc_register(&ds1286_dev);
14231 +static void __exit ds1286_exit(void)
14233 + misc_deregister(&ds1286_dev);
14236 +module_init(ds1286_init);
14237 +module_exit(ds1286_exit);
14238 +EXPORT_NO_SYMBOLS;
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);
14249 + memset(&tm, 0, sizeof(struct rtc_time));
14252 /* check each field one by one */
14253 @@ -216,6 +217,7 @@
14254 unsigned long curr_time;
14256 curr_time = rtc_ds1742_get_time();
14257 + memset(&tm, 0, sizeof(struct rtc_time));
14258 to_tm(curr_time, &tm);
14261 @@ -251,8 +253,8 @@
14263 void rtc_ds1742_wait(void)
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));
14271 static int ds1742_ioctl(struct inode *inode, struct file *file,
14272 @@ -264,6 +266,7 @@
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 @@
14285 printk("Dummy keyboard driver installed.\n");
14287 +#ifdef CONFIG_MAGIC_SYSRQ
14288 +unsigned char kbd_sysrq_key;
14289 +unsigned char kbd_sysrq_xlate[128];
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
14296 - * dz.c: Serial port driver for DECStations equiped
14297 + * dz.c: Serial port driver for DECstations equipped
14298 * with the DZ chipset.
14300 * Copyright (C) 1998 Olivier A. D. Lebaillif
14302 * Email: olivier.lebaillif@ifrsys.com
14304 + * Copyright (C) 2004 Maciej W. Rozycki
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
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>
14321 -#define CONSOLE_LINE (3) /* for definition of struct console */
14322 +#ifdef CONFIG_MAGIC_SYSRQ
14323 +#include <linux/sysrq.h>
14328 -#define DZ_INTR_DEBUG 1
14330 DECLARE_TASK_QUEUE(tq_serial);
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;
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];
14341 +static int serial_refcount;
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.
14354 -static void debug_console(const char *s, int count)
14357 +static unsigned char *tmp_buf;
14358 +static DECLARE_MUTEX(tmp_buf_sem);
14360 - for (i = 0; i < count; i++) {
14362 - prom_printf("%c", 13);
14363 - prom_printf("%c", *s++);
14366 +static char *dz_name __initdata = "DECstation DZ serial driver version ";
14367 +static char *dz_version __initdata = "1.03";
14369 +static struct dz_serial *lines[DZ_NB_PORT];
14370 +static unsigned char tmp_buffer[256];
14372 +#ifdef CONFIG_SERIAL_DEC_CONSOLE
14373 +static struct console dz_sercons;
14375 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
14377 +static unsigned long break_pressed; /* break, really ... */
14380 +static void change_speed (struct dz_serial *);
14382 +static int baud_table[] = {
14383 + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
14388 * ------------------------------------------------------------
14389 * dz_in () and dz_out ()
14390 @@ -94,15 +120,16 @@
14392 volatile unsigned short *addr =
14393 (volatile unsigned short *) (info->port + offset);
14398 static inline void dz_out(struct dz_serial *info, unsigned offset,
14399 unsigned short value)
14402 volatile unsigned short *addr =
14403 (volatile unsigned short *) (info->port + offset);
14408 @@ -143,25 +170,24 @@
14410 tmp |= mask; /* set the TX flag */
14411 dz_out(info, DZ_TCR, tmp);
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
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.
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
14434 * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c
14436 - * and look at the resulting assemble code in serial.s.
14437 + * and look at the resulting assemble code in dz.s.
14439 * ------------------------------------------------------------
14441 @@ -188,101 +214,97 @@
14442 * This routine deals with inputs from any lines.
14443 * ------------------------------------------------------------
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)
14450 struct dz_serial *info;
14451 - struct tty_struct *tty = 0;
14452 + struct tty_struct *tty;
14453 struct async_icount *icount;
14455 - unsigned short status, tmp;
14456 - unsigned char ch;
14458 - /* this code is going to be a problem...
14459 - the call to tty_flip_buffer is going to need
14460 - to be rethought...
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;
14470 - /* punt so we don't get duplicate characters */
14471 - if (!(status & DZ_DVAL))
14472 - goto ignore_char;
14474 - ch = UCHAR(status); /* grab the char */
14477 - if (info->is_console) {
14479 - return; /* it's a break ... */
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 */
14486 - tty = info->tty; /* now tty points to the proper dev */
14487 - icount = &info->icount;
14488 + ch = UCHAR(status); /* grab the char */
14492 - if (tty->flip.count >= TTY_FLIPBUF_SIZE)
14494 + if (!tty && (!info->hook || !info->hook->rx_char))
14497 - *tty->flip.char_buf_ptr = ch;
14498 - *tty->flip.flag_buf_ptr = 0;
14499 + icount = &info->icount;
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 */
14508 - if (status & DZ_OERR) /* overrun error */
14509 - icount->overrun++;
14511 - /* check to see if we should ignore the character
14512 - and mask off conditions that should be ignored
14514 + if (status & DZ_FERR) { /* frame error */
14516 + * There is no separate BREAK status bit, so
14517 + * treat framing errors as BREAKs for Magic SysRq
14518 + * and SAK; normally, otherwise.
14521 - if (status & info->ignore_status_mask) {
14522 - if (++ignore > 100)
14524 - goto ignore_char;
14525 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
14527 + if (info->line == dz_sercons.index) {
14528 + if (!break_pressed)
14529 + break_pressed = jiffies;
14532 - /* mask off the error conditions we want to ignore */
14533 - tmp = status & info->read_status_mask;
14535 - if (tmp & DZ_PERR) {
14536 - *tty->flip.flag_buf_ptr = TTY_PARITY;
14538 - debug_console("PERR\n", 5);
14540 - } else if (tmp & DZ_FERR) {
14541 - *tty->flip.flag_buf_ptr = TTY_FRAME;
14543 - debug_console("FERR\n", 5);
14545 + flag = TTY_BREAK;
14546 + if (info->flags & DZ_SAK)
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;
14555 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
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;
14563 - if (tmp & DZ_OERR) {
14565 - debug_console("OERR\n", 5);
14566 + break_pressed = 0;
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;
14577 + if (info->hook && info->hook->rx_char) {
14578 + (*info->hook->rx_char)(ch, flag);
14581 - tty->flip.flag_buf_ptr++;
14582 - tty->flip.char_buf_ptr++;
14583 - tty->flip.count++;
14585 - } while (status & DZ_DVAL);
14588 - tty_flip_buffer_push(tty);
14589 + /* keep track of the statistics */
14595 + icount->parity++;
14597 + case TTY_OVERRUN:
14598 + icount->overrun++;
14607 + if ((status & info->ignore_status_mask) == 0) {
14608 + tty_insert_flip_char(tty, ch, flag);
14609 + lines_rx[LINE(status)] = 1;
14612 + for (i = 0; i < DZ_NB_PORT; i++)
14614 + tty_flip_buffer_push(lines[i]->tty);
14618 @@ -292,20 +314,34 @@
14619 * This routine deals with outputs to any lines.
14620 * ------------------------------------------------------------
14622 -static inline void transmit_chars(struct dz_serial *info)
14623 +static inline void transmit_chars(struct dz_serial *info_in)
14625 + struct dz_serial *info;
14626 + unsigned short status;
14629 + status = dz_in(info_in, DZ_CSR);
14630 + info = lines[LINE(status)];
14632 + if (info->hook || !info->tty) {
14633 + unsigned short mask, tmp;
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);
14643 + if (info->x_char) { /* XON/XOFF chars */
14644 dz_out(info, DZ_TDR, info->x_char);
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);
14656 @@ -359,15 +395,14 @@
14658 static void dz_interrupt(int irq, void *dev, struct pt_regs *regs)
14660 - struct dz_serial *info;
14661 + struct dz_serial *info = (struct dz_serial *)dev;
14662 unsigned short status;
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);
14669 if (status & DZ_RDONE)
14670 - receive_chars(info); /* the receive function */
14671 + receive_chars(info, regs);
14673 if (status & DZ_TRDY)
14674 transmit_chars(info);
14675 @@ -514,7 +549,7 @@
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);
14682 if (info->xmit_buf) { /* free Tx buffer */
14683 free_page((unsigned long) info->xmit_buf);
14684 @@ -545,18 +580,21 @@
14686 unsigned long flags;
14691 - if (!info->tty || !info->tty->termios)
14693 + if (!info->hook) {
14694 + if (!info->tty || !info->tty->termios)
14696 + cflag = info->tty->termios->c_cflag;
14698 + cflag = info->hook->cflags;
14704 info->cflags = info->line;
14706 - cflag = info->tty->termios->c_cflag;
14708 switch (cflag & CSIZE) {
14710 info->cflags |= DZ_CS5;
14711 @@ -579,7 +617,16 @@
14712 if (cflag & PARODD)
14713 info->cflags |= DZ_PARODD;
14715 - baud = tty_get_baud_rate(info->tty);
14716 + i = cflag & CBAUD;
14717 + if (i & CBAUDEX) {
14720 + info->tty->termios->c_cflag &= ~CBAUDEX;
14722 + info->hook->cflags &= ~CBAUDEX;
14724 + baud = baud_table[i];
14728 info->cflags |= DZ_B50;
14729 @@ -629,16 +676,16 @@
14732 info->cflags |= DZ_RXENAB;
14733 - dz_out(info, DZ_LPR, info->cflags);
14734 + dz_out(info, DZ_LPR, info->cflags | info->line);
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);
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);
14748 restore_flags(flags);
14749 @@ -694,7 +741,7 @@
14751 down(&tmp_buf_sem);
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));
14758 @@ -707,7 +754,7 @@
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 @@
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));
14774 restore_flags(flags);
14776 @@ -845,7 +892,7 @@
14779 * ------------------------------------------------------------
14780 - * rs_ioctl () and friends
14781 + * dz_ioctl () and friends
14782 * ------------------------------------------------------------
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;
14792 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
14793 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
14794 (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
14795 @@ -1252,19 +1302,14 @@
14798 line = MINOR(tty->device) - tty->driver.minor_start;
14800 - /* The dz lines for the mouse/keyboard must be
14801 - * opened using their respective drivers.
14803 if ((line < 0) || (line >= DZ_NB_PORT))
14805 + info = lines[line];
14807 - if ((line == DZ_KEYBOARD) || (line == DZ_MOUSE))
14811 - info = lines[line];
14814 tty->driver_data = info;
14817 @@ -1285,14 +1330,21 @@
14819 *tty->termios = info->callout_termios;
14820 change_speed(info);
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);
14831 info->session = current->session;
14832 info->pgrp = current->pgrp;
14836 -static void show_serial_version(void)
14837 +static void __init show_serial_version(void)
14839 printk("%s%s\n", dz_name, dz_version);
14841 @@ -1300,7 +1352,6 @@
14842 int __init dz_init(void)
14846 struct dz_serial *info;
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";
14855 serial_driver.name = "tts/%d";
14857 + serial_driver.name = "ttyS";
14859 serial_driver.major = TTY_MAJOR;
14860 serial_driver.minor_start = 64;
14861 @@ -1352,9 +1403,9 @@
14863 callout_driver = serial_driver;
14864 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
14865 - callout_driver.name = "cua";
14867 callout_driver.name = "cua/%d";
14869 + callout_driver.name = "cua";
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);
14880 for (i = 0; i < DZ_NB_PORT; i++) {
14883 - info->magic = SERIAL_MAGIC;
14886 + info->x_char = 0;
14887 if (mips_machtype == MACH_DS23100 ||
14888 mips_machtype == MACH_DS5100)
14889 info->port = (unsigned long) KN01_DZ11_BASE;
14891 info->port = (unsigned long) KN02_DZ11_BASE;
14896 + if (info->hook && info->hook->init_info) {
14897 + (*info->hook->init_info)(info);
14901 + info->magic = SERIAL_MAGIC;
14902 info->close_delay = 50;
14903 info->closing_wait = 3000;
14904 - info->x_char = 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);
14914 - * If we are pointing to address zero then punt - not correctly
14915 - * set up in setup.c to handle this.
14920 - printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
14921 - info->port, dec_interrupt[DEC_IRQ_DZ11]);
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);
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);
14939 @@ -1420,43 +1464,104 @@
14940 dz_out(info, DZ_CSR, DZ_MSE);
14943 - /* order matters here... the trick is that flags
14944 - is updated... in request_irq - to immediatedly obliterate
14946 - restore_flags(flags);
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");
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]);
14964 -#ifdef CONFIG_SERIAL_DEC_CONSOLE
14965 -static void dz_console_put_char(unsigned char ch)
14967 + * polling I/O routines
14969 +static int dz_poll_tx_char(void *handle, unsigned char ch)
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;
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;
14989 + dz_out(info, DZ_TCR, mask);
14991 + local_irq_restore(flags);
14993 - save_flags(flags);
14995 + while (loops--) {
14996 + trdy = dz_in(info, DZ_CSR);
14997 + if (!(trdy & DZ_TRDY))
14999 + trdy = (trdy & DZ_TLINE) >> 8;
15000 + if (trdy == info->line)
15002 + mask &= ~(1 << trdy);
15003 + dz_out(info, DZ_TCR, mask);
15009 + dz_out(info, DZ_TDR, ch);
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);
15019 - /* Actually transmit the character. */
15020 - dz_out(dz_console, DZ_TDR, tmp);
15024 - restore_flags(flags);
15025 +static int dz_poll_rx_char(void *handle)
15030 +int register_dz_hook(unsigned int channel, struct dec_serial_hook *hook)
15032 + struct dz_serial *info = multi + channel;
15034 + if (info->hook) {
15035 + printk("%s: line %d has already a hook registered\n",
15036 + __FUNCTION__, channel);
15040 + hook->poll_rx_char = dz_poll_rx_char;
15041 + hook->poll_tx_char = dz_poll_tx_char;
15042 + info->hook = hook;
15048 +int unregister_dz_hook(unsigned int channel)
15050 + struct dz_serial *info = &multi[channel];
15052 + if (info->hook) {
15053 + info->hook = NULL;
15056 + printk("%s: trying to unregister hook on line %d,"
15057 + " but none is registered\n", __FUNCTION__, channel);
15062 +#ifdef CONFIG_SERIAL_DEC_CONSOLE
15064 * -------------------------------------------------------------------
15065 * dz_console_print ()
15066 @@ -1465,17 +1570,19 @@
15067 * The console must be locked when we get here.
15068 * -------------------------------------------------------------------
15070 -static void dz_console_print(struct console *cons,
15071 +static void dz_console_print(struct console *co,
15073 unsigned int count)
15075 + struct dz_serial *info = multi + co->index;
15078 prom_printf((char *) str);
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++);
15089 @@ -1486,12 +1593,12 @@
15091 static int __init dz_console_setup(struct console *co, char *options)
15093 + struct dz_serial *info = multi + co->index;
15097 int cflag = CREAD | HUPCL | CLOCAL;
15099 - unsigned short mask, tmp;
15102 baud = simple_strtoul(options, NULL, 10);
15103 @@ -1542,44 +1649,31 @@
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;
15113 - dz_console->port = KN02_DZ11_BASE;
15114 - dz_console->line = CONSOLE_LINE;
15115 + info->port = KN02_DZ11_BASE;
15116 + info->line = co->index;
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);
15123 /* enable scanning */
15124 - dz_out(dz_console, DZ_CSR, DZ_MSE);
15125 + dz_out(info, DZ_CSR, DZ_MSE);
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);
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);
15140 + dz_out(info, DZ_LPR, cflag | info->line);
15145 -static struct console dz_sercons =
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 = {
15155 + .write = dz_console_print,
15156 + .device = dz_console_device,
15157 + .setup = dz_console_setup,
15158 + .flags = CON_PRINTBUFFER,
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
15167 #ifndef DZ_SERIAL_H
15168 #define DZ_SERIAL_H
15170 +#include <asm/dec/serial.h>
15172 #define SERIAL_MAGIC 0x5301
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)
15187 - * Definitions for the Transmit Register.
15188 + * Definitions for the Transmit Control Register.
15190 #define DZ_LINE_KEYBOARD 0x0001
15191 #define DZ_LINE_MOUSE 0x0002
15192 #define DZ_LINE_MODEM 0x0004
15193 #define DZ_LINE_PRINTER 0x0008
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 */
15202 * Definitions for the Modem Status Register.
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) */
15214 * Definitions for the Transmit Data Register.
15215 @@ -115,9 +129,6 @@
15217 #define DZ_EVENT_WRITE_WAKEUP 0
15220 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
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
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 */
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;
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;
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];
15250 -static int serial_refcount;
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.
15261 -static unsigned char *tmp_buf;
15262 -static DECLARE_MUTEX(tmp_buf_sem);
15264 -static char *dz_name = "DECstation DZ serial driver version ";
15265 -static char *dz_version = "1.02";
15267 -static inline unsigned short dz_in (struct dz_serial *, unsigned);
15268 -static inline void dz_out (struct dz_serial *, unsigned, unsigned short);
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 *);
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);
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 *);
15307 -int init_module (void)
15308 -void cleanup_module (void)
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
15318 +# Keymap for IBM Workpad z50
15321 +# by Michael Klar <wyldfier@iname.com>
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.
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.
15332 +keymaps 0-2,4-5,8,12,32-33,36-37
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
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
15450 +keycode 27 = nine parenleft bracketright
15451 + shiftr keycode 27 = parenleft
15452 + shift shiftr keycode 27 = parenleft
15453 + alt keycode 27 = Meta_nine
15455 + shiftr keycode 28 = +O
15456 + shift shiftr keycode 28 = +o
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
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
15485 + shiftr keycode 36 = +I
15486 + shift shiftr keycode 36 = +i
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
15496 + shiftr keycode 40 = +H
15497 + shift shiftr keycode 40 = +h
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
15512 + shiftr keycode 44 = +U
15513 + shift shiftr keycode 44 = +u
15515 + shiftr keycode 45 = +J
15516 + shift shiftr keycode 45 = +j
15518 + shiftr keycode 46 = +M
15519 + shift shiftr keycode 46 = +m
15521 + shiftr keycode 47 = +N
15522 + shift shiftr keycode 47 = +n
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
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
15551 + shiftr keycode 56 = +G
15552 + shift shiftr keycode 56 = +g
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
15567 + shiftr keycode 60 = +R
15568 + shift shiftr keycode 60 = +r
15570 + shiftr keycode 61 = +F
15571 + shift shiftr keycode 61 = +f
15572 + altgr keycode 61 = Hex_F
15574 + shiftr keycode 62 = +V
15575 + shift shiftr keycode 62 = +v
15577 + shiftr keycode 63 = +B
15578 + shift shiftr keycode 63 = +b
15579 + altgr keycode 63 = Hex_B
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
15587 + shiftr keycode 68 = +E
15588 + shift shiftr keycode 68 = +e
15589 + altgr keycode 68 = Hex_E
15591 + shiftr keycode 69 = +D
15592 + shift shiftr keycode 69 = +d
15593 + altgr keycode 69 = Hex_D
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
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
15612 + shiftr keycode 76 = +W
15613 + shift shiftr keycode 76 = +w
15615 + shiftr keycode 77 = +S
15616 + shift shiftr keycode 77 = +s
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
15642 + shiftr keycode 84 = +Q
15643 + shift shiftr keycode 84 = +q
15645 + shiftr keycode 85 = +A
15646 + shift shiftr keycode 85 = +a
15647 + altgr keycode 85 = Hex_A
15649 + shiftr keycode 86 = +Z
15650 + shift shiftr keycode 86 = +z
15652 +# This is the windows key:
15653 +keycode 88 = Decr_Console
15654 +keycode 89 = Shift
15655 +keycode 90 = Control
15656 +keycode 91 = Control
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
15666 - * IndyDog 0.2 A Hardware Watchdog Device for SGI IP22
15667 + * IndyDog 0.3 A Hardware Watchdog Device for SGI IP22
15669 * (c) Copyright 2002 Guido Guenther <agx@sigxcpu.org>, All Rights Reserved.
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.
15677 * based on softdog.c by Alan Cox <alan@redhat.com>
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>
15693 -static unsigned long indydog_alive;
15694 -static int expect_close = 0;
15695 +#define PFX "indydog: "
15696 +static int indydog_alive;
15698 #ifdef CONFIG_WATCHDOG_NOWAYOUT
15699 static int nowayout = 1;
15700 @@ -33,10 +32,30 @@
15701 static int nowayout = 0;
15704 +#define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */
15706 MODULE_PARM(nowayout,"i");
15707 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
15709 -static inline void indydog_ping(void)
15710 +static void indydog_start(void)
15712 + u32 mc_ctrl0 = sgimc->cpuctrl0;
15714 + mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
15715 + sgimc->cpuctrl0 = mc_ctrl0;
15718 +static void indydog_stop(void)
15720 + u32 mc_ctrl0 = sgimc->cpuctrl0;
15722 + mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
15723 + sgimc->cpuctrl0 = mc_ctrl0;
15725 + printk(KERN_INFO PFX "Stopped watchdog timer.\n");
15728 +static void indydog_ping(void)
15730 sgimc->watchdogt = 0;
15732 @@ -46,18 +65,14 @@
15734 static int indydog_open(struct inode *inode, struct file *file)
15738 - if (test_and_set_bit(0,&indydog_alive))
15739 + if (indydog_alive)
15747 /* Activate timer */
15748 - mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
15749 - sgimc->cpuctrl0 = mc_ctrl0;
15754 @@ -69,63 +84,48 @@
15755 static int indydog_release(struct inode *inode, struct file *file)
15757 /* Shut off the timer.
15758 - * Lock it in if it's a module and we set nowayout. */
15760 - if (expect_close) {
15761 - u32 mc_ctrl0 = sgimc->cpuctrl0;
15762 + * Lock it in if it's a module and we defined ...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");
15769 - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n");
15770 - clear_bit(0, &indydog_alive);
15773 + indydog_alive = 0;
15778 static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
15780 - /* Can't seek (pwrite) on this device */
15781 + /* Can't seek (pwrite) on this device */
15782 if (ppos != &file->f_pos)
15786 - * Refresh the timer.
15788 + /* Refresh the timer. */
15793 - /* In case it was set long ago */
15794 - expect_close = 0;
15796 - for (i = 0; i != len; i++) {
15798 - if (get_user(c, data + i))
15801 - expect_close = 1;
15811 static int indydog_ioctl(struct inode *inode, struct file *file,
15812 unsigned int cmd, unsigned long arg)
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",
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)))
15833 case WDIOC_GETSTATUS:
15834 @@ -134,31 +134,53 @@
15835 case WDIOC_KEEPALIVE:
15838 + case WDIOC_GETTIMEOUT:
15839 + return put_user(WATCHDOG_TIMEOUT,(int *)arg);
15840 + case WDIOC_SETOPTIONS:
15842 + if (get_user(options, (int *)arg))
15845 + if (options & WDIOS_DISABLECARD) {
15850 + if (options & WDIOS_ENABLECARD) {
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,
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,
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";
15886 static int __init watchdog_init(void)
15888 int ret = misc_register(&indydog_miscdev);
15892 + printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
15893 + WATCHDOG_MINOR, ret);
15899 @@ -172,4 +194,7 @@
15901 module_init(watchdog_init);
15902 module_exit(watchdog_exit);
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
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>
15916 static int rtc_ioctl(struct inode *inode, struct file *file,
15917 unsigned int cmd, unsigned long arg);
15918 @@ -209,11 +210,8 @@
15920 static int __init rtc_init(void)
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);
15929 printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
15930 if (misc_register(&rtc_dev)) {
15931 @@ -325,3 +323,7 @@
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 @@
15946 + if (!capable(CAP_SYS_ADMIN)) return -EPERM;
15948 // Chip Erase Sequence
15949 WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
15950 WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
15951 @@ -422,6 +424,8 @@
15953 struct lcd_display display;
15955 + if (!capable(CAP_SYS_ADMIN)) return -EPERM;
15957 if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
15959 rom = (unsigned char *) kmalloc((128),GFP_ATOMIC);
15960 @@ -434,8 +438,10 @@
15962 for (i=0; i<FLASH_SIZE; i=i+128) {
15964 - if(copy_from_user(rom, display.RomImage + i, 128))
15965 + if(copy_from_user(rom, display.RomImage + i, 128)) {
15969 burn_addr = kFlashBase + i;
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;
15979 - if (copy_from_user (kbuf, buf, copy_size))
15982 if (down_interruptible (&lp_table[minor].port_mutex))
15985 + if (copy_from_user (kbuf, buf, copy_size)) {
15990 /* Claim Parport or sleep until it becomes available
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]);
15999 up (&lp_table[minor].port_mutex);
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
16008 ifeq ($(CONFIG_VR41XX_KIU),y)
16010 + ifeq ($(CONFIG_IBM_WORKPAD),y)
16011 + KEYMAP = ibm_workpad_keymap.o
16013 + ifeq ($(CONFIG_VICTOR_MPC30X),y)
16014 + KEYMAP = victor_mpc30x_keymap.o
16016 KEYBD = vr41xx_keyb.o
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 @@
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 @@
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 @@
16045 qtronixmap.c: qtronixmap.map
16046 set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
16048 +ibm_workpad_keymap.c: ibm_workpad_keymap.map
16049 + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
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
16057 #include <asm/io.h>
16058 #include <asm/uaccess.h>
16059 #include <asm/system.h>
16064 -#if !defined(CONFIG_MIPS) || !defined(CONFIG_NEW_TIME_C)
16065 -#error "This driver is for MIPS machines with CONFIG_NEW_TIME_C defined"
16068 #include <asm/time.h>
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 @@
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);
16083 + spin_lock_irqsave(&us->outp_lock, flags);
16085 memcpy(us->outp_buf + us->outp_tail, buf, c);
16087 @@ -498,9 +499,31 @@
16088 duart_set_cflag(us->line, tty->termios->c_cflag);
16091 +static int get_serial_info(uart_state_t *us, struct serial_struct * retinfo) {
16093 + struct serial_struct tmp;
16095 + memset(&tmp, 0, sizeof(tmp));
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;
16105 + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
16111 static int duart_ioctl(struct tty_struct *tty, struct file * file,
16112 unsigned int cmd, unsigned long arg)
16114 + uart_state_t *us = (uart_state_t *) tty->driver_data;
16116 /* if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
16119 @@ -517,7 +540,7 @@
16120 printk("Ignoring TIOCMSET\n");
16123 - printk("Ignoring TIOCGSERIAL\n");
16124 + return get_serial_info(us,(struct serial_struct *) arg);
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
16132 * Robert Schwebel <robert@schwebel.de>,
16133 * Juergen Beisert <jbeisert@eurodsn.de>,
16134 * Theodore Ts'o <tytso@mit.edu>
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.
16143 static char *serial_version = "5.05c";
16144 @@ -413,6 +419,22 @@
16148 +#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
16150 +#include <asm/mips-boards/atlas.h>
16152 +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
16154 + return (*(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) & 0xff);
16157 +static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
16159 + *(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) = value;
16164 static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
16166 switch (info->io_type) {
16167 @@ -447,6 +469,8 @@
16168 outb(value, info->port+offset);
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
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");
16189 static char *driver_name = "SyncLink MultiPort driver";
16190 -static char *driver_version = "$Revision$";
16191 +static char *driver_version = "$Revision$";
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
16199 - write_reg(info, TRC0, 0x00);
16200 + write_reg(info, RRC, 0x00);
16202 /* TRC0 Transmit Ready Control 0
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
16208 +# Victor Interlink MP-C303/304 keyboard keymap
16210 +# Copyright (C) 2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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
16218 +compose as usual for "iso-8859-1"
16221 +keycode 89 = Escape
16222 +keycode 9 = Delete
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
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
16264 +keycode 23 = Caps_Lock
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
16280 +keycode 91 = Shift
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
16297 + alt keycode 55 = PageUp
16298 +keycode 14 = Shift
16300 +keycode 56 = Control
16302 +keycode 33 = space
16303 + control keycode 33 = nul
16305 + alt keycode 7 = Home
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 @@
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);
16322 @@ -325,7 +325,7 @@
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);
16329 kiu_writew(KIURST_KIURST, KIURST);
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
16335 if [ "$CONFIG_SGI_IP22" = "y" ]; then
16336 dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C
16339 + if [ "$CONFIG_SOC_AU1550" = "y" -o "$CONFIG_SOC_AU1200" ]; then
16340 + dep_tristate 'Au1550/Au1200 SMBus interface' CONFIG_I2C_ALGO_AU1550 $CONFIG_I2C
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
16350 + * i2c-algo-au1550.c: SMBus (i2c) driver algorithms for Alchemy PSC interface
16351 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
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.
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>
16364 +#include <asm/au1000.h>
16365 +#include <asm/au1xxx_psc.h>
16367 +#include <linux/i2c.h>
16368 +#include <linux/i2c-algo-au1550.h>
16371 +wait_xfer_done(struct i2c_algo_au1550_data *adap)
16375 + volatile psc_smb_t *sp;
16377 + sp = (volatile psc_smb_t *)(adap->psc_base);
16379 + /* Wait for Tx FIFO Underflow.
16381 + for (i = 0; i < adap->xfer_timeout; i++) {
16382 + stat = sp->psc_smbevnt;
16384 + if ((stat & PSC_SMBEVNT_TU) != 0) {
16386 + sp->psc_smbevnt = PSC_SMBEVNT_TU;
16393 + return -ETIMEDOUT;
16397 +wait_ack(struct i2c_algo_au1550_data *adap)
16400 + volatile psc_smb_t *sp;
16402 + if (wait_xfer_done(adap))
16403 + return -ETIMEDOUT;
16405 + sp = (volatile psc_smb_t *)(adap->psc_base);
16407 + stat = sp->psc_smbevnt;
16410 + if ((stat & (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | PSC_SMBEVNT_AL)) != 0)
16411 + return -ETIMEDOUT;
16417 +wait_master_done(struct i2c_algo_au1550_data *adap)
16421 + volatile psc_smb_t *sp;
16423 + sp = (volatile psc_smb_t *)(adap->psc_base);
16425 + /* Wait for Master Done.
16427 + for (i = 0; i < adap->xfer_timeout; i++) {
16428 + stat = sp->psc_smbevnt;
16430 + if ((stat & PSC_SMBEVNT_MD) != 0)
16435 + return -ETIMEDOUT;
16439 +do_address(struct i2c_algo_au1550_data *adap, unsigned int addr, int rd)
16441 + volatile psc_smb_t *sp;
16444 + sp = (volatile psc_smb_t *)(adap->psc_base);
16446 + /* Reset the FIFOs, clear events.
16448 + sp->psc_smbpcr = PSC_SMBPCR_DC;
16449 + sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR;
16452 + stat = sp->psc_smbpcr;
16454 + } while ((stat & PSC_SMBPCR_DC) != 0);
16456 + /* Write out the i2c chip address and specify operation
16462 + /* Put byte into fifo, start up master.
16464 + sp->psc_smbtxrx = addr;
16466 + sp->psc_smbpcr = PSC_SMBPCR_MS;
16468 + if (wait_ack(adap))
16474 +wait_for_rx_byte(struct i2c_algo_au1550_data *adap, u32 *ret_data)
16478 + volatile psc_smb_t *sp;
16480 + if (wait_xfer_done(adap))
16483 + sp = (volatile psc_smb_t *)(adap->psc_base);
16485 + j = adap->xfer_timeout * 100;
16491 + stat = sp->psc_smbstat;
16493 + if ((stat & PSC_SMBSTAT_RE) == 0)
16498 + data = sp->psc_smbtxrx;
16500 + *ret_data = data;
16506 +i2c_read(struct i2c_algo_au1550_data *adap, unsigned char *buf,
16507 + unsigned int len)
16511 + volatile psc_smb_t *sp;
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.
16521 + sp = (volatile psc_smb_t *)(adap->psc_base);
16524 + while (i < (len-1)) {
16525 + sp->psc_smbtxrx = 0;
16527 + if (wait_for_rx_byte(adap, &data))
16534 + /* The last byte has to indicate transfer done.
16536 + sp->psc_smbtxrx = PSC_SMBTXRX_STP;
16538 + if (wait_master_done(adap))
16541 + data = sp->psc_smbtxrx;
16548 +i2c_write(struct i2c_algo_au1550_data *adap, unsigned char *buf,
16549 + unsigned int len)
16553 + volatile psc_smb_t *sp;
16558 + sp = (volatile psc_smb_t *)(adap->psc_base);
16561 + while (i < (len-1)) {
16563 + sp->psc_smbtxrx = data;
16565 + if (wait_ack(adap))
16570 + /* The last byte has to indicate transfer done.
16573 + data |= PSC_SMBTXRX_STP;
16574 + sp->psc_smbtxrx = data;
16576 + if (wait_master_done(adap))
16582 +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
16584 + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
16585 + struct i2c_msg *p;
16588 + for (i = 0; !err && i < num; i++) {
16590 + err = do_address(adap, p->addr, p->flags & I2C_M_RD);
16591 + if (err || !p->len)
16593 + if (p->flags & I2C_M_RD)
16594 + err = i2c_read(adap, p->buf, p->len);
16596 + err = i2c_write(adap, p->buf, p->len);
16599 + /* Return the number of messages processed, or the error code.
16607 +au1550_func(struct i2c_adapter *adap)
16609 + return I2C_FUNC_I2C;
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,
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.
16625 +i2c_au1550_add_bus(struct i2c_adapter *i2c_adap)
16627 + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
16628 + volatile psc_smb_t *sp;
16631 + i2c_adap->algo = &au1550_algo;
16633 + /* Now, set up the PSC for SMBus PIO mode.
16635 + sp = (volatile psc_smb_t *)(adap->psc_base);
16636 + sp->psc_ctrl = PSC_CTRL_DISABLE;
16638 + sp->psc_sel = PSC_SEL_PS_SMBUSMODE;
16639 + sp->psc_smbcfg = 0;
16641 + sp->psc_ctrl = PSC_CTRL_ENABLE;
16644 + stat = sp->psc_smbstat;
16646 + } while ((stat & PSC_SMBSTAT_SR) == 0);
16648 + sp->psc_smbcfg = (PSC_SMBCFG_RT_FIFO8 | PSC_SMBCFG_TT_FIFO8 |
16649 + PSC_SMBCFG_DD_DISABLE);
16651 + /* Divide by 8 to get a 6.25 MHz clock. The later protocol
16652 + * timings are based on this clock.
16654 + sp->psc_smbcfg |= PSC_SMBCFG_SET_DIV(PSC_SMBCFG_DIV2);
16655 + sp->psc_smbmsk = PSC_SMBMSK_ALLMASK;
16658 + /* Set the protocol timer values. See Table 71 in the
16659 + * Au1550 Data Book for standard timing values.
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);
16667 + sp->psc_smbcfg |= PSC_SMBCFG_DE_ENABLE;
16669 + stat = sp->psc_smbstat;
16671 + } while ((stat & PSC_SMBSTAT_DR) == 0);
16673 + return i2c_add_adapter(i2c_adap);
16678 +i2c_au1550_del_bus(struct i2c_adapter *adap)
16680 + return i2c_del_adapter(adap);
16683 +EXPORT_SYMBOL(i2c_au1550_add_bus);
16684 +EXPORT_SYMBOL(i2c_au1550_del_bus);
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>
16701 #include <linux/i2c.h>
16702 #include <linux/i2c-algo-bit.h>
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 @@
16710 static u32 bit_func(struct i2c_adapter *adap)
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;
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>
16731 #include <linux/i2c.h>
16732 #include <linux/i2c-algo-pcf.h>
16733 #include "i2c-pcf8584.h"
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 @@
16741 static u32 pcf_func(struct i2c_adapter *adap)
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;
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
16755 + * i2c-au1550.c: SMBus (i2c) adapter for Alchemy PSC interface
16756 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
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.
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.
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.
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.
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>
16783 +#include <asm/au1000.h>
16784 +#include <asm/au1xxx_psc.h>
16785 +#if defined( CONFIG_MIPS_PB1550 )
16786 + #include <asm/pb1550.h>
16788 +#if defined( CONFIG_MIPS_PB1200 )
16789 + #include <asm/pb1200.h>
16791 +#if defined( CONFIG_MIPS_DB1200 )
16792 + #include <asm/db1200.h>
16794 +#if defined( CONFIG_MIPS_FICMMP )
16795 + #include <asm/ficmmp.h>
16798 +#include <linux/i2c.h>
16799 +#include <linux/i2c-algo-au1550.h>
16804 +pb1550_reg(struct i2c_client *client)
16810 +pb1550_unreg(struct i2c_client *client)
16816 +pb1550_inc_use(struct i2c_adapter *adap)
16819 + MOD_INC_USE_COUNT;
16824 +pb1550_dec_use(struct i2c_adapter *adap)
16827 + MOD_DEC_USE_COUNT;
16831 +static struct i2c_algo_au1550_data pb1550_i2c_info = {
16832 + SMBUS_PSC_BASE, 200, 200
16835 +static struct i2c_adapter pb1550_board_adapter = {
16836 + name: "pb1550 adapter",
16837 + id: I2C_HW_AU1550_PSC,
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,
16848 +i2c_pb1550_init(void)
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
16856 + if (i2c_au1550_add_bus(&pb1550_board_adapter) < 0)
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.
16868 +static struct i2c_msg wm_i2c_msg; /* We don't want this stuff on the stack */
16869 +static u8 i2cbuf[2];
16872 +pb1550_wm_codec_write(u8 addr, u8 reg, u8 val)
16874 + wm_i2c_msg.addr = addr;
16875 + wm_i2c_msg.flags = 0;
16876 + wm_i2c_msg.buf = i2cbuf;
16877 + wm_i2c_msg.len = 2;
16881 + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, &wm_i2c_msg, 1);
16884 +/* the next function is needed by DVB driver. */
16885 +int pb1550_i2c_xfer(struct i2c_msg msgs[], int num)
16887 + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, msgs, num);
16890 +EXPORT_SYMBOL(pb1550_wm_codec_write);
16891 +EXPORT_SYMBOL(pb1550_i2c_xfer);
16893 +MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
16894 +MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
16895 +MODULE_LICENSE("GPL");
16900 + return i2c_pb1550_init();
16904 +cleanup_module(void)
16906 + i2c_au1550_del_bus(&pb1550_board_adapter);
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);
16915 +#ifdef CONFIG_I2C_ALGO_AU1550
16916 + extern int i2c_pb1550_init(void);
16919 #ifdef CONFIG_I2C_PROC
16920 extern int sensors_init(void);
16921 @@ -1335,6 +1338,10 @@
16922 i2c_max1617_init();
16925 +#ifdef CONFIG_I2C_ALGO_AU1550
16926 + i2c_pb1550_init();
16929 /* -------------- proc interface ---- */
16930 #ifdef CONFIG_I2C_PROC
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
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 \
16940 + i2c-algo-au1550.o i2c-proc.o i2c-au1550.o
16942 obj-$(CONFIG_I2C) += i2c-core.o
16943 obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
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
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;
16964 + toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
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 */
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);
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);
16987 #endif /* not STANDARD_ATAPI */
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);
16993 toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
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 @@
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);
17009 + ph_command(cs, IPACX_CMD_RES);
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;
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) {
17030 - /* fun, isn't it? :) */
17032 - list_add(next, hash_table);
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 */
17049 struct indycam *camera;
17050 struct i2c_client *client;
17053 client = kmalloc(sizeof(*client), GFP_KERNEL);
17058 camera = kmalloc(sizeof(*camera), GFP_KERNEL);
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;
17069 err = i2c_attach_client(client);
17070 @@ -75,18 +76,18 @@
17071 goto out_free_camera;
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)) {
17079 goto out_detach_client;
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));
17086 err = i2c_master_send(client, initseq, sizeof(initseq));
17088 - printk(KERN_INFO "IndyCam initalization failed\n");
17089 + printk(KERN_ERR "IndyCam initalization failed.\n");
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
17097 * License version 2 as published by the Free Software Foundation.
17099 * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
17100 + * Copyright (C) 2004 Mikael Nousiainen <tmnousia@cc.hut.fi>
17104 #include <linux/module.h>
17105 @@ -37,13 +39,23 @@
17106 #define DEBUG(x...)
17109 +/* Channels (who could have guessed) */
17110 +#define VINO_CHAN_NONE 0
17111 +#define VINO_CHAN_A 1
17112 +#define VINO_CHAN_B 2
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
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
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
17132 struct vino_device {
17133 struct video_device vdev;
17134 -#define VINO_CHAN_A 1
17135 -#define VINO_CHAN_B 2
17137 + int chan; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
17140 unsigned int left, right, top, bottom;
17141 @@ -106,7 +116,7 @@
17143 struct vino_client {
17144 struct i2c_client *driver;
17146 + int owner; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
17149 struct vino_video {
17150 @@ -362,6 +372,7 @@
17151 static int dma_setup(struct vino_device *v)
17155 struct sgi_vino_channel *ch;
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
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
17172 + * TODO: for analog sources (SAA7191), the clipping values are a bit
17173 + * different and that case isn't yet handled
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);
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)
17193 + int a_eof, b_eof;
17195 spin_lock(&Vino->vino_lock);
17196 ctrl = vino->control;
17197 @@ -525,12 +547,14 @@
17198 vino->control = ctrl;
17199 clear_eod(&Vino->chB);
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
17208 - field_done(&Vino->chA);
17210 + field_done(&Vino->chA);
17212 + field_done(&Vino->chB);
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 @@
17221 #elif defined(CONFIG_MOMENCO_OCELOT)
17225 #elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
17230 #warning Unknown architecture for DiskOnChip. No default probe locations defined
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
17238 - * Copyright (c) 2001 Maciej W. Rozycki
17239 + * Copyright (c) 2001 Maciej W. Rozycki
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.
17252 @@ -29,18 +29,18 @@
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";
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");
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.
17274 static ulong ms02nv_addrs[] __initdata = {
17275 0x07000000, 0x06800000, 0x06000000, 0x05800000, 0x05000000,
17276 @@ -130,7 +130,7 @@
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);
17285 @@ -233,7 +233,7 @@
17286 goto err_out_csr_res;
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);
17293 mp->next = root_ms02nv_mtd;
17294 @@ -293,12 +293,12 @@
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)
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)
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
17314 - * Copyright (c) 2001 Maciej W. Rozycki
17315 + * Copyright (c) 2001, 2003 Maciej W. Rozycki
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
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.
17333 #include <linux/ioport.h>
17334 #include <linux/mtd/mtd.h>
17337 + * Addresses are decoded as follows:
17339 + * 0x000000 - 0x3fffff SRAM
17340 + * 0x400000 - 0x7fffff CSR
17342 + * Within the SRAM area the following ranges are forced by the system
17345 + * 0x000000 - 0x0003ff diagnostic area, destroyed upon a reboot
17346 + * 0x000400 - ENDofRAM storage area, available to operating systems
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.
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
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.
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):
17378 + * left LED battery disable status: lit = enabled
17379 + * right LED battery condition status: lit = OK
17382 /* MS02-NV iomem register offsets. */
17383 #define MS02NV_CSR 0x400000 /* control & status register */
17385 +/* MS02-NV CSR status bits. */
17386 +#define MS02NV_CSR_BATT_OK 0x01 /* battery OK */
17387 +#define MS02NV_CSR_BATT_OFF 0x02 /* battery disabled */
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 */
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) */
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 */
17415 typedef volatile u32 ms02nv_uint;
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
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
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
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
17453 + * Flash memory access on Alchemy Db1xxx boards
17455 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
17459 +#include <linux/config.h>
17460 +#include <linux/module.h>
17461 +#include <linux/types.h>
17462 +#include <linux/kernel.h>
17464 +#include <linux/mtd/mtd.h>
17465 +#include <linux/mtd/map.h>
17466 +#include <linux/mtd/partitions.h>
17468 +#include <asm/io.h>
17469 +#include <asm/au1000.h>
17470 +#include <asm/db1x00.h>
17473 +#define DBG(x...) printk(x)
17478 +static unsigned long window_addr;
17479 +static unsigned long window_size;
17480 +static unsigned long flash_size;
17482 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
17485 + ret = __raw_readb(map->map_priv_1 + ofs);
17486 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17490 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
17493 + ret = __raw_readw(map->map_priv_1 + ofs);
17494 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17498 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
17501 + ret = __raw_readl(map->map_priv_1 + ofs);
17502 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17506 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
17508 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
17509 + memcpy_fromio(to, map->map_priv_1 + from, len);
17512 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
17514 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17515 + __raw_writeb(d, map->map_priv_1 + adr);
17519 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
17521 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17522 + __raw_writew(d, map->map_priv_1 + adr);
17526 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
17528 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17529 + __raw_writel(d, map->map_priv_1 + adr);
17533 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
17535 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
17536 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
17551 +static unsigned char flash_buswidth = 4;
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.
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
17565 +static struct mtd_partition db1x00_partitions[] = {
17569 + offset: 0x0000000
17573 + offset: MTDPART_OFS_APPEND,
17574 + mask_flags: MTD_WRITEABLE
17576 + name: "raw kernel",
17577 + size: (0x300000-0x40000), /* last 256KB is yamon env */
17578 + offset: MTDPART_OFS_APPEND,
17581 +#elif defined(DB1X00_BOOT_ONLY)
17582 +static struct mtd_partition db1x00_partitions[] = {
17585 + size: 0x00c00000,
17586 + offset: 0x0000000
17590 + offset: MTDPART_OFS_APPEND,
17591 + mask_flags: MTD_WRITEABLE
17593 + name: "raw kernel",
17594 + size: (0x300000-0x40000), /* last 256KB is yamon env */
17595 + offset: MTDPART_OFS_APPEND,
17598 +#elif defined(DB1X00_USER_ONLY)
17599 +static struct mtd_partition db1x00_partitions[] = {
17603 + offset: 0x0000000
17605 + name: "raw kernel",
17606 + size: MTDPART_SIZ_FULL,
17607 + offset: MTDPART_OFS_APPEND,
17611 +#error MTD_DB1X00 define combo error /* should never happen */
17615 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
17617 +static struct mtd_partition *parsed_parts;
17618 +static struct mtd_info *mymtd;
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.
17626 +int setup_flash_params()
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;
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;
17663 + /* 256 Mbit devices */
17664 + flash_size = 0x4000000; /* 64MB per part */
17665 +#if defined(DB1X00_BOTH_BANKS)
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 */
17683 +int __init db1x00_mtd_init(void)
17685 + struct mtd_partition *parts;
17686 + int nb_parts = 0;
17689 + /* Default flash buswidth */
17690 + db1x00_map.buswidth = flash_buswidth;
17692 + if (setup_flash_params())
17696 + * Static partition definition selection
17698 + part_type = "static";
17699 + parts = db1x00_partitions;
17700 + nb_parts = NB_OF(db1x00_partitions);
17701 + db1x00_map.size = window_size;
17704 + * Now let's probe for the actual flash. Do it here since
17705 + * specific machine settings might have been set above.
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;
17715 + add_mtd_partitions(mymtd, parts, nb_parts);
17719 +static void __exit db1x00_mtd_cleanup(void)
17722 + del_mtd_partitions(mymtd);
17723 + map_destroy(mymtd);
17724 + if (parsed_parts)
17725 + kfree(parsed_parts);
17729 +module_init(db1x00_mtd_init);
17730 +module_exit(db1x00_mtd_cleanup);
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
17740 + * Flash memory access on Alchemy HydrogenIII boards
17742 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
17746 +#include <linux/config.h>
17747 +#include <linux/module.h>
17748 +#include <linux/types.h>
17749 +#include <linux/kernel.h>
17751 +#include <linux/mtd/mtd.h>
17752 +#include <linux/mtd/map.h>
17753 +#include <linux/mtd/partitions.h>
17755 +#include <asm/io.h>
17756 +#include <asm/au1000.h>
17759 +#define DBG(x...) printk(x)
17764 +#define WINDOW_ADDR 0x1E000000
17765 +#define WINDOW_SIZE 0x02000000
17768 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
17771 + ret = __raw_readb(map->map_priv_1 + ofs);
17772 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17776 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
17779 + ret = __raw_readw(map->map_priv_1 + ofs);
17780 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17784 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
17787 + ret = __raw_readl(map->map_priv_1 + ofs);
17788 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
17792 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
17794 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
17795 + memcpy_fromio(to, map->map_priv_1 + from, len);
17798 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
17800 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17801 + __raw_writeb(d, map->map_priv_1 + adr);
17805 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
17807 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17808 + __raw_writew(d, map->map_priv_1 + adr);
17812 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
17814 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
17815 + __raw_writel(d, map->map_priv_1 + adr);
17819 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
17821 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
17822 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
17837 +static unsigned char flash_buswidth = 4;
17839 +/* MTDPART_OFS_APPEND is vastly preferred to any attempt at statically lining
17840 + * up the offsets. */
17841 +static struct mtd_partition hydrogen3_partitions[] = {
17845 + offset: 0x0000000
17849 + offset: MTDPART_OFS_APPEND,
17850 + mask_flags: MTD_WRITEABLE
17852 + name: "raw kernel",
17854 + offset: MTDPART_OFS_APPEND
17858 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
17860 +static struct mtd_partition *parsed_parts;
17861 +static struct mtd_info *mymtd;
17863 +int __init hydrogen3_mtd_init(void)
17865 + struct mtd_partition *parts;
17866 + int nb_parts = 0;
17869 + /* Default flash buswidth */
17870 + hydrogen3_map.buswidth = flash_buswidth;
17873 + * Static partition definition selection
17875 + part_type = "static";
17876 + parts = hydrogen3_partitions;
17877 + nb_parts = NB_OF(hydrogen3_partitions);
17878 + hydrogen3_map.size = WINDOW_SIZE;
17881 + * Now let's probe for the actual flash. Do it here since
17882 + * specific machine settings might have been set above.
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;
17892 + add_mtd_partitions(mymtd, parts, nb_parts);
17896 +static void __exit hydrogen3_mtd_cleanup(void)
17899 + del_mtd_partitions(mymtd);
17900 + map_destroy(mymtd);
17901 + if (parsed_parts)
17902 + kfree(parsed_parts);
17908 +static int __init _bootflashonly(char *str)
17910 + bootflashonly = simple_strtol(str, NULL, 0);
17915 +__setup("bootflashonly=", _bootflashonly);
17920 +module_init(hydrogen3_mtd_init);
17921 +module_exit(hydrogen3_mtd_cleanup);
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
17933 * Flash device on lasat 100 and 200 boards
17935 - * Presumably (C) 2002 Brian Murphy <brian@murphy.dk> or whoever he
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.
17946 #include <linux/module.h>
17948 #include <linux/mtd/partitions.h>
17949 #include <linux/config.h>
17950 #include <asm/lasat/lasat.h>
17951 -#include <asm/lasat/lasat_mtd.h>
17953 static struct mtd_info *mymtd;
17955 @@ -69,30 +59,33 @@
17958 static struct map_info sp_map = {
17959 - .name = "SP flash",
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",
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
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"};
17985 static int __init init_sp(void)
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;
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;
18000 printk(KERN_NOTICE "sp flash device: %lx at %lx\n",
18001 @@ -109,12 +102,15 @@
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;
18010 + partition_info[i].size = size;
18011 + partition_info[i].offset = offset;
18016 - add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
18017 + add_mtd_partitions( mymtd, partition_info, nparts );
18021 @@ -124,11 +120,11 @@
18022 static void __exit cleanup_sp(void)
18025 - del_mtd_partitions(mymtd);
18026 - map_destroy(mymtd);
18027 + del_mtd_partitions(mymtd);
18028 + map_destroy(mymtd);
18030 if (sp_map.map_priv_1) {
18031 - sp_map.map_priv_1 = 0;
18032 + sp_map.map_priv_1 = 0;
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
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
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
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
18065 + * Flash memory access on AMD Mirage board.
18067 + * (C) 2003 Embedded Edge
18068 + * based on mirage-flash.c:
18069 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
18073 +#include <linux/config.h>
18074 +#include <linux/module.h>
18075 +#include <linux/types.h>
18076 +#include <linux/kernel.h>
18078 +#include <linux/mtd/mtd.h>
18079 +#include <linux/mtd/map.h>
18080 +#include <linux/mtd/partitions.h>
18082 +#include <asm/io.h>
18083 +#include <asm/au1000.h>
18084 +//#include <asm/mirage.h>
18087 +#define DBG(x...) printk(x)
18092 +static unsigned long window_addr;
18093 +static unsigned long window_size;
18094 +static unsigned long flash_size;
18096 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18099 + ret = __raw_readb(map->map_priv_1 + ofs);
18100 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18104 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18107 + ret = __raw_readw(map->map_priv_1 + ofs);
18108 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18112 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18115 + ret = __raw_readl(map->map_priv_1 + ofs);
18116 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18120 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18122 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18123 + memcpy_fromio(to, map->map_priv_1 + from, len);
18126 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18128 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18129 + __raw_writeb(d, map->map_priv_1 + adr);
18133 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18135 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18136 + __raw_writew(d, map->map_priv_1 + adr);
18140 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18142 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18143 + __raw_writel(d, map->map_priv_1 + adr);
18147 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18149 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18150 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
18165 +static unsigned char flash_buswidth = 4;
18167 +static struct mtd_partition mirage_partitions[] = {
18171 + offset: 0x0000000
18175 + offset: MTDPART_OFS_APPEND,
18176 + mask_flags: MTD_WRITEABLE
18178 + name: "raw kernel",
18179 + size: (0x300000-0x40000), /* last 256KB is yamon env */
18180 + offset: MTDPART_OFS_APPEND,
18184 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18186 +static struct mtd_partition *parsed_parts;
18187 +static struct mtd_info *mymtd;
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.
18195 +int setup_flash_params()
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;
18206 +int __init mirage_mtd_init(void)
18208 + struct mtd_partition *parts;
18209 + int nb_parts = 0;
18212 + /* Default flash buswidth */
18213 + mirage_map.buswidth = flash_buswidth;
18215 + if (setup_flash_params())
18219 + * Static partition definition selection
18221 + part_type = "static";
18222 + parts = mirage_partitions;
18223 + nb_parts = NB_OF(mirage_partitions);
18224 + mirage_map.size = window_size;
18227 + * Now let's probe for the actual flash. Do it here since
18228 + * specific machine settings might have been set above.
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;
18238 + add_mtd_partitions(mymtd, parts, nb_parts);
18242 +static void __exit mirage_mtd_cleanup(void)
18245 + del_mtd_partitions(mymtd);
18246 + map_destroy(mymtd);
18247 + if (parsed_parts)
18248 + kfree(parsed_parts);
18252 +module_init(mirage_mtd_init);
18253 +module_exit(mirage_mtd_cleanup);
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
18263 + * Flash memory access on 4G Systems MTX-1 board
18265 + * (C) 2003 Pete Popov <ppopov@mvista.com>
18266 + * Bruno Randolf <bruno.randolf@4g-systems.de>
18269 +#include <linux/config.h>
18270 +#include <linux/module.h>
18271 +#include <linux/types.h>
18272 +#include <linux/kernel.h>
18274 +#include <linux/mtd/mtd.h>
18275 +#include <linux/mtd/map.h>
18276 +#include <linux/mtd/partitions.h>
18278 +#include <asm/io.h>
18279 +#include <asm/au1000.h>
18282 +#define DBG(x...) printk(x)
18287 +#ifdef CONFIG_MIPS_MTX1
18288 +#define WINDOW_ADDR 0x1E000000
18289 +#define WINDOW_SIZE 0x2000000
18292 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18295 + ret = __raw_readb(map->map_priv_1 + ofs);
18296 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18300 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18303 + ret = __raw_readw(map->map_priv_1 + ofs);
18304 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18308 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18311 + ret = __raw_readl(map->map_priv_1 + ofs);
18312 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18316 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18318 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18319 + memcpy_fromio(to, map->map_priv_1 + from, len);
18322 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18324 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18325 + __raw_writeb(d, map->map_priv_1 + adr);
18329 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18331 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18332 + __raw_writew(d, map->map_priv_1 + adr);
18336 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18338 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18339 + __raw_writel(d, map->map_priv_1 + adr);
18343 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18345 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18346 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
18364 +static unsigned long flash_size = 0x01000000;
18365 +static unsigned char flash_buswidth = 4;
18366 +static struct mtd_partition mtx1_partitions[] = {
18374 + offset: MTDPART_OFS_APPEND,
18375 + mask_flags: MTD_WRITEABLE
18377 + name: "raw kernel",
18379 + offset: MTDPART_OFS_APPEND,
18381 + name: "yamon env vars",
18383 + offset: MTDPART_OFS_APPEND,
18384 + mask_flags: MTD_WRITEABLE
18389 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18391 +static struct mtd_partition *parsed_parts;
18392 +static struct mtd_info *mymtd;
18394 +int __init mtx1_mtd_init(void)
18396 + struct mtd_partition *parts;
18397 + int nb_parts = 0;
18400 + /* Default flash buswidth */
18401 + mtx1_map.buswidth = flash_buswidth;
18404 + * Static partition definition selection
18406 + part_type = "static";
18407 + parts = mtx1_partitions;
18408 + nb_parts = NB_OF(mtx1_partitions);
18409 + mtx1_map.size = flash_size;
18412 + * Now let's probe for the actual flash. Do it here since
18413 + * specific machine settings might have been set above.
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;
18423 + add_mtd_partitions(mymtd, parts, nb_parts);
18427 +static void __exit mtx1_mtd_cleanup(void)
18430 + del_mtd_partitions(mymtd);
18431 + map_destroy(mymtd);
18432 + if (parsed_parts)
18433 + kfree(parsed_parts);
18437 +module_init(mtx1_mtd_init);
18438 +module_exit(mtx1_mtd_cleanup);
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
18448 + * Flash memory access on Alchemy Pb1550 board
18450 + * (C) 2004 Embedded Edge, LLC, based on pb1550-flash.c:
18451 + * (C) 2003 Pete Popov <ppopov@pacbell.net>
18455 +#include <linux/config.h>
18456 +#include <linux/module.h>
18457 +#include <linux/types.h>
18458 +#include <linux/kernel.h>
18460 +#include <linux/mtd/mtd.h>
18461 +#include <linux/mtd/map.h>
18462 +#include <linux/mtd/partitions.h>
18464 +#include <asm/io.h>
18465 +#include <asm/au1000.h>
18466 +#include <asm/pb1550.h>
18469 +#define DBG(x...) printk(x)
18474 +static unsigned long window_addr;
18475 +static unsigned long window_size;
18477 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18480 + ret = __raw_readb(map->map_priv_1 + ofs);
18481 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18485 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18488 + ret = __raw_readw(map->map_priv_1 + ofs);
18489 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18493 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18496 + ret = __raw_readl(map->map_priv_1 + ofs);
18497 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18501 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18503 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18504 + memcpy_fromio(to, map->map_priv_1 + from, len);
18507 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18509 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18510 + __raw_writeb(d, map->map_priv_1 + adr);
18514 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18516 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18517 + __raw_writew(d, map->map_priv_1 + adr);
18521 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18523 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18524 + __raw_writel(d, map->map_priv_1 + adr);
18528 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18530 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18531 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
18546 +static unsigned char flash_buswidth = 4;
18549 + * Support only 64MB NOR Flash parts
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
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
18564 + size: (0x1FC00000 - 0x18000000),
18565 + offset: 0x0000000
18569 + offset: MTDPART_OFS_APPEND,
18570 + mask_flags: MTD_WRITEABLE
18572 + name: "raw kernel",
18573 + size: (0x300000 - 0x40000), /* last 256KB is yamon env */
18574 + offset: MTDPART_OFS_APPEND,
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
18584 + size: 0x03c00000,
18585 + offset: 0x0000000
18589 + offset: MTDPART_OFS_APPEND,
18590 + mask_flags: MTD_WRITEABLE
18592 + name: "raw kernel",
18593 + size: (0x300000-0x40000), /* last 256KB is yamon env */
18594 + offset: MTDPART_OFS_APPEND,
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
18604 + size: (0x4000000 - 0x200000), /* reserve 2MB for raw kernel */
18605 + offset: 0x0000000
18607 + name: "raw kernel",
18608 + size: MTDPART_SIZ_FULL,
18609 + offset: MTDPART_OFS_APPEND,
18613 +#error MTD_PB1550 define combo error /* should never happen */
18616 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18618 +static struct mtd_partition *parsed_parts;
18619 +static struct mtd_info *mymtd;
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.
18627 +int setup_flash_params()
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);
18634 + switch (boot_swapboot) {
18635 + case 0: /* 512Mbit devices, both enabled */
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;
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;
18659 + printk("Pb1550 MTD: unsupported boot:swap setting\n");
18665 +int __init pb1550_mtd_init(void)
18667 + struct mtd_partition *parts;
18668 + int nb_parts = 0;
18671 + /* Default flash buswidth */
18672 + pb1550_map.buswidth = flash_buswidth;
18674 + if (setup_flash_params())
18678 + * Static partition definition selection
18680 + part_type = "static";
18681 + parts = pb1550_partitions;
18682 + nb_parts = NB_OF(pb1550_partitions);
18683 + pb1550_map.size = window_size;
18686 + * Now let's probe for the actual flash. Do it here since
18687 + * specific machine settings might have been set above.
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;
18697 + add_mtd_partitions(mymtd, parts, nb_parts);
18701 +static void __exit pb1550_mtd_cleanup(void)
18704 + del_mtd_partitions(mymtd);
18705 + map_destroy(mymtd);
18706 + if (parsed_parts)
18707 + kfree(parsed_parts);
18711 +module_init(pb1550_mtd_init);
18712 +module_exit(pb1550_mtd_cleanup);
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 @@
18722 #error MTD_PB1500 define combo error /* should never happen */
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[] = {
18732 + size: 0x00400000,
18733 + offset: 0x00000000,
18736 + size: 0x00100000,
18737 + offset: 0x00400000,
18740 + size: 0x00700000,
18741 + offset: 0x00500000,
18744 + size: 0x00100000,
18745 + offset: 0x00C00000,
18748 + size: 0x00300000,
18749 + offset: 0x00D00000,
18753 #error Unsupported board
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
18760 + * Flash memory access on MyCable XXS1500 board
18762 + * (C) 2003 Pete Popov <ppopov@mvista.com>
18767 +#include <linux/config.h>
18768 +#include <linux/module.h>
18769 +#include <linux/types.h>
18770 +#include <linux/kernel.h>
18772 +#include <linux/mtd/mtd.h>
18773 +#include <linux/mtd/map.h>
18774 +#include <linux/mtd/partitions.h>
18776 +#include <asm/io.h>
18777 +#include <asm/au1000.h>
18780 +#define DBG(x...) printk(x)
18785 +#ifdef CONFIG_MIPS_XXS1500
18786 +#define WINDOW_ADDR 0x1F000000
18787 +#define WINDOW_SIZE 0x1000000
18790 +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
18793 + ret = __raw_readb(map->map_priv_1 + ofs);
18794 + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18798 +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
18801 + ret = __raw_readw(map->map_priv_1 + ofs);
18802 + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18806 +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
18809 + ret = __raw_readl(map->map_priv_1 + ofs);
18810 + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
18814 +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
18816 + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
18817 + memcpy_fromio(to, map->map_priv_1 + from, len);
18820 +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
18822 + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18823 + __raw_writeb(d, map->map_priv_1 + adr);
18827 +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
18829 + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18830 + __raw_writew(d, map->map_priv_1 + adr);
18834 +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
18836 + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
18837 + __raw_writel(d, map->map_priv_1 + adr);
18841 +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
18843 + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
18844 + memcpy_toio(map->map_priv_1 + to, from, len);
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,
18862 +static unsigned long flash_size = 0x00800000;
18863 +static unsigned char flash_buswidth = 4;
18864 +static struct mtd_partition xxs1500_partitions[] = {
18866 + name: "kernel image",
18867 + size: 0x00200000,
18870 + name: "user fs 0",
18871 + size: (0x00C00000-0x200000),
18872 + offset: MTDPART_OFS_APPEND,
18875 + size: 0x00100000,
18876 + offset: MTDPART_OFS_APPEND,
18877 + mask_flags: MTD_WRITEABLE
18879 + name: "user fs 1",
18881 + offset: MTDPART_OFS_APPEND,
18883 + name: "yamon env vars",
18885 + offset: MTDPART_OFS_APPEND,
18886 + mask_flags: MTD_WRITEABLE
18891 +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
18893 +static struct mtd_partition *parsed_parts;
18894 +static struct mtd_info *mymtd;
18896 +int __init xxs1500_mtd_init(void)
18898 + struct mtd_partition *parts;
18899 + int nb_parts = 0;
18902 + /* Default flash buswidth */
18903 + xxs1500_map.buswidth = flash_buswidth;
18906 + * Static partition definition selection
18908 + part_type = "static";
18909 + parts = xxs1500_partitions;
18910 + nb_parts = NB_OF(xxs1500_partitions);
18911 + xxs1500_map.size = flash_size;
18914 + * Now let's probe for the actual flash. Do it here since
18915 + * specific machine settings might have been set above.
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;
18925 + add_mtd_partitions(mymtd, parts, nb_parts);
18929 +static void __exit xxs1500_mtd_cleanup(void)
18932 + del_mtd_partitions(mymtd);
18933 + map_destroy(mymtd);
18934 + if (parsed_parts)
18935 + kfree(parsed_parts);
18939 +module_init(xxs1500_mtd_init);
18940 +module_exit(xxs1500_mtd_cleanup);
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 @@
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:
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)
18963 - * LVS Lawrence V. Stefani
18966 - * The author may be reached at:
18967 + * The original author:
18968 + * LVS Lawrence V. Stefani <lstefani@yahoo.com>
18970 - * Inet: stefani@lkg.dec.com
18971 - * (NOTE! this address no longer works -jgarzik)
18973 - * Mail: Digital Equipment Corporation
18974 - * 550 King Street
18975 - * M/S: LKG1-3/M07
18976 - * Littleton, MA 01460
18978 + * macro Maciej W. Rozycki <macro@linux-mips.org>
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.
18991 /* Include files */
18993 #include <linux/module.h>
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>
19009 #include <asm/byteorder.h>
19010 #include <asm/bitops.h>
19011 #include <asm/io.h>
19013 -#include <linux/fddidevice.h>
19014 -#include <linux/skbuff.h>
19016 +#include <asm/dec/tc.h>
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; }
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"
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";
19038 #define DYNAMIC_BUFFERS 1
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);
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);
19048 static int dfx_open(struct net_device *dev);
19049 @@ -337,48 +345,84 @@
19054 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19056 + volatile u8 *addr = (void *)(bp->base_addr + offset);
19063 u16 port = bp->base_addr + offset;
19069 static inline void dfx_port_read_byte(
19075 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19077 + volatile u8 *addr = (void *)(bp->base_addr + offset);
19084 u16 port = bp->base_addr + offset;
19090 static inline void dfx_port_write_long(
19096 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19098 + volatile u32 *addr = (void *)(bp->base_addr + offset);
19105 u16 port = bp->base_addr + offset;
19111 static inline void dfx_port_read_long(
19117 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19119 + volatile u32 *addr = (void *)(bp->base_addr + offset);
19126 u16 port = bp->base_addr + offset;
19134 @@ -393,8 +437,9 @@
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)
19144 * Functional Description:
19146 @@ -410,54 +455,68 @@
19147 * initialized and the board resources are read and stored in
19148 * the device structure.
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)
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 */
19163 - static int version_disp;
19165 - if (!version_disp) /* display version info if adapter is found */
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 */
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.
19177 - dev = init_fddidev(NULL, sizeof(*bp));
19178 + if (pdev != NULL)
19179 + print_name = pdev->slot_name;
19181 + dev = alloc_fddidev(sizeof(*bp));
19183 - printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
19184 + printk(KERN_ERR "%s: unable to allocate fddidev, aborting\n",
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);
19197 SET_MODULE_OWNER(dev);
19198 + SET_NETDEV_DEV(dev, &pdev->dev);
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) {
19214 + len = PI_ESIC_K_CSR_IO_LEN;
19217 + len = PFI_K_CSR_IO_LEN;
19218 + dev->base_addr = ioaddr; /* save port (I/O) base address */
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);
19227 /* Initialize new device structure */
19229 - dev->base_addr = ioaddr; /* save port (I/O) base address */
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;
19238 - if (pdev == NULL) {
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;
19248 - bp->bus_type = DFX_BUS_TYPE_PCI;
19249 bp->pci_dev = pdev;
19250 pci_set_drvdata (pdev, dev);
19251 pci_set_master (pdev);
19254 - if (dfx_driver_init(dev) != DFX_K_SUCCESS) {
19256 + if (dfx_driver_init(dev, print_name) != DFX_K_SUCCESS) {
19258 goto err_out_region;
19261 + err = register_netdev(dev);
19263 + goto err_out_kfree;
19265 + printk("%s: registered as %s\n", print_name, dev->name);
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) +
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);
19280 - release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
19281 + release_region(ioaddr, len);
19283 - unregister_netdev(dev);
19285 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19286 + release_tc_card(bp->slot);
19287 + free_netdev(dev);
19291 static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
19293 - return dfx_init_one_pci_or_eisa(pdev, 0);
19294 + return dfx_init_one_pci_or_eisa(pdev, DFX_BUS_TYPE_PCI, 0);
19297 static int __init dfx_eisa_init(void)
19298 @@ -507,6 +583,7 @@
19300 DBG_printk("In dfx_eisa_init...\n");
19302 +#ifdef CONFIG_EISA
19303 /* Scan for FDDI EISA controllers */
19305 for (i=0; i < DFX_MAX_EISA_SLOTS; i++) /* only scan for up to 16 EISA slots */
19306 @@ -517,9 +594,27 @@
19308 port = (i << 12); /* recalc base addr */
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;
19318 +static int __init dfx_tc_init(void)
19320 + int rc = -ENODEV;
19321 + int slot; /* TC slot number */
19323 + DBG_printk("In dfx_tc_init...\n");
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)
19335 @@ -583,8 +678,9 @@
19337 /* Initialize adapter based on bus type */
19339 - if (bp->bus_type == DFX_BUS_TYPE_EISA)
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 */
19346 dfx_port_read_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, &val);
19347 @@ -766,6 +862,7 @@
19350 * dev - pointer to device information
19351 + * print_name - printable device name
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
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.
19365 * Adapter is reset and should be in DMA_UNAVAILABLE state before
19366 * returning from this routine.
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)
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 */
19380 DBG_printk("In dfx_driver_init...\n");
19381 @@ -837,26 +935,20 @@
19383 /* Read the factory MAC address from the adapter then save it */
19385 - if (dfx_hw_port_ctrl_req(bp,
19387 - PI_PDATA_A_MLA_K_LO,
19389 - &data) != DFX_K_SUCCESS)
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",
19396 return(DFX_K_FAILURE);
19399 memcpy(&bp->factory_mac_addr[0], &data, sizeof(u32));
19401 - if (dfx_hw_port_ctrl_req(bp,
19403 - PI_PDATA_A_MLA_K_HI,
19405 - &data) != DFX_K_SUCCESS)
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",
19412 return(DFX_K_FAILURE);
19415 memcpy(&bp->factory_mac_addr[4], &data, sizeof(u16));
19418 @@ -867,28 +959,27 @@
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",
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]);
19448 - printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
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]);
19466 * Get memory for descriptor block, consumer block, and other buffers
19467 @@ -903,14 +994,15 @@
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)
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);
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 */
19488 * To guarantee the 8K alignment required for the descriptor block, 8K - 1
19489 @@ -924,7 +1016,7 @@
19490 * for allocating the needed memory.
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);
19497 /* Reserve space for descriptor block */
19498 @@ -965,14 +1057,20 @@
19500 /* Display virtual and physical addresses if debug driver */
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",
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);
19519 return(DFX_K_SUCCESS);
19525 @@ -1218,7 +1316,9 @@
19527 /* Register IRQ - support shared interrupts by passing device ptr */
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,
19534 printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
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));
19541 + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
19543 /* Disable interrupts at the ESIC */
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);
19550 + /* TC doesn't share interrupts so no need to disable them */
19552 + /* Call interrupt service routine for this adapter */
19554 + dfx_int_common(dev);
19557 spin_unlock(&bp->lock);
19559 @@ -2663,12 +2770,12 @@
19561 static void my_skb_align(struct sk_buff *skb, int n)
19563 - u32 x=(u32)skb->data; /* We only want the low bits .. */
19565 + unsigned long x = (unsigned long)skb->data;
19568 - v=(x+n-1)&~(n-1); /* Where we want to be */
19569 + v = ALIGN(x, n); /* Where we want to be */
19571 - skb_reserve(skb, v-x);
19572 + skb_reserve(skb, v - x);
19576 @@ -2745,7 +2852,10 @@
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,
19584 + PCI_DMA_FROMDEVICE);
19586 * p_rcv_buff_va is only used inside the
19587 * kernel so we put the skb pointer here.
19588 @@ -2859,9 +2969,17 @@
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,
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,
19603 + PCI_DMA_FROMDEVICE);
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().
19614 * Since the adapter architecture requires a three byte
19615 * packet request header to prepend the start of packet,
19616 @@ -3082,12 +3200,13 @@
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
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);
19631 * Verify that descriptor is actually available
19632 @@ -3171,6 +3290,7 @@
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 */
19639 /* Service all consumed transmit frames */
19640 @@ -3188,7 +3308,11 @@
19641 bp->xmt_total_bytes += p_xmt_drv_descr->p_skb->len;
19643 /* Return skb to operating system */
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);
19653 @@ -3297,6 +3421,7 @@
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 */
19659 /* Flush all outstanding transmit frames */
19661 @@ -3307,7 +3432,11 @@
19662 p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[bp->rcv_xmt_reg.index.xmt_comp]);
19664 /* Return skb to operating system */
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);
19673 /* Increment transmit error counter */
19674 @@ -3337,12 +3466,36 @@
19676 static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
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 */
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) {
19688 + len = PI_ESIC_K_CSR_IO_LEN;
19690 + len = PFI_K_CSR_IO_LEN;
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);
19696 + release_region(dev->base_addr, len);
19698 + if (bp->bus_type == DFX_BUS_TYPE_TC)
19699 + release_tc_card(bp->slot);
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) +
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);
19714 static void __devexit dfx_remove_one (struct pci_dev *pdev)
19715 @@ -3353,21 +3506,22 @@
19716 pci_set_drvdata(pdev, NULL);
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, },
19724 MODULE_DEVICE_TABLE(pci, dfx_pci_tbl);
19726 static struct pci_driver dfx_driver = {
19728 - probe: dfx_init_one,
19729 - remove: __devexit_p(dfx_remove_one),
19730 - id_table: dfx_pci_tbl,
19732 + .probe = dfx_init_one,
19733 + .remove = __devexit_p(dfx_remove_one),
19734 + .id_table = dfx_pci_tbl,
19737 static int dfx_have_pci;
19738 static int dfx_have_eisa;
19739 +static int dfx_have_tc;
19742 static void __exit dfx_eisa_cleanup(void)
19743 @@ -3388,12 +3542,7 @@
19745 static int __init dfx_init(void)
19747 - int rc_pci, rc_eisa;
19749 -/* when a module, this is printed whether or not devices are found in probe */
19753 + int rc_pci, rc_eisa, rc_tc;
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;
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;
19765 + return ((rc_tc < 0) ? 0 : rc_tc) +
19766 + ((rc_eisa < 0) ? 0 : rc_eisa) +
19767 + ((rc_pci < 0) ? 0 : rc_pci);
19770 static void __exit dfx_cleanup(void)
19773 pci_unregister_driver(&dfx_driver);
19774 - if (dfx_have_eisa)
19775 + if (dfx_have_eisa || dfx_have_tc)
19776 dfx_eisa_cleanup();
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");
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.
19796 - * LVS Lawrence V. Stefani
19799 - * The author may be reached at:
19800 + * The original author:
19801 + * LVS Lawrence V. Stefani <lstefani@yahoo.com>
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
19809 + * macro Maciej W. Rozycki <macro@linux-mips.org>
19811 * Modification History:
19812 * Date Name Description
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.
19821 @@ -1467,6 +1462,11 @@
19823 #endif /* #ifndef BIG_ENDIAN */
19825 +/* Define TC PDQ CSR offset and length */
19827 +#define PI_TC_K_CSR_OFFSET 0x100000
19828 +#define PI_TC_K_CSR_LEN 0x80 /* 128 bytes */
19830 /* Define EISA controller register offsets */
19832 #define PI_ESIC_K_BURST_HOLDOFF 0x040
19833 @@ -1634,6 +1634,7 @@
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 */
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 @@
19843 /* Keep virtual and physical pointers to locked, physically contiguous memory */
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 */
19865 /* Keep local copies of Type 1 and Type 2 register data */
19867 @@ -1758,8 +1761,9 @@
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;
19889 E1000_WRITE_REG(&adapter->hw, RDT, rxdr->count - 1);
19891 @@ -1329,11 +1329,12 @@
19892 rxdr->buffer_info[i].length,
19893 PCI_DMA_FROMDEVICE);
19895 - if (!e1000_check_lbtest_frame(rxdr->buffer_info[i++].skb, 1024))
19897 - } while (i < 64);
19898 + ret_val = e1000_check_lbtest_frame(rxdr->buffer_info[i].skb,
19901 + } while (ret_val != 0 && i < 64);
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 */
19914 #define AUTO_ALL_MODES 0
19915 +#define E1000_EEPROM_82544_APM 0x0004
19916 #define E1000_EEPROM_APME 0x0400
19918 #ifndef E1000_MASTER_SLAVE
19919 @@ -211,6 +212,7 @@
19922 struct e1000_desc_ring tx_ring;
19923 + struct e1000_buffer previous_buffer_info;
19924 spinlock_t tx_lock;
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;
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;
19942 - if((i == 0) && (hw->phy_type == e1000_phy_m88)) {
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);
19948 @@ -2504,7 +2505,7 @@
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,
19957 @@ -2610,7 +2611,7 @@
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,
19966 @@ -2956,8 +2957,7 @@
19967 /* Check polarity status */
19968 ret_val = e1000_check_polarity(hw, &polarity);
19973 phy_info->cable_polarity = polarity;
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;
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.
19987 phy_info->cable_length = ((phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
19988 M88E1000_PSSR_CABLE_LENGTH_SHIFT);
19989 @@ -4641,41 +4641,44 @@
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;
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;
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;
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;
20019 - switch (status & E1000_STATUS_PCIX_SPEED) {
20020 - case E1000_STATUS_PCIX_SPEED_66:
20021 - hw->bus_speed = e1000_bus_speed_66;
20023 - case E1000_STATUS_PCIX_SPEED_100:
20024 - hw->bus_speed = e1000_bus_speed_100;
20026 - case E1000_STATUS_PCIX_SPEED_133:
20027 - hw->bus_speed = e1000_bus_speed_133;
20030 - hw->bus_speed = e1000_bus_speed_reserved;
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;
20039 + switch (status & E1000_STATUS_PCIX_SPEED) {
20040 + case E1000_STATUS_PCIX_SPEED_66:
20041 + hw->bus_speed = e1000_bus_speed_66;
20043 + case E1000_STATUS_PCIX_SPEED_100:
20044 + hw->bus_speed = e1000_bus_speed_100;
20046 + case E1000_STATUS_PCIX_SPEED_133:
20047 + hw->bus_speed = e1000_bus_speed_133;
20050 + hw->bus_speed = e1000_bus_speed_reserved;
20054 + hw->bus_width = (status & E1000_STATUS_BUS64) ?
20055 + e1000_bus_width_64 : e1000_bus_width_32;
20058 - hw->bus_width = (status & E1000_STATUS_BUS64) ?
20059 - e1000_bus_width_64 : e1000_bus_width_32;
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;
20069 DEBUGFUNC("e1000_get_cable_length");
20071 @@ -4751,10 +4755,11 @@
20075 + cable_length = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
20076 + M88E1000_PSSR_CABLE_LENGTH_SHIFT;
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:
20084 *max_length = e1000_igp_cable_length_50;
20085 @@ -4921,8 +4926,7 @@
20088 hw->speed_downgraded = (phy_data & IGP01E1000_PLHR_SS_DOWNGRADE) ? 1 : 0;
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,
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
20099 #include "e1000_osdep.h"
20103 /* Forward declarations of structures used by the shared code */
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
20111 #define NODE_ADDRESS_SIZE 6
20112 #define ETH_LENGTH_OF_ADDRESS 6
20114 @@ -1735,6 +1735,9 @@
20115 #define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */
20116 #define PHY_EXT_STATUS 0x0F /* Extended Status Reg */
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 */
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 @@
20126 #define IGP01E1000_ANALOG_REGS_PAGE 0x20C0
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*/
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
20139 /* Bit definitions for valid PHY IDs. */
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
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>
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.
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
20162 * - Enabling NETIF_F_SG without checksum offload is illegal -
20163 John Mason <jdmason@us.ibm.com>
20165 * - Remove redundant initialization - Jamal Hadi
20166 * - Reset buffer_info->dma in tx resource cleanup logic
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
20177 char e1000_driver_name[] = "e1000";
20180 #define DRIVERNAPI "-NAPI"
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.";
20186 /* e1000_pci_tbl - PCI Device ID Table
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);
20199 +#ifdef CONFIG_E1000_NAPI
20200 + netif_poll_enable(netdev);
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);
20210 +#ifdef CONFIG_E1000_NAPI
20211 + netif_poll_disable(netdev);
20213 adapter->link_speed = 0;
20214 adapter->link_duplex = 0;
20215 netif_carrier_off(netdev);
20216 @@ -409,6 +430,7 @@
20219 uint16_t eeprom_data;
20220 + uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
20222 if((err = pci_enable_device(pdev)))
20224 @@ -505,9 +527,6 @@
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:
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;
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);
20250 - if(eeprom_data & E1000_EEPROM_APME)
20251 + if(eeprom_data & eeprom_apme_mask)
20252 adapter->wol |= E1000_WUFC_MAG;
20254 /* reset the hardware with the new settings */
20255 @@ -797,6 +821,31 @@
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
20264 +static inline boolean_t
20265 +e1000_check_64k_bound(struct e1000_adapter *adapter,
20266 + void *start, unsigned long len)
20268 + unsigned long begin = (unsigned long) start;
20269 + unsigned long end = begin + len;
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 ) {
20276 + /* check buffer doesn't cross 64kB */
20277 + return ((begin ^ (end - 1)) >> 16) != 0 ? FALSE : TRUE;
20284 * e1000_setup_tx_resources - allocate Tx resources (Descriptors)
20285 * @adapter: board private structure
20287 @@ -826,11 +875,42 @@
20289 txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
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);
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;
20312 + if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
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);
20323 + /* free old, move on with the new one since its okay */
20324 + pci_free_consistent(pdev, txdr->size, olddesc, olddma);
20327 memset(txdr->desc, 0, txdr->size);
20329 txdr->next_to_use = 0;
20330 @@ -948,11 +1028,43 @@
20331 rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
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);
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;
20357 + if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
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);
20368 + /* free old, move on with the new one since its okay */
20369 + pci_free_consistent(pdev, rxdr->size, olddesc, olddma);
20372 memset(rxdr->desc, 0, rxdr->size);
20374 rxdr->next_to_clean = 0;
20375 @@ -1086,6 +1198,7 @@
20376 struct e1000_buffer *buffer_info)
20378 struct pci_dev *pdev = adapter->pdev;
20380 if(buffer_info->dma) {
20381 pci_unmap_page(pdev,
20383 @@ -1114,6 +1227,11 @@
20385 /* Free all the Tx ring sk_buffs */
20387 + if (likely(adapter->previous_buffer_info.skb != NULL)) {
20388 + e1000_unmap_and_free_tx_resource(adapter,
20389 + &adapter->previous_buffer_info);
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;
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);
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;
20416 /* Reset the timer */
20417 mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
20418 @@ -2132,10 +2245,28 @@
20419 __netif_rx_schedule(netdev);
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.
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);
20437 for(i = 0; i < E1000_MAX_INTR; i++)
20438 if(unlikely(!e1000_clean_rx_irq(adapter) &
20439 !e1000_clean_tx_irq(adapter)))
20442 + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
20443 + e1000_irq_enable(adapter);
20446 return IRQ_HANDLED;
20447 @@ -2155,24 +2286,21 @@
20451 - if (!netif_carrier_ok(netdev))
20452 - goto quit_polling;
20454 tx_cleaned = e1000_clean_tx_irq(adapter);
20455 e1000_clean_rx_irq(adapter, &work_done, work_to_do);
20457 *budget -= work_done;
20458 netdev->quota -= work_done;
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);
20471 - return (work_done >= work_to_do);
20476 @@ -2196,11 +2324,34 @@
20477 eop_desc = E1000_TX_DESC(*tx_ring, eop);
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);
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);
20493 + /* pre-mature writeback of Tx descriptors */
20494 + /* save the cleaning of the this for the */
20495 + /* next iteration */
20497 + memcpy(&adapter->previous_buffer_info,
20499 + sizeof(struct e1000_buffer));
20500 + memset(buffer_info,
20502 + sizeof(struct e1000_buffer));
20504 + e1000_unmap_and_free_tx_resource(adapter,
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);
20515 spin_unlock(&adapter->tx_lock);
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);
20529 @@ -2389,20 +2550,43 @@
20530 struct e1000_buffer *buffer_info;
20531 struct sk_buff *skb;
20532 int reserve_len = 2;
20534 + unsigned int i, bufsz;
20536 i = rx_ring->next_to_use;
20537 buffer_info = &rx_ring->buffer_info[i];
20539 while(!buffer_info->skb) {
20540 + bufsz = adapter->rx_buffer_len + reserve_len;
20542 - skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
20544 + skb = dev_alloc_skb(bufsz);
20545 if(unlikely(!skb)) {
20546 /* Better luck next round */
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);
20559 + dev_kfree_skb(oldskb);
20562 + if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
20564 + dev_kfree_skb(skb);
20565 + dev_kfree_skb(oldskb);
20566 + break; /* while !buffer_info->skb */
20568 + /* move on with the new one */
20569 + dev_kfree_skb(oldskb);
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);
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);
20588 + dev_kfree_skb(skb);
20589 + buffer_info->skb = NULL;
20591 + pci_unmap_single(pdev,
20592 + buffer_info->dma,
20593 + adapter->rx_buffer_len,
20594 + PCI_DMA_FROMDEVICE);
20596 + break; /* while !buffer_info->skb */
20599 rx_desc = E1000_RX_DESC(*rx_ring, i);
20600 rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
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 @@
20607 s = (struct hdlcdrv_state *)dev->priv;
20609 + netif_stop_queue(dev);
20611 if (s->ops && s->ops->close)
20612 i = s->ops->close(dev);
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
20619 #define RUN_AT(x) (jiffies + (x))
20621 -#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
20622 -static BCSR * const bcsr = (BCSR *)0xAE000000;
20625 static spinlock_t ir_lock = SPIN_LOCK_UNLOCKED;
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 @@
20633 pAC->vpd.vpd_size = vpd_size;
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;
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
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"
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)
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)));
20674 static int tg3_bmcr_reset(struct tg3 *tp)
20675 @@ -618,9 +619,10 @@
20679 - tg3_readphy(tp, 0x16, &tmp32);
20680 - if ((tmp32 & 0x1000) == 0)
20682 + if (!tg3_readphy(tp, 0x16, &tmp32)) {
20683 + if ((tmp32 & 0x1000) == 0)
20689 @@ -672,9 +674,9 @@
20690 for (i = 0; i < 6; i += 2) {
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)) {
20702 @@ -730,7 +732,9 @@
20705 /* Disable transmitter and interrupt. */
20706 - tg3_readphy(tp, MII_TG3_EXT_CTRL, ®32);
20707 + if (tg3_readphy(tp, MII_TG3_EXT_CTRL, ®32))
20711 tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20713 @@ -739,7 +743,9 @@
20714 BMCR_FULLDPLX | TG3_BMCR_SPEED1000);
20716 /* Set to master mode. */
20717 - tg3_readphy(tp, MII_TG3_CTRL, &phy9_orig);
20718 + if (tg3_readphy(tp, MII_TG3_CTRL, &phy9_orig))
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 @@
20726 tg3_writephy(tp, MII_TG3_CTRL, phy9_orig);
20728 - tg3_readphy(tp, MII_TG3_EXT_CTRL, ®32);
20729 - reg32 &= ~0x3000;
20730 - tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20731 + if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, ®32)) {
20732 + reg32 &= ~0x3000;
20733 + tg3_writephy(tp, MII_TG3_EXT_CTRL, reg32);
20739 @@ -843,9 +851,9 @@
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);
20750 tg3_phy_set_wirespeed(tp);
20752 @@ -877,7 +885,7 @@
20753 GRC_LCLCTRL_GPIO_OUTPUT1));
20758 u32 grc_local_ctrl;
20760 if (tp_peer != tp &&
20761 @@ -885,8 +893,8 @@
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;
20770 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
20771 GRC_LCLCTRL_GPIO_OE1 |
20772 @@ -898,29 +906,17 @@
20773 GRC_LCLCTRL_GPIO_OUTPUT2);
20775 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
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;
20787 - grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 |
20788 - GRC_LCLCTRL_GPIO_OUTPUT2);
20790 + grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0;
20792 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
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;
20803 + grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2;
20804 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
20807 @@ -1240,7 +1236,7 @@
20811 -static int tg3_phy_copper_begin(struct tg3 *tp)
20812 +static void tg3_phy_copper_begin(struct tg3 *tp)
20816 @@ -1355,15 +1351,16 @@
20817 if (tp->link_config.duplex == DUPLEX_FULL)
20818 bmcr |= BMCR_FULLDPLX;
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++) {
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))
20834 if (!(tmp & BMSR_LSTATUS)) {
20837 @@ -1376,8 +1373,6 @@
20838 tg3_writephy(tp, MII_BMCR,
20839 BMCR_ANENABLE | BMCR_ANRESTART);
20845 static int tg3_init_5401phy_dsp(struct tg3 *tp)
20846 @@ -1412,7 +1407,9 @@
20848 u32 adv_reg, all_mask;
20850 - tg3_readphy(tp, MII_ADVERTISE, &adv_reg);
20851 + if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
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)) {
20861 - tg3_readphy(tp, MII_TG3_CTRL, &tg3_ctrl);
20862 + if (tg3_readphy(tp, MII_TG3_CTRL, &tg3_ctrl))
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))
20879 @@ -1469,9 +1468,8 @@
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);
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))
20890 if (!(bmsr & BMSR_LSTATUS)) {
20891 @@ -1482,8 +1480,8 @@
20892 tg3_readphy(tp, MII_BMSR, &bmsr);
20893 for (i = 0; i < 1000; i++) {
20895 - tg3_readphy(tp, MII_BMSR, &bmsr);
20896 - if (bmsr & BMSR_LSTATUS) {
20897 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
20898 + (bmsr & BMSR_LSTATUS)) {
20902 @@ -1545,8 +1543,8 @@
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))
20913 @@ -1557,8 +1555,8 @@
20914 tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat);
20915 for (i = 0; i < 2000; i++) {
20917 - tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat);
20919 + if (!tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat) &&
20924 @@ -1569,7 +1567,8 @@
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))
20931 if (bmcr && bmcr != 0x7fff)
20934 @@ -1606,10 +1605,13 @@
20935 (tp->link_config.autoneg == AUTONEG_ENABLE)) {
20936 u32 local_adv, remote_adv;
20938 - tg3_readphy(tp, MII_ADVERTISE, &local_adv);
20939 + if (tg3_readphy(tp, MII_ADVERTISE, &local_adv))
20941 local_adv &= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
20943 - tg3_readphy(tp, MII_LPA, &remote_adv);
20944 + if (tg3_readphy(tp, MII_LPA, &remote_adv))
20947 remote_adv &= (LPA_PAUSE_CAP | LPA_PAUSE_ASYM);
20949 /* If we are not advertising full pause capability,
20950 @@ -1628,8 +1630,8 @@
20951 tg3_phy_copper_begin(tp);
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;
20961 @@ -2130,8 +2132,9 @@
20962 if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)
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;
20972 sg_dig_ctrl = tr32(SG_DIG_CTRL);
20973 @@ -2142,9 +2145,9 @@
20974 u32 val = serdes_cfg;
20977 - val |= 0xc010880;
20978 + val |= 0xc010000;
20980 - val |= 0x4010880;
20981 + val |= 0x4010000;
20982 tw32_f(MAC_SERDES_CFG, val);
20984 tw32_f(SG_DIG_CTRL, 0x01388400);
20985 @@ -2167,7 +2170,7 @@
20987 if (sg_dig_ctrl != expected_sg_dig_ctrl) {
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));
20993 tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl);
20994 @@ -2208,9 +2211,9 @@
20995 u32 val = serdes_cfg;
20998 - val |= 0xc010880;
20999 + val |= 0xc010000;
21001 - val |= 0x4010880;
21002 + val |= 0x4010000;
21004 tw32_f(MAC_SERDES_CFG, val);
21006 @@ -2218,8 +2221,12 @@
21007 tw32_f(SG_DIG_CTRL, 0x01388400);
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;
21020 @@ -2690,7 +2697,11 @@
21022 len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */
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()] */
21032 skb_size = tg3_alloc_rx_skb(tp, opaque_key,
21033 @@ -3085,11 +3096,19 @@
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;
21045 + skb->h.th->check =
21046 + ~csum_tcpudp_magic(skb->nh.iph->saddr,
21047 + skb->nh.iph->daddr,
21048 + 0, IPPROTO_TCP, 0);
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) {
21057 @@ -3156,7 +3175,7 @@
21058 would_hit_hwbug = entry + 1;
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));
21066 @@ -3655,8 +3674,9 @@
21067 /* tp->lock is held. */
21068 static void tg3_write_sig_pre_reset(struct tg3 *tp, int kind)
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);
21076 if (tp->tg3_flags2 & TG3_FLG2_ASF_NEW_HANDSHAKE) {
21078 @@ -3860,19 +3880,20 @@
21079 tw32_f(MAC_MODE, 0);
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)
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);
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)
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);
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;
21116 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21117 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
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);
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),
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))
21141 (bdinfo_addr + TG3_BDINFO_NIC_ADDR),
21143 @@ -5181,7 +5202,7 @@
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);
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);
21160 tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE);
21161 @@ -5381,8 +5402,10 @@
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);
21173 @@ -5411,9 +5434,10 @@
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);
21186 __tg3_set_rx_mode(tp->dev);
21187 @@ -6003,9 +6027,11 @@
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);
21199 spin_unlock_irqrestore(&tp->lock, flags);
21201 tp->phy_crc_errors += val;
21202 @@ -6349,11 +6375,13 @@
21204 static int tg3_get_eeprom_len(struct net_device *dev)
21206 - return EEPROM_CHIP_SIZE;
21207 + struct tg3 *tp = netdev_priv(dev);
21209 + return tp->nvram_size;
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);
21216 static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
21218 struct tg3 *tp = dev->priv;
21219 @@ -6365,10 +6393,7 @@
21223 - ret = tg3_nvram_read_using_eeprom(tp, 0, &eeprom->magic);
21226 - eeprom->magic = swab32(eeprom->magic);
21227 + eeprom->magic = TG3_EEPROM_MAGIC;
21230 /* adjustments to start on required 4 byte boundary */
21231 @@ -6378,9 +6403,10 @@
21232 /* i.e. offset=1 len=2 */
21235 - ret = tg3_nvram_read_using_eeprom(tp, offset-b_offset, &val);
21236 + ret = tg3_nvram_read(tp, offset-b_offset, &val);
21239 + val = cpu_to_le32(val);
21240 memcpy(data, ((char*)&val) + b_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,
21249 + ret = tg3_nvram_read(tp, offset + i, &val);
21254 + val = cpu_to_le32(val);
21255 + memcpy(pd + i, &val, 4);
21259 @@ -6404,15 +6431,72 @@
21260 pd = &data[eeprom->len];
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);
21267 + val = cpu_to_le32(val);
21268 memcpy(pd, ((char*)&val), b_count);
21269 eeprom->len += b_count;
21274 +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf);
21276 +static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
21278 + struct tg3 *tp = netdev_priv(dev);
21280 + u32 offset, len, b_offset, odd_len, start, end;
21283 + if (eeprom->magic != TG3_EEPROM_MAGIC)
21286 + offset = eeprom->offset;
21287 + len = eeprom->len;
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);
21294 + start = cpu_to_le32(start);
21300 + if ((len & 3) && ((len > 4) || (b_offset == 0))) {
21301 + /* adjustments to end on required 4 byte boundary */
21303 + len = (len + 3) & ~3;
21304 + ret = tg3_nvram_read(tp, offset+len-4, &end);
21307 + end = cpu_to_le32(end);
21311 + if (b_offset || odd_len) {
21312 + buf = kmalloc(len, GFP_KERNEL);
21316 + memcpy(buf, &start, 4);
21318 + memcpy(buf+len-4, &end, 4);
21319 + memcpy(buf + b_offset, data, eeprom->len);
21322 + ret = tg3_nvram_write_block(tp, offset, len, buf);
21330 static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
21332 struct tg3 *tp = netdev_priv(dev);
21333 @@ -6561,10 +6645,10 @@
21336 spin_lock_irq(&tp->lock);
21337 - tg3_readphy(tp, MII_BMCR, &bmcr);
21338 - tg3_readphy(tp, MII_BMCR, &bmcr);
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);
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,
21359 +static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
21361 + u32 cursize, val;
21363 + tp->nvram_size = EEPROM_CHIP_SIZE;
21365 + if (tg3_nvram_read(tp, 0, &val) != 0)
21368 + if (swab32(val) != TG3_EEPROM_MAGIC)
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.
21378 + while (cursize < tp->nvram_size) {
21379 + if (tg3_nvram_read(tp, cursize, &val) != 0)
21382 + if (swab32(val) == TG3_EEPROM_MAGIC)
21388 + tp->nvram_size = cursize;
21391 +static void __devinit tg3_get_nvram_size(struct tg3 *tp)
21395 + if (tg3_nvram_read(tp, 0xf0, &val) == 0) {
21397 + tp->nvram_size = (val >> 16) * 1024;
21401 + tp->nvram_size = 0x20000;
21404 +static void __devinit tg3_get_nvram_info(struct tg3 *tp)
21408 + nvcfg1 = tr32(NVRAM_CFG1);
21409 + if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) {
21410 + tp->tg3_flags2 |= TG3_FLG2_FLASH;
21413 + nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
21414 + tw32(NVRAM_CFG1, nvcfg1);
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;
21424 + case FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED:
21425 + tp->nvram_jedecnum = JEDEC_ATMEL;
21426 + tp->nvram_pagesize = ATMEL_AT25F512_PAGE_SIZE;
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;
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;
21438 + case FLASH_VENDOR_SAIFUN:
21439 + tp->nvram_jedecnum = JEDEC_SAIFUN;
21440 + tp->nvram_pagesize = SAIFUN_SA25F0XX_PAGE_SIZE;
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;
21450 + tp->nvram_jedecnum = JEDEC_ATMEL;
21451 + tp->nvram_pagesize = ATMEL_AT45DB0X1B_PAGE_SIZE;
21452 + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
21456 /* Chips other than 5700/5701 use the NVRAM for fetching info. */
21457 static void __devinit tg3_nvram_init(struct tg3 *tp)
21459 @@ -6855,32 +7037,27 @@
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) {
21464 + tp->tg3_flags |= TG3_FLAG_NVRAM;
21466 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21467 u32 nvaccess = tr32(NVRAM_ACCESS);
21469 - tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21470 + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21473 - nvcfg1 = tr32(NVRAM_CFG1);
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;
21480 - nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
21481 - tw32(NVRAM_CFG1, nvcfg1);
21483 + tg3_get_nvram_info(tp);
21484 + tg3_get_nvram_size(tp);
21486 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21487 u32 nvaccess = tr32(NVRAM_ACCESS);
21489 - tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21490 + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21494 tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED);
21496 + tg3_get_eeprom_size(tp);
21500 @@ -6918,11 +7095,30 @@
21504 -static int __devinit tg3_nvram_read(struct tg3 *tp,
21505 - u32 offset, u32 *val)
21506 +#define NVRAM_CMD_TIMEOUT 10000
21508 +static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
21512 + tw32(NVRAM_CMD, nvram_cmd);
21513 + for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
21515 + if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
21520 + if (i == NVRAM_CMD_TIMEOUT) {
21526 +static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val)
21530 if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) {
21531 printk(KERN_ERR PFX "Attempt to do nvram_read on Sun 570X\n");
21533 @@ -6931,10 +7127,14 @@
21534 if (!(tp->tg3_flags & TG3_FLAG_NVRAM))
21535 return tg3_nvram_read_using_eeprom(tp, offset, val);
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)) {
21545 + offset = ((offset / tp->nvram_pagesize) <<
21546 + ATMEL_AT45DB0X1B_PAGE_POS) +
21547 + (offset % tp->nvram_pagesize);
21550 if (offset > NVRAM_ADDR_MSK)
21552 @@ -6948,19 +7148,11 @@
21555 tw32(NVRAM_ADDR, offset);
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);
21562 - /* Wait for done bit to clear. */
21563 - for (i = 0; i < 1000; i++) {
21565 - if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
21567 - *val = swab32(tr32(NVRAM_RDDATA));
21572 + *val = swab32(tr32(NVRAM_RDDATA));
21574 tg3_nvram_unlock(tp);
21576 @@ -6970,10 +7162,268 @@
21577 tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21586 +static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp,
21587 + u32 offset, u32 len, u8 *buf)
21589 + int i, j, rc = 0;
21592 + for (i = 0; i < len; i += 4) {
21595 + addr = offset + i;
21597 + memcpy(&data, buf + i, 4);
21599 + tw32(GRC_EEPROM_DATA, cpu_to_le32(data));
21601 + val = tr32(GRC_EEPROM_ADDR);
21602 + tw32(GRC_EEPROM_ADDR, val | EEPROM_ADDR_COMPLETE);
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);
21612 + for (j = 0; j < 10000; j++) {
21613 + val = tr32(GRC_EEPROM_ADDR);
21615 + if (val & EEPROM_ADDR_COMPLETE)
21619 + if (!(val & EEPROM_ADDR_COMPLETE)) {
21628 +/* offset and length are dword aligned */
21629 +static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
21633 + u32 pagesize = tp->nvram_pagesize;
21634 + u32 pagemask = pagesize - 1;
21638 + tmp = kmalloc(pagesize, GFP_KERNEL);
21644 + u32 phy_addr, page_off, size, nvaccess;
21646 + phy_addr = offset & ~pagemask;
21648 + for (j = 0; j < pagesize; j += 4) {
21649 + if ((ret = tg3_nvram_read(tp, phy_addr + j,
21650 + (u32 *) (tmp + j))))
21656 + page_off = offset & pagemask;
21663 + memcpy(tmp + page_off, buf, size);
21665 + offset = offset + (pagesize - page_off);
21667 + nvaccess = tr32(NVRAM_ACCESS);
21668 + tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21671 + * Before we can erase the flash page, we need
21672 + * to issue a special "write enable" command.
21674 + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21676 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21679 + /* Erase the target page */
21680 + tw32(NVRAM_ADDR, phy_addr);
21682 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR |
21683 + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_ERASE;
21685 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21688 + /* Issue another write enable to start the write. */
21689 + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21691 + if (tg3_nvram_exec_cmd(tp, nvram_cmd))
21694 + for (j = 0; j < pagesize; j += 4) {
21697 + data = *((u32 *) (tmp + j));
21698 + tw32(NVRAM_WRDATA, cpu_to_be32(data));
21700 + tw32(NVRAM_ADDR, phy_addr + j);
21702 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE |
21706 + nvram_cmd |= NVRAM_CMD_FIRST;
21707 + else if (j == (pagesize - 4))
21708 + nvram_cmd |= NVRAM_CMD_LAST;
21710 + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd)))
21717 + nvram_cmd = NVRAM_CMD_WRDI | NVRAM_CMD_GO | NVRAM_CMD_DONE;
21718 + tg3_nvram_exec_cmd(tp, nvram_cmd);
21725 +/* offset and length are dword aligned */
21726 +static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
21731 + for (i = 0; i < len; i += 4, offset += 4) {
21732 + u32 data, page_off, phy_addr, nvram_cmd;
21734 + memcpy(&data, buf + i, 4);
21735 + tw32(NVRAM_WRDATA, cpu_to_be32(data));
21737 + page_off = offset % tp->nvram_pagesize;
21739 + if ((tp->tg3_flags2 & TG3_FLG2_FLASH) &&
21740 + (tp->nvram_jedecnum == JEDEC_ATMEL)) {
21742 + phy_addr = ((offset / tp->nvram_pagesize) <<
21743 + ATMEL_AT45DB0X1B_PAGE_POS) + page_off;
21746 + phy_addr = offset;
21749 + tw32(NVRAM_ADDR, phy_addr);
21751 + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR;
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;
21758 + if (i == (len - 4))
21759 + nvram_cmd |= NVRAM_CMD_LAST;
21761 + if ((tp->nvram_jedecnum == JEDEC_ST) &&
21762 + (nvram_cmd & NVRAM_CMD_FIRST)) {
21764 + if ((ret = tg3_nvram_exec_cmd(tp,
21765 + NVRAM_CMD_WREN | NVRAM_CMD_GO |
21766 + NVRAM_CMD_DONE)))
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);
21775 + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd)))
21781 +/* offset and length are dword aligned */
21782 +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
21786 + if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) {
21787 + printk(KERN_ERR PFX "Attempt to do nvram_write on Sun 570X\n");
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);
21797 + if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) {
21798 + ret = tg3_nvram_write_block_using_eeprom(tp, offset, len, buf);
21803 + tg3_nvram_lock(tp);
21805 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21806 + u32 nvaccess = tr32(NVRAM_ACCESS);
21808 + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
21810 + tw32(NVRAM_WRITE1, 0x406);
21813 + grc_mode = tr32(GRC_MODE);
21814 + tw32(GRC_MODE, grc_mode | GRC_MODE_NVRAM_WR_ENABLE);
21816 + if ((tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) ||
21817 + !(tp->tg3_flags2 & TG3_FLG2_FLASH)) {
21819 + ret = tg3_nvram_write_block_buffered(tp, offset, len,
21823 + ret = tg3_nvram_write_block_unbuffered(tp, offset, len,
21827 + grc_mode = tr32(GRC_MODE);
21828 + tw32(GRC_MODE, grc_mode & ~GRC_MODE_NVRAM_WR_ENABLE);
21830 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
21831 + u32 nvaccess = tr32(NVRAM_ACCESS);
21833 + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
21835 + tg3_nvram_unlock(tp);
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);
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;
21855 tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
21856 tp->nic_sram_data_cfg = nic_cfg;
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);
21866 eeprom_signature_found = 1;
21868 if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) ==
21869 @@ -7070,8 +7528,7 @@
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);
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;
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;
21891 @@ -7130,9 +7586,13 @@
21892 if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)
21893 tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP;
21895 - tg3_read_mem(tp, NIC_SRAM_DATA_PHY_ID, &cfg2);
21896 if (cfg2 & (1 << 17))
21897 tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING;
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;
21905 /* Reading the PHY ID register can conflict with ASF
21906 @@ -7188,9 +7648,8 @@
21907 u32 bmsr, adv_reg, tg3_ctrl;
21909 tg3_readphy(tp, MII_BMSR, &bmsr);
21910 - tg3_readphy(tp, MII_BMSR, &bmsr);
21912 - if (bmsr & BMSR_LSTATUS)
21913 + if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
21914 + (bmsr & BMSR_LSTATUS))
21915 goto skip_phy_reset;
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;
21922 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
21923 + tp->tg3_flags2 |= TG3_FLG2_HW_TSO;
21925 if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0)
21926 tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
21928 @@ -8302,11 +8764,13 @@
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;
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;
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 */
21997 /* 0x7400 --> 0x8000 unused */
21999 +#define TG3_EEPROM_MAGIC 0x669955aa
22001 /* 32K Window into NIC internal memory */
22002 #define NIC_SRAM_WIN_BASE 0x00008000
22004 @@ -1438,6 +1452,9 @@
22005 #define NIC_SRAM_DATA_CFG_FIBER_WOL 0x00004000
22006 #define NIC_SRAM_DATA_CFG_NO_GPIO2 0x00100000
22008 +#define NIC_SRAM_DATA_VER 0x00000b5c
22009 +#define NIC_SRAM_DATA_VER_SHIFT 16
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
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;
22030 + u32 nvram_pagesize;
22031 + u32 nvram_jedecnum;
22033 +#define JEDEC_ATMEL 0x1f
22034 +#define JEDEC_ST 0x20
22035 +#define JEDEC_SAIFUN 0x4f
22036 +#define JEDEC_SST 0xbf
22038 +#define ATMEL_AT24C64_CHIP_SIZE (64 * 1024)
22039 +#define ATMEL_AT24C64_PAGE_SIZE (32)
22041 +#define ATMEL_AT24C512_CHIP_SIZE (512 * 1024)
22042 +#define ATMEL_AT24C512_PAGE_SIZE (128)
22044 +#define ATMEL_AT45DB0X1B_PAGE_POS 9
22045 +#define ATMEL_AT45DB0X1B_PAGE_SIZE 264
22047 +#define ATMEL_AT25F512_PAGE_SIZE 256
22049 +#define ST_M45PEX0_PAGE_SIZE 256
22051 +#define SAIFUN_SA25F0XX_PAGE_SIZE 256
22053 +#define SST_25VF0X0_PAGE_SIZE 4098
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
22066 -#include "tulip.h"
22067 #include <linux/pci.h>
22068 +#include "tulip.h"
22069 #include <linux/delay.h>
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
22079 +#include <linux/pci.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 @@
22090 +#include <linux/pci.h>
22092 #include <linux/config.h>
22093 #include <linux/etherdevice.h>
22094 -#include <linux/pci.h>
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
22102 #include <linux/mii.h>
22103 #include <linux/init.h>
22104 #include <linux/delay.h>
22105 +#include <linux/pci.h>
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
22116 -#include "tulip.h"
22117 #include <linux/pci.h>
22118 +#include "tulip.h"
22119 #include <linux/delay.h>
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
22128 #include <linux/kernel.h>
22129 +#include <linux/pci.h>
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
22140 +#include <linux/pci.h>
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
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 @@
22164 +/* bit mask for CSR5 TX/RX process state */
22165 +#define CSR5_TS 0x00700000
22166 +#define CSR5_RS 0x000e0000
22168 enum tulip_mode_bits {
22169 TxThreshold = (1 << 22),
22170 @@ -484,9 +487,19 @@
22171 u32 csr6 = inl(ioaddr + CSR6);
22174 + unsigned i=1300/10;
22175 outl(csr6 & ~RxTx, ioaddr + CSR6);
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.
22182 + while (--i && (inl(ioaddr + CSR5) & (CSR5_TS|CSR5_RS)))
22186 + printk (KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
22187 + tp->pdev->slot_name);
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 @@
22196 unsigned int buses;
22198 + unsigned short bctl;
22199 struct pci_bus *child;
22200 int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
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()) {
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);
22216 + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
22217 sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
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.
22228 - * TODO: When we have device-specific interrupt routers,
22229 - * quirk_via_irqpic will go away from quirks.
22233 @@ -393,22 +390,6 @@
22237 -static void __init quirk_via_irqpic(struct pci_dev *dev)
22239 - u8 irq, new_irq = dev->irq & 0xf;
22241 - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
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);
22248 - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
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
22260 -int interrupt_line_quirk;
22261 +int via_interrupt_line_quirk;
22263 static void __init quirk_via_bridge(struct pci_dev *pdev)
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;
22274 @@ -773,9 +756,6 @@
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 },
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
22290 - * Alchemy Semi Db1x00 boards specific pcmcia routines.
22291 + * AMD Alchemy DUAL-SLOT Db1x00 boards' specific pcmcia routines.
22293 * Copyright 2002 MontaVista Software Inc.
22294 * Author: MontaVista Software, Inc.
22296 #include <asm/au1000.h>
22297 #include <asm/au1000_pcmcia.h>
22299 +#if defined(CONFIG_MIPS_PB1200)
22300 +#include <asm/pb1200.h>
22301 +#elif defined(CONFIG_MIPS_DB1200)
22302 +#include <asm/db1200.h>
22304 #include <asm/db1x00.h>
22307 -static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
22308 +#define PCMCIA_MAX_SOCK 1
22309 +#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
22312 +#define SET_VCC_VPP(VCC, VPP, SLOT)\
22313 + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
22315 static int db1x00_pcmcia_init(struct pcmcia_init *init)
22318 db1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
22321 - unsigned char vs;
22324 if(sock > PCMCIA_MAX_SOCK) return -1;
22326 @@ -87,11 +98,11 @@
22329 vs = bcsr->status & 0x3;
22330 - inserted = !(bcsr->status & (1<<4));
22331 + inserted = BOARD_CARD_INSERTED(0);
22334 vs = (bcsr->status & 0xC)>>2;
22335 - inserted = !(bcsr->status & (1<<5));
22336 + inserted = BOARD_CARD_INSERTED(1);
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;
22343 if(info->sock == 0)
22344 -#ifdef CONFIG_MIPS_DB1550
22345 - info->irq = AU1000_GPIO_3;
22346 + info->irq = BOARD_PC0_INT;
22348 - info->irq = AU1000_GPIO_5;
22350 - info->irq = AU1000_GPIO_2;
22352 - info->irq = AU1000_GPIO_5;
22355 + info->irq = BOARD_PC1_INT;
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 @@
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);
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
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
22383 + dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
22385 if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
22386 dep_bool ' SiByte PCMCIA support' CONFIG_PCMCIA_SIBYTE $CONFIG_PCMCIA $CONFIG_BLK_DEV_IDE_SIBYTE
22388 + if [ "$CONFIG_VRC4171" = "y" -o "$CONFIG_VRC4171" = "m" ]; then
22389 + dep_tristate ' NEC VRC4171 Card Controllers support' CONFIG_PCMCIA_VRC4171 $CONFIG_PCMCIA
22391 if [ "$CONFIG_VRC4173" = "y" -o "$CONFIG_VRC4173" = "m" ]; then
22392 dep_tristate ' NEC VRC4173 CARDU support' CONFIG_PCMCIA_VRC4173 $CONFIG_PCMCIA
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
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
22417 obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
22418 obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
22420 sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
22421 sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
22423 +obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
22424 obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
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
22432 + * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services.
22434 + * Copyright (C) 2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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.
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.
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
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>
22458 +#include <asm/io.h>
22459 +#include <asm/vr41xx/vrc4171.h>
22461 +#include <pcmcia/ss.h>
22463 +#include "i82365.h"
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");
22469 +#define CARD_MAX_SLOTS 2
22470 +#define CARD_SLOTA 0
22471 +#define CARD_SLOTB 1
22472 +#define CARD_SLOTB_OFFSET 0x40
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
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
22502 +#define IO_MAX_MAPS 2
22503 +#define MEM_MAX_MAPS 5
22507 + SLOTB_NOPROBE_IO,
22508 + SLOTB_NOPROBE_MEM,
22509 + SLOTB_NOPROBE_ALL
22512 +typedef struct vrc4171_socket {
22514 + void (*handler)(void *, unsigned int);
22516 + socket_cap_t cap;
22517 + spinlock_t event_lock;
22519 + struct socket_info_t *pcmcia_socket;
22520 + struct tq_struct tq_task;
22524 +} vrc4171_socket_t;
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;
22531 +extern struct socket_info_t *pcmcia_register_socket(int slot,
22532 + struct pccard_operations *vtable,
22534 +extern void pcmcia_unregister_socket(struct socket_info_t *s);
22536 +static inline uint8_t exca_read_byte(int slot, uint8_t index)
22538 + if (slot == CARD_SLOTB)
22539 + index += CARD_SLOTB_OFFSET;
22541 + outb(index, CARD_CONTROLLER_INDEX);
22542 + return inb(CARD_CONTROLLER_DATA);
22545 +static inline uint16_t exca_read_word(int slot, uint8_t index)
22549 + if (slot == CARD_SLOTB)
22550 + index += CARD_SLOTB_OFFSET;
22552 + outb(index++, CARD_CONTROLLER_INDEX);
22553 + data = inb(CARD_CONTROLLER_DATA);
22555 + outb(index, CARD_CONTROLLER_INDEX);
22556 + data |= ((uint16_t)inb(CARD_CONTROLLER_DATA)) << 8;
22561 +static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t data)
22563 + if (slot == CARD_SLOTB)
22564 + index += CARD_SLOTB_OFFSET;
22566 + outb(index, CARD_CONTROLLER_INDEX);
22567 + outb(data, CARD_CONTROLLER_DATA);
22572 +static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t data)
22574 + if (slot == CARD_SLOTB)
22575 + index += CARD_SLOTB_OFFSET;
22577 + outb(index++, CARD_CONTROLLER_INDEX);
22578 + outb(data, CARD_CONTROLLER_DATA);
22580 + outb(index, CARD_CONTROLLER_INDEX);
22581 + outb((uint8_t)(data >> 8), CARD_CONTROLLER_DATA);
22586 +static inline int search_nonuse_irq(void)
22590 + for (i = 0; i < 16; i++) {
22591 + if (vrc4171_irq_mask & (1 << i)) {
22592 + vrc4171_irq_mask &= ~(1 << i);
22600 +static int pccard_init(unsigned int slot)
22602 + vrc4171_socket_t *socket = &vrc4171_sockets[slot];
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();
22616 +static int pccard_suspend(unsigned int slot)
22621 +static int pccard_register_callback(unsigned int slot,
22622 + void (*handler)(void *, unsigned int),
22625 + vrc4171_socket_t *socket;
22627 + if (slot >= CARD_MAX_SLOTS)
22630 + socket = &vrc4171_sockets[slot];
22632 + socket->handler = handler;
22633 + socket->info = info;
22636 + MOD_INC_USE_COUNT;
22638 + MOD_DEC_USE_COUNT;
22643 +static int pccard_inquire_socket(unsigned int slot, socket_cap_t *cap)
22645 + vrc4171_socket_t *socket;
22647 + if (slot >= CARD_MAX_SLOTS || cap == NULL)
22650 + socket = &vrc4171_sockets[slot];
22652 + *cap = socket->cap;
22657 +static int pccard_get_status(unsigned int slot, u_int *value)
22659 + uint8_t status, sense;
22662 + if (slot >= CARD_MAX_SLOTS || value == NULL)
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;
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;
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)
22681 + if (status & I365_CS_POWERON)
22682 + val |= SS_POWERON;
22684 + sense = exca_read_byte(slot, CARD_VOLTAGE_SENSE);
22686 + case VCC_3VORXV_CAPABLE:
22687 + val |= SS_3VCARD | SS_XVCARD;
22689 + case VCC_XV_ONLY:
22690 + val |= SS_XVCARD;
22692 + case VCC_3V_CAPABLE:
22693 + val |= SS_3VCARD;
22705 +static inline u_char get_Vcc_value(uint8_t voltage)
22707 + switch (voltage) {
22708 + case VCC_STATUS_3V:
22710 + case VCC_STATUS_5V:
22719 +static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
22721 + if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
22727 +static int pccard_get_socket(unsigned int slot, socket_state_t *state)
22729 + vrc4171_socket_t *socket;
22730 + uint8_t power, voltage, control, cscint;
22732 + if (slot >= CARD_MAX_SLOTS || state == NULL)
22735 + socket = &vrc4171_sockets[slot];
22737 + power = exca_read_byte(slot, I365_POWER);
22738 + voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
22740 + state->Vcc = get_Vcc_value(voltage);
22741 + state->Vpp = get_Vpp_value(power, state->Vcc);
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;
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;
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;
22761 + if (cscint & I365_CSC_BVD1)
22762 + state->csc_mask |= SS_BATDEAD;
22763 + if (cscint & I365_CSC_BVD2)
22764 + state->csc_mask |= SS_BATWARN;
22766 + if (cscint & I365_CSC_READY)
22767 + state->csc_mask |= SS_READY;
22768 + if (cscint & I365_CSC_DETECT)
22769 + state->csc_mask |= SS_DETECT;
22774 +static inline uint8_t set_Vcc_value(u_char Vcc)
22783 + /* Small voltage is chosen for safety. */
22787 +static int pccard_set_socket(unsigned int slot, socket_state_t *state)
22789 + vrc4171_socket_t *socket;
22790 + uint8_t voltage, power, control, cscint;
22792 + if (slot >= CARD_MAX_SLOTS ||
22793 + (state->Vpp != state->Vcc && state->Vpp != 0) ||
22794 + (state->Vcc != 50 && state->Vcc != 33 && state->Vcc != 0))
22797 + socket = &vrc4171_sockets[slot];
22799 + spin_lock_irq(&socket->event_lock);
22801 + voltage = set_Vcc_value(state->Vcc);
22802 + exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
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);
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;
22819 + control |= I365_PC_RESET;
22820 + exca_write_byte(slot, I365_INTCTL, control);
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;
22831 + if (state->csc_mask & SS_BATDEAD)
22832 + cscint |= I365_CSC_BVD1;
22833 + if (state->csc_mask & SS_BATWARN)
22834 + cscint |= I365_CSC_BVD2;
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);
22842 + spin_unlock_irq(&socket->event_lock);
22847 +static int pccard_get_io_map(unsigned int slot, struct pccard_io_map *io)
22849 + vrc4171_socket_t *socket;
22850 + uint8_t ioctl, addrwin;
22853 + if (slot >= CARD_MAX_SLOTS || io == NULL ||
22854 + io->map >= IO_MAX_MAPS)
22857 + socket = &vrc4171_sockets[slot];
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);
22863 + ioctl = exca_read_byte(slot, I365_IOCTL);
22864 + if (io->flags & I365_IOCTL_WAIT(map))
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;
22877 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22878 + if (addrwin & I365_ENA_IO(map))
22879 + io->flags |= MAP_ACTIVE;
22884 +static int pccard_set_io_map(unsigned int slot, struct pccard_io_map *io)
22886 + vrc4171_socket_t *socket;
22887 + uint8_t ioctl, addrwin;
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)
22895 + socket = &vrc4171_sockets[slot];
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);
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);
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);
22918 + if (io->flags & MAP_ACTIVE) {
22919 + addrwin |= I365_ENA_IO(map);
22920 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
22926 +static int pccard_get_mem_map(unsigned int slot, struct pccard_mem_map *mem)
22928 + vrc4171_socket_t *socket;
22930 + u_long start, stop;
22934 + if (slot >= CARD_MAX_SLOTS || mem == NULL || mem->map >= MEM_MAX_MAPS)
22937 + socket = &vrc4171_sockets[slot];
22943 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
22944 + if (addrwin & I365_ENA_MEM(map))
22945 + mem->flags |= MAP_ACTIVE;
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;
22952 + stop = exca_read_word(slot, I365_MEM(map)+I365_W_STOP);
22953 + if (start & I365_MEM_WS0)
22955 + if (start & I365_MEM_WS1)
22957 + mem->sys_stop = ((stop & 0x3fffUL) << 12) + 0xfffUL;
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;
22966 + mem->sys_start += CARD_MEM_START;
22967 + mem->sys_stop += CARD_MEM_START;
22972 +static int pccard_set_mem_map(unsigned int slot, struct pccard_mem_map *mem)
22974 + vrc4171_socket_t *socket;
22975 + uint16_t start, stop, offset;
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)
22988 + socket = &vrc4171_sockets[slot];
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);
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);
23002 + stop = (mem->sys_stop >> 12) & 0x3fff;
23003 + switch (mem->speed) {
23007 + stop |= I365_MEM_WS0;
23010 + stop |= I365_MEM_WS1;
23013 + stop |= I365_MEM_WS0 | I365_MEM_WS1;
23016 + exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop);
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);
23025 + if (mem->flags & MAP_ACTIVE) {
23026 + addrwin |= I365_ENA_MEM(map);
23027 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23033 +static void pccard_proc_setup(unsigned int slot, struct proc_dir_entry *base)
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,
23052 +static void pccard_bh(void *data)
23054 + vrc4171_socket_t *socket = (vrc4171_socket_t *)data;
23057 + spin_lock_irq(&socket->event_lock);
23058 + events = socket->events;
23059 + socket->events = 0;
23060 + spin_unlock_irq(&socket->event_lock);
23062 + if (socket->handler)
23063 + socket->handler(socket->info, events);
23066 +static inline uint16_t get_events(int slot)
23068 + uint16_t events = 0;
23069 + uint8_t status, csc;
23071 + status = exca_read_byte(slot, I365_STATUS);
23072 + csc = exca_read_byte(slot, I365_CSC);
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;
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;
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;
23093 +static void pccard_status_change(int slot, vrc4171_socket_t *socket)
23097 + socket->tq_task.routine = pccard_bh;
23098 + socket->tq_task.data = socket;
23100 + events = get_events(slot);
23102 + spin_lock(&socket->event_lock);
23103 + socket->events |= events;
23104 + spin_unlock(&socket->event_lock);
23105 + schedule_task(&socket->tq_task);
23109 +static void pccard_interrupt(int irq, void *dev_id, struct pt_regs *regs)
23111 + vrc4171_socket_t *socket;
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);
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);
23132 +static inline void reserve_using_irq(int slot)
23134 + unsigned int irq;
23136 + irq = exca_read_byte(slot, I365_INTCTL);
23138 + vrc4171_irq_mask &= ~(1 << irq);
23140 + irq = exca_read_byte(slot, I365_CSCINT);
23141 + irq = (irq & 0xf0) >> 4;
23142 + vrc4171_irq_mask &= ~(1 << irq);
23145 +static int __devinit vrc4171_add_socket(int slot)
23147 + vrc4171_socket_t *socket;
23149 + if (slot >= CARD_MAX_SLOTS)
23152 + socket = &vrc4171_sockets[slot];
23153 + if (socket->noprobe != SLOTB_PROBE) {
23156 + switch (socket->noprobe) {
23157 + case SLOTB_NOPROBE_MEM:
23158 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
23160 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23162 + case SLOTB_NOPROBE_IO:
23163 + addrwin = exca_read_byte(slot, I365_ADDRWIN);
23165 + exca_write_byte(slot, I365_ADDRWIN, addrwin);
23171 + reserve_using_irq(slot);
23176 + sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot);
23178 + socket->pcmcia_socket = pcmcia_register_socket(slot, &vrc4171_pccard_operations, 1);
23179 + if (socket->pcmcia_socket == NULL)
23182 + exca_write_byte(slot, I365_ADDRWIN, 0);
23184 + exca_write_byte(slot, GLOBAL_CONTROL, 0);
23189 +static void vrc4171_remove_socket(int slot)
23191 + vrc4171_socket_t *socket;
23193 + if (slot >= CARD_MAX_SLOTS)
23196 + socket = &vrc4171_sockets[slot];
23198 + if (socket->pcmcia_socket != NULL) {
23199 + pcmcia_unregister_socket(socket->pcmcia_socket);
23200 + socket->pcmcia_socket = NULL;
23204 +static int __devinit vrc4171_card_setup(char *options)
23206 + if (options == NULL || *options == '\0')
23209 + if (strncmp(options, "irq:", 4) == 0) {
23212 + irq = simple_strtoul(options, &options, 0);
23213 + if (irq >= 0 && irq < NR_IRQS)
23214 + vrc4171_irq = irq;
23216 + if (*options != ',')
23221 + if (strncmp(options, "slota:", 6) == 0) {
23223 + if (*options != '\0') {
23224 + if (strncmp(options, "noprobe", 7) == 0) {
23225 + vrc4171_sockets[CARD_SLOTA].noprobe = 1;
23229 + if (*options != ',')
23237 + if (strncmp(options, "slotb:", 6) == 0) {
23239 + if (*options != '\0') {
23240 + if (strncmp(options, "pccard", 6) == 0) {
23241 + vrc4171_slotb = SLOTB_IS_PCCARD;
23243 + } else if (strncmp(options, "cf", 2) == 0) {
23244 + vrc4171_slotb = SLOTB_IS_CF;
23246 + } else if (strncmp(options, "flashrom", 8) == 0) {
23247 + vrc4171_slotb = SLOTB_IS_FLASHROM;
23249 + } else if (strncmp(options, "none", 4) == 0) {
23250 + vrc4171_slotb = SLOTB_IS_NONE;
23254 + if (*options != ',')
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;
23270 +__setup("vrc4171_card=", vrc4171_card_setup);
23272 +static int __devinit vrc4171_card_init(void)
23274 + int retval, slot;
23276 + vrc4171_set_multifunction_pin(vrc4171_slotb);
23278 + if (request_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE,
23279 + "NEC VRC4171 Card Controller") == NULL)
23282 + for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
23283 + if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE)
23286 + retval = vrc4171_add_socket(slot);
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);
23300 + printk(KERN_INFO "NEC VRC4171 Card Controller, connected to IRQ %d\n", vrc4171_irq);
23305 +static void __devexit vrc4171_card_exit(void)
23309 + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
23310 + vrc4171_remove_socket(slot);
23312 + release_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE);
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
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.");
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.");
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);
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);
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);
23361 return put_user(i, (int *)arg);
23362 @@ -798,7 +806,7 @@
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.
23376 - * TODO: Make number of input/output buffers tunable parameters
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);
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 @@
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
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 @@
23411 static void dbri_process_interrupt_buffer(struct dbri *);
23413 -static void dbri_cmdsend(struct dbri *dbri, volatile s32 *cmd)
23414 +static void dbri_cmdsend(struct dbri *dbri, volatile s32 *cmd, int pause)
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");
23422 - *(cmd++) = DBRI_CMD(D_PAUSE, 0, 0);
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))
23431 - if (maxloops == 0) {
23432 - printk("DBRI: Chip never completed command buffer\n");
23434 - while ((--maxloops) > 0 && (! dbri->wait_seen))
23435 - dbri_process_interrupt_buffer(dbri);
23437 + while ((--maxloops) > 0 &&
23438 + (sbus_readl(dbri->regs + REG0) & D_P))
23440 if (maxloops == 0) {
23441 - printk("DBRI: Chip never acked WAIT\n");
23442 + printk("DBRI: Chip never completed command buffer\n");
23444 - dprintk(D_INT, ("DBRI: Chip completed command "
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");
23452 + dprintk(D_INT, ("DBRI: Chip completed command "
23454 + MAXLOOPS - maxloops));
23458 + dprintk(D_INT, ("DBRI: NO PAUSE\n"));
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;
23471 sbus_writel(tmp, dbri->regs + REG0);
23474 @@ -268,7 +277,7 @@
23475 *(cmd++) = DBRI_CMD(D_IIQ, 0, 0);
23476 *(cmd++) = dma_addr;
23478 - dbri_cmdsend(dbri, cmd);
23479 + dbri_cmdsend(dbri, cmd, 1);
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);
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);
23496 - dbri_cmdsend(dbri, cmd);
23497 + dbri_cmdsend(dbri, cmd, 1);
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);
23505 - dbri_cmdsend(dbri, cmd);
23506 + dbri_cmdsend(dbri, cmd, 1);
23509 /* I don't use this function, so it's basically untested. */
23510 @@ -752,7 +761,7 @@
23511 *(cmd++) = D_TS_NEXT(nextpipe);
23514 - dbri_cmdsend(dbri, cmd);
23515 + dbri_cmdsend(dbri, cmd, 1);
23518 /* xmit_fixed() / recv_fixed()
23519 @@ -803,7 +812,7 @@
23520 *(cmd++) = DBRI_CMD(D_SSP, 0, pipe);
23523 - dbri_cmdsend(dbri, cmd);
23524 + dbri_cmdsend(dbri, cmd, 1);
23527 static void recv_fixed(struct dbri *dbri, int pipe, volatile __u32 *ptr)
23528 @@ -884,7 +893,9 @@
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;
23539 @@ -954,7 +965,7 @@
23541 cmd = dbri_cmdlock(dbri);
23542 *(cmd++) = DBRI_CMD(D_CDP, 0, pipe);
23543 - dbri_cmdsend(dbri,cmd);
23544 + dbri_cmdsend(dbri,cmd, 0);
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);
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);
23561 - dbri_cmdsend(dbri, cmd);
23562 + dbri_cmdsend(dbri, cmd, 1);
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);
23570 - dbri_cmdsend(dbri, cmd);
23571 + dbri_cmdsend(dbri, cmd, 1);
23575 @@ -1538,7 +1549,6 @@
23576 xmit_on_pipe(dbri, 4, buffer, count,
23577 &dbri_audio_output_callback, drv);
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.
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
23594 sparcaudio_output_done(drv, 2);
23598 static void dbri_stop_output(struct sparcaudio_driver *drv)
23599 @@ -1842,6 +1857,12 @@
23600 return dbri_get_output_rate(drv);
23603 +static int dbri_get_formats(struct sparcaudio_driver *drv)
23605 +/* 8-bit format is not working */
23606 + return (AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE);
23609 /******************* sparcaudio midlevel - ports ***********************/
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, */
23632 @@ -2093,7 +2127,7 @@
23634 *(cmd++) = DBRI_CMD(D_TE, 0, val);
23636 - dbri_cmdsend(dbri, cmd);
23637 + dbri_cmdsend(dbri, cmd, 1);
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
23645 #define DRV_NAME "ahci"
23646 #define DRV_VERSION "1.00"
23648 -#define msleep libata_msleep /* 2.4-specific */
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);
23660 static Scsi_Host_Template ahci_sht = {
23661 @@ -206,6 +205,8 @@
23662 .port_disable = ata_port_disable,
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,
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 */
23683 @@ -448,6 +455,13 @@
23684 return readl(mmio + PORT_TFDATA) & 0xFF;
23687 +static u8 ahci_check_err(struct ata_port *ap)
23689 + void *mmio = (void *) ap->ioaddr.cmd_addr;
23691 + return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
23694 static void ahci_fill_sg(struct ata_queued_cmd *qc)
23696 struct ahci_port_priv *pp = qc->ap->private_data;
23697 @@ -515,15 +529,6 @@
23701 -static inline void ahci_dma_complete (struct ata_port *ap,
23702 - struct ata_queued_cmd *qc,
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);
23710 static void ahci_intr_error(struct ata_port *ap, u32 irq_stat)
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 */
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);
23721 static void ahci_eng_timeout(struct ata_port *ap)
23722 @@ -761,10 +766,10 @@
23724 using_dac = hpriv->cap & HOST_CAP_64;
23726 - !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
23727 + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
23728 hpriv->flags |= HOST_CAP_64;
23730 - rc = pci_set_dma_mask(pdev, 0xffffffffULL);
23731 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
23733 printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n",
23735 @@ -929,6 +934,7 @@
23736 unsigned long base;
23738 unsigned int board_idx = (unsigned int) ent->driver_data;
23739 + int pci_dev_busy = 0;
23742 VPRINTK("ENTER\n");
23743 @@ -941,8 +947,10 @@
23746 rc = pci_request_regions(pdev, DRV_NAME);
23749 + pci_dev_busy = 1;
23753 pci_enable_intx(pdev);
23755 @@ -1002,7 +1010,8 @@
23757 pci_release_regions(pdev);
23759 - pci_disable_device(pdev);
23760 + if (!pci_dev_busy)
23761 + pci_disable_device(pdev);
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
23773 + * PCI errors. First pause without causing another
23776 + hcntrl &= ~CHIPRST;
23777 ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
23778 while (ahd_is_paused(ahd) == 0)
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
23788 + * PCI errors. First pause without causing another
23791 + hcntrl &= ~CHIPRST;
23792 ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
23793 while (ahc_is_paused(ahc) == 0)
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 @@
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,
23807 @@ -164,6 +166,8 @@
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,
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
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 @@
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
23838 * Reads ATA taskfile status register for currently-selected device
23839 @@ -414,6 +414,27 @@
23840 return ata_check_status_pio(ap);
23843 +u8 ata_altstatus(struct ata_port *ap)
23845 + if (ap->ops->check_altstatus)
23846 + return ap->ops->check_altstatus(ap);
23848 + if (ap->flags & ATA_FLAG_MMIO)
23849 + return readb((void __iomem *)ap->ioaddr.altstatus_addr);
23850 + return inb(ap->ioaddr.altstatus_addr);
23853 +u8 ata_chk_err(struct ata_port *ap)
23855 + if (ap->ops->check_err)
23856 + return ap->ops->check_err(ap);
23858 + if (ap->flags & ATA_FLAG_MMIO) {
23859 + return readb((void __iomem *) ap->ioaddr.error_addr);
23861 + return inb(ap->ioaddr.error_addr);
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",
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");
23875 @@ -1668,7 +1688,8 @@
23876 ata_dev_try_classify(ap, 1);
23878 /* re-enable interrupts */
23880 + if (ap->ioaddr.ctl_addr) /* FIXME: hack. create a hook instead */
23883 /* is double-select really necessary? */
23884 if (ap->device[1].class != ATA_DEV_NONE)
23885 @@ -1699,6 +1720,69 @@
23889 +static void ata_pr_blacklisted(struct ata_port *ap, struct ata_device *dev)
23891 + printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n",
23892 + ap->id, dev->devno);
23895 +static const char * ata_dma_blacklist [] = {
23903 + "Compaq CRD-8241B",
23909 + "SanDisk SDP3B-64",
23910 + "SANYO CD-ROM CRD",
23912 + "HITACHI CDR-8335",
23913 + "HITACHI CDR-8435",
23914 + "Toshiba CD-ROM XM-6202B",
23916 + "E-IDE CD-ROM CR-840",
23917 + "CD-ROM Drive/F5A",
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",
23927 +static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev)
23929 + unsigned char model_num[40];
23931 + unsigned int len;
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));
23939 + /* ATAPI specifies that empty space is blank-filled; remove blanks */
23940 + while ((len > 0) && (s[len - 1] == ' ')) {
23945 + for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++)
23946 + if (!strncmp(ata_dma_blacklist[i], s, len))
23952 static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift)
23954 struct ata_device *master, *slave;
23955 @@ -1711,17 +1795,37 @@
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)) {
23965 + ata_pr_blacklisted(ap, master);
23968 + if (ata_dev_present(slave)) {
23969 mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff);
23970 + if (ata_dma_blacklisted(ap, slave)) {
23972 + ata_pr_blacklisted(ap, slave);
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)) {
23984 + ata_pr_blacklisted(ap, master);
23987 + if (ata_dev_present(slave)) {
23988 mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07);
23989 + if (ata_dma_blacklisted(ap, slave)) {
23991 + ata_pr_blacklisted(ap, slave);
23995 else if (shift == ATA_SHIFT_PIO) {
23996 mask = ap->pio_mask;
23997 @@ -2518,10 +2622,10 @@
24000 case ATA_PROT_ATAPI_DMA:
24001 - host_stat = ata_bmdma_status(ap);
24002 + host_stat = ap->ops->bmdma_status(ap);
24004 /* before we do anything else, clear DMA-Start bit */
24005 - ata_bmdma_stop(ap);
24006 + ap->ops->bmdma_stop(ap);
24010 @@ -2530,7 +2634,7 @@
24011 drv_stat = ata_chk_status(ap);
24013 /* ack bmdma irq events */
24014 - ata_bmdma_ack_irq(ap);
24015 + ap->ops->irq_clear(ap);
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 @@
24023 + * ata_qc_free - free unused ata_queued_cmd
24024 + * @qc: Command to complete
24026 + * Designed to free unused ata_queued_cmd object
24027 + * in case something prevents using it.
24032 +void ata_qc_free(struct ata_queued_cmd *qc)
24034 + assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */
24035 + assert(qc->waiting == NULL); /* nothing should be waiting */
24037 + __ata_qc_complete(qc);
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 @@
24053 @@ -2959,7 +3081,43 @@
24055 void ata_bmdma_irq_clear(struct ata_port *ap)
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);
24062 + unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
24063 + outb(inb(addr), addr);
24068 +u8 ata_bmdma_status(struct ata_port *ap)
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);
24075 + host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
24076 + return host_stat;
24079 +void ata_bmdma_stop(struct ata_port *ap)
24081 + if (ap->flags & ATA_FLAG_MMIO) {
24082 + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
24084 + /* clear start/stop bit */
24085 + writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
24086 + mmio + ATA_DMA_CMD);
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);
24093 + /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
24094 + ata_altstatus(ap); /* dummy read */
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);
24106 /* if it's not our irq... */
24107 @@ -2997,7 +3155,7 @@
24110 /* before we do anything else, clear DMA-Start bit */
24111 - ata_bmdma_stop(ap);
24112 + ap->ops->bmdma_stop(ap);
24116 @@ -3016,7 +3174,7 @@
24117 ap->id, qc->tf.protocol, status);
24119 /* ack bmdma irq events */
24120 - ata_bmdma_ack_irq(ap);
24121 + ap->ops->irq_clear(ap);
24123 /* complete taskfile transaction */
24124 ata_qc_complete(qc, status);
24125 @@ -3470,32 +3628,28 @@
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)
24132 struct ata_probe_ent *probe_ent;
24135 - probe_ent = kmalloc(sizeof(*probe_ent) * n, GFP_KERNEL);
24136 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
24138 printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
24139 pci_name(to_pci_dev(dev)));
24143 - memset(probe_ent, 0, sizeof(*probe_ent) * n);
24144 + memset(probe_ent, 0, sizeof(*probe_ent));
24146 - for (i = 0; i < n; i++) {
24147 - INIT_LIST_HEAD(&probe_ent[i].node);
24148 - probe_ent[i].dev = dev;
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;
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;
24169 @@ -3505,7 +3659,7 @@
24170 ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
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]);
24178 @@ -3531,39 +3685,47 @@
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)
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;
24192 + probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
24195 + probe_ent2 = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[1]);
24196 + if (!probe_ent2) {
24197 + kfree(probe_ent);
24201 + probe_ent->n_ports = 1;
24202 + probe_ent->irq = 14;
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;
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;
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;
24219 - probe_ent[1].hard_port_no = 1;
24220 - probe_ent[1].legacy_mode = 1;
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);
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);
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;
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]);
24246 + *ppe2 = probe_ent2;
24250 @@ -3587,6 +3749,7 @@
24251 struct ata_port_info *port[2];
24253 unsigned int legacy_mode = 0;
24254 + int disable_dev_on_err = 1;
24257 DPRINTK("ENTER\n");
24258 @@ -3597,7 +3760,8 @@
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 @@
24271 rc = pci_request_regions(pdev, DRV_NAME);
24274 + disable_dev_on_err = 0;
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");
24285 legacy_mode |= (1 << 0);
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");
24293 legacy_mode |= (1 << 1);
24296 @@ -3642,9 +3810,7 @@
24297 goto err_out_regions;
24300 - probe_ent = ata_pci_init_legacy_mode(pdev, port);
24302 - probe_ent2 = &probe_ent[1];
24303 + probe_ent = ata_pci_init_legacy_mode(pdev, port, &probe_ent2);
24305 probe_ent = ata_pci_init_native_mode(pdev, port);
24307 @@ -3656,17 +3822,14 @@
24309 spin_lock(&ata_module_lock);
24312 if (legacy_mode & (1 << 0))
24313 list_add_tail(&probe_ent->node, &ata_probe_list);
24316 + kfree(probe_ent);
24317 if (legacy_mode & (1 << 1))
24318 list_add_tail(&probe_ent2->node, &ata_probe_list);
24322 - kfree(probe_ent);
24323 + kfree(probe_ent2);
24325 list_add_tail(&probe_ent->node, &ata_probe_list);
24327 @@ -3681,7 +3844,8 @@
24328 release_region(0x170, 8);
24329 pci_release_regions(pdev);
24331 - pci_disable_device(pdev);
24332 + if (disable_dev_on_err)
24333 + pci_disable_device(pdev);
24337 @@ -3723,15 +3887,12 @@
24338 if (host_set->mmio_base)
24339 iounmap(host_set->mmio_base);
24341 - pci_release_regions(pdev);
24343 for (i = 0; i < host_set->n_ports; i++) {
24344 - struct ata_ioports *ioaddr;
24346 ap = host_set->ports[i];
24347 - ioaddr = &ap->ioaddr;
24349 if ((ap->flags & ATA_FLAG_NO_LEGACY) == 0) {
24350 + struct ata_ioports *ioaddr = &ap->ioaddr;
24352 if (ioaddr->cmd_addr == 0x1f0)
24353 release_region(0x1f0, 8);
24354 else if (ioaddr->cmd_addr == 0x170)
24355 @@ -3740,6 +3901,8 @@
24360 + pci_release_regions(pdev);
24361 pci_disable_device(pdev);
24362 dev_set_drvdata(dev, NULL);
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 @@
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
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
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
24430 cmd->result = SAM_STAT_CHECK_CONDITION;
24434 * Is this an error we can process/parse
24438 if(drv_stat & ATA_ERR)
24439 /* Read the err bits */
24440 err = ata_chk_err(qc->ap);
24442 /* Display the ATA level error info */
24445 printk(KERN_WARNING "ata%u: status=0x%02x { ", qc->ap->id, drv_stat);
24446 if(drv_stat & 0x80)
24448 @@ -243,7 +243,7 @@
24449 if(drv_stat & 0x01) printk("Error ");
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 ");
24463 /* Should we dump sector info here too ?? */
24470 while(sense_table[i][0] != 0xFF)
24472 @@ -283,7 +283,8 @@
24473 /* No immediate match */
24475 printk(KERN_DEBUG "ata%u: no sense translation for 0x%02x\n", qc->ap->id, err);
24479 /* Fall back to interpreting status bits */
24480 while(stat_table[i][0] != 0xFF)
24482 @@ -301,7 +302,7 @@
24484 printk(KERN_ERR "ata%u: called with no error (%02X)!\n", qc->ap->id, drv_stat);
24485 /* additional-sense-code[-qualifier] */
24489 sb[2] = MEDIUM_ERROR;
24491 @@ -449,19 +450,24 @@
24495 + tf->command = ATA_CMD_VERIFY_EXT;
24497 tf->hob_nsect = (n_sect >> 8) & 0xff;
24499 tf->hob_lbah = (sect >> 40) & 0xff;
24500 tf->hob_lbam = (sect >> 32) & 0xff;
24501 tf->hob_lbal = (sect >> 24) & 0xff;
24504 + tf->command = ATA_CMD_VERIFY;
24506 tf->device |= (sect >> 24) & 0xf;
24509 tf->nsect = n_sect & 0xff;
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;
24520 @@ -561,7 +567,7 @@
24523 /* stores LBA27:24 in lower 4 bits of device reg */
24524 - tf->device |= scsicmd[2];
24525 + tf->device |= scsicmd[6];
24527 qc->nsect = scsicmd[13];
24529 @@ -657,6 +663,7 @@
24534 ata_bad_cdb(cmd, done);
24535 DPRINTK("EXIT - badcmd\n");
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
24552 * - speed-ups (list handling fixes, issued_list, optimizations.)
24553 * - lots of cleanups.
24555 - * Version : v2.10.3 (Apr 08, 2004)
24556 + * Version : v2.10.8.2 (July 26, 2004)
24558 * Authors: Atul Mukker <Atul.Mukker@lsil.com>
24559 * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com>
24562 #include "megaraid2.h"
24564 -#ifdef LSI_CONFIG_COMPAT
24565 +#if defined(__x86_64__)
24566 #include <asm/ioctl32.h>
24569 @@ -90,10 +90,15 @@
24570 static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
24573 + * Lock to protect access to IOCTL
24575 +static struct semaphore megaraid_ioc_mtx;
24578 * The File Operations structure for the serial/ioctl interface of the driver
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];
24589 /* The current driver version */
24590 -static u32 driver_ver = 0x02100000;
24591 +static u32 driver_ver = 0x02104000;
24593 /* major number used by the device for character interface */
24595 @@ -189,6 +194,11 @@
24597 mega_reorder_hosts();
24600 + * Initialize the IOCTL lock
24602 + init_MUTEX( &megaraid_ioc_mtx );
24604 #ifdef CONFIG_PROC_FS
24605 mega_proc_dir_entry = proc_mkdir("megaraid", &proc_root);
24607 @@ -223,7 +233,7 @@
24608 "MegaRAID Shutdown routine not registered!!\n");
24611 -#ifdef LSI_CONFIG_COMPAT
24612 +#if defined(__x86_64__)
24614 * Register the 32-bit ioctl conversion
24616 @@ -273,6 +283,8 @@
24617 unsigned long tbase;
24618 unsigned long flag = 0;
24620 + u8 did_int_pthru_f = 0;
24621 + u8 did_int_data_f = 0;
24623 while((pdev = pci_find_device(pci_vendor, pci_device, pdev))) {
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;
24633 @@ -465,6 +478,33 @@
24638 + * Allocate memory for ioctls
24640 + adapter->int_pthru = pci_alloc_consistent (
24642 + sizeof(mega_passthru),
24643 + &adapter->int_pthru_dma_hndl );
24645 + if( adapter->int_pthru == NULL ) {
24646 + printk(KERN_WARNING "megaraid: out of RAM.\n");
24647 + goto fail_attach;
24650 + did_int_pthru_f = 1;
24652 + adapter->int_data = pci_alloc_consistent (
24655 + &adapter->int_data_dma_hndl );
24657 + if( adapter->int_data == NULL ) {
24658 + printk(KERN_WARNING "megaraid: out of RAM.\n");
24659 + goto fail_attach;
24662 + did_int_data_f = 1;
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 @@
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 );
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 );
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 @@
24692 + * @adapter - pointer to our soft state
24693 + * @scb - scsi control block
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
24700 +issue_scb(adapter_t *adapter, scb_t *scb)
24702 + volatile mbox64_t *mbox64 = adapter->mbox64;
24703 + volatile mbox_t *mbox = adapter->mbox;
24704 + unsigned int i = 0;
24706 + if(unlikely(mbox->busy)) {
24710 + } while( mbox->busy && (i < max_mbox_busy_wait) );
24712 + if(mbox->busy) return -1;
24715 + /* Copy mailbox data into host structure */
24716 + memcpy((char *)mbox, (char *)scb->raw_mbox, 16);
24718 + mbox->cmdid = scb->idx; /* Set cmdid */
24719 + mbox->busy = 1; /* Set busy */
24723 + * Increment the pending queue counter
24725 + atomic_inc(&adapter->pend_cmds);
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;
24739 + mbox64->xfer_segment_lo = 0;
24740 + mbox64->xfer_segment_hi = 0;
24744 + * post the command
24746 + scb->state |= SCB_ISSUED;
24748 + if( likely(adapter->flag & BOARD_MEMMAP) ) {
24751 + WRINDOOR(adapter, adapter->mbox_dma | 0x1);
24754 + irq_enable(adapter);
24755 + issue_command(adapter);
24764 * @adapter - pointer to our soft state
24766 @@ -949,52 +1074,26 @@
24767 __mega_runpendq(adapter);
24771 - * megaraid_queue()
24772 - * @scmd - Issue this scsi command
24773 - * @done - the callback hook into the scsi mid-layer
24775 - * The command queuing entry point for the mid-layer.
24778 -megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
24780 - adapter_t *adapter;
24784 - adapter = (adapter_t *)scmd->host->hostdata;
24786 - scmd->scsi_done = done;
24789 +__mega_runpendq(adapter_t *adapter)
24792 + struct list_head *pos, *next;
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.
24802 + /* Issue any pending commands to the card */
24803 + list_for_each_safe(pos, next, &adapter->pending_list) {
24805 - scb = mega_build_cmd(adapter, scmd, &busy);
24806 + scb = list_entry(pos, scb_t, list);
24809 - scb->state |= SCB_PENDQ;
24810 - list_add_tail(&scb->list, &adapter->pending_list);
24811 + if( !(scb->state & SCB_ISSUED) ) {
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.
24818 - if(atomic_read(&adapter->quiescent) == 0) {
24819 - mega_runpendq(adapter);
24820 + if( issue_scb(adapter, scb) != 0 )
24831 @@ -1068,25 +1167,136 @@
24835 - * If "delete logical drive" feature is enabled on this controller.
24836 - * Do only if at least one delete logical drive operation was done.
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.
24842 - * These is valid only for IO commands.
24844 + if (adapter->support_random_del)
24845 + ldrv_num += 0x80;
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 */
24853 - ldrv_num += 0x80;
24858 + * Wait until the controller's mailbox is available
24861 +mega_busywait_mbox (adapter_t *adapter)
24863 + if (adapter->mbox->busy)
24864 + return __mega_busywait_mbox(adapter);
24870 + * megaraid_iombox_ack_sequence - interrupt ack sequence for IO mapped HBAs
24871 + * @adapter - controller's soft state
24873 + * Interrupt ackrowledgement sequence for IO mapped HBAs
24875 +static inline void
24876 +megaraid_iombox_ack_sequence(adapter_t *adapter)
24880 + u8 completed[MAX_FIRMWARE_STATUS];
24886 + * loop till F/W has more commands for us to complete.
24889 + /* Check if a valid interrupt is pending */
24890 + byte = irq_state(adapter);
24891 + if( (byte & VALID_INTR_BYTE) == 0 ) {
24894 + set_irq_state(adapter, byte);
24897 + while ((nstatus = adapter->mbox->numstatus) == 0xFF) {
24900 + adapter->mbox->numstatus = 0xFF;
24902 + for (i = 0; i < nstatus; i++) {
24903 + while ((completed[i] = adapter->mbox->completed[i])
24908 + adapter->mbox->completed[i] = 0xFF;
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");
24916 + adapter->mbox->status = 0xFF;
24919 + * decrement the pending queue counter
24921 + atomic_sub(nstatus, &adapter->pend_cmds);
24923 + /* Acknowledge interrupt */
24924 + irq_ack(adapter);
24926 + mega_cmd_done(adapter, completed, nstatus, status);
24934 + * megaraid_queue()
24935 + * @scmd - Issue this scsi command
24936 + * @done - the callback hook into the scsi mid-layer
24938 + * The command queuing entry point for the mid-layer.
24941 +megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
24943 + adapter_t *adapter;
24947 + adapter = (adapter_t *)scmd->host->hostdata;
24949 + scmd->scsi_done = done;
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.
24961 + scb = mega_build_cmd(adapter, scmd, &busy);
24964 + scb->state |= SCB_PENDQ;
24965 + list_add_tail(&scb->list, &adapter->pending_list);
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.
24972 + if(atomic_read(&adapter->quiescent) == 0) {
24973 + mega_runpendq(adapter);
24982 @@ -1112,7 +1322,6 @@
24986 - int max_ldrv_num;
24989 int ldrv_num = 0; /* logical drive number */
24990 @@ -1184,24 +1393,6 @@
24993 ldrv_num = mega_get_ldrv_num(adapter, cmd, channel);
24996 - max_ldrv_num = (adapter->flag & BOARD_40LD) ?
24997 - MAX_LOGICAL_DRIVES_40LD : MAX_LOGICAL_DRIVES_8LD;
25000 - * max_ldrv_num increases by 0x80 if some logical drive was
25003 - if(adapter->read_ldidmap)
25004 - max_ldrv_num += 0x80;
25006 - if(ldrv_num > max_ldrv_num ) {
25007 - cmd->result = (DID_BAD_TARGET << 16);
25008 - cmd->scsi_done(cmd);
25014 if( cmd->lun > 7) {
25015 @@ -1671,111 +1862,6 @@
25020 -__mega_runpendq(adapter_t *adapter)
25023 - struct list_head *pos, *next;
25025 - /* Issue any pending commands to the card */
25026 - list_for_each_safe(pos, next, &adapter->pending_list) {
25028 - scb = list_entry(pos, scb_t, list);
25030 - if( !(scb->state & SCB_ISSUED) ) {
25032 - if( issue_scb(adapter, scb) != 0 )
25043 - * @adapter - pointer to our soft state
25044 - * @scb - scsi control block
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
25051 -issue_scb(adapter_t *adapter, scb_t *scb)
25053 - volatile mbox64_t *mbox64 = adapter->mbox64;
25054 - volatile mbox_t *mbox = adapter->mbox;
25055 - unsigned int i = 0;
25057 - if(unlikely(mbox->busy)) {
25061 - } while( mbox->busy && (i < max_mbox_busy_wait) );
25063 - if(mbox->busy) return -1;
25066 - /* Copy mailbox data into host structure */
25067 - memcpy((char *)mbox, (char *)scb->raw_mbox, 16);
25069 - mbox->cmdid = scb->idx; /* Set cmdid */
25070 - mbox->busy = 1; /* Set busy */
25074 - * Increment the pending queue counter
25076 - atomic_inc(&adapter->pend_cmds);
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;
25090 - mbox64->xfer_segment_lo = 0;
25091 - mbox64->xfer_segment_hi = 0;
25095 - * post the command
25097 - scb->state |= SCB_ISSUED;
25099 - if( likely(adapter->flag & BOARD_MEMMAP) ) {
25102 - WRINDOOR(adapter, adapter->mbox_dma | 0x1);
25105 - irq_enable(adapter);
25106 - issue_command(adapter);
25114 - * Wait until the controller's mailbox is available
25117 -mega_busywait_mbox (adapter_t *adapter)
25119 - if (adapter->mbox->busy)
25120 - return __mega_busywait_mbox(adapter);
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;
25136 -bug_blocked_mailbox:
25137 - printk(KERN_WARNING "megaraid: Blocked mailbox......!!\n");
25144 - * megaraid_iombox_ack_sequence - interrupt ack sequence for IO mapped HBAs
25145 - * @adapter - controller's soft state
25147 - * Interrupt ackrowledgement sequence for IO mapped HBAs
25149 -static inline void
25150 -megaraid_iombox_ack_sequence(adapter_t *adapter)
25154 - u8 completed[MAX_FIRMWARE_STATUS];
25160 - * loop till F/W has more commands for us to complete.
25163 - /* Check if a valid interrupt is pending */
25164 - byte = irq_state(adapter);
25165 - if( (byte & VALID_INTR_BYTE) == 0 ) {
25168 - set_irq_state(adapter, byte);
25169 + mbox->completed[i] = 0xFF;
25172 - while ((nstatus = adapter->mbox->numstatus) == 0xFF) {
25175 - adapter->mbox->numstatus = 0xFF;
25178 - for (i = 0; i < nstatus; i++) {
25179 - while ((completed[i] = adapter->mbox->completed[i])
25183 +bug_blocked_mailbox:
25184 + printk(KERN_WARNING "megaraid: Blocked mailbox......!!\n");
25189 - adapter->mbox->completed[i] = 0xFF;
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");
25197 - adapter->mbox->status = 0xFF;
25199 + * megaraid_isr_iomapped()
25201 + * @devp - pointer to our soft state
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.
25209 +megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
25211 + adapter_t *adapter = devp;
25212 + unsigned long flags;
25215 - * decrement the pending queue counter
25217 - atomic_sub(nstatus, &adapter->pend_cmds);
25219 - /* Acknowledge interrupt */
25220 - irq_ack(adapter);
25221 + spin_lock_irqsave(adapter->host_lock, flags);
25223 - mega_cmd_done(adapter, completed, nstatus, status);
25224 + megaraid_iombox_ack_sequence(adapter);
25227 + /* Loop through any pending requests */
25228 + if( atomic_read(&adapter->quiescent ) == 0) {
25229 + mega_runpendq(adapter);
25232 + spin_unlock_irqrestore(adapter->host_lock, flags);
25238 @@ -2007,38 +2063,6 @@
25242 - * megaraid_isr_iomapped()
25244 - * @devp - pointer to our soft state
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.
25252 -megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
25254 - adapter_t *adapter = devp;
25255 - unsigned long flags;
25258 - spin_lock_irqsave(adapter->host_lock, flags);
25260 - megaraid_iombox_ack_sequence(adapter);
25262 - /* Loop through any pending requests */
25263 - if( atomic_read(&adapter->quiescent ) == 0) {
25264 - mega_runpendq(adapter);
25267 - spin_unlock_irqrestore(adapter->host_lock, flags);
25274 * megaraid_isr_memmapped()
25276 * @devp - pointer to our soft state
25277 @@ -2069,7 +2093,6 @@
25284 * @adapter - pointer to our soft state
25285 @@ -2381,7 +2404,6 @@
25286 list_add(&scb->list, &adapter->free_list);
25291 __mega_busywait_mbox (adapter_t *adapter)
25293 @@ -2412,6 +2434,10 @@
25297 + /* return 0 elements if no data transfer */
25298 + if (!cmd->request_buffer || !cmd->request_bufflen)
25301 /* Scatter-gather not used */
25302 if( !cmd->use_sg ) {
25304 @@ -2535,7 +2561,6 @@
25305 enquiry3->pdrv_state[i] = inquiry->pdrv_info.pdrv_state[i];
25310 mega_free_sgl(adapter_t *adapter)
25312 @@ -2666,6 +2691,13 @@
25313 pci_free_consistent(adapter->dev, sizeof(mbox64_t),
25314 (void *)adapter->una_mbox64, adapter->una_mbox64_dma);
25316 + pci_free_consistent( adapter->dev, sizeof(mega_passthru),
25317 + (void*) adapter->int_pthru,
25318 + adapter->int_pthru_dma_hndl );
25320 + pci_free_consistent( adapter->dev, INT_MEMBLK_SZ, adapter->int_data,
25321 + adapter->int_data_dma_hndl );
25325 if( hba_count == 0 ) {
25326 @@ -2694,7 +2726,7 @@
25328 scsi_unregister(host);
25330 -#ifdef LSI_CONFIG_COMPAT
25331 +#if defined(__x86_64__)
25332 unregister_ioctl32_conversion(MEGAIOCCMD);
25335 @@ -2736,30 +2768,36 @@
25340 - * megaraid_abort - abort the scsi command
25341 - * @scp - command to be aborted
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.
25347 megaraid_abort(Scsi_Cmnd *scp)
25349 adapter_t *adapter;
25350 struct list_head *pos, *next;
25353 - int rval = SUCCESS;
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);
25359 adapter = (adapter_t *)scp->host->hostdata;
25361 - ASSERT( spin_is_locked(adapter->host_lock) );
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.
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,
25371 + if (adapter->hw_error) {
25372 + printk("megaraid: hw error, cannot abort\n");
25376 + ASSERT( spin_is_locked(adapter->host_lock) );
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.
25383 list_for_each_safe( pos, next, &adapter->pending_list ) {
25385 @@ -2769,15 +2807,11 @@
25387 scb->state |= SCB_ABORT;
25390 - * Check if this command was never issued. If this is
25391 - * the case, take it off from the pending list and
25394 if( !(scb->state & SCB_ISSUED) ) {
25396 - printk(KERN_WARNING
25397 - "megaraid: %ld:%d, driver owner.\n",
25398 + /* Not issued to the FW yet; ABORT it */
25400 + printk( "megaraid: %ld:%d, driver owner.\n",
25401 scp->serial_number, scb->idx);
25403 scp->result = (DID_ABORT << 16);
25404 @@ -2786,67 +2820,31 @@
25406 scp->scsi_done(scp);
25412 + /* Issued to the FW; can do nothing */
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
25425 - while( atomic_read(&adapter->pend_cmds) > 0 ) {
25427 - * Perform the ack sequence, since interrupts are not
25428 - * available right now!
25430 - if( adapter->flag & BOARD_MEMMAP ) {
25431 - megaraid_memmbox_ack_sequence(adapter);
25434 - megaraid_iombox_ack_sequence(adapter);
25438 - * print a message once every second only
25440 - if( !(iter % 1000) ) {
25442 - "megaraid: Waiting for %d commands to flush: iter:%ld\n",
25443 - atomic_read(&adapter->pend_cmds), iter);
25446 - if( iter++ < MBOX_ABORT_SLEEP*1000 ) {
25450 - printk(KERN_WARNING
25451 - "megaraid: critical hardware error!\n");
25459 - if( rval == SUCCESS ) {
25461 - "megaraid: abort sequence successfully completed.\n");
25470 megaraid_reset(Scsi_Cmnd *cmd)
25472 - adapter_t *adapter;
25475 - int rval = SUCCESS;
25476 + DECLARE_WAIT_QUEUE_HEAD(wq);
25479 + adapter_t *adapter;
25480 + struct list_head *pos, *next;
25483 adapter = (adapter_t *)cmd->host->hostdata;
25485 @@ -2856,31 +2854,54 @@
25486 cmd->serial_number, cmd->cmnd[0], cmd->channel, cmd->target,
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
25495 -#if MEGA_HAVE_CLUSTERING
25496 - mc.cmd = MEGA_CLUSTER_CMD;
25497 - mc.opcode = MEGA_RESET_RESERVATIONS;
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");
25508 - printk(KERN_INFO "megaraid: reservation reset.\n");
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.
25514 + list_for_each_safe( pos, next, &adapter->pending_list ) {
25516 + scb = list_entry(pos, scb_t, list);
25517 + scb->state |= SCB_RESET;
25519 + if( !(scb->state & SCB_ISSUED) ) {
25521 + /* Not issued to the FW; return with RESET */
25522 + cmd->result = (DID_RESET << 16);
25524 + mega_free_scb(adapter, scb);
25525 + cmd->scsi_done(cmd);
25528 - spin_lock_irq(adapter->host_lock);
25532 - * Do not return until all the commands are actually completed by the
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.
25539 - while( atomic_read(&adapter->pend_cmds) > 0 ) {
25541 + if (atomic_read(&adapter->pend_cmds) == 0)
25544 + printk("megaraid: %d pending cmds; max wait %d seconds\n",
25545 + atomic_read(&adapter->pend_cmds), MBOX_RESET_WAIT );
25547 + for(i=0; (i<MBOX_RESET_WAIT)&&(atomic_read(&adapter->pend_cmds)); i++){
25549 + ASSERT( spin_is_locked(adapter->host_lock) );
25552 - * Perform the ack sequence, since interrupts are not
25553 - * available right now!
25554 + * Perform the ack sequence, since interrupts are unavailable
25556 if( adapter->flag & BOARD_MEMMAP ) {
25557 megaraid_memmbox_ack_sequence(adapter);
25558 @@ -2889,55 +2910,35 @@
25559 megaraid_iombox_ack_sequence(adapter);
25563 - * print a message once every second only
25565 - if( !(iter % 1000) ) {
25567 - "megaraid: Waiting for %d commands to flush: iter:%ld\n",
25568 - atomic_read(&adapter->pend_cmds), iter);
25570 + spin_unlock(adapter->host_lock);
25572 - if( iter++ < MBOX_RESET_SLEEP*1000 ) {
25574 + /* Print a message once every 5 seconds */
25576 + printk("megaraid: pending %d; remaining %d seconds\n",
25577 + atomic_read(&adapter->pend_cmds),
25578 + MBOX_RESET_WAIT - i);
25581 - printk(KERN_WARNING
25582 - "megaraid: critical hardware error!\n");
25589 + sleep_on_timeout(&wq, HZ);
25591 - if( rval == SUCCESS ) {
25593 - "megaraid: reset sequence successfully completed.\n");
25594 + spin_lock(adapter->host_lock);
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
25607 - * mega_allocate_inquiry()
25608 - * @dma_handle - handle returned for dma address
25609 - * @pdev - handle to pci device
25611 - * allocates memory for inquiry structure
25613 -static inline caddr_t
25614 -mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
25616 - return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
25619 + if (atomic_read(&adapter->pend_cmds)) {
25621 + adapter->hw_error = 1;
25622 + printk("megaraid: critical hardware error!\n" );
25626 -static inline void
25627 -mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
25629 - pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
25634 @@ -3199,6 +3200,26 @@
25639 + * mega_allocate_inquiry()
25640 + * @dma_handle - handle returned for dma address
25641 + * @pdev - handle to pci device
25643 + * allocates memory for inquiry structure
25645 +static inline caddr_t
25646 +mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
25648 + return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
25652 +static inline void
25653 +mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
25655 + pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
25660 * proc_rebuild_rate()
25661 @@ -3988,6 +4009,7 @@
25662 megaraid_reboot_notify (struct notifier_block *this, unsigned long code,
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);
25674 + sleep_on_timeout(&wq, HZ);
25676 printk("\b\b\b[done]\n");
25678 + sleep_on_timeout(&wq, HZ);
25680 return NOTIFY_DONE;
25682 @@ -4150,17 +4172,27 @@
25686 -#ifdef LSI_CONFIG_COMPAT
25687 +#if defined(__x86_64__)
25689 megadev_compat_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
25690 struct file *filep)
25692 struct inode *inode = filep->f_dentry->d_inode;
25694 - return megadev_ioctl(inode, filep, cmd, arg);
25695 + return megadev_ioctl_entry(inode, filep, cmd, arg);
25700 +megadev_ioctl_entry(struct inode *inode, struct file *filep, unsigned int cmd,
25701 + unsigned long arg)
25704 + down( &megaraid_ioc_mtx );
25705 + rval = megadev_ioctl( inode, filep, cmd, arg );
25706 + up( &megaraid_ioc_mtx );
25712 @@ -4184,9 +4216,8 @@
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;
25721 megastat_t *ustats;
25723 @@ -4302,7 +4333,7 @@
25727 - if( (adapno = GETADAP(uioc.adapno)) >= hba_count )
25728 + if( (adapno = GETADAP(uioc.adapno)) >= hba_count )
25731 adapter = hba_soft_state[adapno];
25732 @@ -4358,13 +4389,7 @@
25733 if( uioc.uioc_rmbox[0] == MEGA_MBOXCMD_PASSTHRU ) {
25734 /* Passthru commands */
25736 - pthru = pci_alloc_consistent(pdev,
25737 - sizeof(mega_passthru),
25738 - &pthru_dma_hndl);
25740 - if( pthru == NULL ) {
25741 - return (-ENOMEM);
25743 + pthru = adapter->int_pthru;
25746 * The user passthru structure
25747 @@ -4376,29 +4401,27 @@
25749 if( copy_from_user(pthru, (char *)upthru,
25750 sizeof(mega_passthru)) ) {
25752 - pci_free_consistent(pdev,
25753 - sizeof(mega_passthru), pthru,
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
25766 - if( pthru->dataxferlen ) {
25767 - data = pci_alloc_consistent(pdev,
25768 - pthru->dataxferlen,
25771 - if( data == NULL ) {
25772 - pci_free_consistent(pdev,
25773 - sizeof(mega_passthru),
25776 + if (pthru->dataxferlen) {
25777 + if (pthru->dataxferlen > INT_MEMBLK_SZ) {
25778 + data = pci_alloc_consistent (
25780 + pthru->dataxferlen,
25781 + &data_dma_hndl );
25783 - return (-ENOMEM);
25784 + if (data == NULL)
25785 + return (-ENOMEM);
25788 + data = adapter->int_data;
25792 @@ -4406,7 +4429,11 @@
25793 * address at just allocated memory
25795 uxferaddr = pthru->dataxferaddr;
25796 - pthru->dataxferaddr = data_dma_hndl;
25797 + if (data_dma_hndl)
25798 + pthru->dataxferaddr = data_dma_hndl;
25800 + pthru->dataxferaddr =
25801 + adapter->int_data_dma_hndl;
25805 @@ -4421,14 +4448,14 @@
25806 (char *)((ulong)uxferaddr),
25807 pthru->dataxferlen) ) {
25809 - goto freemem_and_return;
25810 + goto freedata_and_return;
25814 memset(&mc, 0, sizeof(megacmd_t));
25816 mc.cmd = MEGA_MBOXCMD_PASSTHRU;
25817 - mc.xferaddr = (u32)pthru_dma_hndl;
25818 + mc.xferaddr = (u32)adapter->int_pthru_dma_hndl;
25821 * Issue the command
25822 @@ -4437,7 +4464,7 @@
25824 rval = mega_n_to_m((void *)arg, &mc);
25826 - if( rval ) goto freemem_and_return;
25827 + if( rval ) goto freedata_and_return;
25831 @@ -4456,18 +4483,14 @@
25833 copy_to_user(upthru->reqsensearea,
25834 pthru->reqsensearea, 14);
25836 -freemem_and_return:
25837 - if( pthru->dataxferlen ) {
25838 - pci_free_consistent(pdev,
25839 - pthru->dataxferlen, data,
25841 +freedata_and_return:
25842 + if (data_dma_hndl) {
25843 + pci_free_consistent( pdev, pthru->dataxferlen,
25844 + data, data_dma_hndl );
25847 - pci_free_consistent(pdev, sizeof(mega_passthru),
25848 - pthru, pthru_dma_hndl);
25854 /* DCMD commands */
25855 @@ -4476,13 +4499,18 @@
25856 * Is there a data transfer
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(
25865 + &data_dma_hndl );
25867 - if( data == NULL ) {
25868 - return (-ENOMEM);
25869 + if (data == NULL)
25870 + return (-ENOMEM);
25873 + data = adapter->int_data;
25876 uxferaddr = MBOX(uioc)->xferaddr;
25879 @@ -4497,9 +4525,9 @@
25880 (char *)((ulong)uxferaddr),
25883 - pci_free_consistent(pdev,
25884 - uioc.xferlen, data,
25886 + pci_free_consistent(
25887 + pdev, uioc.xferlen,
25888 + data, data_dma_hndl );
25892 @@ -4507,7 +4535,10 @@
25894 memcpy(&mc, MBOX(uioc), sizeof(megacmd_t));
25896 - mc.xferaddr = (u32)data_dma_hndl;
25897 + if (data_dma_hndl )
25898 + mc.xferaddr = (u32)data_dma_hndl;
25900 + mc.xferaddr = (u32)(adapter->int_data_dma_hndl);
25903 * Issue the command
25904 @@ -4517,12 +4548,10 @@
25905 rval = mega_n_to_m((void *)arg, &mc);
25908 - if( uioc.xferlen ) {
25909 - pci_free_consistent(pdev,
25910 - uioc.xferlen, data,
25912 + if (data_dma_hndl) {
25913 + pci_free_consistent( pdev, uioc.xferlen,
25914 + data, data_dma_hndl );
25920 @@ -4537,10 +4566,9 @@
25924 - if( uioc.xferlen ) {
25925 - pci_free_consistent(pdev,
25926 - uioc.xferlen, data,
25928 + if (data_dma_hndl) {
25929 + pci_free_consistent( pdev, uioc.xferlen,
25930 + data, data_dma_hndl );
25934 @@ -4725,19 +4753,22 @@
25936 uioc_mimd = (struct uioctl_t *)arg;
25938 - if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) )
25939 + if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) ) {
25943 if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) {
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))) {
25951 upthru = (mega_passthru *)((ulong)kmc.xferaddr);
25953 - if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
25954 + if( put_user(mc->status, (u8 *)&upthru->scsistatus) ){
25960 @@ -5148,7 +5179,6 @@
25966 * mega_reorder_hosts()
25968 @@ -5363,6 +5393,7 @@
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
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"
25987 * Driver features - change the values to enable or disable features in the
25989 #define LSI_SUBSYS_VID 0x1000
25990 #define INTEL_SUBSYS_VID 0x8086
25991 #define FSC_SUBSYS_VID 0x1734
25992 +#define ACER_SUBSYS_VID 0x1025
25994 #define HBA_SIGNATURE 0x3344
25995 #define HBA_SIGNATURE_471 0xCCCC
25996 @@ -978,6 +979,15 @@
25999 int has_cluster; /* cluster support on this HBA */
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;
26012 @@ -1085,18 +1095,21 @@
26014 #define MBOX_ABORT_SLEEP 60
26015 #define MBOX_RESET_SLEEP 30
26016 +#define MBOX_RESET_WAIT 180
26018 const char *megaraid_info (struct Scsi_Host *);
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 *);
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 *);
26034 static void megaraid_isr_memmapped(int, void *, struct pt_regs *);
26035 @@ -1113,6 +1126,7 @@
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 *);
26047 -#if defined(CONFIG_COMPAT) || defined( __x86_64__) || defined(IA32_EMULATION)
26048 -#define LSI_CONFIG_COMPAT
26051 -#ifdef LSI_CONFIG_COMPAT
26052 +#if defined(__x86_64__)
26053 static int megadev_compat_ioctl(unsigned int, unsigned int, unsigned long,
26057 +static int megadev_ioctl_entry (struct inode *, struct file *, unsigned int,
26059 static int megadev_ioctl (struct inode *, struct file *, unsigned int,
26061 static int mega_m_to_n(void *, nitioctl_t *);
26062 @@ -1164,6 +1176,8 @@
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 *);
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 @@
26084 #ifndef MULTIPLE_PAD_SIZES
26086 -#ifdef CONFIG_CPU_HAS_WB
26087 -#include <asm/wbflush.h>
26088 -#define esp_write(__reg, __val) do{(__reg) = (__val); wbflush();} while(0)
26090 -#define esp_write(__reg, __val) ((__reg) = (__val))
26092 +#define esp_write(__reg, __val) do{(__reg) = (__val); iob();} while(0)
26093 #define esp_read(__reg) (__reg)
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 @@
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
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.
26115 + * - Added generic SATA support by using a pci_device_id that filters on
26116 + * the IDE storage class code.
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.
26122 #include <linux/libata.h>
26124 #define DRV_NAME "sata_nv"
26125 -#define DRV_VERSION "0.5"
26126 +#define DRV_VERSION "0.6"
26129 #define NV_PIO_MASK 0x1f
26131 #define NV_MCP_SATA_CFG_20_SATA_SPACE_EN 0x04
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 @@
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 */
26158 @@ -136,7 +145,6 @@
26159 struct nv_host_desc
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 @@
26168 static struct nv_host_desc nv_device_tbl[] = {
26170 + .host_type = GENERIC,
26171 + .enable_hotplug = NULL,
26172 + .disable_hotplug= NULL,
26173 + .check_hotplug = NULL,
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,
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,
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 @@
26197 struct nv_host_desc *host_desc;
26198 + unsigned long host_flags;
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);
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)
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;
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));
26230 return inl(ap->ioaddr.scr_addr + (sc_reg * 4));
26232 @@ -299,8 +314,8 @@
26233 if (sc_reg > SCR_CONTROL)
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));
26241 outl(val, ap->ioaddr.scr_addr + (sc_reg * 4));
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;
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)
26258 if (!printed_version++)
26259 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
26260 @@ -332,8 +356,10 @@
26263 rc = pci_request_regions(pdev, DRV_NAME);
26266 + pci_dev_busy = 1;
26267 goto err_out_disable;
26270 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
26272 @@ -350,11 +376,15 @@
26274 goto err_out_free_ent;
26276 + memset(host, 0, sizeof(struct nv_host));
26277 host->host_desc = &nv_device_tbl[ent->driver_data];
26279 probe_ent->private_data = host;
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;
26285 + if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
26286 unsigned long base;
26288 probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
26289 @@ -395,7 +425,8 @@
26291 pci_release_regions(pdev);
26293 - pci_disable_device(pdev);
26294 + if (!pci_dev_busy)
26295 + pci_disable_device(pdev);
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
26303 #define DRV_NAME "sata_promise"
26304 #define DRV_VERSION "1.01"
26306 -#define msleep libata_msleep /* 2.4-specific */
26309 PDC_PKT_SUBMIT = 0x40, /* Command packet pointer addr */
26310 PDC_INT_SEQMASK = 0x40, /* Mask of asserted SEQ INTs */
26311 @@ -158,10 +156,18 @@
26313 { PCI_VENDOR_ID_PROMISE, 0x3376, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26315 + { PCI_VENDOR_ID_PROMISE, 0x3574, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26317 + { PCI_VENDOR_ID_PROMISE, 0x3d75, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26320 { PCI_VENDOR_ID_PROMISE, 0x3318, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26322 { PCI_VENDOR_ID_PROMISE, 0x3319, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26324 + { PCI_VENDOR_ID_PROMISE, 0x3d18, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
26327 { } /* terminate list */
26330 @@ -408,9 +414,11 @@
26334 - spin_lock(&host_set->lock);
26335 + spin_lock(&host_set->lock);
26337 + writel(mask, mmio_base + PDC_INT_SEQMASK);
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;
26347 unsigned int board_idx = (unsigned int) ent->driver_data;
26348 + int pci_dev_busy = 0;
26351 if (!printed_version++)
26352 @@ -562,8 +571,10 @@
26355 rc = pci_request_regions(pdev, DRV_NAME);
26358 + pci_dev_busy = 1;
26362 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
26364 @@ -637,7 +648,8 @@
26366 pci_release_regions(pdev);
26368 - pci_disable_device(pdev);
26369 + if (!pci_dev_busy)
26370 + pci_disable_device(pdev);
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
26379 + * sata_qstor.c - Pacific Digital Corporation QStor SATA
26381 + * Maintained by: Mark Lord <mlord@pobox.com>
26383 + * Copyright 2005 Pacific Digital Corporation.
26384 + * (OSL/GPL code release authorized by Jalil Fadavi).
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
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.
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>
26413 +#include <scsi/scsi_host.h>
26414 +#include <asm/io.h>
26415 +#include <linux/libata.h>
26417 +#define DRV_NAME "sata_qstor"
26418 +#define DRV_VERSION "0.04"
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,
26428 + QS_DMA_BOUNDARY = ~0UL,
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 */
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*/
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 */
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 */
26460 + /* pkt sub-field headers */
26461 + QS_HCB_HDR = 0x01, /* Host Control Block header */
26462 + QS_DCB_HDR = 0x02, /* Device Control Block header */
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 */
26470 + /* pkt DCB flag bits */
26471 + QS_DF_PORD = (1 << 2), /* Pio OR Dma */
26472 + QS_DF_ELBA = (1 << 3), /* Extended LBA (lba48) */
26474 + /* PCI device IDs */
26475 + board_2068_idx = 0, /* QStor 4-port SATA/RAID */
26478 +typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
26480 +struct qs_port_priv {
26482 + dma_addr_t pkt_dma;
26483 + qs_state_t state;
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);
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,
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,
26546 +static struct ata_port_info qs_port_info[] = {
26547 + /* board_2068_idx */
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 |
26554 + .pio_mask = 0x10, /* pio4 */
26555 + .udma_mask = 0x7f, /* udma0-6 */
26556 + .port_ops = &qs_ata_ops,
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 },
26564 + { } /* terminate list */
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,
26574 +static int qs_check_atapi_dma(struct ata_queued_cmd *qc)
26576 + return 1; /* ATAPI DMA not supported */
26579 +static void qs_bmdma_stop(struct ata_port *ap)
26584 +static u8 qs_bmdma_status(struct ata_port *ap)
26589 +static void qs_irq_clear(struct ata_port *ap)
26594 +static inline void qs_enter_reg_mode(struct ata_port *ap)
26596 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26598 + writeb(QS_CTR0_REG, chan + QS_CCT_CTR0);
26599 + readb(chan + QS_CCT_CTR0); /* flush */
26602 +static inline void qs_reset_channel_logic(struct ata_port *ap)
26604 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26606 + writeb(QS_CTR1_RCHN, chan + QS_CCT_CTR1);
26607 + readb(chan + QS_CCT_CTR0); /* flush */
26608 + qs_enter_reg_mode(ap);
26611 +static void qs_phy_reset(struct ata_port *ap)
26613 + struct qs_port_priv *pp = ap->private_data;
26615 + pp->state = qs_state_idle;
26616 + qs_reset_channel_logic(ap);
26617 + sata_phy_reset(ap);
26620 +static void qs_eng_timeout(struct ata_port *ap)
26622 + struct qs_port_priv *pp = ap->private_data;
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);
26630 +static u32 qs_scr_read (struct ata_port *ap, unsigned int sc_reg)
26632 + if (sc_reg > SCR_CONTROL)
26634 + return readl((void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
26637 +static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
26639 + if (sc_reg > SCR_CONTROL)
26641 + writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
26644 +static void qs_fill_sg(struct ata_queued_cmd *qc)
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;
26652 + assert(sg != NULL);
26653 + assert(qc->n_elem > 0);
26655 + for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) {
26659 + addr = sg_dma_address(sg);
26660 + *(__le64 *)prd = cpu_to_le64(addr);
26661 + prd += sizeof(u64);
26663 + len = sg_dma_len(sg);
26664 + *(__le32 *)prd = cpu_to_le32(len);
26665 + prd += sizeof(u64);
26667 + VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem,
26668 + (unsigned long long)addr, len);
26672 +static void qs_qc_prep(struct ata_queued_cmd *qc)
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;
26679 + VPRINTK("ENTER\n");
26681 + qs_enter_reg_mode(qc->ap);
26682 + if (qc->tf.protocol != ATA_PROT_DMA) {
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;
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);
26702 + /* device control block (DCB) */
26703 + buf[24] = QS_DCB_HDR;
26704 + buf[28] = dflags;
26706 + /* frame information structure (FIS) */
26707 + ata_tf_to_fis(&qc->tf, &buf[32], 0);
26710 +static inline void qs_packet_start(struct ata_queued_cmd *qc)
26712 + struct ata_port *ap = qc->ap;
26713 + u8 __iomem *chan = ap->host_set->mmio_base + (ap->port_no * 0x4000);
26715 + VPRINTK("ENTER, ap %p\n", ap);
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 */
26723 +static int qs_qc_issue(struct ata_queued_cmd *qc)
26725 + struct qs_port_priv *pp = qc->ap->private_data;
26727 + switch (qc->tf.protocol) {
26728 + case ATA_PROT_DMA:
26730 + pp->state = qs_state_pkt;
26731 + qs_packet_start(qc);
26734 + case ATA_PROT_ATAPI_DMA:
26742 + pp->state = qs_state_mmio;
26743 + return ata_qc_issue_prot(qc);
26746 +static inline unsigned int qs_intr_pkt(struct ata_host_set *host_set)
26748 + unsigned int handled = 0;
26750 + u8 __iomem *mmio_base = host_set->mmio_base;
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 */
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];
26764 + DPRINTK("SFF=%08x%08x: sCHAN=%u sHST=%d sDST=%02x\n",
26765 + sff1, sff0, port_no, sHST, sDST);
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)
26772 + qc = ata_qc_from_tag(ap, ap->active_tag);
26773 + if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
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);
26791 +static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
26793 + unsigned int handled = 0, port_no;
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)
26803 + qc = ata_qc_from_tag(ap, ap->active_tag);
26804 + if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
26806 + /* check main status, clearing INTRQ */
26807 + u8 status = ata_chk_status(ap);
26808 + if ((status & ATA_BUSY))
26810 + DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n",
26811 + ap->id, qc->tf.protocol, status);
26813 + /* complete taskfile transaction */
26814 + pp->state = qs_state_idle;
26815 + ata_qc_complete(qc, status);
26823 +static irqreturn_t qs_intr(int irq, void *dev_instance, struct pt_regs *regs)
26825 + struct ata_host_set *host_set = dev_instance;
26826 + unsigned int handled = 0;
26828 + VPRINTK("ENTER\n");
26830 + spin_lock(&host_set->lock);
26831 + handled = qs_intr_pkt(host_set) | qs_intr_mmio(host_set);
26832 + spin_unlock(&host_set->lock);
26834 + VPRINTK("EXIT\n");
26836 + return IRQ_RETVAL(handled);
26839 +static void qs_ata_setup_port(struct ata_ioports *port, unsigned long base)
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;
26857 +static int qs_port_start(struct ata_port *ap)
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);
26866 + rc = ata_port_start(ap);
26869 + qs_enter_reg_mode(ap);
26870 + pp = kcalloc(1, sizeof(*pp), GFP_KERNEL);
26875 + pp->pkt = dma_alloc_coherent(dev, QS_PKT_BYTES, &pp->pkt_dma,
26879 + goto err_out_kfree;
26881 + memset(pp->pkt, 0, QS_PKT_BYTES);
26882 + ap->private_data = pp;
26884 + addr = (u64)pp->pkt_dma;
26885 + writel((u32) addr, chan + QS_CCF_CPBA);
26886 + writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4);
26892 + ata_port_stop(ap);
26896 +static void qs_port_stop(struct ata_port *ap)
26898 + struct device *dev = ap->host_set->dev;
26899 + struct qs_port_priv *pp = ap->private_data;
26901 + if (pp != NULL) {
26902 + ap->private_data = NULL;
26903 + if (pp->pkt != NULL)
26904 + dma_free_coherent(dev, QS_PKT_BYTES, pp->pkt,
26908 + ata_port_stop(ap);
26911 +static void qs_host_stop(struct ata_host_set *host_set)
26913 + void __iomem *mmio_base = host_set->mmio_base;
26915 + writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
26916 + writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
26919 +static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
26921 + void __iomem *mmio_base = pe->mmio_base;
26922 + unsigned int port_no;
26924 + writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
26925 + writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
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 */
26934 + writeb(QS_SERD3_PHY_ENA, mmio_base + QS_HVS_SERD3); /* enable phy */
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);
26946 + writeb(1, mmio_base + QS_HCT_CTRL); /* enable host interrupts */
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).
26959 +static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
26961 + u32 bus_info = readl(mmio_base + QS_HID_HPHY);
26962 + int rc, have_64bit_bus = (bus_info & QS_HPHY_64BIT);
26964 + if (have_64bit_bus &&
26965 + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
26968 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
26970 + printk(KERN_ERR DRV_NAME
26971 + "(%s): 32-bit DMA enable failed\n",
26979 +static int qs_ata_init_one(struct pci_dev *pdev,
26980 + const struct pci_device_id *ent)
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;
26988 + if (!printed_version++)
26989 + printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
26991 + rc = pci_enable_device(pdev);
26995 + rc = pci_request_regions(pdev, DRV_NAME);
26999 + if ((pci_resource_flags(pdev, 4) & IORESOURCE_MEM) == 0) {
27001 + goto err_out_regions;
27004 + mmio_base = ioremap(pci_resource_start(pdev, 4),
27005 + pci_resource_len(pdev, 4));
27006 + if (mmio_base == NULL) {
27008 + goto err_out_regions;
27011 + rc = qs_set_dma_masks(pdev, mmio_base);
27013 + goto err_out_iounmap;
27015 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
27016 + if (probe_ent == NULL) {
27018 + goto err_out_iounmap;
27021 + memset(probe_ent, 0, sizeof(*probe_ent));
27022 + probe_ent->dev = pci_dev_to_dev(pdev);
27023 + INIT_LIST_HEAD(&probe_ent->node);
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;
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;
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);
27043 + pci_set_master(pdev);
27045 + /* initialize adapter */
27046 + qs_host_init(board_idx, probe_ent);
27048 + ata_add_to_probe_list(probe_ent);
27052 + iounmap(mmio_base);
27054 + pci_release_regions(pdev);
27056 + pci_disable_device(pdev);
27060 +static int __init qs_ata_init(void)
27064 + rc = pci_module_init(&qs_ata_pci_driver);
27068 + rc = scsi_register_module(MODULE_SCSI_HA, &qs_ata_sht);
27077 + pci_unregister_driver(&qs_ata_pci_driver);
27081 +static void __exit qs_ata_exit(void)
27083 + scsi_unregister_module(MODULE_SCSI_HA, &qs_ata_sht);
27084 + pci_unregister_driver(&qs_ata_pci_driver);
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);
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 */
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 @@
27140 + int pci_dev_busy = 0;
27143 if (!printed_version++)
27144 @@ -347,8 +354,10 @@
27147 rc = pci_request_regions(pdev, DRV_NAME);
27150 + pci_dev_busy = 1;
27154 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27156 @@ -430,7 +439,8 @@
27158 pci_release_regions(pdev);
27160 - pci_disable_device(pdev);
27161 + if (!pci_dev_busy)
27162 + pci_disable_device(pdev);
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 @@
27181 struct ata_port_info *ppi;
27182 + int pci_dev_busy = 0;
27184 rc = pci_enable_device(pdev);
27188 rc = pci_request_regions(pdev, DRV_NAME);
27191 + pci_dev_busy = 1;
27195 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27197 @@ -255,7 +260,8 @@
27198 pci_release_regions(pdev);
27201 - pci_disable_device(pdev);
27202 + if (!pci_dev_busy)
27203 + pci_disable_device(pdev);
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)
27214 -void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
27215 +static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
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)
27223 -void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
27224 +static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
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;
27241 + int pci_dev_busy = 0;
27244 if (!printed_version++)
27245 @@ -360,8 +363,10 @@
27247 /* Request PCI regions */
27248 rc = pci_request_regions(pdev, DRV_NAME);
27251 + pci_dev_busy = 1;
27255 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27257 @@ -429,7 +434,8 @@
27259 pci_release_regions(pdev);
27261 - pci_disable_device(pdev);
27262 + if (!pci_dev_busy)
27263 + pci_disable_device(pdev);
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 @@
27274 - set_current_state(TASK_UNINTERRUPTIBLE);
27275 - schedule_timeout((i * 100) * HZ / 1000 + 1);
27280 @@ -1225,8 +1224,7 @@
27281 readl(mmio + PDC_TIME_CONTROL);
27283 /* Wait 3 seconds */
27284 - set_current_state(TASK_UNINTERRUPTIBLE);
27285 - schedule_timeout(3 * HZ);
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;
27297 if (!printed_version++)
27298 @@ -1383,8 +1382,10 @@
27301 rc = pci_request_regions(pdev, DRV_NAME);
27304 + pci_dev_busy = 1;
27308 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27310 @@ -1469,7 +1470,8 @@
27312 pci_release_regions(pdev);
27314 - pci_disable_device(pdev);
27315 + if (!pci_dev_busy)
27316 + pci_disable_device(pdev);
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
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,
27332 @@ -186,14 +188,17 @@
27333 struct ata_port_info *ppi;
27335 unsigned int board_idx = (unsigned int) ent->driver_data;
27336 + int pci_dev_busy = 0;
27338 rc = pci_enable_device(pdev);
27342 rc = pci_request_regions(pdev, DRV_NAME);
27345 + pci_dev_busy = 1;
27349 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
27351 @@ -256,7 +261,8 @@
27352 pci_release_regions(pdev);
27355 - pci_disable_device(pdev);
27356 + if (!pci_dev_busy)
27357 + pci_disable_device(pdev);
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
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.
27368 + ----------------------------------------------------------------------
27371 + * VT6421 PATA support
27375 #include <linux/kernel.h>
27376 @@ -38,11 +43,14 @@
27377 #include <asm/io.h>
27379 #define DRV_NAME "sata_via"
27380 -#define DRV_VERSION "1.0"
27381 +#define DRV_VERSION "1.1"
27385 +enum board_ids_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 */
27399 - ENAB_ALL = PORT0 | PORT1,
27401 - INT_GATE_ALL = PORT0 | PORT1,
27402 + ALL_PORTS = PORT0 | PORT1,
27405 NATIVE_MODE_ALL = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4),
27408 static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
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 },
27415 { } /* terminate list */
27417 @@ -111,6 +118,9 @@
27419 .bmdma_setup = ata_bmdma_setup,
27420 .bmdma_start = ata_bmdma_start,
27421 + .bmdma_stop = ata_bmdma_stop,
27422 + .bmdma_status = ata_bmdma_status,
27424 .qc_prep = ata_qc_prep,
27425 .qc_issue = ata_qc_issue_prot,
27427 @@ -159,18 +169,132 @@
27428 8, 4, 8, 4, 16, 256
27431 +static const unsigned int vt6421_bar_sizes[] = {
27432 + 16, 16, 16, 16, 32, 128
27435 static unsigned long svia_scr_addr(unsigned long addr, unsigned int port)
27437 return addr + (port * 128);
27440 +static unsigned long vt6421_scr_addr(unsigned long addr, unsigned int port)
27442 + return addr + (port * 64);
27445 +static void vt6421_init_addrs(struct ata_probe_ent *probe_ent,
27446 + struct pci_dev *pdev,
27447 + unsigned int port)
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;
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;
27458 + scr_addr = vt6421_scr_addr(pci_resource_start(pdev, 5), port);
27459 + probe_ent->port[port].scr_addr = scr_addr;
27461 + ata_std_ports(&probe_ent->port[port]);
27464 +static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
27466 + struct ata_probe_ent *probe_ent;
27467 + struct ata_port_info *ppi = &svia_port_info;
27469 + probe_ent = ata_pci_init_native_mode(pdev, &ppi);
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);
27478 + return probe_ent;
27481 +static struct ata_probe_ent *vt6421_init_probe_ent(struct pci_dev *pdev)
27483 + struct ata_probe_ent *probe_ent;
27486 + probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
27490 + memset(probe_ent, 0, sizeof(*probe_ent));
27491 + probe_ent->dev = pci_dev_to_dev(pdev);
27492 + INIT_LIST_HEAD(&probe_ent->node);
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;
27505 + for (i = 0; i < N_PORTS; i++)
27506 + vt6421_init_addrs(probe_ent, pdev, i);
27508 + return probe_ent;
27511 +static void svia_configure(struct pci_dev *pdev)
27515 + pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
27516 + printk(KERN_INFO DRV_NAME "(%s): routed to hard irq line %d\n",
27518 + (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
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);
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);
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);
27548 static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
27550 static int printed_version;
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;
27560 if (!printed_version++)
27561 @@ -181,20 +305,28 @@
27564 rc = pci_request_regions(pdev, DRV_NAME);
27567 + pci_dev_busy = 1;
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);
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);
27583 + goto err_out_regions;
27586 + bar_sizes = &svia_bar_sizes[0];
27588 + bar_sizes = &vt6421_bar_sizes[0];
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",
27597 pci_resource_start(pdev, i),
27598 @@ -207,8 +339,11 @@
27600 goto err_out_regions;
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);
27607 + probe_ent = vt6421_init_probe_ent(pdev);
27610 printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
27612 @@ -216,42 +351,7 @@
27613 goto err_out_regions;
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);
27621 - pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
27622 - printk(KERN_INFO DRV_NAME "(%s): routed to hard irq line %d\n",
27624 - (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
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);
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);
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);
27652 + svia_configure(pdev);
27654 pci_set_master(pdev);
27656 @@ -262,7 +362,8 @@
27658 pci_release_regions(pdev);
27660 - pci_disable_device(pdev);
27661 + if (!pci_dev_busy)
27662 + pci_disable_device(pdev);
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 @@
27671 * Read the interrupt register and process for the devices that have them pending.
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)
27677 struct ata_host_set *host_set = dev_instance;
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;
27696 @@ -275,13 +279,15 @@
27699 rc = pci_request_regions(pdev, DRV_NAME);
27702 + pci_dev_busy = 1;
27707 * Use 32 bit DMA mask, because 64 bit address support is poor.
27709 - rc = pci_set_dma_mask(pdev, 0xFFFFFFFFULL);
27710 + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
27712 goto err_out_regions;
27714 @@ -348,7 +354,8 @@
27716 pci_release_regions(pdev);
27718 - pci_disable_device(pdev);
27719 + if (!pci_dev_busy)
27720 + pci_disable_device(pdev);
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);
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 @@
27746 sd_template.dev_noticed--;
27747 sd_template.nr_dev--;
27748 - SD_GENDISK(i).nr_real--;
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;
27760 + return (-ENOMEM);
27762 (STp->buffer)->buffer_bytes = bytes - transfer;
27764 @@ -3778,7 +3778,6 @@
27768 - llseek: no_llseek,
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 @@
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;
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
27788 * 675 Mass Ave, Cambridge, MA 02139, USA.
27792 #include <linux/version.h>
27793 #include <linux/module.h>
27794 #include <linux/string.h>
27796 #include <asm/uaccess.h>
27797 #include <asm/hardirq.h>
27798 #include <asm/au1000.h>
27800 +#if defined(CONFIG_SOC_AU1550)
27801 #include <asm/pb1550.h>
27804 +#if defined(CONFIG_MIPS_PB1200)
27806 +#define WM_MODE_USB
27807 +#include <asm/pb1200.h>
27810 +#if defined(CONFIG_MIPS_FICMMP)
27812 +#define WM_MODE_NORMAL
27813 +#include <asm/ficmmp.h>
27817 +#define WM_VOLUME_MIN 47
27818 +#define WM_VOLUME_SCALE 80
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)
27834 +#define supported_mixer(FOO) ((FOO >= 0) && \
27835 + (FOO < SOUND_MIXER_NRDEVICES) && \
27836 + WM_I2S_SUPPORTED_MASK & (1<<FOO) )
27838 #include <asm/au1xxx_psc.h>
27839 #include <asm/au1xxx_dbdma.h>
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.
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;
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)
27876 +#define WS_64FS 31
27877 +#define WS_96FS 47
27878 +#define WS_128FS 63
27879 +#define WS_192FS 95
27881 +#define MIN_Q_COUNT 2
27883 MODULE_PARM(vra, "i");
27884 MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it");
27886 static struct au1550_state {
27887 /* soundcore stuff */
27892 struct semaphore open_sem;
27893 @@ -114,6 +191,11 @@
27895 volatile psc_i2s_t *psc_addr;
27904 unsigned sample_rate;
27905 @@ -195,60 +277,224 @@
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.
27916 - return 0 /* data */;
27922 -wrcodec(u8 ctlreg, u8 val)
27923 +wrcodec(u8 ctlreg, u16 val)
27926 extern int pb1550_wm_codec_write(u8 addr, u8 reg, u8 val);
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.
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) &&
27942 - printk("Codec write retry %02x %02x\n", ctlreg, val);
27946 + au1550_delay(10);
27950 +au1550_open_mixdev(struct inode *inode, struct file *file)
27952 + file->private_data = &au1550_state;
27957 +au1550_release_mixdev(struct inode *inode, struct file *file)
27962 +static int wm_i2s_read_mixer(struct au1550_state *s, int oss_channel)
27966 + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
27967 + /* nice stereo mixers .. */
27969 + ret = s->level_left | (s->level_right << 8);
27970 + } else if (oss_channel == SOUND_MIXER_MIC) {
27972 + /* TODO: Implement read mixer for input/output codecs */
27978 +static void wm_i2s_write_mixer(struct au1550_state *s, int oss_channel, unsigned int left, unsigned int right)
27980 + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
27981 + /* stereo mixers */
27982 + s->level_left = left;
27983 + s->level_right = right;
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;
27992 + right += WM_VOLUME_MIN;
27993 + left += WM_VOLUME_MIN;
27995 + wrcodec(WM_REG_L_HEADPHONE_OUT, left);
27996 + wrcodec(WM_REG_R_HEADPHONE_OUT, right);
27998 + }else if (oss_channel == SOUND_MIXER_MIC) {
27999 + /* TODO: implement write mixer for input/output codecs */
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 )
28006 + unsigned int left,right;
28008 + /* cleanse input a little */
28009 + right = ((val >> 8) & 0xff) ;
28010 + left = (val & 0xff) ;
28012 + if (right > 100) right = 100;
28013 + if (left > 100) left = 100;
28015 + wm_i2s_write_mixer(s, oss_mixer, left, right);
28019 +au1550_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
28021 + struct au1550_state *s = (struct au1550_state *)file->private_data;
28025 + if (cmd == SOUND_MIXER_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)))
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)))
28043 + if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
28046 + if (cmd == OSS_GETVERSION)
28047 + return put_user(SOUND_VERSION, (int *)arg);
28049 + if (_SIOC_DIR(cmd) == _SIOC_READ) {
28050 + switch (_IOC_NR(cmd)) {
28051 + case SOUND_MIXER_RECSRC: /* give them the current record src */
28054 + if (!codec->recmask_io) {
28057 + val = codec->recmask_io(codec, 1, 0);
28061 + case SOUND_MIXER_DEVMASK: /* give them the supported mixers */
28062 + val = WM_I2S_SUPPORTED_MASK;
28065 + case SOUND_MIXER_RECMASK:
28066 + /* Arg contains a bit for each supported recording
28068 + val = WM_I2S_RECORD_MASK;
28071 + case SOUND_MIXER_STEREODEVS:
28072 + /* Mixer channels supporting stereo */
28073 + val = WM_I2S_STEREO_MASK;
28076 + case SOUND_MIXER_CAPS:
28077 + val = SOUND_CAP_EXCL_INPUT;
28080 + default: /* read a specific mixer */
28081 + i = _IOC_NR(cmd);
28083 + if (!supported_mixer(i))
28086 + val = wm_i2s_read_mixer(s, i);
28089 + return put_user(val, (int *)arg);
28092 + if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
28093 + if (get_user(val, (int *)arg))
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)
28103 + if (!(val &= WM_I2S_RECORD_MASK))
28107 + default: /* write a specific mixer */
28108 + i = _IOC_NR(cmd);
28110 + if (!supported_mixer(i))
28113 + wm_i2s_set_mixer(s, i, val);
28122 +au1550_llseek(struct file *file, loff_t offset, int origin)
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,
28137 +codec_init(struct au1550_state *s)
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 */
28167 /* stop the ADC before calling */
28168 @@ -256,27 +502,16 @@
28169 set_adc_rate(struct au1550_state *s, unsigned rate)
28171 struct dmabuf *adc = &s->dma_adc;
28172 - struct dmabuf *dac = &s->dma_dac;
28175 - /* calc SRC factor
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;
28183 + //TODO: Need code for normal mode
28186 adc->src_factor = 1;
28190 - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
28192 - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
28194 - adc->sample_rate = rate;
28195 - dac->sample_rate = rate;
28199 /* stop the DAC before calling */
28200 @@ -284,26 +519,89 @@
28201 set_dac_rate(struct au1550_state *s, unsigned rate)
28203 struct dmabuf *dac = &s->dma_dac;
28204 - struct dmabuf *adc = &s->dma_adc;
28207 - /* calc SRC factor
28209 - dac->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
28210 - dac->sample_rate = SAMP_RATE / dac->src_factor;
28212 + u16 sr, ws, div, bosr, mode;
28213 + volatile psc_i2s_t* ip = (volatile psc_i2s_t *)I2S_PSC_BASE;
28216 + #if defined(CONFIG_MIPS_FICMMP)
28217 + rate = ficmmp_set_i2s_sample_rate(rate);
28223 + sr = WM_SC_SR_96000;
28225 + div = PSC_I2SCFG_DIV2;
28228 + sr = WM_SC_SR_88200;
28230 + div = PSC_I2SCFG_DIV2;
28233 + sr = WM_SC_SR_44100;
28235 + div = PSC_I2SCFG_DIV2;
28238 + sr = WM_SC_SR_48000;
28240 + div = PSC_I2SCFG_DIV2;
28243 + sr = WM_SC_SR_32000;
28245 + div = PSC_I2SCFG_DIV4;
28248 + sr = WM_SC_SR_8018;
28250 + div = PSC_I2SCFG_DIV2;
28254 + sr = WM_SC_SR_8000;
28256 + div = PSC_I2SCFG_DIV16;
28260 + #if defined(WM_MODE_USB)
28261 + mode = WM_SC_MODE_USB;
28263 + mode = WM_SC_MODE_NORMAL;
28268 dac->src_factor = 1;
28269 + dac->sample_rate = rate;
28272 - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
28273 + /* Deactivate codec */
28274 + wrcodec(WM_REG_ACTIVE_CTRL, 0x00);
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);
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;
28289 - adc->sample_rate = rate;
28290 - dac->sample_rate = rate;
28292 + /* Wait for device enabled */
28293 + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 0);
28295 + /* Set appropriate sampling rate */
28296 + wrcodec(WM_REG_SAMPLING_CONTROL, bosr | mode | sr);
28298 + /* Activate codec */
28299 + wrcodec(WM_REG_ACTIVE_CTRL, 0x01);
28303 @@ -354,8 +652,7 @@
28304 ip->psc_i2spcr = PSC_I2SPCR_RP;
28307 - /* Wait for Receive Busy to show disabled.
28309 + /* Wait for Receive Busy to show disabled. */
28311 stat = ip->psc_i2sstat;
28313 @@ -463,7 +760,6 @@
28314 if (db->num_channels == 1)
28315 db->cnt_factor *= 2;
28316 db->cnt_factor *= db->src_factor;
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);
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)
28334 + err("qcount < MIN_Q_COUNT and no ring room!");
28336 db->nextOut += db->fragsize;
28337 if (db->nextOut >= db->rawbuf + db->dmasize)
28338 @@ -606,65 +903,43 @@
28343 -au1550_llseek(struct file *file, loff_t offset, int origin)
28351 -au1550_open_mixdev(struct inode *inode, struct file *file)
28353 - file->private_data = &au1550_state;
28358 -au1550_release_mixdev(struct inode *inode, struct file *file)
28364 -mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
28365 - unsigned long arg)
28367 - return codec->mixer_ioctl(codec, cmd, arg);
28371 -au1550_ioctl_mixdev(struct inode *inode, struct file *file,
28372 - unsigned int cmd, unsigned long arg)
28374 - struct au1550_state *s = (struct au1550_state *)file->private_data;
28375 - struct ac97_codec *codec = s->codec;
28377 - return mixdev_ioctl(codec, cmd, arg);
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,
28390 drain_dac(struct au1550_state *s, int nonblock)
28392 unsigned long flags;
28395 + struct dmabuf *db = &s->dma_dac;
28398 if (s->dma_dac.mapped || !s->dma_dac.ready || s->dma_dac.stopped)
28402 spin_lock_irqsave(&s->lock, flags);
28403 - count = s->dma_dac.count;
28404 + count = db->count;
28406 + /* Pad the ddma buffer with zeros if the amount remaining
28407 + * is not a multiple of fragsize */
28408 + if(count % db->fragsize != 0)
28410 + int pad = db->fragsize - (count % db->fragsize);
28411 + char* bufptr = db->nextIn;
28412 + char* bufend = db->rawbuf + db->dmasize;
28414 + if((bufend - bufptr) < pad)
28415 + printk("Error! ddma padding is bigger than available ring space!\n");
28418 + memset((void*)bufptr, 0, pad);
28420 + db->nextIn += pad;
28421 + db->count += pad;
28422 + if (db->dma_qcount == 0)
28424 + db->dma_qcount++;
28427 spin_unlock_irqrestore(&s->lock, flags);
28430 @@ -672,9 +947,9 @@
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;
28441 if (signal_pending(current))
28442 @@ -698,8 +973,7 @@
28443 * If interpolating (no VRA), duplicate every audio frame src_factor times.
28446 -translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf,
28448 +translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf, int dmacount)
28451 int interp_bytes_per_sample;
28452 @@ -737,11 +1011,12 @@
28454 /* duplicate every audio frame src_factor times
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;
28462 userbuf += db->user_bytes_per_sample;
28463 - dmabuf += interp_bytes_per_sample;
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.
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!");
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)
28485 @@ -1017,7 +1291,6 @@
28488 } /* while (count > 0) */
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);
28500 return copy_to_user((void *) arg, &abinfo,
28501 sizeof(abinfo)) ? -EFAULT : 0;
28503 @@ -1536,13 +1806,9 @@
28504 case SNDCTL_DSP_SETSYNCRO:
28505 case SOUND_PCM_READ_FILTER:
28511 - return mixdev_ioctl(s->codec, cmd, arg);
28518 @@ -1664,15 +1930,15 @@
28519 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
28520 MODULE_DESCRIPTION("Au1550 Audio Driver");
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.
28529 - uint clk, rate, stat;
28531 - /* Wire up Freq4 as a clock for the PSC3.
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 @@
28539 clk = au_readl(SYS_CLKSRC);
28541 +#if defined(CONFIG_SOC_AU1550)
28542 clk &= ~0x01f00000;
28544 +#elif defined(CONFIG_SOC_AU1200)
28545 + clk &= ~0x3e000000;
28546 + clk |= (6 << 27);
28548 au_writel(clk, SYS_CLKSRC);
28553 static int __devinit
28555 @@ -1724,6 +1996,11 @@
28556 init_MUTEX(&s->open_sem);
28557 spin_lock_init(&s->lock);
28559 + /* CPLD Mux for I2s */
28561 +#if defined(CONFIG_MIPS_PB1200)
28562 + bcsr->resets |= BCSR_RESETS_PCS1MUX;
28565 s->psc_addr = (volatile psc_i2s_t *)I2S_PSC_BASE;
28567 @@ -1765,9 +2042,8 @@
28569 if ((s->dev_audio = register_sound_dsp(&au1550_audio_fops, -1)) < 0)
28572 - if ((s->codec->dev_mixer =
28573 - register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
28575 + if ((s->dev_mixer = register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
28579 @@ -1777,7 +2053,6 @@
28580 proc_au1550_dump, NULL);
28581 #endif /* AU1550_DEBUG */
28585 /* The GPIO for the appropriate PSC was configured by the
28586 * board specific start up.
28587 @@ -1786,7 +2061,12 @@
28589 ip->psc_ctrl = PSC_CTRL_DISABLE; /* Disable PSC */
28591 +#if defined(WM_MODE_USB)
28593 ip->psc_sel = (PSC_SEL_CLK_INTCLK | PSC_SEL_PS_I2SMODE);
28595 + ip->psc_sel = (PSC_SEL_CLK_EXTCLK | PSC_SEL_PS_I2SMODE);
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).
28604 - val = PSC_I2SCFG_SET_LEN(16);
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
28614 - val |= PSC_I2SCFG_SET_WS(252);
28616 - val |= PSC_I2SCFG_SET_WS(250);
28618 - val |= PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
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;
28623 - ip->psc_i2scfg = val;
28625 - val |= PSC_I2SCFG_DE_ENABLE;
28626 - ip->psc_i2scfg = val;
28628 + ip->psc_i2scfg = val | PSC_I2SCFG_DE_ENABLE;
28630 - /* Wait for Device ready.
28633 - val = ip->psc_i2sstat;
28635 - } while ((val & PSC_I2SSTAT_DR) == 0);
28636 + set_dac_rate(s, 8000); //Set default rate
28638 - val = ip->psc_i2scfg;
28643 + s->no_vra = vra ? 0 : 1;
28647 info("no VRA, interpolating and decimating");
28649 @@ -1866,6 +2122,8 @@
28651 unregister_sound_dsp(s->dev_audio);
28654 + unregister_sound_dsp(s->dev_audio);
28656 au1xxx_dbdma_chan_free(s->dma_adc.dmanr);
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
28662 * 675 Mass Ave, Cambridge, MA 02139, USA.
28666 #include <linux/version.h>
28667 #include <linux/module.h>
28668 #include <linux/string.h>
28670 #include <asm/db1x00.h>
28673 +#ifdef CONFIG_MIPS_PB1200
28674 +#include <asm/pb1200.h>
28677 +#ifdef CONFIG_MIPS_DB1200
28678 +#include <asm/db1200.h>
28681 #undef OSS_DOCUMENTED_MIXER_SEMANTICS
28683 #define AU1550_MODULE_NAME "Au1550 psc audio"
28684 @@ -521,7 +530,14 @@
28685 spin_unlock_irqrestore(&s->lock, flags);
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
28698 set_xmit_slots(int num_channels)
28700 @@ -565,6 +581,14 @@
28701 } while ((stat & PSC_AC97STAT_DR) == 0);
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
28713 set_recv_slots(int num_channels)
28715 @@ -608,7 +632,6 @@
28717 spin_lock_irqsave(&s->lock, flags);
28719 - set_xmit_slots(db->num_channels);
28720 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);
28722 au_writel(PSC_AC97PCR_TS, PSC_AC97PCR);
28723 @@ -640,7 +663,6 @@
28724 db->nextIn -= db->dmasize;
28727 - set_recv_slots(db->num_channels);
28728 au1xxx_dbdma_start(db->dmanr);
28729 au_writel(PSC_AC97PCR_RC, PSC_AC97PCR);
28731 @@ -752,12 +774,16 @@
28732 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
28733 dbg("AC97C status = 0x%08x", ac97c_stat);
28735 + /* There is a possiblity that we are getting 1 interrupt for
28736 + multiple descriptors. Use ddma api to find out how many
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!");
28747 db->nextOut += db->fragsize;
28748 if (db->nextOut >= db->rawbuf + db->dmasize)
28749 @@ -941,11 +967,12 @@
28751 /* duplicate every audio frame src_factor times
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;
28759 userbuf += db->user_bytes_per_sample;
28760 - dmabuf += interp_bytes_per_sample;
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");
28771 db->nextOut += db->fragsize;
28772 if (db->nextOut >= db->rawbuf + db->dmasize)
28773 @@ -1481,6 +1508,7 @@
28776 s->dma_adc.num_channels = val;
28777 + set_recv_slots(val);
28778 if ((ret = prog_dmabuf_adc(s)))
28781 @@ -1538,6 +1566,7 @@
28784 s->dma_dac.num_channels = val;
28785 + set_xmit_slots(val);
28786 if ((ret = prog_dmabuf_dac(s)))
28789 @@ -1832,10 +1861,8 @@
28790 down(&s->open_sem);
28796 if (file->f_mode & FMODE_READ) {
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 @@
28804 if (file->f_mode & FMODE_WRITE) {
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);
28813 + set_xmit_slots(1);
28814 + set_recv_slots(1);
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
28823 * for more details.
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
28830 #include <linux/config.h>
28832 #include <asm/keyboard.h>
28833 #include <asm/dec/tc.h>
28834 #include <asm/dec/machtype.h>
28835 +#include <asm/dec/serial.h>
28841 @@ -55,19 +55,20 @@
28842 unsigned char kbd_sysrq_key = -1;
28845 -#define KEYB_LINE 3
28846 +#define KEYB_LINE_ZS 3
28847 +#define KEYB_LINE_DZ 0
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);
28856 -struct zs_hook lk201_kbdhook = {
28857 +static struct dec_serial_hook lk201_hook = {
28858 .init_channel = lk201_init,
28859 .init_info = lk201_info,
28861 .poll_rx_char = NULL,
28862 .poll_tx_char = NULL,
28863 - .cflags = B4800 | CS8 | CSTOPB | CLOCAL
28864 + .cflags = B4800 | CS8 | CSTOPB | CLOCAL,
28868 @@ -93,28 +94,28 @@
28869 LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
28872 -static struct dec_serial* lk201kbd_info;
28873 +static void *lk201_handle;
28875 -static int lk201_send(struct dec_serial *info, unsigned char ch)
28876 +static int lk201_send(unsigned char ch)
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");
28886 -static inline int lk201_get_id(struct dec_serial *info)
28887 +static inline int lk201_get_id(void)
28889 - return lk201_send(info, LK_CMD_REQ_ID);
28890 + return lk201_send(LK_CMD_REQ_ID);
28893 -static int lk201_reset(struct dec_serial *info)
28894 +static int lk201_reset(void)
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]);
28904 @@ -203,24 +204,26 @@
28906 static int write_kbd_rate(struct kbd_repeat *rep)
28908 - struct dec_serial* info = lk201kbd_info;
28912 delay = rep->delay / 5;
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)))
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)))
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)))
28931 -static int lk201kbd_rate(struct kbd_repeat *rep)
28932 +static int lk201_kbd_rate(struct kbd_repeat *rep)
28936 @@ -237,10 +240,8 @@
28940 -static void lk201kd_mksound(unsigned int hz, unsigned int ticks)
28941 +static void lk201_kd_mksound(unsigned int hz, unsigned int ticks)
28943 - struct dec_serial* info = lk201kbd_info;
28948 @@ -253,20 +254,19 @@
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))
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)))
28958 - if (info->hook->poll_tx_char(info, LK_CMD_BELL))
28959 + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_BELL))
28963 void kbd_leds(unsigned char leds)
28965 - struct dec_serial* info = lk201kbd_info;
28966 unsigned char l = 0;
28968 - if (!info) /* FIXME */
28969 + if (!lk201_handle) /* FIXME */
28972 /* FIXME -- Only Hold and Lock LEDs for now. --macro */
28973 @@ -275,13 +275,13 @@
28974 if (leds & LED_CAP)
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))
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)))
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))
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)))
28991 @@ -307,7 +307,7 @@
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)
28998 static unsigned char id[6];
29000 @@ -316,9 +316,8 @@
29001 static int prev_scancode;
29002 unsigned char c = scancodeRemap[ch];
29004 - if (stat && stat != TTY_OVERRUN) {
29005 - printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n",
29007 + if (fl != TTY_NORMAL && fl != TTY_OVERRUN) {
29008 + printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n", fl);
29012 @@ -335,7 +334,7 @@
29013 /* OK, the power-up concluded. */
29015 if (id[2] == LK_STAT_PWRUP_OK)
29016 - lk201_get_id(lk201kbd_info);
29020 printk(KERN_ERR "lk201: keyboard power-up "
29021 @@ -345,7 +344,7 @@
29022 /* We got the ID; report it and start operation. */
29025 - lk201_reset(lk201kbd_info);
29030 @@ -398,29 +397,28 @@
29031 tasklet_schedule(&keyboard_tasklet);
29034 -static void __init lk201_info(struct dec_serial *info)
29035 +static void __init lk201_info(void *handle)
29039 -static int __init lk201_init(struct dec_serial *info)
29040 +static int __init lk201_init(void *handle)
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;
29050 - info->hook->rx_char = lk201_kbd_rx_char;
29051 + lk201_hook.rx_char = lk201_rx_char;
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);
29060 void __init kbd_init_hw(void)
29062 - extern int register_zs_hook(unsigned int, struct zs_hook *);
29063 - extern int unregister_zs_hook(unsigned int);
29066 /* Maxine uses LK501 at the Access.Bus. */
29068 @@ -428,19 +426,15 @@
29070 printk(KERN_INFO "lk201: DECstation LK keyboard driver v0.05.\n");
29072 - if (LK_IFACE_ZS) {
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 :-)
29078 - if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
29079 - unregister_zs_hook(KEYB_LINE);
29082 - * TODO: modify dz.c to allow similar hooks
29083 - * for LK201 handling on DS2100, DS3100, and DS5000/200
29085 - printk(KERN_ERR "lk201: support for DZ11 not yet ready.\n");
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 :-)
29093 + keyb_line = KEYB_LINE_ZS;
29095 + keyb_line = KEYB_LINE_DZ;
29096 + if (!register_dec_serial_hook(keyb_line, &lk201_hook))
29097 + unregister_dec_serial_hook(keyb_line);
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
29103 #include <asm/bitops.h>
29104 #include <asm/uaccess.h>
29105 #include <asm/bootinfo.h>
29106 +#include <asm/dec/serial.h>
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;
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) && \
29119 static unsigned long break_pressed; /* break, really ... */
29122 @@ -196,7 +198,6 @@
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];
29135 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
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 * -----------------------------------------------------------------------
29145 -static int tty_break; /* Set whenever BREAK condition is detected. */
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))
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;
29162 - break_pressed = 0;
29165 + flag = TTY_NORMAL;
29166 + if (info->tty_break) {
29167 + info->tty_break = 0;
29169 if (info->flags & ZILOG_SAK)
29171 + /* Ignore the null char got when BREAK is removed. */
29175 if (stat & Rx_OVR) {
29176 flag = TTY_OVERRUN;
29177 @@ -435,20 +425,22 @@
29179 } else if (stat & PAR_ERR) {
29185 + if (flag != TTY_NORMAL)
29186 /* reset the error indication */
29187 write_zsreg(info->zs_channel, R0, ERR_RES);
29190 -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
29191 +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
29193 if (break_pressed && info->line == sercons.index) {
29195 - time_before(jiffies, break_pressed + HZ*5)) {
29196 + /* Ignore the null char got when BREAK is removed. */
29199 + if (time_before(jiffies, break_pressed + HZ * 5)) {
29200 handle_sysrq(ch, regs, NULL, NULL);
29202 - goto ignore_char;
29207 @@ -459,23 +451,7 @@
29211 - if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
29212 - static int flip_buf_ovf;
29216 - tty->flip.count++;
29218 - static int flip_max_cnt;
29219 - if (flip_max_cnt < tty->flip.count)
29220 - flip_max_cnt = tty->flip.count;
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)
29228 + tty_insert_flip_char(tty, ch, flag);
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);
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) && \
29242 + if (info->line == sercons.index) {
29243 + if (!break_pressed)
29244 + break_pressed = jiffies;
29248 + info->tty_break = 1;
29251 if (info->zs_channel != info->zs_chan_a) {
29252 @@ -957,7 +937,7 @@
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));
29261 @@ -965,7 +945,7 @@
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);
29270 @@ -1282,46 +1262,48 @@
29275 - error = verify_area(VERIFY_WRITE, (void *) arg,
29276 - sizeof(unsigned int));
29279 - return get_modem_info(info, (unsigned int *) arg);
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));
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));
29300 - return get_lsr_info(info, (unsigned int *) arg);
29302 + error = verify_area(VERIFY_WRITE, (void *)arg,
29303 + sizeof(unsigned int));
29306 + return get_modem_info(info, (unsigned int *)arg);
29308 - case TIOCSERGSTRUCT:
29309 - error = verify_area(VERIFY_WRITE, (void *) arg,
29310 - sizeof(struct dec_serial));
29313 - copy_from_user((struct dec_serial *) arg,
29314 - info, sizeof(struct dec_serial));
29319 + return set_modem_info(info, cmd, (unsigned int *)arg);
29322 - return -ENOIOCTLCMD;
29324 + case TIOCGSERIAL:
29325 + error = verify_area(VERIFY_WRITE, (void *)arg,
29326 + sizeof(struct serial_struct));
29329 + return get_serial_info(info, (struct serial_struct *)arg);
29331 + case TIOCSSERIAL:
29332 + return set_serial_info(info, (struct serial_struct *)arg);
29334 + case TIOCSERGETLSR: /* Get line status register */
29335 + error = verify_area(VERIFY_WRITE, (void *)arg,
29336 + sizeof(unsigned int));
29340 + return get_lsr_info(info, (unsigned int *)arg);
29342 + case TIOCSERGSTRUCT:
29343 + error = verify_area(VERIFY_WRITE, (void *)arg,
29344 + sizeof(struct dec_serial));
29347 + copy_from_user((struct dec_serial *)arg, info,
29348 + sizeof(struct dec_serial));
29352 + return -ENOIOCTLCMD;
29357 @@ -1446,7 +1428,8 @@
29358 static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
29360 struct dec_serial *info = (struct dec_serial *) tty->driver_data;
29361 - unsigned long orig_jiffies, char_time;
29362 + unsigned long orig_jiffies;
29365 if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
29367 @@ -1462,7 +1445,7 @@
29368 if (char_time == 0)
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 @@
29378 static void __init show_serial_version(void)
29380 - printk("DECstation Z8530 serial driver version 0.08\n");
29381 + printk("DECstation Z8530 serial driver version 0.09\n");
29384 /* Initialize Z8530s zs_channels
29385 @@ -1994,8 +1977,9 @@
29386 * polling I/O routines
29389 -zs_poll_tx_char(struct dec_serial *info, unsigned char ch)
29390 +zs_poll_tx_char(void *handle, unsigned char ch)
29392 + struct dec_serial *info = handle;
29393 struct dec_zschannel *chan = info->zs_channel;
29396 @@ -2017,8 +2001,9 @@
29400 -zs_poll_rx_char(struct dec_serial *info)
29401 +zs_poll_rx_char(void *handle)
29403 + struct dec_serial *info = handle;
29404 struct dec_zschannel *chan = info->zs_channel;
29407 @@ -2038,12 +2023,13 @@
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)
29414 struct dec_serial *info = &zs_soft[channel];
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);
29423 @@ -2055,7 +2041,7 @@
29427 -unsigned int unregister_zs_hook(unsigned int channel)
29428 +int unregister_zs_hook(unsigned int channel)
29430 struct dec_serial *info = &zs_soft[channel];
29432 @@ -2063,8 +2049,8 @@
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);
29443 @@ -2319,22 +2305,23 @@
29444 write_zsreg(chan, 9, nine);
29447 -static int kgdbhook_init_channel(struct dec_serial* info)
29448 +static int kgdbhook_init_channel(void *handle)
29453 -static void kgdbhook_init_info(struct dec_serial* info)
29454 +static void kgdbhook_init_info(void *handle)
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)
29462 + struct dec_serial *info = handle;
29464 + if (fl != TTY_NORMAL)
29466 if (ch == 0x03 || ch == '$')
29468 - if (stat & (Rx_OVR|FRM_ERR|PAR_ERR))
29469 - write_zsreg(info->zs_channel, 0, ERR_RES);
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.
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,
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
29495 - * macserial.h: Definitions for the Macintosh Z8530 serial driver.
29496 + * drivers/tc/zs.h: Definitions for the DECstation Z85C30 serial driver.
29498 * Adapted from drivers/sbus/char/sunserial.h by Paul Mackerras.
29499 + * Adapted from drivers/macintosh/macserial.h by Harald Koerfgen.
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
29505 #ifndef _DECSERIAL_H
29506 #define _DECSERIAL_H
29508 +#include <asm/dec/serial.h>
29510 #define NUM_ZSREGS 16
29512 struct serial_struct {
29513 @@ -89,63 +93,50 @@
29514 unsigned char curregs[NUM_ZSREGS];
29517 -struct dec_serial;
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);
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;
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 */
29542 - /* We need to know the current clock divisor
29543 - * to read the bps rate the chip has currently
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;
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. */
29557 + * We need to know the current clock divisor
29558 + * to read the bps rate the chip has currently loaded.
29560 - unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
29562 + int clk_divisor; /* May be 1, 16, 32, or 64. */
29565 - char change_needed;
29566 + char change_needed;
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;
29580 int xmit_fifo_size;
29581 int custom_divisor;
29582 - int x_char; /* xon/xoff character */
29583 + int x_char; /* XON/XOFF character. */
29585 unsigned short closing_wait;
29586 unsigned short closing_wait2;
29587 unsigned long event;
29588 unsigned long last_active;
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;
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;
29613 @@ -1146,24 +1148,10 @@
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)
29621 - struct dev_state *ps = (struct dev_state *)file->private_data;
29622 - int ret = -ENOIOCTLCMD;
29624 - if (!(file->f_mode & FMODE_WRITE))
29626 - down_read(&ps->devsem);
29628 - up_read(&ps->devsem);
29633 - * grab device's exclusive_access mutex to prevent its driver from
29634 - * using this device while it is being accessed by us.
29636 - down(&ps->dev->exclusive_access);
29640 case USBDEVFS_CONTROL:
29641 @@ -1194,14 +1182,6 @@
29642 inode->i_mtime = CURRENT_TIME;
29645 - case USBDEVFS_GETDRIVER:
29646 - ret = proc_getdriver(ps, (void *)arg);
29649 - case USBDEVFS_CONNECTINFO:
29650 - ret = proc_connectinfo(ps, (void *)arg);
29653 case USBDEVFS_SETINTERFACE:
29654 ret = proc_setintf(ps, (void *)arg);
29656 @@ -1220,6 +1200,53 @@
29657 ret = proc_unlinkurb(ps, (void *)arg);
29660 + case USBDEVFS_CLAIMINTERFACE:
29661 + ret = proc_claiminterface(ps, (void *)arg);
29664 + case USBDEVFS_RELEASEINTERFACE:
29665 + ret = proc_releaseinterface(ps, (void *)arg);
29668 + case USBDEVFS_IOCTL:
29669 + ret = proc_ioctl(ps, (void *) arg);
29678 +static int usbdev_ioctl(struct inode *inode, struct file *file,
29679 + unsigned int cmd, unsigned long arg)
29681 + struct dev_state *ps = file->private_data;
29684 + if (!(file->f_mode & FMODE_WRITE))
29686 + down_read(&ps->devsem);
29688 + up_read(&ps->devsem);
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().
29699 + case USBDEVFS_GETDRIVER:
29700 + ret = proc_getdriver(ps, (void *)arg);
29703 + case USBDEVFS_CONNECTINFO:
29704 + ret = proc_connectinfo(ps, (void *)arg);
29707 case USBDEVFS_REAPURB:
29708 ret = proc_reapurb(ps, (void *)arg);
29710 @@ -1232,19 +1259,28 @@
29711 ret = proc_disconnectsignal(ps, (void *)arg);
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);
29727 case USBDEVFS_RELEASEINTERFACE:
29728 - ret = proc_releaseinterface(ps, (void *)arg);
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);
29743 - up(&ps->dev->exclusive_access);
29744 up_read(&ps->devsem);
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)
29753 struct hid_device *hid = urb->context;
29754 + unsigned long flags;
29757 warn("ctrl urb status %d received", urb->status);
29759 + spin_lock_irqsave(&hid->outlock, flags);
29761 hid->outtail = (hid->outtail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
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);
29769 + spin_unlock_irqrestore(&hid->outlock, flags);
29773 + clear_bit(HID_OUT_RUNNING, &hid->iofl);
29774 + spin_unlock_irqrestore(&hid->outlock, flags);
29777 void hid_write_report(struct hid_device *hid, struct hid_report *report)
29779 + unsigned long flags;
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 @@
29786 hid->out[hid->outhead].dr.wValue = cpu_to_le16(((report->type + 1) << 8) | report->id);
29788 + spin_lock_irqsave(&hid->outlock, flags);
29790 hid->outhead = (hid->outhead + 1) & (HID_CONTROL_FIFO_SIZE - 1);
29792 if (hid->outhead == hid->outtail)
29793 hid->outtail = (hid->outtail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
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);
29801 + spin_unlock_irqrestore(&hid->outlock, flags);
29804 int hid_open(struct hid_device *hid)
29805 @@ -1333,6 +1351,8 @@
29809 + spin_lock_init(&hid->outlock);
29811 hid->version = hdesc->bcdHID;
29812 hid->country = hdesc->bCountryCode;
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 @@
29821 + set_current_state(TASK_INTERRUPTIBLE);
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
29832 +#define HID_OUT_RUNNING 2
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 */
29841 + unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
29843 struct urb urb; /* USB URB structure */
29844 char buffer[HID_BUFFER_SIZE]; /* Rx buffer */
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 */
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 @@
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 */
29869 -/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
29870 - * it is called when the usb device is disconnected
29872 - * usbserial:usb_serial_disconnect
29873 - * calls __serial_close for each open of the port
29874 - * shutdown is called then (ie ftdi_shutdown)
29878 /* Startup for the 8U232AM chip */
29879 static int ftdi_userdev_startup (struct usb_serial *serial)
29881 @@ -1273,6 +1262,14 @@
29885 +/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
29886 + * it is called when the usb device is disconnected
29888 + * usbserial:usb_serial_disconnect
29889 + * calls __serial_close for each open of the port
29890 + * shutdown is called then (ie ftdi_shutdown)
29893 static void ftdi_shutdown (struct usb_serial *serial)
29894 { /* ftdi_shutdown */
29896 @@ -1382,6 +1379,7 @@
29897 struct usb_serial *serial;
29898 unsigned int c_cflag = port->tty->termios->c_cflag;
29902 dbg("%s", __FUNCTION__);
29904 @@ -1412,8 +1410,9 @@
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);
29914 /* unlink the running write urbs */
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"
29925 * Version Information
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"
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!
29938 -#undef FIX_WRITE_RETURN_CODE_PROBLEM
29939 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
29940 -static int write_blocking; /* disabled by default */
29944 * Function prototypes
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,
29954 - const unsigned char *buf,
29956 -static void mct_u232_write_bulk_callback (struct urb *urb);
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 @@
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,
29970 @@ -155,10 +136,6 @@
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,
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,
29985 +struct mct_u232_interval_kludge {
29986 + int ecnt; /* Error counter */
29987 + int ibase; /* Initial interval value */
29990 struct mct_u232_private {
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;
30000 - /* allocate the private data structure */
30001 priv = kmalloc(sizeof(struct mct_u232_private), GFP_KERNEL);
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;
30013 init_waitqueue_head(&serial->port->write_wait);
30015 /* Puh, that's dirty */
30016 @@ -383,20 +361,27 @@
30017 rport->interrupt_in_urb = NULL;
30018 port->read_urb->context = port;
30020 + priv->ik[0].ibase = port->read_urb->interval;
30021 + priv->ik[1].ibase = port->interrupt_in_urb->interval;
30024 } /* mct_u232_startup */
30027 static void mct_u232_shutdown (struct usb_serial *serial)
30029 + struct mct_u232_private *priv;
30032 dbg("%s", __FUNCTION__);
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;
30040 + serial->port[i].private = NULL;
30044 } /* mct_u232_shutdown */
30046 @@ -448,16 +433,20 @@
30047 spin_unlock_irqrestore(&priv->lock, flags);
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);
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);
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);
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);
30069 @@ -476,109 +465,22 @@
30071 } /* mct_u232_close */
30074 -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
30075 -/* The generic routines work fine otherwise */
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)
30082 - struct usb_serial *serial = port->serial;
30083 - int result, bytes_sent, size;
30085 - dbg("%s - port %d", __FUNCTION__, port->number);
30087 - if (count == 0) {
30088 - dbg("%s - write request of 0 bytes", __FUNCTION__);
30092 - /* only do something if we have a bulk out endpoint */
30093 - if (!serial->num_bulk_out)
30096 - /* another write is still pending? */
30097 - if (port->write_urb->status == -EINPROGRESS) {
30098 - dbg("%s - already writing", __FUNCTION__);
30103 - while (count > 0) {
30104 - size = (count > port->bulk_out_size) ? port->bulk_out_size : count;
30106 - usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf);
30109 - if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) {
30114 - memcpy (port->write_urb->transfer_buffer, buf, size);
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),
30127 - /* send the data out the bulk port */
30128 - result = usb_submit_urb(port->write_urb);
30130 - err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
30134 - bytes_sent += size;
30135 - if (write_blocking)
30136 - interruptible_sleep_on(&port->write_wait);
30144 - return bytes_sent;
30145 -} /* mct_u232_write */
30147 -static void mct_u232_write_bulk_callback (struct urb *urb)
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;
30153 - dbg("%s - port %d", __FUNCTION__, port->number);
30156 - dbg("%s - bad serial pointer, exiting", __FUNCTION__);
30159 + struct mct_u232_interval_kludge *ikp = &priv->ik[n];
30161 - if (urb->status) {
30162 - dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
30167 - if (write_blocking) {
30168 - wake_up_interruptible(&port->write_wait);
30170 + if (ikp->ecnt >= 2) {
30171 + if (urb->interval)
30172 + err("%s - too many errors: "
30173 + "status %d pipe 0x%x interval %d",
30175 + urb->status, urb->pipe, urb->interval);
30176 + urb->interval = 0;
30178 - /* from generic_write_bulk_callback */
30179 - queue_task(&port->tqueue, &tq_immediate);
30180 - mark_bh(IMMEDIATE_BH);
30185 -} /* mct_u232_write_bulk_callback */
30189 static void mct_u232_read_int_callback (struct urb *urb)
30191 @@ -589,21 +491,37 @@
30192 unsigned char *data = urb->transfer_buffer;
30193 unsigned long flags;
30195 - dbg("%s - port %d", __FUNCTION__, port->number);
30197 /* The urb might have been killed. */
30199 - dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
30201 + dbg("%s - nonzero status %d, pipe 0x%x flags 0x%x interval %d",
30203 + urb->status, urb->pipe, urb->transfer_flags, urb->interval);
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.
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);
30218 dbg("%s - bad serial pointer, exiting", __FUNCTION__);
30223 + dbg("%s - port %d", __FUNCTION__, port->number);
30224 usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
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;
30232 * Work-a-round: handle the 'usual' bulk-in pipe here
30234 @@ -660,7 +578,6 @@
30235 /* INT urbs are automatically re-submitted */
30236 } /* mct_u232_read_int_callback */
30239 static void mct_u232_set_termios (struct usb_serial_port *port,
30240 struct termios *old_termios)
30242 @@ -781,6 +698,21 @@
30243 } /* mct_u232_break_ctl */
30246 +static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file)
30248 + struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
30249 + unsigned int control_state;
30250 + unsigned long flags;
30252 + dbg("%s", __FUNCTION__);
30254 + spin_lock_irqsave(&priv->lock, flags);
30255 + control_state = priv->control_state;
30256 + spin_unlock_irqrestore(&priv->lock, flags);
30258 + return control_state;
30261 static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
30262 unsigned int cmd, unsigned long arg)
30264 @@ -794,8 +726,8 @@
30265 /* Based on code from acm.c and others */
30268 - return put_user(priv->control_state, (unsigned long *) arg);
30270 + mask = mct_u232_tiocmget(port, file);
30271 + return put_user(mask, (unsigned long *) arg);
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");
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");
30285 MODULE_PARM(debug, "i");
30286 MODULE_PARM_DESC(debug, "Debug enabled or not");
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 @@
30293 /* if the command transfered well, then we go to the data stage */
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)
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 @@
30310 ss->htmplt.proc_dir = (void *)ss;
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.
30318 + if (ss->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS)
30319 + ss->htmplt.max_sectors = 64;
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);
30332 +/* Vendor ID list for devices that require special handling */
30333 +#define USB_VENDOR_ID_GENESYS 0x05e3 /* Genesys Logic */
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
30340 + * BRIEF MODULE DESCRIPTION
30341 + * Au1200 LCD Driver.
30343 + * Copyright 2004 AMD
30347 + * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
30348 + * Created 28 Dec 1997 by Geert Uytterhoeven
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.
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.
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.
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>
30383 +#include <asm/au1000.h>
30384 +#include <asm/au1xxx_gpio.h>
30385 +#include "au1200fb.h"
30387 +#include <video/fbcon.h>
30388 +#include <video/fbcon-cfb16.h>
30389 +#include <video/fbcon-cfb32.h>
30390 +#define CMAPSIZE 16
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
30405 +typedef struct au1200_lcd_getset_t
30407 + unsigned int subcmd;
30419 + unsigned int color;
30422 + unsigned int key;
30423 + unsigned int mask;
30430 +} au1200_lcd_getset_t;
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 */
30436 +struct window_settings
30438 + unsigned char name[64];
30439 + uint32 mode_backcolor;
30440 + uint32 mode_colorkey;
30441 + uint32 mode_colorkeymsk;
30448 + uint32 mode_winctrl1; /* winctrl1[FRM,CCO,PO,PIPE] */
30449 + uint32 mode_winenable;
30453 +struct panel_settings
30455 + unsigned char name[64];
30456 + /* panel physical dimensions */
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);
30475 +#if defined(__BIG_ENDIAN)
30476 +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_00
30478 +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_01
30481 +extern int board_au1200fb_panel (void);
30482 +extern int board_au1200fb_panel_init (void);
30483 +extern int board_au1200fb_panel_shutdown (void);
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);
30493 + * Default window configurations
30495 +static struct window_settings windows[] =
30498 + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
30499 + /* mode_backcolor */ 0x006600ff,
30500 + /* mode_colorkey,msk*/ 0, 0,
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,
30508 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30509 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30510 + /* mode_winenable*/ 0,
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,
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,
30526 + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
30527 + /* mode_backcolor */ 0x006600ff,
30528 + /* mode_colorkey,msk*/ 0, 0,
30531 + /* xres, yres, xpos, ypos */ 320, 240, 5, 5,
30533 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30535 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_24BPP|LCD_WINCTRL1_PO_00,
30536 + /* mode_winenable*/ LCD_WINENABLE_WEN0,
30539 + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
30540 + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
30541 + /* mode_winenable*/ 0,
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*/,
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,
30555 + /* Need VGA 640 @ 24bpp, @ 32bpp */
30556 + /* Need VGA 800 @ 24bpp, @ 32bpp */
30557 + /* Need VGA 1024 @ 24bpp, @ 32bpp */
30561 + * Controller configurations for various panels.
30563 +static struct panel_settings panels[] =
30565 + { /* Index 0: QVGA 320x240 H:33.3kHz V:110Hz */
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,
30583 + { /* Index 1: VGA 640x480 H:30.3kHz V:58Hz */
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,
30601 + { /* Index 2: SVGA 800x600 H:46.1kHz V:69Hz */
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,
30619 + { /* Index 3: XVGA 1024x768 H:56.2kHz V:70Hz */
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,
30637 + { /* Index 4: XVGA 1280x1024 H:68.5kHz V:65Hz */
30638 + "XVGA_1280x1024",
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,
30655 + { /* Index 5: Samsung 1024x768 TFT */
30656 + "Samsung_1024x768_TFT",
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,
30673 + { /* Index 6: Toshiba 640x480 TFT */
30674 + "Toshiba_640x480_TFT",
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,
30691 + { /* Index 7: Sharp 320x240 TFT */
30692 + "Sharp_320x240_TFT",
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,
30708 + { /* Index 8: Toppoly TD070WGCB2 7" 854x480 TFT */
30709 + "Toppoly_TD070WGCB2",
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,
30725 +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
30726 + { /* Index 9: Focus FS453 TV-Out 640x480 */
30727 + "FS453_640x480 (Composite/S-Video)",
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,
30744 + { /* Index 10: Focus FS453 TV-Out 640x480 */
30745 + "FS453_640x480 (Component Video)",
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,
30762 + { /* Index 11: Focus FS453 TV-Out 640x480 */
30763 + "FS453_640x480 (HDTV)",
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,
30782 +#define NUM_PANELS (sizeof(panels) / sizeof(struct panel_settings))
30784 +static struct window_settings *win;
30785 +static struct panel_settings *panel;
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;
30796 + struct { unsigned red, green, blue, pad; } palette[256];
30798 +#if defined(FBCON_HAS_CFB16)
30799 + u16 fbcon_cmap16[16];
30801 +#if defined(FBCON_HAS_CFB32)
30802 + u32 fbcon_cmap32[16];
30807 +struct au1200fb_par {
30808 + struct fb_var_screeninfo var;
30810 + int line_length; /* in bytes */
30811 + int cmap_len; /* color-map length */
30814 +#ifndef CONFIG_FB_AU1200_DEVS
30815 +#define CONFIG_FB_AU1200_DEVS 1
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];
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);
30830 +void au1200_nocursor(struct display *p, int mode, int xx, int yy){};
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);
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,
30851 +winbpp (unsigned int winctrl1)
30853 + /* how many bytes of memory are needed for each pixel format */
30854 + switch (winctrl1 & LCD_WINCTRL1_FRM)
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;
30875 +fbinfo2index (struct fb_info *fb_info)
30878 + for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i)
30880 + if (fb_info == (struct fb_info *)(&fb_infos[i]))
30883 + printk("au1200fb: ERROR: fbinfo2index failed!\n");
30887 +static void au1200_detect(void)
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 ...
30897 +static int au1200_encode_fix(struct fb_fix_screeninfo *fix,
30898 + const void *_par, struct fb_info_gen *_info)
30900 + struct au1200fb_info *info = (struct au1200fb_info *) _info;
30901 + struct au1200fb_par *par = (struct au1200fb_par *) _par;
30904 + plane = fbinfo2index(info);
30906 + memset(fix, 0, sizeof(struct fb_fix_screeninfo));
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;*/
30922 +static void set_color_bitfields(struct fb_var_screeninfo *var, int plane)
30924 + if (var->bits_per_pixel == 8)
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;
30937 + if (var->bits_per_pixel == 16)
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)
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;
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;
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;
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;
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;
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;
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;
31021 + printk("ERROR: Invalid PIXEL FORMAT!!!\n"); break;
31026 + if (var->bits_per_pixel == 32)
31028 + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
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;
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;
31053 + var->red.msb_right = 0;
31054 + var->green.msb_right = 0;
31055 + var->blue.msb_right = 0;
31056 + var->transp.msb_right = 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);
31066 +static int au1200_decode_var(const struct fb_var_screeninfo *var,
31067 + void *_par, struct fb_info_gen *_info)
31069 + struct au1200fb_par *par = (struct au1200fb_par *)_par;
31072 + plane = fbinfo2index((struct fb_info *)_info);
31075 + * Don't allow setting any of these yet: xres and yres don't
31076 + * make sense for LCD panels.
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) {
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");
31091 + memset(par, 0, sizeof(struct au1200fb_par));
31095 + switch (var->bits_per_pixel) {
31097 + par->var.bits_per_pixel = 8;
31100 + par->var.bits_per_pixel = 16;
31104 + par->var.bits_per_pixel = 32;
31107 + printk("color depth %d bpp not supported\n",
31108 + var->bits_per_pixel);
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;
31118 +static int au1200_encode_var(struct fb_var_screeninfo *var,
31119 + const void *par, struct fb_info_gen *_info)
31121 + *var = ((struct au1200fb_par *)par)->var;
31126 +au1200_get_par(void *_par, struct fb_info_gen *_info)
31130 + index = fbinfo2index((struct fb_info *)_info);
31131 + *(struct au1200fb_par *)_par = fb_pars[index];
31134 +static void au1200_set_par(const void *par, struct fb_info_gen *info)
31136 + /* nothing to do: we don't change any settings */
31139 +static int au1200_getcolreg(unsigned regno, unsigned *red, unsigned *green,
31140 + unsigned *blue, unsigned *transp,
31141 + struct fb_info *info)
31143 + struct au1200fb_info* i = (struct au1200fb_info*)info;
31148 + *red = i->palette[regno].red;
31149 + *green = i->palette[regno].green;
31150 + *blue = i->palette[regno].blue;
31156 +static int au1200_setcolreg(unsigned regno, unsigned red, unsigned green,
31157 + unsigned blue, unsigned transp,
31158 + struct fb_info *info)
31160 + struct au1200fb_info* i = (struct au1200fb_info *)info;
31164 + plane = fbinfo2index((struct fb_info *)info);
31165 + bpp = winbpp(win->w[plane].mode_winctrl1);
31170 + i->palette[regno].red = red;
31171 + i->palette[regno].green = green;
31172 + i->palette[regno].blue = blue;
31175 +#ifdef FBCON_HAS_CFB8
31180 + panel_reg->lcd_pallettebase[regno] = (blue&0x1f) |
31181 + ((green&0x3f)<<5) | ((red&0x1f)<<11);
31184 +#ifdef FBCON_HAS_CFB16
31185 +/* FIX!!!! depends upon pixel format */
31187 + i->fbcon_cmap16[regno] =
31188 + ((red & 0xf800) >> 0) |
31189 + ((green & 0xfc00) >> 5) |
31190 + ((blue & 0xf800) >> 11);
31193 +#ifdef FBCON_HAS_CFB32
31195 + i->fbcon_cmap32[regno] =
31196 + (((u32 )transp & 0xff00) << 16) |
31197 + (((u32 )red & 0xff00) << 8) |
31198 + (((u32 )green & 0xff00)) |
31199 + (((u32 )blue & 0xff00) >> 8);
31203 + printk("unsupported au1200_setcolreg(%d)\n", bpp);
31211 +static int au1200_blank(int blank_mode, struct fb_info_gen *_info)
31213 + struct au1200fb_info *fb_info = (struct au1200fb_info *)_info;
31216 + /* Short-circuit screen blanking */
31217 + if (fb_info->noblanking)
31220 + plane = fbinfo2index((struct fb_info *)_info);
31222 + switch (blank_mode) {
31223 + case VESA_NO_BLANKING:
31224 + /* printk("turn on panel\n"); */
31225 + au1200_setpanel(panel);
31228 + case VESA_VSYNC_SUSPEND:
31229 + case VESA_HSYNC_SUSPEND:
31230 + case VESA_POWERDOWN:
31231 + /* printk("turn off panel\n"); */
31232 + au1200_setpanel(NULL);
31241 +static void au1200_set_disp(const void *unused, struct display *disp,
31242 + struct fb_info_gen *info)
31244 + struct au1200fb_info *fb_info;
31247 + fb_info = (struct au1200fb_info *)info;
31249 + disp->screen_base = (char *)fb_info->fb_virt_start;
31251 + switch (disp->var.bits_per_pixel) {
31252 +#ifdef FBCON_HAS_CFB8
31254 + disp->dispsw = &fbcon_cfb8;
31255 + if (fb_info->nohwcursor)
31256 + fbcon_cfb8.cursor = au1200_nocursor;
31259 +#ifdef FBCON_HAS_CFB16
31261 + disp->dispsw = &fbcon_cfb16;
31262 + disp->dispsw_data = fb_info->fbcon_cmap16;
31263 + if (fb_info->nohwcursor)
31264 + fbcon_cfb16.cursor = au1200_nocursor;
31267 +#ifdef FBCON_HAS_CFB32
31269 + disp->dispsw = &fbcon_cfb32;
31270 + disp->dispsw_data = fb_info->fbcon_cmap32;
31271 + if (fb_info->nohwcursor)
31272 + fbcon_cfb32.cursor = au1200_nocursor;
31276 + disp->dispsw = &fbcon_dummy;
31277 + disp->dispsw_data = NULL;
31283 +au1200fb_mmap(struct fb_info *_fb,
31284 + struct file *file,
31285 + struct vm_area_struct *vma)
31287 + unsigned int len;
31288 + unsigned long start=0, off;
31290 + struct au1200fb_info *fb_info = (struct au1200fb_info *)_fb;
31292 + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
31296 + start = fb_info->fb_phys & PAGE_MASK;
31297 + len = PAGE_ALIGN((start & ~PAGE_MASK) + fb_info->fb_size);
31299 + off = vma->vm_pgoff << PAGE_SHIFT;
31301 + if ((vma->vm_end - vma->vm_start + off) > len) {
31306 + vma->vm_pgoff = off >> PAGE_SHIFT;
31308 + pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
31309 + pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
31311 + /* This is an IO map - tell maydump to skip this VMA */
31312 + vma->vm_flags |= VM_IO;
31314 + if (io_remap_page_range(vma->vm_start, off,
31315 + vma->vm_end - vma->vm_start,
31316 + vma->vm_page_prot)) {
31320 + fb_info->mmaped = 1;
31324 +int au1200_pan_display(const struct fb_var_screeninfo *var,
31325 + struct fb_info_gen *info)
31331 +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
31332 + u_long arg, int con, struct fb_info *info)
31336 + plane = fbinfo2index(info);
31338 + /* printk("au1200fb: ioctl %d on plane %d\n", cmd, plane); */
31340 + if (cmd == 0x46FF)
31342 + au1200_lcd_getset_t iodata;
31344 + if (copy_from_user(&iodata, (void *) arg, sizeof(au1200_lcd_getset_t)))
31347 + switch (iodata.subcmd)
31349 + case AU1200_LCD_GET_WINENABLE:
31350 + iodata.winenable.enable = (lcd->winenable & (1<<plane)) ? 1 : 0;
31352 + case AU1200_LCD_SET_WINENABLE:
31355 + winenable = lcd->winenable;
31356 + winenable &= ~(1<<plane);
31357 + winenable |= (iodata.winenable.enable) ? (1<<plane) : 0;
31358 + lcd->winenable = winenable;
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;
31367 + case AU1200_LCD_SET_WINLOCATION:
31368 + au1200_setlocation(plane, iodata.winlocation.x, iodata.winlocation.y);
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;
31376 + case AU1200_LCD_SET_WINSIZE:
31377 + au1200_setsize(plane, iodata.winsize.hsz, iodata.winsize.vsz);
31379 + case AU1200_LCD_GET_BACKCOLOR:
31380 + iodata.backcolor.color = lcd->backcolor;
31382 + case AU1200_LCD_SET_BACKCOLOR:
31383 + lcd->backcolor = iodata.backcolor.color;
31385 + case AU1200_LCD_GET_COLORKEY:
31386 + iodata.colorkey.key = lcd->colorkey;
31387 + iodata.colorkey.mask = lcd->colorkeymsk;
31389 + case AU1200_LCD_SET_COLORKEY:
31390 + lcd->colorkey = iodata.colorkey.key;
31391 + lcd->colorkeymsk = iodata.colorkey.mask;
31393 + case AU1200_LCD_GET_PANEL:
31394 + iodata.panel.panel = panel_index;
31396 + case AU1200_LCD_SET_PANEL:
31397 + if ((iodata.panel.panel >= 0) && (iodata.panel.panel < NUM_PANELS))
31399 + struct panel_settings *newpanel;
31400 + panel_index = iodata.panel.panel;
31401 + newpanel = &panels[panel_index];
31402 + au1200_setpanel(newpanel);
31407 + return copy_to_user((void *) arg, &iodata, sizeof(au1200_lcd_getset_t)) ? -EFAULT : 0;
31413 +static struct fbgen_hwswitch au1200_switch = {
31415 + au1200_encode_fix,
31416 + au1200_decode_var,
31417 + au1200_encode_var,
31420 + au1200_getcolreg,
31421 + au1200_setcolreg,
31422 + au1200_pan_display,
31427 +static void au1200_setpanel (struct panel_settings *newpanel)
31430 + * Perform global setup/init of LCD controller
31432 + uint32 winenable;
31434 + /* Make sure all windows disabled */
31435 + winenable = lcd->winenable;
31436 + lcd->winenable = 0;
31439 + * Ensure everything is disabled before reconfiguring
31441 + if (lcd->screen & LCD_SCREEN_SEN)
31443 + /* Wait for vertical sync period */
31444 + lcd->intstatus = LCD_INT_SS;
31445 + while ((lcd->intstatus & LCD_INT_SS) == 0)
31448 + lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/
31452 + lcd->intstatus = lcd->intstatus; /*clear interrupts*/
31454 + /*wait for controller to shut down*/
31455 + while ((lcd->intstatus & LCD_INT_SD) == 0);
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.
31462 + if (panel->device_shutdown != NULL) panel->device_shutdown();
31465 + /* Check if only needing to turn off panel */
31466 + if (panel == NULL) return;
31468 + panel = newpanel;
31470 + printk("Panel(%s), %dx%d\n", panel->name, panel->Xres, panel->Yres);
31473 + * Setup clocking if internal LCD clock source (assumes sys_auxpll valid)
31475 + if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
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);
31487 + * Configure panel timings
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;
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;
31507 + * Re-enable screen now that it is configured
31509 + lcd->screen |= LCD_SCREEN_SEN;
31512 + /* Call init of panel */
31513 + if (panel->device_init != NULL) panel->device_init();
31516 +#define D(X) printk("%25s: %08X\n", #X, X)
31518 + D(lcd->horztiming);
31519 + D(lcd->verttiming);
31520 + D(lcd->clkcontrol);
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);
31565 +static int au1200_setsize (int plane, int xres, int yres)
31568 + uint32 winctrl0, winctrl1, winenable;
31571 + /* FIX!!! X*Y can not surpass allocated memory */
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);
31580 + winctrl1 |= (xres << 11);
31581 + winctrl1 |= (yres << 0);
31583 + printk("new winctrl1 %08X\n", winctrl1);
31585 + /*winenable = lcd->winenable & (1 << plane); */
31586 + /*lcd->winenable &= ~(1 << plane); */
31587 + lcd->window[plane].winctrl1 = winctrl1;
31588 + /*lcd->winenable |= winenable; */
31593 +static int au1200_setlocation (int plane, int xpos, int ypos)
31595 + uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
31598 + /* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
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);
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)
31610 + /* Off-screen to the right */
31611 + xsz = panel->Xres - xpos; /* off by 1 ??? */
31612 + /*printk("off screen right\n");*/
31615 + if ((ypos + win->w[plane].yres) > panel->Yres)
31617 + /* Off-screen to the bottom */
31618 + ysz = panel->Yres - ypos; /* off by 1 ??? */
31619 + /*printk("off screen bottom\n");*/
31624 + /* Off-screen to the left */
31625 + xsz = win->w[plane].xres + xpos;
31626 + fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
31628 + /*printk("off screen left\n");*/
31633 + /* Off-screen to the top */
31634 + ysz = win->w[plane].yres + ypos;
31635 + fb_offset += ((0 - ypos) * fb_pars[plane].line_length);
31637 + /*printk("off screen top\n");*/
31640 + /* record settings */
31641 + win->w[plane].xpos = xpos;
31642 + win->w[plane].ypos = ypos;
31646 + winctrl0 |= (xpos << 21);
31647 + winctrl0 |= (ypos << 10);
31648 + winctrl1 |= (xsz << 11);
31649 + winctrl1 |= (ysz << 0);
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;
31664 +static void au1200_setmode(int plane)
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 */
31672 + au1200_setlocation(plane, win->w[plane].xpos, win->w[plane].ypos);
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
31682 + lcd->winenable |= win->w[plane].mode_winenable;
31687 +static unsigned long
31688 +au1200fb_alloc_fbmem (unsigned long size)
31690 + /* __get_free_pages() fulfills a max request of 2MB */
31691 + /* do multiple requests to obtain large contigous mem */
31692 +#define MAX_GFP 0x00200000
31694 + unsigned long mem, amem, alloced = 0, allocsize;
31697 + allocsize = (size < MAX_GFP) ? size : MAX_GFP;
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;
31704 + /* Get remaining, contiguous chunks */
31705 + while (alloced < size)
31707 + amem = (unsigned long )
31708 + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
31710 + alloced += allocsize;
31712 + /* check for contiguous mem alloced */
31713 + if ((amem == 0) || (amem + allocsize) != mem)
31721 +int __init au1200fb_init(void)
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;
31731 + * Get the panel information/display mode
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);
31739 + panel = &panels[panel_index];
31740 + win = &windows[window_index];
31742 + printk("au1200fb: Panel %d %s\n", panel_index, panel->name);
31743 + printk("au1200fb: Win %d %s\n", window_index, win->name);
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;
31752 + /* Setup Color Key - FIX!!! */
31753 + lcd->colorkey = win->mode_colorkey;
31754 + lcd->colorkeymsk = win->mode_colorkeymsk;
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;
31764 + /* Register each plane as a frame buffer device */
31765 + for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane)
31767 + fb_info = &fb_infos[plane];
31768 + disp = &disps[plane];
31769 + par = &fb_pars[plane];
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;
31778 + par->var.xres_virtual = win->w[plane].xres;
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 */
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.
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");
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));
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);
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;
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;
31819 + fb_info->nohwcursor = 1;
31820 + fb_info->noblanking = 1;
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);
31828 + /* Turn on plane */
31829 + au1200_setmode(plane);
31831 + if (register_framebuffer(&fb_info->gen.info) < 0)
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);
31839 + /* uncomment this if your driver cannot be unloaded */
31840 + /* MOD_INC_USE_COUNT; */
31844 +void au1200fb_setup(char *options, int *ints)
31848 + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
31850 + if (!options || !*options)
31853 + for(this_opt=strtok(options, ","); this_opt;
31854 + this_opt=strtok(NULL, ",")) {
31855 + if (!strncmp(this_opt, "panel:", 6)) {
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;
31866 + else if (strcmp(this_opt, "bs") == 0) {
31867 + panel_index = board_au1200fb_panel();
31870 + for (i=0; i<num_panels; i++) {
31871 + if (!strcmp(this_opt, panels[i].name)) {
31877 + else if (!strncmp(this_opt, "nohwcursor", 10)) {
31878 + printk("nohwcursor\n");
31879 + fb_infos[0].nohwcursor = 1;
31883 + printk("au1200fb: Panel %d %s\n", panel_index,
31884 + panels[panel_index].name);
31890 +MODULE_LICENSE("GPL");
31891 +MODULE_DESCRIPTION("Au1200 LCD framebuffer driver");
31893 +void au1200fb_cleanup(struct fb_info *info)
31895 + unregister_framebuffer(info);
31898 +module_init(au1200fb_init);
31899 +module_exit(au1200fb_cleanup);
31900 +#endif /* MODULE */
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
31908 + * BRIEF MODULE DESCRIPTION
31909 + * Hardware definitions for the Au1200 LCD controller
31911 + * Copyright 2004 AMD
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.
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.
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.
31935 +#ifndef _AU1200LCD_H
31936 +#define _AU1200LCD_H
31938 +/********************************************************************/
31939 +#define AU1200_LCD_ADDR 0xB5000000
31941 +#define uint8 unsigned char
31942 +#define uint32 unsigned int
31944 +typedef volatile struct
31946 + uint32 reserved0;
31948 + uint32 backcolor;
31949 + uint32 horztiming;
31950 + uint32 verttiming;
31951 + uint32 clkcontrol;
31954 + uint32 reserved1;
31955 + uint32 winenable;
31957 + uint32 colorkeymsk;
31960 + uint32 cursorctrl;
31961 + uint32 cursorpos;
31962 + uint32 cursorcolor0;
31963 + uint32 cursorcolor1;
31964 + uint32 cursorcolor2;
31965 + uint32 cursorcolor3;
31967 + uint32 intstatus;
31968 + uint32 intenable;
31971 + uint32 reserved2[(0x0100-0x0058)/4];
31979 + uint32 winbufctrl;
31980 + uint32 winreserved0;
31981 + uint32 winreserved1;
31984 + uint32 reserved3[(0x0400-0x0180)/4];
31986 + uint32 palette[(0x0800-0x0400)/4];
31988 + uint8 cursorpattern[256];
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)
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)
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)
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)
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)
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)
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)
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)
32099 +/* lcd windows buffer control */
32100 +#define LCD_WINBUFCTRL_DB (1<<1)
32101 +#define LCD_WINBUFCTRL_DBN (1<<0)
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)
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)
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)
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)
32143 +#define LCD_PWMDIV_EN (1<<31)
32144 +#define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
32145 +#define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
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)
32154 +#define LCD_HWCCON_EN (1<<0)
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)
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)
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)
32191 +#define LCD_OUTMASK_MASK (0x00FFFFFF)
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
32199 if [ "$CONFIG_HP300" = "y" ]; then
32200 define_bool CONFIG_FB_HP300 y
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
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
32213 + if [ "$CONFIG_SOC_AU1100" = "y" ]; then
32214 + bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
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
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
32231 - if [ "$CONFIG_SOC_AU1100" = "y" ]; then
32232 - bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
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 },
32253 +#ifdef CONFIG_FB_AU1200
32254 + { "au1200fb", au1200fb_init, au1200fb_setup },
32256 #ifdef CONFIG_FB_IT8181
32257 { "it8181fb", it8181fb_init, it8181fb_setup },
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
32264 + * linux/drivers/video/ims332.h
32266 + * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
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.
32272 +#include <linux/types.h>
32275 + * IMS332 16-bit wide, 128-bit aligned registers.
32277 +struct _ims332_reg {
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];
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];
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];
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.
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));
32364 +static inline void ims332_control_reg_bits(struct ims332_regs *regs, u32 mask,
32367 + volatile u16 *ctr = &(regs->r.config_control_a.r);
32368 + volatile u16 *ctw = &(regs->w.config_control_a.r);
32374 + ctrl |= ((regs->rw.boot.r << 8) & 0x00ff0000);
32375 + ctrl |= val & mask;
32376 + ctrl &= ~(~val & mask);
32378 + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
32380 + *ctw = ctrl & 0xffff;
32383 +/* FIXME: This is maxinefb specific. */
32384 +static inline void ims332_bootstrap(struct ims332_regs *regs)
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;
32389 + /* bootstrap sequence */
32391 + regs->rw.boot.r = 0;
32395 + /* init control A register */
32397 + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
32399 + *ctw = ctrl & 0xffff;
32402 +static inline void ims332_blank_screen(struct ims332_regs *regs, int blank)
32404 + ims332_control_reg_bits(regs, IMS332_CTRL_A_FORCE_BLANKING,
32405 + blank ? IMS332_CTRL_A_FORCE_BLANKING : 0);
32408 +static inline void ims332_set_color_depth(struct ims332_regs *regs, u32 depth)
32411 + u32 mask = (IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING
32412 + | IMS332_CTRL_A_DELAYED_SAMPLING
32413 + | IMS332_CTRL_A_BITS_PER_PIXEL);
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;
32424 + ims332_control_reg_bits(regs, mask, dp);
32426 + if (depth <= 8) {
32427 + volatile u16 *pmask = &(regs->w.pixel_address_mask.r);
32428 + u32 dm = (1 << depth) - 1;
32431 + regs->rw.boot.r = dm << 8;
32433 + *pmask = dm << 8 | dm;
32437 +static inline void ims332_set_screen_top(struct ims332_regs *regs, u16 top)
32439 + volatile u16 *st = &(regs->w.screen_top.r);
32442 + *st = top & 0xffff;
32445 +static inline void ims332_enable_cursor(struct ims332_regs *regs, int on)
32447 + ims332_control_reg_bits(regs, IMS332_CTRL_A_CURSOR_DISABLE,
32448 + on ? 0 : IMS332_CTRL_A_CURSOR_DISABLE);
32451 +static inline void ims332_position_cursor(struct ims332_regs *regs,
32454 + volatile u16 *cp = &(regs->w.cursor_start.r);
32455 + u32 val = ((x & 0xfff) << 12) | (y & 0xfff);
32457 + if (x > 2303 || y > 2303)
32461 + regs->rw.boot.r = (val >> 8) & 0xff00;
32463 + *cp = val & 0xffff;
32466 +static inline void ims332_set_font(struct ims332_regs *regs, u8 fgc,
32467 + u16 width, u16 height)
32469 + volatile u16 *cp0 = &(regs->w.cursor_color_palette0.r);
32473 + for (i = 0; i < 0x200; i++) {
32474 + volatile u16 *cram = &(regs->w.cursor_ram[i].r);
32476 + if (height << 6 <= i << 3)
32478 + else if (width <= i % 8 << 3)
32480 + else if (((width >> 3) & 0xffff) > i % 8)
32483 + *cram = 0x5555 & ~(0xffff << (width % 8 << 1));
32486 + regs->rw.boot.r = fgc << 8;
32488 + *cp0 = fgc << 8 | fgc;
32491 +static inline void ims332_read_cmap(struct ims332_regs *regs, u8 reg,
32492 + u8* red, u8* green, u8* blue)
32494 + volatile u16 *rptr = &(regs->r.color_palette[reg].r);
32499 + *red = val & 0xff;
32500 + *green = (val >> 8) & 0xff;
32502 + *blue = (regs->rw.boot.r >> 8) & 0xff;
32505 +static inline void ims332_write_cmap(struct ims332_regs *regs, u8 reg,
32506 + u8 red, u8 green, u8 blue)
32508 + volatile u16 *wptr = &(regs->w.color_palette[reg].r);
32511 + regs->rw.boot.r = blue << 8;
32513 + *wptr = (green << 8) + red;
32516 +static inline void ims332_dump_regs(struct ims332_regs *regs)
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 *)(®s->r) + sizeof(struct _ims332_reg) * i);
32528 + val |= regs->rw.boot.r << 8;
32531 + printk("\n%02x:", i);
32532 + printk(" %06x", val);
32534 + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG,
32535 + IMS332_CTRL_A_BOOT_ENABLE_VTG);
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
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
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
32554 - * linux/drivers/video/maxinefb.h
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.
32563 -#include <asm/addrspace.h>
32566 - * IMS332 video controller register base address
32568 -#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000)
32571 - * Begin of DECstation 5000/xx onboard framebuffer memory, default resolution
32574 -#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000)
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
32583 -#define IMS332_REG_CURSOR_RAM 0x200 /* hardware cursor bitmap */
32586 - * The color palette entries have the form 0x00BBGGRR
32588 -#define IMS332_REG_COLOR_PALETTE 0x100 /* color palette, 256 entries */
32589 -#define IMS332_REG_CURSOR_COLOR_PALETTE 0x0a1 /* cursor color palette, */
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
32595 #include <linux/module.h>
32596 #include <linux/slab.h>
32598 +#include <asm/io.h>
32599 #include <asm/uaccess.h>
32600 #include <asm/system.h>
32601 #include <asm/page.h>
32603 static inline void newport_render_background(int xstart, int ystart,
32604 int xend, int yend, int ci)
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
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,
32620 @@ -107,7 +108,7 @@
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,
32629 @@ -115,13 +116,13 @@
32630 linux_logo_blue[i]);
32634 + newport_wait(npregs);
32635 npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
32636 NPORT_DMODE0_CHOST);
32638 npregs->set.xystarti = ((newport_xsize - LOGO_W) << 16) | (0);
32639 npregs->set.xyendi = ((newport_xsize - 1) << 16);
32641 + newport_wait(npregs);
32643 for (i = 0; i < LOGO_W * LOGO_H; i++)
32644 npregs->go.hostrw0 = linux_logo[i] << 24;
32645 @@ -133,7 +134,7 @@
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;
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;
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;
32681 @@ -216,12 +217,12 @@
32682 npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
32683 NPORT_DMODE_W2 | VC2_PROTOCOL);
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;
32695 } while ((treg & 0x8000) == 0);
32696 @@ -291,16 +292,16 @@
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;
32705 - if (newport_wait()) {
32708 + if (newport_wait(npregs))
32711 npregs->set.xstarti = TESTVAL;
32712 if (npregs->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
32716 for (i = 0; i < MAX_NR_CONSOLES; i++)
32717 font_data[i] = FONT_DATA;
32718 @@ -310,6 +311,10 @@
32719 newport_get_screensize();
32721 return "SGI Newport";
32724 + iounmap((void *)npregs);
32728 static void newport_init(struct vc_data *vc, int init)
32729 @@ -363,7 +368,7 @@
32730 (charattr & 0xf0) >> 4);
32732 /* Set the color and drawing mode. */
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);
32743 + newport_wait(npregs);
32745 /* Go, baby, go... */
32747 @@ -396,7 +401,7 @@
32748 xpos + ((count - 1) << 3), ypos,
32749 (charattr & 0xf0) >> 4);
32752 + newport_wait(npregs);
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];
32761 + newport_wait(npregs);
32763 /* Set coordinates for bitmap operation. */
32764 npregs->set.xystarti =
32765 @@ -689,7 +694,7 @@
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
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
32813 static int __init newport_console_init(void)
32815 take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
32820 static void __exit newport_console_exit(void)
32822 give_up_console(&newport_con);
32823 + iounmap((void *)npregs);
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
32831 #include <linux/console.h>
32832 #include <asm/io.h>
32835 +#include <asm/dec/tc.h>
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; }
32843 #include <video/fbcon.h>
32844 #include <video/fbcon-cfb8.h>
32845 #include <video/fbcon-cfb32.h>
32846 @@ -84,10 +93,10 @@
32849 static unsigned int deep_presets[4] = {
32859 static unsigned int rasterop_presets[4] = {
32860 @@ -131,6 +140,13 @@
32862 FB_VMODE_NONINTERLACED
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
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 @@
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 */
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));
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)
32896 struct pci_dev *pdev;
32899 pdev = pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA, NULL);
32901 + slot = search_tc_card("PMAGD");
32902 + if (!pdev && slot < 0)
32905 /* divine board type */
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
32912 + fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start,
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);
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;
32931 /* setup framebuffer */
32933 @@ -950,40 +982,62 @@
32934 fb_info.gen.fbhw = &tgafb_hwswitch;
32935 fb_info.gen.fbhw->detect();
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));
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));
32947 + printk (KERN_INFO "tgafb: SFB+ detected, rev=0x%02x\n",
32948 + fb_info.tga_chip_rev);
32951 switch (fb_info.tga_type)
32953 case TGA_TYPE_8PLANE:
32954 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
32956 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
32958 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E1");
32961 case TGA_TYPE_24PLANE:
32962 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
32964 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
32966 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E2");
32969 case TGA_TYPE_24PLUSZ:
32970 - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
32972 + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
32974 + strcpy (fb_info.gen.info.modename,"Digital ZLX-E3");
32978 /* This should give a reasonable default video mode */
32980 if (!default_var_valid) {
32981 - default_var = tgafb_predefined[0].var;
32983 + default_var = tgafb_predefined[0].var;
32985 + default_var = tgafb_predefined[1].var;
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) {
32995 + release_tc_card(slot);
32997 - printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
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);
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
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 @@
33025 + /* Executables without an interpreter also need a personality */
33026 + SET_PERSONALITY(elf_ex, ibcs2_interpreter);
33029 /* Flush all traces of the currently running executable */
33030 @@ -1208,7 +1211,11 @@
33032 elf.e_phoff = sizeof(elf);
33034 +#ifdef ELF_CORE_EFLAGS
33035 + elf.e_flags = ELF_CORE_EFLAGS;
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
33046 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
33047 ret |= fsync_inode_data_buffers(inode);
33049 - ext3_force_commit(inode->i_sb);
33050 + ret |= ext3_force_commit(inode->i_sb);
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 @@
33059 static int ext3_sync_fs(struct super_block *sb)
33065 target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
33066 - log_wait_commit(EXT3_SB(sb)->s_journal, target);
33068 + err = log_wait_commit(EXT3_SB(sb)->s_journal, target);
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
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();
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;
33090 if (filp->f_op->open)
33091 return filp->f_op->open(dentry->d_inode, filp);
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
33097 struct buffer_head *wbuf[64];
33102 unsigned long blocknr;
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)))
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)))
33120 lock_journal(journal);
33121 spin_lock(&journal_datalist_lock);
33122 continue; /* List may have changed */
33123 @@ -351,6 +355,9 @@
33125 spin_unlock(&journal_datalist_lock);
33128 + __journal_abort_hard(journal);
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)))
33139 lock_journal(journal);
33140 goto wait_for_iobuf;
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)))
33148 lock_journal(journal);
33149 goto wait_for_ctlbuf;
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)))
33157 put_bh(bh); /* One for getblk() */
33158 journal_unlock_journal_head(descriptor);
33160 @@ -661,6 +674,9 @@
33162 skip_commit: /* The journal should be unlocked by now. */
33165 + __journal_abort_hard(journal);
33167 /* Call any callbacks that had been registered for handles in this
33168 * transaction. It is up to the callback to free any allocated
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.
33177 -void log_wait_commit (journal_t *journal, tid_t tid)
33178 +int log_wait_commit (journal_t *journal, tid_t tid)
33183 #ifdef CONFIG_JBD_DEBUG
33184 lock_journal(journal);
33185 @@ -600,6 +602,12 @@
33186 sleep_on(&journal->j_wait_done_commit);
33190 + if (unlikely(is_journal_aborted(journal))) {
33191 + printk(KERN_EMERG "journal commit I/O error\n");
33198 @@ -1326,7 +1334,7 @@
33200 /* Wait for the log commit to complete... */
33202 - log_wait_commit(journal, transaction->t_tid);
33203 + err = log_wait_commit(journal, transaction->t_tid);
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.
33213 if (handle->h_sync && !(current->flags & PF_MEMALLOC))
33214 - log_wait_commit(journal, tid);
33215 + err = log_wait_commit(journal, tid);
33219 @@ -1509,7 +1509,7 @@
33222 handle->h_sync = 1;
33223 - journal_stop(handle);
33224 + ret = journal_stop(handle);
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
33233 - * Copyright (c) International Business Machines Corp., 2000-2001
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.
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.
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
33249 -#ifndef _H_JFS_DEFRAGFS
33250 -#define _H_JFS_DEFRAGFS
33253 - * defragfs parameter list
33256 - uint flag; /* 4: */
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: */
33270 -#define DEFRAGFS_SYNC 0x80000000
33271 -#define DEFRAGFS_COMMIT 0x40000000
33272 -#define DEFRAGFS_RELOCATE 0x10000000
33274 -#define INODE_TYPE 0x0000F000 /* IFREG or IFDIR */
33276 -#define EXTENT_TYPE 0x000000ff
33277 -#define DTPAGE 0x00000001
33278 -#define XTPAGE 0x00000002
33279 -#define DATAEXT 0x00000004
33280 -#define EAEXT 0x00000008
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);
33291 ip->i_nlink = 1; /* Don't want iput() deleting it */
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 */
33299 ip->i_nlink = 1; /* Don't want iput() deleting it */
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);
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);
33320 + lock_metapage(mp);
33321 + spin_unlock(&meta_lock);
33322 if (test_bit(META_discard, &mp->flag)) {
33324 jfs_error(inode->i_sb,
33325 @@ -518,7 +518,6 @@
33329 - /* Releasing spinlock, we have to check mp->count later */
33330 set_bit(META_stale, &mp->flag);
33331 spin_unlock(&meta_lock);
33333 @@ -555,12 +554,6 @@
33334 list_del(&mp->synclist);
33335 LOGSYNC_UNLOCK(log);
33338 - /* Someone else is trying to get this metpage */
33339 - unlock_metapage(mp);
33340 - spin_unlock(&meta_lock);
33343 remove_from_hash(mp, meta_hash(mp->mapping, mp->index));
33344 spin_unlock(&meta_lock);
33346 @@ -589,12 +582,8 @@
33347 mp = search_hash(hash_ptr, mapping, lblock);
33349 if (test_bit(META_stale, &mp->flag)) {
33350 - /* Racing with release_metapage */
33352 - lock_metapage(mp);
33353 spin_unlock(&meta_lock);
33354 - /* racing release_metapage should be done now */
33355 - release_metapage(mp);
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
33365 - * Copyright (c) International Business Machines Corp., 2000-2002
33366 + * Copyright (C) International Business Machines Corp., 2000-2005
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
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 @@
33383 + static int warn_again = 5; /* Only warn up to 5 times total */
33384 + int warn = !!warn_again; /* once per string */
33386 - for (i = 0; (i < len) && from[i]; i++) {
33389 - codepage->uni2char(le16_to_cpu(from[i]), &to[outlen],
33390 - NLS_MAX_CHARSET_SIZE);
33391 - if (charlen > 0) {
33392 - outlen += charlen;
33394 - to[outlen++] = '?';
33396 + for (i = 0; (i < len) && from[i]; i++) {
33399 + codepage->uni2char(le16_to_cpu(from[i]),
33401 + NLS_MAX_CHARSET_SIZE);
33403 + outlen += charlen;
33405 + to[outlen++] = '?';
33408 + for (i = 0; (i < len) && from[i]; i++) {
33409 + if (le16_to_cpu(from[i]) & 0xff00) {
33414 + "non-latin1 character 0x%x found in JFS file name\n",
33415 + le16_to_cpu(from[i]));
33417 + "mount with iocharset=utf8 to access\n");
33422 + to[i] = (char) (le16_to_cpu(from[i]));
33429 @@ -56,20 +79,27 @@
33430 * FUNCTION: Convert character string to unicode string
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)
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);
33448 + for (i = 0; len && *from; i++, from += charlen, len -= charlen)
33450 + charlen = codepage->char2uni(from, len, &to[i]);
33451 + if (charlen < 1) {
33452 + jfs_err("jfs_strtoUCS: char2uni returned %d.",
33454 + jfs_err("charset = %s, char = 0x%x",
33455 + codepage->charset, *from);
33460 + for (i = 0; (i < len) && from[i]; i++)
33461 + to[i] = (wchar_t) from[i];
33466 * FUNCTION: Allocate and translate to unicode string
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)
33473 + struct nls_table *nls_tab = JFS_SBI(dentry->d_sb)->nls_tab;
33474 int length = dentry->d_name.len;
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
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
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
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 *);
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
33503 * search parent directory for entry/freespace
33504 * (dtSearch() returns parent directory page pinned)
33506 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33507 + if ((rc = get_UCSname(&dname, dentry)))
33511 @@ -195,7 +195,7 @@
33512 * search parent directory for entry/freespace
33513 * (dtSearch() returns parent directory page pinned)
33515 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33516 + if ((rc = get_UCSname(&dname, dentry)))
33520 @@ -318,9 +318,8 @@
33524 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) {
33525 + if ((rc = get_UCSname(&dname, dentry)))
33529 tid = txBegin(dip->i_sb, 0);
33531 @@ -437,7 +436,7 @@
33533 jfs_info("jfs_unlink: dip:0x%p name:%s", dip, dentry->d_name.name);
33535 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33536 + if ((rc = get_UCSname(&dname, dentry)))
33540 @@ -780,7 +779,7 @@
33542 * scan parent directory for entry/freespace
33544 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(ip->i_sb)->nls_tab)))
33545 + if ((rc = get_UCSname(&dname, dentry)))
33548 if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
33549 @@ -865,7 +864,7 @@
33550 * (dtSearch() returns parent directory page pinned)
33553 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
33554 + if ((rc = get_UCSname(&dname, dentry)))
33558 @@ -1044,12 +1043,10 @@
33559 old_ip = old_dentry->d_inode;
33560 new_ip = new_dentry->d_inode;
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)))
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)))
33573 @@ -1301,7 +1298,7 @@
33575 jfs_info("jfs_mknod: %s", dentry->d_name.name);
33577 - if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dir->i_sb)->nls_tab)))
33578 + if ((rc = get_UCSname(&dname, dentry)))
33581 ip = ialloc(dir, mode);
33582 @@ -1376,8 +1373,7 @@
33583 else if (strcmp(name, "..") == 0)
33584 inum = PARENT(dip);
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
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
33601 * This program is free software; you can redistribute it and/or modify
33602 @@ -155,8 +155,10 @@
33603 rc = jfs_umount(sb);
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;
33615 @@ -182,7 +184,7 @@
33616 static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
33619 - void *nls_map = NULL;
33620 + void *nls_map = (void *)-1; /* -1: no change; NULL: none */
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)
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);
33633 - printk(KERN_ERR "JFS: charset not found\n");
33636 + if (!strcmp(value, "none"))
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 @@
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;
33655 @@ -260,7 +261,7 @@
33657 printk(KERN_ERR "JFS: %s needs an argument\n", this_char);
33660 + if (nls_map && nls_map != (void *) -1)
33661 unload_nls(nls_map);
33664 @@ -328,6 +329,8 @@
33665 /* initialize the mount flag and determine the default error handler */
33666 flag = JFS_ERR_REMOUNT_RO;
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)) {
33673 @@ -378,7 +381,7 @@
33677 - if (!sbi->nls_tab)
33678 + if (sbi->nls_tab == (void *) -1)
33679 sbi->nls_tab = load_nls_default();
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;
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
33701 +#if CONFIG_BLK_DEV_MD
33702 +extern void md_autodetect_dev(kdev_t dev);
33706 int sgi_partition(struct gendisk *hd, struct block_device *bdev, unsigned long first_sector, int current_minor)
33708 int i, csum, magic;
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));
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 @@
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),
33738 task->it_real_value,
33739 - task->start_time,
33740 + hz_to_std(task->start_time),
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 @@
33746 len = sprintf(buffer,
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));
33753 for (i = 0 ; i < smp_num_cpus; i++)
33754 len += sprintf(buffer + len, "cpu%d %lu %lu\n",
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)]));
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 @@
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);
33778 @@ -279,7 +282,7 @@
33780 memset(&prstatus, 0, sizeof(struct elf_prstatus));
33782 - nhdr->p_filesz = notesize(¬es[0]);
33783 + nhdr->p_filesz += notesize(¬es[0]);
33784 bufp = storenote(¬es[0], bufp);
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);
33791 - nhdr->p_filesz = notesize(¬es[1]);
33792 + nhdr->p_filesz += notesize(¬es[1]);
33793 bufp = storenote(¬es[1], bufp);
33795 /* set up the task structure */
33796 @@ -305,7 +308,7 @@
33797 notes[2].datasz = sizeof(struct task_struct);
33798 notes[2].data = current;
33800 - nhdr->p_filesz = notesize(¬es[2]);
33801 + nhdr->p_filesz += notesize(¬es[2]);
33802 bufp = storenote(¬es[2], bufp);
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 @@
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;
33817 for (i = 0 ; i < smp_num_cpus; i++) {
33818 int cpu = cpu_logical_map(i), j;
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",
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 @@
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>
33855 void proc_tty_register_driver(struct tty_driver *driver)
33856 @@ -152,7 +152,7 @@
33860 - * This function is called by unregister_tty_driver()
33861 + * This function is called by tty_unregister_driver()
33863 void proc_tty_unregister_driver(struct tty_driver *driver)
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
33872 +int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count)
33874 + struct inode *inode;
33877 + if (unlikely(count > file->f_maxcount))
33882 + if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
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);
33894 loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
33897 @@ -168,8 +190,8 @@
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);
33906 ssize_t (*read)(struct file *, char *, size_t, loff_t *);
33908 @@ -193,9 +215,7 @@
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);
33917 ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
33919 @@ -224,7 +244,6 @@
33923 - struct inode *inode;
33926 * First get the "struct iovec" from user memory and
33927 @@ -275,12 +294,11 @@
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);
33942 fnv = (type == VERIFY_WRITE ? file->f_op->readv : file->f_op->writev);
33944 @@ -383,8 +401,8 @@
33946 if (!(file->f_mode & FMODE_READ))
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);
33955 @@ -414,8 +432,8 @@
33957 if (!(file->f_mode & FMODE_WRITE))
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);
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
33974 +# define hz_to_std(a) (a)
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)
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
33999 +#define hz_to_std(a) (a)
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
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
34013 * Based on <asm-i386/param.h>.
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
34020 +#include <linux/config.h>
34023 +#define hz_to_std(a) (a)
34026 #define EXEC_PAGESIZE 65536
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
34037 +#define hz_to_std(a) (a)
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
34046 * 675 Mass Ave, Cambridge, MA 02139, USA.
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
34056 #ifndef __AU1000_GPIO_H
34057 #define __AU1000_GPIO_H
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)
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)
34071 +/* set this major numer same as the CRIS GPIO driver */
34072 +#define AU1X00_GPIO_MAJOR (120)
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)
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)
34086 +#define AU1X00_GPIO_NAME "gpio"
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)
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)
34114 + * pin to minor mapping.
34115 + * GPIO0-GPIO31, minor=0-31.
34116 + * GPIO200-GPIO215, minor=32-47.
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;
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;
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);
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);
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)
34167 -/* SDRAM Controller */
34169 + * SDRAM Register Offsets
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
34176 -#define MEM_SDADDR0 0xB400000C
34177 -#define MEM_SDADDR1 0xB4000010
34178 -#define MEM_SDADDR2 0xB4000014
34180 -#define MEM_SDREFCFG 0xB4000018
34181 -#define MEM_SDPRECMD 0xB400001C
34182 -#define MEM_SDAUTOREF 0xB4000020
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)
34203 +/*typedef volatile struct
34212 + uint32 sdautoref;
34223 + * MEM_SDMODE register content definitions
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)
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)
34257 + * MEM_SDADDR register contents definitions
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)
34266 + * MEM_SDREFCFG register content definitions
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)
34277 +/***********************************************************************/
34280 + * Au1550 SDRAM Register Offsets
34283 +/***********************************************************************/
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
34308 +/*typedef volatile struct
34311 + uint32 reserved0;
34313 + uint32 reserved1;
34315 + uint32 reserved2[3];
34317 + uint32 reserved3;
34319 + uint32 reserved4;
34321 + uint32 reserved5[3];
34322 + uint32 sdconfiga;
34323 + uint32 reserved6;
34324 + uint32 sdconfigb;
34325 + uint32 reserved7;
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];
34337 + uint32 reserved13;
34339 + uint32 reserved14;
34341 + uint32 reserved15[11];
34343 + uint32 reserved16;
34344 + uint32 sdautoref;
34345 + uint32 reserved17;
34353 + * Physical base addresses for integrated peripherals
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
34391 +/********************************************************************/
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
34431 +/********************************************************************/
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
34470 +/***********************************************************************/
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
34505 +/***********************************************************************/
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
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 */
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 */
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
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 */
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 */
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
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
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 */
34690 #define AU1000_LAST_INTC0_INT 31
34691 +#define AU1000_LAST_INTC1_INT 63
34692 #define AU1000_MAX_INTR 63
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)
34702 +#ifndef CONFIG_SOC_AU1200
34704 /* USB Host Controller */
34705 #define USB_OHCI_LEN 0x00100000
34707 @@ -773,6 +1135,8 @@
34708 #define USBDEV_ENABLE (1<<1)
34709 #define USBDEV_CE (1<<0)
34711 +#endif /* !CONFIG_SOC_AU1200 */
34713 /* Ethernet Controllers */
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))
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)
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
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 @@
34766 +#ifndef _LANGUAGE_ASSEMBLY
34767 +typedef volatile struct
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
34813 +static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
34816 /* Processor information base on prid.
34817 * Copied from PowerPC.
34819 +#ifndef _LANGUAGE_ASSEMBLY
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[];
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
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...
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)
34854 +#ifdef CONFIG_MIPS_DB1000
34855 +#define SOCK1_DECODE (1<<26)
34857 +#ifdef CONFIG_MIPS_DB1500
34858 +#define SOCK1_DECODE (1<<26)
34860 +#ifdef CONFIG_MIPS_DB1100
34861 +#define SOCK1_DECODE (1<<26)
34863 +#ifdef CONFIG_MIPS_DB1550
34864 +#define SOCK1_DECODE (1<<26)
34866 +#ifdef CONFIG_MIPS_DB1200
34867 +#define SOCK1_DECODE (1<<26)
34869 +#ifdef CONFIG_MIPS_PB1550
34870 +#define SOCK1_DECODE (1<<26)
34872 +#ifdef CONFIG_MIPS_PB1200
34873 +#define SOCK1_DECODE (1<<26)
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)
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
34891 -#define NUM_AU1100_MMC_CONTROLLERS 2
34894 -#define AU1100_SD_IRQ 2
34896 +#if defined(CONFIG_SOC_AU1100)
34897 +#define NUM_MMC_CONTROLLERS 2
34898 +#define AU1X_MMC_INT AU1100_SD_INT
34901 +#if defined(CONFIG_SOC_AU1200)
34902 +#define NUM_MMC_CONTROLLERS 2
34903 +#define AU1X_MMC_INT AU1200_SD_INT
34906 #define SD0_BASE 0xB0600000
34907 #define SD1_BASE 0xB0680000
34913 * Register offsets.
34915 @@ -201,5 +207,12 @@
34916 #define SD_CMD_RT_1B (0x00810000)
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_);
34926 #endif /* __ASM_AU1100_MMC_H */
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
34932 #define DDMA_GLOBAL_BASE 0xb4003000
34933 #define DDMA_CHANNEL_BASE 0xb4002000
34935 -typedef struct dbdma_global {
34936 +typedef volatile struct dbdma_global {
34942 /* The structure of a DMA Channel.
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 */
34950 /* "Standard" DDMA Descriptor.
34951 * Must be 32-byte aligned.
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
34967 + u32 sw_reserved[6];
34968 } au1x_ddma_desc_t;
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 */
34975 +#define SW_STATUS_INUSE (1<<0)
34977 /* Command 0 device IDs.
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)
35000 #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
35001 #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
35002 @@ -277,6 +289,43 @@
35004 #define NUM_DBDMA_CHANS 16
35007 + * Ddma API definitions
35008 + * FIXME: may not fit to this header file
35010 +typedef struct dbdma_device_table {
35014 + u32 dev_devwidth;
35015 + u32 dev_physaddr; /* If FIFO */
35016 + u32 dev_intlevel;
35017 + u32 dev_intpolarity;
35021 +typedef struct dbdma_chan_config {
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 *);
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 */
35043 /* External functions for drivers to use.
35045 /* Use this to allocate a dbdma channel. The device ids are one of the
35046 @@ -299,8 +348,8 @@
35048 /* Put buffers on source/destination descriptors.
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);
35055 /* Get a buffer from the destination descriptor.
35057 @@ -314,5 +363,25 @@
35058 void au1xxx_dbdma_chan_free(u32 chanid);
35059 void au1xxx_dbdma_dump(u32 chanid);
35061 +u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
35063 +u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
35066 + Some compatibilty macros --
35067 + Needed to make changes to API without breaking existing drivers
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)
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)
35076 + * Flags for the put_source/put_dest functions.
35078 +#define DDMA_FLAGS_IE (1<<0)
35079 +#define DDMA_FLAGS_NOIE (1<<1)
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
35089 +#ifndef __AU1XXX_GPIO_H
35090 +#define __AU1XXX_GPIO_H
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);
35097 +typedef volatile struct
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
35113 #define PSC3_BASE_ADDR 0xb0d00000
35116 +#ifdef CONFIG_SOC_AU1200
35117 +#define PSC0_BASE_ADDR 0xb1a00000
35118 +#define PSC1_BASE_ADDR 0xb1b00000
35121 /* The PSC select and control registers are common to
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)
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 */
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
35151 + * AMD Alchemy DB1200 Referrence Board
35152 + * Board Registers defines.
35154 + * ########################################################################
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.
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.
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.
35169 + * ########################################################################
35173 +#ifndef __ASM_DB1200_H
35174 +#define __ASM_DB1200_H
35176 +#include <linux/types.h>
35178 +// This is defined in au1000.h with bogus value
35179 +#undef AU1X00_EXTERNAL_INT
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
35186 +/* SPI and SMB are muxed on the Pb1200 board.
35187 + Refer to board documentation.
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.
35194 +#define AC97_PSC_BASE PSC1_BASE_ADDR
35195 +#define I2S_PSC_BASE PSC1_BASE_ADDR
35197 +#define BCSR_KSEG1_ADDR 0xB9800000
35199 +typedef volatile struct
35201 + /*00*/ u16 whoami;
35203 + /*04*/ u16 status;
35205 + /*08*/ u16 switches;
35207 + /*0C*/ u16 resets;
35210 + /*10*/ u16 pcmcia;
35212 + /*14*/ u16 board;
35214 + /*18*/ u16 disk_leds;
35216 + /*1C*/ u16 system;
35219 + /*20*/ u16 intclr;
35221 + /*24*/ u16 intset;
35223 + /*28*/ u16 intclr_mask;
35225 + /*2C*/ u16 intset_mask;
35228 + /*30*/ u16 sig_status;
35230 + /*34*/ u16 int_status;
35232 + /*38*/ u16 reserved14;
35234 + /*3C*/ u16 reserved16;
35239 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
35242 + * Register bit definitions for the BCSRs
35244 +#define BCSR_WHOAMI_DCID 0x000F
35245 +#define BCSR_WHOAMI_CPLD 0x00F0
35246 +#define BCSR_WHOAMI_BOARD 0x0F00
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
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
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
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
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
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
35301 +#define BCSR_SYSTEM_POWEROFF 0x4000
35302 +#define BCSR_SYSTEM_RESET 0x8000
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
35320 +#define AU1XXX_SMC91111_PHYS_ADDR (0x19000300)
35321 +#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
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
35330 +#define NAND_PHYS_ADDR 0x20000000
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
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)
35355 +#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
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)))
35362 +#endif /* __ASM_DB1200_H */
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
35369 - * AMD Alchemy DB1x00 Reference Boards
35370 + * AMD Alchemy DB1x00 Reference Boards (BUT NOT DB1200)
35372 * Copyright 2001 MontaVista Software Inc.
35373 * Author: MontaVista Software, Inc.
35375 #define AC97_PSC_BASE PSC1_BASE_ADDR
35376 #define SMBUS_PSC_BASE PSC2_BASE_ADDR
35377 #define I2S_PSC_BASE PSC3_BASE_ADDR
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)))
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)))
35397 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
35400 * Register/mask bit definitions for the BCSRs
35401 @@ -130,14 +140,6 @@
35403 #define BCSR_SWRESET_RESET 0x0080
35405 -/* PCMCIA Db1x00 specific defines */
35406 -#define PCMCIA_MAX_SOCK 1
35407 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
35410 -#define SET_VCC_VPP(VCC, VPP, SLOT)\
35411 - ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
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
35420 -/* SD controller macros */
35424 -#define mmc_card_inserted(_n_, _res_) \
35426 - BCSR * const bcsr = (BCSR *)0xAE000000; \
35427 - unsigned long mmc_wp, board_specific; \
35429 - mmc_wp = BCSR_BOARD_SD1_WP; \
35431 - mmc_wp = BCSR_BOARD_SD0_WP; \
35433 - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
35434 - if (!(board_specific & mmc_wp)) {/* low means card present */ \
35435 - *(int *)(_res_) = 1; \
35437 - *(int *)(_res_) = 0; \
35441 +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
35443 - * Apply power to card slot(s).
35444 + * Daughter card information.
35446 -#define mmc_power_on(_n_) \
35448 - BCSR * const bcsr = (BCSR *)0xAE000000; \
35449 - unsigned long mmc_pwr, mmc_wp, board_specific; \
35451 - mmc_pwr = BCSR_BOARD_SD1_PWR; \
35452 - mmc_wp = BCSR_BOARD_SD1_WP; \
35454 - mmc_pwr = BCSR_BOARD_SD0_PWR; \
35455 - mmc_wp = BCSR_BOARD_SD0_WP; \
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)); \
35464 +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_8)
35466 +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
35467 +#define AU1XXX_ATA_REG_OFFSET (5)
35468 +#endif /* CONFIG_MIPS_DB1550 */
35470 #endif /* __ASM_DB1X00_H */
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
35479 + * ########################################################################
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.
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.
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.
35494 + * ########################################################################
35498 +#ifndef __ASM_FICMMP_H
35499 +#define __ASM_FICMMP_H
35501 +#include <linux/types.h>
35502 +#include <asm/au1000.h>
35503 +#include <asm/au1xxx_gpio.h>
35505 +// This is defined in au1000.h with bogus value
35506 +#undef AU1X00_EXTERNAL_INT
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.
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.
35520 +#define AC97_PSC_BASE PSC1_BASE_ADDR
35521 +#define I2S_PSC_BASE PSC1_BASE_ADDR
35527 +#define AU1XXX_SMC91111_PHYS_ADDR (0xAC000300)
35528 +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_5
35530 +/* DC_IDE and DC_ETHERNET */
35531 +#define FICMMP_IDE_INT AU1000_GPIO_4
35533 +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
35534 +#define AU1XXX_ATA_REG_OFFSET (5)
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)
35540 +#define AU1XXX_ATA_REG_OFFSET (5)
35543 +#define SET_VCC_VPP(VCC, VPP, SLOT)\
35544 + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
35547 +#define FICMMP_CONFIG_BASE 0xAD000000
35548 +#define FICMMP_CONFIG_ENABLE 13
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)
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)
35585 +#define FICMMP_IDE_PWR 9
35586 +#define FICMMP_FOCUS_RST 2
35588 +static __inline void ficmmp_config_set(u16 bits)
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;
35596 +static __inline void ficmmp_config_clear(u16 bits)
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;
35604 +static __inline void ficmmp_config_init(void)
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));
35611 +static __inline u32 ficmmp_set_i2s_sample_rate(u32 rate)
35619 + case 8018: freq = I2S_FREQ_11_2896; break;
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;
35625 + ficmmp_config_clear(FICMMP_CONFIG_I2SFREQ(0xF));
35626 + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(freq));
35630 +#endif /* __ASM_FICMMP_H */
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
35636 * License. See the file "COPYING" in the main directory of this archive
35637 * for more details.
35639 - * Copyright (C) 2003 Ralf Baechle
35640 + * Copyright (C) 2003, 2004 Ralf Baechle
35642 #ifndef _ASM_HAZARDS_H
35643 #define _ASM_HAZARDS_H
35644 @@ -12,38 +12,185 @@
35646 #ifdef __ASSEMBLY__
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.
35657 #ifdef CONFIG_CPU_RM9000
35658 -#define rm9000_tlb_hazard \
35660 +#define mtc0_tlbw_hazard \
35663 + _ssnop; _ssnop; _ssnop; _ssnop; \
35666 +#define tlbw_eret_hazard \
35669 - ssnop; ssnop; ssnop; ssnop; \
35670 + _ssnop; _ssnop; _ssnop; _ssnop; \
35674 -#define rm9000_tlb_hazard
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
35682 +#define mtc0_tlbw_hazard \
35684 +#define tlbw_eret_hazard
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.
35693 +#ifdef CONFIG_CPU_MIPSR2
35695 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
35701 +#define irq_enable_hazard \
35702 + ehb # irq_enable_hazard
35704 +#define irq_disable_hazard \
35705 + ehb # irq_disable_hazard
35709 +#define irq_enable_hazard
35710 +#define irq_disable_hazard
35714 +#else /* __ASSEMBLY__ */
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.
35721 #ifdef CONFIG_CPU_RM9000
35722 -#define rm9000_tlb_hazard() \
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" \
35731 +#define tlbw_use_hazard() \
35732 + __asm__ __volatile__( \
35733 + ".set\tmips32\n\t" \
35734 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
35737 -#define rm9000_tlb_hazard() do { } while (0)
35740 + * Overkill warning ...
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")
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")
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.
35762 +#ifdef CONFIG_CPU_MIPSR2
35764 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
35767 + " .macro ehb \n\t"
35768 + " sll $0, $0, 3 \n\t"
35771 + " .macro\tirq_enable_hazard \n\t"
35775 + " .macro\tirq_disable_hazard \n\t"
35779 +#define irq_enable_hazard() \
35780 + __asm__ __volatile__( \
35781 + "ehb\t\t\t\t# irq_enable_hazard")
35783 +#define irq_disable_hazard() \
35784 + __asm__ __volatile__( \
35785 + "ehb\t\t\t\t# irq_disable_hazard")
35787 +#elif defined(CONFIG_CPU_R10000)
35790 + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
35794 + " .macro\tirq_enable_hazard \n\t"
35797 + " .macro\tirq_disable_hazard \n\t"
35800 +#define irq_enable_hazard() do { } while (0)
35801 +#define irq_disable_hazard() do { } while (0)
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.
35812 + " .macro _ssnop \n\t"
35813 + " sll $0, $2, 1 \n\t"
35817 + " # There is a hazard but we do not care \n\t"
35819 + " .macro\tirq_enable_hazard \n\t"
35822 + " .macro\tirq_disable_hazard \n\t"
35823 + " _ssnop; _ssnop; _ssnop \n\t"
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")
35833 +#endif /* __ASSEMBLY__ */
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)
35857 * The WatchLo register. There may be upto 8 of them.
35858 @@ -874,42 +882,34 @@
35860 static inline void tlb_probe(void)
35862 - rm9000_tlb_hazard();
35863 __asm__ __volatile__(
35864 ".set noreorder\n\t"
35867 - rm9000_tlb_hazard();
35870 static inline void tlb_read(void)
35872 - rm9000_tlb_hazard();
35873 __asm__ __volatile__(
35874 ".set noreorder\n\t"
35877 - rm9000_tlb_hazard();
35880 static inline void tlb_write_indexed(void)
35882 - rm9000_tlb_hazard();
35883 __asm__ __volatile__(
35884 ".set noreorder\n\t"
35887 - rm9000_tlb_hazard();
35890 static inline void tlb_write_random(void)
35892 - rm9000_tlb_hazard();
35893 __asm__ __volatile__(
35894 ".set noreorder\n\t"
35897 - rm9000_tlb_hazard();
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
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[];
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
35918 - * Alchemy Semi PB1100 Referrence Board
35919 + * AMD Alchemy PB1100 Reference Boards
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
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)
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)
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)
35962 -#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
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
35970 + * Overlay data structure of the Pb1100 board registers.
35971 + * Registers located at physical 0E0000xx, KSEG1 0xAE0000xx
35973 +typedef volatile struct
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;
35994 -#define PB1100_LEDS 0xAE000018
35996 -/* 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
35997 - * 7:0 is the LED Display's decimal points.
35999 + * Register/mask bit definitions for the BCSRs
36001 -#define PB1100_HEX_LED 0xAE000018
36002 +#define BCSR_WHOAMI_DCID 0x000F
36003 +#define BCSR_WHOAMI_CPLD 0x00F0
36004 +#define BCSR_WHOAMI_BOARD 0x0F00
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
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
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
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
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
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
36068 +#define BCSR_SWRESET_RESET 0x0080
36069 +#define BCSR_VDDI_VDI 0x001F
36071 -/* PCMCIA PB1100 specific defines */
36073 + /* PCMCIA Pb1x00 specific defines */
36074 #define PCMCIA_MAX_SOCK 0
36075 #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
36078 #define SET_VCC_VPP(VCC, VPP) (((VCC)<<2) | ((VPP)<<0))
36080 #endif /* __ASM_PB1100_H */
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
36087 + * AMD Alchemy PB1200 Referrence Board
36088 + * Board Registers defines.
36090 + * ########################################################################
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.
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.
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.
36105 + * ########################################################################
36109 +#ifndef __ASM_PB1200_H
36110 +#define __ASM_PB1200_H
36112 +#include <linux/types.h>
36114 +// This is defined in au1000.h with bogus value
36115 +#undef AU1X00_EXTERNAL_INT
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
36122 +/* SPI and SMB are muxed on the Pb1200 board.
36123 + Refer to board documentation.
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.
36130 +#define AC97_PSC_BASE PSC1_BASE_ADDR
36131 +#define I2S_PSC_BASE PSC1_BASE_ADDR
36133 +#define BCSR_KSEG1_ADDR 0xAD800000
36135 +typedef volatile struct
36137 + /*00*/ u16 whoami;
36139 + /*04*/ u16 status;
36141 + /*08*/ u16 switches;
36143 + /*0C*/ u16 resets;
36146 + /*10*/ u16 pcmcia;
36148 + /*14*/ u16 board;
36150 + /*18*/ u16 disk_leds;
36152 + /*1C*/ u16 system;
36155 + /*20*/ u16 intclr;
36157 + /*24*/ u16 intset;
36159 + /*28*/ u16 intclr_mask;
36161 + /*2C*/ u16 intset_mask;
36164 + /*30*/ u16 sig_status;
36166 + /*34*/ u16 int_status;
36168 + /*38*/ u16 reserved14;
36170 + /*3C*/ u16 reserved16;
36175 +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
36178 + * Register bit definitions for the BCSRs
36180 +#define BCSR_WHOAMI_DCID 0x000F
36181 +#define BCSR_WHOAMI_CPLD 0x00F0
36182 +#define BCSR_WHOAMI_BOARD 0x0F00
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
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
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
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
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
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
36239 +#define BCSR_SYSTEM_VDDI 0x001F
36240 +#define BCSR_SYSTEM_POWEROFF 0x4000
36241 +#define BCSR_SYSTEM_RESET 0x8000
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
36261 +#define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300)
36262 +#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
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
36271 +#define NAND_PHYS_ADDR 0x1C000000
36273 +/* Timing values as described in databook, * ns value stripped of
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.
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)
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
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)
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
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)
36321 +#define PB1200_INT_END (PB1200_INT_BEGIN + 15)
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)))
36328 +#endif /* __ASM_PB1200_H */
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 @@
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
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
36346 #define BCSR_PHYS_ADDR 0xAF000000
36348 @@ -160,9 +158,23 @@
36349 #define NAND_T_SU_SHIFT 8
36350 #define NAND_T_WH_SHIFT 12
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)
36362 + * Daughter card information.
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)
36368 +/* DC_IDE and DC_ETHERNET */
36369 +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
36370 +#define AU1XXX_ATA_REG_OFFSET (5)
36372 +#define AU1XXX_SMC91111_PHYS_ADDR (0x0C000300)
36373 +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_3
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
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 @@
36452 return (type) __v0; \
36455 + return (type)-1; \
36459 @@ -788,7 +788,7 @@
36461 return (type) __v0; \
36464 + return (type)-1; \
36467 #define _syscall2(type,name,atype,a,btype,b) \
36468 @@ -813,7 +813,7 @@
36470 return (type) __v0; \
36473 + return (type)-1; \
36476 #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
36477 @@ -839,7 +839,7 @@
36479 return (type) __v0; \
36482 + return (type)-1; \
36485 #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
36486 @@ -865,7 +865,7 @@
36488 return (type) __v0; \
36491 + return (type)-1; \
36494 #if (_MIPS_SIM == _MIPS_SIM_ABI32)
36495 @@ -902,7 +902,7 @@
36497 return (type) __v0; \
36500 + return (type)-1; \
36503 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36504 @@ -935,7 +935,7 @@
36506 return (type) __v0; \
36509 + return (type)-1; \
36512 #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
36513 @@ -966,7 +966,7 @@
36515 return (type) __v0; \
36518 + return (type)-1; \
36521 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36522 @@ -995,7 +995,7 @@
36524 return (type) __v0; \
36527 + return (type)-1; \
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
36535 * License. See the file "COPYING" in the main directory of this archive
36536 * for more details.
36538 - * Copyright (C) 2003 Ralf Baechle
36539 + * Copyright (C) 2003, 2004 Ralf Baechle
36541 #ifndef _ASM_HAZARDS_H
36542 #define _ASM_HAZARDS_H
36543 @@ -12,37 +12,185 @@
36545 #ifdef __ASSEMBLY__
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.
36556 #ifdef CONFIG_CPU_RM9000
36557 -#define rm9000_tlb_hazard \
36559 +#define mtc0_tlbw_hazard \
36562 + _ssnop; _ssnop; _ssnop; _ssnop; \
36565 +#define tlbw_eret_hazard \
36568 - ssnop; ssnop; ssnop; ssnop; \
36570 + _ssnop; _ssnop; _ssnop; _ssnop; \
36574 -#define rm9000_tlb_hazard
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
36582 +#define mtc0_tlbw_hazard \
36584 +#define tlbw_eret_hazard
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.
36593 +#ifdef CONFIG_CPU_MIPSR2
36595 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
36601 +#define irq_enable_hazard \
36602 + ehb # irq_enable_hazard
36604 +#define irq_disable_hazard \
36605 + ehb # irq_disable_hazard
36609 +#define irq_enable_hazard
36610 +#define irq_disable_hazard
36614 +#else /* __ASSEMBLY__ */
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.
36621 #ifdef CONFIG_CPU_RM9000
36622 -#define rm9000_tlb_hazard() \
36624 +#define mtc0_tlbw_hazard() \
36625 + __asm__ __volatile__( \
36626 + ".set\tmips32\n\t" \
36627 + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
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" \
36637 -#define rm9000_tlb_hazard() do { } while (0)
36640 + * Overkill warning ...
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")
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")
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.
36662 +#ifdef CONFIG_CPU_MIPSR2
36664 + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
36667 + " .macro ehb \n\t"
36668 + " sll $0, $0, 3 \n\t"
36671 + " .macro\tirq_enable_hazard \n\t"
36675 + " .macro\tirq_disable_hazard \n\t"
36679 +#define irq_enable_hazard() \
36680 + __asm__ __volatile__( \
36681 + "ehb\t\t\t\t# irq_enable_hazard")
36683 +#define irq_disable_hazard() \
36684 + __asm__ __volatile__( \
36685 + "ehb\t\t\t\t# irq_disable_hazard")
36687 +#elif defined(CONFIG_CPU_R10000)
36690 + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
36694 + " .macro\tirq_enable_hazard \n\t"
36697 + " .macro\tirq_disable_hazard \n\t"
36700 +#define irq_enable_hazard() do { } while (0)
36701 +#define irq_disable_hazard() do { } while (0)
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.
36712 + " .macro _ssnop \n\t"
36713 + " sll $0, $2, 1 \n\t"
36717 + " # There is a hazard but we do not care \n\t"
36719 + " .macro\tirq_enable_hazard \n\t"
36722 + " .macro\tirq_disable_hazard \n\t"
36723 + " _ssnop; _ssnop; _ssnop \n\t"
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")
36733 +#endif /* __ASSEMBLY__ */
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)
36757 * The WatchLo register. There may be upto 8 of them.
36758 @@ -856,42 +864,34 @@
36760 static inline void tlb_probe(void)
36762 - rm9000_tlb_hazard();
36763 __asm__ __volatile__(
36764 ".set noreorder\n\t"
36767 - rm9000_tlb_hazard();
36770 static inline void tlb_read(void)
36772 - rm9000_tlb_hazard();
36773 __asm__ __volatile__(
36774 ".set noreorder\n\t"
36777 - rm9000_tlb_hazard();
36780 static inline void tlb_write_indexed(void)
36782 - rm9000_tlb_hazard();
36783 __asm__ __volatile__(
36784 ".set noreorder\n\t"
36787 - rm9000_tlb_hazard();
36790 static inline void tlb_write_random(void)
36792 - rm9000_tlb_hazard();
36793 __asm__ __volatile__(
36794 ".set noreorder\n\t"
36797 - rm9000_tlb_hazard();
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 @@
36806 return (type) __v0; \
36809 + return (type)-1; \
36813 @@ -788,7 +788,7 @@
36815 return (type) __v0; \
36818 + return (type)-1; \
36821 #define _syscall2(type,name,atype,a,btype,b) \
36822 @@ -813,7 +813,7 @@
36824 return (type) __v0; \
36827 + return (type)-1; \
36830 #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
36831 @@ -839,7 +839,7 @@
36833 return (type) __v0; \
36836 + return (type)-1; \
36839 #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
36840 @@ -865,7 +865,7 @@
36842 return (type) __v0; \
36845 + return (type)-1; \
36848 #if (_MIPS_SIM == _MIPS_SIM_ABI32)
36849 @@ -902,7 +902,7 @@
36851 return (type) __v0; \
36854 + return (type)-1; \
36857 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36858 @@ -935,7 +935,7 @@
36860 return (type) __v0; \
36863 + return (type)-1; \
36866 #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
36867 @@ -966,7 +966,7 @@
36869 return (type) __v0; \
36872 + return (type)-1; \
36875 #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
36876 @@ -995,7 +995,7 @@
36878 return (type) __v0; \
36881 + return (type)-1; \
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
36893 +#define hz_to_std(a) (a)
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
36918 +#define hz_to_std(a) (a)
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
36931 +#define hz_to_std(a) (a)
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
36944 +#define hz_to_std(a) (a)
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 @@
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")
36963 -#define nop() __asm__ __volatile__ ("nop");
36964 +#define nop() __asm__ __volatile__ ("nop")
36966 /* This has special calling conventions */
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
36972 #ifndef __ARCH_SPARC64_ATOMIC__
36973 #define __ARCH_SPARC64_ATOMIC__
36975 +#include <linux/config.h>
36977 typedef struct { volatile int counter; } atomic_t;
36978 #define ATOMIC_INIT(i) { (i) }
36980 #define atomic_read(v) ((v)->counter)
36981 #define atomic_set(v, i) (((v)->counter) = i)
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 *);
36988 +extern int atomic_add_ret(int, atomic_t *);
36989 +extern int atomic_sub_ret(int, atomic_t *);
36991 +#define atomic_dec_return(v) atomic_sub_ret(1, v)
36993 +#define atomic_inc_return(v) atomic_add_ret(1, v)
36995 +#define atomic_sub_return(i, v) atomic_sub_ret(i, v)
36997 +#define atomic_add_return(i, v) atomic_add_ret(i, v)
37000 + * atomic_inc_and_test - increment and test
37001 + * @v: pointer of type atomic_t
37003 + * Atomically increments @v by 1
37004 + * and returns true if the result is zero, or false for all
37007 +#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
37009 +#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
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)
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)
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)
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)
37027 /* Atomic operations are already serializing */
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")
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()
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
37047 * bitops.h: Bit string operations on the V9.
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
37054 +#include <linux/config.h>
37055 +#include <linux/compiler.h>
37056 #include <asm/byteorder.h>
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);
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);
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)); \
37081 -#define __clear_bit(X,Y) \
37082 -do { unsigned long __nr = (X); \
37083 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37084 - *__m &= ~(1UL << (__nr & 63)); \
37086 -#define __change_bit(X,Y) \
37087 -do { unsigned long __nr = (X); \
37088 - long *__m = ((long *) (Y)) + (__nr >> 6); \
37089 - *__m ^= (1UL << (__nr & 63)); \
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); \
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); \
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); \
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)
37120 + unsigned long *m;
37122 + m = ((unsigned long *)addr) + (nr >> 6);
37123 + *m |= (1UL << (nr & 63));
37126 +static __inline__ void __clear_bit(int nr, volatile void *addr)
37128 + unsigned long *m;
37130 + m = ((unsigned long *)addr) + (nr >> 6);
37131 + *m &= ~(1UL << (nr & 63));
37134 -extern __inline__ int test_bit(int nr, __const__ void *addr)
37135 +static __inline__ void __change_bit(int nr, volatile void *addr)
37137 - return (1UL & (((__const__ long *) addr)[nr >> 6] >> (nr & 63))) != 0UL;
37138 + unsigned long *m;
37140 + m = ((unsigned long *)addr) + (nr >> 6);
37141 + *m ^= (1UL << (nr & 63));
37144 +static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
37146 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37147 + unsigned long old = *m;
37148 + unsigned long mask = (1UL << (nr & 63));
37150 + *m = (old | mask);
37151 + return ((old & mask) != 0);
37154 +static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
37156 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37157 + unsigned long old = *m;
37158 + unsigned long mask = (1UL << (nr & 63));
37160 + *m = (old & ~mask);
37161 + return ((old & mask) != 0);
37164 +static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
37166 + unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
37167 + unsigned long old = *m;
37168 + unsigned long mask = (1UL << (nr & 63));
37170 + *m = (old ^ mask);
37171 + return ((old & mask) != 0);
37175 +#define smp_mb__before_clear_bit() membar("#StoreLoad | #LoadLoad")
37176 +#define smp_mb__after_clear_bit() membar("#StoreLoad | #StoreStore")
37178 +#define smp_mb__before_clear_bit() barrier()
37179 +#define smp_mb__after_clear_bit() barrier()
37182 +static __inline__ int test_bit(int nr, __const__ volatile void *_addr)
37184 + __const__ unsigned long *addr;
37186 + addr = (__const__ unsigned long *) _addr;
37188 + return (1UL & ((addr)[nr >> 6] >> (nr & 63))) != 0UL;
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)
37195 unsigned long result;
37197 -#ifdef ULTRA_HAS_POPULATION_COUNT /* Thanks for nothing Sun... */
37198 - __asm__ __volatile__(
37199 -" brz,pn %0, 1f\n"
37201 -" xnor %0, %%g1, %%g2\n"
37202 -" popc %%g2, %0\n"
37203 -"1: " : "=&r" (result)
37207 -#if 1 /* def EASY_CHEESE_VERSION */
37214 - unsigned long tmp;
37219 - tmp = ~word & -~word;
37220 - if (!(unsigned)tmp) {
37224 - if (!(unsigned short)tmp) {
37228 - if (!(unsigned char)tmp) {
37232 + * __ffs - find first bit in word.
37233 + * @word: The word to search
37235 + * Undefined if no bit exists, so code should check against 0 first.
37237 +static __inline__ unsigned long __ffs(unsigned long word)
37239 + unsigned long result = 0;
37241 + while (!(word & 1UL)) {
37245 - if (tmp & 0xf0) result += 4;
37246 - if (tmp & 0xcc) result += 2;
37247 - if (tmp & 0xaa) result ++;
37254 + * fls: find last bit set.
37257 +#define fls(x) generic_fls(x)
37262 @@ -122,8 +134,12 @@
37263 * the libc and compiler builtin ffs routines, therefore
37264 * differs in spirit from the above ffz (man ffs).
37267 -#define ffs(x) generic_ffs(x)
37268 +static __inline__ int ffs(int x)
37272 + return __ffs((unsigned long)x) + 1;
37276 * hweightN: returns the hamming weight (i.e. the number
37277 @@ -132,7 +148,15 @@
37279 #ifdef ULTRA_HAS_POPULATION_COUNT
37281 -extern __inline__ unsigned int hweight32(unsigned int w)
37282 +static __inline__ unsigned int hweight64(unsigned long w)
37284 + unsigned int res;
37286 + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w));
37290 +static __inline__ unsigned int hweight32(unsigned int w)
37294 @@ -140,7 +164,7 @@
37298 -extern __inline__ unsigned int hweight16(unsigned int w)
37299 +static __inline__ unsigned int hweight16(unsigned int w)
37303 @@ -148,7 +172,7 @@
37307 -extern __inline__ unsigned int hweight8(unsigned int w)
37308 +static __inline__ unsigned int hweight8(unsigned int w)
37312 @@ -158,6 +182,7 @@
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.
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)
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)
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);
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))
37345 -extern __inline__ int test_le_bit(int nr, __const__ void * addr)
37346 +static __inline__ int test_le_bit(int nr, __const__ void *addr)
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)
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)
37357 unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
37358 unsigned long result = offset & ~63UL;
37359 @@ -271,18 +293,41 @@
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))
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))
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))
37409 #endif /* __KERNEL__ */
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
37419 +#define hz_to_std(a) (a)
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 @@
37429 #define nop() __asm__ __volatile__ ("nop")
37431 -#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory");
37432 +#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory")
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()
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")
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)
37455 __asm__ __volatile__(
37456 +" membar #StoreLoad | #LoadLoad\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)
37463 __asm__ __volatile__(
37464 +" membar #StoreLoad | #LoadLoad\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)
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"
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)
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"
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)
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,
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
37515 * Registry idea and naming [ crutial! :-) ] by:
37517 * David S. Miller <davem@redhat.com>
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.
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
37530 /* Register bigreader lock indices here. */
37532 #include <linux/cache.h>
37533 #include <linux/spinlock.h>
37535 -#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
37536 -#define __BRLOCK_USE_ATOMICS
37538 -#undef __BRLOCK_USE_ATOMICS
37541 -#ifdef __BRLOCK_USE_ATOMICS
37542 -typedef rwlock_t brlock_read_lock_t;
37544 typedef unsigned int brlock_read_lock_t;
37548 * align last allocated index to the next cacheline:
37549 @@ -65,39 +45,14 @@
37551 extern brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX];
37553 -#ifndef __BRLOCK_USE_ATOMICS
37556 } __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
37558 extern struct br_wrlock __br_write_locks[__BR_IDX_MAX];
37561 extern void __br_lock_usage_bug (void);
37563 -#ifdef __BRLOCK_USE_ATOMICS
37565 -static inline void br_read_lock (enum brlock_indices idx)
37568 - * This causes a link-time bug message if an
37569 - * invalid index is used:
37571 - if (idx >= __BR_END)
37572 - __br_lock_usage_bug();
37574 - read_lock(&__brlock_array[smp_processor_id()][idx]);
37577 -static inline void br_read_unlock (enum brlock_indices idx)
37579 - if (idx >= __BR_END)
37580 - __br_lock_usage_bug();
37582 - read_unlock(&__brlock_array[smp_processor_id()][idx]);
37585 -#else /* ! __BRLOCK_USE_ATOMICS */
37586 static inline void br_read_lock (enum brlock_indices idx)
37589 @@ -149,7 +104,6 @@
37593 -#endif /* __BRLOCK_USE_ATOMICS */
37595 /* write path not inlined - it's rare and larger */
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;
37604 + size_t f_maxcount;
37605 unsigned long f_version;
37607 /* needed for tty driver, and maybe others */
37608 @@ -1056,14 +1057,7 @@
37612 -static inline int locks_verify_area(int read_write, struct inode *inode,
37613 - struct file *filp, loff_t offset,
37616 - if (inode->i_flock && MANDATORY_LOCK(inode))
37617 - return locks_mandatory_area(read_write, inode, filp, offset, count);
37620 +extern int rw_verify_area(int, struct file *, loff_t *, size_t);
37622 static inline int locks_verify_truncate(struct inode *inode,
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
37629 + * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
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.
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.
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.
37646 +#ifndef I2C_ALGO_AU1550_H
37647 +#define I2C_ALGO_AU1550_H 1
37649 +struct i2c_algo_au1550_data {
37651 + int xfer_timeout;
37655 +int i2c_au1550_add_bus(struct i2c_adapter *);
37656 +int i2c_au1550_del_bus(struct i2c_adapter *);
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 @@
37664 #define I2C_ALGO_SGI 0x130000 /* SGI algorithm */
37666 +#define I2C_ALGO_AU1550 0x140000 /* Alchemy Au1550 PSC */
37668 #define I2C_ALGO_EXP 0x800000 /* experimental */
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
37675 +/* --- Au1550 PSC adapters */
37676 +#define I2C_HW_AU1550_PSC 0x00
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 @@
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);
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
37697 #ifndef __LIBATA_COMPAT_H__
37698 #define __LIBATA_COMPAT_H__
37700 +#include <linux/types.h>
37701 #include <linux/delay.h>
37702 #include <linux/pci.h>
37703 +#include <linux/slab.h>
37705 +typedef u32 __le32;
37706 +typedef u64 __le64;
37708 +#define DMA_64BIT_MASK 0xffffffffffffffffULL
37709 +#define DMA_32BIT_MASK 0x00000000ffffffffULL
37711 #define MODULE_VERSION(ver_str)
37714 struct pci_dev pdev;
37717 -static inline void libata_msleep(unsigned long msecs)
37722 static inline struct pci_dev *to_pci_dev(struct device *dev)
37724 return (struct pci_dev *) dev;
37726 #define dev_set_drvdata(dev,ptr) \
37727 pci_set_drvdata(to_pci_dev(dev),(ptr))
37729 +static inline void *kcalloc(size_t nmemb, size_t size, int flags)
37731 + size_t total = nmemb * size;
37732 + void *mem = kmalloc(total, flags);
37734 + memset(mem, 0, total);
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 @@
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);
37750 void (*phy_reset) (struct ata_port *ap);
37751 @@ -361,6 +363,9 @@
37752 void (*port_stop) (struct ata_port *ap);
37754 void (*host_stop) (struct ata_host_set *host_set);
37756 + void (*bmdma_stop) (struct ata_port *ap);
37757 + u8 (*bmdma_status) (struct ata_port *ap);
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 @@
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);
37787 #endif /* CONFIG_PCI */
37788 @@ -453,26 +460,11 @@
37789 (dev->class == ATA_DEV_ATAPI));
37792 -static inline u8 ata_chk_err(struct ata_port *ap)
37794 - if (ap->flags & ATA_FLAG_MMIO) {
37795 - return readb((void __iomem *) ap->ioaddr.error_addr);
37797 - return inb(ap->ioaddr.error_addr);
37800 static inline u8 ata_chk_status(struct ata_port *ap)
37802 return ap->ops->check_status(ap);
37805 -static inline u8 ata_altstatus(struct ata_port *ap)
37807 - if (ap->flags & ATA_FLAG_MMIO)
37808 - return readb((void __iomem *)ap->ioaddr.altstatus_addr);
37809 - return inb(ap->ioaddr.altstatus_addr);
37812 static inline void ata_pause(struct ata_port *ap)
37815 @@ -596,46 +588,6 @@
37816 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
37819 -static inline void ata_bmdma_stop(struct ata_port *ap)
37821 - if (ap->flags & ATA_FLAG_MMIO) {
37822 - void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
37824 - /* clear start/stop bit */
37825 - writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
37826 - mmio + ATA_DMA_CMD);
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);
37833 - /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
37834 - ata_altstatus(ap); /* dummy read */
37837 -static inline void ata_bmdma_ack_irq(struct ata_port *ap)
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);
37843 - unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
37844 - outb(inb(addr), addr);
37848 -static inline u8 ata_bmdma_status(struct ata_port *ap)
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);
37855 - host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
37856 - return host_stat;
37859 static inline int ata_try_flush_cache(struct ata_device *dev)
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);
37869 -extern int ip_ct_no_defrag;
37870 /* Returns new sk_buff, or NULL */
37872 -ip_ct_gather_frags(struct sk_buff *skb);
37873 +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user);
37875 /* Delete all conntracks which match. */
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 @@
37883 * skb should fit one page. This choice is good for headerless malloc.
37885 - * FIXME: What is the best size for SLAB???? --ANK
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))
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);
37911 +extern ATTRIB_NORET void cpu_idle(void);
37913 +extern void release_task(struct task_struct * p);
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
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
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 @@
37936 static inline void kfree_skb(struct sk_buff *skb)
37938 - if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
37939 - __kfree_skb(skb);
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)
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))
37949 + else if (likely(!atomic_dec_and_test(&skb->users)))
37951 + __kfree_skb(skb);
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
37959 #ifndef _LINUX_SWAP_H
37960 #define _LINUX_SWAP_H
37962 +#include <linux/config.h>
37964 +#define MAX_SWAPFILES 32
37968 #include <linux/spinlock.h>
37969 #include <asm/page.h>
37972 #define SWAP_FLAG_PRIO_MASK 0x7fff
37973 #define SWAP_FLAG_PRIO_SHIFT 0
37975 -#define MAX_SWAPFILES 32
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)
37987 * Max bad pages in the new format..
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,
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 @@
38005 void dst_release(struct dst_entry * dst)
38009 + smp_mb__before_atomic_dec();
38010 atomic_dec(&dst->__refcnt);
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 @@
38020 * Functions provided by ip_fragment.o
38023 -struct sk_buff *ip_defrag(struct sk_buff *skb);
38024 -extern void ipfrag_flush(void);
38026 +enum ip_defrag_users
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,
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;
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)
38048 -#define BICTCP_1_OVER_BETA 8 /*
38050 - * multiplicative decrease factor
38051 +#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
38052 + * max_cwnd = snd_cwnd * beta
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;
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);
38076 tp->bictcp.last_max_cwnd = tp->snd_cwnd;
38078 if (tp->snd_cwnd > sysctl_tcp_bic_low_window)
38079 - return max(tp->snd_cwnd - (tp->snd_cwnd/BICTCP_1_OVER_BETA),
38081 + return max((tp->snd_cwnd * sysctl_tcp_bic_beta)
38082 + / BICTCP_BETA_SCALE, 2U);
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;
38093 -extern struct newport_regs *npregs;
38097 unsigned int drawmode1;
38098 @@ -450,38 +448,26 @@
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)
38106 + int t = BUSY_TIMEOUT;
38108 - while(i < BUSY_TIMEOUT)
38109 - if(!(npregs->cset.status & NPORT_STAT_GBUSY))
38111 + if (!(regs->cset.status & NPORT_STAT_GBUSY))
38113 - if(i == BUSY_TIMEOUT)
38119 -static __inline__ int newport_bfwait(void)
38120 +static __inline__ int newport_bfwait(struct newport_regs *regs)
38123 + int t = BUSY_TIMEOUT;
38125 - while(i < BUSY_TIMEOUT)
38126 - if(!(npregs->cset.status & NPORT_STAT_BBUSY))
38128 + if(!(regs->cset.status & NPORT_STAT_BBUSY))
38130 - if(i == BUSY_TIMEOUT)
38136 -/* newport.c and cons_newport.c routines */
38137 -extern struct graphics_ops *newport_probe (int, const char **);
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);
38145 * DCBMODE register defines:
38147 @@ -564,7 +550,7 @@
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);
38154 while ((rex->set.dcbdata0.bybytes.b3 & 3) != XM9_FIFO_EMPTY)
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 @@
38162 extern void setup_arch(char **);
38163 -extern void cpu_idle(void);
38165 unsigned long wait_init_idle;
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
38172 int getrusage(struct task_struct *, int, struct rusage *);
38174 -static void release_task(struct task_struct * p)
38175 +void release_task(struct task_struct * p)
38177 if (p != current) {
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
38183 #include <linux/init.h>
38184 #include <linux/sched.h>
38186 +#include <asm/param.h>
38187 #include <asm/uaccess.h>
38191 #define SIG_SLAB_DEBUG 0
38194 +#define DEBUG_SIG 0
38197 +#define SIG_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
38199 +#define SIG_SLAB_DEBUG 0
38202 static kmem_cache_t *sigqueue_cachep;
38204 atomic_t nr_queued_signals;
38205 @@ -270,6 +279,11 @@
38206 signal_pending(current));
38210 +printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
38211 + signal_pending(current));
38214 sig = next_signal(current, mask);
38216 if (current->notifier) {
38217 @@ -293,6 +307,10 @@
38218 printk(" %d -> %d\n", signal_pending(current), sig);
38222 +printk(" %d -> %d\n", signal_pending(current), sig);
38228 @@ -540,6 +558,11 @@
38229 printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
38234 +printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
38238 if (sig < 0 || sig > _NSIG)
38240 @@ -778,8 +801,8 @@
38241 info.si_uid = tsk->uid;
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);
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 @@
38256 asmlinkage long sys_times(struct tms * tbuf)
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.
38267 - if (copy_to_user(tbuf, ¤t->times, sizeof(struct tms)))
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)))
38277 + return hz_to_std(jiffies);
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
38285 #include <linux/sched.h>
38286 #include <linux/brlock.h>
38288 -#ifdef __BRLOCK_USE_ATOMICS
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 } };
38293 -void fastcall __br_write_lock (enum brlock_indices idx)
38297 - for (i = 0; i < smp_num_cpus; i++)
38298 - write_lock(&__brlock_array[cpu_logical_map(i)][idx]);
38301 -void fastcall __br_write_unlock (enum brlock_indices idx)
38305 - for (i = 0; i < smp_num_cpus; i++)
38306 - write_unlock(&__brlock_array[cpu_logical_map(i)][idx]);
38309 -#else /* ! __BRLOCK_USE_ATOMICS */
38311 brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX] =
38312 { [0 ... NR_CPUS-1] = { [0 ... __BR_IDX_MAX-1] = 0 } };
38315 spin_unlock(&__br_write_locks[idx].lock);
38318 -#endif /* __BRLOCK_USE_ATOMICS */
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
38325 subdir-$(CONFIG_ZLIB_INFLATE) += zlib_inflate
38326 subdir-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate
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 @@
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/
38346 @@ -1532,7 +1532,7 @@
38349 P: Michal Ostrowski
38350 -M: mostrows@styx.uwaterloo.ca
38351 +M: mostrows@speakeasy.net
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
38364 +EXTRAVERSION = -pre3
38366 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
38368 -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
38370 KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
38372 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
38373 @@ -462,10 +462,11 @@
38374 $(MAKE) -C Documentation/DocBook mrproper
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
38388 cd .. && tar cf - linux/ | gzip -9 > backup.gz
38389 @@ -492,7 +493,7 @@
38390 $(MAKE) -C Documentation/DocBook man
38393 - find . -type f -print | sort | xargs sum > .SUMS
38394 + find . -type f -print | sort | env -i xargs sum > .SUMS
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 @@
38403 if (!in_inode->i_mapping->a_ops->readpage)
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);
38410 @@ -1887,7 +1887,7 @@
38411 if (!out_file->f_op || !out_file->f_op->write)
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);
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;
38426 /* Doesn't work if there's no mapped file. */
38428 @@ -2605,13 +2605,6 @@
38430 end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
38432 - /* Make sure this doesn't exceed the process's max rss. */
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)
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);
38446 - err = written ? written : status;
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.
38452 + err = (status < 0) ? status : written;
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)
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))
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 @@
38477 if (dev->flags&IFF_UP)
38479 - if (__dev_get_by_name(ifr->ifr_newname))
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];
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);
38495 + /* Copy the new name back to caller. */
38496 + strncpy(ifr->ifr_newname, dev->name, IFNAMSIZ);
38498 + if (__dev_get_by_name(ifr->ifr_newname))
38500 + memcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
38501 + dev->name[IFNAMSIZ-1] = 0;
38503 notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
38506 @@ -2316,6 +2332,7 @@
38510 + case SIOCSIFNAME:
38513 if (!capable(CAP_NET_ADMIN))
38514 @@ -2351,7 +2368,6 @@
38516 case SIOCSIFHWBROADCAST:
38517 case SIOCSIFTXQLEN:
38518 - case SIOCSIFNAME:
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 @@
38527 void dst_destroy(struct dst_entry * dst)
38529 - struct neighbour *neigh = dst->neighbour;
38530 - struct hh_cache *hh = dst->hh;
38531 + struct neighbour *neigh;
38532 + struct hh_cache *hh;
38536 + neigh = dst->neighbour;
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 @@
38546 unsigned long neigh_rand_reach_time(unsigned long base)
38548 - return (net_random() % base) + (base>>1);
38549 + return (base ? (net_random() % base) + (base >> 1) : 0);
38553 @@ -1469,6 +1469,7 @@
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 @@
38567 addr = in_aton(name);
38568 - strcpy(name, cp);
38569 + memmove(name, cp, strlen(cp) + 1);
38571 addr = INADDR_NONE;
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
38578 struct ipq *next; /* linked list pointers */
38579 struct list_head lru_list; /* lru list member */
38584 @@ -242,13 +243,13 @@
38585 /* Memory limiting on fragments. Evictor trashes the oldest
38586 * fragment queue until we are back under the threshold.
38588 -static void __ip_evictor(int threshold)
38589 +static void ip_evictor(void)
38592 struct list_head *tmp;
38595 - work = atomic_read(&ip_frag_mem) - threshold;
38596 + work = atomic_read(&ip_frag_mem) - sysctl_ipfrag_low_thresh;
38600 @@ -273,11 +274,6 @@
38604 -static inline void ip_evictor(void)
38606 - __ip_evictor(sysctl_ipfrag_low_thresh);
38610 * Oops, a fragment queue timed out. Kill it and send an ICMP reply.
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 @@
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)
38631 @@ -363,6 +360,7 @@
38633 qp->saddr = iph->saddr;
38634 qp->daddr = iph->daddr;
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.
38643 -static inline struct ipq *ip_find(struct iphdr *iph)
38644 +static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
38646 __u16 id = iph->id;
38647 __u32 saddr = iph->saddr;
38648 @@ -399,7 +397,8 @@
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);
38658 @@ -407,7 +406,7 @@
38660 read_unlock(&ipfrag_lock);
38662 - return ip_frag_create(hash, iph);
38663 + return ip_frag_create(hash, iph, user);
38666 /* Add new segment to existing queue. */
38667 @@ -641,7 +640,7 @@
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)
38674 struct iphdr *iph = skb->nh.iph;
38676 @@ -656,7 +655,7 @@
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;
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);
38690 -void ipfrag_flush(void)
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);
38704 read_unlock(&ip_ra_lock);
38706 @@ -291,7 +291,7 @@
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);
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 @@
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);
38727 @@ -658,7 +658,7 @@
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);
38736 @@ -1164,7 +1164,7 @@
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);
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 @@
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);
38760 @@ -1183,29 +1186,22 @@
38761 WRITE_UNLOCK(&ip_conntrack_lock);
38764 -int ip_ct_no_defrag;
38766 /* Returns new sk_buff, or NULL */
38768 -ip_ct_gather_frags(struct sk_buff *skb)
38769 +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
38771 struct sock *sk = skb->sk;
38772 #ifdef CONFIG_NETFILTER_DEBUG
38773 unsigned int olddebug = skb->nf_debug;
38776 - if (unlikely(ip_ct_no_defrag)) {
38786 local_bh_disable();
38787 - skb = ip_defrag(skb);
38788 + skb = ip_defrag(skb, user);
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);
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);
38805 - local_bh_enable();
38806 nf_unregister_hook(&ip_conntrack_in_ops);
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);
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);
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. */
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);
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,
38840 + {NET_TCP_BIC_BETA, "tcp_bic_beta",
38841 + &sysctl_tcp_bic_beta, sizeof(int), 0644, NULL,
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) */
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);
38865 /* Too big header? This can happen with IPv6. */
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 @@
38872 struct netlink_table *table = &nl_table[sk->protocol];
38873 struct nl_pid_hash *hash = &table->hash;
38874 + u32 pid = nlk_sk(sk)->pid;
38876 netlink_table_grab();
38878 - for (skp = hash->table; *skp; skp = &((*skp)->next)) {
38879 + for (skp = nl_pid_hashfn(hash, pid); *skp; skp = &((*skp)->next)) {
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);
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
38899 struct tc_u_hnode *next;
38902 struct tc_u_common *tp_c;
38905 @@ -271,6 +272,7 @@
38906 root_ht->divisor = 0;
38908 root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000;
38909 + root_ht->prio = tp->prio;
38911 if (tp_c == NULL) {
38912 tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL);
38913 @@ -534,6 +536,7 @@
38915 ht->divisor = divisor;
38916 ht->handle = handle;
38917 + ht->prio = tp->prio;
38918 ht->next = tp_c->hlist;
38920 *arg = (unsigned long)ht;
38921 @@ -606,6 +609,8 @@
38924 for (ht = tp_c->hlist; ht; ht = ht->next) {
38925 + if (ht->prio != tp->prio)
38927 if (arg->count >= arg->skip) {
38928 if (arg->fn(tp, (unsigned long)ht, arg) < 0) {
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
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
38945 +static struct nf_hook_ops ing6_ops =
38950 + NF_IP6_PRE_ROUTING,
38951 + NF_IP6_PRI_FILTER + 1
38954 int ingress_init(struct Qdisc *sch,struct rtattr *opt)
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");
38964 + if (nf_register_hook(&ing6_ops) < 0) {
38965 + printk("IPv6 ingress qdisc registration error, " \
38966 + "disabling IPv6 support.\n");
38971 DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
38972 @@ -374,8 +389,11 @@
38973 void cleanup_module(void)
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);
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++;
38993 return 0; /* lie about loss so TCP doesn't know */
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 @@
39002 spin_lock(&sk->receive_queue.lock);
39003 - if((skb=skb_peek(&sk->receive_queue))!=NULL)
39005 + if (sk->type == SOCK_STREAM) {
39006 + skb_queue_walk(&sk->receive_queue, skb)
39007 + amount += skb->len;
39009 + if((skb=skb_peek(&sk->receive_queue))!=NULL)
39012 spin_unlock(&sk->receive_queue.lock);
39013 err = put_user(amount, (int *)arg);
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 @@
39020 old=$(eval echo "\${$2}")
39022 - def=${def#*[x,X]}
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"
39032 + if expr "$ans" : '[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
39033 + define_hex "$2" "0x$ans"