aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPaul Bolle <pebolle@tiscali.nl>2014-02-09 08:22:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-15 15:16:21 -0500
commitb2b2d6067db89afac3185de6e869766aa259731d (patch)
tree030c1c3e533764eba84dd415b5983d0179a72c68 /drivers/tty
parent86a41c46c7b5a1335b849f5e48d20184e4a905e1 (diff)
tty: serial: crisv10: Drop remaining code for CRISv10 CPU simulator
The Kconfig symbol SVINTO_SIM got dropped in commit e269a869417c ("Drop code for CRISv10 CPU simulator"). Now drop the remaining code for that simulator. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/crisv10.c112
1 files changed, 0 insertions, 112 deletions
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 690bdea0a0c1..d567ac5d3af4 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -286,7 +286,6 @@ static struct e100_serial rs_table[] = {
286#endif 286#endif
287 287
288}, /* ttyS0 */ 288}, /* ttyS0 */
289#ifndef CONFIG_SVINTO_SIM
290 { .baud = DEF_BAUD, 289 { .baud = DEF_BAUD,
291 .ioport = (unsigned char *)R_SERIAL1_CTRL, 290 .ioport = (unsigned char *)R_SERIAL1_CTRL,
292 .irq = 1U << 16, /* uses DMA 8 and 9 */ 291 .irq = 1U << 16, /* uses DMA 8 and 9 */
@@ -447,7 +446,6 @@ static struct e100_serial rs_table[] = {
447 .dma_in_enabled = 0 446 .dma_in_enabled = 0
448#endif 447#endif
449 } /* ttyS3 */ 448 } /* ttyS3 */
450#endif
451}; 449};
452 450
453 451
@@ -1035,7 +1033,6 @@ cflag_to_etrax_baud(unsigned int cflag)
1035static inline void 1033static inline void
1036e100_dtr(struct e100_serial *info, int set) 1034e100_dtr(struct e100_serial *info, int set)
1037{ 1035{
1038#ifndef CONFIG_SVINTO_SIM
1039 unsigned char mask = e100_modem_pins[info->line].dtr_mask; 1036 unsigned char mask = e100_modem_pins[info->line].dtr_mask;
1040 1037
1041#ifdef SERIAL_DEBUG_IO 1038#ifdef SERIAL_DEBUG_IO
@@ -1060,7 +1057,6 @@ e100_dtr(struct e100_serial *info, int set)
1060 info->line, *e100_modem_pins[info->line].dtr_shadow, 1057 info->line, *e100_modem_pins[info->line].dtr_shadow,
1061 E100_DTR_GET(info)); 1058 E100_DTR_GET(info));
1062#endif 1059#endif
1063#endif
1064} 1060}
1065 1061
1066/* set = 0 means 3.3V on the pin, bitvalue: 0=active, 1=inactive 1062/* set = 0 means 3.3V on the pin, bitvalue: 0=active, 1=inactive
@@ -1069,7 +1065,6 @@ e100_dtr(struct e100_serial *info, int set)
1069static inline void 1065static inline void
1070e100_rts(struct e100_serial *info, int set) 1066e100_rts(struct e100_serial *info, int set)
1071{ 1067{
1072#ifndef CONFIG_SVINTO_SIM
1073 unsigned long flags; 1068 unsigned long flags;
1074 local_irq_save(flags); 1069 local_irq_save(flags);
1075 info->rx_ctrl &= ~E100_RTS_MASK; 1070 info->rx_ctrl &= ~E100_RTS_MASK;
@@ -1079,7 +1074,6 @@ e100_rts(struct e100_serial *info, int set)
1079#ifdef SERIAL_DEBUG_IO 1074#ifdef SERIAL_DEBUG_IO
1080 printk("ser%i rts %i\n", info->line, set); 1075 printk("ser%i rts %i\n", info->line, set);
1081#endif 1076#endif
1082#endif
1083} 1077}
1084 1078
1085 1079
@@ -1087,7 +1081,6 @@ e100_rts(struct e100_serial *info, int set)
1087static inline void 1081static inline void
1088e100_ri_out(struct e100_serial *info, int set) 1082e100_ri_out(struct e100_serial *info, int set)
1089{ 1083{
1090#ifndef CONFIG_SVINTO_SIM
1091 /* RI is active low */ 1084 /* RI is active low */
1092 { 1085 {
1093 unsigned char mask = e100_modem_pins[info->line].ri_mask; 1086 unsigned char mask = e100_modem_pins[info->line].ri_mask;
@@ -1099,12 +1092,10 @@ e100_ri_out(struct e100_serial *info, int set)
1099 *e100_modem_pins[info->line].ri_port = *e100_modem_pins[info->line].ri_shadow; 1092 *e100_modem_pins[info->line].ri_port = *e100_modem_pins[info->line].ri_shadow;
1100 local_irq_restore(flags); 1093 local_irq_restore(flags);
1101 } 1094 }
1102#endif
1103} 1095}
1104static inline void 1096static inline void
1105e100_cd_out(struct e100_serial *info, int set) 1097e100_cd_out(struct e100_serial *info, int set)
1106{ 1098{
1107#ifndef CONFIG_SVINTO_SIM
1108 /* CD is active low */ 1099 /* CD is active low */
1109 { 1100 {
1110 unsigned char mask = e100_modem_pins[info->line].cd_mask; 1101 unsigned char mask = e100_modem_pins[info->line].cd_mask;
@@ -1116,27 +1107,22 @@ e100_cd_out(struct e100_serial *info, int set)
1116 *e100_modem_pins[info->line].cd_port = *e100_modem_pins[info->line].cd_shadow; 1107 *e100_modem_pins[info->line].cd_port = *e100_modem_pins[info->line].cd_shadow;
1117 local_irq_restore(flags); 1108 local_irq_restore(flags);
1118 } 1109 }
1119#endif
1120} 1110}
1121 1111
1122static inline void 1112static inline void
1123e100_disable_rx(struct e100_serial *info) 1113e100_disable_rx(struct e100_serial *info)
1124{ 1114{
1125#ifndef CONFIG_SVINTO_SIM
1126 /* disable the receiver */ 1115 /* disable the receiver */
1127 info->ioport[REG_REC_CTRL] = 1116 info->ioport[REG_REC_CTRL] =
1128 (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); 1117 (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
1129#endif
1130} 1118}
1131 1119
1132static inline void 1120static inline void
1133e100_enable_rx(struct e100_serial *info) 1121e100_enable_rx(struct e100_serial *info)
1134{ 1122{
1135#ifndef CONFIG_SVINTO_SIM
1136 /* enable the receiver */ 1123 /* enable the receiver */
1137 info->ioport[REG_REC_CTRL] = 1124 info->ioport[REG_REC_CTRL] =
1138 (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); 1125 (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
1139#endif
1140} 1126}
1141 1127
1142/* the rx DMA uses both the dma_descr and the dma_eop interrupts */ 1128/* the rx DMA uses both the dma_descr and the dma_eop interrupts */
@@ -1554,24 +1540,6 @@ transmit_chars_dma(struct e100_serial *info)
1554 unsigned int c, sentl; 1540 unsigned int c, sentl;
1555 struct etrax_dma_descr *descr; 1541 struct etrax_dma_descr *descr;
1556 1542
1557#ifdef CONFIG_SVINTO_SIM
1558 /* This will output too little if tail is not 0 always since
1559 * we don't reloop to send the other part. Anyway this SHOULD be a
1560 * no-op - transmit_chars_dma would never really be called during sim
1561 * since rs_write does not write into the xmit buffer then.
1562 */
1563 if (info->xmit.tail)
1564 printk("Error in serial.c:transmit_chars-dma(), tail!=0\n");
1565 if (info->xmit.head != info->xmit.tail) {
1566 SIMCOUT(info->xmit.buf + info->xmit.tail,
1567 CIRC_CNT(info->xmit.head,
1568 info->xmit.tail,
1569 SERIAL_XMIT_SIZE));
1570 info->xmit.head = info->xmit.tail; /* move back head */
1571 info->tr_running = 0;
1572 }
1573 return;
1574#endif
1575 /* acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */ 1543 /* acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */
1576 *info->oclrintradr = 1544 *info->oclrintradr =
1577 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | 1545 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
@@ -1842,13 +1810,6 @@ static void receive_chars_dma(struct e100_serial *info)
1842 struct tty_struct *tty; 1810 struct tty_struct *tty;
1843 unsigned char rstat; 1811 unsigned char rstat;
1844 1812
1845#ifdef CONFIG_SVINTO_SIM
1846 /* No receive in the simulator. Will probably be when the rest of
1847 * the serial interface works, and this piece will just be removed.
1848 */
1849 return;
1850#endif
1851
1852 /* Acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */ 1813 /* Acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */
1853 *info->iclrintradr = 1814 *info->iclrintradr =
1854 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | 1815 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
@@ -1934,12 +1895,6 @@ static int start_recv_dma(struct e100_serial *info)
1934static void 1895static void
1935start_receive(struct e100_serial *info) 1896start_receive(struct e100_serial *info)
1936{ 1897{
1937#ifdef CONFIG_SVINTO_SIM
1938 /* No receive in the simulator. Will probably be when the rest of
1939 * the serial interface works, and this piece will just be removed.
1940 */
1941 return;
1942#endif
1943 if (info->uses_dma_in) { 1898 if (info->uses_dma_in) {
1944 /* reset the input dma channel to be sure it works */ 1899 /* reset the input dma channel to be sure it works */
1945 1900
@@ -1972,17 +1927,6 @@ tr_interrupt(int irq, void *dev_id)
1972 int i; 1927 int i;
1973 int handled = 0; 1928 int handled = 0;
1974 1929
1975#ifdef CONFIG_SVINTO_SIM
1976 /* No receive in the simulator. Will probably be when the rest of
1977 * the serial interface works, and this piece will just be removed.
1978 */
1979 {
1980 const char *s = "What? tr_interrupt in simulator??\n";
1981 SIMCOUT(s,strlen(s));
1982 }
1983 return IRQ_HANDLED;
1984#endif
1985
1986 /* find out the line that caused this irq and get it from rs_table */ 1930 /* find out the line that caused this irq and get it from rs_table */
1987 1931
1988 ireg = *R_IRQ_MASK2_RD; /* get the active irq bits for the dma channels */ 1932 ireg = *R_IRQ_MASK2_RD; /* get the active irq bits for the dma channels */
@@ -2021,17 +1965,6 @@ rec_interrupt(int irq, void *dev_id)
2021 int i; 1965 int i;
2022 int handled = 0; 1966 int handled = 0;
2023 1967
2024#ifdef CONFIG_SVINTO_SIM
2025 /* No receive in the simulator. Will probably be when the rest of
2026 * the serial interface works, and this piece will just be removed.
2027 */
2028 {
2029 const char *s = "What? rec_interrupt in simulator??\n";
2030 SIMCOUT(s,strlen(s));
2031 }
2032 return IRQ_HANDLED;
2033#endif
2034
2035 /* find out the line that caused this irq and get it from rs_table */ 1968 /* find out the line that caused this irq and get it from rs_table */
2036 1969
2037 ireg = *R_IRQ_MASK2_RD; /* get the active irq bits for the dma channels */ 1970 ireg = *R_IRQ_MASK2_RD; /* get the active irq bits for the dma channels */
@@ -2173,10 +2106,6 @@ timed_flush_handler(unsigned long ptr)
2173 struct e100_serial *info; 2106 struct e100_serial *info;
2174 int i; 2107 int i;
2175 2108
2176#ifdef CONFIG_SVINTO_SIM
2177 return;
2178#endif
2179
2180 for (i = 0; i < NR_PORTS; i++) { 2109 for (i = 0; i < NR_PORTS; i++) {
2181 info = rs_table + i; 2110 info = rs_table + i;
2182 if (info->uses_dma_in) 2111 if (info->uses_dma_in)
@@ -2729,25 +2658,6 @@ startup(struct e100_serial * info)
2729 printk("starting up ttyS%d (xmit_buf 0x%p)...\n", info->line, info->xmit.buf); 2658 printk("starting up ttyS%d (xmit_buf 0x%p)...\n", info->line, info->xmit.buf);
2730#endif 2659#endif
2731 2660
2732#ifdef CONFIG_SVINTO_SIM
2733 /* Bits and pieces collected from below. Better to have them
2734 in one ifdef:ed clause than to mix in a lot of ifdefs,
2735 right? */
2736 if (info->port.tty)
2737 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
2738
2739 info->xmit.head = info->xmit.tail = 0;
2740 info->first_recv_buffer = info->last_recv_buffer = NULL;
2741 info->recv_cnt = info->max_recv_cnt = 0;
2742
2743 for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++)
2744 info->rec_descr[i].buf = NULL;
2745
2746 /* No real action in the simulator, but may set info important
2747 to ioctl. */
2748 change_speed(info);
2749#else
2750
2751 /* 2661 /*
2752 * Clear the FIFO buffers and disable them 2662 * Clear the FIFO buffers and disable them
2753 * (they will be reenabled in change_speed()) 2663 * (they will be reenabled in change_speed())
@@ -2837,8 +2747,6 @@ startup(struct e100_serial * info)
2837 e100_rts(info, 1); 2747 e100_rts(info, 1);
2838 e100_dtr(info, 1); 2748 e100_dtr(info, 1);
2839 2749
2840#endif /* CONFIG_SVINTO_SIM */
2841
2842 info->port.flags |= ASYNC_INITIALIZED; 2750 info->port.flags |= ASYNC_INITIALIZED;
2843 2751
2844 local_irq_restore(flags); 2752 local_irq_restore(flags);
@@ -2857,7 +2765,6 @@ shutdown(struct e100_serial * info)
2857 struct etrax_recv_buffer *buffer; 2765 struct etrax_recv_buffer *buffer;
2858 int i; 2766 int i;
2859 2767
2860#ifndef CONFIG_SVINTO_SIM
2861 /* shut down the transmitter and receiver */ 2768 /* shut down the transmitter and receiver */
2862 DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line)); 2769 DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line));
2863 e100_disable_rx(info); 2770 e100_disable_rx(info);
@@ -2882,8 +2789,6 @@ shutdown(struct e100_serial * info)
2882 info->tr_running = 0; 2789 info->tr_running = 0;
2883 } 2790 }
2884 2791
2885#endif /* CONFIG_SVINTO_SIM */
2886
2887 if (!(info->port.flags & ASYNC_INITIALIZED)) 2792 if (!(info->port.flags & ASYNC_INITIALIZED))
2888 return; 2793 return;
2889 2794
@@ -2995,17 +2900,12 @@ change_speed(struct e100_serial *info)
2995 IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, normal); 2900 IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, normal);
2996 r_alt_ser_baudrate_shadow &= ~mask; 2901 r_alt_ser_baudrate_shadow &= ~mask;
2997 r_alt_ser_baudrate_shadow |= (alt_source << (info->line*8)); 2902 r_alt_ser_baudrate_shadow |= (alt_source << (info->line*8));
2998#ifndef CONFIG_SVINTO_SIM
2999 *R_ALT_SER_BAUDRATE = r_alt_ser_baudrate_shadow; 2903 *R_ALT_SER_BAUDRATE = r_alt_ser_baudrate_shadow;
3000#endif /* CONFIG_SVINTO_SIM */
3001 2904
3002 info->baud = cflag_to_baud(cflag); 2905 info->baud = cflag_to_baud(cflag);
3003#ifndef CONFIG_SVINTO_SIM
3004 info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag); 2906 info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag);
3005#endif /* CONFIG_SVINTO_SIM */
3006 } 2907 }
3007 2908
3008#ifndef CONFIG_SVINTO_SIM
3009 /* start with default settings and then fill in changes */ 2909 /* start with default settings and then fill in changes */
3010 local_irq_save(flags); 2910 local_irq_save(flags);
3011 /* 8 bit, no/even parity */ 2911 /* 8 bit, no/even parity */
@@ -3073,7 +2973,6 @@ change_speed(struct e100_serial *info)
3073 2973
3074 *((unsigned long *)&info->ioport[REG_XOFF]) = xoff; 2974 *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
3075 local_irq_restore(flags); 2975 local_irq_restore(flags);
3076#endif /* !CONFIG_SVINTO_SIM */
3077 2976
3078 update_char_time(info); 2977 update_char_time(info);
3079 2978
@@ -3122,11 +3021,6 @@ static int rs_raw_write(struct tty_struct *tty,
3122 count, info->ioport[REG_STATUS]); 3021 count, info->ioport[REG_STATUS]);
3123#endif 3022#endif
3124 3023
3125#ifdef CONFIG_SVINTO_SIM
3126 /* Really simple. The output is here and now. */
3127 SIMCOUT(buf, count);
3128 return count;
3129#endif
3130 local_save_flags(flags); 3024 local_save_flags(flags);
3131 DFLOW(DEBUG_LOG(info->line, "write count %i ", count)); 3025 DFLOW(DEBUG_LOG(info->line, "write count %i ", count));
3132 DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty))); 3026 DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty)));
@@ -3463,7 +3357,6 @@ static int
3463get_lsr_info(struct e100_serial * info, unsigned int *value) 3357get_lsr_info(struct e100_serial * info, unsigned int *value)
3464{ 3358{
3465 unsigned int result = TIOCSER_TEMT; 3359 unsigned int result = TIOCSER_TEMT;
3466#ifndef CONFIG_SVINTO_SIM
3467 unsigned long curr_time = jiffies; 3360 unsigned long curr_time = jiffies;
3468 unsigned long curr_time_usec = GET_JIFFIES_USEC(); 3361 unsigned long curr_time_usec = GET_JIFFIES_USEC();
3469 unsigned long elapsed_usec = 3362 unsigned long elapsed_usec =
@@ -3474,7 +3367,6 @@ get_lsr_info(struct e100_serial * info, unsigned int *value)
3474 elapsed_usec < 2*info->char_time_usec) { 3367 elapsed_usec < 2*info->char_time_usec) {
3475 result = 0; 3368 result = 0;
3476 } 3369 }
3477#endif
3478 3370
3479 if (copy_to_user(value, &result, sizeof(int))) 3371 if (copy_to_user(value, &result, sizeof(int)))
3480 return -EFAULT; 3372 return -EFAULT;
@@ -3804,7 +3696,6 @@ rs_close(struct tty_struct *tty, struct file * filp)
3804 e100_disable_serial_data_irq(info); 3696 e100_disable_serial_data_irq(info);
3805#endif 3697#endif
3806 3698
3807#ifndef CONFIG_SVINTO_SIM
3808 e100_disable_rx(info); 3699 e100_disable_rx(info);
3809 e100_disable_rx_irq(info); 3700 e100_disable_rx_irq(info);
3810 3701
@@ -3816,7 +3707,6 @@ rs_close(struct tty_struct *tty, struct file * filp)
3816 */ 3707 */
3817 rs_wait_until_sent(tty, HZ); 3708 rs_wait_until_sent(tty, HZ);
3818 } 3709 }
3819#endif
3820 3710
3821 shutdown(info); 3711 shutdown(info);
3822 rs_flush_buffer(tty); 3712 rs_flush_buffer(tty);
@@ -4479,7 +4369,6 @@ static int __init rs_init(void)
4479 fast_timer_init(); 4369 fast_timer_init();
4480#endif 4370#endif
4481 4371
4482#ifndef CONFIG_SVINTO_SIM
4483#ifndef CONFIG_ETRAX_KGDB 4372#ifndef CONFIG_ETRAX_KGDB
4484 /* Not needed in simulator. May only complicate stuff. */ 4373 /* Not needed in simulator. May only complicate stuff. */
4485 /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */ 4374 /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */
@@ -4489,7 +4378,6 @@ static int __init rs_init(void)
4489 panic("%s: Failed to request irq8", __func__); 4378 panic("%s: Failed to request irq8", __func__);
4490 4379
4491#endif 4380#endif
4492#endif /* CONFIG_SVINTO_SIM */
4493 4381
4494 return 0; 4382 return 0;
4495} 4383}