From f8bd9de913fc004705002f7bd6e840b1c685b188 Mon Sep 17 00:00:00 2001 From: Kars de Jong Date: Tue, 18 Nov 2008 21:22:22 +0100 Subject: m68k/serial: SERIAL_PORT_DFNS only if CONFIG_ISA Only define SERIAL_PORT_DFNS when CONFIG_ISA is defined. Otherwise the first 4 slots in the 8250 driver are unavailable on non-ISA machines. Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/serial.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/include/asm/serial.h b/arch/m68k/include/asm/serial.h index 2b90d6e69070..7267536adbcc 100644 --- a/arch/m68k/include/asm/serial.h +++ b/arch/m68k/include/asm/serial.h @@ -25,9 +25,11 @@ #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF #endif +#ifdef CONFIG_ISA #define SERIAL_PORT_DFNS \ /* UART CLK PORT IRQ FLAGS */ \ { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ +#endif -- cgit v1.2.3-59-g8ed1b From f9994894953d6bd9d5ed2719a34d027a4e0c2131 Mon Sep 17 00:00:00 2001 From: Kars de Jong Date: Thu, 20 Nov 2008 13:47:18 +0100 Subject: m68k/mvme16x: Add support for EARLY_PRINTK Added support for EARLY_PRINTK when running on an MVME16x board. Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig.debug | 11 ++++ arch/m68k/mvme16x/config.c | 160 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+) diff --git a/arch/m68k/Kconfig.debug b/arch/m68k/Kconfig.debug index 2bdb1b01115c..8702dc65f7f2 100644 --- a/arch/m68k/Kconfig.debug +++ b/arch/m68k/Kconfig.debug @@ -2,6 +2,17 @@ menu "Kernel hacking" source "lib/Kconfig.debug" +config EARLY_PRINTK + bool "Early printk" if EMBEDDED + depends on MVME16x + default y + help + Write kernel log output directly to a serial port. + + This is useful for kernel debugging when your machine crashes very + early before the console code is initialized. + You should normally say N here, unless you want to debug such a crash. + if !MMU config FULLDEBUG diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 31a66d99cbca..c3fb3bdd7ed9 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -124,6 +124,163 @@ static void __init mvme16x_init_IRQ (void) #define PccSCCMICR 0x1d #define PccSCCTICR 0x1e #define PccSCCRICR 0x1f +#define PccTPIACKR 0x25 + +#ifdef CONFIG_EARLY_PRINTK + +/**** cd2401 registers ****/ +#define CD2401_ADDR (0xfff45000) + +#define CyGFRCR (0x81) +#define CyCCR (0x13) +#define CyCLR_CHAN (0x40) +#define CyINIT_CHAN (0x20) +#define CyCHIP_RESET (0x10) +#define CyENB_XMTR (0x08) +#define CyDIS_XMTR (0x04) +#define CyENB_RCVR (0x02) +#define CyDIS_RCVR (0x01) +#define CyCAR (0xee) +#define CyIER (0x11) +#define CyMdmCh (0x80) +#define CyRxExc (0x20) +#define CyRxData (0x08) +#define CyTxMpty (0x02) +#define CyTxRdy (0x01) +#define CyLICR (0x26) +#define CyRISR (0x89) +#define CyTIMEOUT (0x80) +#define CySPECHAR (0x70) +#define CyOVERRUN (0x08) +#define CyPARITY (0x04) +#define CyFRAME (0x02) +#define CyBREAK (0x01) +#define CyREOIR (0x84) +#define CyTEOIR (0x85) +#define CyMEOIR (0x86) +#define CyNOTRANS (0x08) +#define CyRFOC (0x30) +#define CyRDR (0xf8) +#define CyTDR (0xf8) +#define CyMISR (0x8b) +#define CyRISR (0x89) +#define CyTISR (0x8a) +#define CyMSVR1 (0xde) +#define CyMSVR2 (0xdf) +#define CyDSR (0x80) +#define CyDCD (0x40) +#define CyCTS (0x20) +#define CyDTR (0x02) +#define CyRTS (0x01) +#define CyRTPRL (0x25) +#define CyRTPRH (0x24) +#define CyCOR1 (0x10) +#define CyPARITY_NONE (0x00) +#define CyPARITY_E (0x40) +#define CyPARITY_O (0xC0) +#define Cy_5_BITS (0x04) +#define Cy_6_BITS (0x05) +#define Cy_7_BITS (0x06) +#define Cy_8_BITS (0x07) +#define CyCOR2 (0x17) +#define CyETC (0x20) +#define CyCtsAE (0x02) +#define CyCOR3 (0x16) +#define Cy_1_STOP (0x02) +#define Cy_2_STOP (0x04) +#define CyCOR4 (0x15) +#define CyREC_FIFO (0x0F) /* Receive FIFO threshold */ +#define CyCOR5 (0x14) +#define CyCOR6 (0x18) +#define CyCOR7 (0x07) +#define CyRBPR (0xcb) +#define CyRCOR (0xc8) +#define CyTBPR (0xc3) +#define CyTCOR (0xc0) +#define CySCHR1 (0x1f) +#define CySCHR2 (0x1e) +#define CyTPR (0xda) +#define CyPILR1 (0xe3) +#define CyPILR2 (0xe0) +#define CyPILR3 (0xe1) +#define CyCMR (0x1b) +#define CyASYNC (0x02) +#define CyLICR (0x26) +#define CyLIVR (0x09) +#define CySCRL (0x23) +#define CySCRH (0x22) +#define CyTFTC (0x80) + +static void cons_write(struct console *co, const char *str, unsigned count) +{ + volatile unsigned char *base_addr = (u_char *)CD2401_ADDR; + volatile u_char sink; + u_char ier; + int port; + u_char do_lf = 0; + int i = 0; + + /* Ensure transmitter is enabled! */ + + port = 0; + base_addr[CyCAR] = (u_char)port; + while (base_addr[CyCCR]) + ; + base_addr[CyCCR] = CyENB_XMTR; + + ier = base_addr[CyIER]; + base_addr[CyIER] = CyTxMpty; + + while (1) { + if (pcc2chip[PccSCCTICR] & 0x20) + { + /* We have a Tx int. Acknowledge it */ + sink = pcc2chip[PccTPIACKR]; + if ((base_addr[CyLICR] >> 2) == port) { + if (i == count) { + /* Last char of string is now output */ + base_addr[CyTEOIR] = CyNOTRANS; + break; + } + if (do_lf) { + base_addr[CyTDR] = '\n'; + str++; + i++; + do_lf = 0; + } + else if (*str == '\n') { + base_addr[CyTDR] = '\r'; + do_lf = 1; + } + else { + base_addr[CyTDR] = *str++; + i++; + } + base_addr[CyTEOIR] = 0; + } + else + base_addr[CyTEOIR] = CyNOTRANS; + } + } + + base_addr[CyIER] = ier; +} + +static struct console cons_info = +{ + .name = "sercon", + .write = cons_write, + .flags = CON_PRINTBUFFER | CON_BOOT, + .index = -1, +}; + +static void __init mvme16x_early_console(void) +{ + register_console(&cons_info); + + printk(KERN_INFO "MVME16x: early console registered\n"); +} +#endif void __init config_mvme16x(void) { @@ -183,6 +340,9 @@ void __init config_mvme16x(void) pcc2chip[PccSCCMICR] = 0x10; pcc2chip[PccSCCTICR] = 0x10; pcc2chip[PccSCCRICR] = 0x10; +#ifdef CONFIG_EARLY_PRINTK + mvme16x_early_console(); +#endif } } -- cgit v1.2.3-59-g8ed1b From 93edd023a7de1ea4fe6e5de631982b96156eef03 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:12 +1100 Subject: m68k/mac: early console Revive the old mac_serial_print() routine as mac_early_print(). mac_serial_print() did not function because it did not use the right offsets for its stack arguments. Fix this and make compilation conditional on CONFIG_EARLY_PRINTK instead of the obscure MAC_SERIAL_DEBUG macro. Give mac_early_print() a new string length parameter to fit the early console API. Send output to the framebuffer as well as serial ports. Change the line rate to 38400 baud to match the default for the real (pmac_zilog) serial console. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig.debug | 2 +- arch/m68k/kernel/head.S | 117 ++++++++++++++++++++++++------------------------ arch/m68k/mac/config.c | 29 ++++++++++++ 3 files changed, 89 insertions(+), 59 deletions(-) diff --git a/arch/m68k/Kconfig.debug b/arch/m68k/Kconfig.debug index 8702dc65f7f2..a0c8863bd08b 100644 --- a/arch/m68k/Kconfig.debug +++ b/arch/m68k/Kconfig.debug @@ -4,7 +4,7 @@ source "lib/Kconfig.debug" config EARLY_PRINTK bool "Early printk" if EMBEDDED - depends on MVME16x + depends on MVME16x || MAC default y help Write kernel log output directly to a serial port. diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 27622b3273c1..d197e7ff62c5 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -250,9 +250,8 @@ * USE_MFP: Use the ST-MFP port (Modem1) for serial debug. * * Macintosh constants: - * MAC_SERIAL_DEBUG: Turns on serial debug output for the Macintosh. - * MAC_USE_SCC_A: Use the SCC port A (modem) for serial debug. - * MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default). + * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console. + * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console. */ #include @@ -268,33 +267,25 @@ #include -/* - * Macintosh console support - */ - #ifdef CONFIG_FRAMEBUFFER_CONSOLE #define CONSOLE #define CONSOLE_PENGUIN #endif -/* - * Macintosh serial debug support; outputs boot info to the printer - * and/or modem serial ports - */ -#undef MAC_SERIAL_DEBUG +#ifdef CONFIG_EARLY_PRINTK +#define SERIAL_DEBUG +#else +#undef SERIAL_DEBUG +#endif -/* - * Macintosh serial debug port selection; define one or both; - * requires MAC_SERIAL_DEBUG to be defined - */ -#define MAC_USE_SCC_A /* Macintosh modem serial port */ -#define MAC_USE_SCC_B /* Macintosh printer serial port */ +#else /* !CONFIG_MAC */ -#endif /* CONFIG_MAC */ +#define SERIAL_DEBUG + +#endif /* !CONFIG_MAC */ #undef MMU_PRINT #undef MMU_NOCACHE_KERNEL -#define SERIAL_DEBUG #undef DEBUG /* @@ -655,11 +646,11 @@ ENTRY(__start) lea %pc@(L(mac_rowbytes)),%a1 movel %a0@,%a1@ -#ifdef MAC_SERIAL_DEBUG +#ifdef SERIAL_DEBUG get_bi_record BI_MAC_SCCBASE lea %pc@(L(mac_sccbase)),%a1 movel %a0@,%a1@ -#endif /* MAC_SERIAL_DEBUG */ +#endif #if 0 /* @@ -1427,7 +1418,7 @@ L(mmu_fixup_done): subl %d0,L(console_font) subl %d0,L(console_font_data) #endif -#ifdef MAC_SERIAL_DEBUG +#ifdef SERIAL_DEBUG orl #0x50000000,L(mac_sccbase) #endif 1: @@ -1917,7 +1908,7 @@ mmu_030_print: jbne 30b mmu_print_done: - puts "\n\n" + puts "\n" func_return mmu_print @@ -2768,7 +2759,7 @@ L(scc_initable_mac): .byte 9,0 /* no interrupts */ .byte 10,0 /* NRZ */ .byte 11,0x50 /* use baud rate generator */ - .byte 12,10,13,0 /* 9600 baud */ + .byte 12,1,13,0 /* 38400 baud */ .byte 14,1 /* Baud rate generator enable */ .byte 3,0xc1 /* enable receiver */ .byte 5,0xea /* enable transmitter */ @@ -2906,10 +2897,12 @@ func_start serial_init,%d0/%d1/%a0/%a1 #endif #ifdef CONFIG_MAC is_not_mac(L(serial_init_not_mac)) -#ifdef MAC_SERIAL_DEBUG -#if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B) -#define MAC_USE_SCC_B -#endif + +#ifdef SERIAL_DEBUG +/* You may define either or both of these. */ +#define MAC_USE_SCC_A /* Modem port */ +#define MAC_USE_SCC_B /* Printer port */ + #define mac_scc_cha_b_ctrl_offset 0x0 #define mac_scc_cha_a_ctrl_offset 0x2 #define mac_scc_cha_b_data_offset 0x4 @@ -2940,7 +2933,7 @@ func_start serial_init,%d0/%d1/%a0/%a1 jra 7b 8: #endif /* MAC_USE_SCC_B */ -#endif /* MAC_SERIAL_DEBUG */ +#endif /* SERIAL_DEBUG */ jra L(serial_init_done) L(serial_init_not_mac): @@ -3011,7 +3004,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 #ifdef CONFIG_MAC is_not_mac(5f) -#ifdef MAC_SERIAL_DEBUG +#ifdef SERIAL_DEBUG #ifdef MAC_USE_SCC_A movel %pc@(L(mac_sccbase)),%a1 @@ -3029,7 +3022,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 moveb %d0,%a1@(mac_scc_cha_b_data_offset) #endif /* MAC_USE_SCC_B */ -#endif /* MAC_SERIAL_DEBUG */ +#endif /* SERIAL_DEBUG */ jra L(serial_putc_done) 5: @@ -3248,33 +3241,39 @@ func_return putn #ifdef CONFIG_MAC /* - * mac_serial_print + * mac_early_print * * This routine takes its parameters on the stack. It then - * turns around and calls the internal routine. This routine - * is used until the Linux console driver initializes itself. + * turns around and calls the internal routines. This routine + * is used by the boot console. * * The calling parameters are: - * void mac_serial_print(const char *str); + * void mac_early_print(const char *str, unsigned length); * * This routine does NOT understand variable arguments only * simple strings! */ -ENTRY(mac_serial_print) - moveml %d0/%a0,%sp@- -#if 1 - move %sr,%sp@- +ENTRY(mac_early_print) + moveml %d0/%d1/%a0,%sp@- + movew %sr,%sp@- ori #0x0700,%sr -#endif - movel %sp@(10),%a0 /* fetch parameter */ + movel %sp@(18),%a0 /* fetch parameter */ + movel %sp@(22),%d1 /* fetch parameter */ jra 2f -1: serial_putc %d0 -2: moveb %a0@+,%d0 - jne 1b -#if 1 - move %sp@+,%sr +1: +#ifdef CONSOLE + console_putc %d0 #endif - moveml %sp@+,%d0/%a0 +#ifdef SERIAL_DEBUG + serial_putc %d0 +#endif + subq #1,%d1 +2: jeq 3f + moveb %a0@+,%d0 + jne 1b +3: + movew %sp@+,%sr + moveml %sp@+,%d0/%d1/%a0 rts #endif /* CONFIG_MAC */ @@ -3409,10 +3408,10 @@ func_start console_put_stats,%a0/%d7 * a0 = pointer to boot_info * d7 = value of boot_info fields */ - puts "\nMacLinux\n\n" + puts "\nMacLinux\n" #ifdef SERIAL_DEBUG - puts " vidaddr:" + puts "\n vidaddr:" putn %pc@(L(mac_videobase)) /* video addr. */ puts "\n _stext:" @@ -3423,19 +3422,21 @@ func_start console_put_stats,%a0/%d7 lea %pc@(_end),%a0 putn %a0 - puts "\ncpuid:" + puts "\n cpuid:" putn %pc@(L(cputype)) - putc '\n' -#ifdef MAC_SERIAL_DEBUG +# ifdef CONFIG_MAC + puts "\n sccbase:" putn %pc@(L(mac_sccbase)) +# endif +# ifdef MMU_PRINT putc '\n' -#endif -# if defined(MMU_PRINT) jbsr mmu_print_machine_cpu_types -# endif /* MMU_PRINT */ +# endif #endif /* SERIAL_DEBUG */ + putc '\n' + func_return console_put_stats #ifdef CONSOLE_PENGUIN @@ -3896,11 +3897,11 @@ L(mac_dimensions): .long 0 L(mac_rowbytes): .long 0 -#ifdef MAC_SERIAL_DEBUG +#ifdef SERIAL_DEBUG L(mac_sccbase): .long 0 -#endif /* MAC_SERIAL_DEBUG */ #endif +#endif /* CONFIG_MAC */ #if defined (CONFIG_APOLLO) LSRB0 = 0x10412 diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index c247de02bc7e..55db101dd36d 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -71,6 +71,31 @@ static void mac_get_model(char *str); static void mac_identify(void); static void mac_report_hardware(void); +#ifdef CONFIG_EARLY_PRINTK +asmlinkage void __init mac_early_print(const char *s, unsigned n); + +static void __init mac_early_cons_write(struct console *con, + const char *s, unsigned n) +{ + mac_early_print(s, n); +} + +static struct console __initdata mac_early_cons = { + .name = "early", + .write = mac_early_cons_write, + .flags = CON_PRINTBUFFER | CON_BOOT, + .index = -1 +}; + +int __init mac_unregister_early_cons(void) +{ + /* mac_early_print can't be used after init sections are discarded */ + return unregister_console(&mac_early_cons); +} + +late_initcall(mac_unregister_early_cons); +#endif + static void __init mac_sched_init(irq_handler_t vector) { via_init_clock(vector); @@ -164,6 +189,10 @@ void __init config_mac(void) mach_beep = mac_mksound; #endif +#ifdef CONFIG_EARLY_PRINTK + register_console(&mac_early_cons); +#endif + /* * Determine hardware present */ -- cgit v1.2.3-59-g8ed1b From 56e63689fd866a865682fe14dc5a7e1ec3b2c3ad Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:13 +1100 Subject: m68k/mac: cleanup mac_clear_irq mac_clear_irq() is dead code and has been dead for as long as I can recall. On certain Mac models, certain irqs can't be cleared this way. Outside of irq dispatch, this code appears be unusable without busy loops or worse, and for irq dispatch we duplicate the same logic. Remove mac_clear_irq() and supporting code. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/baboon.c | 7 ------- arch/m68k/mac/macints.c | 33 --------------------------------- arch/m68k/mac/oss.c | 31 ------------------------------- arch/m68k/mac/psc.c | 8 -------- arch/m68k/mac/via.c | 16 ---------------- 5 files changed, 95 deletions(-) diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index b403924a1cad..b51ebaa54141 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -124,13 +124,6 @@ void baboon_irq_disable(int irq) mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); } -void baboon_irq_clear(int irq) -{ - int irq_idx = IRQ_IDX(irq); - - baboon->mb_ifr &= ~(1 << irq_idx); -} - int baboon_irq_pending(int irq) { int irq_idx = IRQ_IDX(irq); diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index ba220b70ab8c..8fdd990e04ba 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -239,7 +239,6 @@ void __init mac_init_IRQ(void) /* * mac_irq_enable - enable an interrupt source * mac_irq_disable - disable an interrupt source - * mac_clear_irq - clears a pending interrupt * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending) * * These routines are just dispatchers to the VIA/OSS/PSC routines. @@ -315,38 +314,6 @@ void mac_irq_disable(struct irq_data *data) } } -void mac_clear_irq(unsigned int irq) -{ - switch(IRQ_SRC(irq)) { - case 1: - via_irq_clear(irq); - break; - case 2: - case 7: - if (oss_present) - oss_irq_clear(irq); - else - via_irq_clear(irq); - break; - case 3: - case 5: - case 6: - if (psc_present) - psc_irq_clear(irq); - else if (oss_present) - oss_irq_clear(irq); - break; - case 4: - if (psc_present) - psc_irq_clear(irq); - break; - case 8: - if (baboon_present) - baboon_irq_clear(irq); - break; - } -} - int mac_irq_pending(unsigned int irq) { switch(IRQ_SRC(irq)) { diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index a4c82dab9ff1..2344af31e836 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -220,37 +220,6 @@ void oss_irq_disable(int irq) { } } -/* - * Clear an OSS interrupt - * - * Not sure if this works or not but it's the only method I could - * think of based on the contents of the mac_oss structure. - */ - -void oss_irq_clear(int irq) { - /* FIXME: how to do this on OSS? */ - switch(irq) { - case IRQ_MAC_SCC: - oss->irq_pending &= ~OSS_IP_IOPSCC; - break; - case IRQ_MAC_ADB: - oss->irq_pending &= ~OSS_IP_IOPISM; - break; - case IRQ_MAC_SCSI: - oss->irq_pending &= ~OSS_IP_SCSI; - break; - case IRQ_NUBUS_9: - case IRQ_NUBUS_A: - case IRQ_NUBUS_B: - case IRQ_NUBUS_C: - case IRQ_NUBUS_D: - case IRQ_NUBUS_E: - irq -= NUBUS_SOURCE_BASE; - oss->irq_pending &= ~(1 << irq); - break; - } -} - /* * Check to see if a specific OSS interrupt is pending */ diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index e6c2d20f328d..8dd71c555e93 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -181,14 +181,6 @@ void psc_irq_disable(int irq) { psc_write_byte(pIER, 1 << irq_idx); } -void psc_irq_clear(int irq) { - int irq_src = IRQ_SRC(irq); - int irq_idx = IRQ_IDX(irq); - int pIFR = pIERbase + (irq_src << 4); - - psc_write_byte(pIFR, 1 << irq_idx); -} - int psc_irq_pending(int irq) { int irq_src = IRQ_SRC(irq); diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index f1600ad26621..1c2bce7506b2 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -585,22 +585,6 @@ void via_irq_disable(int irq) { } } -void via_irq_clear(int irq) { - int irq_src = IRQ_SRC(irq); - int irq_idx = IRQ_IDX(irq); - int irq_bit = 1 << irq_idx; - - if (irq_src == 1) { - via1[vIFR] = irq_bit; - } else if (irq_src == 2) { - via2[gIFR] = irq_bit | rbv_clear; - } else if (irq_src == 7) { - /* FIXME: There is no way to clear an individual nubus slot - * IRQ flag, other than getting the device to do it. - */ - } -} - /* * Returns nonzero if an interrupt is pending on the given * VIA/IRQ combination. -- cgit v1.2.3-59-g8ed1b From 30c0527d15ce4edcde64581e9d062ba9fb08fe16 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:14 +1100 Subject: m68k/mac: cleanup mac_irq_pending mac_irq_pending() has only one caller (mac_esp.c). Nothing tests for Baboon, PSC or OSS pending interrupts. Until that need arises, let's keep it simple and remove all the unused abstraction. Replace it with a routine to check for SCSI DRQ. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/mac_via.h | 2 ++ arch/m68k/include/asm/macintosh.h | 2 +- arch/m68k/mac/baboon.c | 7 ------- arch/m68k/mac/macints.c | 32 -------------------------------- arch/m68k/mac/oss.c | 29 ----------------------------- arch/m68k/mac/psc.c | 9 --------- arch/m68k/mac/via.c | 28 ++++++---------------------- drivers/scsi/mac_esp.c | 3 ++- 8 files changed, 11 insertions(+), 101 deletions(-) diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index a59665e1d41b..3622cf89f831 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h @@ -254,6 +254,8 @@ extern volatile __u8 *via1,*via2; extern int rbv_present,via_alt_mapping; +extern int via2_scsi_drq_pending(void); + static inline int rbv_set_video_bpp(int bpp) { char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h index 12ebe43b008b..e5bf02d3741d 100644 --- a/arch/m68k/include/asm/macintosh.h +++ b/arch/m68k/include/asm/macintosh.h @@ -11,7 +11,7 @@ extern void mac_reset(void); extern void mac_poweroff(void); extern void mac_init_IRQ(void); -extern int mac_irq_pending(unsigned int); + extern void mac_irq_enable(struct irq_data *data); extern void mac_irq_disable(struct irq_data *data); diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index b51ebaa54141..c97429129be3 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -123,10 +123,3 @@ void baboon_irq_disable(int irq) if (baboon_disabled) mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); } - -int baboon_irq_pending(int irq) -{ - int irq_idx = IRQ_IDX(irq); - - return baboon->mb_ifr & (1 << irq_idx); -} diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 8fdd990e04ba..fb6147110b34 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -142,7 +142,6 @@ extern void via_register_interrupts(void); extern void via_irq_enable(int); extern void via_irq_disable(int); extern void via_irq_clear(int); -extern int via_irq_pending(int); /* * OSS hooks @@ -152,7 +151,6 @@ extern void oss_register_interrupts(void); extern void oss_irq_enable(int); extern void oss_irq_disable(int); extern void oss_irq_clear(int); -extern int oss_irq_pending(int); /* * PSC hooks @@ -162,7 +160,6 @@ extern void psc_register_interrupts(void); extern void psc_irq_enable(int); extern void psc_irq_disable(int); extern void psc_irq_clear(int); -extern int psc_irq_pending(int); /* * IOP hooks @@ -239,7 +236,6 @@ void __init mac_init_IRQ(void) /* * mac_irq_enable - enable an interrupt source * mac_irq_disable - disable an interrupt source - * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending) * * These routines are just dispatchers to the VIA/OSS/PSC routines. */ @@ -314,34 +310,6 @@ void mac_irq_disable(struct irq_data *data) } } -int mac_irq_pending(unsigned int irq) -{ - switch(IRQ_SRC(irq)) { - case 1: - return via_irq_pending(irq); - case 2: - case 7: - if (oss_present) - return oss_irq_pending(irq); - else - return via_irq_pending(irq); - case 3: - case 5: - case 6: - if (psc_present) - return psc_irq_pending(irq); - else if (oss_present) - return oss_irq_pending(irq); - break; - case 4: - if (psc_present) - return psc_irq_pending(irq); - break; - } - return 0; -} -EXPORT_SYMBOL(mac_irq_pending); - static int num_debug[8]; irqreturn_t mac_debug_handler(int irq, void *dev_id) diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 2344af31e836..a310197a7c7c 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -219,32 +219,3 @@ void oss_irq_disable(int irq) { #endif } } - -/* - * Check to see if a specific OSS interrupt is pending - */ - -int oss_irq_pending(int irq) -{ - switch(irq) { - case IRQ_MAC_SCC: - return oss->irq_pending & OSS_IP_IOPSCC; - break; - case IRQ_MAC_ADB: - return oss->irq_pending & OSS_IP_IOPISM; - break; - case IRQ_MAC_SCSI: - return oss->irq_pending & OSS_IP_SCSI; - break; - case IRQ_NUBUS_9: - case IRQ_NUBUS_A: - case IRQ_NUBUS_B: - case IRQ_NUBUS_C: - case IRQ_NUBUS_D: - case IRQ_NUBUS_E: - irq -= NUBUS_SOURCE_BASE; - return oss->irq_pending & (1 << irq); - break; - } - return 0; -} diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 8dd71c555e93..6f026fc302fa 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -180,12 +180,3 @@ void psc_irq_disable(int irq) { #endif psc_write_byte(pIER, 1 << irq_idx); } - -int psc_irq_pending(int irq) -{ - int irq_src = IRQ_SRC(irq); - int irq_idx = IRQ_IDX(irq); - int pIFR = pIERbase + (irq_src << 4); - - return psc_read_byte(pIFR) & (1 << irq_idx); -} diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 1c2bce7506b2..105707aa03a2 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -585,28 +585,6 @@ void via_irq_disable(int irq) { } } -/* - * Returns nonzero if an interrupt is pending on the given - * VIA/IRQ combination. - */ - -int via_irq_pending(int irq) -{ - int irq_src = IRQ_SRC(irq); - int irq_idx = IRQ_IDX(irq); - int irq_bit = 1 << irq_idx; - - if (irq_src == 1) { - return via1[vIFR] & irq_bit; - } else if (irq_src == 2) { - return via2[gIFR] & irq_bit; - } else if (irq_src == 7) { - /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */ - return ~via2[gBufA] & irq_bit; - } - return 0; -} - void via1_set_head(int head) { if (head == 0) @@ -615,3 +593,9 @@ void via1_set_head(int head) via1[vBufA] |= VIA1A_vHeadSel; } EXPORT_SYMBOL(via1_set_head); + +int via2_scsi_drq_pending(void) +{ + return via2[gIFR] & (1 << IRQ_IDX(IRQ_MAC_SCSIDRQ)); +} +EXPORT_SYMBOL(via2_scsi_drq_pending); diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c index 590ce1ef2016..4ceeace80453 100644 --- a/drivers/scsi/mac_esp.c +++ b/drivers/scsi/mac_esp.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -149,7 +150,7 @@ static inline int mac_esp_wait_for_dreq(struct esp *esp) do { if (mep->pdma_regs == NULL) { - if (mac_irq_pending(IRQ_MAC_SCSIDRQ)) + if (via2_scsi_drq_pending()) return 0; } else { if (nubus_readl(mep->pdma_regs) & 0x200) -- cgit v1.2.3-59-g8ed1b From ed04c97d5187c2d606a8fee0ec9ba172942ee508 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:15 +1100 Subject: m68k/mac: cleanup forward declarations Move some forward declarations into header files and adjust includes. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/mac_baboon.h | 6 ++++ arch/m68k/include/asm/mac_iop.h | 2 ++ arch/m68k/include/asm/mac_oss.h | 4 +++ arch/m68k/include/asm/mac_psc.h | 4 +++ arch/m68k/include/asm/mac_via.h | 5 ++++ arch/m68k/include/asm/macintosh.h | 6 ---- arch/m68k/mac/baboon.c | 5 ---- arch/m68k/mac/macints.c | 60 ++++---------------------------------- arch/m68k/mac/oss.c | 2 -- arch/m68k/mac/via.c | 3 -- drivers/block/swim.c | 1 - 11 files changed, 27 insertions(+), 71 deletions(-) diff --git a/arch/m68k/include/asm/mac_baboon.h b/arch/m68k/include/asm/mac_baboon.h index c2a042b8c349..a2d32f6589f9 100644 --- a/arch/m68k/include/asm/mac_baboon.h +++ b/arch/m68k/include/asm/mac_baboon.h @@ -29,4 +29,10 @@ struct baboon { */ }; +extern int baboon_present; + +extern void baboon_register_interrupts(void); +extern void baboon_irq_enable(int); +extern void baboon_irq_disable(int); + #endif /* __ASSEMBLY **/ diff --git a/arch/m68k/include/asm/mac_iop.h b/arch/m68k/include/asm/mac_iop.h index a2c7e6fcca38..fde874a01e20 100644 --- a/arch/m68k/include/asm/mac_iop.h +++ b/arch/m68k/include/asm/mac_iop.h @@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16); extern void iop_download_code(uint, __u8 *, uint, __u16); extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16); +extern void iop_register_interrupts(void); + #endif /* __ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/mac_oss.h b/arch/m68k/include/asm/mac_oss.h index 3cf2b6ed685a..3f04a66f0933 100644 --- a/arch/m68k/include/asm/mac_oss.h +++ b/arch/m68k/include/asm/mac_oss.h @@ -91,4 +91,8 @@ struct mac_oss { extern volatile struct mac_oss *oss; extern int oss_present; +extern void oss_register_interrupts(void); +extern void oss_irq_enable(int); +extern void oss_irq_disable(int); + #endif /* __ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/mac_psc.h b/arch/m68k/include/asm/mac_psc.h index 7808bb0b2323..e5c0d71d1543 100644 --- a/arch/m68k/include/asm/mac_psc.h +++ b/arch/m68k/include/asm/mac_psc.h @@ -211,6 +211,10 @@ extern volatile __u8 *psc; extern int psc_present; +extern void psc_register_interrupts(void); +extern void psc_irq_enable(int); +extern void psc_irq_disable(int); + /* * Access functions */ diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index 3622cf89f831..53e831c4097e 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h @@ -254,6 +254,11 @@ extern volatile __u8 *via1,*via2; extern int rbv_present,via_alt_mapping; +extern void via_register_interrupts(void); +extern void via_irq_enable(int); +extern void via_irq_disable(int); +extern void via1_irq(unsigned int irq, struct irq_desc *desc); +extern void via1_set_head(int); extern int via2_scsi_drq_pending(void); static inline int rbv_set_video_bpp(int bpp) diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h index e5bf02d3741d..b02418c45b86 100644 --- a/arch/m68k/include/asm/macintosh.h +++ b/arch/m68k/include/asm/macintosh.h @@ -15,12 +15,6 @@ extern void mac_init_IRQ(void); extern void mac_irq_enable(struct irq_data *data); extern void mac_irq_disable(struct irq_data *data); -/* - * Floppy driver magic hook - probably shouldn't be here - */ - -extern void via1_set_head(int); - /* * Macintosh Table */ diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index c97429129be3..74999685ddad 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -8,13 +8,8 @@ #include #include -#include -#include -#include #include -#include -#include #include #include #include diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index fb6147110b34..6c9ad9bbcc96 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -110,74 +110,26 @@ * */ -#include #include #include #include -#include -#include /* for intr_count */ +#include +#include #include -#include -#include #include -#include -#include #include +#include #include #include +#include +#include +#include #include -#include -#include #include -#include #define SHUTUP_SONIC -/* - * VIA/RBV hooks - */ - -extern void via_register_interrupts(void); -extern void via_irq_enable(int); -extern void via_irq_disable(int); -extern void via_irq_clear(int); - -/* - * OSS hooks - */ - -extern void oss_register_interrupts(void); -extern void oss_irq_enable(int); -extern void oss_irq_disable(int); -extern void oss_irq_clear(int); - -/* - * PSC hooks - */ - -extern void psc_register_interrupts(void); -extern void psc_irq_enable(int); -extern void psc_irq_disable(int); -extern void psc_irq_clear(int); - -/* - * IOP hooks - */ - -extern void iop_register_interrupts(void); - -/* - * Baboon hooks - */ - -extern int baboon_present; - -extern void baboon_register_interrupts(void); -extern void baboon_irq_enable(int); -extern void baboon_irq_disable(int); -extern void baboon_irq_clear(int); - /* * console_loglevel determines NMI handler function */ diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index a310197a7c7c..fdc0f843ff6f 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -30,8 +30,6 @@ int oss_present; volatile struct mac_oss *oss; -extern void via1_irq(unsigned int irq, struct irq_desc *desc); - /* * Initialize the OSS * diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 105707aa03a2..974c3e9ac7f3 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -78,9 +78,6 @@ static int gIER,gIFR,gBufA,gBufB; static u8 nubus_disabled; void via_debug_dump(void); -void via_irq_enable(int irq); -void via_irq_disable(int irq); -void via_irq_clear(int irq); /* * Initialize the VIAs diff --git a/drivers/block/swim.c b/drivers/block/swim.c index fd5adcd55944..6d5a914b9619 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -26,7 +26,6 @@ #include #include -#include #include #define CARDNAME "swim" -- cgit v1.2.3-59-g8ed1b From 8d9f014ad16711d79c8a575f2d3d009d2a16c7b7 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:16 +1100 Subject: m68k/mac: enable via_alt_mapping on performa 580 Enable via_alt_mapping on the Performa 588 and tidy up related documentation. I'm betting that remapped IRQs work just fine on the Performa 580 series since it works on the LC 630 and the logic board part numbers are reputedly the same. And the consensus seems to be that the Mac TV is essentially a Performa 550, not dissimilar to the Performa 520, so set the via_type accordingly. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 2 +- arch/m68k/mac/macints.c | 12 ++++++++++++ arch/m68k/mac/via.c | 43 +++++++++++-------------------------------- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 55db101dd36d..12e564c62957 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -594,7 +594,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_TV, .name = "TV", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_QUADRA, + .via_type = MAC_VIA_IIci, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 6c9ad9bbcc96..41dd164aac27 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -42,6 +42,18 @@ * * 6 - off switch (?) * + * Machines with Quadra-like VIA hardware, except PSC and PMU machines, support + * an alternate interrupt mapping, as used by A/UX. It spreads ethernet and + * sound out to their own autovector IRQs and gives VIA1 a higher priority: + * + * 1 - unused (?) + * + * 3 - on-board SONIC + * + * 5 - Apple Sound Chip (ASC) + * + * 6 - VIA1 + * * For OSS Macintoshes (IIfx only at this point): * * 3 - Nubus interrupt diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 974c3e9ac7f3..642b44615f78 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -194,38 +194,17 @@ void __init via_init(void) if (oss_present) return; - /* Some machines support an alternate IRQ mapping that spreads */ - /* Ethernet and Sound out to their own autolevel IRQs and moves */ - /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ - /* that the IIfx emulates this alternate mapping using the OSS. */ - - via_alt_mapping = 0; - if (macintosh_config->via_type == MAC_VIA_QUADRA) - switch (macintosh_config->ident) { - case MAC_MODEL_C660: - case MAC_MODEL_Q840: - /* not applicable */ - break; - case MAC_MODEL_P588: - case MAC_MODEL_TV: - case MAC_MODEL_PB140: - case MAC_MODEL_PB145: - case MAC_MODEL_PB160: - case MAC_MODEL_PB165: - case MAC_MODEL_PB165C: - case MAC_MODEL_PB170: - case MAC_MODEL_PB180: - case MAC_MODEL_PB180C: - case MAC_MODEL_PB190: - case MAC_MODEL_PB520: - /* not yet tested */ - break; - default: - via_alt_mapping = 1; - via1[vDirB] |= 0x40; - via1[vBufB] &= ~0x40; - break; - } + if ((macintosh_config->via_type == MAC_VIA_QUADRA) && + (macintosh_config->adb_type != MAC_ADB_PB1) && + (macintosh_config->adb_type != MAC_ADB_PB2) && + (macintosh_config->ident != MAC_MODEL_C660) && + (macintosh_config->ident != MAC_MODEL_Q840)) { + via_alt_mapping = 1; + via1[vDirB] |= 0x40; + via1[vBufB] &= ~0x40; + } else { + via_alt_mapping = 0; + } /* * Now initialize VIA2. For RBV we just kill all interrupts; -- cgit v1.2.3-59-g8ed1b From c4af5da7f24ff1bf60db2d6ff3e9d9bd912ca47a Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:17 +1100 Subject: m68k/mac: fix nubus slot irq disable and shutdown Improve NuBus slot interrupt handling code and documentation. This patch fixes the NuBus NIC (mac8390) in my Quadra 700. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/mac_via.h | 2 + arch/m68k/mac/macints.c | 27 +++++++++ arch/m68k/mac/via.c | 123 ++++++++++++++++++++++++++-------------- 3 files changed, 110 insertions(+), 42 deletions(-) diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index 53e831c4097e..aeeedf8b2d25 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h @@ -257,6 +257,8 @@ extern int rbv_present,via_alt_mapping; extern void via_register_interrupts(void); extern void via_irq_enable(int); extern void via_irq_disable(int); +extern void via_nubus_irq_startup(int irq); +extern void via_nubus_irq_shutdown(int irq); extern void via1_irq(unsigned int irq, struct irq_desc *desc); extern void via1_set_head(int); extern int via2_scsi_drq_pending(void); diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 41dd164aac27..74f5a97c9860 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -151,10 +151,15 @@ irqreturn_t mac_debug_handler(int, void *); /* #define DEBUG_MACINTS */ +static unsigned int mac_irq_startup(struct irq_data *); +static void mac_irq_shutdown(struct irq_data *); + static struct irq_chip mac_irq_chip = { .name = "mac", .irq_enable = mac_irq_enable, .irq_disable = mac_irq_disable, + .irq_startup = mac_irq_startup, + .irq_shutdown = mac_irq_shutdown, }; void __init mac_init_IRQ(void) @@ -274,6 +279,28 @@ void mac_irq_disable(struct irq_data *data) } } +static unsigned int mac_irq_startup(struct irq_data *data) +{ + int irq = data->irq; + + if (IRQ_SRC(irq) == 7 && !oss_present) + via_nubus_irq_startup(irq); + else + mac_irq_enable(data); + + return 0; +} + +static void mac_irq_shutdown(struct irq_data *data) +{ + int irq = data->irq; + + if (IRQ_SRC(irq) == 7 && !oss_present) + via_nubus_irq_shutdown(irq); + else + mac_irq_disable(data); +} + static int num_debug[8]; irqreturn_t mac_debug_handler(int irq, void *dev_id) diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 642b44615f78..97996a48b048 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -63,18 +63,47 @@ static int gIER,gIFR,gBufA,gBufB; #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) -/* To disable a NuBus slot on Quadras we make that slot IRQ line an output set - * high. On RBV we just use the slot interrupt enable register. On Macs with - * genuine VIA chips we must use nubus_disabled to keep track of disabled slot - * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 - * or "SLOTS" interrupt. When no slot is disabled, we unmask the CA1 interrupt. - * So, on genuine VIAs, having more than one NuBus IRQ can mean trouble, - * because closing one of those drivers can mask all of the NuBus interrupts. - * Also, since we can't mask the unregistered slot IRQs on genuine VIAs, it's - * possible to get interrupts from cards that MacOS or the ROM has configured - * but we have not. FWIW, "Designing Cards and Drivers for Macintosh II and - * Macintosh SE", page 9-8, says, a slot IRQ with no driver would crash MacOS. + +/* + * On Macs with a genuine VIA chip there is no way to mask an individual slot + * interrupt. This limitation also seems to apply to VIA clone logic cores in + * Quadra-like ASICs. (RBV and OSS machines don't have this limitation.) + * + * We used to fake it by configuring the relevent VIA pin as an output + * (to mask the interrupt) or input (to unmask). That scheme did not work on + * (at least) the Quadra 700. A NuBus card's /NMRQ signal is an open-collector + * circuit (see Designing Cards and Drivers for Macintosh II and Macintosh SE, + * p. 10-11 etc) but VIA outputs are not (see datasheet). + * + * Driving these outputs high must cause the VIA to source current and the + * card to sink current when it asserts /NMRQ. Current will flow but the pin + * voltage is uncertain and so the /NMRQ condition may still cause a transition + * at the VIA2 CA1 input (which explains the lost interrupts). A side effect + * is that a disabled slot IRQ can never be tested as pending or not. + * + * Driving these outputs low doesn't work either. All the slot /NMRQ lines are + * (active low) OR'd together to generate the CA1 (aka "SLOTS") interrupt (see + * The Guide To Macintosh Family Hardware, 2nd edition p. 167). If we drive a + * disabled /NMRQ line low, the falling edge immediately triggers a CA1 + * interrupt and all slot interrupts after that will generate no transition + * and therefore no interrupt, even after being re-enabled. + * + * So we make the VIA port A I/O lines inputs and use nubus_disabled to keep + * track of their states. When any slot IRQ becomes disabled we mask the CA1 + * umbrella interrupt. Only when all slot IRQs become enabled do we unmask + * the CA1 interrupt. It must remain enabled even when cards have no interrupt + * handler registered. Drivers must therefore disable a slot interrupt at the + * device before they call free_irq (like shared and autovector interrupts). + * + * There is also a related problem when MacOS is used to boot Linux. A network + * card brought up by a MacOS driver may raise an interrupt while Linux boots. + * This can be fatal since it can't be handled until the right driver loads + * (if such a driver exists at all). Apparently related to this hardware + * limitation, "Designing Cards and Drivers", p. 9-8, says that a slot + * interrupt with no driver would crash MacOS (the book was written before + * the appearance of Macs with RBV or OSS). */ + static u8 nubus_disabled; void via_debug_dump(void); @@ -354,34 +383,55 @@ void __init via_nubus_init(void) via2[gBufB] |= 0x02; } - /* Disable all the slot interrupts (where possible). */ + /* + * Disable the slot interrupts. On some hardware that's not possible. + * On some hardware it's unclear what all of these I/O lines do. + */ switch (macintosh_config->via_type) { case MAC_VIA_II: - /* Just make the port A lines inputs. */ - switch(macintosh_config->ident) { - case MAC_MODEL_II: - case MAC_MODEL_IIX: - case MAC_MODEL_IICX: - case MAC_MODEL_SE30: - /* The top two bits are RAM size outputs. */ - via2[vDirA] &= 0xC0; - break; - default: - via2[vDirA] &= 0x80; - } + case MAC_VIA_QUADRA: + pr_debug("VIA2 vDirA is 0x%02X\n", via2[vDirA]); break; case MAC_VIA_IIci: /* RBV. Disable all the slot interrupts. SIER works like IER. */ via2[rSIER] = 0x7F; break; + } +} + +void via_nubus_irq_startup(int irq) +{ + int irq_idx = IRQ_IDX(irq); + + switch (macintosh_config->via_type) { + case MAC_VIA_II: case MAC_VIA_QUADRA: - /* Disable the inactive slot interrupts by making those lines outputs. */ - if ((macintosh_config->adb_type != MAC_ADB_PB1) && - (macintosh_config->adb_type != MAC_ADB_PB2)) { - via2[vBufA] |= 0x7F; - via2[vDirA] |= 0x7F; + /* Make the port A line an input. Probably redundant. */ + if (macintosh_config->via_type == MAC_VIA_II) { + /* The top two bits are RAM size outputs. */ + via2[vDirA] &= 0xC0 | ~(1 << irq_idx); + } else { + /* Allow NuBus slots 9 through F. */ + via2[vDirA] &= 0x80 | ~(1 << irq_idx); } + /* fall through */ + case MAC_VIA_IIci: + via_irq_enable(irq); + break; + } +} + +void via_nubus_irq_shutdown(int irq) +{ + switch (macintosh_config->via_type) { + case MAC_VIA_II: + case MAC_VIA_QUADRA: + /* Ensure that the umbrella CA1 interrupt remains enabled. */ + via_irq_enable(irq); + break; + case MAC_VIA_IIci: + via_irq_disable(irq); break; } } @@ -507,6 +557,7 @@ void via_irq_enable(int irq) { } else if (irq_src == 7) { switch (macintosh_config->via_type) { case MAC_VIA_II: + case MAC_VIA_QUADRA: nubus_disabled &= ~(1 << irq_idx); /* Enable the CA1 interrupt when no slot is disabled. */ if (!nubus_disabled) @@ -518,14 +569,6 @@ void via_irq_enable(int irq) { */ via2[rSIER] = IER_SET_BIT(irq_idx); break; - case MAC_VIA_QUADRA: - /* Make the port A line an input to enable the slot irq. - * But not on PowerBooks, that's ADB. - */ - if ((macintosh_config->adb_type != MAC_ADB_PB1) && - (macintosh_config->adb_type != MAC_ADB_PB2)) - via2[vDirA] &= ~(1 << irq_idx); - break; } } } @@ -545,6 +588,7 @@ void via_irq_disable(int irq) { } else if (irq_src == 7) { switch (macintosh_config->via_type) { case MAC_VIA_II: + case MAC_VIA_QUADRA: nubus_disabled |= 1 << irq_idx; if (nubus_disabled) via2[gIER] = IER_CLR_BIT(1); @@ -552,11 +596,6 @@ void via_irq_disable(int irq) { case MAC_VIA_IIci: via2[rSIER] = IER_CLR_BIT(irq_idx); break; - case MAC_VIA_QUADRA: - if ((macintosh_config->adb_type != MAC_ADB_PB1) && - (macintosh_config->adb_type != MAC_ADB_PB2)) - via2[vDirA] |= 1 << irq_idx; - break; } } } -- cgit v1.2.3-59-g8ed1b From da3fb3c9aaa357421ade92910303af82340c2ff5 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:18 +1100 Subject: m68k/mac: oss irq fixes The IOP driver calls into the OSS driver to enable its IRQ. This undesirable coupling between drivers only exists because the OSS driver doesn't correctly handle all of its machspec IRQs. Fix OSS handling of enable/disable for VIA1 IRQs (8 thru 15) which includes MAC_IRQ_ADB. Back when I implemented pmac_zilog support I redefined IRQ_MAC_SCC incorrectly. Change this to a machspec IRQ so that it works on OSS. Clean up the unused OSS audio IRQ and OSS_IRQLEV_* cruft that only confuses things. Fix the OSS description in macints.c and remove an obsolete comment. Don't enable the VIA1 irq before registering the handler. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/mac_oss.h | 19 -------- arch/m68k/include/asm/macints.h | 6 +-- arch/m68k/mac/config.c | 10 ++++- arch/m68k/mac/iop.c | 8 +--- arch/m68k/mac/macints.c | 45 +++++-------------- arch/m68k/mac/oss.c | 97 ++++++++++++++++++++++------------------- 6 files changed, 76 insertions(+), 109 deletions(-) diff --git a/arch/m68k/include/asm/mac_oss.h b/arch/m68k/include/asm/mac_oss.h index 3f04a66f0933..425fbff4f4d8 100644 --- a/arch/m68k/include/asm/mac_oss.h +++ b/arch/m68k/include/asm/mac_oss.h @@ -58,25 +58,6 @@ #define OSS_POWEROFF 0x80 -/* - * OSS Interrupt levels for various sub-systems - * - * This mapping is laid out with two things in mind: first, we try to keep - * things on their own levels to avoid having to do double-dispatches. Second, - * the levels match as closely as possible the alternate IRQ mapping mode (aka - * "A/UX mode") available on some VIA machines. - */ - -#define OSS_IRQLEV_DISABLED 0 -#define OSS_IRQLEV_IOPISM 1 /* ADB? */ -#define OSS_IRQLEV_SCSI IRQ_AUTO_2 -#define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */ -#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */ -#define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */ -#define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ -#define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */ -#define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ - #ifndef __ASSEMBLY__ struct mac_oss { diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h index ebe1b70fe90c..92aa8a4c2d03 100644 --- a/arch/m68k/include/asm/macints.h +++ b/arch/m68k/include/asm/macints.h @@ -104,6 +104,9 @@ #define IRQ_PSC4_3 (35) #define IRQ_MAC_MACE_DMA IRQ_PSC4_3 +/* OSS Level 4 interrupts */ +#define IRQ_MAC_SCC (33) + /* Level 5 (PSC, AV Macs only) interrupts */ #define IRQ_PSC5_0 (40) #define IRQ_PSC5_1 (41) @@ -131,9 +134,6 @@ #define IRQ_BABOON_2 (66) #define IRQ_BABOON_3 (67) -/* On non-PSC machines, the serial ports share an IRQ */ -#define IRQ_MAC_SCC IRQ_AUTO_4 - #define SLOT2IRQ(x) (x + 47) #define IRQ2SLOT(x) (x - 47) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 12e564c62957..101a8b7e2d52 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -893,8 +893,14 @@ static void __init mac_identify(void) scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; break; default: - scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; - scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; + /* On non-PSC machines, the serial ports share an IRQ. */ + if (macintosh_config->ident == MAC_MODEL_IIFX) { + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; + } else { + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4; + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4; + } break; } diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index a5462cc0bfd6..7d8d46127ad9 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -115,7 +115,6 @@ #include #include #include -#include /*#define DEBUG_IOP*/ @@ -149,8 +148,6 @@ static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN]; irqreturn_t iop_ism_irq(int, void *); -extern void oss_irq_enable(int); - /* * Private access functions */ @@ -304,11 +301,10 @@ void __init iop_init(void) void __init iop_register_interrupts(void) { if (iop_ism_present) { - if (oss_present) { - if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 0, + if (macintosh_config->ident == MAC_MODEL_IIFX) { + if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0, "ISM IOP", (void *)IOP_NUM_ISM)) pr_err("Couldn't register ISM IOP interrupt\n"); - oss_irq_enable(IRQ_MAC_ADB); } else { if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP", (void *)IOP_NUM_ISM)) diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 74f5a97c9860..5c1a6b2ff0af 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -26,10 +26,6 @@ * - slot 6: timer 1 (not on IIci) * - slot 7: status of IRQ; signals 'any enabled int.' * - * 2 - OSS (IIfx only?) - * - slot 0: SCSI interrupt - * - slot 1: Sound interrupt - * * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes: * * 3 - unused (?) @@ -54,21 +50,18 @@ * * 6 - VIA1 * - * For OSS Macintoshes (IIfx only at this point): + * For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to + * the Quadra (A/UX) mapping: * - * 3 - Nubus interrupt - * - slot 0: Slot $9 - * - slot 1: Slot $A - * - slot 2: Slot $B - * - slot 3: Slot $C - * - slot 4: Slot $D - * - slot 5: Slot $E + * 1 - ISM IOP (ADB) * - * 4 - SCC IOP + * 2 - SCSI * - * 5 - ISM IOP (ADB?) + * 3 - NuBus * - * 6 - unused + * 4 - SCC IOP + * + * 6 - VIA1 * * For PSC Macintoshes (660AV, 840AV): * @@ -112,14 +105,6 @@ * case. They're hidden behind the Nubus slot $C interrupt thus adding a * third layer of indirection. Why oh why did the Apple engineers do that? * - * - We support "fast" and "slow" handlers, just like the Amiga port. The - * fast handlers are called first and with all interrupts disabled. They - * are expected to execute quickly (hence the name). The slow handlers are - * called last with interrupts enabled and the interrupt level restored. - * They must therefore be reentrant. - * - * TODO: - * */ #include @@ -216,8 +201,6 @@ void mac_irq_enable(struct irq_data *data) switch(irq_src) { case 1: - via_irq_enable(irq); - break; case 2: case 7: if (oss_present) @@ -226,6 +209,7 @@ void mac_irq_enable(struct irq_data *data) via_irq_enable(irq); break; case 3: + case 4: case 5: case 6: if (psc_present) @@ -233,10 +217,6 @@ void mac_irq_enable(struct irq_data *data) else if (oss_present) oss_irq_enable(irq); break; - case 4: - if (psc_present) - psc_irq_enable(irq); - break; case 8: if (baboon_present) baboon_irq_enable(irq); @@ -251,8 +231,6 @@ void mac_irq_disable(struct irq_data *data) switch(irq_src) { case 1: - via_irq_disable(irq); - break; case 2: case 7: if (oss_present) @@ -261,6 +239,7 @@ void mac_irq_disable(struct irq_data *data) via_irq_disable(irq); break; case 3: + case 4: case 5: case 6: if (psc_present) @@ -268,10 +247,6 @@ void mac_irq_disable(struct irq_data *data) else if (oss_present) oss_irq_disable(irq); break; - case 4: - if (psc_present) - psc_irq_disable(irq); - break; case 8: if (baboon_present) baboon_irq_disable(irq); diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index fdc0f843ff6f..6c4c882c126e 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -1,5 +1,5 @@ /* - * OSS handling + * Operating System Services (OSS) chip handling * Written by Joshua M. Thompson (funaho@jurai.org) * * @@ -49,10 +49,8 @@ void __init oss_init(void) /* do this by setting the source's interrupt level to zero. */ for (i = 0; i <= OSS_NUM_SOURCES; i++) { - oss->irq_level[i] = OSS_IRQLEV_DISABLED; + oss->irq_level[i] = 0; } - /* If we disable VIA1 here, we never really handle it... */ - oss->irq_level[OSS_VIA1] = OSS_IRQLEV_VIA1; } /* @@ -64,17 +62,13 @@ void __init oss_nubus_init(void) } /* - * Handle miscellaneous OSS interrupts. Right now that's just sound - * and SCSI; everything else is routed to its own autovector IRQ. + * Handle miscellaneous OSS interrupts. */ static void oss_irq(unsigned int irq, struct irq_desc *desc) { - int events; - - events = oss->irq_pending & (OSS_IP_SOUND|OSS_IP_SCSI); - if (!events) - return; + int events = oss->irq_pending & + (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM); #ifdef DEBUG_IRQS if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) { @@ -82,16 +76,20 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc) (int) oss->irq_pending); } #endif - /* FIXME: how do you clear a pending IRQ? */ - if (events & OSS_IP_SOUND) { - oss->irq_pending &= ~OSS_IP_SOUND; - /* FIXME: call sound handler */ - } else if (events & OSS_IP_SCSI) { + if (events & OSS_IP_IOPSCC) { + oss->irq_pending &= ~OSS_IP_IOPSCC; + generic_handle_irq(IRQ_MAC_SCC); + } + + if (events & OSS_IP_SCSI) { oss->irq_pending &= ~OSS_IP_SCSI; generic_handle_irq(IRQ_MAC_SCSI); - } else { - /* FIXME: error check here? */ + } + + if (events & OSS_IP_IOPISM) { + oss->irq_pending &= ~OSS_IP_IOPISM; + generic_handle_irq(IRQ_MAC_ADB); } } @@ -130,14 +128,29 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc) /* * Register the OSS and NuBus interrupt dispatchers. + * + * This IRQ mapping is laid out with two things in mind: first, we try to keep + * things on their own levels to avoid having to do double-dispatches. Second, + * the levels match as closely as possible the alternate IRQ mapping mode (aka + * "A/UX mode") available on some VIA machines. */ +#define OSS_IRQLEV_IOPISM IRQ_AUTO_1 +#define OSS_IRQLEV_SCSI IRQ_AUTO_2 +#define OSS_IRQLEV_NUBUS IRQ_AUTO_3 +#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 +#define OSS_IRQLEV_VIA1 IRQ_AUTO_6 + void __init oss_register_interrupts(void) { - irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); - irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); - irq_set_chained_handler(OSS_IRQLEV_SOUND, oss_irq); - irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq); + irq_set_chained_handler(OSS_IRQLEV_IOPISM, oss_irq); + irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); + irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); + irq_set_chained_handler(OSS_IRQLEV_IOPSCC, oss_irq); + irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq); + + /* OSS_VIA1 gets enabled here because it has no machspec interrupt. */ + oss->irq_level[OSS_VIA1] = IRQ_AUTO_6; } /* @@ -156,13 +169,13 @@ void oss_irq_enable(int irq) { switch(irq) { case IRQ_MAC_SCC: oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; - break; + return; case IRQ_MAC_ADB: oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM; - break; + return; case IRQ_MAC_SCSI: oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; - break; + return; case IRQ_NUBUS_9: case IRQ_NUBUS_A: case IRQ_NUBUS_B: @@ -171,13 +184,11 @@ void oss_irq_enable(int irq) { case IRQ_NUBUS_E: irq -= NUBUS_SOURCE_BASE; oss->irq_level[irq] = OSS_IRQLEV_NUBUS; - break; -#ifdef DEBUG_IRQUSE - default: - printk("%s unknown irq %d\n", __func__, irq); - break; -#endif + return; } + + if (IRQ_SRC(irq) == 1) + via_irq_enable(irq); } /* @@ -193,14 +204,14 @@ void oss_irq_disable(int irq) { #endif switch(irq) { case IRQ_MAC_SCC: - oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; - break; + oss->irq_level[OSS_IOPSCC] = 0; + return; case IRQ_MAC_ADB: - oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_DISABLED; - break; + oss->irq_level[OSS_IOPISM] = 0; + return; case IRQ_MAC_SCSI: - oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED; - break; + oss->irq_level[OSS_SCSI] = 0; + return; case IRQ_NUBUS_9: case IRQ_NUBUS_A: case IRQ_NUBUS_B: @@ -208,12 +219,10 @@ void oss_irq_disable(int irq) { case IRQ_NUBUS_D: case IRQ_NUBUS_E: irq -= NUBUS_SOURCE_BASE; - oss->irq_level[irq] = OSS_IRQLEV_DISABLED; - break; -#ifdef DEBUG_IRQUSE - default: - printk("%s unknown irq %d\n", __func__, irq); - break; -#endif + oss->irq_level[irq] = 0; + return; } + + if (IRQ_SRC(irq) == 1) + via_irq_disable(irq); } -- cgit v1.2.3-59-g8ed1b From feb11e8a5617cd337d8a83fd9cde38dba8ef050f Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:19 +1100 Subject: m68k/mac: fix baboon irq disable and shutdown The baboon_disabled hack is broken because it is missing an irq shutdown method. So releasing a Baboon irq kills the other Baboon irqs. But we don't really need this hack because we don't have media bay support and TREX uses a NuBus IRQ. Remove it. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/baboon.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index 74999685ddad..3fe0e43d44f6 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -18,7 +18,6 @@ int baboon_present; static volatile struct baboon *baboon; -static unsigned char baboon_disabled; #if 0 extern int macide_ack_intr(struct ata_channel *); @@ -84,37 +83,32 @@ static void baboon_irq(unsigned int irq, struct irq_desc *desc) void __init baboon_register_interrupts(void) { - baboon_disabled = 0; irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq); } /* - * The means for masking individual baboon interrupts remains a mystery, so - * enable the umbrella interrupt only when no baboon interrupt is disabled. + * The means for masking individual Baboon interrupts remains a mystery. + * However, since we only use the IDE IRQ, we can just enable/disable all + * Baboon interrupts. If/when we handle more than one Baboon IRQ, we must + * either figure out how to mask them individually or else implement the + * same workaround that's used for NuBus slots (see nubus_disabled and + * via_nubus_irq_shutdown). */ void baboon_irq_enable(int irq) { - int irq_idx = IRQ_IDX(irq); - #ifdef DEBUG_IRQUSE printk("baboon_irq_enable(%d)\n", irq); #endif - baboon_disabled &= ~(1 << irq_idx); - if (!baboon_disabled) - mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C)); + mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C)); } void baboon_irq_disable(int irq) { - int irq_idx = IRQ_IDX(irq); - #ifdef DEBUG_IRQUSE printk("baboon_irq_disable(%d)\n", irq); #endif - baboon_disabled |= 1 << irq_idx; - if (baboon_disabled) - mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); + mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); } -- cgit v1.2.3-59-g8ed1b From 4107c459fe4075c5a2d552fd8d9d5fea10c1ff93 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:20 +1100 Subject: m68k/mac: fix powerbook 150 adb_type The PowerBook 150 is a actually a Duo underneath. Fix the adb_type. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 101a8b7e2d52..b20b1318462c 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -674,7 +674,7 @@ static struct mac_model mac_data_table[] = { }, { .ident = MAC_MODEL_PB150, .name = "PowerBook 150", - .adb_type = MAC_ADB_PB1, + .adb_type = MAC_ADB_PB2, .via_type = MAC_VIA_IIci, .scsi_type = MAC_SCSI_OLD, .ide_type = MAC_IDE_PB, -- cgit v1.2.3-59-g8ed1b From aa8a9fbe18bbbcf25bf5e3c7155e886057dcf171 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:21 +1100 Subject: mac_scsi: fix mac_scsi on some powerbooks Fix the mac_scsi interrupt edge trigger on non-RBV PowerBooks. This doesn't appear to help my PowerBook 520 but the NetBSD source reveals that the PowerBook 500 series is different than the others. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/via.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 97996a48b048..7a2993bb092d 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -253,22 +253,28 @@ void __init via_init(void) via2[vACR] &= ~0x03; /* disable port A & B latches */ } + /* Everything below this point is VIA2 only... */ + + if (rbv_present) + return; + /* - * Set vPCR for control line interrupts (but not on RBV) + * Set vPCR for control line interrupts. + * + * CA1 (SLOTS IRQ), CB1 (ASC IRQ): negative edge trigger. + * + * Macs with ESP SCSI have a negative edge triggered SCSI interrupt. + * Testing reveals that PowerBooks do too. However, the SE/30 + * schematic diagram shows an active high NCR5380 IRQ line. */ - if (!rbv_present) { - /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ) - * are made negative edge triggered here. - */ - if (macintosh_config->scsi_type == MAC_SCSI_OLD) { - /* CB2 (IRQ) indep. input, positive edge */ - /* CA2 (DRQ) indep. input, positive edge */ - via2[vPCR] = 0x66; - } else { - /* CB2 (IRQ) indep. input, negative edge */ - /* CA2 (DRQ) indep. input, negative edge */ - via2[vPCR] = 0x22; - } + + pr_debug("VIA2 vPCR is 0x%02X\n", via2[vPCR]); + if (macintosh_config->via_type == MAC_VIA_II) { + /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, pos. edge */ + via2[vPCR] = 0x66; + } else { + /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, neg. edge */ + via2[vPCR] = 0x22; } } -- cgit v1.2.3-59-g8ed1b From 608e287b0591789ecd851b05db6f0ba37807fadc Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:22 +1100 Subject: m68k/mac: cleanup macro case Code style convention has macro names in uppercase. Change MAC_VIA_IIci to MAC_VIA_IICI. Also remove an obsolete comment. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/macintosh.h | 2 +- arch/m68k/mac/config.c | 52 ++++++++++++++++++--------------------- arch/m68k/mac/via.c | 12 ++++----- 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h index b02418c45b86..682a1a2ff55f 100644 --- a/arch/m68k/include/asm/macintosh.h +++ b/arch/m68k/include/asm/macintosh.h @@ -42,7 +42,7 @@ struct mac_model #define MAC_ADB_IOP 6 #define MAC_VIA_II 1 -#define MAC_VIA_IIci 2 +#define MAC_VIA_IICI 2 #define MAC_VIA_QUADRA 3 #define MAC_SCSI_NONE 0 diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index b20b1318462c..f60ff5f59205 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -221,7 +221,7 @@ void __init config_mac(void) * inaccurate, so look here if a new Mac model won't run. Example: if * a Mac crashes immediately after the VIA1 registers have been dumped * to the screen, it probably died attempting to read DirB on a RBV. - * Meaning it should have MAC_VIA_IIci here :-) + * Meaning it should have MAC_VIA_IICI here :-) */ struct mac_model *macintosh_config; @@ -296,7 +296,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IICI, .name = "IIci", .adb_type = MAC_ADB_II, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -305,7 +305,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIFX, .name = "IIfx", .adb_type = MAC_ADB_IOP, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_IOP, .nubus_type = MAC_NUBUS, @@ -314,7 +314,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IISI, .name = "IIsi", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -323,7 +323,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIVI, .name = "IIvi", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -332,7 +332,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIVX, .name = "IIvx", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -347,7 +347,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CLII, .name = "Classic II", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -356,7 +356,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CCL, .name = "Color Classic", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -365,7 +365,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CCLII, .name = "Color Classic II", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -380,7 +380,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LC, .name = "LC", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -389,7 +389,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LCII, .name = "LC II", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -398,7 +398,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LCIII, .name = "LC III", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -526,7 +526,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P460, .name = "Performa 460", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -553,7 +553,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P520, .name = "Performa 520", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -562,7 +562,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P550, .name = "Performa 550", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -594,7 +594,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_TV, .name = "TV", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -603,7 +603,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P600, .name = "Performa 600", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -675,7 +675,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB150, .name = "PowerBook 150", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .ide_type = MAC_IDE_PB, .scc_type = MAC_SCC_QUADRA, @@ -761,17 +761,13 @@ static struct mac_model mac_data_table[] = { * PowerBook Duos are pretty much like normal PowerBooks * All of these probably have onboard SONIC in the Dock which * means we'll have to probe for it eventually. - * - * Are these really MAC_VIA_IIci? The developer notes for the - * Duos show pretty much the same custom parts as in most of - * the other PowerBooks which would imply MAC_VIA_QUADRA. */ { .ident = MAC_MODEL_PB210, .name = "PowerBook Duo 210", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -780,7 +776,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB230, .name = "PowerBook Duo 230", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -789,7 +785,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB250, .name = "PowerBook Duo 250", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -798,7 +794,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB270C, .name = "PowerBook Duo 270c", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -807,7 +803,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB280, .name = "PowerBook Duo 280", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -816,7 +812,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB280C, .name = "PowerBook Duo 280c", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 7a2993bb092d..2d85662715fb 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -126,7 +126,7 @@ void __init via_init(void) /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */ - case MAC_VIA_IIci: + case MAC_VIA_IICI: via1 = (void *) VIA1_BASE; if (macintosh_config->ident == MAC_MODEL_IIFX) { via2 = NULL; @@ -399,7 +399,7 @@ void __init via_nubus_init(void) case MAC_VIA_QUADRA: pr_debug("VIA2 vDirA is 0x%02X\n", via2[vDirA]); break; - case MAC_VIA_IIci: + case MAC_VIA_IICI: /* RBV. Disable all the slot interrupts. SIER works like IER. */ via2[rSIER] = 0x7F; break; @@ -422,7 +422,7 @@ void via_nubus_irq_startup(int irq) via2[vDirA] &= 0x80 | ~(1 << irq_idx); } /* fall through */ - case MAC_VIA_IIci: + case MAC_VIA_IICI: via_irq_enable(irq); break; } @@ -436,7 +436,7 @@ void via_nubus_irq_shutdown(int irq) /* Ensure that the umbrella CA1 interrupt remains enabled. */ via_irq_enable(irq); break; - case MAC_VIA_IIci: + case MAC_VIA_IICI: via_irq_disable(irq); break; } @@ -569,7 +569,7 @@ void via_irq_enable(int irq) { if (!nubus_disabled) via2[gIER] = IER_SET_BIT(1); break; - case MAC_VIA_IIci: + case MAC_VIA_IICI: /* On RBV, enable the slot interrupt. * SIER works like IER. */ @@ -599,7 +599,7 @@ void via_irq_disable(int irq) { if (nubus_disabled) via2[gIER] = IER_CLR_BIT(1); break; - case MAC_VIA_IIci: + case MAC_VIA_IICI: via2[rSIER] = IER_CLR_BIT(irq_idx); break; } -- cgit v1.2.3-59-g8ed1b From 9d7a51d509a8b28fc1217fe11842fb8bbc184c44 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 15 Sep 2011 13:09:32 -0700 Subject: m68k: Initconst section fixes Signed-off-by: Andi Kleen Signed-off-by: Geert Uytterhoeven --- arch/m68k/emu/nfeth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c index c5748bb4ea71..a985a7e87d45 100644 --- a/arch/m68k/emu/nfeth.c +++ b/arch/m68k/emu/nfeth.c @@ -39,7 +39,7 @@ enum { #define MAX_UNIT 8 /* These identify the driver base version and may not be removed. */ -static const char version[] __devinitdata = +static const char version[] __devinitconst = KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE " S.Opichal, M.Jurik, P.Stehlik\n" KERN_INFO " http://aranym.org/\n"; -- cgit v1.2.3-59-g8ed1b From f808b8650788f78bc1e5e693712e7d7603ab26bc Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 7 Nov 2011 21:14:43 +0100 Subject: m68k/hp300: Export hp300_ledstate The accidental loss of CONFIG_DIO in commit 0e152d80507b75c00aac60f2ffc586360687cd52 ("m68k: reorganize Kconfig options to improve mmu/non-mmu selections") exposed a missing symbol export in m68k allmodconfig. If CONFIG_HP300=y but CONFIG_HPLANCE (which is bool, and depends on CONFIG_DIO) is not set, and CONFIG_MVME147=y and CONFIG_MVME147_NET=m, 7990.c is compiled as a module, giving: ERROR: "ledstate" [drivers/net/ethernet/amd/7990.ko] undefined! Add the missing export, and rename ledstate to hp300_ledstate while we're at it, as it's a too generic name. Signed-off-by: Geert Uytterhoeven --- arch/m68k/hp300/config.c | 3 ++- arch/m68k/include/asm/blinken.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index 1c05a6260546..bf16af1edacf 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c @@ -24,7 +24,8 @@ unsigned long hp300_model; unsigned long hp300_uart_scode = -1; -unsigned char ledstate; +unsigned char hp300_ledstate; +EXPORT_SYMBOL(hp300_ledstate); static char s_hp330[] __initdata = "330"; static char s_hp340[] __initdata = "340"; diff --git a/arch/m68k/include/asm/blinken.h b/arch/m68k/include/asm/blinken.h index 1a749cf7b06d..0626582a7db4 100644 --- a/arch/m68k/include/asm/blinken.h +++ b/arch/m68k/include/asm/blinken.h @@ -17,15 +17,15 @@ #define HP300_LEDS 0xf001ffff -extern unsigned char ledstate; +extern unsigned char hp300_ledstate; static __inline__ void blinken_leds(int on, int off) { if (MACH_IS_HP300) { - ledstate |= on; - ledstate &= ~off; - out_8(HP300_LEDS, ~ledstate); + hp300_ledstate |= on; + hp300_ledstate &= ~off; + out_8(HP300_LEDS, ~hp300_ledstate); } } -- cgit v1.2.3-59-g8ed1b From 1d9532b3fa7f903bfcf96acc917111db491ee50d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 8 Nov 2011 23:30:19 +0100 Subject: m68k/serial: Remove references to obsolete CONFIG_SERIAL167 commit 51c9d654c2def97827395a7fbfd0c6f865c26544 ("Staging: delete tty drivers") removed the MVME167 serial driver, but forgot to remove these references. Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig.devices | 2 +- arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices index 6033f5d4e67e..e01eeb263321 100644 --- a/arch/m68k/Kconfig.devices +++ b/arch/m68k/Kconfig.devices @@ -128,7 +128,7 @@ config DN_SERIAL config SERIAL_CONSOLE bool "Support for serial port console" - 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) + depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || DN_SERIAL) ---help--- If you say Y here, it will be possible to use a serial port as the system console (the system console is the device which receives all diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index ad9e85760e34..958a7ce49dee 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig @@ -323,7 +323,6 @@ CONFIG_ATARI_MIDI=y CONFIG_ATARI_DSP56K=m CONFIG_AMIGA_BUILTIN_SERIAL=y CONFIG_MULTIFACE_III_TTY=m -CONFIG_SERIAL167=y CONFIG_DN_SERIAL=y CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index c45aaf3b816f..6dd12e62b41b 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -218,7 +218,6 @@ CONFIG_GEN_RTC_X=y CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set -CONFIG_SERIAL167=y CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y -- cgit v1.2.3-59-g8ed1b From 125298d2daf7c9005d5bc26313a037b798c8de70 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 13 Nov 2011 10:44:24 +0100 Subject: m68k/atari: Move declaration of atari_SCC_reset_done to header file Signed-off-by: Geert Uytterhoeven --- arch/m68k/atari/ataints.c | 2 -- arch/m68k/atari/debug.c | 1 - arch/m68k/include/asm/atarihw.h | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 6d196dadfdbc..8048e1b7e552 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -82,8 +82,6 @@ __ALIGN_STR "\n\t" extern void atari_microwire_cmd(int cmd); -extern int atari_SCC_reset_done; - static unsigned int atari_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 5a484247e493..a547ba9683d1 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c @@ -202,7 +202,6 @@ static void __init atari_init_mfp_port(int cflag) static void __init atari_init_scc_port(int cflag) { - extern int atari_SCC_reset_done; static int clksrc_table[9] = /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index 0392b28656ab..c0cb36350775 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h @@ -30,6 +30,8 @@ extern u_long atari_switches; extern int atari_rtc_year_offset; extern int atari_dont_touch_floppy_select; +extern int atari_SCC_reset_done; + /* convenience macros for testing machine type */ #define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST) #define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \ -- cgit v1.2.3-59-g8ed1b From 0c51a0c6a3bc974d42d6ea5e15c0a00e1eb87fc2 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 1 Nov 2011 21:34:23 +0100 Subject: m68k: Don't comment out syscalls used by glibc Define again the syscalls that are used by glibc so that it is possible to compile a feature-complete glibc with the newest kernel headers. Signed-off-by: Andreas Schwab Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/unistd.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 303192fc9260..ea0b502f845e 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -132,10 +132,10 @@ #define __NR_adjtimex 124 #define __NR_mprotect 125 #define __NR_sigprocmask 126 -/*#define __NR_create_module 127*/ +#define __NR_create_module 127 #define __NR_init_module 128 #define __NR_delete_module 129 -/*#define __NR_get_kernel_syms 130*/ +#define __NR_get_kernel_syms 130 #define __NR_quotactl 131 #define __NR_getpgid 132 #define __NR_fchdir 133 @@ -172,7 +172,7 @@ #define __NR_setresuid 164 #define __NR_getresuid 165 #define __NR_getpagesize 166 -/*#define __NR_query_module 167*/ +#define __NR_query_module 167 #define __NR_poll 168 #define __NR_nfsservctl 169 #define __NR_setresgid 170 @@ -193,8 +193,8 @@ #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 -/*#define __NR_getpmsg 188*/ /* some people actually want streams */ -/*#define __NR_putpmsg 189*/ /* some people actually want streams */ +#define __NR_getpmsg 188 /* some people actually want streams */ +#define __NR_putpmsg 189 /* some people actually want streams */ #define __NR_vfork 190 #define __NR_ugetrlimit 191 #define __NR_mmap2 192 -- cgit v1.2.3-59-g8ed1b From e71ef315ddb96c239d6d8323008ac0b5ef6cee99 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Jul 2011 22:33:13 +0200 Subject: m68k/net: Remove obsolete IRQ_FLG_* users The m68k core irq code stopped honoring these flags during the irq restructuring in 2006. Signed-off-by: Geert Uytterhoeven Acked-by: David S. Miller --- drivers/net/ethernet/natsemi/macsonic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c index a2eacbfb4252..5987d172d3d6 100644 --- a/drivers/net/ethernet/natsemi/macsonic.c +++ b/drivers/net/ethernet/natsemi/macsonic.c @@ -142,8 +142,7 @@ static int macsonic_open(struct net_device* dev) { int retval; - retval = request_irq(dev->irq, sonic_interrupt, IRQ_FLG_FAST, - "sonic", dev); + retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev); if (retval) { printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); @@ -154,8 +153,8 @@ static int macsonic_open(struct net_device* dev) * rupt as well, which must prevent re-entrance of the sonic handler. */ if (dev->irq == IRQ_AUTO_3) { - retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, - IRQ_FLG_FAST, "sonic", dev); + retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, 0, + "sonic", dev); if (retval) { printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, IRQ_NUBUS_9); -- cgit v1.2.3-59-g8ed1b From 176f2934d118f82a033ba69c235b21af151dc576 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 6 Dec 2011 21:16:13 +0100 Subject: m68k/serial: Remove references to obsolete serial config options - ATARI_MFPSER, ATARI_MIDI, MULTIFACE_III_TTY, and DN_SERIAL have no corresponding drivers (anymore), - Clean up SERIAL_CONSOLE dependencies and help text. Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig.devices | 42 ++++--------------------------------- arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 2 -- arch/m68k/configs/atari_defconfig | 3 --- arch/m68k/configs/multi_defconfig | 4 ---- arch/m68k/configs/mvme16x_defconfig | 1 - 6 files changed, 4 insertions(+), 49 deletions(-) diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices index e01eeb263321..052cb647b307 100644 --- a/arch/m68k/Kconfig.devices +++ b/arch/m68k/Kconfig.devices @@ -59,27 +59,6 @@ endmenu menu "Character devices" -config ATARI_MFPSER - tristate "Atari MFP serial support" - depends on ATARI - ---help--- - If you like to use the MFP serial ports ("Modem1", "Serial1") under - Linux, say Y. The driver equally supports all kinds of MFP serial - ports and automatically detects whether Serial1 is available. - - To compile this driver as a module, choose M here. - - Note for Falcon users: You also have an MFP port, it's just not - wired to the outside... But you could use the port under Linux. - -config ATARI_MIDI - tristate "Atari MIDI serial support" - depends on ATARI - help - If you want to use your Atari's MIDI port in Linux, say Y. - - To compile this driver as a module, choose M here. - config ATARI_DSP56K tristate "Atari DSP56k support (EXPERIMENTAL)" depends on ATARI && EXPERIMENTAL @@ -99,15 +78,6 @@ config AMIGA_BUILTIN_SERIAL To compile this driver as a module, choose M here. -config MULTIFACE_III_TTY - tristate "Multiface Card III serial support" - depends on AMIGA - help - If you want to use a Multiface III card's serial port in Linux, - answer Y. - - To compile this driver as a module, choose M here. - config HPDCA tristate "HP DCA serial support" depends on DIO && SERIAL_8250 @@ -122,13 +92,9 @@ config HPAPCI If you want to use the internal "APCI" serial ports on an HP400 machine, say Y here. -config DN_SERIAL - bool "Support for DN serial port (dummy)" - depends on APOLLO - config SERIAL_CONSOLE bool "Support for serial port console" - depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || DN_SERIAL) + depends on AMIGA_BUILTIN_SERIAL=y ---help--- If you say Y here, it will be possible to use a serial port as the system console (the system console is the device which receives all @@ -140,10 +106,10 @@ config SERIAL_CONSOLE (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyS1". (Try "man bootparam" or see the documentation of - your boot loader (lilo or loadlin) about how to pass options to the - kernel at boot time.) + your boot loader about how to pass options to the kernel at boot + time.) - If you don't have a VGA card installed and you say Y here, the + If you don't have a graphical console and you say Y here, the kernel will automatically use the first serial line, /dev/ttyS0, as system console. diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index dbb49fc6463b..e93fdae10b23 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig @@ -255,7 +255,6 @@ CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set CONFIG_AMIGA_BUILTIN_SERIAL=y -CONFIG_MULTIFACE_III_TTY=m CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 562b221f6951..66b26c1e848c 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig @@ -223,8 +223,6 @@ CONFIG_LOGO=y CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set -CONFIG_DN_SERIAL=y -CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 82978df637fa..151332515980 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig @@ -235,10 +235,7 @@ CONFIG_DMASOUND_ATARI=m CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set -CONFIG_ATARI_MFPSER=y -CONFIG_ATARI_MIDI=y CONFIG_ATARI_DSP56K=m -CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 958a7ce49dee..55d394edf633 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig @@ -318,12 +318,8 @@ CONFIG_DMASOUND_Q40=m CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set -CONFIG_ATARI_MFPSER=y -CONFIG_ATARI_MIDI=y CONFIG_ATARI_DSP56K=m CONFIG_AMIGA_BUILTIN_SERIAL=y -CONFIG_MULTIFACE_III_TTY=m -CONFIG_DN_SERIAL=y CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 6dd12e62b41b..cdb70d66e535 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -218,7 +218,6 @@ CONFIG_GEN_RTC_X=y CONFIG_HID=m CONFIG_HIDRAW=y # CONFIG_USB_SUPPORT is not set -CONFIG_SERIAL_CONSOLE=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set -- cgit v1.2.3-59-g8ed1b From 3bd9e50b4297b0d85bb86a8f2ade941c0f9c21fd Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 29 Dec 2011 20:00:31 +0100 Subject: m68k/mac: Make CONFIG_HEARTBEAT unavailable on Mac mac_heartbeat() was never really implemented. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer --- arch/m68k/Kconfig.devices | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices index 052cb647b307..04a3d9be90e9 100644 --- a/arch/m68k/Kconfig.devices +++ b/arch/m68k/Kconfig.devices @@ -8,8 +8,8 @@ config ARCH_MAY_HAVE_PC_FDC menu "Platform devices" config HEARTBEAT - bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40 - default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300 + bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || Q40 + default y if !AMIGA && !APOLLO && !ATARI && !Q40 && HP300 help Use the power-on LED on your machine as a load meter. The exact behavior is platform-dependent, but normally the flash frequency is -- cgit v1.2.3-59-g8ed1b