Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Paul Bolle and committed by
Greg Kroah-Hartman
b2b2d606 86a41c46

-112
-112
drivers/tty/serial/crisv10.c
··· 286 286 #endif 287 287 288 288 }, /* ttyS0 */ 289 - #ifndef CONFIG_SVINTO_SIM 290 289 { .baud = DEF_BAUD, 291 290 .ioport = (unsigned char *)R_SERIAL1_CTRL, 292 291 .irq = 1U << 16, /* uses DMA 8 and 9 */ ··· 446 447 .dma_in_enabled = 0 447 448 #endif 448 449 } /* ttyS3 */ 449 - #endif 450 450 }; 451 451 452 452 ··· 1033 1035 static inline void 1034 1036 e100_dtr(struct e100_serial *info, int set) 1035 1037 { 1036 - #ifndef CONFIG_SVINTO_SIM 1037 1038 unsigned char mask = e100_modem_pins[info->line].dtr_mask; 1038 1039 1039 1040 #ifdef SERIAL_DEBUG_IO ··· 1057 1060 info->line, *e100_modem_pins[info->line].dtr_shadow, 1058 1061 E100_DTR_GET(info)); 1059 1062 #endif 1060 - #endif 1061 1063 } 1062 1064 1063 1065 /* set = 0 means 3.3V on the pin, bitvalue: 0=active, 1=inactive ··· 1065 1069 static inline void 1066 1070 e100_rts(struct e100_serial *info, int set) 1067 1071 { 1068 - #ifndef CONFIG_SVINTO_SIM 1069 1072 unsigned long flags; 1070 1073 local_irq_save(flags); 1071 1074 info->rx_ctrl &= ~E100_RTS_MASK; ··· 1074 1079 #ifdef SERIAL_DEBUG_IO 1075 1080 printk("ser%i rts %i\n", info->line, set); 1076 1081 #endif 1077 - #endif 1078 1082 } 1079 1083 1080 1084 ··· 1081 1087 static inline void 1082 1088 e100_ri_out(struct e100_serial *info, int set) 1083 1089 { 1084 - #ifndef CONFIG_SVINTO_SIM 1085 1090 /* RI is active low */ 1086 1091 { 1087 1092 unsigned char mask = e100_modem_pins[info->line].ri_mask; ··· 1092 1099 *e100_modem_pins[info->line].ri_port = *e100_modem_pins[info->line].ri_shadow; 1093 1100 local_irq_restore(flags); 1094 1101 } 1095 - #endif 1096 1102 } 1097 1103 static inline void 1098 1104 e100_cd_out(struct e100_serial *info, int set) 1099 1105 { 1100 - #ifndef CONFIG_SVINTO_SIM 1101 1106 /* CD is active low */ 1102 1107 { 1103 1108 unsigned char mask = e100_modem_pins[info->line].cd_mask; ··· 1107 1116 *e100_modem_pins[info->line].cd_port = *e100_modem_pins[info->line].cd_shadow; 1108 1117 local_irq_restore(flags); 1109 1118 } 1110 - #endif 1111 1119 } 1112 1120 1113 1121 static inline void 1114 1122 e100_disable_rx(struct e100_serial *info) 1115 1123 { 1116 - #ifndef CONFIG_SVINTO_SIM 1117 1124 /* disable the receiver */ 1118 1125 info->ioport[REG_REC_CTRL] = 1119 1126 (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); 1120 - #endif 1121 1127 } 1122 1128 1123 1129 static inline void 1124 1130 e100_enable_rx(struct e100_serial *info) 1125 1131 { 1126 - #ifndef CONFIG_SVINTO_SIM 1127 1132 /* enable the receiver */ 1128 1133 info->ioport[REG_REC_CTRL] = 1129 1134 (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); 1130 - #endif 1131 1135 } 1132 1136 1133 1137 /* the rx DMA uses both the dma_descr and the dma_eop interrupts */ ··· 1540 1554 unsigned int c, sentl; 1541 1555 struct etrax_dma_descr *descr; 1542 1556 1543 - #ifdef CONFIG_SVINTO_SIM 1544 - /* This will output too little if tail is not 0 always since 1545 - * we don't reloop to send the other part. Anyway this SHOULD be a 1546 - * no-op - transmit_chars_dma would never really be called during sim 1547 - * since rs_write does not write into the xmit buffer then. 1548 - */ 1549 - if (info->xmit.tail) 1550 - printk("Error in serial.c:transmit_chars-dma(), tail!=0\n"); 1551 - if (info->xmit.head != info->xmit.tail) { 1552 - SIMCOUT(info->xmit.buf + info->xmit.tail, 1553 - CIRC_CNT(info->xmit.head, 1554 - info->xmit.tail, 1555 - SERIAL_XMIT_SIZE)); 1556 - info->xmit.head = info->xmit.tail; /* move back head */ 1557 - info->tr_running = 0; 1558 - } 1559 - return; 1560 - #endif 1561 1557 /* acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */ 1562 1558 *info->oclrintradr = 1563 1559 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | ··· 1810 1842 struct tty_struct *tty; 1811 1843 unsigned char rstat; 1812 1844 1813 - #ifdef CONFIG_SVINTO_SIM 1814 - /* No receive in the simulator. Will probably be when the rest of 1815 - * the serial interface works, and this piece will just be removed. 1816 - */ 1817 - return; 1818 - #endif 1819 - 1820 1845 /* Acknowledge both dma_descr and dma_eop irq in R_DMA_CHx_CLR_INTR */ 1821 1846 *info->iclrintradr = 1822 1847 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | ··· 1895 1934 static void 1896 1935 start_receive(struct e100_serial *info) 1897 1936 { 1898 - #ifdef CONFIG_SVINTO_SIM 1899 - /* No receive in the simulator. Will probably be when the rest of 1900 - * the serial interface works, and this piece will just be removed. 1901 - */ 1902 - return; 1903 - #endif 1904 1937 if (info->uses_dma_in) { 1905 1938 /* reset the input dma channel to be sure it works */ 1906 1939 ··· 1926 1971 unsigned long ireg; 1927 1972 int i; 1928 1973 int handled = 0; 1929 - 1930 - #ifdef CONFIG_SVINTO_SIM 1931 - /* No receive in the simulator. Will probably be when the rest of 1932 - * the serial interface works, and this piece will just be removed. 1933 - */ 1934 - { 1935 - const char *s = "What? tr_interrupt in simulator??\n"; 1936 - SIMCOUT(s,strlen(s)); 1937 - } 1938 - return IRQ_HANDLED; 1939 - #endif 1940 1974 1941 1975 /* find out the line that caused this irq and get it from rs_table */ 1942 1976 ··· 1964 2020 unsigned long ireg; 1965 2021 int i; 1966 2022 int handled = 0; 1967 - 1968 - #ifdef CONFIG_SVINTO_SIM 1969 - /* No receive in the simulator. Will probably be when the rest of 1970 - * the serial interface works, and this piece will just be removed. 1971 - */ 1972 - { 1973 - const char *s = "What? rec_interrupt in simulator??\n"; 1974 - SIMCOUT(s,strlen(s)); 1975 - } 1976 - return IRQ_HANDLED; 1977 - #endif 1978 2023 1979 2024 /* find out the line that caused this irq and get it from rs_table */ 1980 2025 ··· 2105 2172 { 2106 2173 struct e100_serial *info; 2107 2174 int i; 2108 - 2109 - #ifdef CONFIG_SVINTO_SIM 2110 - return; 2111 - #endif 2112 2175 2113 2176 for (i = 0; i < NR_PORTS; i++) { 2114 2177 info = rs_table + i; ··· 2658 2729 printk("starting up ttyS%d (xmit_buf 0x%p)...\n", info->line, info->xmit.buf); 2659 2730 #endif 2660 2731 2661 - #ifdef CONFIG_SVINTO_SIM 2662 - /* Bits and pieces collected from below. Better to have them 2663 - in one ifdef:ed clause than to mix in a lot of ifdefs, 2664 - right? */ 2665 - if (info->port.tty) 2666 - clear_bit(TTY_IO_ERROR, &info->port.tty->flags); 2667 - 2668 - info->xmit.head = info->xmit.tail = 0; 2669 - info->first_recv_buffer = info->last_recv_buffer = NULL; 2670 - info->recv_cnt = info->max_recv_cnt = 0; 2671 - 2672 - for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++) 2673 - info->rec_descr[i].buf = NULL; 2674 - 2675 - /* No real action in the simulator, but may set info important 2676 - to ioctl. */ 2677 - change_speed(info); 2678 - #else 2679 - 2680 2732 /* 2681 2733 * Clear the FIFO buffers and disable them 2682 2734 * (they will be reenabled in change_speed()) ··· 2747 2837 e100_rts(info, 1); 2748 2838 e100_dtr(info, 1); 2749 2839 2750 - #endif /* CONFIG_SVINTO_SIM */ 2751 - 2752 2840 info->port.flags |= ASYNC_INITIALIZED; 2753 2841 2754 2842 local_irq_restore(flags); ··· 2765 2857 struct etrax_recv_buffer *buffer; 2766 2858 int i; 2767 2859 2768 - #ifndef CONFIG_SVINTO_SIM 2769 2860 /* shut down the transmitter and receiver */ 2770 2861 DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line)); 2771 2862 e100_disable_rx(info); ··· 2788 2881 e100_disable_serial_tx_ready_irq(info); 2789 2882 info->tr_running = 0; 2790 2883 } 2791 - 2792 - #endif /* CONFIG_SVINTO_SIM */ 2793 2884 2794 2885 if (!(info->port.flags & ASYNC_INITIALIZED)) 2795 2886 return; ··· 2900 2995 IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, normal); 2901 2996 r_alt_ser_baudrate_shadow &= ~mask; 2902 2997 r_alt_ser_baudrate_shadow |= (alt_source << (info->line*8)); 2903 - #ifndef CONFIG_SVINTO_SIM 2904 2998 *R_ALT_SER_BAUDRATE = r_alt_ser_baudrate_shadow; 2905 - #endif /* CONFIG_SVINTO_SIM */ 2906 2999 2907 3000 info->baud = cflag_to_baud(cflag); 2908 - #ifndef CONFIG_SVINTO_SIM 2909 3001 info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag); 2910 - #endif /* CONFIG_SVINTO_SIM */ 2911 3002 } 2912 3003 2913 - #ifndef CONFIG_SVINTO_SIM 2914 3004 /* start with default settings and then fill in changes */ 2915 3005 local_irq_save(flags); 2916 3006 /* 8 bit, no/even parity */ ··· 2973 3073 2974 3074 *((unsigned long *)&info->ioport[REG_XOFF]) = xoff; 2975 3075 local_irq_restore(flags); 2976 - #endif /* !CONFIG_SVINTO_SIM */ 2977 3076 2978 3077 update_char_time(info); 2979 3078 ··· 3021 3122 count, info->ioport[REG_STATUS]); 3022 3123 #endif 3023 3124 3024 - #ifdef CONFIG_SVINTO_SIM 3025 - /* Really simple. The output is here and now. */ 3026 - SIMCOUT(buf, count); 3027 - return count; 3028 - #endif 3029 3125 local_save_flags(flags); 3030 3126 DFLOW(DEBUG_LOG(info->line, "write count %i ", count)); 3031 3127 DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty))); ··· 3357 3463 get_lsr_info(struct e100_serial * info, unsigned int *value) 3358 3464 { 3359 3465 unsigned int result = TIOCSER_TEMT; 3360 - #ifndef CONFIG_SVINTO_SIM 3361 3466 unsigned long curr_time = jiffies; 3362 3467 unsigned long curr_time_usec = GET_JIFFIES_USEC(); 3363 3468 unsigned long elapsed_usec = ··· 3367 3474 elapsed_usec < 2*info->char_time_usec) { 3368 3475 result = 0; 3369 3476 } 3370 - #endif 3371 3477 3372 3478 if (copy_to_user(value, &result, sizeof(int))) 3373 3479 return -EFAULT; ··· 3696 3804 e100_disable_serial_data_irq(info); 3697 3805 #endif 3698 3806 3699 - #ifndef CONFIG_SVINTO_SIM 3700 3807 e100_disable_rx(info); 3701 3808 e100_disable_rx_irq(info); 3702 3809 ··· 3707 3816 */ 3708 3817 rs_wait_until_sent(tty, HZ); 3709 3818 } 3710 - #endif 3711 3819 3712 3820 shutdown(info); 3713 3821 rs_flush_buffer(tty); ··· 4369 4479 fast_timer_init(); 4370 4480 #endif 4371 4481 4372 - #ifndef CONFIG_SVINTO_SIM 4373 4482 #ifndef CONFIG_ETRAX_KGDB 4374 4483 /* Not needed in simulator. May only complicate stuff. */ 4375 4484 /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */ ··· 4378 4489 panic("%s: Failed to request irq8", __func__); 4379 4490 4380 4491 #endif 4381 - #endif /* CONFIG_SVINTO_SIM */ 4382 4492 4383 4493 return 0; 4384 4494 }