diff options
author | nslu2-linux.adm@bkbits.net <nslu2-linux.adm@bkbits.net> | 2005-03-29 14:41:34 +0000 |
---|---|---|
committer | nslu2-linux.adm@bkbits.net <nslu2-linux.adm@bkbits.net> | 2005-03-29 14:41:34 +0000 |
commit | 27c1c1ba6614531c676d84f5f5cd0aeeb3031eaa (patch) | |
tree | d02025494ecc66c61ae6e075f5c712edffde78a0 /packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch | |
parent | 61b67f62993f35584f36b413cb271e0947d84a36 (diff) |
Merge bk://oe-devel.bkbits.net/openembedded
into bkbits.net:/repos/n/nslu2-linux/openembedded
2005/03/29 16:09:43+02:00 uni-frankfurt.de!mickeyl
Merge bk://oe-devel@oe-devel.bkbits.net/openembedded
into r2d2.tm.informatik.uni-frankfurt.de:/local/pkg/oe/packages
2005/03/29 16:09:27+02:00 uni-frankfurt.de!mickeyl
wlan-ng: fix S
2005/03/29 14:03:30+02:00 mn-solutions.de!schurig
add serial_cs & bluez to MNCI "Ramses" kernel
BKrev: 4249691eWc46O2knhl17RCokRw2zRw
Diffstat (limited to 'packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch')
-rw-r--r-- | packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch | 1086 |
1 files changed, 473 insertions, 613 deletions
diff --git a/packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch b/packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch index 8299c9d3dc..2f80d090a2 100644 --- a/packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch +++ b/packages/linux/mnci-ramses-2.4.21-rmk2-pxa1/mnci-combined.patch @@ -1783,7 +1783,7 @@ --- /dev/null +++ linux-2.4.21/arch/arm/def-configs/ramses -@@ -0,0 +1,1159 @@ +@@ -0,0 +1,1174 @@ +# +# Automatically generated by make menuconfig: don't edit +# @@ -2831,7 +2831,6 @@ +CONFIG_USB_SL811HS_ALT=m +CONFIG_USB_AUDIO=m +CONFIG_USB_EMI26=m -+# CONFIG_USB_BLUETOOTH is not set +CONFIG_USB_MIDI=m +CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE_DEBUG=y @@ -2910,16 +2909,32 @@ +# +# Bluetooth support +# -+CONFIG_BLUEZ=y ++CONFIG_BLUEZ=m +CONFIG_BLUEZ_L2CAP=m +CONFIG_BLUEZ_SCO=m +CONFIG_BLUEZ_RFCOMM=m -+CONFIG_BLUEZ_RFCOMM_TTY=y ++# CONFIG_BLUEZ_RFCOMM_TTY is not set +CONFIG_BLUEZ_BNEP=m -+# CONFIG_BLUEZ_BNEP_MC_FILTER is not set ++CONFIG_BLUEZ_BNEP_MC_FILTER=y +# CONFIG_BLUEZ_BNEP_PROTO_FILTER is not set + +# ++# Bluetooth device drivers ++# ++CONFIG_BLUEZ_HCIUSB=m ++CONFIG_BLUEZ_USB_SCO=y ++CONFIG_BLUEZ_USB_ZERO_PACKET=y ++CONFIG_BLUEZ_HCIUART=m ++CONFIG_BLUEZ_HCIUART_H4=y ++CONFIG_BLUEZ_HCIUART_BCSP=y ++CONFIG_BLUEZ_HCIUART_BCSP_TXCRC=y ++CONFIG_BLUEZ_HCIDTL1=m ++CONFIG_BLUEZ_HCIBT3C=m ++CONFIG_BLUEZ_HCIBLUECARD=m ++CONFIG_BLUEZ_HCIBTUART=m ++# CONFIG_BLUEZ_HCIVHCI is not set ++ ++# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y @@ -4060,7 +4075,7 @@ +#endif +#define USE_UCB +//#define PFI_LED -+#define PFI_TURNOFF ++//#define PFI_TURNOFF + +#include <asm/types.h> +#include <asm/setup.h> @@ -6721,7 +6736,7 @@ static void change_speed(struct async_struct *info, struct termios *old); static void rs_wait_until_sent(struct tty_struct *tty, int timeout); -@@ -325,46 +165,74 @@ +@@ -325,46 +165,82 @@ { 0, 0} }; @@ -6803,6 +6818,14 @@ + io_type: SERIAL_IO_MEM, + irq: IRQ_GPIO(26), + flags: ASYNC_SKIP_TEST, ++ }, { ++ type: PORT_UNKNOWN, ++ }, { ++ type: PORT_UNKNOWN, ++ }, { ++ type: PORT_UNKNOWN, ++ }, { ++ type: PORT_UNKNOWN, + } }; @@ -6833,7 +6856,7 @@ #ifndef PREPARE_FUNC #define PREPARE_FUNC(dev) (dev->prepare) -@@ -403,39 +271,21 @@ +@@ -403,39 +279,21 @@ #endif @@ -6882,7 +6905,7 @@ return readl((unsigned long) info->iomem_base + (offset<<info->iomem_reg_shift)); default: -@@ -447,17 +297,14 @@ +@@ -447,17 +305,14 @@ int value) { switch (info->io_type) { @@ -6903,7 +6926,7 @@ writel(value, (unsigned long) info->iomem_base + (offset<<info->iomem_reg_shift)); break; -@@ -509,9 +356,6 @@ +@@ -509,9 +364,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -6913,7 +6936,7 @@ save_flags(flags); cli(); if (info->IER & UART_IER_THRI) { info->IER &= ~UART_IER_THRI; -@@ -529,9 +373,6 @@ +@@ -529,9 +381,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -6923,7 +6946,7 @@ save_flags(flags); cli(); if (info->xmit.head != info->xmit.tail && info->xmit.buf -@@ -689,11 +530,7 @@ +@@ -689,11 +538,7 @@ #endif *status = serial_inp(info, UART_LSR); } while ((*status & UART_LSR_DR) && (max_count-- > 0)); @@ -6935,7 +6958,7 @@ } static _INLINE_ void transmit_chars(struct async_struct *info, int *intr_done) -@@ -758,11 +595,6 @@ +@@ -758,11 +603,6 @@ icount->dsr++; if (status & UART_MSR_DDCD) { icount->dcd++; @@ -6947,7 +6970,7 @@ } if (status & UART_MSR_DCTS) icount->cts++; -@@ -810,120 +642,23 @@ +@@ -810,120 +650,23 @@ } } @@ -7069,7 +7092,7 @@ do { status = serial_inp(info, UART_LSR); #ifdef SERIAL_DEBUG_INTR -@@ -932,120 +667,23 @@ +@@ -932,120 +675,23 @@ if (status & UART_LSR_DR) receive_chars(info, &status, regs); check_modem_status(info); @@ -7194,7 +7217,7 @@ /* * ------------------------------------------------------------------- -@@ -1107,22 +745,6 @@ +@@ -1107,22 +753,6 @@ if (!info) continue; save_flags(flags); cli(); @@ -7217,7 +7240,7 @@ rs_interrupt_single(i, NULL, NULL); restore_flags(flags); } -@@ -1132,11 +754,7 @@ +@@ -1132,11 +762,7 @@ if (IRQ_ports[0]) { save_flags(flags); cli(); @@ -7229,7 +7252,7 @@ restore_flags(flags); mod_timer(&serial_timer, jiffies + IRQ_timeout[0]); -@@ -1177,50 +795,6 @@ +@@ -1177,50 +803,6 @@ IRQ_timeout[irq] = (timeout > 3) ? timeout-2 : 1; } @@ -7280,7 +7303,7 @@ static int startup(struct async_struct * info) { unsigned long flags; -@@ -1228,9 +802,6 @@ +@@ -1228,9 +810,6 @@ void (*handler)(int, void *, struct pt_regs *); struct serial_state *state= info->state; unsigned long page; @@ -7290,7 +7313,7 @@ page = get_zeroed_page(GFP_KERNEL); if (!page) -@@ -1258,6 +829,22 @@ +@@ -1258,6 +837,22 @@ printk("starting up ttys%d (irq %d)...", info->line, state->irq); #endif @@ -7313,7 +7336,7 @@ if (uart_config[state->type].flags & UART_STARTECH) { /* Wake up UART */ serial_outp(info, UART_LCR, 0xBF); -@@ -1305,25 +892,12 @@ +@@ -1305,25 +900,12 @@ serial_outp(info, UART_LCR, 0); } @@ -7340,7 +7363,7 @@ case (long)&STUART: CKEN |= CKEN5_STUART; break; } } -@@ -1344,6 +918,7 @@ +@@ -1344,6 +926,7 @@ /* * Clear the interrupt registers. */ @@ -7348,7 +7371,7 @@ (void) serial_inp(info, UART_LSR); (void) serial_inp(info, UART_RX); (void) serial_inp(info, UART_IIR); -@@ -1371,18 +946,8 @@ +@@ -1371,18 +954,8 @@ if (state->irq && (!IRQ_ports[state->irq] || !IRQ_ports[state->irq]->next_port)) { if (IRQ_ports[state->irq]) { @@ -7367,7 +7390,7 @@ } else handler = rs_interrupt_single; -@@ -1417,12 +982,6 @@ +@@ -1417,12 +990,6 @@ info->MCR = 0; if (info->tty->termios->c_cflag & CBAUD) info->MCR = UART_MCR_DTR | UART_MCR_RTS; @@ -7380,7 +7403,7 @@ { if (state->irq != 0) info->MCR |= UART_MCR_OUT2; -@@ -1437,18 +996,9 @@ +@@ -1437,18 +1004,9 @@ */ info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI; if (pxa_port(state->type)) @@ -7400,7 +7423,7 @@ /* * And clear the interrupt registers again for luck. */ -@@ -1469,7 +1019,6 @@ +@@ -1469,7 +1027,6 @@ /* * Set up the tty->alt_speed kludge */ @@ -7408,7 +7431,7 @@ if (info->tty) { if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) info->tty->alt_speed = 57600; -@@ -1480,7 +1029,6 @@ +@@ -1480,7 +1037,6 @@ if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) info->tty->alt_speed = 460800; } @@ -7416,7 +7439,7 @@ /* * and set the speed of the serial port -@@ -1516,6 +1064,30 @@ +@@ -1516,6 +1072,30 @@ state->irq); #endif @@ -7447,7 +7470,7 @@ save_flags(flags); cli(); /* Disable interrupts */ /* -@@ -1561,13 +1133,6 @@ +@@ -1561,13 +1141,6 @@ info->IER = 0; serial_outp(info, UART_IER, 0x00); /* disable all intrs */ @@ -7461,7 +7484,7 @@ info->MCR &= ~UART_MCR_OUT2; if (pxa_buggy_port(state->type)) info->MCR ^= UART_MCR_OUT2; -@@ -1586,16 +1151,6 @@ +@@ -1586,16 +1159,6 @@ UART_FCR_CLEAR_XMIT)); serial_outp(info, UART_FCR, 0); @@ -7478,7 +7501,7 @@ #ifdef CONFIG_ARCH_PXA if (state->type == PORT_PXA #ifdef CONFIG_SERIAL_CONSOLE -@@ -1634,37 +1189,6 @@ +@@ -1634,37 +1197,6 @@ restore_flags(flags); } @@ -7516,7 +7539,7 @@ /* * This routine is called to set the UART divisor registers to match * the specified baud rate for a serial port. -@@ -1711,12 +1235,6 @@ +@@ -1711,12 +1243,6 @@ baud = tty_get_baud_rate(info->tty); if (!baud) baud = 9600; /* B0 transition handled in rs_set_termios */ @@ -7529,7 +7552,7 @@ baud_base = info->state->baud_base; if (info->state->type == PORT_16C950) { if (baud <= baud_base) -@@ -1778,10 +1296,6 @@ +@@ -1778,10 +1304,6 @@ if (uart_config[info->state->type].flags & UART_USE_FIFO) { if ((info->state->baud_base / quot) < 2400) fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1; @@ -7540,7 +7563,7 @@ else fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_8; } -@@ -1864,9 +1378,6 @@ +@@ -1864,9 +1386,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -7550,7 +7573,7 @@ if (!tty || !info->xmit.buf) return; -@@ -1888,9 +1399,6 @@ +@@ -1888,9 +1407,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -7560,7 +7583,7 @@ if (info->xmit.head == info->xmit.tail || tty->stopped || tty->hw_stopped -@@ -1900,8 +1408,6 @@ +@@ -1900,8 +1416,6 @@ save_flags(flags); cli(); info->IER |= UART_IER_THRI; serial_out(info, UART_IER, info->IER); @@ -7569,7 +7592,7 @@ restore_flags(flags); } -@@ -1912,9 +1418,6 @@ +@@ -1912,9 +1426,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -7579,7 +7602,7 @@ if (!tty || !info->xmit.buf || !tmp_buf) return 0; -@@ -1978,11 +1481,6 @@ +@@ -1978,11 +1489,6 @@ && !(info->IER & UART_IER_THRI)) { info->IER |= UART_IER_THRI; serial_out(info, UART_IER, info->IER); @@ -7591,7 +7614,7 @@ } return ret; } -@@ -1991,8 +1489,6 @@ +@@ -1991,8 +1497,6 @@ { struct async_struct *info = (struct async_struct *)tty->driver_data; @@ -7600,7 +7623,7 @@ return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); } -@@ -2000,8 +1496,6 @@ +@@ -2000,8 +1504,6 @@ { struct async_struct *info = (struct async_struct *)tty->driver_data; @@ -7609,7 +7632,7 @@ return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); } -@@ -2010,8 +1504,6 @@ +@@ -2010,8 +1512,6 @@ struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; @@ -7618,7 +7641,7 @@ save_flags(flags); cli(); info->xmit.head = info->xmit.tail = 0; restore_flags(flags); -@@ -2032,16 +1524,11 @@ +@@ -2032,16 +1532,11 @@ { struct async_struct *info = (struct async_struct *)tty->driver_data; @@ -7635,7 +7658,7 @@ } } -@@ -2064,9 +1551,6 @@ +@@ -2064,9 +1559,6 @@ tty->ldisc.chars_in_buffer(tty)); #endif @@ -7645,7 +7668,7 @@ if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty)); -@@ -2089,9 +1573,6 @@ +@@ -2089,9 +1581,6 @@ tty->ldisc.chars_in_buffer(tty)); #endif @@ -7655,7 +7678,7 @@ if (I_IXOFF(tty)) { if (info->x_char) info->x_char = 0; -@@ -2134,7 +1615,6 @@ +@@ -2134,7 +1623,6 @@ tmp.close_delay = state->close_delay; tmp.closing_wait = state->closing_wait; tmp.custom_divisor = state->custom_divisor; @@ -7663,7 +7686,7 @@ tmp.io_type = state->io_type; if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) return -EFAULT; -@@ -2160,8 +1640,7 @@ +@@ -2160,8 +1648,7 @@ new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET; change_irq = new_serial.irq != state->irq; @@ -7673,7 +7696,7 @@ if (!capable(CAP_SYS_ADMIN)) { if (change_irq || change_port || -@@ -2198,7 +1677,6 @@ +@@ -2198,7 +1685,6 @@ if (new_serial.type) { for (i = 0 ; i < NR_PORTS; i++) if ((state != &rs_table[i]) && @@ -7681,7 +7704,7 @@ (rs_table[i].port == new_port) && rs_table[i].type) return -EADDRINUSE; -@@ -2220,18 +1698,11 @@ +@@ -2220,18 +1706,11 @@ state->custom_divisor = new_serial.custom_divisor; state->close_delay = new_serial.close_delay * HZ/100; state->closing_wait = new_serial.closing_wait * HZ/100; @@ -7700,7 +7723,7 @@ release_region(state->port,8); } state->type = new_serial.type; -@@ -2243,31 +1714,19 @@ +@@ -2243,31 +1722,19 @@ shutdown(info); state->irq = new_serial.irq; info->port = state->port = new_port; @@ -7733,7 +7756,7 @@ if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) info->tty->alt_speed = 57600; if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) -@@ -2276,7 +1735,6 @@ +@@ -2276,7 +1743,6 @@ info->tty->alt_speed = 230400; if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) info->tty->alt_speed = 460800; @@ -7741,7 +7764,7 @@ change_speed(info, 0); } } else -@@ -2414,60 +1872,14 @@ +@@ -2414,60 +1880,14 @@ return 0; } @@ -7802,7 +7825,7 @@ if (!CONFIGURED_SERIAL_PORT(info)) return; save_flags(flags); cli(); -@@ -2478,121 +1890,6 @@ +@@ -2478,121 +1898,6 @@ serial_out(info, UART_LCR, info->LCR); restore_flags(flags); } @@ -7924,7 +7947,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) -@@ -2601,12 +1898,6 @@ +@@ -2601,12 +1906,6 @@ struct async_icount cprev, cnow; /* kernel counter temps */ struct serial_icounter_struct icount; unsigned long flags; @@ -7937,7 +7960,7 @@ if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && -@@ -2616,45 +1907,6 @@ +@@ -2616,45 +1915,6 @@ } switch (cmd) { @@ -7983,7 +8006,7 @@ case TIOCMGET: return get_modem_info(info, (unsigned int *) arg); case TIOCMBIS: -@@ -2667,9 +1919,6 @@ +@@ -2667,9 +1927,6 @@ case TIOCSSERIAL: return set_serial_info(info, (struct serial_struct *) arg); @@ -7993,7 +8016,7 @@ case TIOCSERGETLSR: /* Get line status register */ return get_lsr_info(info, (unsigned int *) arg); -@@ -2679,15 +1928,6 @@ +@@ -2679,15 +1936,6 @@ return -EFAULT; return 0; @@ -8009,7 +8032,7 @@ /* * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change * - mask passed in arg for lines of interest -@@ -2754,6 +1994,39 @@ +@@ -2754,6 +2002,39 @@ printk ("TIOCSER?WILD ioctl obsolete, ignored.\n"); return 0; @@ -8049,7 +8072,7 @@ default: return -ENOIOCTLCMD; } -@@ -2801,18 +2074,6 @@ +@@ -2801,18 +2082,6 @@ tty->hw_stopped = 0; rs_start(tty); } @@ -8068,7 +8091,7 @@ } /* -@@ -2831,9 +2092,6 @@ +@@ -2831,9 +2100,6 @@ struct serial_state *state; unsigned long flags; @@ -8078,7 +8101,7 @@ state = info->state; save_flags(flags); cli(); -@@ -2933,10 +2191,7 @@ +@@ -2933,10 +2199,7 @@ { struct async_struct * info = (struct async_struct *)tty->driver_data; unsigned long orig_jiffies, char_time; @@ -8090,7 +8113,7 @@ if (info->state->type == PORT_UNKNOWN) return; -@@ -2974,9 +2229,11 @@ +@@ -2974,9 +2237,11 @@ printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time); printk("jiff=%lu...", jiffies); #endif @@ -8103,7 +8126,7 @@ #endif set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); -@@ -2986,8 +2243,9 @@ +@@ -2986,8 +2251,9 @@ break; } #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT @@ -8114,7 +8137,7 @@ } /* -@@ -2998,9 +2256,6 @@ +@@ -2998,9 +2264,6 @@ struct async_struct * info = (struct async_struct *)tty->driver_data; struct serial_state *state = info->state; @@ -8124,7 +8147,7 @@ state = info->state; rs_flush_buffer(tty); -@@ -3036,12 +2291,8 @@ +@@ -3036,12 +2299,8 @@ (info->flags & ASYNC_CLOSING)) { if (info->flags & ASYNC_CLOSING) interruptible_sleep_on(&info->close_wait); @@ -8137,7 +8160,7 @@ } /* -@@ -3114,14 +2365,10 @@ +@@ -3114,14 +2373,10 @@ set_current_state(TASK_INTERRUPTIBLE); if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) { @@ -8152,7 +8175,7 @@ break; } if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && -@@ -3223,16 +2470,12 @@ +@@ -3223,16 +2478,12 @@ } tty->driver_data = info; info->tty = tty; @@ -8169,7 +8192,7 @@ /* * This relies on lock_kernel() stuff so wants tidying for 2.5 -@@ -3254,12 +2497,8 @@ +@@ -3254,12 +2505,8 @@ (info->flags & ASYNC_CLOSING)) { if (info->flags & ASYNC_CLOSING) interruptible_sleep_on(&info->close_wait); @@ -8182,7 +8205,7 @@ } /* -@@ -3313,17 +2552,14 @@ +@@ -3313,17 +2560,14 @@ int ret; unsigned long flags; @@ -8206,7 +8229,7 @@ /* * Figure out the current RS-232 lines -@@ -3334,7 +2570,6 @@ +@@ -3334,7 +2578,6 @@ info->magic = SERIAL_MAGIC; info->port = state->port; info->flags = state->flags; @@ -8214,7 +8237,7 @@ info->io_type = state->io_type; info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; -@@ -3389,13 +2624,13 @@ +@@ -3389,13 +2632,13 @@ } static int rs_read_proc(char *page, char **start, off_t off, int count, @@ -8231,14 +8254,15 @@ for (i = 0; i < NR_PORTS && len < 4000; i++) { l = line_info(page + len, &rs_table[i]); len += l; -@@ -3423,2038 +2658,63 @@ +@@ -3423,125 +2666,212 @@ */ /* - * This routine prints out the appropriate serial driver version - * number, and identifies which options were configured into this - * driver. -- */ ++ * The serial driver boot-time initialization code! + */ -static char serial_options[] __initdata = -#ifdef CONFIG_HUB6 - " HUB-6" @@ -8267,34 +8291,205 @@ -#ifdef ENABLE_SERIAL_PNP - " ISAPNP" -#define SERIAL_OPT --#endif ++static int __init rs_init(void) ++{ ++ int i; ++ struct serial_state * state; ++ ++ printk("pxa & ti16c754b serial driver\n"); ++ set_GPIO_IRQ_edge(7, GPIO_RISING_EDGE); ++ set_GPIO_IRQ_edge(24, GPIO_RISING_EDGE); ++ set_GPIO_IRQ_edge(25, GPIO_RISING_EDGE); ++ set_GPIO_IRQ_edge(26, GPIO_RISING_EDGE); ++ ++ if (!request_mem_region(RAMSES_UARTA_PHYS, 16*4, "Ramses UART A")) ++ printk(KERN_ERR "unable to reserve region\n"); ++ else { ++ ramses_uarta = ioremap_nocache(RAMSES_UARTA_PHYS, 16*4); ++ if (!ramses_uarta) ++ printk(KERN_ERR "unable to map region\n"); ++ else { ++ //printk("ramses_uarta cookie is: %08x\n", (unsigned int) ramses_uarta); ++ rs_table[3].iomem_base = ramses_uarta; ++ } ++ } ++ if (!request_mem_region(RAMSES_UARTB_PHYS, 16*4, "Ramses UART B")) ++ printk(KERN_ERR "unable to reserve region\n"); ++ else { ++ ramses_uartb = ioremap_nocache(RAMSES_UARTB_PHYS, 16*4); ++ if (!ramses_uartb) ++ printk(KERN_ERR "unable to map region\n"); ++ else { ++ //printk("ramses_uartb cookie is: %08x\n", (unsigned int) ramses_uartb); ++ rs_table[4].iomem_base = ramses_uartb; ++ } ++ } ++ if (!request_mem_region(RAMSES_UARTC_PHYS, 16*4, "Ramses UART C")) ++ printk(KERN_ERR "unable to reserve region\n"); ++ else { ++ ramses_uartc = ioremap_nocache(RAMSES_UARTC_PHYS, 16*4); ++ if (!ramses_uartc) ++ printk(KERN_ERR "unable to map region\n"); ++ else { ++ //printk("ramses_uartc cookie is: %08x\n", (unsigned int) ramses_uartc); ++ rs_table[5].iomem_base = ramses_uartc; ++ } ++ } ++ if (!request_mem_region(RAMSES_UARTD_PHYS, 16*4, "Ramses UART D")) ++ printk(KERN_ERR "unable to reserve region\n"); ++ else { ++ ramses_uartd = ioremap_nocache(RAMSES_UARTD_PHYS, 16*4); ++ if (!ramses_uartd) ++ printk(KERN_ERR "unable to map region\n"); ++ else { ++ //printk("ramses_uartd cookie is: %08x\n", (unsigned int) ramses_uartd); ++ rs_table[6].iomem_base = ramses_uartd; ++ } ++ } ++ init_bh(SERIAL_BH, do_serial_bh); ++ init_timer(&serial_timer); ++ serial_timer.function = rs_timer; ++ mod_timer(&serial_timer, jiffies + RS_STROBE_TIME); ++ ++ for (i = 0; i < NR_IRQS; i++) { ++ IRQ_ports[i] = 0; ++ IRQ_timeout[i] = 0; ++ } ++#ifdef CONFIG_SERIAL_CONSOLE ++ /* ++ * The interrupt of the serial console port ++ * can't be shared. ++ */ ++ if (sercons.flags & CON_CONSDEV) { ++ for(i = 0; i < NR_PORTS; i++) ++ if (i != sercons.index && ++ rs_table[i].irq == rs_table[sercons.index].irq) ++ rs_table[i].irq = 0; ++ } + #endif -#ifdef ENABLE_SERIAL_ACPI - " SERIAL_ACPI" -#define SERIAL_OPT --#endif ++ /* Initialize the tty_driver structure */ ++ ++ memset(&serial_driver, 0, sizeof(struct tty_driver)); ++ serial_driver.magic = TTY_DRIVER_MAGIC; ++ serial_driver.driver_name = "serial"; ++#if defined(CONFIG_DEVFS_FS) ++ serial_driver.name = "tts/%d"; ++#else ++ serial_driver.name = "ttyS"; + #endif -#ifdef SERIAL_OPT - " enabled\n"; --#else ++ serial_driver.major = TTY_MAJOR; ++ serial_driver.minor_start = 64; ++ serial_driver.name_base = 0; ++ serial_driver.num = NR_PORTS; ++ serial_driver.type = TTY_DRIVER_TYPE_SERIAL; ++ serial_driver.subtype = SERIAL_TYPE_NORMAL; ++ serial_driver.init_termios = tty_std_termios; ++ serial_driver.init_termios.c_cflag = ++ B115200 | CS8 | CREAD | HUPCL | CLOCAL; ++ serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; ++ serial_driver.refcount = &serial_refcount; ++ serial_driver.table = serial_table; ++ serial_driver.termios = serial_termios; ++ serial_driver.termios_locked = serial_termios_locked; ++ ++ serial_driver.open = rs_open; ++ serial_driver.close = rs_close; ++ serial_driver.write = rs_write; ++ serial_driver.put_char = rs_put_char; ++ serial_driver.flush_chars = rs_flush_chars; ++ serial_driver.write_room = rs_write_room; ++ serial_driver.chars_in_buffer = rs_chars_in_buffer; ++ serial_driver.flush_buffer = rs_flush_buffer; ++ serial_driver.ioctl = rs_ioctl; ++ serial_driver.throttle = rs_throttle; ++ serial_driver.unthrottle = rs_unthrottle; ++ serial_driver.set_termios = rs_set_termios; ++ serial_driver.stop = rs_stop; ++ serial_driver.start = rs_start; ++ serial_driver.hangup = rs_hangup; ++ serial_driver.break_ctl = rs_break; ++ serial_driver.send_xchar = rs_send_xchar; ++ serial_driver.wait_until_sent = rs_wait_until_sent; ++ serial_driver.read_proc = rs_read_proc; ++ ++ /* ++ * The callout device is just like normal device except for ++ * major number and the subtype code. ++ */ ++ callout_driver = serial_driver; ++#if defined(CONFIG_DEVFS_FS) ++ callout_driver.name = "cua/%d"; + #else - " no serial options enabled\n"; --#endif ++ callout_driver.name = "cua"; + #endif -#undef SERIAL_OPT -- ++ callout_driver.major = TTYAUX_MAJOR; ++ callout_driver.subtype = SERIAL_TYPE_CALLOUT; ++ callout_driver.read_proc = 0; ++ callout_driver.proc_entry = 0; + -static _INLINE_ void show_serial_version(void) -{ - printk(KERN_INFO "%s version %s%s (%s) with%s", serial_name, - serial_version, LOCAL_VERSTRING, serial_revdate, - serial_options); --} -- --/* ++ if (tty_register_driver(&serial_driver)) ++ panic("Couldn't register serial driver\n"); ++ if (tty_register_driver(&callout_driver)) ++ panic("Couldn't register callout driver\n"); ++ ++ for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { ++ state->magic = SSTATE_MAGIC; ++ state->line = i; ++ state->custom_divisor = 0; ++ state->close_delay = 5*HZ/10; ++ state->closing_wait = 30*HZ; ++ state->callout_termios = callout_driver.init_termios; ++ state->normal_termios = serial_driver.init_termios; ++ state->icount.cts = state->icount.dsr = ++ state->icount.rng = state->icount.dcd = 0; ++ state->icount.rx = state->icount.tx = 0; ++ state->icount.frame = state->icount.parity = 0; ++ state->icount.overrun = state->icount.brk = 0; ++ state->irq = irq_cannonicalize(state->irq); ++ if (state->port && check_region(state->port,8)) { ++ state->type = PORT_UNKNOWN; ++ continue; ++ } ++ } ++ for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { ++ if (state->type == PORT_UNKNOWN) ++ continue; ++ printk(KERN_INFO"tts/%d at irq %d is a %s\n", ++ state->line, ++ state->irq, ++ uart_config[state->type].name); ++ tty_register_devfs(&serial_driver, 0, ++ serial_driver.minor_start + state->line); ++ tty_register_devfs(&callout_driver, 0, ++ callout_driver.minor_start + state->line); ++ } ++ return 0; + } + + /* - * This routine detect the IRQ of a serial port by clearing OUT2 when - * no UART interrupt are requested (IER = 0) (*GPL*). This seems to work at - * each time, as long as no other device permanently request the IRQ. - * If no IRQ is detected, or multiple IRQ appear, this function returns 0. - * The variable "state" and the field "state->port" should not be null. -- */ ++ * This is for use by architectures that know their serial console ++ * attributes only at run time. Not to be invoked after rs_init(). + */ -static unsigned detect_uart_irq (struct serial_state * state) --{ ++int __init early_serial_setup(struct serial_struct *req) + { - int irq; - unsigned long irqs; - unsigned char save_mcr, save_ier; @@ -8321,7 +8516,8 @@ - scr_info.io_type = state->io_type; - scr_info.iomem_base = state->iomem_base; - scr_info.iomem_reg_shift = state->iomem_reg_shift; -- ++ int i = req->line; + - /* forget possible initially masked and pending IRQ */ - probe_irq_off(probe_irq_on()); - save_mcr = serial_inp(&scr_info, UART_MCR); @@ -8346,7 +8542,8 @@ - serial_outp(&scr_info, UART_TX, 0xFF); - udelay (20); - irq = probe_irq_off(irqs); -- ++ printk("%s\n", __FUNCTION__); + - serial_outp(&scr_info, UART_MCR, save_mcr); - serial_outp(&scr_info, UART_IER, save_ier); -#ifdef CONFIG_SERIAL_MANY_PORTS @@ -8354,358 +8551,32 @@ - outb_p(save_ICP, ICP); -#endif - return (irq > 0)? irq : 0; --} -- --/* -- * This is a quickie test to see how big the FIFO is. -- * It doesn't work at all the time, more's the pity. -- */ --static int size_fifo(struct async_struct *info) --{ -- unsigned char old_fcr, old_mcr, old_dll, old_dlm; -- int count; -- -- old_fcr = serial_inp(info, UART_FCR); -- old_mcr = serial_inp(info, UART_MCR); -- serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO | -- UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); -- serial_outp(info, UART_MCR, UART_MCR_LOOP); -- serial_outp(info, UART_LCR, UART_LCR_DLAB); -- old_dll = serial_inp(info, UART_DLL); -- old_dlm = serial_inp(info, UART_DLM); -- serial_outp(info, UART_DLL, 0x01); -- serial_outp(info, UART_DLM, 0x00); -- serial_outp(info, UART_LCR, 0x03); -- for (count = 0; count < 256; count++) -- serial_outp(info, UART_TX, count); -- mdelay(20); -- for (count = 0; (serial_inp(info, UART_LSR) & UART_LSR_DR) && -- (count < 256); count++) -- serial_inp(info, UART_RX); -- serial_outp(info, UART_FCR, old_fcr); -- serial_outp(info, UART_MCR, old_mcr); -- serial_outp(info, UART_LCR, UART_LCR_DLAB); -- serial_outp(info, UART_DLL, old_dll); -- serial_outp(info, UART_DLM, old_dlm); -- -- return count; --} -- --/* -- * This is a helper routine to autodetect StarTech/Exar/Oxsemi UART's. -- * When this function is called we know it is at least a StarTech -- * 16650 V2, but it might be one of several StarTech UARTs, or one of -- * its clones. (We treat the broken original StarTech 16650 V1 as a -- * 16550, and why not? Startech doesn't seem to even acknowledge its -- * existence.) -- * -- * What evil have men's minds wrought... -- */ --static void autoconfig_startech_uarts(struct async_struct *info, -- struct serial_state *state, -- unsigned long flags) --{ -- unsigned char scratch, scratch2, scratch3, scratch4; -- -- /* -- * First we check to see if it's an Oxford Semiconductor UART. -- * -- * If we have to do this here because some non-National -- * Semiconductor clone chips lock up if you try writing to the -- * LSR register (which serial_icr_read does) -- */ -- if (state->type == PORT_16550A) { -- /* -- * EFR [4] must be set else this test fails -- * -- * This shouldn't be necessary, but Mike Hudson -- * (Exoray@isys.ca) claims that it's needed for 952 -- * dual UART's (which are not recommended for new designs). -- */ -- info->ACR = 0; -- serial_out(info, UART_LCR, 0xBF); -- serial_out(info, UART_EFR, 0x10); -- serial_out(info, UART_LCR, 0x00); -- /* Check for Oxford Semiconductor 16C950 */ -- scratch = serial_icr_read(info, UART_ID1); -- scratch2 = serial_icr_read(info, UART_ID2); -- scratch3 = serial_icr_read(info, UART_ID3); -- -- if (scratch == 0x16 && scratch2 == 0xC9 && -- (scratch3 == 0x50 || scratch3 == 0x52 || -- scratch3 == 0x54)) { -- state->type = PORT_16C950; -- state->revision = serial_icr_read(info, UART_REV) | -- (scratch3 << 8); -- return; -- } -- } -- -- /* -- * We check for a XR16C850 by setting DLL and DLM to 0, and -- * then reading back DLL and DLM. If DLM reads back 0x10, -- * then the UART is a XR16C850 and the DLL contains the chip -- * revision. If DLM reads back 0x14, then the UART is a -- * XR16C854. -- * -- */ -- -- /* Save the DLL and DLM */ -- -- serial_outp(info, UART_LCR, UART_LCR_DLAB); -- scratch3 = serial_inp(info, UART_DLL); -- scratch4 = serial_inp(info, UART_DLM); -- -- serial_outp(info, UART_DLL, 0); -- serial_outp(info, UART_DLM, 0); -- scratch2 = serial_inp(info, UART_DLL); -- scratch = serial_inp(info, UART_DLM); -- serial_outp(info, UART_LCR, 0); -- -- if (scratch == 0x10 || scratch == 0x14) { -- if (scratch == 0x10) -- state->revision = scratch2; -- state->type = PORT_16850; -- return; -- } -- -- /* Restore the DLL and DLM */ -- -- serial_outp(info, UART_LCR, UART_LCR_DLAB); -- serial_outp(info, UART_DLL, scratch3); -- serial_outp(info, UART_DLM, scratch4); -- serial_outp(info, UART_LCR, 0); -- /* -- * We distinguish between the '654 and the '650 by counting -- * how many bytes are in the FIFO. I'm using this for now, -- * since that's the technique that was sent to me in the -- * serial driver update, but I'm not convinced this works. -- * I've had problems doing this in the past. -TYT -- */ -- if (size_fifo(info) == 64) -- state->type = PORT_16654; -- else -- state->type = PORT_16650V2; --} -- --/* -- * This routine is called by rs_init() to initialize a specific serial -- * port. It determines what type of UART chip this serial port is -- * using: 8250, 16450, 16550, 16550A. The important question is -- * whether or not this UART is a 16550A or not, since this will -- * determine whether or not we can use its FIFO features or not. -- */ --static void autoconfig(struct serial_state * state) --{ -- unsigned char status1, status2, scratch, scratch2, scratch3; -- unsigned char save_lcr, save_mcr; -- struct async_struct *info, scr_info; -- unsigned long flags; -- -- state->type = PORT_UNKNOWN; -- --#ifdef SERIAL_DEBUG_AUTOCONF -- printk("Testing ttyS%d (0x%04lx, 0x%04x)...\n", state->line, -- state->port, (unsigned) state->iomem_base); --#endif -- -- if (!CONFIGURED_SERIAL_PORT(state)) -- return; -- -- info = &scr_info; /* This is just for serial_{in,out} */ -- -- info->magic = SERIAL_MAGIC; -- info->state = state; -- info->port = state->port; -- info->flags = state->flags; --#ifdef CONFIG_HUB6 -- info->hub6 = state->hub6; --#endif -- info->io_type = state->io_type; -- info->iomem_base = state->iomem_base; -- info->iomem_reg_shift = state->iomem_reg_shift; -- -- save_flags(flags); cli(); -- -- if (!(state->flags & ASYNC_BUGGY_UART) && -- !state->iomem_base) { -- /* -- * Do a simple existence test first; if we fail this, -- * there's no point trying anything else. -- * -- * 0x80 is used as a nonsense port to prevent against -- * false positives due to ISA bus float. The -- * assumption is that 0x80 is a non-existent port; -- * which should be safe since include/asm/io.h also -- * makes this assumption. -- */ -- scratch = serial_inp(info, UART_IER); -- serial_outp(info, UART_IER, 0); --#ifdef __i386__ -- outb(0xff, 0x080); --#endif -- scratch2 = serial_inp(info, UART_IER); -- serial_outp(info, UART_IER, 0x0F); --#ifdef __i386__ -- outb(0, 0x080); --#endif -- scratch3 = serial_inp(info, UART_IER); -- serial_outp(info, UART_IER, scratch); -- if (scratch2 || scratch3 != 0x0F) { --#ifdef SERIAL_DEBUG_AUTOCONF -- printk("serial: ttyS%d: simple autoconfig failed " -- "(%02x, %02x)\n", state->line, -- scratch2, scratch3); --#endif -- restore_flags(flags); -- return; /* We failed; there's nothing here */ -- } -- } -- -- save_mcr = serial_in(info, UART_MCR); -- save_lcr = serial_in(info, UART_LCR); -- -- /* -- * Check to see if a UART is really there. Certain broken -- * internal modems based on the Rockwell chipset fail this -- * test, because they apparently don't implement the loopback -- * test mode. So this test is skipped on the COM 1 through -- * COM 4 ports. This *should* be safe, since no board -- * manufacturer would be stupid enough to design a board -- * that conflicts with COM 1-4 --- we hope! -- */ -- if (!(state->flags & ASYNC_SKIP_TEST)) { -- serial_outp(info, UART_MCR, UART_MCR_LOOP | 0x0A); -- status1 = serial_inp(info, UART_MSR) & 0xF0; -- serial_outp(info, UART_MCR, save_mcr); -- if (status1 != 0x90) { --#ifdef SERIAL_DEBUG_AUTOCONF -- printk("serial: ttyS%d: no UART loopback failed\n", -- state->line); --#endif -- restore_flags(flags); -- return; -- } -- } -- serial_outp(info, UART_LCR, 0xBF); /* set up for StarTech test */ -- serial_outp(info, UART_EFR, 0); /* EFR is the same as FCR */ -- serial_outp(info, UART_LCR, 0); -- serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO); -- scratch = serial_in(info, UART_IIR) >> 6; -- switch (scratch) { -- case 0: -- state->type = PORT_16450; -- break; -- case 1: -- state->type = PORT_UNKNOWN; -- break; -- case 2: -- state->type = PORT_16550; -- break; -- case 3: -- state->type = PORT_16550A; -- break; -- } -- if (state->type == PORT_16550A) { -- /* Check for Startech UART's */ -- serial_outp(info, UART_LCR, UART_LCR_DLAB); -- if (serial_in(info, UART_EFR) == 0) { -- state->type = PORT_16650; -- } else { -- serial_outp(info, UART_LCR, 0xBF); -- if (serial_in(info, UART_EFR) == 0) -- autoconfig_startech_uarts(info, state, flags); -- } -- } -- if (state->type == PORT_16550A) { -- /* Check for TI 16750 */ -- serial_outp(info, UART_LCR, save_lcr | UART_LCR_DLAB); -- serial_outp(info, UART_FCR, -- UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); -- scratch = serial_in(info, UART_IIR) >> 5; -- if (scratch == 7) { -- /* -- * If this is a 16750, and not a cheap UART -- * clone, then it should only go into 64 byte -- * mode if the UART_FCR7_64BYTE bit was set -- * while UART_LCR_DLAB was latched. -- */ -- serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO); -- serial_outp(info, UART_LCR, 0); -- serial_outp(info, UART_FCR, -- UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); -- scratch = serial_in(info, UART_IIR) >> 5; -- if (scratch == 6) -- state->type = PORT_16750; -- } -- serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO); -- } --#if defined(CONFIG_SERIAL_RSA) && defined(MODULE) -- if (state->type == PORT_16550A) { -- int i; -- -- for (i = 0 ; i < PORT_RSA_MAX ; ++i) { -- if (!probe_rsa[i] && !force_rsa[i]) -- break; -- if (((probe_rsa[i] != state->port) || -- check_region(state->port + UART_RSA_BASE, 16)) && -- (force_rsa[i] != state->port)) -- continue; -- if (!enable_rsa(info)) -- continue; -- state->type = PORT_RSA; -- state->baud_base = SERIAL_RSA_BAUD_BASE; -- break; -- } -- } --#endif -- serial_outp(info, UART_LCR, save_lcr); -- if (state->type == PORT_16450) { -- scratch = serial_in(info, UART_SCR); -- serial_outp(info, UART_SCR, 0xa5); -- status1 = serial_in(info, UART_SCR); -- serial_outp(info, UART_SCR, 0x5a); -- status2 = serial_in(info, UART_SCR); -- serial_outp(info, UART_SCR, scratch); -- -- if ((status1 != 0xa5) || (status2 != 0x5a)) -- state->type = PORT_8250; -- } -- state->xmit_fifo_size = uart_config[state->type].dfl_xmit_fifo_size; -- -- if (state->type == PORT_UNKNOWN) { -- restore_flags(flags); -- return; -- } -- -- if (info->port) { --#ifdef CONFIG_SERIAL_RSA -- if (state->type == PORT_RSA) -- request_region(info->port + UART_RSA_BASE, 16, -- "serial_rsa(auto)"); -- else --#endif -- request_region(info->port,8,"serial(auto)"); -- } -- -- /* -- * Reset the UART. -- */ --#ifdef CONFIG_SERIAL_RSA -- if (state->type == PORT_RSA) -- serial_outp(info, UART_RSA_FRR, 0); --#endif -- serial_outp(info, UART_MCR, save_mcr); -- serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO | -- UART_FCR_CLEAR_RCVR | -- UART_FCR_CLEAR_XMIT)); -- serial_outp(info, UART_FCR, 0); -- (void)serial_in(info, UART_RX); -- serial_outp(info, UART_IER, 0); -- -- restore_flags(flags); --} -- ++ if (i >= NR_IRQS) ++ return(-ENOENT); ++ rs_table[i].magic = 0; ++ rs_table[i].baud_base = req->baud_base; ++ rs_table[i].port = req->port; ++ if (HIGH_BITS_OFFSET) ++ rs_table[i].port += (unsigned long) req->port_high << ++ HIGH_BITS_OFFSET; ++ rs_table[i].irq = req->irq; ++ rs_table[i].flags = req->flags; ++ rs_table[i].close_delay = req->close_delay; ++ rs_table[i].io_type = req->io_type; ++ rs_table[i].iomem_base = req->iomem_base; ++ rs_table[i].iomem_reg_shift = req->iomem_reg_shift; ++ rs_table[i].type = req->type; ++ rs_table[i].xmit_fifo_size = req->xmit_fifo_size; ++ rs_table[i].custom_divisor = req->custom_divisor; ++ rs_table[i].closing_wait = req->closing_wait; ++ return(0); + } + + /* +@@ -3894,1760 +3224,8 @@ + restore_flags(flags); + } + -int register_serial(struct serial_struct *req); -void unregister_serial(int line); - @@ -9323,7 +9194,7 @@ -#endif - { SPCI_FL_BASE0, 1, 115200, /* pbn_xircom_combo */ - 0, 0, pci_xircom_fn }, -- + - { SPCI_FL_BASE2, 1, 460800, /* pbn_siig10x_0 */ - 0, 0, pci_siig10x_fn }, - { SPCI_FL_BASE2, 1, 921600, /* pbn_siig10x_1 */ @@ -9338,7 +9209,7 @@ - 0, 0, pci_siig20x_fn }, - { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 921600, /* pbn_siix20x_4 */ - 0, 0, pci_siig20x_fn }, -- + - { SPCI_FL_BASE0, 4, 921600, /* IOMEM */ /* pbn_computone_4 */ - 0x40, 2, NULL, 0x200 }, - { SPCI_FL_BASE0, 6, 921600, /* IOMEM */ /* pbn_computone_6 */ @@ -9351,16 +9222,13 @@ - * Given a complete unknown PCI device, try to use some heuristics to - * guess what the configuration might be, based on the pitiful PCI - * serial specs. Returns 0 on success, 1 on failure. -+ * The serial driver boot-time initialization code! - */ +- */ -static int __devinit serial_pci_guess_board(struct pci_dev *dev, - struct pci_board *board) -+static int __init rs_init(void) - { +-{ - int num_iomem = 0, num_port = 0, first_port = -1; - int i; -+ struct serial_state * state; - +- int i; +- - /* - * If it is not a communications device or the programming - * interface is greater than 6, give up. @@ -9382,28 +9250,14 @@ - if (IS_PCI_REGION_IOMEM(dev, i)) - num_iomem++; - } -+ printk("pxa & ti16c754b serial driver\n"); -+ set_GPIO_IRQ_edge(7, GPIO_RISING_EDGE); -+ set_GPIO_IRQ_edge(24, GPIO_RISING_EDGE); -+ set_GPIO_IRQ_edge(25, GPIO_RISING_EDGE); -+ set_GPIO_IRQ_edge(26, GPIO_RISING_EDGE); - +- - /* - * If there is exactly one port of 8 bytes, use it. - */ - if (num_port == 1 && pci_resource_len(dev, first_port) == 8) { - board->flags = first_port; - return 0; -+ if (!request_mem_region(RAMSES_UARTA_PHYS, 16*4, "Ramses UART A")) -+ printk(KERN_ERR "unable to reserve region\n"); -+ else { -+ ramses_uarta = ioremap_nocache(RAMSES_UARTA_PHYS, 16*4); -+ if (!ramses_uarta) -+ printk(KERN_ERR "unable to map region\n"); -+ else { -+ //printk("ramses_uarta cookie is: %08x\n", (unsigned int) ramses_uarta); -+ rs_table[3].iomem_base = ramses_uarta; - } +- } - - /* - * If there is 1 or 0 iomem regions, and exactly one port, use @@ -9412,7 +9266,7 @@ - if (num_iomem <= 1 && num_port == 1) { - board->flags = first_port; - return 0; - } +- } - return 1; -} - @@ -9459,16 +9313,7 @@ - continue; - unregister_serial(i); - rs_table[i].dev = 0; -+ if (!request_mem_region(RAMSES_UARTB_PHYS, 16*4, "Ramses UART B")) -+ printk(KERN_ERR "unable to reserve region\n"); -+ else { -+ ramses_uartb = ioremap_nocache(RAMSES_UARTB_PHYS, 16*4); -+ if (!ramses_uartb) -+ printk(KERN_ERR "unable to map region\n"); -+ else { -+ //printk("ramses_uartb cookie is: %08x\n", (unsigned int) ramses_uartb); -+ rs_table[4].iomem_base = ramses_uartb; - } +- } - /* - * Now execute any board-specific shutdown procedure - */ @@ -9482,7 +9327,7 @@ - if (DEACTIVATE_FUNC(brd->dev)) - (DEACTIVATE_FUNC(brd->dev))(brd->dev); - serial_pci_board[i].dev = 0; - } +- } -} - - @@ -10178,16 +10023,7 @@ - if (strstr(name, *tmp)) - return 1; - tmp++; -+ if (!request_mem_region(RAMSES_UARTC_PHYS, 16*4, "Ramses UART C")) -+ printk(KERN_ERR "unable to reserve region\n"); -+ else { -+ ramses_uartc = ioremap_nocache(RAMSES_UARTC_PHYS, 16*4); -+ if (!ramses_uartc) -+ printk(KERN_ERR "unable to map region\n"); -+ else { -+ //printk("ramses_uartc cookie is: %08x\n", (unsigned int) ramses_uartc); -+ rs_table[5].iomem_base = ramses_uartc; - } +- } - return 0; -} - @@ -10236,7 +10072,7 @@ - (port->min == 0x2e8) || - (port->min == 0x3e8))) - return 0; - } +- } - - return 1; -} @@ -10255,16 +10091,7 @@ - printk("Leaving probe_serial_pnp() (no isapnp)\n"); -#endif - return; -+ if (!request_mem_region(RAMSES_UARTD_PHYS, 16*4, "Ramses UART D")) -+ printk(KERN_ERR "unable to reserve region\n"); -+ else { -+ ramses_uartd = ioremap_nocache(RAMSES_UARTD_PHYS, 16*4); -+ if (!ramses_uartd) -+ printk(KERN_ERR "unable to map region\n"); -+ else { -+ //printk("ramses_uartd cookie is: %08x\n", (unsigned int) ramses_uartd); -+ rs_table[6].iomem_base = ramses_uartd; - } +- } - - isapnp_for_each_dev(dev) { - if (dev->active) @@ -10288,7 +10115,7 @@ - } else { - if (serial_pnp_guess_board(dev, &board)) - continue; - } +- } - - if (board.flags & SPCI_FL_NO_SHIRQ) - avoid_irq_share(dev); @@ -10311,97 +10138,126 @@ - int i; - struct serial_state * state; - - init_bh(SERIAL_BH, do_serial_bh); - init_timer(&serial_timer); - serial_timer.function = rs_timer; -@@ -5463,10 +2723,6 @@ - for (i = 0; i < NR_IRQS; i++) { - IRQ_ports[i] = 0; - IRQ_timeout[i] = 0; +- init_bh(SERIAL_BH, do_serial_bh); +- init_timer(&serial_timer); +- serial_timer.function = rs_timer; +- mod_timer(&serial_timer, jiffies + RS_STROBE_TIME); +- +- for (i = 0; i < NR_IRQS; i++) { +- IRQ_ports[i] = 0; +- IRQ_timeout[i] = 0; -#ifdef CONFIG_SERIAL_MULTIPORT - memset(&rs_multiport[i], 0, - sizeof(struct rs_multiport_struct)); -#endif - } - #ifdef CONFIG_SERIAL_CONSOLE - /* -@@ -5480,29 +2736,25 @@ - rs_table[i].irq = 0; - } - #endif +- } +-#ifdef CONFIG_SERIAL_CONSOLE +- /* +- * The interrupt of the serial console port +- * can't be shared. +- */ +- if (sercons.flags & CON_CONSDEV) { +- for(i = 0; i < NR_PORTS; i++) +- if (i != sercons.index && +- rs_table[i].irq == rs_table[sercons.index].irq) +- rs_table[i].irq = 0; +- } +-#endif - show_serial_version(); - - /* Initialize the tty_driver structure */ - - memset(&serial_driver, 0, sizeof(struct tty_driver)); - serial_driver.magic = TTY_DRIVER_MAGIC; +- /* Initialize the tty_driver structure */ +- +- memset(&serial_driver, 0, sizeof(struct tty_driver)); +- serial_driver.magic = TTY_DRIVER_MAGIC; -#if (LINUX_VERSION_CODE > 0x20100) - serial_driver.driver_name = "serial"; +- serial_driver.driver_name = "serial"; -#endif -#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS)) -+#if defined(CONFIG_DEVFS_FS) - serial_driver.name = "tts/%d"; - #else - serial_driver.name = "ttyS"; - #endif - serial_driver.major = TTY_MAJOR; +- serial_driver.name = "tts/%d"; +-#else +- serial_driver.name = "ttyS"; +-#endif +- serial_driver.major = TTY_MAJOR; - serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET; - serial_driver.name_base = SERIAL_DEV_OFFSET; -+ serial_driver.minor_start = 64; -+ serial_driver.name_base = 0; - serial_driver.num = NR_PORTS; - serial_driver.type = TTY_DRIVER_TYPE_SERIAL; - serial_driver.subtype = SERIAL_TYPE_NORMAL; - serial_driver.init_termios = tty_std_termios; - serial_driver.init_termios.c_cflag = +- serial_driver.num = NR_PORTS; +- serial_driver.type = TTY_DRIVER_TYPE_SERIAL; +- serial_driver.subtype = SERIAL_TYPE_NORMAL; +- serial_driver.init_termios = tty_std_termios; +- serial_driver.init_termios.c_cflag = - B9600 | CS8 | CREAD | HUPCL | CLOCAL; -+ B115200 | CS8 | CREAD | HUPCL | CLOCAL; - serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; - serial_driver.refcount = &serial_refcount; - serial_driver.table = serial_table; -@@ -5524,31 +2776,25 @@ - serial_driver.stop = rs_stop; - serial_driver.start = rs_start; - serial_driver.hangup = rs_hangup; +- serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; +- serial_driver.refcount = &serial_refcount; +- serial_driver.table = serial_table; +- serial_driver.termios = serial_termios; +- serial_driver.termios_locked = serial_termios_locked; +- +- serial_driver.open = rs_open; +- serial_driver.close = rs_close; +- serial_driver.write = rs_write; +- serial_driver.put_char = rs_put_char; +- serial_driver.flush_chars = rs_flush_chars; +- serial_driver.write_room = rs_write_room; +- serial_driver.chars_in_buffer = rs_chars_in_buffer; +- serial_driver.flush_buffer = rs_flush_buffer; +- serial_driver.ioctl = rs_ioctl; +- serial_driver.throttle = rs_throttle; +- serial_driver.unthrottle = rs_unthrottle; +- serial_driver.set_termios = rs_set_termios; +- serial_driver.stop = rs_stop; +- serial_driver.start = rs_start; +- serial_driver.hangup = rs_hangup; -#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ - serial_driver.break_ctl = rs_break; +- serial_driver.break_ctl = rs_break; -#endif -#if (LINUX_VERSION_CODE >= 131343) - serial_driver.send_xchar = rs_send_xchar; - serial_driver.wait_until_sent = rs_wait_until_sent; - serial_driver.read_proc = rs_read_proc; +- serial_driver.send_xchar = rs_send_xchar; +- serial_driver.wait_until_sent = rs_wait_until_sent; +- serial_driver.read_proc = rs_read_proc; -#endif - - /* - * The callout device is just like normal device except for - * major number and the subtype code. - */ - callout_driver = serial_driver; +- +- /* +- * The callout device is just like normal device except for +- * major number and the subtype code. +- */ +- callout_driver = serial_driver; -#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS)) -+#if defined(CONFIG_DEVFS_FS) - callout_driver.name = "cua/%d"; - #else - callout_driver.name = "cua"; - #endif - callout_driver.major = TTYAUX_MAJOR; - callout_driver.subtype = SERIAL_TYPE_CALLOUT; +- callout_driver.name = "cua/%d"; +-#else +- callout_driver.name = "cua"; +-#endif +- callout_driver.major = TTYAUX_MAJOR; +- callout_driver.subtype = SERIAL_TYPE_CALLOUT; -#if (LINUX_VERSION_CODE >= 131343) - callout_driver.read_proc = 0; - callout_driver.proc_entry = 0; +- callout_driver.read_proc = 0; +- callout_driver.proc_entry = 0; -#endif - - if (tty_register_driver(&serial_driver)) - panic("Couldn't register serial driver\n"); -@@ -5569,53 +2815,23 @@ - state->icount.frame = state->icount.parity = 0; - state->icount.overrun = state->icount.brk = 0; - state->irq = irq_cannonicalize(state->irq); +- +- if (tty_register_driver(&serial_driver)) +- panic("Couldn't register serial driver\n"); +- if (tty_register_driver(&callout_driver)) +- panic("Couldn't register callout driver\n"); +- +- for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { +- state->magic = SSTATE_MAGIC; +- state->line = i; +- state->custom_divisor = 0; +- state->close_delay = 5*HZ/10; +- state->closing_wait = 30*HZ; +- state->callout_termios = callout_driver.init_termios; +- state->normal_termios = serial_driver.init_termios; +- state->icount.cts = state->icount.dsr = +- state->icount.rng = state->icount.dcd = 0; +- state->icount.rx = state->icount.tx = 0; +- state->icount.frame = state->icount.parity = 0; +- state->icount.overrun = state->icount.brk = 0; +- state->irq = irq_cannonicalize(state->irq); - if (state->hub6) - state->io_type = SERIAL_IO_HUB6; - if (state->port && check_region(state->port,8)) { - state->type = PORT_UNKNOWN; - continue; - } +- if (state->port && check_region(state->port,8)) { +- state->type = PORT_UNKNOWN; +- continue; +- } -#ifdef CONFIG_MCA - if ((state->flags & ASYNC_BOOT_ONLYMCA) && !MCA_bus) - continue; @@ -10410,10 +10266,10 @@ - state->type = PORT_UNKNOWN; - autoconfig(state); - } - } - for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { - if (state->type == PORT_UNKNOWN) - continue; +- } +- for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { +- if (state->type == PORT_UNKNOWN) +- continue; - if ( (state->flags & ASYNC_BOOT_AUTOCONF) - && (state->flags & ASYNC_AUTO_IRQ) - && (state->port != 0 || state->iomem_base != 0)) @@ -10430,51 +10286,55 @@ - state->line + SERIAL_DEV_OFFSET, - (state->flags & ASYNC_FOURPORT) ? " FourPort" : "", - state->port, state->irq, -+ printk(KERN_INFO"tts/%d at irq %d is a %s\n", -+ state->line, -+ state->irq, - uart_config[state->type].name); +- uart_config[state->type].name); - } - tty_register_devfs(&serial_driver, 0, - serial_driver.minor_start + state->line); - tty_register_devfs(&callout_driver, 0, - callout_driver.minor_start + state->line); - } +- tty_register_devfs(&serial_driver, 0, +- serial_driver.minor_start + state->line); +- tty_register_devfs(&callout_driver, 0, +- callout_driver.minor_start + state->line); +- } -#ifdef ENABLE_SERIAL_PCI - probe_serial_pci(); -#endif -#ifdef ENABLE_SERIAL_PNP - probe_serial_pnp(); -#endif - return 0; - } - -@@ -5627,6 +2843,8 @@ - { - int i = req->line; - -+ printk("%s\n", __FUNCTION__); -+ - if (i >= NR_IRQS) - return(-ENOENT); - rs_table[i].magic = 0; -@@ -5639,7 +2857,6 @@ - rs_table[i].flags = req->flags; - rs_table[i].close_delay = req->close_delay; - rs_table[i].io_type = req->io_type; +- return 0; +-} +- +-/* +- * This is for use by architectures that know their serial console +- * attributes only at run time. Not to be invoked after rs_init(). +- */ +-int __init early_serial_setup(struct serial_struct *req) +-{ +- int i = req->line; +- +- if (i >= NR_IRQS) +- return(-ENOENT); +- rs_table[i].magic = 0; +- rs_table[i].baud_base = req->baud_base; +- rs_table[i].port = req->port; +- if (HIGH_BITS_OFFSET) +- rs_table[i].port += (unsigned long) req->port_high << +- HIGH_BITS_OFFSET; +- rs_table[i].irq = req->irq; +- rs_table[i].flags = req->flags; +- rs_table[i].close_delay = req->close_delay; +- rs_table[i].io_type = req->io_type; - rs_table[i].hub6 = req->hub6; - rs_table[i].iomem_base = req->iomem_base; - rs_table[i].iomem_reg_shift = req->iomem_reg_shift; - rs_table[i].type = req->type; -@@ -5726,7 +2943,6 @@ - info->iomem_base = req->iomem_base; - info->iomem_reg_shift = req->iomem_reg_shift; - } -- autoconfig(state); - if (state->type == PORT_UNKNOWN) { - restore_flags(flags); - printk("register_serial(): autoconfig failed\n"); -@@ -5734,11 +2950,8 @@ +- rs_table[i].iomem_base = req->iomem_base; +- rs_table[i].iomem_reg_shift = req->iomem_reg_shift; +- rs_table[i].type = req->type; +- rs_table[i].xmit_fifo_size = req->xmit_fifo_size; +- rs_table[i].custom_divisor = req->custom_divisor; +- rs_table[i].closing_wait = req->closing_wait; +- return(0); +-} + + /* + * register_serial and unregister_serial allows for 16x50 serial ports to be +@@ -5734,11 +3312,8 @@ } restore_flags(flags); @@ -10487,7 +10347,7 @@ state->iomem_base ? "iomem" : "port", state->iomem_base ? (unsigned long)state->iomem_base : state->port, state->irq, uart_config[state->type].name); -@@ -5746,7 +2959,7 @@ +@@ -5746,7 +3321,7 @@ serial_driver.minor_start + state->line); tty_register_devfs(&callout_driver, 0, callout_driver.minor_start + state->line); @@ -10496,7 +10356,7 @@ } /** -@@ -5785,7 +2998,6 @@ +@@ -5785,7 +3360,6 @@ int i; struct async_struct *info; @@ -10504,7 +10364,7 @@ del_timer_sync(&serial_timer); save_flags(flags); cli(); remove_bh(SERIAL_BH); -@@ -5803,41 +3015,31 @@ +@@ -5803,41 +3377,31 @@ kfree(info); } if ((rs_table[i].type != PORT_UNKNOWN) && rs_table[i].port) { @@ -10562,7 +10422,7 @@ } module_init(rs_init); -@@ -5946,7 +3148,7 @@ +@@ -5946,7 +3510,7 @@ static struct async_struct *info; struct serial_state *state; unsigned cval; @@ -10571,7 +10431,7 @@ int bits = 8; int parity = 'n'; int doflow = 0; -@@ -5954,6 +3156,8 @@ +@@ -5954,6 +3518,8 @@ int quot = 0; char *s; @@ -10580,7 +10440,7 @@ if (options) { baud = simple_strtoul(options, NULL, 10); s = options; -@@ -6028,19 +3232,12 @@ +@@ -6028,19 +3594,12 @@ info->state = state; info->port = state->port; info->flags = state->flags; @@ -10600,7 +10460,7 @@ if (cflag & PARENB) cval |= UART_LCR_PARITY; if (!(cflag & PARODD)) -@@ -6082,10 +3279,15 @@ +@@ -6082,10 +3641,15 @@ */ void __init serial_console_init(void) { |