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

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (21 commits)
m68k/mac: Make CONFIG_HEARTBEAT unavailable on Mac
m68k/serial: Remove references to obsolete serial config options
m68k/net: Remove obsolete IRQ_FLG_* users
m68k: Don't comment out syscalls used by glibc
m68k/atari: Move declaration of atari_SCC_reset_done to header file
m68k/serial: Remove references to obsolete CONFIG_SERIAL167
m68k/hp300: Export hp300_ledstate
m68k: Initconst section fixes
m68k/mac: cleanup macro case
mac_scsi: fix mac_scsi on some powerbooks
m68k/mac: fix powerbook 150 adb_type
m68k/mac: fix baboon irq disable and shutdown
m68k/mac: oss irq fixes
m68k/mac: fix nubus slot irq disable and shutdown
m68k/mac: enable via_alt_mapping on performa 580
m68k/mac: cleanup forward declarations
m68k/mac: cleanup mac_irq_pending
m68k/mac: cleanup mac_clear_irq
m68k/mac: early console
m68k/mvme16x: Add support for EARLY_PRINTK
...

Fix up trivial conflict in arch/m68k/Kconfig.debug due to new
EARLY_PRINTK config option addition clashing with movement of the
BOOTPARAM options.

+584 -636
+11
arch/m68k/Kconfig.debug
··· 10 10 default 'console=ttyS0,19200' 11 11 depends on BOOTPARAM 12 12 13 + config EARLY_PRINTK 14 + bool "Early printk" if EMBEDDED 15 + depends on MVME16x || MAC 16 + default y 17 + help 18 + Write kernel log output directly to a serial port. 19 + 20 + This is useful for kernel debugging when your machine crashes very 21 + early before the console code is initialized. 22 + You should normally say N here, unless you want to debug such a crash. 23 + 13 24 if !MMU 14 25 15 26 config FULLDEBUG
+6 -40
arch/m68k/Kconfig.devices
··· 8 8 menu "Platform devices" 9 9 10 10 config HEARTBEAT 11 - bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40 12 - default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300 11 + bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || Q40 12 + default y if !AMIGA && !APOLLO && !ATARI && !Q40 && HP300 13 13 help 14 14 Use the power-on LED on your machine as a load meter. The exact 15 15 behavior is platform-dependent, but normally the flash frequency is ··· 59 59 60 60 menu "Character devices" 61 61 62 - config ATARI_MFPSER 63 - tristate "Atari MFP serial support" 64 - depends on ATARI 65 - ---help--- 66 - If you like to use the MFP serial ports ("Modem1", "Serial1") under 67 - Linux, say Y. The driver equally supports all kinds of MFP serial 68 - ports and automatically detects whether Serial1 is available. 69 - 70 - To compile this driver as a module, choose M here. 71 - 72 - Note for Falcon users: You also have an MFP port, it's just not 73 - wired to the outside... But you could use the port under Linux. 74 - 75 - config ATARI_MIDI 76 - tristate "Atari MIDI serial support" 77 - depends on ATARI 78 - help 79 - If you want to use your Atari's MIDI port in Linux, say Y. 80 - 81 - To compile this driver as a module, choose M here. 82 - 83 62 config ATARI_DSP56K 84 63 tristate "Atari DSP56k support (EXPERIMENTAL)" 85 64 depends on ATARI && EXPERIMENTAL ··· 78 99 79 100 To compile this driver as a module, choose M here. 80 101 81 - config MULTIFACE_III_TTY 82 - tristate "Multiface Card III serial support" 83 - depends on AMIGA 84 - help 85 - If you want to use a Multiface III card's serial port in Linux, 86 - answer Y. 87 - 88 - To compile this driver as a module, choose M here. 89 - 90 102 config HPDCA 91 103 tristate "HP DCA serial support" 92 104 depends on DIO && SERIAL_8250 ··· 92 122 If you want to use the internal "APCI" serial ports on an HP400 93 123 machine, say Y here. 94 124 95 - config DN_SERIAL 96 - bool "Support for DN serial port (dummy)" 97 - depends on APOLLO 98 - 99 125 config SERIAL_CONSOLE 100 126 bool "Support for serial port console" 101 - depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || SERIAL167 || DN_SERIAL) 127 + depends on AMIGA_BUILTIN_SERIAL=y 102 128 ---help--- 103 129 If you say Y here, it will be possible to use a serial port as the 104 130 system console (the system console is the device which receives all ··· 106 140 (/dev/tty0) will still be used as the system console by default, but 107 141 you can alter that using a kernel command line option such as 108 142 "console=ttyS1". (Try "man bootparam" or see the documentation of 109 - your boot loader (lilo or loadlin) about how to pass options to the 110 - kernel at boot time.) 143 + your boot loader about how to pass options to the kernel at boot 144 + time.) 111 145 112 - If you don't have a VGA card installed and you say Y here, the 146 + If you don't have a graphical console and you say Y here, the 113 147 kernel will automatically use the first serial line, /dev/ttyS0, as 114 148 system console. 115 149
-2
arch/m68k/atari/ataints.c
··· 82 82 83 83 extern void atari_microwire_cmd(int cmd); 84 84 85 - extern int atari_SCC_reset_done; 86 - 87 85 static unsigned int atari_irq_startup(struct irq_data *data) 88 86 { 89 87 unsigned int irq = data->irq;
-1
arch/m68k/atari/debug.c
··· 202 202 203 203 static void __init atari_init_scc_port(int cflag) 204 204 { 205 - extern int atari_SCC_reset_done; 206 205 static int clksrc_table[9] = 207 206 /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ 208 207 { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
-1
arch/m68k/configs/amiga_defconfig
··· 255 255 CONFIG_HIDRAW=y 256 256 # CONFIG_USB_SUPPORT is not set 257 257 CONFIG_AMIGA_BUILTIN_SERIAL=y 258 - CONFIG_MULTIFACE_III_TTY=m 259 258 CONFIG_SERIAL_CONSOLE=y 260 259 CONFIG_EXT2_FS=y 261 260 CONFIG_EXT3_FS=y
-2
arch/m68k/configs/apollo_defconfig
··· 223 223 CONFIG_HID=m 224 224 CONFIG_HIDRAW=y 225 225 # CONFIG_USB_SUPPORT is not set 226 - CONFIG_DN_SERIAL=y 227 - CONFIG_SERIAL_CONSOLE=y 228 226 CONFIG_EXT2_FS=y 229 227 CONFIG_EXT3_FS=y 230 228 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-3
arch/m68k/configs/atari_defconfig
··· 235 235 CONFIG_HID=m 236 236 CONFIG_HIDRAW=y 237 237 # CONFIG_USB_SUPPORT is not set 238 - CONFIG_ATARI_MFPSER=y 239 - CONFIG_ATARI_MIDI=y 240 238 CONFIG_ATARI_DSP56K=m 241 - CONFIG_SERIAL_CONSOLE=y 242 239 CONFIG_EXT2_FS=y 243 240 CONFIG_EXT3_FS=y 244 241 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-5
arch/m68k/configs/multi_defconfig
··· 318 318 CONFIG_HID=m 319 319 CONFIG_HIDRAW=y 320 320 # CONFIG_USB_SUPPORT is not set 321 - CONFIG_ATARI_MFPSER=y 322 - CONFIG_ATARI_MIDI=y 323 321 CONFIG_ATARI_DSP56K=m 324 322 CONFIG_AMIGA_BUILTIN_SERIAL=y 325 - CONFIG_MULTIFACE_III_TTY=m 326 - CONFIG_SERIAL167=y 327 - CONFIG_DN_SERIAL=y 328 323 CONFIG_SERIAL_CONSOLE=y 329 324 CONFIG_EXT2_FS=y 330 325 CONFIG_EXT3_FS=y
-2
arch/m68k/configs/mvme16x_defconfig
··· 218 218 CONFIG_HID=m 219 219 CONFIG_HIDRAW=y 220 220 # CONFIG_USB_SUPPORT is not set 221 - CONFIG_SERIAL167=y 222 - CONFIG_SERIAL_CONSOLE=y 223 221 CONFIG_EXT2_FS=y 224 222 CONFIG_EXT3_FS=y 225 223 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+1 -1
arch/m68k/emu/nfeth.c
··· 39 39 #define MAX_UNIT 8 40 40 41 41 /* These identify the driver base version and may not be removed. */ 42 - static const char version[] __devinitdata = 42 + static const char version[] __devinitconst = 43 43 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE 44 44 " S.Opichal, M.Jurik, P.Stehlik\n" 45 45 KERN_INFO " http://aranym.org/\n";
+2 -1
arch/m68k/hp300/config.c
··· 24 24 25 25 unsigned long hp300_model; 26 26 unsigned long hp300_uart_scode = -1; 27 - unsigned char ledstate; 27 + unsigned char hp300_ledstate; 28 + EXPORT_SYMBOL(hp300_ledstate); 28 29 29 30 static char s_hp330[] __initdata = "330"; 30 31 static char s_hp340[] __initdata = "340";
+2
arch/m68k/include/asm/atarihw.h
··· 30 30 extern int atari_rtc_year_offset; 31 31 extern int atari_dont_touch_floppy_select; 32 32 33 + extern int atari_SCC_reset_done; 34 + 33 35 /* convenience macros for testing machine type */ 34 36 #define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST) 35 37 #define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
+4 -4
arch/m68k/include/asm/blinken.h
··· 17 17 18 18 #define HP300_LEDS 0xf001ffff 19 19 20 - extern unsigned char ledstate; 20 + extern unsigned char hp300_ledstate; 21 21 22 22 static __inline__ void blinken_leds(int on, int off) 23 23 { 24 24 if (MACH_IS_HP300) 25 25 { 26 - ledstate |= on; 27 - ledstate &= ~off; 28 - out_8(HP300_LEDS, ~ledstate); 26 + hp300_ledstate |= on; 27 + hp300_ledstate &= ~off; 28 + out_8(HP300_LEDS, ~hp300_ledstate); 29 29 } 30 30 } 31 31
+6
arch/m68k/include/asm/mac_baboon.h
··· 29 29 */ 30 30 }; 31 31 32 + extern int baboon_present; 33 + 34 + extern void baboon_register_interrupts(void); 35 + extern void baboon_irq_enable(int); 36 + extern void baboon_irq_disable(int); 37 + 32 38 #endif /* __ASSEMBLY **/
+2
arch/m68k/include/asm/mac_iop.h
··· 159 159 extern void iop_download_code(uint, __u8 *, uint, __u16); 160 160 extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16); 161 161 162 + extern void iop_register_interrupts(void); 163 + 162 164 #endif /* __ASSEMBLY__ */
+4 -19
arch/m68k/include/asm/mac_oss.h
··· 58 58 59 59 #define OSS_POWEROFF 0x80 60 60 61 - /* 62 - * OSS Interrupt levels for various sub-systems 63 - * 64 - * This mapping is laid out with two things in mind: first, we try to keep 65 - * things on their own levels to avoid having to do double-dispatches. Second, 66 - * the levels match as closely as possible the alternate IRQ mapping mode (aka 67 - * "A/UX mode") available on some VIA machines. 68 - */ 69 - 70 - #define OSS_IRQLEV_DISABLED 0 71 - #define OSS_IRQLEV_IOPISM 1 /* ADB? */ 72 - #define OSS_IRQLEV_SCSI IRQ_AUTO_2 73 - #define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */ 74 - #define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */ 75 - #define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */ 76 - #define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ 77 - #define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */ 78 - #define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ 79 - 80 61 #ifndef __ASSEMBLY__ 81 62 82 63 struct mac_oss { ··· 71 90 72 91 extern volatile struct mac_oss *oss; 73 92 extern int oss_present; 93 + 94 + extern void oss_register_interrupts(void); 95 + extern void oss_irq_enable(int); 96 + extern void oss_irq_disable(int); 74 97 75 98 #endif /* __ASSEMBLY__ */
+4
arch/m68k/include/asm/mac_psc.h
··· 211 211 extern volatile __u8 *psc; 212 212 extern int psc_present; 213 213 214 + extern void psc_register_interrupts(void); 215 + extern void psc_irq_enable(int); 216 + extern void psc_irq_disable(int); 217 + 214 218 /* 215 219 * Access functions 216 220 */
+9
arch/m68k/include/asm/mac_via.h
··· 254 254 extern volatile __u8 *via1,*via2; 255 255 extern int rbv_present,via_alt_mapping; 256 256 257 + extern void via_register_interrupts(void); 258 + extern void via_irq_enable(int); 259 + extern void via_irq_disable(int); 260 + extern void via_nubus_irq_startup(int irq); 261 + extern void via_nubus_irq_shutdown(int irq); 262 + extern void via1_irq(unsigned int irq, struct irq_desc *desc); 263 + extern void via1_set_head(int); 264 + extern int via2_scsi_drq_pending(void); 265 + 257 266 static inline int rbv_set_video_bpp(int bpp) 258 267 { 259 268 char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
+2 -8
arch/m68k/include/asm/macintosh.h
··· 11 11 extern void mac_reset(void); 12 12 extern void mac_poweroff(void); 13 13 extern void mac_init_IRQ(void); 14 - extern int mac_irq_pending(unsigned int); 14 + 15 15 extern void mac_irq_enable(struct irq_data *data); 16 16 extern void mac_irq_disable(struct irq_data *data); 17 - 18 - /* 19 - * Floppy driver magic hook - probably shouldn't be here 20 - */ 21 - 22 - extern void via1_set_head(int); 23 17 24 18 /* 25 19 * Macintosh Table ··· 42 48 #define MAC_ADB_IOP 6 43 49 44 50 #define MAC_VIA_II 1 45 - #define MAC_VIA_IIci 2 51 + #define MAC_VIA_IICI 2 46 52 #define MAC_VIA_QUADRA 3 47 53 48 54 #define MAC_SCSI_NONE 0
+3 -3
arch/m68k/include/asm/macints.h
··· 104 104 #define IRQ_PSC4_3 (35) 105 105 #define IRQ_MAC_MACE_DMA IRQ_PSC4_3 106 106 107 + /* OSS Level 4 interrupts */ 108 + #define IRQ_MAC_SCC (33) 109 + 107 110 /* Level 5 (PSC, AV Macs only) interrupts */ 108 111 #define IRQ_PSC5_0 (40) 109 112 #define IRQ_PSC5_1 (41) ··· 133 130 #define IRQ_BABOON_1 (65) 134 131 #define IRQ_BABOON_2 (66) 135 132 #define IRQ_BABOON_3 (67) 136 - 137 - /* On non-PSC machines, the serial ports share an IRQ */ 138 - #define IRQ_MAC_SCC IRQ_AUTO_4 139 133 140 134 #define SLOT2IRQ(x) (x + 47) 141 135 #define IRQ2SLOT(x) (x - 47)
+2
arch/m68k/include/asm/serial.h
··· 25 25 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 26 26 #endif 27 27 28 + #ifdef CONFIG_ISA 28 29 #define SERIAL_PORT_DFNS \ 29 30 /* UART CLK PORT IRQ FLAGS */ \ 30 31 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 31 32 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 32 33 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 33 34 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 35 + #endif
+5 -5
arch/m68k/include/asm/unistd.h
··· 132 132 #define __NR_adjtimex 124 133 133 #define __NR_mprotect 125 134 134 #define __NR_sigprocmask 126 135 - /*#define __NR_create_module 127*/ 135 + #define __NR_create_module 127 136 136 #define __NR_init_module 128 137 137 #define __NR_delete_module 129 138 - /*#define __NR_get_kernel_syms 130*/ 138 + #define __NR_get_kernel_syms 130 139 139 #define __NR_quotactl 131 140 140 #define __NR_getpgid 132 141 141 #define __NR_fchdir 133 ··· 172 172 #define __NR_setresuid 164 173 173 #define __NR_getresuid 165 174 174 #define __NR_getpagesize 166 175 - /*#define __NR_query_module 167*/ 175 + #define __NR_query_module 167 176 176 #define __NR_poll 168 177 177 #define __NR_nfsservctl 169 178 178 #define __NR_setresgid 170 ··· 193 193 #define __NR_capset 185 194 194 #define __NR_sigaltstack 186 195 195 #define __NR_sendfile 187 196 - /*#define __NR_getpmsg 188*/ /* some people actually want streams */ 197 - /*#define __NR_putpmsg 189*/ /* some people actually want streams */ 196 + #define __NR_getpmsg 188 /* some people actually want streams */ 197 + #define __NR_putpmsg 189 /* some people actually want streams */ 198 198 #define __NR_vfork 190 199 199 #define __NR_ugetrlimit 191 200 200 #define __NR_mmap2 192
+59 -58
arch/m68k/kernel/head.S
··· 250 250 * USE_MFP: Use the ST-MFP port (Modem1) for serial debug. 251 251 * 252 252 * Macintosh constants: 253 - * MAC_SERIAL_DEBUG: Turns on serial debug output for the Macintosh. 254 - * MAC_USE_SCC_A: Use the SCC port A (modem) for serial debug. 255 - * MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default). 253 + * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console. 254 + * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console. 256 255 */ 257 256 258 257 #include <linux/linkage.h> ··· 267 268 268 269 #include <asm/machw.h> 269 270 270 - /* 271 - * Macintosh console support 272 - */ 273 - 274 271 #ifdef CONFIG_FRAMEBUFFER_CONSOLE 275 272 #define CONSOLE 276 273 #define CONSOLE_PENGUIN 277 274 #endif 278 275 279 - /* 280 - * Macintosh serial debug support; outputs boot info to the printer 281 - * and/or modem serial ports 282 - */ 283 - #undef MAC_SERIAL_DEBUG 276 + #ifdef CONFIG_EARLY_PRINTK 277 + #define SERIAL_DEBUG 278 + #else 279 + #undef SERIAL_DEBUG 280 + #endif 284 281 285 - /* 286 - * Macintosh serial debug port selection; define one or both; 287 - * requires MAC_SERIAL_DEBUG to be defined 288 - */ 289 - #define MAC_USE_SCC_A /* Macintosh modem serial port */ 290 - #define MAC_USE_SCC_B /* Macintosh printer serial port */ 282 + #else /* !CONFIG_MAC */ 291 283 292 - #endif /* CONFIG_MAC */ 284 + #define SERIAL_DEBUG 285 + 286 + #endif /* !CONFIG_MAC */ 293 287 294 288 #undef MMU_PRINT 295 289 #undef MMU_NOCACHE_KERNEL 296 - #define SERIAL_DEBUG 297 290 #undef DEBUG 298 291 299 292 /* ··· 646 655 lea %pc@(L(mac_rowbytes)),%a1 647 656 movel %a0@,%a1@ 648 657 649 - #ifdef MAC_SERIAL_DEBUG 658 + #ifdef SERIAL_DEBUG 650 659 get_bi_record BI_MAC_SCCBASE 651 660 lea %pc@(L(mac_sccbase)),%a1 652 661 movel %a0@,%a1@ 653 - #endif /* MAC_SERIAL_DEBUG */ 662 + #endif 654 663 655 664 #if 0 656 665 /* ··· 1418 1427 subl %d0,L(console_font) 1419 1428 subl %d0,L(console_font_data) 1420 1429 #endif 1421 - #ifdef MAC_SERIAL_DEBUG 1430 + #ifdef SERIAL_DEBUG 1422 1431 orl #0x50000000,L(mac_sccbase) 1423 1432 #endif 1424 1433 1: ··· 1908 1917 jbne 30b 1909 1918 1910 1919 mmu_print_done: 1911 - puts "\n\n" 1920 + puts "\n" 1912 1921 1913 1922 func_return mmu_print 1914 1923 ··· 2759 2768 .byte 9,0 /* no interrupts */ 2760 2769 .byte 10,0 /* NRZ */ 2761 2770 .byte 11,0x50 /* use baud rate generator */ 2762 - .byte 12,10,13,0 /* 9600 baud */ 2771 + .byte 12,1,13,0 /* 38400 baud */ 2763 2772 .byte 14,1 /* Baud rate generator enable */ 2764 2773 .byte 3,0xc1 /* enable receiver */ 2765 2774 .byte 5,0xea /* enable transmitter */ ··· 2897 2906 #endif 2898 2907 #ifdef CONFIG_MAC 2899 2908 is_not_mac(L(serial_init_not_mac)) 2900 - #ifdef MAC_SERIAL_DEBUG 2901 - #if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B) 2902 - #define MAC_USE_SCC_B 2903 - #endif 2909 + 2910 + #ifdef SERIAL_DEBUG 2911 + /* You may define either or both of these. */ 2912 + #define MAC_USE_SCC_A /* Modem port */ 2913 + #define MAC_USE_SCC_B /* Printer port */ 2914 + 2904 2915 #define mac_scc_cha_b_ctrl_offset 0x0 2905 2916 #define mac_scc_cha_a_ctrl_offset 0x2 2906 2917 #define mac_scc_cha_b_data_offset 0x4 ··· 2933 2940 jra 7b 2934 2941 8: 2935 2942 #endif /* MAC_USE_SCC_B */ 2936 - #endif /* MAC_SERIAL_DEBUG */ 2943 + #endif /* SERIAL_DEBUG */ 2937 2944 2938 2945 jra L(serial_init_done) 2939 2946 L(serial_init_not_mac): ··· 3004 3011 #ifdef CONFIG_MAC 3005 3012 is_not_mac(5f) 3006 3013 3007 - #ifdef MAC_SERIAL_DEBUG 3014 + #ifdef SERIAL_DEBUG 3008 3015 3009 3016 #ifdef MAC_USE_SCC_A 3010 3017 movel %pc@(L(mac_sccbase)),%a1 ··· 3022 3029 moveb %d0,%a1@(mac_scc_cha_b_data_offset) 3023 3030 #endif /* MAC_USE_SCC_B */ 3024 3031 3025 - #endif /* MAC_SERIAL_DEBUG */ 3032 + #endif /* SERIAL_DEBUG */ 3026 3033 3027 3034 jra L(serial_putc_done) 3028 3035 5: ··· 3241 3248 3242 3249 #ifdef CONFIG_MAC 3243 3250 /* 3244 - * mac_serial_print 3251 + * mac_early_print 3245 3252 * 3246 3253 * This routine takes its parameters on the stack. It then 3247 - * turns around and calls the internal routine. This routine 3248 - * is used until the Linux console driver initializes itself. 3254 + * turns around and calls the internal routines. This routine 3255 + * is used by the boot console. 3249 3256 * 3250 3257 * The calling parameters are: 3251 - * void mac_serial_print(const char *str); 3258 + * void mac_early_print(const char *str, unsigned length); 3252 3259 * 3253 3260 * This routine does NOT understand variable arguments only 3254 3261 * simple strings! 3255 3262 */ 3256 - ENTRY(mac_serial_print) 3257 - moveml %d0/%a0,%sp@- 3258 - #if 1 3259 - move %sr,%sp@- 3263 + ENTRY(mac_early_print) 3264 + moveml %d0/%d1/%a0,%sp@- 3265 + movew %sr,%sp@- 3260 3266 ori #0x0700,%sr 3261 - #endif 3262 - movel %sp@(10),%a0 /* fetch parameter */ 3267 + movel %sp@(18),%a0 /* fetch parameter */ 3268 + movel %sp@(22),%d1 /* fetch parameter */ 3263 3269 jra 2f 3264 - 1: serial_putc %d0 3265 - 2: moveb %a0@+,%d0 3266 - jne 1b 3267 - #if 1 3268 - move %sp@+,%sr 3270 + 1: 3271 + #ifdef CONSOLE 3272 + console_putc %d0 3269 3273 #endif 3270 - moveml %sp@+,%d0/%a0 3274 + #ifdef SERIAL_DEBUG 3275 + serial_putc %d0 3276 + #endif 3277 + subq #1,%d1 3278 + 2: jeq 3f 3279 + moveb %a0@+,%d0 3280 + jne 1b 3281 + 3: 3282 + movew %sp@+,%sr 3283 + moveml %sp@+,%d0/%d1/%a0 3271 3284 rts 3272 3285 #endif /* CONFIG_MAC */ 3273 3286 ··· 3408 3409 * a0 = pointer to boot_info 3409 3410 * d7 = value of boot_info fields 3410 3411 */ 3411 - puts "\nMacLinux\n\n" 3412 + puts "\nMacLinux\n" 3412 3413 3413 3414 #ifdef SERIAL_DEBUG 3414 - puts " vidaddr:" 3415 + puts "\n vidaddr:" 3415 3416 putn %pc@(L(mac_videobase)) /* video addr. */ 3416 3417 3417 3418 puts "\n _stext:" ··· 3422 3423 lea %pc@(_end),%a0 3423 3424 putn %a0 3424 3425 3425 - puts "\ncpuid:" 3426 + puts "\n cpuid:" 3426 3427 putn %pc@(L(cputype)) 3427 - putc '\n' 3428 3428 3429 - #ifdef MAC_SERIAL_DEBUG 3429 + # ifdef CONFIG_MAC 3430 + puts "\n sccbase:" 3430 3431 putn %pc@(L(mac_sccbase)) 3432 + # endif 3433 + # ifdef MMU_PRINT 3431 3434 putc '\n' 3432 - #endif 3433 - # if defined(MMU_PRINT) 3434 3435 jbsr mmu_print_machine_cpu_types 3435 - # endif /* MMU_PRINT */ 3436 + # endif 3436 3437 #endif /* SERIAL_DEBUG */ 3438 + 3439 + putc '\n' 3437 3440 3438 3441 func_return console_put_stats 3439 3442 ··· 3897 3896 .long 0 3898 3897 L(mac_rowbytes): 3899 3898 .long 0 3900 - #ifdef MAC_SERIAL_DEBUG 3899 + #ifdef SERIAL_DEBUG 3901 3900 L(mac_sccbase): 3902 3901 .long 0 3903 - #endif /* MAC_SERIAL_DEBUG */ 3904 3902 #endif 3903 + #endif /* CONFIG_MAC */ 3905 3904 3906 3905 #if defined (CONFIG_APOLLO) 3907 3906 LSRB0 = 0x10412
+8 -33
arch/m68k/mac/baboon.c
··· 8 8 9 9 #include <linux/types.h> 10 10 #include <linux/kernel.h> 11 - #include <linux/mm.h> 12 - #include <linux/delay.h> 13 - #include <linux/init.h> 14 11 #include <linux/irq.h> 15 12 16 - #include <asm/traps.h> 17 - #include <asm/bootinfo.h> 18 13 #include <asm/macintosh.h> 19 14 #include <asm/macints.h> 20 15 #include <asm/mac_baboon.h> ··· 18 23 19 24 int baboon_present; 20 25 static volatile struct baboon *baboon; 21 - static unsigned char baboon_disabled; 22 26 23 27 #if 0 24 28 extern int macide_ack_intr(struct ata_channel *); ··· 83 89 84 90 void __init baboon_register_interrupts(void) 85 91 { 86 - baboon_disabled = 0; 87 92 irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq); 88 93 } 89 94 90 95 /* 91 - * The means for masking individual baboon interrupts remains a mystery, so 92 - * enable the umbrella interrupt only when no baboon interrupt is disabled. 96 + * The means for masking individual Baboon interrupts remains a mystery. 97 + * However, since we only use the IDE IRQ, we can just enable/disable all 98 + * Baboon interrupts. If/when we handle more than one Baboon IRQ, we must 99 + * either figure out how to mask them individually or else implement the 100 + * same workaround that's used for NuBus slots (see nubus_disabled and 101 + * via_nubus_irq_shutdown). 93 102 */ 94 103 95 104 void baboon_irq_enable(int irq) 96 105 { 97 - int irq_idx = IRQ_IDX(irq); 98 - 99 106 #ifdef DEBUG_IRQUSE 100 107 printk("baboon_irq_enable(%d)\n", irq); 101 108 #endif 102 109 103 - baboon_disabled &= ~(1 << irq_idx); 104 - if (!baboon_disabled) 105 - mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C)); 110 + mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C)); 106 111 } 107 112 108 113 void baboon_irq_disable(int irq) 109 114 { 110 - int irq_idx = IRQ_IDX(irq); 111 - 112 115 #ifdef DEBUG_IRQUSE 113 116 printk("baboon_irq_disable(%d)\n", irq); 114 117 #endif 115 118 116 - baboon_disabled |= 1 << irq_idx; 117 - if (baboon_disabled) 118 - mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); 119 - } 120 - 121 - void baboon_irq_clear(int irq) 122 - { 123 - int irq_idx = IRQ_IDX(irq); 124 - 125 - baboon->mb_ifr &= ~(1 << irq_idx); 126 - } 127 - 128 - int baboon_irq_pending(int irq) 129 - { 130 - int irq_idx = IRQ_IDX(irq); 131 - 132 - return baboon->mb_ifr & (1 << irq_idx); 119 + mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); 133 120 }
+62 -31
arch/m68k/mac/config.c
··· 71 71 static void mac_identify(void); 72 72 static void mac_report_hardware(void); 73 73 74 + #ifdef CONFIG_EARLY_PRINTK 75 + asmlinkage void __init mac_early_print(const char *s, unsigned n); 76 + 77 + static void __init mac_early_cons_write(struct console *con, 78 + const char *s, unsigned n) 79 + { 80 + mac_early_print(s, n); 81 + } 82 + 83 + static struct console __initdata mac_early_cons = { 84 + .name = "early", 85 + .write = mac_early_cons_write, 86 + .flags = CON_PRINTBUFFER | CON_BOOT, 87 + .index = -1 88 + }; 89 + 90 + int __init mac_unregister_early_cons(void) 91 + { 92 + /* mac_early_print can't be used after init sections are discarded */ 93 + return unregister_console(&mac_early_cons); 94 + } 95 + 96 + late_initcall(mac_unregister_early_cons); 97 + #endif 98 + 74 99 static void __init mac_sched_init(irq_handler_t vector) 75 100 { 76 101 via_init_clock(vector); ··· 189 164 mach_beep = mac_mksound; 190 165 #endif 191 166 167 + #ifdef CONFIG_EARLY_PRINTK 168 + register_console(&mac_early_cons); 169 + #endif 170 + 192 171 /* 193 172 * Determine hardware present 194 173 */ ··· 221 192 * inaccurate, so look here if a new Mac model won't run. Example: if 222 193 * a Mac crashes immediately after the VIA1 registers have been dumped 223 194 * to the screen, it probably died attempting to read DirB on a RBV. 224 - * Meaning it should have MAC_VIA_IIci here :-) 195 + * Meaning it should have MAC_VIA_IICI here :-) 225 196 */ 226 197 227 198 struct mac_model *macintosh_config; ··· 296 267 .ident = MAC_MODEL_IICI, 297 268 .name = "IIci", 298 269 .adb_type = MAC_ADB_II, 299 - .via_type = MAC_VIA_IIci, 270 + .via_type = MAC_VIA_IICI, 300 271 .scsi_type = MAC_SCSI_OLD, 301 272 .scc_type = MAC_SCC_II, 302 273 .nubus_type = MAC_NUBUS, ··· 305 276 .ident = MAC_MODEL_IIFX, 306 277 .name = "IIfx", 307 278 .adb_type = MAC_ADB_IOP, 308 - .via_type = MAC_VIA_IIci, 279 + .via_type = MAC_VIA_IICI, 309 280 .scsi_type = MAC_SCSI_OLD, 310 281 .scc_type = MAC_SCC_IOP, 311 282 .nubus_type = MAC_NUBUS, ··· 314 285 .ident = MAC_MODEL_IISI, 315 286 .name = "IIsi", 316 287 .adb_type = MAC_ADB_IISI, 317 - .via_type = MAC_VIA_IIci, 288 + .via_type = MAC_VIA_IICI, 318 289 .scsi_type = MAC_SCSI_OLD, 319 290 .scc_type = MAC_SCC_II, 320 291 .nubus_type = MAC_NUBUS, ··· 323 294 .ident = MAC_MODEL_IIVI, 324 295 .name = "IIvi", 325 296 .adb_type = MAC_ADB_IISI, 326 - .via_type = MAC_VIA_IIci, 297 + .via_type = MAC_VIA_IICI, 327 298 .scsi_type = MAC_SCSI_OLD, 328 299 .scc_type = MAC_SCC_II, 329 300 .nubus_type = MAC_NUBUS, ··· 332 303 .ident = MAC_MODEL_IIVX, 333 304 .name = "IIvx", 334 305 .adb_type = MAC_ADB_IISI, 335 - .via_type = MAC_VIA_IIci, 306 + .via_type = MAC_VIA_IICI, 336 307 .scsi_type = MAC_SCSI_OLD, 337 308 .scc_type = MAC_SCC_II, 338 309 .nubus_type = MAC_NUBUS, ··· 347 318 .ident = MAC_MODEL_CLII, 348 319 .name = "Classic II", 349 320 .adb_type = MAC_ADB_IISI, 350 - .via_type = MAC_VIA_IIci, 321 + .via_type = MAC_VIA_IICI, 351 322 .scsi_type = MAC_SCSI_OLD, 352 323 .scc_type = MAC_SCC_II, 353 324 .nubus_type = MAC_NUBUS, ··· 356 327 .ident = MAC_MODEL_CCL, 357 328 .name = "Color Classic", 358 329 .adb_type = MAC_ADB_CUDA, 359 - .via_type = MAC_VIA_IIci, 330 + .via_type = MAC_VIA_IICI, 360 331 .scsi_type = MAC_SCSI_OLD, 361 332 .scc_type = MAC_SCC_II, 362 333 .nubus_type = MAC_NUBUS, ··· 365 336 .ident = MAC_MODEL_CCLII, 366 337 .name = "Color Classic II", 367 338 .adb_type = MAC_ADB_CUDA, 368 - .via_type = MAC_VIA_IIci, 339 + .via_type = MAC_VIA_IICI, 369 340 .scsi_type = MAC_SCSI_OLD, 370 341 .scc_type = MAC_SCC_II, 371 342 .nubus_type = MAC_NUBUS, ··· 380 351 .ident = MAC_MODEL_LC, 381 352 .name = "LC", 382 353 .adb_type = MAC_ADB_IISI, 383 - .via_type = MAC_VIA_IIci, 354 + .via_type = MAC_VIA_IICI, 384 355 .scsi_type = MAC_SCSI_OLD, 385 356 .scc_type = MAC_SCC_II, 386 357 .nubus_type = MAC_NUBUS, ··· 389 360 .ident = MAC_MODEL_LCII, 390 361 .name = "LC II", 391 362 .adb_type = MAC_ADB_IISI, 392 - .via_type = MAC_VIA_IIci, 363 + .via_type = MAC_VIA_IICI, 393 364 .scsi_type = MAC_SCSI_OLD, 394 365 .scc_type = MAC_SCC_II, 395 366 .nubus_type = MAC_NUBUS, ··· 398 369 .ident = MAC_MODEL_LCIII, 399 370 .name = "LC III", 400 371 .adb_type = MAC_ADB_IISI, 401 - .via_type = MAC_VIA_IIci, 372 + .via_type = MAC_VIA_IICI, 402 373 .scsi_type = MAC_SCSI_OLD, 403 374 .scc_type = MAC_SCC_II, 404 375 .nubus_type = MAC_NUBUS, ··· 526 497 .ident = MAC_MODEL_P460, 527 498 .name = "Performa 460", 528 499 .adb_type = MAC_ADB_IISI, 529 - .via_type = MAC_VIA_IIci, 500 + .via_type = MAC_VIA_IICI, 530 501 .scsi_type = MAC_SCSI_OLD, 531 502 .scc_type = MAC_SCC_II, 532 503 .nubus_type = MAC_NUBUS, ··· 553 524 .ident = MAC_MODEL_P520, 554 525 .name = "Performa 520", 555 526 .adb_type = MAC_ADB_CUDA, 556 - .via_type = MAC_VIA_IIci, 527 + .via_type = MAC_VIA_IICI, 557 528 .scsi_type = MAC_SCSI_OLD, 558 529 .scc_type = MAC_SCC_II, 559 530 .nubus_type = MAC_NUBUS, ··· 562 533 .ident = MAC_MODEL_P550, 563 534 .name = "Performa 550", 564 535 .adb_type = MAC_ADB_CUDA, 565 - .via_type = MAC_VIA_IIci, 536 + .via_type = MAC_VIA_IICI, 566 537 .scsi_type = MAC_SCSI_OLD, 567 538 .scc_type = MAC_SCC_II, 568 539 .nubus_type = MAC_NUBUS, ··· 594 565 .ident = MAC_MODEL_TV, 595 566 .name = "TV", 596 567 .adb_type = MAC_ADB_CUDA, 597 - .via_type = MAC_VIA_QUADRA, 568 + .via_type = MAC_VIA_IICI, 598 569 .scsi_type = MAC_SCSI_OLD, 599 570 .scc_type = MAC_SCC_II, 600 571 .nubus_type = MAC_NUBUS, ··· 603 574 .ident = MAC_MODEL_P600, 604 575 .name = "Performa 600", 605 576 .adb_type = MAC_ADB_IISI, 606 - .via_type = MAC_VIA_IIci, 577 + .via_type = MAC_VIA_IICI, 607 578 .scsi_type = MAC_SCSI_OLD, 608 579 .scc_type = MAC_SCC_II, 609 580 .nubus_type = MAC_NUBUS, ··· 674 645 }, { 675 646 .ident = MAC_MODEL_PB150, 676 647 .name = "PowerBook 150", 677 - .adb_type = MAC_ADB_PB1, 678 - .via_type = MAC_VIA_IIci, 648 + .adb_type = MAC_ADB_PB2, 649 + .via_type = MAC_VIA_IICI, 679 650 .scsi_type = MAC_SCSI_OLD, 680 651 .ide_type = MAC_IDE_PB, 681 652 .scc_type = MAC_SCC_QUADRA, ··· 761 732 * PowerBook Duos are pretty much like normal PowerBooks 762 733 * All of these probably have onboard SONIC in the Dock which 763 734 * means we'll have to probe for it eventually. 764 - * 765 - * Are these really MAC_VIA_IIci? The developer notes for the 766 - * Duos show pretty much the same custom parts as in most of 767 - * the other PowerBooks which would imply MAC_VIA_QUADRA. 768 735 */ 769 736 770 737 { 771 738 .ident = MAC_MODEL_PB210, 772 739 .name = "PowerBook Duo 210", 773 740 .adb_type = MAC_ADB_PB2, 774 - .via_type = MAC_VIA_IIci, 741 + .via_type = MAC_VIA_IICI, 775 742 .scsi_type = MAC_SCSI_OLD, 776 743 .scc_type = MAC_SCC_QUADRA, 777 744 .nubus_type = MAC_NUBUS, ··· 776 751 .ident = MAC_MODEL_PB230, 777 752 .name = "PowerBook Duo 230", 778 753 .adb_type = MAC_ADB_PB2, 779 - .via_type = MAC_VIA_IIci, 754 + .via_type = MAC_VIA_IICI, 780 755 .scsi_type = MAC_SCSI_OLD, 781 756 .scc_type = MAC_SCC_QUADRA, 782 757 .nubus_type = MAC_NUBUS, ··· 785 760 .ident = MAC_MODEL_PB250, 786 761 .name = "PowerBook Duo 250", 787 762 .adb_type = MAC_ADB_PB2, 788 - .via_type = MAC_VIA_IIci, 763 + .via_type = MAC_VIA_IICI, 789 764 .scsi_type = MAC_SCSI_OLD, 790 765 .scc_type = MAC_SCC_QUADRA, 791 766 .nubus_type = MAC_NUBUS, ··· 794 769 .ident = MAC_MODEL_PB270C, 795 770 .name = "PowerBook Duo 270c", 796 771 .adb_type = MAC_ADB_PB2, 797 - .via_type = MAC_VIA_IIci, 772 + .via_type = MAC_VIA_IICI, 798 773 .scsi_type = MAC_SCSI_OLD, 799 774 .scc_type = MAC_SCC_QUADRA, 800 775 .nubus_type = MAC_NUBUS, ··· 803 778 .ident = MAC_MODEL_PB280, 804 779 .name = "PowerBook Duo 280", 805 780 .adb_type = MAC_ADB_PB2, 806 - .via_type = MAC_VIA_IIci, 781 + .via_type = MAC_VIA_IICI, 807 782 .scsi_type = MAC_SCSI_OLD, 808 783 .scc_type = MAC_SCC_QUADRA, 809 784 .nubus_type = MAC_NUBUS, ··· 812 787 .ident = MAC_MODEL_PB280C, 813 788 .name = "PowerBook Duo 280c", 814 789 .adb_type = MAC_ADB_PB2, 815 - .via_type = MAC_VIA_IIci, 790 + .via_type = MAC_VIA_IICI, 816 791 .scsi_type = MAC_SCSI_OLD, 817 792 .scc_type = MAC_SCC_QUADRA, 818 793 .nubus_type = MAC_NUBUS, ··· 889 864 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; 890 865 break; 891 866 default: 892 - scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; 893 - scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; 867 + /* On non-PSC machines, the serial ports share an IRQ. */ 868 + if (macintosh_config->ident == MAC_MODEL_IIFX) { 869 + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; 870 + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; 871 + } else { 872 + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4; 873 + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4; 874 + } 894 875 break; 895 876 } 896 877
+2 -6
arch/m68k/mac/iop.c
··· 115 115 #include <asm/macintosh.h> 116 116 #include <asm/macints.h> 117 117 #include <asm/mac_iop.h> 118 - #include <asm/mac_oss.h> 119 118 120 119 /*#define DEBUG_IOP*/ 121 120 ··· 147 148 static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN]; 148 149 149 150 irqreturn_t iop_ism_irq(int, void *); 150 - 151 - extern void oss_irq_enable(int); 152 151 153 152 /* 154 153 * Private access functions ··· 301 304 void __init iop_register_interrupts(void) 302 305 { 303 306 if (iop_ism_present) { 304 - if (oss_present) { 305 - if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 0, 307 + if (macintosh_config->ident == MAC_MODEL_IIFX) { 308 + if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0, 306 309 "ISM IOP", (void *)IOP_NUM_ISM)) 307 310 pr_err("Couldn't register ISM IOP interrupt\n"); 308 - oss_irq_enable(IRQ_MAC_ADB); 309 311 } else { 310 312 if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP", 311 313 (void *)IOP_NUM_ISM))
+51 -150
arch/m68k/mac/macints.c
··· 26 26 * - slot 6: timer 1 (not on IIci) 27 27 * - slot 7: status of IRQ; signals 'any enabled int.' 28 28 * 29 - * 2 - OSS (IIfx only?) 30 - * - slot 0: SCSI interrupt 31 - * - slot 1: Sound interrupt 32 - * 33 29 * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes: 34 30 * 35 31 * 3 - unused (?) ··· 38 42 * 39 43 * 6 - off switch (?) 40 44 * 41 - * For OSS Macintoshes (IIfx only at this point): 45 + * Machines with Quadra-like VIA hardware, except PSC and PMU machines, support 46 + * an alternate interrupt mapping, as used by A/UX. It spreads ethernet and 47 + * sound out to their own autovector IRQs and gives VIA1 a higher priority: 42 48 * 43 - * 3 - Nubus interrupt 44 - * - slot 0: Slot $9 45 - * - slot 1: Slot $A 46 - * - slot 2: Slot $B 47 - * - slot 3: Slot $C 48 - * - slot 4: Slot $D 49 - * - slot 5: Slot $E 49 + * 1 - unused (?) 50 + * 51 + * 3 - on-board SONIC 52 + * 53 + * 5 - Apple Sound Chip (ASC) 54 + * 55 + * 6 - VIA1 56 + * 57 + * For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to 58 + * the Quadra (A/UX) mapping: 59 + * 60 + * 1 - ISM IOP (ADB) 61 + * 62 + * 2 - SCSI 63 + * 64 + * 3 - NuBus 50 65 * 51 66 * 4 - SCC IOP 52 67 * 53 - * 5 - ISM IOP (ADB?) 54 - * 55 - * 6 - unused 68 + * 6 - VIA1 56 69 * 57 70 * For PSC Macintoshes (660AV, 840AV): 58 71 * ··· 105 100 * case. They're hidden behind the Nubus slot $C interrupt thus adding a 106 101 * third layer of indirection. Why oh why did the Apple engineers do that? 107 102 * 108 - * - We support "fast" and "slow" handlers, just like the Amiga port. The 109 - * fast handlers are called first and with all interrupts disabled. They 110 - * are expected to execute quickly (hence the name). The slow handlers are 111 - * called last with interrupts enabled and the interrupt level restored. 112 - * They must therefore be reentrant. 113 - * 114 - * TODO: 115 - * 116 103 */ 117 104 118 - #include <linux/module.h> 119 105 #include <linux/types.h> 120 106 #include <linux/kernel.h> 121 107 #include <linux/sched.h> 122 - #include <linux/kernel_stat.h> 123 - #include <linux/interrupt.h> /* for intr_count */ 108 + #include <linux/interrupt.h> 109 + #include <linux/irq.h> 124 110 #include <linux/delay.h> 125 - #include <linux/seq_file.h> 126 111 127 - #include <asm/system.h> 128 112 #include <asm/irq.h> 129 - #include <asm/traps.h> 130 - #include <asm/bootinfo.h> 131 113 #include <asm/macintosh.h> 114 + #include <asm/macints.h> 132 115 #include <asm/mac_via.h> 133 116 #include <asm/mac_psc.h> 134 - #include <asm/hwtest.h> 135 - #include <asm/errno.h> 136 - #include <asm/macints.h> 137 - #include <asm/irq_regs.h> 138 117 #include <asm/mac_oss.h> 118 + #include <asm/mac_iop.h> 119 + #include <asm/mac_baboon.h> 120 + #include <asm/hwtest.h> 121 + #include <asm/irq_regs.h> 139 122 140 123 #define SHUTUP_SONIC 141 - 142 - /* 143 - * VIA/RBV hooks 144 - */ 145 - 146 - extern void via_register_interrupts(void); 147 - extern void via_irq_enable(int); 148 - extern void via_irq_disable(int); 149 - extern void via_irq_clear(int); 150 - extern int via_irq_pending(int); 151 - 152 - /* 153 - * OSS hooks 154 - */ 155 - 156 - extern void oss_register_interrupts(void); 157 - extern void oss_irq_enable(int); 158 - extern void oss_irq_disable(int); 159 - extern void oss_irq_clear(int); 160 - extern int oss_irq_pending(int); 161 - 162 - /* 163 - * PSC hooks 164 - */ 165 - 166 - extern void psc_register_interrupts(void); 167 - extern void psc_irq_enable(int); 168 - extern void psc_irq_disable(int); 169 - extern void psc_irq_clear(int); 170 - extern int psc_irq_pending(int); 171 - 172 - /* 173 - * IOP hooks 174 - */ 175 - 176 - extern void iop_register_interrupts(void); 177 - 178 - /* 179 - * Baboon hooks 180 - */ 181 - 182 - extern int baboon_present; 183 - 184 - extern void baboon_register_interrupts(void); 185 - extern void baboon_irq_enable(int); 186 - extern void baboon_irq_disable(int); 187 - extern void baboon_irq_clear(int); 188 124 189 125 /* 190 126 * console_loglevel determines NMI handler function ··· 136 190 137 191 /* #define DEBUG_MACINTS */ 138 192 193 + static unsigned int mac_irq_startup(struct irq_data *); 194 + static void mac_irq_shutdown(struct irq_data *); 195 + 139 196 static struct irq_chip mac_irq_chip = { 140 197 .name = "mac", 141 198 .irq_enable = mac_irq_enable, 142 199 .irq_disable = mac_irq_disable, 200 + .irq_startup = mac_irq_startup, 201 + .irq_shutdown = mac_irq_shutdown, 143 202 }; 144 203 145 204 void __init mac_init_IRQ(void) ··· 190 239 /* 191 240 * mac_irq_enable - enable an interrupt source 192 241 * mac_irq_disable - disable an interrupt source 193 - * mac_clear_irq - clears a pending interrupt 194 - * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending) 195 242 * 196 243 * These routines are just dispatchers to the VIA/OSS/PSC routines. 197 244 */ ··· 201 252 202 253 switch(irq_src) { 203 254 case 1: 204 - via_irq_enable(irq); 205 - break; 206 255 case 2: 207 256 case 7: 208 257 if (oss_present) ··· 209 262 via_irq_enable(irq); 210 263 break; 211 264 case 3: 265 + case 4: 212 266 case 5: 213 267 case 6: 214 268 if (psc_present) 215 269 psc_irq_enable(irq); 216 270 else if (oss_present) 217 271 oss_irq_enable(irq); 218 - break; 219 - case 4: 220 - if (psc_present) 221 - psc_irq_enable(irq); 222 272 break; 223 273 case 8: 224 274 if (baboon_present) ··· 231 287 232 288 switch(irq_src) { 233 289 case 1: 234 - via_irq_disable(irq); 235 - break; 236 290 case 2: 237 291 case 7: 238 292 if (oss_present) ··· 239 297 via_irq_disable(irq); 240 298 break; 241 299 case 3: 300 + case 4: 242 301 case 5: 243 302 case 6: 244 303 if (psc_present) 245 304 psc_irq_disable(irq); 246 305 else if (oss_present) 247 306 oss_irq_disable(irq); 248 - break; 249 - case 4: 250 - if (psc_present) 251 - psc_irq_disable(irq); 252 307 break; 253 308 case 8: 254 309 if (baboon_present) ··· 254 315 } 255 316 } 256 317 257 - void mac_clear_irq(unsigned int irq) 318 + static unsigned int mac_irq_startup(struct irq_data *data) 258 319 { 259 - switch(IRQ_SRC(irq)) { 260 - case 1: 261 - via_irq_clear(irq); 262 - break; 263 - case 2: 264 - case 7: 265 - if (oss_present) 266 - oss_irq_clear(irq); 267 - else 268 - via_irq_clear(irq); 269 - break; 270 - case 3: 271 - case 5: 272 - case 6: 273 - if (psc_present) 274 - psc_irq_clear(irq); 275 - else if (oss_present) 276 - oss_irq_clear(irq); 277 - break; 278 - case 4: 279 - if (psc_present) 280 - psc_irq_clear(irq); 281 - break; 282 - case 8: 283 - if (baboon_present) 284 - baboon_irq_clear(irq); 285 - break; 286 - } 287 - } 320 + int irq = data->irq; 288 321 289 - int mac_irq_pending(unsigned int irq) 290 - { 291 - switch(IRQ_SRC(irq)) { 292 - case 1: 293 - return via_irq_pending(irq); 294 - case 2: 295 - case 7: 296 - if (oss_present) 297 - return oss_irq_pending(irq); 298 - else 299 - return via_irq_pending(irq); 300 - case 3: 301 - case 5: 302 - case 6: 303 - if (psc_present) 304 - return psc_irq_pending(irq); 305 - else if (oss_present) 306 - return oss_irq_pending(irq); 307 - break; 308 - case 4: 309 - if (psc_present) 310 - return psc_irq_pending(irq); 311 - break; 312 - } 322 + if (IRQ_SRC(irq) == 7 && !oss_present) 323 + via_nubus_irq_startup(irq); 324 + else 325 + mac_irq_enable(data); 326 + 313 327 return 0; 314 328 } 315 - EXPORT_SYMBOL(mac_irq_pending); 329 + 330 + static void mac_irq_shutdown(struct irq_data *data) 331 + { 332 + int irq = data->irq; 333 + 334 + if (IRQ_SRC(irq) == 7 && !oss_present) 335 + via_nubus_irq_shutdown(irq); 336 + else 337 + mac_irq_disable(data); 338 + } 316 339 317 340 static int num_debug[8]; 318 341
+52 -105
arch/m68k/mac/oss.c
··· 1 1 /* 2 - * OSS handling 2 + * Operating System Services (OSS) chip handling 3 3 * Written by Joshua M. Thompson (funaho@jurai.org) 4 4 * 5 5 * ··· 30 30 int oss_present; 31 31 volatile struct mac_oss *oss; 32 32 33 - extern void via1_irq(unsigned int irq, struct irq_desc *desc); 34 - 35 33 /* 36 34 * Initialize the OSS 37 35 * ··· 49 51 /* do this by setting the source's interrupt level to zero. */ 50 52 51 53 for (i = 0; i <= OSS_NUM_SOURCES; i++) { 52 - oss->irq_level[i] = OSS_IRQLEV_DISABLED; 54 + oss->irq_level[i] = 0; 53 55 } 54 - /* If we disable VIA1 here, we never really handle it... */ 55 - oss->irq_level[OSS_VIA1] = OSS_IRQLEV_VIA1; 56 56 } 57 57 58 58 /* ··· 62 66 } 63 67 64 68 /* 65 - * Handle miscellaneous OSS interrupts. Right now that's just sound 66 - * and SCSI; everything else is routed to its own autovector IRQ. 69 + * Handle miscellaneous OSS interrupts. 67 70 */ 68 71 69 72 static void oss_irq(unsigned int irq, struct irq_desc *desc) 70 73 { 71 - int events; 72 - 73 - events = oss->irq_pending & (OSS_IP_SOUND|OSS_IP_SCSI); 74 - if (!events) 75 - return; 74 + int events = oss->irq_pending & 75 + (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM); 76 76 77 77 #ifdef DEBUG_IRQS 78 78 if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) { ··· 76 84 (int) oss->irq_pending); 77 85 } 78 86 #endif 79 - /* FIXME: how do you clear a pending IRQ? */ 80 87 81 - if (events & OSS_IP_SOUND) { 82 - oss->irq_pending &= ~OSS_IP_SOUND; 83 - /* FIXME: call sound handler */ 84 - } else if (events & OSS_IP_SCSI) { 88 + if (events & OSS_IP_IOPSCC) { 89 + oss->irq_pending &= ~OSS_IP_IOPSCC; 90 + generic_handle_irq(IRQ_MAC_SCC); 91 + } 92 + 93 + if (events & OSS_IP_SCSI) { 85 94 oss->irq_pending &= ~OSS_IP_SCSI; 86 95 generic_handle_irq(IRQ_MAC_SCSI); 87 - } else { 88 - /* FIXME: error check here? */ 96 + } 97 + 98 + if (events & OSS_IP_IOPISM) { 99 + oss->irq_pending &= ~OSS_IP_IOPISM; 100 + generic_handle_irq(IRQ_MAC_ADB); 89 101 } 90 102 } 91 103 ··· 128 132 129 133 /* 130 134 * Register the OSS and NuBus interrupt dispatchers. 135 + * 136 + * This IRQ mapping is laid out with two things in mind: first, we try to keep 137 + * things on their own levels to avoid having to do double-dispatches. Second, 138 + * the levels match as closely as possible the alternate IRQ mapping mode (aka 139 + * "A/UX mode") available on some VIA machines. 131 140 */ 141 + 142 + #define OSS_IRQLEV_IOPISM IRQ_AUTO_1 143 + #define OSS_IRQLEV_SCSI IRQ_AUTO_2 144 + #define OSS_IRQLEV_NUBUS IRQ_AUTO_3 145 + #define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 146 + #define OSS_IRQLEV_VIA1 IRQ_AUTO_6 132 147 133 148 void __init oss_register_interrupts(void) 134 149 { 135 - irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); 136 - irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); 137 - irq_set_chained_handler(OSS_IRQLEV_SOUND, oss_irq); 138 - irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq); 150 + irq_set_chained_handler(OSS_IRQLEV_IOPISM, oss_irq); 151 + irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); 152 + irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); 153 + irq_set_chained_handler(OSS_IRQLEV_IOPSCC, oss_irq); 154 + irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq); 155 + 156 + /* OSS_VIA1 gets enabled here because it has no machspec interrupt. */ 157 + oss->irq_level[OSS_VIA1] = IRQ_AUTO_6; 139 158 } 140 159 141 160 /* ··· 169 158 switch(irq) { 170 159 case IRQ_MAC_SCC: 171 160 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; 172 - break; 161 + return; 173 162 case IRQ_MAC_ADB: 174 163 oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM; 175 - break; 164 + return; 176 165 case IRQ_MAC_SCSI: 177 166 oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; 178 - break; 167 + return; 179 168 case IRQ_NUBUS_9: 180 169 case IRQ_NUBUS_A: 181 170 case IRQ_NUBUS_B: ··· 184 173 case IRQ_NUBUS_E: 185 174 irq -= NUBUS_SOURCE_BASE; 186 175 oss->irq_level[irq] = OSS_IRQLEV_NUBUS; 187 - break; 188 - #ifdef DEBUG_IRQUSE 189 - default: 190 - printk("%s unknown irq %d\n", __func__, irq); 191 - break; 192 - #endif 176 + return; 193 177 } 178 + 179 + if (IRQ_SRC(irq) == 1) 180 + via_irq_enable(irq); 194 181 } 195 182 196 183 /* ··· 204 195 #endif 205 196 switch(irq) { 206 197 case IRQ_MAC_SCC: 207 - oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; 208 - break; 198 + oss->irq_level[OSS_IOPSCC] = 0; 199 + return; 209 200 case IRQ_MAC_ADB: 210 - oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_DISABLED; 211 - break; 201 + oss->irq_level[OSS_IOPISM] = 0; 202 + return; 212 203 case IRQ_MAC_SCSI: 213 - oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED; 214 - break; 204 + oss->irq_level[OSS_SCSI] = 0; 205 + return; 215 206 case IRQ_NUBUS_9: 216 207 case IRQ_NUBUS_A: 217 208 case IRQ_NUBUS_B: ··· 219 210 case IRQ_NUBUS_D: 220 211 case IRQ_NUBUS_E: 221 212 irq -= NUBUS_SOURCE_BASE; 222 - oss->irq_level[irq] = OSS_IRQLEV_DISABLED; 223 - break; 224 - #ifdef DEBUG_IRQUSE 225 - default: 226 - printk("%s unknown irq %d\n", __func__, irq); 227 - break; 228 - #endif 213 + oss->irq_level[irq] = 0; 214 + return; 229 215 } 230 - } 231 216 232 - /* 233 - * Clear an OSS interrupt 234 - * 235 - * Not sure if this works or not but it's the only method I could 236 - * think of based on the contents of the mac_oss structure. 237 - */ 238 - 239 - void oss_irq_clear(int irq) { 240 - /* FIXME: how to do this on OSS? */ 241 - switch(irq) { 242 - case IRQ_MAC_SCC: 243 - oss->irq_pending &= ~OSS_IP_IOPSCC; 244 - break; 245 - case IRQ_MAC_ADB: 246 - oss->irq_pending &= ~OSS_IP_IOPISM; 247 - break; 248 - case IRQ_MAC_SCSI: 249 - oss->irq_pending &= ~OSS_IP_SCSI; 250 - break; 251 - case IRQ_NUBUS_9: 252 - case IRQ_NUBUS_A: 253 - case IRQ_NUBUS_B: 254 - case IRQ_NUBUS_C: 255 - case IRQ_NUBUS_D: 256 - case IRQ_NUBUS_E: 257 - irq -= NUBUS_SOURCE_BASE; 258 - oss->irq_pending &= ~(1 << irq); 259 - break; 260 - } 261 - } 262 - 263 - /* 264 - * Check to see if a specific OSS interrupt is pending 265 - */ 266 - 267 - int oss_irq_pending(int irq) 268 - { 269 - switch(irq) { 270 - case IRQ_MAC_SCC: 271 - return oss->irq_pending & OSS_IP_IOPSCC; 272 - break; 273 - case IRQ_MAC_ADB: 274 - return oss->irq_pending & OSS_IP_IOPISM; 275 - break; 276 - case IRQ_MAC_SCSI: 277 - return oss->irq_pending & OSS_IP_SCSI; 278 - break; 279 - case IRQ_NUBUS_9: 280 - case IRQ_NUBUS_A: 281 - case IRQ_NUBUS_B: 282 - case IRQ_NUBUS_C: 283 - case IRQ_NUBUS_D: 284 - case IRQ_NUBUS_E: 285 - irq -= NUBUS_SOURCE_BASE; 286 - return oss->irq_pending & (1 << irq); 287 - break; 288 - } 289 - return 0; 217 + if (IRQ_SRC(irq) == 1) 218 + via_irq_disable(irq); 290 219 }
-17
arch/m68k/mac/psc.c
··· 180 180 #endif 181 181 psc_write_byte(pIER, 1 << irq_idx); 182 182 } 183 - 184 - void psc_irq_clear(int irq) { 185 - int irq_src = IRQ_SRC(irq); 186 - int irq_idx = IRQ_IDX(irq); 187 - int pIFR = pIERbase + (irq_src << 4); 188 - 189 - psc_write_byte(pIFR, 1 << irq_idx); 190 - } 191 - 192 - int psc_irq_pending(int irq) 193 - { 194 - int irq_src = IRQ_SRC(irq); 195 - int irq_idx = IRQ_IDX(irq); 196 - int pIFR = pIERbase + (irq_src << 4); 197 - 198 - return psc_read_byte(pIFR) & (1 << irq_idx); 199 - }
+122 -133
arch/m68k/mac/via.c
··· 63 63 #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) 64 64 #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) 65 65 66 - /* To disable a NuBus slot on Quadras we make that slot IRQ line an output set 67 - * high. On RBV we just use the slot interrupt enable register. On Macs with 68 - * genuine VIA chips we must use nubus_disabled to keep track of disabled slot 69 - * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 70 - * or "SLOTS" interrupt. When no slot is disabled, we unmask the CA1 interrupt. 71 - * So, on genuine VIAs, having more than one NuBus IRQ can mean trouble, 72 - * because closing one of those drivers can mask all of the NuBus interrupts. 73 - * Also, since we can't mask the unregistered slot IRQs on genuine VIAs, it's 74 - * possible to get interrupts from cards that MacOS or the ROM has configured 75 - * but we have not. FWIW, "Designing Cards and Drivers for Macintosh II and 76 - * Macintosh SE", page 9-8, says, a slot IRQ with no driver would crash MacOS. 66 + 67 + /* 68 + * On Macs with a genuine VIA chip there is no way to mask an individual slot 69 + * interrupt. This limitation also seems to apply to VIA clone logic cores in 70 + * Quadra-like ASICs. (RBV and OSS machines don't have this limitation.) 71 + * 72 + * We used to fake it by configuring the relevent VIA pin as an output 73 + * (to mask the interrupt) or input (to unmask). That scheme did not work on 74 + * (at least) the Quadra 700. A NuBus card's /NMRQ signal is an open-collector 75 + * circuit (see Designing Cards and Drivers for Macintosh II and Macintosh SE, 76 + * p. 10-11 etc) but VIA outputs are not (see datasheet). 77 + * 78 + * Driving these outputs high must cause the VIA to source current and the 79 + * card to sink current when it asserts /NMRQ. Current will flow but the pin 80 + * voltage is uncertain and so the /NMRQ condition may still cause a transition 81 + * at the VIA2 CA1 input (which explains the lost interrupts). A side effect 82 + * is that a disabled slot IRQ can never be tested as pending or not. 83 + * 84 + * Driving these outputs low doesn't work either. All the slot /NMRQ lines are 85 + * (active low) OR'd together to generate the CA1 (aka "SLOTS") interrupt (see 86 + * The Guide To Macintosh Family Hardware, 2nd edition p. 167). If we drive a 87 + * disabled /NMRQ line low, the falling edge immediately triggers a CA1 88 + * interrupt and all slot interrupts after that will generate no transition 89 + * and therefore no interrupt, even after being re-enabled. 90 + * 91 + * So we make the VIA port A I/O lines inputs and use nubus_disabled to keep 92 + * track of their states. When any slot IRQ becomes disabled we mask the CA1 93 + * umbrella interrupt. Only when all slot IRQs become enabled do we unmask 94 + * the CA1 interrupt. It must remain enabled even when cards have no interrupt 95 + * handler registered. Drivers must therefore disable a slot interrupt at the 96 + * device before they call free_irq (like shared and autovector interrupts). 97 + * 98 + * There is also a related problem when MacOS is used to boot Linux. A network 99 + * card brought up by a MacOS driver may raise an interrupt while Linux boots. 100 + * This can be fatal since it can't be handled until the right driver loads 101 + * (if such a driver exists at all). Apparently related to this hardware 102 + * limitation, "Designing Cards and Drivers", p. 9-8, says that a slot 103 + * interrupt with no driver would crash MacOS (the book was written before 104 + * the appearance of Macs with RBV or OSS). 77 105 */ 106 + 78 107 static u8 nubus_disabled; 79 108 80 109 void via_debug_dump(void); 81 - void via_irq_enable(int irq); 82 - void via_irq_disable(int irq); 83 - void via_irq_clear(int irq); 84 110 85 111 /* 86 112 * Initialize the VIAs ··· 126 100 127 101 /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */ 128 102 129 - case MAC_VIA_IIci: 103 + case MAC_VIA_IICI: 130 104 via1 = (void *) VIA1_BASE; 131 105 if (macintosh_config->ident == MAC_MODEL_IIFX) { 132 106 via2 = NULL; ··· 223 197 if (oss_present) 224 198 return; 225 199 226 - /* Some machines support an alternate IRQ mapping that spreads */ 227 - /* Ethernet and Sound out to their own autolevel IRQs and moves */ 228 - /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ 229 - /* that the IIfx emulates this alternate mapping using the OSS. */ 230 - 231 - via_alt_mapping = 0; 232 - if (macintosh_config->via_type == MAC_VIA_QUADRA) 233 - switch (macintosh_config->ident) { 234 - case MAC_MODEL_C660: 235 - case MAC_MODEL_Q840: 236 - /* not applicable */ 237 - break; 238 - case MAC_MODEL_P588: 239 - case MAC_MODEL_TV: 240 - case MAC_MODEL_PB140: 241 - case MAC_MODEL_PB145: 242 - case MAC_MODEL_PB160: 243 - case MAC_MODEL_PB165: 244 - case MAC_MODEL_PB165C: 245 - case MAC_MODEL_PB170: 246 - case MAC_MODEL_PB180: 247 - case MAC_MODEL_PB180C: 248 - case MAC_MODEL_PB190: 249 - case MAC_MODEL_PB520: 250 - /* not yet tested */ 251 - break; 252 - default: 253 - via_alt_mapping = 1; 254 - via1[vDirB] |= 0x40; 255 - via1[vBufB] &= ~0x40; 256 - break; 257 - } 200 + if ((macintosh_config->via_type == MAC_VIA_QUADRA) && 201 + (macintosh_config->adb_type != MAC_ADB_PB1) && 202 + (macintosh_config->adb_type != MAC_ADB_PB2) && 203 + (macintosh_config->ident != MAC_MODEL_C660) && 204 + (macintosh_config->ident != MAC_MODEL_Q840)) { 205 + via_alt_mapping = 1; 206 + via1[vDirB] |= 0x40; 207 + via1[vBufB] &= ~0x40; 208 + } else { 209 + via_alt_mapping = 0; 210 + } 258 211 259 212 /* 260 213 * Now initialize VIA2. For RBV we just kill all interrupts; ··· 253 248 via2[vACR] &= ~0x03; /* disable port A & B latches */ 254 249 } 255 250 251 + /* Everything below this point is VIA2 only... */ 252 + 253 + if (rbv_present) 254 + return; 255 + 256 256 /* 257 - * Set vPCR for control line interrupts (but not on RBV) 257 + * Set vPCR for control line interrupts. 258 + * 259 + * CA1 (SLOTS IRQ), CB1 (ASC IRQ): negative edge trigger. 260 + * 261 + * Macs with ESP SCSI have a negative edge triggered SCSI interrupt. 262 + * Testing reveals that PowerBooks do too. However, the SE/30 263 + * schematic diagram shows an active high NCR5380 IRQ line. 258 264 */ 259 - if (!rbv_present) { 260 - /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ) 261 - * are made negative edge triggered here. 262 - */ 263 - if (macintosh_config->scsi_type == MAC_SCSI_OLD) { 264 - /* CB2 (IRQ) indep. input, positive edge */ 265 - /* CA2 (DRQ) indep. input, positive edge */ 266 - via2[vPCR] = 0x66; 267 - } else { 268 - /* CB2 (IRQ) indep. input, negative edge */ 269 - /* CA2 (DRQ) indep. input, negative edge */ 270 - via2[vPCR] = 0x22; 271 - } 265 + 266 + pr_debug("VIA2 vPCR is 0x%02X\n", via2[vPCR]); 267 + if (macintosh_config->via_type == MAC_VIA_II) { 268 + /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, pos. edge */ 269 + via2[vPCR] = 0x66; 270 + } else { 271 + /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, neg. edge */ 272 + via2[vPCR] = 0x22; 272 273 } 273 274 } 274 275 ··· 389 378 via2[gBufB] |= 0x02; 390 379 } 391 380 392 - /* Disable all the slot interrupts (where possible). */ 381 + /* 382 + * Disable the slot interrupts. On some hardware that's not possible. 383 + * On some hardware it's unclear what all of these I/O lines do. 384 + */ 393 385 394 386 switch (macintosh_config->via_type) { 395 387 case MAC_VIA_II: 396 - /* Just make the port A lines inputs. */ 397 - switch(macintosh_config->ident) { 398 - case MAC_MODEL_II: 399 - case MAC_MODEL_IIX: 400 - case MAC_MODEL_IICX: 401 - case MAC_MODEL_SE30: 402 - /* The top two bits are RAM size outputs. */ 403 - via2[vDirA] &= 0xC0; 404 - break; 405 - default: 406 - via2[vDirA] &= 0x80; 407 - } 388 + case MAC_VIA_QUADRA: 389 + pr_debug("VIA2 vDirA is 0x%02X\n", via2[vDirA]); 408 390 break; 409 - case MAC_VIA_IIci: 391 + case MAC_VIA_IICI: 410 392 /* RBV. Disable all the slot interrupts. SIER works like IER. */ 411 393 via2[rSIER] = 0x7F; 412 394 break; 395 + } 396 + } 397 + 398 + void via_nubus_irq_startup(int irq) 399 + { 400 + int irq_idx = IRQ_IDX(irq); 401 + 402 + switch (macintosh_config->via_type) { 403 + case MAC_VIA_II: 413 404 case MAC_VIA_QUADRA: 414 - /* Disable the inactive slot interrupts by making those lines outputs. */ 415 - if ((macintosh_config->adb_type != MAC_ADB_PB1) && 416 - (macintosh_config->adb_type != MAC_ADB_PB2)) { 417 - via2[vBufA] |= 0x7F; 418 - via2[vDirA] |= 0x7F; 405 + /* Make the port A line an input. Probably redundant. */ 406 + if (macintosh_config->via_type == MAC_VIA_II) { 407 + /* The top two bits are RAM size outputs. */ 408 + via2[vDirA] &= 0xC0 | ~(1 << irq_idx); 409 + } else { 410 + /* Allow NuBus slots 9 through F. */ 411 + via2[vDirA] &= 0x80 | ~(1 << irq_idx); 419 412 } 413 + /* fall through */ 414 + case MAC_VIA_IICI: 415 + via_irq_enable(irq); 416 + break; 417 + } 418 + } 419 + 420 + void via_nubus_irq_shutdown(int irq) 421 + { 422 + switch (macintosh_config->via_type) { 423 + case MAC_VIA_II: 424 + case MAC_VIA_QUADRA: 425 + /* Ensure that the umbrella CA1 interrupt remains enabled. */ 426 + via_irq_enable(irq); 427 + break; 428 + case MAC_VIA_IICI: 429 + via_irq_disable(irq); 420 430 break; 421 431 } 422 432 } ··· 563 531 } else if (irq_src == 7) { 564 532 switch (macintosh_config->via_type) { 565 533 case MAC_VIA_II: 534 + case MAC_VIA_QUADRA: 566 535 nubus_disabled &= ~(1 << irq_idx); 567 536 /* Enable the CA1 interrupt when no slot is disabled. */ 568 537 if (!nubus_disabled) 569 538 via2[gIER] = IER_SET_BIT(1); 570 539 break; 571 - case MAC_VIA_IIci: 540 + case MAC_VIA_IICI: 572 541 /* On RBV, enable the slot interrupt. 573 542 * SIER works like IER. 574 543 */ 575 544 via2[rSIER] = IER_SET_BIT(irq_idx); 576 - break; 577 - case MAC_VIA_QUADRA: 578 - /* Make the port A line an input to enable the slot irq. 579 - * But not on PowerBooks, that's ADB. 580 - */ 581 - if ((macintosh_config->adb_type != MAC_ADB_PB1) && 582 - (macintosh_config->adb_type != MAC_ADB_PB2)) 583 - via2[vDirA] &= ~(1 << irq_idx); 584 545 break; 585 546 } 586 547 } ··· 594 569 } else if (irq_src == 7) { 595 570 switch (macintosh_config->via_type) { 596 571 case MAC_VIA_II: 572 + case MAC_VIA_QUADRA: 597 573 nubus_disabled |= 1 << irq_idx; 598 574 if (nubus_disabled) 599 575 via2[gIER] = IER_CLR_BIT(1); 600 576 break; 601 - case MAC_VIA_IIci: 577 + case MAC_VIA_IICI: 602 578 via2[rSIER] = IER_CLR_BIT(irq_idx); 603 - break; 604 - case MAC_VIA_QUADRA: 605 - if ((macintosh_config->adb_type != MAC_ADB_PB1) && 606 - (macintosh_config->adb_type != MAC_ADB_PB2)) 607 - via2[vDirA] |= 1 << irq_idx; 608 579 break; 609 580 } 610 581 } 611 - } 612 - 613 - void via_irq_clear(int irq) { 614 - int irq_src = IRQ_SRC(irq); 615 - int irq_idx = IRQ_IDX(irq); 616 - int irq_bit = 1 << irq_idx; 617 - 618 - if (irq_src == 1) { 619 - via1[vIFR] = irq_bit; 620 - } else if (irq_src == 2) { 621 - via2[gIFR] = irq_bit | rbv_clear; 622 - } else if (irq_src == 7) { 623 - /* FIXME: There is no way to clear an individual nubus slot 624 - * IRQ flag, other than getting the device to do it. 625 - */ 626 - } 627 - } 628 - 629 - /* 630 - * Returns nonzero if an interrupt is pending on the given 631 - * VIA/IRQ combination. 632 - */ 633 - 634 - int via_irq_pending(int irq) 635 - { 636 - int irq_src = IRQ_SRC(irq); 637 - int irq_idx = IRQ_IDX(irq); 638 - int irq_bit = 1 << irq_idx; 639 - 640 - if (irq_src == 1) { 641 - return via1[vIFR] & irq_bit; 642 - } else if (irq_src == 2) { 643 - return via2[gIFR] & irq_bit; 644 - } else if (irq_src == 7) { 645 - /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */ 646 - return ~via2[gBufA] & irq_bit; 647 - } 648 - return 0; 649 582 } 650 583 651 584 void via1_set_head(int head) ··· 614 631 via1[vBufA] |= VIA1A_vHeadSel; 615 632 } 616 633 EXPORT_SYMBOL(via1_set_head); 634 + 635 + int via2_scsi_drq_pending(void) 636 + { 637 + return via2[gIFR] & (1 << IRQ_IDX(IRQ_MAC_SCSIDRQ)); 638 + } 639 + EXPORT_SYMBOL(via2_scsi_drq_pending);
+160
arch/m68k/mvme16x/config.c
··· 124 124 #define PccSCCMICR 0x1d 125 125 #define PccSCCTICR 0x1e 126 126 #define PccSCCRICR 0x1f 127 + #define PccTPIACKR 0x25 128 + 129 + #ifdef CONFIG_EARLY_PRINTK 130 + 131 + /**** cd2401 registers ****/ 132 + #define CD2401_ADDR (0xfff45000) 133 + 134 + #define CyGFRCR (0x81) 135 + #define CyCCR (0x13) 136 + #define CyCLR_CHAN (0x40) 137 + #define CyINIT_CHAN (0x20) 138 + #define CyCHIP_RESET (0x10) 139 + #define CyENB_XMTR (0x08) 140 + #define CyDIS_XMTR (0x04) 141 + #define CyENB_RCVR (0x02) 142 + #define CyDIS_RCVR (0x01) 143 + #define CyCAR (0xee) 144 + #define CyIER (0x11) 145 + #define CyMdmCh (0x80) 146 + #define CyRxExc (0x20) 147 + #define CyRxData (0x08) 148 + #define CyTxMpty (0x02) 149 + #define CyTxRdy (0x01) 150 + #define CyLICR (0x26) 151 + #define CyRISR (0x89) 152 + #define CyTIMEOUT (0x80) 153 + #define CySPECHAR (0x70) 154 + #define CyOVERRUN (0x08) 155 + #define CyPARITY (0x04) 156 + #define CyFRAME (0x02) 157 + #define CyBREAK (0x01) 158 + #define CyREOIR (0x84) 159 + #define CyTEOIR (0x85) 160 + #define CyMEOIR (0x86) 161 + #define CyNOTRANS (0x08) 162 + #define CyRFOC (0x30) 163 + #define CyRDR (0xf8) 164 + #define CyTDR (0xf8) 165 + #define CyMISR (0x8b) 166 + #define CyRISR (0x89) 167 + #define CyTISR (0x8a) 168 + #define CyMSVR1 (0xde) 169 + #define CyMSVR2 (0xdf) 170 + #define CyDSR (0x80) 171 + #define CyDCD (0x40) 172 + #define CyCTS (0x20) 173 + #define CyDTR (0x02) 174 + #define CyRTS (0x01) 175 + #define CyRTPRL (0x25) 176 + #define CyRTPRH (0x24) 177 + #define CyCOR1 (0x10) 178 + #define CyPARITY_NONE (0x00) 179 + #define CyPARITY_E (0x40) 180 + #define CyPARITY_O (0xC0) 181 + #define Cy_5_BITS (0x04) 182 + #define Cy_6_BITS (0x05) 183 + #define Cy_7_BITS (0x06) 184 + #define Cy_8_BITS (0x07) 185 + #define CyCOR2 (0x17) 186 + #define CyETC (0x20) 187 + #define CyCtsAE (0x02) 188 + #define CyCOR3 (0x16) 189 + #define Cy_1_STOP (0x02) 190 + #define Cy_2_STOP (0x04) 191 + #define CyCOR4 (0x15) 192 + #define CyREC_FIFO (0x0F) /* Receive FIFO threshold */ 193 + #define CyCOR5 (0x14) 194 + #define CyCOR6 (0x18) 195 + #define CyCOR7 (0x07) 196 + #define CyRBPR (0xcb) 197 + #define CyRCOR (0xc8) 198 + #define CyTBPR (0xc3) 199 + #define CyTCOR (0xc0) 200 + #define CySCHR1 (0x1f) 201 + #define CySCHR2 (0x1e) 202 + #define CyTPR (0xda) 203 + #define CyPILR1 (0xe3) 204 + #define CyPILR2 (0xe0) 205 + #define CyPILR3 (0xe1) 206 + #define CyCMR (0x1b) 207 + #define CyASYNC (0x02) 208 + #define CyLICR (0x26) 209 + #define CyLIVR (0x09) 210 + #define CySCRL (0x23) 211 + #define CySCRH (0x22) 212 + #define CyTFTC (0x80) 213 + 214 + static void cons_write(struct console *co, const char *str, unsigned count) 215 + { 216 + volatile unsigned char *base_addr = (u_char *)CD2401_ADDR; 217 + volatile u_char sink; 218 + u_char ier; 219 + int port; 220 + u_char do_lf = 0; 221 + int i = 0; 222 + 223 + /* Ensure transmitter is enabled! */ 224 + 225 + port = 0; 226 + base_addr[CyCAR] = (u_char)port; 227 + while (base_addr[CyCCR]) 228 + ; 229 + base_addr[CyCCR] = CyENB_XMTR; 230 + 231 + ier = base_addr[CyIER]; 232 + base_addr[CyIER] = CyTxMpty; 233 + 234 + while (1) { 235 + if (pcc2chip[PccSCCTICR] & 0x20) 236 + { 237 + /* We have a Tx int. Acknowledge it */ 238 + sink = pcc2chip[PccTPIACKR]; 239 + if ((base_addr[CyLICR] >> 2) == port) { 240 + if (i == count) { 241 + /* Last char of string is now output */ 242 + base_addr[CyTEOIR] = CyNOTRANS; 243 + break; 244 + } 245 + if (do_lf) { 246 + base_addr[CyTDR] = '\n'; 247 + str++; 248 + i++; 249 + do_lf = 0; 250 + } 251 + else if (*str == '\n') { 252 + base_addr[CyTDR] = '\r'; 253 + do_lf = 1; 254 + } 255 + else { 256 + base_addr[CyTDR] = *str++; 257 + i++; 258 + } 259 + base_addr[CyTEOIR] = 0; 260 + } 261 + else 262 + base_addr[CyTEOIR] = CyNOTRANS; 263 + } 264 + } 265 + 266 + base_addr[CyIER] = ier; 267 + } 268 + 269 + static struct console cons_info = 270 + { 271 + .name = "sercon", 272 + .write = cons_write, 273 + .flags = CON_PRINTBUFFER | CON_BOOT, 274 + .index = -1, 275 + }; 276 + 277 + static void __init mvme16x_early_console(void) 278 + { 279 + register_console(&cons_info); 280 + 281 + printk(KERN_INFO "MVME16x: early console registered\n"); 282 + } 283 + #endif 127 284 128 285 void __init config_mvme16x(void) 129 286 { ··· 340 183 pcc2chip[PccSCCMICR] = 0x10; 341 184 pcc2chip[PccSCCTICR] = 0x10; 342 185 pcc2chip[PccSCCRICR] = 0x10; 186 + #ifdef CONFIG_EARLY_PRINTK 187 + mvme16x_early_console(); 188 + #endif 343 189 } 344 190 } 345 191
-1
drivers/block/swim.c
··· 26 26 #include <linux/delay.h> 27 27 #include <linux/platform_device.h> 28 28 29 - #include <asm/macintosh.h> 30 29 #include <asm/mac_via.h> 31 30 32 31 #define CARDNAME "swim"
+3 -4
drivers/net/ethernet/natsemi/macsonic.c
··· 142 142 { 143 143 int retval; 144 144 145 - retval = request_irq(dev->irq, sonic_interrupt, IRQ_FLG_FAST, 146 - "sonic", dev); 145 + retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev); 147 146 if (retval) { 148 147 printk(KERN_ERR "%s: unable to get IRQ %d.\n", 149 148 dev->name, dev->irq); ··· 153 154 * rupt as well, which must prevent re-entrance of the sonic handler. 154 155 */ 155 156 if (dev->irq == IRQ_AUTO_3) { 156 - retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, 157 - IRQ_FLG_FAST, "sonic", dev); 157 + retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, 0, 158 + "sonic", dev); 158 159 if (retval) { 159 160 printk(KERN_ERR "%s: unable to get IRQ %d.\n", 160 161 dev->name, IRQ_NUBUS_9);
+2 -1
drivers/scsi/mac_esp.c
··· 25 25 #include <asm/dma.h> 26 26 #include <asm/macints.h> 27 27 #include <asm/macintosh.h> 28 + #include <asm/mac_via.h> 28 29 29 30 #include <scsi/scsi_host.h> 30 31 ··· 150 149 151 150 do { 152 151 if (mep->pdma_regs == NULL) { 153 - if (mac_irq_pending(IRQ_MAC_SCSIDRQ)) 152 + if (via2_scsi_drq_pending()) 154 153 return 0; 155 154 } else { 156 155 if (nubus_readl(mep->pdma_regs) & 0x200)