1 diff -urN a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
2 --- a/arch/mips/rb532/devices.c 2008-11-07 18:55:34.000000000 +0100
3 +++ b/arch/mips/rb532/devices.c 2008-11-15 17:43:28.000000000 +0100
5 #include <asm/mach-rc32434/rb.h>
6 #include <asm/mach-rc32434/integ.h>
7 #include <asm/mach-rc32434/gpio.h>
9 -#define ETH0_DMA_RX_IRQ (GROUP1_IRQ_BASE + 0)
10 -#define ETH0_DMA_TX_IRQ (GROUP1_IRQ_BASE + 1)
11 -#define ETH0_RX_OVR_IRQ (GROUP3_IRQ_BASE + 9)
12 -#define ETH0_TX_UND_IRQ (GROUP3_IRQ_BASE + 10)
13 +#include <asm/mach-rc32434/irq.h>
15 #define ETH0_RX_DMA_ADDR (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
16 #define ETH0_TX_DMA_ADDR (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
18 -/* NAND definitions */
19 -#define GPIO_RDY (1 << 0x08)
20 -#define GPIO_WPX (1 << 0x09)
21 -#define GPIO_ALE (1 << 0x0a)
22 -#define GPIO_CLE (1 << 0x0b)
24 static struct resource korina_dev0_res[] = {
26 .name = "korina_regs",
30 static struct platform_device korina_dev0 = {
34 .dev.platform_data = &korina_dev0_data,
35 .resource = korina_dev0_res,
36 .num_resources = ARRAY_SIZE(korina_dev0_res),
39 -#define CF_GPIO_NUM 13
41 static struct resource cf_slot0_res[] = {
47 static struct cf_device cf_slot0_data = {
49 + .gpio_pin = CF_GPIO_NUM
52 static struct platform_device cf_slot0 = {
55 .name = "pata-rb532-cf",
56 .dev.platform_data = &cf_slot0_data,
57 .resource = cf_slot0_res,
59 /* Resources and device for NAND */
60 static int rb532_dev_ready(struct mtd_info *mtd)
62 - return readl(IDT434_REG_BASE + GPIOD) & GPIO_RDY;
63 + return gpio_get_value(GPIO_RDY);
66 static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
69 static struct platform_device rb532_led = {
75 static struct gpio_keys_button rb532_gpio_btn[] = {
78 /* Look for the CF card reader */
79 if (!readl(IDT434_REG_BASE + DEV1MASK))
80 - rb532_devs[1] = NULL;
81 + rb532_devs[2] = NULL; /* disable cf_slot0 at index 2 */
83 cf_slot0_res[0].start =
84 readl(IDT434_REG_BASE + DEV1BASE);
85 diff -urN a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
86 --- a/arch/mips/rb532/gpio.c 2008-11-07 18:55:34.000000000 +0100
87 +++ b/arch/mips/rb532/gpio.c 2008-11-15 17:43:28.000000000 +0100
91 #include <linux/kernel.h>
92 -#include <linux/gpio.h>
93 #include <linux/init.h>
94 #include <linux/types.h>
95 -#include <linux/pci.h>
96 #include <linux/spinlock.h>
97 -#include <linux/io.h>
98 #include <linux/platform_device.h>
100 -#include <asm/addrspace.h>
101 +#include <linux/gpio.h>
103 #include <asm/mach-rc32434/rb.h>
104 +#include <asm/mach-rc32434/gpio.h>
106 -struct rb532_gpio_reg __iomem *rb532_gpio_reg0;
107 -EXPORT_SYMBOL(rb532_gpio_reg0);
108 +struct rb532_gpio_chip {
109 + struct gpio_chip chip;
110 + void __iomem *regbase;
113 struct mpmc_device dev3;
115 static struct resource rb532_gpio_reg0_res[] = {
118 - .start = (u32)(IDT434_REG_BASE + GPIOBASE),
119 - .end = (u32)(IDT434_REG_BASE + GPIOBASE + sizeof(struct rb532_gpio_reg)),
120 + .start = REGBASE + GPIOBASE,
121 + .end = REGBASE + GPIOBASE + sizeof(struct rb532_gpio_reg) - 1,
122 .flags = IORESOURCE_MEM,
126 static struct resource rb532_dev3_ctl_res[] = {
129 - .start = (u32)(IDT434_REG_BASE + DEV3BASE),
130 - .end = (u32)(IDT434_REG_BASE + DEV3BASE + sizeof(struct dev_reg)),
131 + .start = REGBASE + DEV3BASE,
132 + .end = REGBASE + DEV3BASE + sizeof(struct dev_reg) - 1,
133 .flags = IORESOURCE_MEM,
138 spin_lock_irqsave(&dev3.lock, flags);
140 - data = *(volatile unsigned *) (IDT434_REG_BASE + reg_offs);
141 + data = readl(IDT434_REG_BASE + reg_offs);
142 for (i = 0; i != len; ++i) {
144 data |= (1 << (i + bit));
145 @@ -108,114 +107,166 @@
147 EXPORT_SYMBOL(get_latch_u5);
149 -int rb532_gpio_get_value(unsigned gpio)
150 +/* rb532_set_bit - sanely set a bit
152 + * bitval: new value for the bit
153 + * offset: bit index in the 4 byte address range
154 + * ioaddr: 4 byte aligned address being altered
156 +static inline void rb532_set_bit(unsigned bitval,
157 + unsigned offset, void __iomem *ioaddr)
159 - return readl(&rb532_gpio_reg0->gpiod) & (1 << gpio);
161 -EXPORT_SYMBOL(rb532_gpio_get_value);
162 + unsigned long flags;
165 -void rb532_gpio_set_value(unsigned gpio, int value)
168 + bitval = !!bitval; /* map parameter to {0,1} */
170 + local_irq_save(flags);
172 - tmp = readl(&rb532_gpio_reg0->gpiod) & ~(1 << gpio);
175 + val = readl(ioaddr);
176 + val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */
177 + val |= ( bitval << offset ); /* set bit if bitval == 1 */
178 + writel(val, ioaddr);
180 - writel(tmp, (void *)&rb532_gpio_reg0->gpiod);
181 + local_irq_restore(flags);
183 -EXPORT_SYMBOL(rb532_gpio_set_value);
185 -int rb532_gpio_direction_input(unsigned gpio)
186 +/* rb532_get_bit - read a bit
188 + * returns the boolean state of the bit, which may be > 1
190 +static inline int rb532_get_bit(unsigned offset, void __iomem *ioaddr)
192 - writel(readl(&rb532_gpio_reg0->gpiocfg) & ~(1 << gpio),
193 - (void *)&rb532_gpio_reg0->gpiocfg);
196 + return (readl(ioaddr) & (1 << offset));
198 -EXPORT_SYMBOL(rb532_gpio_direction_input);
200 -int rb532_gpio_direction_output(unsigned gpio, int value)
202 + * Return GPIO level */
203 +static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset)
205 - gpio_set_value(gpio, value);
206 - writel(readl(&rb532_gpio_reg0->gpiocfg) | (1 << gpio),
207 - (void *)&rb532_gpio_reg0->gpiocfg);
208 + struct rb532_gpio_chip *gpch;
211 + gpch = container_of(chip, struct rb532_gpio_chip, chip);
212 + return rb532_get_bit(offset, gpch->regbase + GPIOD);
214 -EXPORT_SYMBOL(rb532_gpio_direction_output);
216 -void rb532_gpio_set_int_level(unsigned gpio, int value)
218 + * Set output GPIO level
220 +static void rb532_gpio_set(struct gpio_chip *chip,
221 + unsigned offset, int value)
224 + struct rb532_gpio_chip *gpch;
226 - tmp = readl(&rb532_gpio_reg0->gpioilevel) & ~(1 << gpio);
229 - writel(tmp, (void *)&rb532_gpio_reg0->gpioilevel);
230 + gpch = container_of(chip, struct rb532_gpio_chip, chip);
231 + rb532_set_bit(value, offset, gpch->regbase + GPIOD);
233 -EXPORT_SYMBOL(rb532_gpio_set_int_level);
235 -int rb532_gpio_get_int_level(unsigned gpio)
237 + * Set GPIO direction to input
239 +static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
241 - return readl(&rb532_gpio_reg0->gpioilevel) & (1 << gpio);
242 + struct rb532_gpio_chip *gpch;
244 + gpch = container_of(chip, struct rb532_gpio_chip, chip);
246 + if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
247 + return 1; /* alternate function, GPIOCFG is ignored */
249 + rb532_set_bit(0, offset, gpch->regbase + GPIOCFG);
252 -EXPORT_SYMBOL(rb532_gpio_get_int_level);
254 -void rb532_gpio_set_int_status(unsigned gpio, int value)
256 + * Set GPIO direction to output
258 +static int rb532_gpio_direction_output(struct gpio_chip *chip,
259 + unsigned offset, int value)
262 + struct rb532_gpio_chip *gpch;
264 + gpch = container_of(chip, struct rb532_gpio_chip, chip);
266 - tmp = readl(&rb532_gpio_reg0->gpioistat);
269 - writel(tmp, (void *)&rb532_gpio_reg0->gpioistat);
270 + if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
271 + return 1; /* alternate function, GPIOCFG is ignored */
273 + /* set the initial output value */
274 + rb532_set_bit(value, offset, gpch->regbase + GPIOD);
276 + rb532_set_bit(1, offset, gpch->regbase + GPIOCFG);
279 -EXPORT_SYMBOL(rb532_gpio_set_int_status);
281 -int rb532_gpio_get_int_status(unsigned gpio)
282 +static struct rb532_gpio_chip rb532_gpio_chip[] = {
286 + .direction_input = rb532_gpio_direction_input,
287 + .direction_output = rb532_gpio_direction_output,
288 + .get = rb532_gpio_get,
289 + .set = rb532_gpio_set,
297 + * Set GPIO interrupt level
299 +void rb532_gpio_set_ilevel(int bit, unsigned gpio)
301 - return readl(&rb532_gpio_reg0->gpioistat) & (1 << gpio);
302 + rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOILEVEL);
304 -EXPORT_SYMBOL(rb532_gpio_get_int_status);
305 +EXPORT_SYMBOL(rb532_gpio_set_ilevel);
307 -void rb532_gpio_set_func(unsigned gpio, int value)
309 + * Set GPIO interrupt status
311 +void rb532_gpio_set_istat(int bit, unsigned gpio)
315 - tmp = readl(&rb532_gpio_reg0->gpiofunc);
318 - writel(tmp, (void *)&rb532_gpio_reg0->gpiofunc);
319 + rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOISTAT);
321 -EXPORT_SYMBOL(rb532_gpio_set_func);
322 +EXPORT_SYMBOL(rb532_gpio_set_istat);
324 -int rb532_gpio_get_func(unsigned gpio)
326 + * Configure GPIO alternate function
328 +static void rb532_gpio_set_func(int bit, unsigned gpio)
330 - return readl(&rb532_gpio_reg0->gpiofunc) & (1 << gpio);
331 + rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOFUNC);
333 -EXPORT_SYMBOL(rb532_gpio_get_func);
335 int __init rb532_gpio_init(void)
337 - rb532_gpio_reg0 = ioremap_nocache(rb532_gpio_reg0_res[0].start,
338 - rb532_gpio_reg0_res[0].end -
339 - rb532_gpio_reg0_res[0].start);
340 + struct resource *r;
342 + r = rb532_gpio_reg0_res;
343 + rb532_gpio_chip->regbase = ioremap_nocache(r->start, r->end - r->start);
345 - if (!rb532_gpio_reg0) {
346 + if (!rb532_gpio_chip->regbase) {
347 printk(KERN_ERR "rb532: cannot remap GPIO register 0\n");
351 - dev3.base = ioremap_nocache(rb532_dev3_ctl_res[0].start,
352 - rb532_dev3_ctl_res[0].end -
353 - rb532_dev3_ctl_res[0].start);
354 + /* Register our GPIO chip */
355 + gpiochip_add(&rb532_gpio_chip->chip);
357 + r = rb532_dev3_ctl_res;
358 + dev3.base = ioremap_nocache(r->start, r->end - r->start);
361 printk(KERN_ERR "rb532: cannot remap device controller 3\n");
365 + /* configure CF_GPIO_NUM as CFRDY IRQ source */
366 + rb532_gpio_set_func(0, CF_GPIO_NUM);
367 + rb532_gpio_direction_input(&rb532_gpio_chip->chip, CF_GPIO_NUM);
368 + rb532_gpio_set_ilevel(1, CF_GPIO_NUM);
369 + rb532_gpio_set_istat(0, CF_GPIO_NUM);
373 arch_initcall(rb532_gpio_init);
374 diff -urN a/arch/mips/rb532/irq.c b/arch/mips/rb532/irq.c
375 --- a/arch/mips/rb532/irq.c 2008-11-07 18:55:34.000000000 +0100
376 +++ b/arch/mips/rb532/irq.c 2008-11-15 17:43:28.000000000 +0100
378 #include <asm/mipsregs.h>
379 #include <asm/system.h>
381 -#include <asm/mach-rc32434/rc32434.h>
382 +#include <asm/mach-rc32434/irq.h>
385 u32 mask; /* mask of valid bits in pending/mask registers */
386 diff -urN a/arch/mips/rb532/prom.c b/arch/mips/rb532/prom.c
387 --- a/arch/mips/rb532/prom.c 2008-11-07 18:55:34.000000000 +0100
388 +++ b/arch/mips/rb532/prom.c 2008-11-15 17:43:28.000000000 +0100
390 #include <asm/mach-rc32434/ddr.h>
391 #include <asm/mach-rc32434/prom.h>
393 -extern void __init setup_serial_port(void);
395 unsigned int idt_cpu_freq = 132000000;
396 EXPORT_SYMBOL(idt_cpu_freq);
397 -unsigned int gpio_bootup_state;
398 -EXPORT_SYMBOL(gpio_bootup_state);
400 static struct resource ddr_reg[] = {
403 mips_machtype = MACH_MIKROTIK_RB532;
406 - if (match_tag(prom_argv[i], GPIO_TAG))
407 - gpio_bootup_state = tag2ul(prom_argv[i], GPIO_TAG);
409 strcpy(cp, prom_argv[i]);
410 cp += strlen(prom_argv[i]);
413 strcpy(cp, arcs_cmdline);
414 cp += strlen(arcs_cmdline);
416 - if (gpio_bootup_state & 0x02)
417 - strcpy(cp, GPIO_INIT_NOBUTTON);
419 - strcpy(cp, GPIO_INIT_BUTTON);
421 cmd_line[CL_SIZE-1] = '\0';
423 strcpy(arcs_cmdline, cmd_line);
424 diff -urN a/arch/mips/rb532/serial.c b/arch/mips/rb532/serial.c
425 --- a/arch/mips/rb532/serial.c 2008-11-07 18:55:34.000000000 +0100
426 +++ b/arch/mips/rb532/serial.c 2008-11-15 17:43:28.000000000 +0100
428 #include <linux/serial_8250.h>
430 #include <asm/serial.h>
431 -#include <asm/mach-rc32434/rc32434.h>
432 +#include <asm/mach-rc32434/rb.h>
434 extern unsigned int idt_cpu_freq;
436 static struct uart_port rb532_uart = {
439 - .irq = RC32434_UART0_IRQ,
442 - .membase = (char *)KSEG1ADDR(RC32434_UART0_BASE),
443 + .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
447 diff -urN a/arch/mips/rb532/setup.c b/arch/mips/rb532/setup.c
448 --- a/arch/mips/rb532/setup.c 2008-11-07 18:55:34.000000000 +0100
449 +++ b/arch/mips/rb532/setup.c 2008-11-15 17:43:28.000000000 +0100
451 #include <asm/time.h>
452 #include <linux/ioport.h>
454 -#include <asm/mach-rc32434/rc32434.h>
455 +#include <asm/mach-rc32434/rb.h>
456 #include <asm/mach-rc32434/pci.h>
458 struct pci_reg __iomem *pci_reg;
460 static void rb_machine_restart(char *command)
462 /* just jump to the reset vector */
463 - writel(0x80000001, (void *)KSEG1ADDR(RC32434_REG_BASE + RC32434_RST));
464 + writel(0x80000001, IDT434_REG_BASE + RST);
465 ((void (*)(void)) KSEG1ADDR(0x1FC00000u))();
468 diff -urN a/arch/mips/rb532/time.c b/arch/mips/rb532/time.c
469 --- a/arch/mips/rb532/time.c 2008-11-07 18:55:34.000000000 +0100
470 +++ b/arch/mips/rb532/time.c 2008-11-15 17:43:28.000000000 +0100
472 #include <linux/timex.h>
474 #include <asm/mipsregs.h>
475 -#include <asm/debug.h>
476 #include <asm/time.h>
477 #include <asm/mach-rc32434/rc32434.h>
479 diff -urN linux-2.6.27.5/arch/mips/Kconfig linux-2.6.27.5.new/arch/mips/Kconfig
480 --- linux-2.6.27.5/arch/mips/Kconfig 2008-11-07 18:55:34.000000000 +0100
481 +++ linux-2.6.27.5.new/arch/mips/Kconfig 2008-11-15 17:50:42.000000000 +0100
483 select SYS_SUPPORTS_LITTLE_ENDIAN
486 - select GENERIC_GPIO
487 + select ARCH_REQUIRE_GPIOLIB
489 Support the Mikrotik(tm) RouterBoard 532 series,
490 based on the IDT RC32434 SoC.
491 diff -urN a/include/asm-mips/mach-rc32434/gpio.h b/include-mips/asm/mach-rc32434/gpio.h
492 --- a/include/asm-mips/mach-rc32434/gpio.h 2008-11-07 18:55:34.000000000 +0100
493 +++ b/include/asm-mips/mach-rc32434/gpio.h 2008-11-15 17:43:28.000000000 +0100
495 #define _RC32434_GPIO_H_
497 #include <linux/types.h>
498 +#include <asm-generic/gpio.h>
500 +#define NR_BUILTIN_GPIO 32
502 +#define gpio_get_value __gpio_get_value
503 +#define gpio_set_value __gpio_set_value
504 +#define gpio_cansleep __gpio_cansleep
506 +#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
507 +#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
509 struct rb532_gpio_reg {
510 u32 gpiofunc; /* GPIO Function Register
512 /* PCI messaging unit */
513 #define RC32434_PCI_MSU_GPIO (1 << 13)
515 +/* NAND GPIO signals */
521 +/* Compact Flash GPIO pin */
522 +#define CF_GPIO_NUM 13
524 extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val);
525 extern unsigned get_434_reg(unsigned reg_offs);
526 extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
527 extern unsigned char get_latch_u5(void);
529 -extern int rb532_gpio_get_value(unsigned gpio);
530 -extern void rb532_gpio_set_value(unsigned gpio, int value);
531 -extern int rb532_gpio_direction_input(unsigned gpio);
532 -extern int rb532_gpio_direction_output(unsigned gpio, int value);
533 -extern void rb532_gpio_set_int_level(unsigned gpio, int value);
534 -extern int rb532_gpio_get_int_level(unsigned gpio);
535 -extern void rb532_gpio_set_int_status(unsigned gpio, int value);
536 -extern int rb532_gpio_get_int_status(unsigned gpio);
539 -/* Wrappers for the arch-neutral GPIO API */
541 -static inline int gpio_request(unsigned gpio, const char *label)
543 - /* Not yet implemented */
547 -static inline void gpio_free(unsigned gpio)
549 - /* Not yet implemented */
552 -static inline int gpio_direction_input(unsigned gpio)
554 - return rb532_gpio_direction_input(gpio);
557 -static inline int gpio_direction_output(unsigned gpio, int value)
559 - return rb532_gpio_direction_output(gpio, value);
562 -static inline int gpio_get_value(unsigned gpio)
564 - return rb532_gpio_get_value(gpio);
567 -static inline void gpio_set_value(unsigned gpio, int value)
569 - rb532_gpio_set_value(gpio, value);
572 -static inline int gpio_to_irq(unsigned gpio)
577 -static inline int irq_to_gpio(unsigned irq)
583 -#include <asm-generic/gpio.h>
584 +extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
585 +extern void rb532_gpio_set_istat(int bit, unsigned gpio);
587 #endif /* _RC32434_GPIO_H_ */
588 diff -urN a/include/asm-mips/mach-rc32434/irq.h b/include/asm-mips/mach-rc32434/irq.h
589 --- a/include/asm-mips/mach-rc32434/irq.h 2008-11-07 18:55:34.000000000 +0100
590 +++ b/include/asm-mips/mach-rc32434/irq.h 2008-11-15 17:43:28.000000000 +0100
594 #include <asm/mach-generic/irq.h>
595 +#include <asm/mach-rc32434/rb.h>
597 +/* Interrupt Controller */
598 +#define IC_GROUP0_PEND (REGBASE + 0x38000)
599 +#define IC_GROUP0_MASK (REGBASE + 0x38008)
600 +#define IC_GROUP_OFFSET 0x0C
602 +#define NUM_INTR_GROUPS 5
605 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
606 + /* GRP3 IRQ numbers start here */
607 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
608 + /* GRP4 IRQ numbers start here */
609 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
610 + /* GRP5 IRQ numbers start here */
611 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
612 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
614 +#define UART0_IRQ (GROUP3_IRQ_BASE + 0)
616 +#define ETH0_DMA_RX_IRQ (GROUP1_IRQ_BASE + 0)
617 +#define ETH0_DMA_TX_IRQ (GROUP1_IRQ_BASE + 1)
618 +#define ETH0_RX_OVR_IRQ (GROUP3_IRQ_BASE + 9)
619 +#define ETH0_TX_UND_IRQ (GROUP3_IRQ_BASE + 10)
621 #endif /* __ASM_RC32434_IRQ_H */
622 diff -urN a/include/asm-mips/mach-rc32434/prom.h b/include/asm-mips/mach-rc32434/prom.h
623 --- a/include/asm-mips/mach-rc32434/prom.h 2008-11-07 18:55:34.000000000 +0100
624 +++ b/include/asm-mips/mach-rc32434/prom.h 2008-11-15 17:43:28.000000000 +0100
627 #define PROM_ENTRY(x) (0xbfc00000 + ((x) * 8))
629 -#define GPIO_INIT_NOBUTTON ""
630 -#define GPIO_INIT_BUTTON " 2"
632 #define SR_NMI 0x00180000
633 #define SERIAL_SPEED_ENTRY 0x00000001
635 #define FREQ_TAG "HZ="
636 -#define GPIO_TAG "gpio="
637 #define KMAC_TAG "kmac="
638 #define MEM_TAG "mem="
639 #define BOARD_TAG "board="
640 diff -urN a/include/asm-mips/mach-rc32434/rb.h b/include/asm-mips/mach-rc32434/rb.h
641 --- a/include/asm-mips/mach-rc32434/rb.h 2008-11-07 18:55:34.000000000 +0100
642 +++ b/include/asm-mips/mach-rc32434/rb.h 2008-11-15 17:43:28.000000000 +0100
645 #include <linux/genhd.h>
647 -#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(0x18000000))
648 +#define REGBASE 0x18000000
649 +#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
650 +#define UART0BASE 0x58000
651 +#define RST (1 << 15)
652 #define DEV0BASE 0x010000
653 #define DEV0MASK 0x010004
654 #define DEV0C 0x010008
656 #define BTCS 0x010040
657 #define BTCOMPARE 0x010044
658 #define GPIOBASE 0x050000
659 -#define GPIOCFG 0x050004
660 -#define GPIOD 0x050008
661 -#define GPIOILEVEL 0x05000C
662 -#define GPIOISTAT 0x050010
663 -#define GPIONMIEN 0x050014
664 -#define IMASK6 0x038038
665 +/* Offsets relative to GPIOBASE */
666 +#define GPIOFUNC 0x00
667 +#define GPIOCFG 0x04
669 +#define GPIOILEVEL 0x0C
670 +#define GPIOISTAT 0x10
671 +#define GPIONMIEN 0x14
673 #define LO_WPX (1 << 0)
674 #define LO_ALE (1 << 1)
675 #define LO_CLE (1 << 2)
676 diff -urN a/include/asm-mips/mach-rc32434/rc32434.h b/include/asm-mips/mach-rc32434/rc32434.h
677 --- a/include/asm-mips/mach-rc32434/rc32434.h 2008-11-07 18:55:34.000000000 +0100
678 +++ b/include/asm-mips/mach-rc32434/rc32434.h 2008-11-15 17:43:28.000000000 +0100
680 #include <linux/delay.h>
681 #include <linux/io.h>
683 -#define RC32434_REG_BASE 0x18000000
684 -#define RC32434_RST (1 << 15)
686 #define IDT_CLOCK_MULT 2
687 -#define MIPS_CPU_TIMER_IRQ 7
689 -/* Interrupt Controller */
690 -#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
691 -#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
692 -#define IC_GROUP_OFFSET 0x0C
694 -#define NUM_INTR_GROUPS 5
697 -#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
698 - /* GRP3 IRQ numbers start here */
699 -#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
700 - /* GRP4 IRQ numbers start here */
701 -#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
702 - /* GRP5 IRQ numbers start here */
703 -#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
704 -#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
708 -#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
710 -#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
713 -#define RC32434_UART0_IRQ (GROUP3_IRQ_BASE + 0)
715 /* cpu pipeline flush */
716 static inline void rc32434_sync(void)
718 __asm__ volatile ("sync");
721 -static inline void rc32434_sync_udelay(int us)
723 - __asm__ volatile ("sync");
727 -static inline void rc32434_sync_delay(int ms)
729 - __asm__ volatile ("sync");
733 #endif /* _ASM_RC32434_RC32434_H_ */
734 --- a/arch/mips/pci/fixup-rc32434.c 2008-11-07 18:55:34.000000000 +0100
735 +++ b/arch/mips/pci/fixup-rc32434.c 2008-11-15 17:43:28.000000000 +0100
737 #include <linux/init.h>
739 #include <asm/mach-rc32434/rc32434.h>
740 +#include <asm/mach-rc32434/irq.h>
742 static int __devinitdata irq_map[2][12] = {
743 {0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1},