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

mac68k: replace mac68k SCC code with platform device

Remove the old 68k Mac serial port code and a lot of related cruft. Add
new SCC platform devices to mac 68k platform.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Finn Thain and committed by
Geert Uytterhoeven
80614e5a ec9cbe09

+80 -522
+1 -5
arch/m68k/Kconfig
··· 536 536 Say Y to enable doing IP over the parallel port on your GVP 537 537 IO-Extender card, N otherwise. 538 538 539 - config MAC_SCC 540 - tristate "Macintosh serial support" 541 - depends on MAC 542 - 543 539 config MAC_HID 544 540 bool 545 541 depends on INPUT_ADBHID ··· 591 595 592 596 config SERIAL_CONSOLE 593 597 bool "Support for serial port console" 594 - depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) 598 + depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) 595 599 ---help--- 596 600 If you say Y here, it will be possible to use a serial port as the 597 601 system console (the system console is the device which receives all
-2
arch/m68k/configs/mac_defconfig
··· 839 839 # 840 840 # Character devices 841 841 # 842 - CONFIG_MAC_SCC=y 843 842 CONFIG_MAC_HID=y 844 - CONFIG_SERIAL_CONSOLE=y 845 843 846 844 # 847 845 # File systems
-1
arch/m68k/configs/multi_defconfig
··· 987 987 CONFIG_ATARI_DSP56K=m 988 988 CONFIG_AMIGA_BUILTIN_SERIAL=y 989 989 CONFIG_MULTIFACE_III_TTY=m 990 - CONFIG_MAC_SCC=y 991 990 CONFIG_MAC_HID=y 992 991 CONFIG_MVME147_SCC=y 993 992 CONFIG_SERIAL167=y
-25
arch/m68k/include/asm/machw.h
··· 21 21 #define VIDEOMEMSIZE (4096*1024) 22 22 #define VIDEOMEMMASK (-4096*1024) 23 23 24 - #ifndef __ASSEMBLY__ 25 - 26 - #include <linux/types.h> 27 - 28 - #if 0 29 - /* 30 - ** SCC Z8530 31 - */ 32 - 33 - #define MAC_SCC_BAS (0x50F04000) 34 - struct MAC_SCC 35 - { 36 - u_char cha_a_ctrl; 37 - u_char char_dummy1; 38 - u_char cha_a_data; 39 - u_char char_dummy2; 40 - u_char cha_b_ctrl; 41 - u_char char_dummy3; 42 - u_char cha_b_data; 43 - }; 44 - # define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS)) 45 - #endif 46 - 47 - #endif /* __ASSEMBLY__ */ 48 - 49 24 #endif /* linux/machw.h */
+5 -17
arch/m68k/include/asm/macints.h
··· 37 37 38 38 #define VIA1_SOURCE_BASE 8 39 39 #define VIA2_SOURCE_BASE 16 40 - #define MAC_SCC_SOURCE_BASE 24 41 40 #define PSC3_SOURCE_BASE 24 42 41 #define PSC4_SOURCE_BASE 32 43 42 #define PSC5_SOURCE_BASE 40 ··· 95 96 #define IRQ_PSC3_2 (26) 96 97 #define IRQ_PSC3_3 (27) 97 98 98 - /* Level 4 (SCC) interrupts */ 99 - #define IRQ_SCC (32) 100 - #define IRQ_SCCA (33) 101 - #define IRQ_SCCB (34) 102 - #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */ 103 - /* SCC interrupts */ 104 - #define IRQ_SCCB_TX (32) 105 - #define IRQ_SCCB_STAT (33) 106 - #define IRQ_SCCB_RX (34) 107 - #define IRQ_SCCB_SPCOND (35) 108 - #define IRQ_SCCA_TX (36) 109 - #define IRQ_SCCA_STAT (37) 110 - #define IRQ_SCCA_RX (38) 111 - #define IRQ_SCCA_SPCOND (39) 112 - #endif 113 - 114 99 /* Level 4 (PSC, AV Macs only) interrupts */ 115 100 #define IRQ_PSC4_0 (32) 116 101 #define IRQ_PSC4_1 (33) 102 + #define IRQ_MAC_SCC_A IRQ_PSC4_1 117 103 #define IRQ_PSC4_2 (34) 104 + #define IRQ_MAC_SCC_B IRQ_PSC4_2 118 105 #define IRQ_PSC4_3 (35) 119 106 #define IRQ_MAC_MACE_DMA IRQ_PSC4_3 120 107 ··· 130 145 #define IRQ_BABOON_1 (65) 131 146 #define IRQ_BABOON_2 (66) 132 147 #define IRQ_BABOON_3 (67) 148 + 149 + /* On non-PSC machines, the serial ports share an IRQ */ 150 + #define IRQ_MAC_SCC IRQ_AUTO_4 133 151 134 152 #define SLOT2IRQ(x) (x + 47) 135 153 #define IRQ2SLOT(x) (x - 47)
+1 -1
arch/m68k/mac/Makefile
··· 3 3 # 4 4 5 5 obj-y := config.o macints.o iop.o via.o oss.o psc.o \ 6 - baboon.o macboing.o debug.o misc.o 6 + baboon.o macboing.o misc.o
+51
arch/m68k/mac/config.c
··· 792 792 } 793 793 }; 794 794 795 + static struct resource scc_a_rsrcs[] = { 796 + { .flags = IORESOURCE_MEM }, 797 + { .flags = IORESOURCE_IRQ }, 798 + }; 799 + 800 + static struct resource scc_b_rsrcs[] = { 801 + { .flags = IORESOURCE_MEM }, 802 + { .flags = IORESOURCE_IRQ }, 803 + }; 804 + 805 + struct platform_device scc_a_pdev = { 806 + .name = "scc", 807 + .id = 0, 808 + .num_resources = ARRAY_SIZE(scc_a_rsrcs), 809 + .resource = scc_a_rsrcs, 810 + }; 811 + EXPORT_SYMBOL(scc_a_pdev); 812 + 813 + struct platform_device scc_b_pdev = { 814 + .name = "scc", 815 + .id = 1, 816 + .num_resources = ARRAY_SIZE(scc_b_rsrcs), 817 + .resource = scc_b_rsrcs, 818 + }; 819 + EXPORT_SYMBOL(scc_b_pdev); 820 + 795 821 static void __init mac_identify(void) 796 822 { 797 823 struct mac_model *m; ··· 838 812 macintosh_config = m; 839 813 break; 840 814 } 815 + } 816 + 817 + /* Set up serial port resources for the console initcall. */ 818 + 819 + scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; 820 + scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; 821 + scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; 822 + scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; 823 + 824 + switch (macintosh_config->scc_type) { 825 + case MAC_SCC_PSC: 826 + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; 827 + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; 828 + break; 829 + default: 830 + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; 831 + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; 832 + break; 841 833 } 842 834 843 835 /* ··· 914 870 int __init mac_platform_init(void) 915 871 { 916 872 u8 *swim_base; 873 + 874 + /* 875 + * Serial devices 876 + */ 877 + 878 + platform_device_register(&scc_a_pdev); 879 + platform_device_register(&scc_b_pdev); 917 880 918 881 /* 919 882 * Floppy device
-365
arch/m68k/mac/debug.c
··· 1 - /* 2 - * linux/arch/m68k/mac/debug.c 3 - * 4 - * Shamelessly stolen (SCC code and general framework) from: 5 - * 6 - * linux/arch/m68k/atari/debug.c 7 - * 8 - * Atari debugging and serial console stuff 9 - * 10 - * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek 11 - * 12 - * This file is subject to the terms and conditions of the GNU General Public 13 - * License. See the file COPYING in the main directory of this archive 14 - * for more details. 15 - */ 16 - 17 - #include <linux/types.h> 18 - #include <linux/sched.h> 19 - #include <linux/tty.h> 20 - #include <linux/console.h> 21 - #include <linux/init.h> 22 - #include <linux/delay.h> 23 - 24 - #define BOOTINFO_COMPAT_1_0 25 - #include <asm/setup.h> 26 - #include <asm/bootinfo.h> 27 - #include <asm/macints.h> 28 - 29 - extern unsigned long mac_videobase; 30 - extern unsigned long mac_rowbytes; 31 - 32 - extern void mac_serial_print(const char *); 33 - 34 - #define DEBUG_HEADS 35 - #undef DEBUG_SCREEN 36 - #define DEBUG_SERIAL 37 - 38 - /* 39 - * These two auxiliary debug functions should go away ASAP. Only usage: 40 - * before the console output is up (after head.S come some other crucial 41 - * setup routines :-) it permits writing 'data' to the screen as bit patterns 42 - * (good luck reading those). Helped to figure that the bootinfo contained 43 - * garbage data on the amount and size of memory chunks ... 44 - * 45 - * The 'pos' argument now simply means 'linefeed after print' ... 46 - */ 47 - 48 - #ifdef DEBUG_SCREEN 49 - static int peng, line; 50 - #endif 51 - 52 - #if 0 53 - 54 - void mac_debugging_short(int pos, short num) 55 - { 56 - #ifdef DEBUG_SCREEN 57 - unsigned char *pengoffset; 58 - unsigned char *pptr; 59 - int i; 60 - #endif 61 - 62 - #ifdef DEBUG_SERIAL 63 - printk("debug: %d !\n", num); 64 - #endif 65 - 66 - #ifdef DEBUG_SCREEN 67 - if (!MACH_IS_MAC) { 68 - /* printk("debug: %d !\n", num); */ 69 - return; 70 - } 71 - 72 - /* calculate current offset */ 73 - pengoffset = (unsigned char *)mac_videobase + 74 - (150+line*2) * mac_rowbytes + 80 * peng; 75 - 76 - pptr = pengoffset; 77 - 78 - for (i = 0; i < 8 * sizeof(short); i++) { /* # of bits */ 79 - /* value mask for bit i, reverse order */ 80 - *pptr++ = (num & (1 << (8*sizeof(short)-i-1)) ? 0xFF : 0x00); 81 - } 82 - 83 - peng++; 84 - 85 - if (pos) { 86 - line++; 87 - peng = 0; 88 - } 89 - #endif 90 - } 91 - 92 - void mac_debugging_long(int pos, long addr) 93 - { 94 - #ifdef DEBUG_SCREEN 95 - unsigned char *pengoffset; 96 - unsigned char *pptr; 97 - int i; 98 - #endif 99 - 100 - #ifdef DEBUG_SERIAL 101 - printk("debug: #%ld !\n", addr); 102 - #endif 103 - 104 - #ifdef DEBUG_SCREEN 105 - if (!MACH_IS_MAC) { 106 - /* printk("debug: #%ld !\n", addr); */ 107 - return; 108 - } 109 - 110 - pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes) 111 - +80*peng; 112 - 113 - pptr = pengoffset; 114 - 115 - for (i = 0; i < 8 * sizeof(long); i++) { /* # of bits */ 116 - *pptr++ = (addr & (1 << (8*sizeof(long)-i-1)) ? 0xFF : 0x00); 117 - } 118 - 119 - peng++; 120 - 121 - if (pos) { 122 - line++; 123 - peng = 0; 124 - } 125 - #endif 126 - } 127 - 128 - #endif /* 0 */ 129 - 130 - #ifdef DEBUG_SERIAL 131 - /* 132 - * TODO: serial debug code 133 - */ 134 - 135 - struct mac_SCC { 136 - u_char cha_b_ctrl; 137 - u_char char_dummy1; 138 - u_char cha_a_ctrl; 139 - u_char char_dummy2; 140 - u_char cha_b_data; 141 - u_char char_dummy3; 142 - u_char cha_a_data; 143 - }; 144 - 145 - # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase)) 146 - 147 - static int scc_port = -1; 148 - 149 - static struct console mac_console_driver = { 150 - .name = "debug", 151 - .flags = CON_PRINTBUFFER, 152 - .index = -1, 153 - }; 154 - 155 - /* 156 - * Crude hack to get console output to the screen before the framebuffer 157 - * is initialized (happens a lot later in 2.1!). 158 - * We just use the console routines declared in head.S, this will interfere 159 - * with regular framebuffer console output and should be used exclusively 160 - * to debug kernel problems manifesting before framebuffer init (aka WSOD) 161 - * 162 - * To keep this hack from interfering with the regular console driver, either 163 - * deregister this driver before/on framebuffer console init, or silence this 164 - * function after the fbcon driver is running (will lose console messages!?). 165 - * To debug real early bugs, need to write a 'mac_register_console_hack()' 166 - * that is called from start_kernel() before setup_arch() and just registers 167 - * this driver if Mac. 168 - */ 169 - 170 - static void mac_debug_console_write(struct console *co, const char *str, 171 - unsigned int count) 172 - { 173 - mac_serial_print(str); 174 - } 175 - 176 - 177 - 178 - /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ 179 - 180 - #define uSEC 1 181 - 182 - static inline void mac_sccb_out(char c) 183 - { 184 - int i; 185 - 186 - do { 187 - for (i = uSEC; i > 0; --i) 188 - barrier(); 189 - } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ 190 - for (i = uSEC; i > 0; --i) 191 - barrier(); 192 - scc.cha_b_data = c; 193 - } 194 - 195 - static inline void mac_scca_out(char c) 196 - { 197 - int i; 198 - 199 - do { 200 - for (i = uSEC; i > 0; --i) 201 - barrier(); 202 - } while (!(scc.cha_a_ctrl & 0x04)); /* wait for tx buf empty */ 203 - for (i = uSEC; i > 0; --i) 204 - barrier(); 205 - scc.cha_a_data = c; 206 - } 207 - 208 - static void mac_sccb_console_write(struct console *co, const char *str, 209 - unsigned int count) 210 - { 211 - while (count--) { 212 - if (*str == '\n') 213 - mac_sccb_out('\r'); 214 - mac_sccb_out(*str++); 215 - } 216 - } 217 - 218 - static void mac_scca_console_write(struct console *co, const char *str, 219 - unsigned int count) 220 - { 221 - while (count--) { 222 - if (*str == '\n') 223 - mac_scca_out('\r'); 224 - mac_scca_out(*str++); 225 - } 226 - } 227 - 228 - 229 - /* The following two functions do a quick'n'dirty initialization of the MFP or 230 - * SCC serial ports. They're used by the debugging interface, kgdb, and the 231 - * serial console code. */ 232 - #define SCCB_WRITE(reg,val) \ 233 - do { \ 234 - int i; \ 235 - scc.cha_b_ctrl = (reg); \ 236 - for (i = uSEC; i > 0; --i) \ 237 - barrier(); \ 238 - scc.cha_b_ctrl = (val); \ 239 - for (i = uSEC; i > 0; --i) \ 240 - barrier(); \ 241 - } while(0) 242 - 243 - #define SCCA_WRITE(reg,val) \ 244 - do { \ 245 - int i; \ 246 - scc.cha_a_ctrl = (reg); \ 247 - for (i = uSEC; i > 0; --i) \ 248 - barrier(); \ 249 - scc.cha_a_ctrl = (val); \ 250 - for (i = uSEC; i > 0; --i) \ 251 - barrier(); \ 252 - } while(0) 253 - 254 - /* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a 255 - * delay of ~ 60us. */ 256 - /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ 257 - #define LONG_DELAY() \ 258 - do { \ 259 - int i; \ 260 - for (i = 60*uSEC; i > 0; --i) \ 261 - barrier(); \ 262 - } while(0) 263 - 264 - static void __init mac_init_scc_port(int cflag, int port) 265 - { 266 - /* 267 - * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k 268 - */ 269 - 270 - static int clksrc_table[9] = 271 - /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ 272 - { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; 273 - static int clkmode_table[9] = 274 - /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ 275 - { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; 276 - static int div_table[9] = 277 - /* reg12 (BRG low) */ 278 - { 94, 62, 46, 22, 10, 4, 1, 0, 0 }; 279 - 280 - int baud = cflag & CBAUD; 281 - int clksrc, clkmode, div, reg3, reg5; 282 - 283 - if (cflag & CBAUDEX) 284 - baud += B38400; 285 - if (baud < B1200 || baud > B38400+2) 286 - baud = B9600; /* use default 9600bps for non-implemented rates */ 287 - baud -= B1200; /* tables starts at 1200bps */ 288 - 289 - clksrc = clksrc_table[baud]; 290 - clkmode = clkmode_table[baud]; 291 - div = div_table[baud]; 292 - 293 - reg3 = (((cflag & CSIZE) == CS8) ? 0xc0 : 0x40); 294 - reg5 = (((cflag & CSIZE) == CS8) ? 0x60 : 0x20) | 0x82 /* assert DTR/RTS */; 295 - 296 - if (port == 1) { 297 - (void)scc.cha_b_ctrl; /* reset reg pointer */ 298 - SCCB_WRITE(9, 0xc0); /* reset */ 299 - LONG_DELAY(); /* extra delay after WR9 access */ 300 - SCCB_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | 301 - 0x04 /* 1 stopbit */ | 302 - clkmode); 303 - SCCB_WRITE(3, reg3); 304 - SCCB_WRITE(5, reg5); 305 - SCCB_WRITE(9, 0); /* no interrupts */ 306 - LONG_DELAY(); /* extra delay after WR9 access */ 307 - SCCB_WRITE(10, 0); /* NRZ mode */ 308 - SCCB_WRITE(11, clksrc); /* main clock source */ 309 - SCCB_WRITE(12, div); /* BRG value */ 310 - SCCB_WRITE(13, 0); /* BRG high byte */ 311 - SCCB_WRITE(14, 1); 312 - SCCB_WRITE(3, reg3 | 1); 313 - SCCB_WRITE(5, reg5 | 8); 314 - } else if (port == 0) { 315 - (void)scc.cha_a_ctrl; /* reset reg pointer */ 316 - SCCA_WRITE(9, 0xc0); /* reset */ 317 - LONG_DELAY(); /* extra delay after WR9 access */ 318 - SCCA_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | 319 - 0x04 /* 1 stopbit */ | 320 - clkmode); 321 - SCCA_WRITE(3, reg3); 322 - SCCA_WRITE(5, reg5); 323 - SCCA_WRITE(9, 0); /* no interrupts */ 324 - LONG_DELAY(); /* extra delay after WR9 access */ 325 - SCCA_WRITE(10, 0); /* NRZ mode */ 326 - SCCA_WRITE(11, clksrc); /* main clock source */ 327 - SCCA_WRITE(12, div); /* BRG value */ 328 - SCCA_WRITE(13, 0); /* BRG high byte */ 329 - SCCA_WRITE(14, 1); 330 - SCCA_WRITE(3, reg3 | 1); 331 - SCCA_WRITE(5, reg5 | 8); 332 - } 333 - } 334 - #endif /* DEBUG_SERIAL */ 335 - 336 - static int __init mac_debug_setup(char *arg) 337 - { 338 - if (!MACH_IS_MAC) 339 - return 0; 340 - 341 - #ifdef DEBUG_SERIAL 342 - if (!strcmp(arg, "ser") || !strcmp(arg, "ser1")) { 343 - /* Mac modem port */ 344 - mac_init_scc_port(B9600|CS8, 0); 345 - mac_console_driver.write = mac_scca_console_write; 346 - scc_port = 0; 347 - } else if (!strcmp(arg, "ser2")) { 348 - /* Mac printer port */ 349 - mac_init_scc_port(B9600|CS8, 1); 350 - mac_console_driver.write = mac_sccb_console_write; 351 - scc_port = 1; 352 - } 353 - #endif 354 - #ifdef DEBUG_HEADS 355 - if (!strcmp(arg, "scn") || !strcmp(arg, "con")) { 356 - /* display, using head.S console routines */ 357 - mac_console_driver.write = mac_debug_console_write; 358 - } 359 - #endif 360 - if (mac_console_driver.write) 361 - register_console(&mac_console_driver); 362 - return 0; 363 - } 364 - 365 - early_param("debug", mac_debug_setup);
+18 -83
arch/m68k/mac/macints.c
··· 34 34 * 35 35 * 3 - unused (?) 36 36 * 37 - * 4 - SCC (slot number determined by reading RR3 on the SSC itself) 38 - * - slot 1: SCC channel A 39 - * - slot 2: SCC channel B 37 + * 4 - SCC 40 38 * 41 39 * 5 - unused (?) 42 40 * [serial errors or special conditions seem to raise level 6 ··· 53 55 * - slot 5: Slot $E 54 56 * 55 57 * 4 - SCC IOP 56 - * - slot 1: SCC channel A 57 - * - slot 2: SCC channel B 58 58 * 59 59 * 5 - ISM IOP (ADB?) 60 60 * ··· 132 136 #include <asm/irq_regs.h> 133 137 #include <asm/mac_oss.h> 134 138 135 - #define DEBUG_SPURIOUS 136 139 #define SHUTUP_SONIC 137 - 138 - /* SCC interrupt mask */ 139 - 140 - static int scc_mask; 141 140 142 141 /* 143 142 * VIA/RBV hooks ··· 182 191 extern void baboon_irq_clear(int); 183 192 184 193 /* 185 - * SCC interrupt routines 186 - */ 187 - 188 - static void scc_irq_enable(unsigned int); 189 - static void scc_irq_disable(unsigned int); 190 - 191 - /* 192 194 * console_loglevel determines NMI handler function 193 195 */ 194 196 ··· 205 221 #ifdef DEBUG_MACINTS 206 222 printk("mac_init_IRQ(): Setting things up...\n"); 207 223 #endif 208 - scc_mask = 0; 209 - 210 224 m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, 211 225 NUM_MAC_SOURCES - IRQ_USER); 212 226 /* Make sure the SONIC interrupt is cleared or things get ugly */ ··· 265 283 via_irq_enable(irq); 266 284 break; 267 285 case 3: 268 - case 4: 269 286 case 5: 270 287 case 6: 271 288 if (psc_present) 272 289 psc_irq_enable(irq); 273 290 else if (oss_present) 274 291 oss_irq_enable(irq); 275 - else if (irq_src == 4) 276 - scc_irq_enable(irq); 292 + break; 293 + case 4: 294 + if (psc_present) 295 + psc_irq_enable(irq); 277 296 break; 278 297 case 8: 279 298 if (baboon_present) ··· 299 316 via_irq_disable(irq); 300 317 break; 301 318 case 3: 302 - case 4: 303 319 case 5: 304 320 case 6: 305 321 if (psc_present) 306 322 psc_irq_disable(irq); 307 323 else if (oss_present) 308 324 oss_irq_disable(irq); 309 - else if (irq_src == 4) 310 - scc_irq_disable(irq); 325 + break; 326 + case 4: 327 + if (psc_present) 328 + psc_irq_disable(irq); 311 329 break; 312 330 case 8: 313 331 if (baboon_present) ··· 331 347 via_irq_clear(irq); 332 348 break; 333 349 case 3: 334 - case 4: 335 350 case 5: 336 351 case 6: 337 352 if (psc_present) 338 353 psc_irq_clear(irq); 339 354 else if (oss_present) 340 355 oss_irq_clear(irq); 356 + break; 357 + case 4: 358 + if (psc_present) 359 + psc_irq_clear(irq); 341 360 break; 342 361 case 8: 343 362 if (baboon_present) ··· 361 374 else 362 375 return via_irq_pending(irq); 363 376 case 3: 364 - case 4: 365 377 case 5: 366 378 case 6: 367 379 if (psc_present) 368 380 return psc_irq_pending(irq); 369 381 else if (oss_present) 370 382 return oss_irq_pending(irq); 383 + break; 384 + case 4: 385 + if (psc_present) 386 + psc_irq_pending(irq); 387 + break; 371 388 } 372 389 return 0; 373 390 } ··· 438 447 } 439 448 in_nmi--; 440 449 return IRQ_HANDLED; 441 - } 442 - 443 - /* 444 - * Simple routines for masking and unmasking 445 - * SCC interrupts in cases where this can't be 446 - * done in hardware (only the PSC can do that.) 447 - */ 448 - 449 - static void scc_irq_enable(unsigned int irq) 450 - { 451 - int irq_idx = IRQ_IDX(irq); 452 - 453 - scc_mask |= (1 << irq_idx); 454 - } 455 - 456 - static void scc_irq_disable(unsigned int irq) 457 - { 458 - int irq_idx = IRQ_IDX(irq); 459 - 460 - scc_mask &= ~(1 << irq_idx); 461 - } 462 - 463 - /* 464 - * SCC master interrupt handler. We have to do a bit of magic here 465 - * to figure out what channel gave us the interrupt; putting this 466 - * here is cleaner than hacking it into drivers/char/macserial.c. 467 - */ 468 - 469 - void mac_scc_dispatch(int irq, void *dev_id) 470 - { 471 - volatile unsigned char *scc = (unsigned char *) mac_bi_data.sccbase + 2; 472 - unsigned char reg; 473 - unsigned long flags; 474 - 475 - /* Read RR3 from the chip. Always do this on channel A */ 476 - /* This must be an atomic operation so disable irqs. */ 477 - 478 - local_irq_save(flags); 479 - *scc = 3; 480 - reg = *scc; 481 - local_irq_restore(flags); 482 - 483 - /* Now dispatch. Bits 0-2 are for channel B and */ 484 - /* bits 3-5 are for channel A. We can safely */ 485 - /* ignore the remaining bits here. */ 486 - /* */ 487 - /* Note that we're ignoring scc_mask for now. */ 488 - /* If we actually mask the ints then we tend to */ 489 - /* get hammered by very persistent SCC irqs, */ 490 - /* and since they're autovector interrupts they */ 491 - /* pretty much kill the system. */ 492 - 493 - if (reg & 0x38) 494 - m68k_handle_int(IRQ_SCCA); 495 - if (reg & 0x07) 496 - m68k_handle_int(IRQ_SCCB); 497 450 }
+4 -16
arch/m68k/mac/oss.c
··· 33 33 static irqreturn_t oss_nubus_irq(int, void *); 34 34 35 35 extern irqreturn_t via1_irq(int, void *); 36 - extern irqreturn_t mac_scc_dispatch(int, void *); 37 36 38 37 /* 39 38 * Initialize the OSS ··· 68 69 if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, 69 70 "scsi", (void *) oss)) 70 71 pr_err("Couldn't register %s interrupt\n", "scsi"); 71 - if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, 72 - "scc", mac_scc_dispatch)) 73 - pr_err("Couldn't register %s interrupt\n", "scc"); 74 72 if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, 75 73 "nubus", (void *) oss)) 76 74 pr_err("Couldn't register %s interrupt\n", "nubus"); ··· 168 172 printk("oss_irq_enable(%d)\n", irq); 169 173 #endif 170 174 switch(irq) { 171 - case IRQ_SCC: 172 - case IRQ_SCCA: 173 - case IRQ_SCCB: 175 + case IRQ_MAC_SCC: 174 176 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; 175 177 break; 176 178 case IRQ_MAC_ADB: ··· 206 212 printk("oss_irq_disable(%d)\n", irq); 207 213 #endif 208 214 switch(irq) { 209 - case IRQ_SCC: 210 - case IRQ_SCCA: 211 - case IRQ_SCCB: 215 + case IRQ_MAC_SCC: 212 216 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; 213 217 break; 214 218 case IRQ_MAC_ADB: ··· 242 250 void oss_irq_clear(int irq) { 243 251 /* FIXME: how to do this on OSS? */ 244 252 switch(irq) { 245 - case IRQ_SCC: 246 - case IRQ_SCCA: 247 - case IRQ_SCCB: 253 + case IRQ_MAC_SCC: 248 254 oss->irq_pending &= ~OSS_IP_IOPSCC; 249 255 break; 250 256 case IRQ_MAC_ADB: ··· 270 280 int oss_irq_pending(int irq) 271 281 { 272 282 switch(irq) { 273 - case IRQ_SCC: 274 - case IRQ_SCCA: 275 - case IRQ_SCCB: 283 + case IRQ_MAC_SCC: 276 284 return oss->irq_pending & OSS_IP_IOPSCC; 277 285 break; 278 286 case IRQ_MAC_ADB:
-7
arch/m68k/mac/via.c
··· 84 84 void via_irq_disable(int irq); 85 85 void via_irq_clear(int irq); 86 86 87 - extern irqreturn_t mac_scc_dispatch(int, void *); 88 - 89 87 /* 90 88 * Initialize the VIAs 91 89 * ··· 309 311 if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 310 312 "via2", (void *) via2)) 311 313 pr_err("Couldn't register %s interrupt\n", "via2"); 312 - if (!psc_present) { 313 - if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, 314 - "scc", mac_scc_dispatch)) 315 - pr_err("Couldn't register %s interrupt\n", "scc"); 316 - } 317 314 if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq, 318 315 IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2)) 319 316 pr_err("Couldn't register %s interrupt\n", "nubus");