diff -urN linux-2.4.25-vrs2.orig/arch/arm/config.in linux-2.4.25-vrs2/arch/arm/config.in --- linux-2.4.25-vrs2.orig/arch/arm/config.in Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/arch/arm/config.in Mon Mar 8 13:14:46 2004 @@ -541,7 +541,8 @@ "$CONFIG_ARCH_INTEGRATOR" = "y" -o \ "$CONFIG_ARCH_CDB89712" = "y" -o \ "$CONFIG_ARCH_P720T" = "y" -o \ - "$CONFIG_ARCH_OMAHA" = "y" ]; then + "$CONFIG_ARCH_OMAHA" = "y" -o \ + "$CONFIG_ARCH_AT91RM9200" = "y" ]; then bool 'Timer and CPU usage LEDs' CONFIG_LEDS if [ "$CONFIG_LEDS" = "y" ]; then if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \ @@ -551,7 +552,8 @@ "$CONFIG_ARCH_SA1100" = "y" -o \ "$CONFIG_ARCH_INTEGRATOR" = "y" -o \ "$CONFIG_ARCH_P720T" = "y" -o \ - "$CONFIG_ARCH_OMAHA" = "y" ]; then + "$CONFIG_ARCH_OMAHA" = "y" -o \ + "$CONFIG_ARCH_AT91RM9200" = "y" ]; then bool ' Timer LED' CONFIG_LEDS_TIMER bool ' CPU usage LED' CONFIG_LEDS_CPU fi diff -urN linux-2.4.25-vrs2.orig/arch/arm/mach-at91rm9200/Makefile linux-2.4.25-vrs2/arch/arm/mach-at91rm9200/Makefile --- linux-2.4.25-vrs2.orig/arch/arm/mach-at91rm9200/Makefile Mon Mar 8 10:13:35 2004 +++ linux-2.4.25-vrs2/arch/arm/mach-at91rm9200/Makefile Mon Mar 8 13:14:46 2004 @@ -18,4 +18,8 @@ export-objs := +# LEDs support +leds-$(CONFIG_ARCH_AT91RM9200DK) += dk-leds.o +obj-$(CONFIG_LEDS) += $(leds-y) + include $(TOPDIR)/Rules.make diff -urN linux-2.4.25-vrs2.orig/arch/arm/mach-at91rm9200/dk-leds.c linux-2.4.25-vrs2/arch/arm/mach-at91rm9200/dk-leds.c --- linux-2.4.25-vrs2.orig/arch/arm/mach-at91rm9200/dk-leds.c Thu Jan 1 02:00:00 1970 +++ linux-2.4.25-vrs2/arch/arm/mach-at91rm9200/dk-leds.c Mon Mar 8 13:14:46 2004 @@ -0,0 +1,97 @@ +/* + * LED driver for the Atmel AT91RM9200 Development Kit. + * + * (c) SAN People (Pty) Ltd + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include + + +static inline void at91_led_on(void) +{ + AT91_SYS->PIOB_CODR = AT91C_PIO_PB2; +} + +static inline void at91_led_off(void) +{ + AT91_SYS->PIOB_SODR = AT91C_PIO_PB2; +} + +static inline void at91_led_toggle(void) +{ + unsigned long curr = AT91_SYS->PIOB_ODSR; + if (curr & AT91C_PIO_PB2) + AT91_SYS->PIOB_CODR = AT91C_PIO_PB2; + else + AT91_SYS->PIOB_SODR = AT91C_PIO_PB2; +} + + +/* + * Handle LED events. + */ +static void at91rm9200dk_leds_event(led_event_t evt) +{ + unsigned long flags; + + local_irq_save(flags); + + switch(evt) { + case led_start: /* System startup */ + at91_led_on(); + break; + + case led_stop: /* System stop / suspend */ + at91_led_off(); + break; + +#ifdef CONFIG_LEDS_TIMER + case led_timer: /* Every 50 timer ticks */ + at91_led_toggle(); + break; +#endif + +#ifdef CONFIG_LEDS_CPU + case led_idle_start: /* Entering idle state */ + at91_led_off(); + break; + + case led_idle_end: /* Exit idle state */ + at91_led_on(); + break; +#endif + + default: + break; + } + + local_irq_restore(flags); +} + + +static int __init leds_init(void) +{ + /* Enable PIO to access the LEDs */ + AT91_SYS->PIOB_PER = AT91C_PIO_PB2; + AT91_SYS->PIOB_OER = AT91C_PIO_PB2; + + leds_event = at91rm9200dk_leds_event; + + leds_event(led_start); + return 0; +} + +__initcall(leds_init); diff -urN linux-2.4.25-vrs2.orig/drivers/at91/mtd/at91_dataflash.c linux-2.4.25-vrs2/drivers/at91/mtd/at91_dataflash.c --- linux-2.4.25-vrs2.orig/drivers/at91/mtd/at91_dataflash.c Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/mtd/at91_dataflash.c Mon Mar 8 13:15:52 2004 @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -68,12 +69,12 @@ If this is not valid, then either (i) each dataflash 'priv' structure needs it's own transfer descriptor, (ii) we lock this one, or (iii) use another mechanism. */ -struct spi_transfer_list* spi_transfer_desc; +static struct spi_transfer_list* spi_transfer_desc; /* * Perform a SPI transfer to access the DataFlash device. */ -int do_spi_transfer(int nr, char* tx, int tx_len, char* rx, int rx_len, +static int do_spi_transfer(int nr, char* tx, int tx_len, char* rx, int rx_len, char* txnext, int txnext_len, char* rxnext, int rxnext_len) { struct spi_transfer_list* list = spi_transfer_desc; @@ -94,7 +95,7 @@ /* * Poll the DataFlash device until it is READY. */ -void at91_dataflash_waitready(void) +static void at91_dataflash_waitready(void) { char* command = kmalloc(2, GFP_KERNEL); @@ -114,7 +115,7 @@ /* * Return the status of the DataFlash device. */ -unsigned short at91_dataflash_status(void) +static unsigned short at91_dataflash_status(void) { unsigned short status; char* command = kmalloc(2, GFP_KERNEL); @@ -135,9 +136,9 @@ /* ......................................................................... */ /* - * Erase a block of flash. + * Erase blocks of flash. */ -int at91_dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) +static int at91_dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) { struct dataflash_local *priv = (struct dataflash_local *) mtd->priv; unsigned int pageaddr; @@ -150,7 +151,7 @@ /* Sanity checks */ if (instr->addr + instr->len > mtd->size) return -EINVAL; - if ((instr->len != mtd->erasesize) || (instr->len != priv->page_size)) + if ((instr->len % mtd->erasesize != 0) || (instr->len % priv->page_size != 0)) return -EINVAL; if ((instr->addr % priv->page_size) != 0) return -EINVAL; @@ -159,23 +160,28 @@ if (!command) return -ENOMEM; - /* Calculate flash page address */ - pageaddr = (instr->addr / priv->page_size) << priv->page_offset; - - command[0] = OP_ERASE_PAGE; - command[1] = (pageaddr & 0x00FF0000) >> 16; - command[2] = (pageaddr & 0x0000FF00) >> 8; - command[3] = 0; + while (instr->len > 0) { + /* Calculate flash page address */ + pageaddr = (instr->addr / priv->page_size) << priv->page_offset; + + command[0] = OP_ERASE_PAGE; + command[1] = (pageaddr & 0x00FF0000) >> 16; + command[2] = (pageaddr & 0x0000FF00) >> 8; + command[3] = 0; #ifdef DEBUG_DATAFLASH - printk("ERASE: (%x) %x %x %x [%i]\n", command[0], command[1], command[2], command[3], pageaddr); + printk("ERASE: (%x) %x %x %x [%i]\n", command[0], command[1], command[2], command[3], pageaddr); #endif - /* Send command to SPI device */ - spi_access_bus(priv->spi); - do_spi_transfer(1, command, 4, command, 4, NULL, 0, NULL, 0); + /* Send command to SPI device */ + spi_access_bus(priv->spi); + do_spi_transfer(1, command, 4, command, 4, NULL, 0, NULL, 0); - at91_dataflash_waitready(); /* poll status until ready */ - spi_release_bus(priv->spi); + at91_dataflash_waitready(); /* poll status until ready */ + spi_release_bus(priv->spi); + + instr->addr += priv->page_size; /* next page */ + instr->len -= priv->page_size; + } kfree(command); @@ -194,7 +200,7 @@ * retlen : About of data actually read * buf : Buffer containing the data */ -int at91_dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) +static int at91_dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { struct dataflash_local *priv = (struct dataflash_local *) mtd->priv; unsigned int addr; @@ -244,15 +250,16 @@ * retlen : Amount of data actually written * buf : Buffer containing the data */ -int at91_dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) +static int at91_dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { struct dataflash_local *priv = (struct dataflash_local *) mtd->priv; unsigned int pageaddr, addr, offset, writelen; size_t remaining; - char *writebuf; + u_char *writebuf; unsigned short status; int res = 0; char* command; + char* tmpbuf = NULL; #ifdef DEBUG_DATAFLASH printk("dataflash_write: %lli .. %lli\n", to, to+len); @@ -279,6 +286,13 @@ writebuf = buf; remaining = len; + /* Allocate temporary buffer */ + tmpbuf = kmalloc(priv->page_size, GFP_KERNEL); + if (!tmpbuf) { + kfree(command); + return -ENOMEM; + } + /* Gain access to the SPI bus */ spi_access_bus(priv->spi); @@ -310,7 +324,7 @@ #ifdef DEBUG_DATAFLASH printk("PROGRAM: (%x) %x %x %x\n", command[0], command[1], command[2], command[3]); #endif - do_spi_transfer(2, command, 4, command, 4, writebuf, writelen, writebuf, writelen); + do_spi_transfer(2, command, 4, command, 4, writebuf, writelen, tmpbuf, writelen); at91_dataflash_waitready(); /* (3) Compare to Buffer1 */ @@ -348,6 +362,7 @@ /* Release SPI bus */ spi_release_bus(priv->spi); + kfree(tmpbuf); kfree(command); return res; } @@ -357,7 +372,7 @@ /* * Initialize and register DataFlash device with MTD subsystem. */ -int add_dataflash(int channel, char *name, int size, int pagesize, int pageoffset) +static int add_dataflash(int channel, char *name, int IDsize, int nr_pages, int pagesize, int pageoffset) { struct mtd_info *device; struct dataflash_local *priv; @@ -376,7 +391,7 @@ memset(device, 0, sizeof(struct mtd_info)); device->name = name; - device->size = size; + device->size = nr_pages * pagesize; device->erasesize = pagesize; device->module = THIS_MODULE; device->type = MTD_NORFLASH; @@ -399,7 +414,7 @@ mtd_devices[nr_devices] = device; nr_devices++; - printk("at91_dataflash: %s detected [spi%i] (%i bytes)\n", name, channel, size); + printk("at91_dataflash: %s detected [spi%i] (%i bytes)\n", name, channel, device->size); #ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_CMDLINE_PARTS @@ -411,16 +426,30 @@ mtd_parts_nr = NB_OF(static_partitions); } - return add_mtd_partitions(device, mtd_parts, mtd_parts_nr); -#else - return add_mtd_device(device); + if (mtd_parts_nr > 0) { +#ifdef DATAFLASH_ALWAYS_ADD_DEVICE + add_mtd_device(device); +#endif + return add_mtd_partitions(device, mtd_parts, mtd_parts_nr); + } #endif + return add_mtd_device(device); /* add whole device */ } /* * Detect and initialize DataFlash device connected to specified SPI channel. + * + * Device Density ID code Nr Pages Page Size Page offset + * AT45DB011B 1Mbit (128K) xx0011xx (0x0c) 512 264 9 + * AT45DB021B 2Mbit (256K) xx0101xx (0x14) 1025 264 9 + * AT45DB041B 4Mbit (512K) xx0111xx (0x1c) 2048 264 9 + * AT45DB081B 8Mbit (1M) xx1001xx (0x24) 4096 264 9 + * AT45DB0161B 16Mbit (2M) xx1011xx (0x2c) 4096 528 10 + * AT45DB0321B 32Mbit (4M) xx1101xx (0x34) 8192 528 10 + * AT45DB0642 64Mbit (8M) xx1111xx (0x3c) 8192 1056 11 + * AT45DB1282 128Mbit (16M) xx0100xx (0x10) 16384 1056 11 */ -int at91_dataflash_detect(int channel) +static int at91_dataflash_detect(int channel) { int res = 0; unsigned short status; @@ -429,15 +458,31 @@ status = at91_dataflash_status(); if (status != 0xff) { /* no dataflash device there */ switch (status & 0x3c) { + case 0x0c: /* 0 0 1 1 */ + res = add_dataflash(channel, "Atmel AT45DB011B", SZ_128K, 512, 264, 9); + break; + case 0x14: /* 0 1 0 1 */ + res = add_dataflash(channel, "Atmel AT45DB021B", SZ_256K, 1025, 264, 9); + break; + case 0x1c: /* 0 1 1 1 */ + res = add_dataflash(channel, "Atmel AT45DB041B", SZ_512K, 2048, 264, 9); + break; + case 0x24: /* 1 0 0 1 */ + res = add_dataflash(channel, "Atmel AT45DB081B", SZ_1M, 4096, 264, 9); + break; case 0x2c: /* 1 0 1 1 */ - res = add_dataflash(channel, "Atmel AT45DB161B", 4096*528, 528, 10); + res = add_dataflash(channel, "Atmel AT45DB161B", SZ_2M, 4096, 528, 10); break; case 0x34: /* 1 1 0 1 */ - res = add_dataflash(channel, "Atmel AT45DB321B", 8192*528, 528, 10); + res = add_dataflash(channel, "Atmel AT45DB321B", SZ_4M, 8192, 528, 10); break; case 0x3c: /* 1 1 1 1 */ - res = add_dataflash(channel, "Atmel AT45DB642", 8192*1056, 1056, 11); + res = add_dataflash(channel, "Atmel AT45DB642", SZ_8M, 8192, 1056, 11); break; +// Currently unsupported since Atmel removed the "Main Memory Program via Buffer" commands. +// case 0x10: /* 0 1 0 0 */ +// res = add_dataflash(channel, "Atmel AT45DB1282", SZ_16M, 16384, 1056, 11); +// break; default: printk(KERN_ERR "at91_dataflash: Unknown device (%x)\n", status & 0x3c); } @@ -447,7 +492,7 @@ return res; } -int __init at91_dataflash_init(void) +static int __init at91_dataflash_init(void) { spi_transfer_desc = kmalloc(sizeof(struct spi_transfer_list), GFP_KERNEL); if (!spi_transfer_desc) @@ -465,7 +510,7 @@ return 0; } -void __exit at91_dataflash_exit(void) +static void __exit at91_dataflash_exit(void) { int i; diff -urN linux-2.4.25-vrs2.orig/drivers/at91/mtd/at91_dataflash.h linux-2.4.25-vrs2/drivers/at91/mtd/at91_dataflash.h --- linux-2.4.25-vrs2.orig/drivers/at91/mtd/at91_dataflash.h Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/mtd/at91_dataflash.h Mon Mar 8 13:15:52 2004 @@ -13,6 +13,7 @@ #define AT91_DATAFLASH_H #define DATAFLASH_MAX_DEVICES 4 /* max number of dataflash devices */ +#undef DATAFLASH_ALWAYS_ADD_DEVICE /* always add whole device when using partitions? */ #define OP_READ_CONTINUOUS 0xE8 #define OP_READ_PAGE 0xD2 diff -urN linux-2.4.25-vrs2.orig/drivers/at91/serial/at91_serial.c linux-2.4.25-vrs2/drivers/at91/serial/at91_serial.c --- linux-2.4.25-vrs2.orig/drivers/at91/serial/at91_serial.c Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/serial/at91_serial.c Mon Mar 8 13:15:57 2004 @@ -77,11 +77,19 @@ static struct tty_driver normal, callout; static struct tty_struct *at91_table[AT91C_NR_UART]; static struct termios *at91_termios[AT91C_NR_UART], *at91_termios_locked[AT91C_NR_UART]; +static int (*at91_open)(struct uart_port *); +static void (*at91_close)(struct uart_port *); const int at91_serialmap[AT91C_NR_UART] = AT91C_UART_MAP; -static int (*at91_open)(struct uart_port *); -static void (*at91_close)(struct uart_port *); +/* + * We wrap our port structure around the generic uart_port. + */ +struct at91_serial_port { + struct uart_port uart; +}; + +static struct at91_serial_port at91_ports[AT91C_NR_UART]; #ifdef SUPPORT_SYSRQ static struct console at91_console; @@ -90,15 +98,15 @@ /* * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty. */ -static u_int at91_tx_empty(struct uart_port *port) +static u_int at91_tx_empty(struct uart_port *uart) { - return UART_GET_CSR(port) & AT91C_US_TXEMPTY ? TIOCSER_TEMT : 0; + return UART_GET_CSR(uart) & AT91C_US_TXEMPTY ? TIOCSER_TEMT : 0; } /* * Set state of the modem control output lines */ -static void at91_set_mctrl(struct uart_port *port, u_int mctrl) +static void at91_set_mctrl(struct uart_port *uart, u_int mctrl) { unsigned int control = 0; @@ -112,17 +120,17 @@ else control |= AT91C_US_DTRDIS; - UART_PUT_CR(port,control); + UART_PUT_CR(uart, control); } /* * Get state of the modem control input lines */ -static u_int at91_get_mctrl(struct uart_port *port) +static u_int at91_get_mctrl(struct uart_port *uart) { unsigned int status, ret = 0; - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); if (status & AT91C_US_DCD) ret |= TIOCM_CD; if (status & AT91C_US_CTS) @@ -138,68 +146,68 @@ /* * Stop transmitting. */ -static void at91_stop_tx(struct uart_port *port, u_int from_tty) +static void at91_stop_tx(struct uart_port *uart, u_int from_tty) { - UART_PUT_IDR(port, AT91C_US_TXRDY); - port->read_status_mask &= ~AT91C_US_TXRDY; + UART_PUT_IDR(uart, AT91C_US_TXRDY); + uart->read_status_mask &= ~AT91C_US_TXRDY; } /* * Start transmitting. */ -static void at91_start_tx(struct uart_port *port, u_int from_tty) +static void at91_start_tx(struct uart_port *uart, u_int from_tty) { unsigned long flags; local_irq_save(flags); - port->read_status_mask |= AT91C_US_TXRDY; - UART_PUT_IER(port, AT91C_US_TXRDY); + uart->read_status_mask |= AT91C_US_TXRDY; + UART_PUT_IER(uart, AT91C_US_TXRDY); local_irq_restore(flags); } /* * Stop receiving - port is in process of being closed. */ -static void at91_stop_rx(struct uart_port *port) +static void at91_stop_rx(struct uart_port *uart) { - UART_PUT_IDR(port, AT91C_US_RXRDY); + UART_PUT_IDR(uart, AT91C_US_RXRDY); } /* * Enable modem status interrupts */ -static void at91_enable_ms(struct uart_port *port) +static void at91_enable_ms(struct uart_port *uart) { - UART_PUT_IER(port, AT91C_US_RIIC | AT91C_US_DSRIC | AT91C_US_DCDIC | AT91C_US_CTSIC); + UART_PUT_IER(uart, AT91C_US_RIIC | AT91C_US_DSRIC | AT91C_US_DCDIC | AT91C_US_CTSIC); } /* * Control the transmission of a break signal */ -static void at91_break_ctl(struct uart_port *port, int break_state) +static void at91_break_ctl(struct uart_port *uart, int break_state) { if (break_state != 0) - UART_PUT_CR(port, AT91C_US_STTBRK); /* start break */ + UART_PUT_CR(uart, AT91C_US_STTBRK); /* start break */ else - UART_PUT_CR(port, AT91C_US_STPBRK); /* stop break */ + UART_PUT_CR(uart, AT91C_US_STPBRK); /* stop break */ } /* * Characters received (called from interrupt handler) */ -static void at91_rx_chars(struct uart_port *port, struct pt_regs *regs) +static void at91_rx_chars(struct at91_serial_port *port, struct pt_regs *regs) { - struct uart_info *info = port->info; - struct tty_struct *tty = info->tty; + struct uart_port *uart = &port->uart; + struct tty_struct *tty = uart->info->tty; unsigned int status, ch, flg, ignored = 0; - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); while (status & (AT91C_US_RXRDY)) { - ch = UART_GET_CHAR(port); + ch = UART_GET_CHAR(uart); if (tty->flip.count >= TTY_FLIPBUF_SIZE) goto ignore_char; - port->icount.rx++; + uart->icount.rx++; flg = TTY_NORMAL; @@ -210,7 +218,7 @@ if (status & (AT91C_US_PARE | AT91C_US_FRAME | AT91C_US_OVRE)) goto handle_error; - if (uart_handle_sysrq_char(port, ch, regs)) + if (uart_handle_sysrq_char(uart, ch, regs)) goto ignore_char; error_return: @@ -218,7 +226,7 @@ *tty->flip.char_buf_ptr++ = ch; tty->flip.count++; ignore_char: - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); } out: tty_flip_buffer_push(tty); @@ -226,23 +234,23 @@ handle_error: if (status & (AT91C_US_PARE | AT91C_US_FRAME | AT91C_US_OVRE)) - UART_PUT_CR(port, AT91C_US_RSTSTA); /* clear error */ + UART_PUT_CR(uart, AT91C_US_RSTSTA); /* clear error */ if (status & (AT91C_US_PARE)) - port->icount.parity++; + uart->icount.parity++; else if (status & (AT91C_US_FRAME)) - port->icount.frame++; + uart->icount.frame++; if (status & (AT91C_US_OVRE)) - port->icount.overrun++; + uart->icount.overrun++; - if (status & port->ignore_status_mask) { + if (status & uart->ignore_status_mask) { if (++ignored > 100) goto out; goto ignore_char; } - status &= port->read_status_mask; + status &= uart->read_status_mask; - UART_PUT_CR(port, AT91C_US_RSTSTA); /* clear error */ + UART_PUT_CR(uart, AT91C_US_RSTSTA); /* clear error */ if (status & AT91C_US_PARE) flg = TTY_PARITY; else if (status & AT91C_US_FRAME) @@ -262,7 +270,7 @@ flg = TTY_OVERRUN; } #ifdef SUPPORT_SYSRQ - port->sysrq = 0; + uart->sysrq = 0; #endif goto error_return; } @@ -270,34 +278,36 @@ /* * Transmit characters (called from interrupt handler) */ -static void at91_tx_chars(struct uart_port *port) +static void at91_tx_chars(struct at91_serial_port *port) { - struct circ_buf *xmit = &port->info->xmit; + struct uart_port *uart = &port->uart; + struct circ_buf *xmit = &uart->info->xmit; - if (port->x_char) { - UART_PUT_CHAR(port, port->x_char); - port->icount.tx++; - port->x_char = 0; + if (uart->x_char) { + UART_PUT_CHAR(uart, uart->x_char); + uart->icount.tx++; + uart->x_char = 0; return; } - if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - at91_stop_tx(port, 0); + + if (uart_circ_empty(xmit) || uart_tx_stopped(uart)) { + at91_stop_tx(uart, 0); return; } - while (UART_GET_CSR(port) & AT91C_US_TXRDY) { - UART_PUT_CHAR(port, xmit->buf[xmit->tail]); + while (UART_GET_CSR(uart) & AT91C_US_TXRDY) { + UART_PUT_CHAR(uart, xmit->buf[xmit->tail]); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart->icount.tx++; if (uart_circ_empty(xmit)) break; } if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); + uart_write_wakeup(uart); if (uart_circ_empty(xmit)) - at91_stop_tx(port, 0); + at91_stop_tx(uart, 0); } /* @@ -305,11 +315,12 @@ */ static void at91_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct uart_port *port = dev_id; + struct at91_serial_port *port = dev_id; + struct uart_port *uart = &port->uart; unsigned int status, pending, pass_counter = 0; - status = UART_GET_CSR(port); - pending = status & port->read_status_mask; + status = UART_GET_CSR(uart); + pending = status & uart->read_status_mask; if (pending) { do { if (pending & AT91C_US_RXRDY) @@ -317,36 +328,37 @@ /* Clear the relevent break bits */ if (pending & AT91C_US_RXBRK) { - UART_PUT_CR(port, AT91C_US_RSTSTA); - port->icount.brk++; + UART_PUT_CR(uart, AT91C_US_RSTSTA); + uart->icount.brk++; #ifdef SUPPORT_SYSRQ - if (port->line == at91_console.index && !port->sysrq) { - port->sysrq = jiffies + HZ*5; + if (uart->line == at91_console.index && !uart->sysrq) { + uart->sysrq = jiffies + HZ*5; } #endif } // TODO: All reads to CSR will clear these interrupts! - if (pending & AT91C_US_RIIC) port->icount.rng++; - if (pending & AT91C_US_DSRIC) port->icount.dsr++; + if (pending & AT91C_US_RIIC) uart->icount.rng++; + if (pending & AT91C_US_DSRIC) uart->icount.dsr++; if (pending & AT91C_US_DCDIC) { - port->icount.dcd++; - uart_handle_dcd_change(port, status & AT91C_US_DCD); + uart->icount.dcd++; + uart_handle_dcd_change(uart, status & AT91C_US_DCD); } if (pending & AT91C_US_CTSIC) { - port->icount.cts++; - uart_handle_cts_change(port, status & AT91C_US_CTS); + uart->icount.cts++; + uart_handle_cts_change(uart, status & AT91C_US_CTS); } if (pending & (AT91C_US_RIIC | AT91C_US_DSRIC | AT91C_US_DCDIC | AT91C_US_CTSIC)) - wake_up_interruptible(&port->info->delta_msr_wait); + wake_up_interruptible(&uart->info->delta_msr_wait); if (pending & AT91C_US_TXRDY) at91_tx_chars(port); + if (pass_counter++ > AT91_ISR_PASS_LIMIT) break; - status = UART_GET_CSR(port); - pending = status & port->read_status_mask; + status = UART_GET_CSR(uart); + pending = status & uart->read_status_mask; } while (pending); } } @@ -354,14 +366,14 @@ /* * Perform initialization and enable port for reception */ -static int at91_startup(struct uart_port *port) +static int at91_startup(struct uart_port *uart) { int retval; /* * Allocate the IRQ */ - retval = request_irq(port->irq, at91_interrupt, SA_SHIRQ, "at91_serial", port); + retval = request_irq(uart->irq, at91_interrupt, SA_SHIRQ, "at91_serial", uart); if (retval) { printk("at91_serial: at91_startup - Can't get irq\n"); return retval; @@ -371,54 +383,54 @@ * control line interrupts) */ if (at91_open) { - retval = at91_open(port); + retval = at91_open(uart); if (retval) { - free_irq(port->irq, port); + free_irq(uart->irq, uart); return retval; } } /* Enable peripheral clock if required */ - if (port->irq != AT91C_ID_SYS) - AT91_SYS->PMC_PCER = 1 << port->irq; + if (uart->irq != AT91C_ID_SYS) + AT91_SYS->PMC_PCER = 1 << uart->irq; - port->read_status_mask = AT91C_US_RXRDY | AT91C_US_TXRDY | AT91C_US_OVRE + uart->read_status_mask = AT91C_US_RXRDY | AT91C_US_TXRDY | AT91C_US_OVRE | AT91C_US_FRAME | AT91C_US_PARE | AT91C_US_RXBRK; /* * Finally, clear and enable interrupts */ - UART_PUT_IDR(port, -1); - UART_PUT_CR(port, AT91C_US_TXEN | AT91C_US_RXEN); /* enable xmit & rcvr */ - UART_PUT_IER(port, AT91C_US_RXRDY); /* do receive only */ + UART_PUT_IDR(uart, -1); + UART_PUT_CR(uart, AT91C_US_TXEN | AT91C_US_RXEN); /* enable xmit & rcvr */ + UART_PUT_IER(uart, AT91C_US_RXRDY); /* do receive only */ return 0; } /* * Disable the port */ -static void at91_shutdown(struct uart_port *port) +static void at91_shutdown(struct uart_port *uart) { /* * Free the interrupt */ - free_irq(port->irq, port); + free_irq(uart->irq, uart); /* * If there is a specific "close" function (to unregister * control line interrupts) */ if (at91_close) - at91_close(port); + at91_close(uart); /* * Disable all interrupts, port and break condition. */ - UART_PUT_CR(port, AT91C_US_RSTSTA); - UART_PUT_IDR(port, -1); + UART_PUT_CR(uart, AT91C_US_RSTSTA); + UART_PUT_IDR(uart, -1); /* Disable peripheral clock if required */ - if (port->irq != AT91C_ID_SYS) - AT91_SYS->PMC_PCDR = 1 << port->irq; + if (uart->irq != AT91C_ID_SYS) + AT91_SYS->PMC_PCDR = 1 << uart->irq; } static struct uart_ops at91_pops; /* forward declaration */ @@ -426,13 +438,13 @@ /* * Change the port parameters */ -static void at91_change_speed(struct uart_port *port, u_int cflag, u_int iflag, u_int quot) +static void at91_change_speed(struct uart_port *uart, u_int cflag, u_int iflag, u_int quot) { unsigned long flags; unsigned int mode, imr; /* Get current mode register */ - mode = UART_GET_MR(port) & ~(AT91C_US_CHRL | AT91C_US_NBSTOP | AT91C_US_PAR); + mode = UART_GET_MR(uart) & ~(AT91C_US_CHRL | AT91C_US_NBSTOP | AT91C_US_PAR); /* byte size */ switch (cflag & CSIZE) { @@ -470,49 +482,49 @@ else mode |= AT91C_US_PAR_NONE; - port->read_status_mask |= AT91C_US_OVRE; + uart->read_status_mask |= AT91C_US_OVRE; if (iflag & INPCK) - port->read_status_mask |= AT91C_US_FRAME | AT91C_US_PARE; + uart->read_status_mask |= AT91C_US_FRAME | AT91C_US_PARE; if (iflag & (BRKINT | PARMRK)) - port->read_status_mask |= AT91C_US_RXBRK; + uart->read_status_mask |= AT91C_US_RXBRK; /* * Characters to ignore */ - port->ignore_status_mask = 0; + uart->ignore_status_mask = 0; if (iflag & IGNPAR) - port->ignore_status_mask |= (AT91C_US_FRAME | AT91C_US_PARE); + uart->ignore_status_mask |= (AT91C_US_FRAME | AT91C_US_PARE); if (iflag & IGNBRK) { - port->ignore_status_mask |= AT91C_US_RXBRK; + uart->ignore_status_mask |= AT91C_US_RXBRK; /* * If we're ignoring parity and break indicators, * ignore overruns too (for real raw support). */ if (iflag & IGNPAR) - port->ignore_status_mask |= AT91C_US_OVRE; + uart->ignore_status_mask |= AT91C_US_OVRE; } // TODO: Ignore all characters if CREAD is set. /* first, disable interrupts and drain transmitter */ local_irq_save(flags); - imr = UART_GET_IMR(port); /* get interrupt mask */ - UART_PUT_IDR(port, -1); /* disable all interrupts */ + imr = UART_GET_IMR(uart); /* get interrupt mask */ + UART_PUT_IDR(uart, -1); /* disable all interrupts */ local_irq_restore(flags); - while (!(UART_GET_CSR(port) & AT91C_US_TXEMPTY)) { barrier(); } + while (!(UART_GET_CSR(uart) & AT91C_US_TXEMPTY)) { barrier(); } /* disable receiver and transmitter */ - UART_PUT_CR(port, AT91C_US_TXDIS | AT91C_US_RXDIS); + UART_PUT_CR(uart, AT91C_US_TXDIS | AT91C_US_RXDIS); /* set the parity, stop bits and data size */ - UART_PUT_MR(port, mode); + UART_PUT_MR(uart, mode); /* set the baud rate */ - UART_PUT_BRGR(port, quot); - UART_PUT_CR(port, AT91C_US_TXEN | AT91C_US_RXEN); + UART_PUT_BRGR(uart, quot); + UART_PUT_CR(uart, AT91C_US_TXEN | AT91C_US_RXEN); /* restore interrupts */ - UART_PUT_IER(port, imr); + UART_PUT_IER(uart, imr); /* CTS flow-control and modem-status interrupts */ if (UART_ENABLE_MS(uart, cflag)) @@ -522,27 +534,27 @@ /* * Return string describing the specified port */ -static const char *at91_type(struct uart_port *port) +static const char *at91_type(struct uart_port *uart) { - return port->type == PORT_AT91RM9200 ? "AT91_SERIAL" : NULL; + return uart->type == PORT_AT91RM9200 ? "AT91_SERIAL" : NULL; } /* * Release the memory region(s) being used by 'port'. */ -static void at91_release_port(struct uart_port *port) +static void at91_release_port(struct uart_port *uart) { - release_mem_region(port->mapbase, - port->mapbase == AT91C_VA_BASE_DBGU ? 512 : SZ_16K); + release_mem_region(uart->mapbase, + uart->mapbase == AT91C_VA_BASE_DBGU ? 512 : SZ_16K); } /* * Request the memory region(s) being used by 'port'. */ -static int at91_request_port(struct uart_port *port) +static int at91_request_port(struct uart_port *uart) { - return request_mem_region(port->mapbase, - port->mapbase == AT91C_VA_BASE_DBGU ? 512 : SZ_16K, + return request_mem_region(uart->mapbase, + uart->mapbase == AT91C_VA_BASE_DBGU ? 512 : SZ_16K, "at91_serial") != NULL ? 0 : -EBUSY; } @@ -550,31 +562,31 @@ /* * Configure/autoconfigure the port. */ -static void at91_config_port(struct uart_port *port, int flags) +static void at91_config_port(struct uart_port *uart, int flags) { if (flags & UART_CONFIG_TYPE) { - port->type = PORT_AT91RM9200; - at91_request_port(port); + uart->type = PORT_AT91RM9200; + at91_request_port(uart); } } /* * Verify the new serial_struct (for TIOCSSERIAL). */ -static int at91_verify_port(struct uart_port *port, struct serial_struct *ser) +static int at91_verify_port(struct uart_port *uart, struct serial_struct *ser) { int ret = 0; if (ser->type != PORT_UNKNOWN && ser->type != PORT_AT91RM9200) ret = -EINVAL; - if (port->irq != ser->irq) + if (uart->irq != ser->irq) ret = -EINVAL; if (ser->io_type != SERIAL_IO_MEM) ret = -EINVAL; - if (port->uartclk / 16 != ser->baud_base) + if (uart->uartclk / 16 != ser->baud_base) ret = -EINVAL; - if ((void *)port->mapbase != ser->iomem_base) + if ((void *)uart->mapbase != ser->iomem_base) ret = -EINVAL; - if (port->iobase != ser->port) + if (uart->iobase != ser->port) ret = -EINVAL; if (ser->hub6 != 0) ret = -EINVAL; @@ -600,8 +612,6 @@ verify_port: at91_verify_port, }; -static struct uart_port at91_ports[AT91C_NR_UART]; - void __init at91_init_ports(void) { static int first = 1; @@ -612,13 +622,13 @@ first = 0; for (i = 0; i < AT91C_NR_UART; i++) { - at91_ports[i].iotype = SERIAL_IO_MEM; - at91_ports[i].flags = ASYNC_BOOT_AUTOCONF; - at91_ports[i].uartclk = AT91C_MASTER_CLOCK; - at91_ports[i].ops = &at91_pops; - at91_ports[i].fifosize = 1; - at91_ports[i].line = i; - } + at91_ports[i].uart.iotype = SERIAL_IO_MEM; + at91_ports[i].uart.flags = ASYNC_BOOT_AUTOCONF; + at91_ports[i].uart.uartclk = AT91C_MASTER_CLOCK; + at91_ports[i].uart.ops = &at91_pops; + at91_ports[i].uart.fifosize = 1; + at91_ports[i].uart.line = i; + } } void __init at91_register_uart_fns(struct at91rm9200_port_fns *fns) @@ -647,33 +657,33 @@ switch (port) { case 0: - at91_ports[idx].membase = (void *) AT91C_VA_BASE_US0; - at91_ports[idx].mapbase = AT91C_VA_BASE_US0; - at91_ports[idx].irq = AT91C_ID_US0; + at91_ports[idx].uart.membase = (void *) AT91C_VA_BASE_US0; + at91_ports[idx].uart.mapbase = AT91C_VA_BASE_US0; + at91_ports[idx].uart.irq = AT91C_ID_US0; AT91_CfgPIO_USART0(); break; case 1: - at91_ports[idx].membase = (void *) AT91C_VA_BASE_US1; - at91_ports[idx].mapbase = AT91C_VA_BASE_US1; - at91_ports[idx].irq = AT91C_ID_US1; + at91_ports[idx].uart.membase = (void *) AT91C_VA_BASE_US1; + at91_ports[idx].uart.mapbase = AT91C_VA_BASE_US1; + at91_ports[idx].uart.irq = AT91C_ID_US1; AT91_CfgPIO_USART1(); break; case 2: - at91_ports[idx].membase = (void *) AT91C_VA_BASE_US2; - at91_ports[idx].mapbase = AT91C_VA_BASE_US2; - at91_ports[idx].irq = AT91C_ID_US2; + at91_ports[idx].uart.membase = (void *) AT91C_VA_BASE_US2; + at91_ports[idx].uart.mapbase = AT91C_VA_BASE_US2; + at91_ports[idx].uart.irq = AT91C_ID_US2; AT91_CfgPIO_USART2(); break; case 3: - at91_ports[idx].membase = (void *) AT91C_VA_BASE_US3; - at91_ports[idx].mapbase = AT91C_VA_BASE_US3; - at91_ports[idx].irq = AT91C_ID_US3; + at91_ports[idx].uart.membase = (void *) AT91C_VA_BASE_US3; + at91_ports[idx].uart.mapbase = AT91C_VA_BASE_US3; + at91_ports[idx].uart.irq = AT91C_ID_US3; AT91_CfgPIO_USART3(); break; case 4: - at91_ports[idx].membase = (void *) AT91C_VA_BASE_DBGU; - at91_ports[idx].mapbase = AT91C_VA_BASE_DBGU; - at91_ports[idx].irq = AT91C_ID_SYS; + at91_ports[idx].uart.membase = (void *) AT91C_VA_BASE_DBGU; + at91_ports[idx].uart.mapbase = AT91C_VA_BASE_DBGU; + at91_ports[idx].uart.irq = AT91C_ID_SYS; AT91_CfgPIO_DBGU(); break; default: @@ -688,28 +698,28 @@ */ static void at91_console_write(struct console *co, const char *s, u_int count) { - struct uart_port *port = at91_ports + co->index; + struct uart_port *uart = &at91_ports[co->index].uart; unsigned int status, i, imr; /* * First, save IMR and then disable interrupts */ - imr = UART_GET_IMR(port); /* get interrupt mask */ - UART_PUT_IDR(port, AT91C_US_RXRDY | AT91C_US_TXRDY); + imr = UART_GET_IMR(uart); /* get interrupt mask */ + UART_PUT_IDR(uart, AT91C_US_RXRDY | AT91C_US_TXRDY); /* * Now, do each character */ for (i = 0; i < count; i++) { do { - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); } while (!(status & AT91C_US_TXRDY)); - UART_PUT_CHAR(port, s[i]); + UART_PUT_CHAR(uart, s[i]); if (s[i] == '\n') { do { - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); } while (!(status & AT91C_US_TXRDY)); - UART_PUT_CHAR(port, '\r'); + UART_PUT_CHAR(uart, '\r'); } } @@ -718,9 +728,9 @@ * and restore IMR */ do { - status = UART_GET_CSR(port); + status = UART_GET_CSR(uart); } while (status & AT91C_US_TXRDY); - UART_PUT_IER(port, imr); /* set interrupts back the way they were */ + UART_PUT_IER(uart, imr); /* set interrupts back the way they were */ } static kdev_t at91_console_device(struct console *co) @@ -732,14 +742,14 @@ * If the port was already initialised (eg, by a boot loader), try to determine * the current setup. */ -static void __init at91_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits) +static void __init at91_console_get_options(struct uart_port *uart, int *baud, int *parity, int *bits) { unsigned int mr, quot; // TODO: CR is a write-only register // unsigned int cr; // -// cr = UART_GET_CR(port) & (AT91C_US_RXEN | AT91C_US_TXEN); +// cr = UART_GET_CR(uart) & (AT91C_US_RXEN | AT91C_US_TXEN); // if (cr == (AT91C_US_RXEN | AT91C_US_TXEN)) { // /* ok, the port was enabled */ // @@ -752,19 +762,19 @@ // *parity = 'o'; // } - mr = UART_GET_MR(port) & AT91C_US_CHRL; + mr = UART_GET_MR(uart) & AT91C_US_CHRL; if (mr == AT91C_US_CHRL_8_BITS) *bits = 8; else *bits = 7; - quot = UART_GET_BRGR(port); - *baud = port->uartclk / (16 * (quot)); + quot = UART_GET_BRGR(uart); + *baud = uart->uartclk / (16 * (quot)); } static int __init at91_console_setup(struct console *co, char *options) { - struct uart_port *port; + struct uart_port *uart; int baud = AT91C_CONSOLE_DEFAULT_BAUDRATE; int bits = 8; int parity = 'n'; @@ -775,7 +785,9 @@ * if so, search for the first available port that does have * console support. */ - port = uart_get_console(at91_ports, AT91C_NR_UART, co); + if (co->index >= AT91C_NR_UART) + co->index = 0; + uart = &at91_ports[co->index].uart; // TODO: The console port should be initialized, and clock enabled if // we're not relying on the bootloader to do it. @@ -783,9 +795,9 @@ if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else - at91_console_get_options(port, &baud, &parity, &bits); + at91_console_get_options(uart, &baud, &parity, &bits); - return uart_set_options(port, co, baud, parity, bits, flow); + return uart_set_options(uart, co, baud, parity, bits, flow); } static struct console at91_console = { @@ -809,7 +821,7 @@ #define AT91_CONSOLE_DEVICE NULL #endif -static struct uart_driver at91_reg = { +static struct uart_driver at91_uart = { owner: THIS_MODULE, normal_major: SERIAL_AT91_MAJOR, #ifdef CONFIG_DEVFS_FS @@ -836,13 +848,13 @@ at91_init_ports(); - ret = uart_register_driver(&at91_reg); + ret = uart_register_driver(&at91_uart); if (ret) return ret; for (i = 0; i < AT91C_NR_UART; i++) { if (at91_serialmap[i] >= 0) - uart_add_one_port(&at91_reg, &at91_ports[i]); + uart_add_one_port(&at91_uart, &at91_ports[i].uart); } return 0; @@ -853,11 +865,11 @@ int i; for (i = 0; i < AT91C_NR_UART; i++) { - if (at91_serialmap[i] >= 0) - uart_remove_one_port(&at91_reg, &at91_ports[i]); - } + if (at91_serialmap[i] >= 0) + uart_remove_one_port(&at91_uart, &at91_ports[i].uart); + } - uart_unregister_driver(&at91_reg); + uart_unregister_driver(&at91_uart); } module_init(at91_serial_init); diff -urN linux-2.4.25-vrs2.orig/drivers/at91/spi/at91_spi.c linux-2.4.25-vrs2/drivers/at91/spi/at91_spi.c --- linux-2.4.25-vrs2.orig/drivers/at91/spi/at91_spi.c Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/spi/at91_spi.c Mon Mar 8 13:16:06 2004 @@ -30,7 +30,7 @@ DECLARE_COMPLETION(transfer_complete); /* SPI controller device */ -AT91PS_SPI controller = (AT91PS_SPI) AT91C_VA_BASE_SPI; +static AT91PS_SPI controller = (AT91PS_SPI) AT91C_VA_BASE_SPI; /* ......................................................................... */ @@ -171,7 +171,7 @@ /* * Handle interrupts from the SPI controller. */ -void spi_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static void spi_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned int status; struct spi_local *device = (struct spi_local *) &spi_dev[current_device]; diff -urN linux-2.4.25-vrs2.orig/drivers/at91/spi/at91_spidev.c linux-2.4.25-vrs2/drivers/at91/spi/at91_spidev.c --- linux-2.4.25-vrs2.orig/drivers/at91/spi/at91_spidev.c Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/spi/at91_spidev.c Mon Mar 8 13:16:06 2004 @@ -112,7 +112,7 @@ return res; } -int spidev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static int spidev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int spi_device = MINOR(inode->i_rdev); @@ -131,7 +131,7 @@ /* * Open the SPI device */ -int spidev_open(struct inode *inode, struct file *file) +static int spidev_open(struct inode *inode, struct file *file) { unsigned int spi_device = MINOR(inode->i_rdev); @@ -205,7 +205,7 @@ /* * Remove the SPI /dev interface driver */ -static void at91_spidev_exit(void) +static void __exit at91_spidev_exit(void) { #ifdef CONFIG_DEVFS_FS devfs_unregister(devfs_handle); diff -urN linux-2.4.25-vrs2.orig/drivers/at91/watchdog/at91_wdt.c linux-2.4.25-vrs2/drivers/at91/watchdog/at91_wdt.c --- linux-2.4.25-vrs2.orig/drivers/at91/watchdog/at91_wdt.c Mon Mar 8 10:43:11 2004 +++ linux-2.4.25-vrs2/drivers/at91/watchdog/at91_wdt.c Mon Mar 8 13:16:06 2004 @@ -27,7 +27,7 @@ /* * Disable the watchdog. */ -void at91_wdt_stop(void) +static void at91_wdt_stop(void) { AT91_SYS->ST_WDMR = AT91C_ST_EXTEN; } @@ -35,7 +35,7 @@ /* * Enable and reset the watchdog. */ -void at91_wdt_start(void) +static void at91_wdt_start(void) { AT91_SYS->ST_WDMR = AT91C_ST_EXTEN | AT91C_ST_RSTEN | (((65536 * at91wdt_time) >> 8) & AT91C_ST_WDV); AT91_SYS->ST_CR = AT91C_ST_WDRST; diff -urN linux-2.4.25-vrs2.orig/drivers/mtd/nand/Config.in linux-2.4.25-vrs2/drivers/mtd/nand/Config.in --- linux-2.4.25-vrs2.orig/drivers/mtd/nand/Config.in Mon Mar 8 10:07:28 2004 +++ linux-2.4.25-vrs2/drivers/mtd/nand/Config.in Mon Mar 8 13:16:06 2004 @@ -33,4 +33,8 @@ fi fi +if [ "$CONFIG_ARCH_AT91RM9200" = "y" ]; then + dep_tristate ' SmartMedia Card on Atmel AT91RM9200' CONFIG_MTD_AT91_SMARTMEDIA $CONFIG_MTD_NAND +fi + endmenu diff -urN linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/AT91RM9200.h linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/AT91RM9200.h --- linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/AT91RM9200.h Mon Mar 8 10:13:49 2004 +++ linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/AT91RM9200.h Mon Mar 8 13:16:06 2004 @@ -171,7 +171,7 @@ #define AT91C_PA23_TXD2 (AT91C_PIO_PA23) // USART 2 Transmit Data #define AT91C_PA23_IRQ3 (AT91C_PIO_PA23) // Interrupt input 3 #define AT91C_PIO_PA24 (1 << 24) -#define AT91C_PA24_SCK2 (AT91C_PIO_PA24) // USART2 Serial Clock +#define AT91C_PA24_SCK2 (AT91C_PIO_PA24) // USART 2 Serial Clock #define AT91C_PA24_PCK1 (AT91C_PIO_PA24) // PMC Programmable Clock Output 1 #define AT91C_PIO_PA25 (1 << 25) #define AT91C_PA25_TWD (AT91C_PIO_PA25) // TWI Two-wire Serial Data @@ -260,7 +260,7 @@ #define AT91C_PIO_PB21 (1 << 21) #define AT91C_PB21_RXD1 (AT91C_PIO_PB21) // USART 1 Receive Data #define AT91C_PIO_PB22 (1 << 22) -#define AT91C_PB22_SCK1 (AT91C_PIO_PB22) // USART1 Serial Clock +#define AT91C_PB22_SCK1 (AT91C_PIO_PB22) // USART 1 Serial Clock #define AT91C_PIO_PB23 (1 << 23) #define AT91C_PB23_DCD1 (AT91C_PIO_PB23) // USART 1 Data Carrier Detect #define AT91C_PIO_PB24 (1 << 24) diff -urN linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/at91rm9200dk.h linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/at91rm9200dk.h --- linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/at91rm9200dk.h Mon Mar 8 10:43:12 2004 +++ linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/at91rm9200dk.h Mon Mar 8 13:16:54 2004 @@ -17,7 +17,7 @@ /* AT91RM92000 clocks */ #define AT91C_MAIN_CLOCK 179712000 /* from 18.432 MHz crystal (18432000 / 4 * 39) */ -#define AT91C_MASTER_CLOCK 59904000 /* peripheral clock (AT91C_MASTER_CLOCK / 3) */ +#define AT91C_MASTER_CLOCK 59904000 /* peripheral clock (AT91C_MAIN_CLOCK / 3) */ #define AT91C_SLOW_CLOCK 32768 /* slow clock */ diff -urN linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/hardware.h linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/hardware.h --- linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/hardware.h Mon Mar 8 10:43:12 2004 +++ linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/hardware.h Mon Mar 8 13:58:26 2004 @@ -60,6 +60,7 @@ #define AT91C_BASE_SRAM 0x00200000 /* Internal SRAM base address */ +#define AT91C_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */ #define AT91C_NR_UART 5 /* 4 USART3's and one DBGU port */ diff -urN linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/time.h linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/time.h --- linux-2.4.25-vrs2.orig/include/asm-arm/arch-at91rm9200/time.h Mon Mar 8 10:43:12 2004 +++ linux-2.4.25-vrs2/include/asm-arm/arch-at91rm9200/time.h Mon Mar 8 14:00:58 2004 @@ -63,6 +63,7 @@ { if (AT91_SYS->ST_SR & AT91C_ST_PITS) { /* This is a shared interrupt */ do { + do_leds(); do_timer(regs); AT91_SYS->ST_RTAR = (AT91_SYS->ST_RTAR + LATCH) & AT91C_ST_ALMV;