Commit 356b9542 authored by Linus Torvalds's avatar Linus Torvalds

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.
parents 770e1b03 3bd9e50b
...@@ -10,6 +10,17 @@ config BOOTPARAM_STRING ...@@ -10,6 +10,17 @@ config BOOTPARAM_STRING
default 'console=ttyS0,19200' default 'console=ttyS0,19200'
depends on BOOTPARAM depends on BOOTPARAM
config EARLY_PRINTK
bool "Early printk" if EMBEDDED
depends on MVME16x || MAC
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 if !MMU
config FULLDEBUG config FULLDEBUG
......
...@@ -8,8 +8,8 @@ config ARCH_MAY_HAVE_PC_FDC ...@@ -8,8 +8,8 @@ config ARCH_MAY_HAVE_PC_FDC
menu "Platform devices" menu "Platform devices"
config HEARTBEAT config HEARTBEAT
bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || Q40
default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300 default y if !AMIGA && !APOLLO && !ATARI && !Q40 && HP300
help help
Use the power-on LED on your machine as a load meter. The exact Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is behavior is platform-dependent, but normally the flash frequency is
...@@ -59,27 +59,6 @@ endmenu ...@@ -59,27 +59,6 @@ endmenu
menu "Character devices" 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 config ATARI_DSP56K
tristate "Atari DSP56k support (EXPERIMENTAL)" tristate "Atari DSP56k support (EXPERIMENTAL)"
depends on ATARI && EXPERIMENTAL depends on ATARI && EXPERIMENTAL
...@@ -99,15 +78,6 @@ config AMIGA_BUILTIN_SERIAL ...@@ -99,15 +78,6 @@ config AMIGA_BUILTIN_SERIAL
To compile this driver as a module, choose M here. 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 config HPDCA
tristate "HP DCA serial support" tristate "HP DCA serial support"
depends on DIO && SERIAL_8250 depends on DIO && SERIAL_8250
...@@ -122,13 +92,9 @@ config HPAPCI ...@@ -122,13 +92,9 @@ config HPAPCI
If you want to use the internal "APCI" serial ports on an HP400 If you want to use the internal "APCI" serial ports on an HP400
machine, say Y here. machine, say Y here.
config DN_SERIAL
bool "Support for DN serial port (dummy)"
depends on APOLLO
config SERIAL_CONSOLE config SERIAL_CONSOLE
bool "Support for serial port 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_BUILTIN_SERIAL=y
---help--- ---help---
If you say Y here, it will be possible to use a serial port as the 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 system console (the system console is the device which receives all
...@@ -140,10 +106,10 @@ config SERIAL_CONSOLE ...@@ -140,10 +106,10 @@ config SERIAL_CONSOLE
(/dev/tty0) will still be used as the system console by default, but (/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 you can alter that using a kernel command line option such as
"console=ttyS1". (Try "man bootparam" or see the documentation of "console=ttyS1". (Try "man bootparam" or see the documentation of
your boot loader (lilo or loadlin) about how to pass options to the your boot loader about how to pass options to the kernel at boot
kernel at boot time.) 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 kernel will automatically use the first serial line, /dev/ttyS0, as
system console. system console.
......
...@@ -82,8 +82,6 @@ __ALIGN_STR "\n\t" ...@@ -82,8 +82,6 @@ __ALIGN_STR "\n\t"
extern void atari_microwire_cmd(int cmd); extern void atari_microwire_cmd(int cmd);
extern int atari_SCC_reset_done;
static unsigned int atari_irq_startup(struct irq_data *data) static unsigned int atari_irq_startup(struct irq_data *data)
{ {
unsigned int irq = data->irq; unsigned int irq = data->irq;
......
...@@ -202,7 +202,6 @@ static void __init atari_init_mfp_port(int cflag) ...@@ -202,7 +202,6 @@ static void __init atari_init_mfp_port(int cflag)
static void __init atari_init_scc_port(int cflag) static void __init atari_init_scc_port(int cflag)
{ {
extern int atari_SCC_reset_done;
static int clksrc_table[9] = static int clksrc_table[9] =
/* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
......
...@@ -255,7 +255,6 @@ CONFIG_HID=m ...@@ -255,7 +255,6 @@ CONFIG_HID=m
CONFIG_HIDRAW=y CONFIG_HIDRAW=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_AMIGA_BUILTIN_SERIAL=y CONFIG_AMIGA_BUILTIN_SERIAL=y
CONFIG_MULTIFACE_III_TTY=m
CONFIG_SERIAL_CONSOLE=y CONFIG_SERIAL_CONSOLE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
......
...@@ -223,8 +223,6 @@ CONFIG_LOGO=y ...@@ -223,8 +223,6 @@ CONFIG_LOGO=y
CONFIG_HID=m CONFIG_HID=m
CONFIG_HIDRAW=y CONFIG_HIDRAW=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_DN_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
......
...@@ -235,10 +235,7 @@ CONFIG_DMASOUND_ATARI=m ...@@ -235,10 +235,7 @@ CONFIG_DMASOUND_ATARI=m
CONFIG_HID=m CONFIG_HID=m
CONFIG_HIDRAW=y CONFIG_HIDRAW=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_ATARI_MFPSER=y
CONFIG_ATARI_MIDI=y
CONFIG_ATARI_DSP56K=m CONFIG_ATARI_DSP56K=m
CONFIG_SERIAL_CONSOLE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
......
...@@ -318,13 +318,8 @@ CONFIG_DMASOUND_Q40=m ...@@ -318,13 +318,8 @@ CONFIG_DMASOUND_Q40=m
CONFIG_HID=m CONFIG_HID=m
CONFIG_HIDRAW=y CONFIG_HIDRAW=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_ATARI_MFPSER=y
CONFIG_ATARI_MIDI=y
CONFIG_ATARI_DSP56K=m CONFIG_ATARI_DSP56K=m
CONFIG_AMIGA_BUILTIN_SERIAL=y CONFIG_AMIGA_BUILTIN_SERIAL=y
CONFIG_MULTIFACE_III_TTY=m
CONFIG_SERIAL167=y
CONFIG_DN_SERIAL=y
CONFIG_SERIAL_CONSOLE=y CONFIG_SERIAL_CONSOLE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
......
...@@ -218,8 +218,6 @@ CONFIG_GEN_RTC_X=y ...@@ -218,8 +218,6 @@ CONFIG_GEN_RTC_X=y
CONFIG_HID=m CONFIG_HID=m
CONFIG_HIDRAW=y CONFIG_HIDRAW=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_SERIAL167=y
CONFIG_SERIAL_CONSOLE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
......
...@@ -39,7 +39,7 @@ enum { ...@@ -39,7 +39,7 @@ enum {
#define MAX_UNIT 8 #define MAX_UNIT 8
/* These identify the driver base version and may not be removed. */ /* 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 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
" S.Opichal, M.Jurik, P.Stehlik\n" " S.Opichal, M.Jurik, P.Stehlik\n"
KERN_INFO " http://aranym.org/\n"; KERN_INFO " http://aranym.org/\n";
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
unsigned long hp300_model; unsigned long hp300_model;
unsigned long hp300_uart_scode = -1; 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_hp330[] __initdata = "330";
static char s_hp340[] __initdata = "340"; static char s_hp340[] __initdata = "340";
......
...@@ -30,6 +30,8 @@ extern u_long atari_switches; ...@@ -30,6 +30,8 @@ extern u_long atari_switches;
extern int atari_rtc_year_offset; extern int atari_rtc_year_offset;
extern int atari_dont_touch_floppy_select; extern int atari_dont_touch_floppy_select;
extern int atari_SCC_reset_done;
/* convenience macros for testing machine type */ /* convenience macros for testing machine type */
#define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST) #define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
#define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \ #define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
#define HP300_LEDS 0xf001ffff #define HP300_LEDS 0xf001ffff
extern unsigned char ledstate; extern unsigned char hp300_ledstate;
static __inline__ void blinken_leds(int on, int off) static __inline__ void blinken_leds(int on, int off)
{ {
if (MACH_IS_HP300) if (MACH_IS_HP300)
{ {
ledstate |= on; hp300_ledstate |= on;
ledstate &= ~off; hp300_ledstate &= ~off;
out_8(HP300_LEDS, ~ledstate); out_8(HP300_LEDS, ~hp300_ledstate);
} }
} }
......
...@@ -29,4 +29,10 @@ struct baboon { ...@@ -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 **/ #endif /* __ASSEMBLY **/
...@@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16); ...@@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16);
extern void iop_download_code(uint, __u8 *, uint, __u16); extern void iop_download_code(uint, __u8 *, uint, __u16);
extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16); extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16);
extern void iop_register_interrupts(void);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
...@@ -58,25 +58,6 @@ ...@@ -58,25 +58,6 @@
#define OSS_POWEROFF 0x80 #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__ #ifndef __ASSEMBLY__
struct mac_oss { struct mac_oss {
...@@ -91,4 +72,8 @@ struct mac_oss { ...@@ -91,4 +72,8 @@ struct mac_oss {
extern volatile struct mac_oss *oss; extern volatile struct mac_oss *oss;
extern int oss_present; extern int oss_present;
extern void oss_register_interrupts(void);
extern void oss_irq_enable(int);
extern void oss_irq_disable(int);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
...@@ -211,6 +211,10 @@ ...@@ -211,6 +211,10 @@
extern volatile __u8 *psc; extern volatile __u8 *psc;
extern int psc_present; extern int psc_present;
extern void psc_register_interrupts(void);
extern void psc_irq_enable(int);
extern void psc_irq_disable(int);
/* /*
* Access functions * Access functions
*/ */
......
...@@ -254,6 +254,15 @@ ...@@ -254,6 +254,15 @@
extern volatile __u8 *via1,*via2; extern volatile __u8 *via1,*via2;
extern int rbv_present,via_alt_mapping; 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);
static inline int rbv_set_video_bpp(int bpp) static inline int rbv_set_video_bpp(int bpp)
{ {
char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
......
...@@ -11,16 +11,10 @@ ...@@ -11,16 +11,10 @@
extern void mac_reset(void); extern void mac_reset(void);
extern void mac_poweroff(void); extern void mac_poweroff(void);
extern void mac_init_IRQ(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_enable(struct irq_data *data);
extern void mac_irq_disable(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 * Macintosh Table
*/ */
...@@ -48,7 +42,7 @@ struct mac_model ...@@ -48,7 +42,7 @@ struct mac_model
#define MAC_ADB_IOP 6 #define MAC_ADB_IOP 6
#define MAC_VIA_II 1 #define MAC_VIA_II 1
#define MAC_VIA_IIci 2 #define MAC_VIA_IICI 2
#define MAC_VIA_QUADRA 3 #define MAC_VIA_QUADRA 3
#define MAC_SCSI_NONE 0 #define MAC_SCSI_NONE 0
......
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
#define IRQ_PSC4_3 (35) #define IRQ_PSC4_3 (35)
#define IRQ_MAC_MACE_DMA IRQ_PSC4_3 #define IRQ_MAC_MACE_DMA IRQ_PSC4_3
/* OSS Level 4 interrupts */
#define IRQ_MAC_SCC (33)
/* Level 5 (PSC, AV Macs only) interrupts */ /* Level 5 (PSC, AV Macs only) interrupts */
#define IRQ_PSC5_0 (40) #define IRQ_PSC5_0 (40)
#define IRQ_PSC5_1 (41) #define IRQ_PSC5_1 (41)
...@@ -131,9 +134,6 @@ ...@@ -131,9 +134,6 @@
#define IRQ_BABOON_2 (66) #define IRQ_BABOON_2 (66)
#define IRQ_BABOON_3 (67) #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 SLOT2IRQ(x) (x + 47)
#define IRQ2SLOT(x) (x - 47) #define IRQ2SLOT(x) (x - 47)
......
...@@ -25,9 +25,11 @@ ...@@ -25,9 +25,11 @@
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#endif #endif
#ifdef CONFIG_ISA
#define SERIAL_PORT_DFNS \ #define SERIAL_PORT_DFNS \
/* UART CLK PORT IRQ FLAGS */ \ /* UART CLK PORT IRQ FLAGS */ \
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
#endif
...@@ -132,10 +132,10 @@ ...@@ -132,10 +132,10 @@
#define __NR_adjtimex 124 #define __NR_adjtimex 124
#define __NR_mprotect 125 #define __NR_mprotect 125
#define __NR_sigprocmask 126 #define __NR_sigprocmask 126
/*#define __NR_create_module 127*/ #define __NR_create_module 127
#define __NR_init_module 128 #define __NR_init_module 128
#define __NR_delete_module 129 #define __NR_delete_module 129
/*#define __NR_get_kernel_syms 130*/ #define __NR_get_kernel_syms 130
#define __NR_quotactl 131 #define __NR_quotactl 131
#define __NR_getpgid 132 #define __NR_getpgid 132
#define __NR_fchdir 133 #define __NR_fchdir 133
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
#define __NR_setresuid 164 #define __NR_setresuid 164
#define __NR_getresuid 165 #define __NR_getresuid 165
#define __NR_getpagesize 166 #define __NR_getpagesize 166
/*#define __NR_query_module 167*/ #define __NR_query_module 167
#define __NR_poll 168 #define __NR_poll 168
#define __NR_nfsservctl 169 #define __NR_nfsservctl 169
#define __NR_setresgid 170 #define __NR_setresgid 170
...@@ -193,8 +193,8 @@ ...@@ -193,8 +193,8 @@
#define __NR_capset 185 #define __NR_capset 185
#define __NR_sigaltstack 186 #define __NR_sigaltstack 186
#define __NR_sendfile 187 #define __NR_sendfile 187
/*#define __NR_getpmsg 188*/ /* 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_putpmsg 189 /* some people actually want streams */
#define __NR_vfork 190 #define __NR_vfork 190
#define __NR_ugetrlimit 191 #define __NR_ugetrlimit 191
#define __NR_mmap2 192 #define __NR_mmap2 192
......
...@@ -250,9 +250,8 @@ ...@@ -250,9 +250,8 @@
* USE_MFP: Use the ST-MFP port (Modem1) for serial debug. * USE_MFP: Use the ST-MFP port (Modem1) for serial debug.
* *
* Macintosh constants: * Macintosh constants:
* MAC_SERIAL_DEBUG: Turns on serial debug output for the Macintosh. * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console.
* MAC_USE_SCC_A: Use the SCC port A (modem) for serial debug. * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console.
* MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default).
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
...@@ -268,33 +267,25 @@ ...@@ -268,33 +267,25 @@
#include <asm/machw.h> #include <asm/machw.h>
/*
* Macintosh console support
*/
#ifdef CONFIG_FRAMEBUFFER_CONSOLE #ifdef CONFIG_FRAMEBUFFER_CONSOLE
#define CONSOLE #define CONSOLE
#define CONSOLE_PENGUIN #define CONSOLE_PENGUIN
#endif #endif
/* #ifdef CONFIG_EARLY_PRINTK
* Macintosh serial debug support; outputs boot info to the printer #define SERIAL_DEBUG
* and/or modem serial ports #else
*/ #undef SERIAL_DEBUG
#undef MAC_SERIAL_DEBUG #endif
/* #else /* !CONFIG_MAC */
* 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 */
#endif /* CONFIG_MAC */ #define SERIAL_DEBUG
#endif /* !CONFIG_MAC */
#undef MMU_PRINT #undef MMU_PRINT
#undef MMU_NOCACHE_KERNEL #undef MMU_NOCACHE_KERNEL
#define SERIAL_DEBUG
#undef DEBUG #undef DEBUG
/* /*
...@@ -655,11 +646,11 @@ ENTRY(__start) ...@@ -655,11 +646,11 @@ ENTRY(__start)
lea %pc@(L(mac_rowbytes)),%a1 lea %pc@(L(mac_rowbytes)),%a1
movel %a0@,%a1@ movel %a0@,%a1@
#ifdef MAC_SERIAL_DEBUG #ifdef SERIAL_DEBUG
get_bi_record BI_MAC_SCCBASE get_bi_record BI_MAC_SCCBASE
lea %pc@(L(mac_sccbase)),%a1 lea %pc@(L(mac_sccbase)),%a1
movel %a0@,%a1@ movel %a0@,%a1@
#endif /* MAC_SERIAL_DEBUG */ #endif
#if 0 #if 0
/* /*
...@@ -1427,7 +1418,7 @@ L(mmu_fixup_done): ...@@ -1427,7 +1418,7 @@ L(mmu_fixup_done):
subl %d0,L(console_font) subl %d0,L(console_font)
subl %d0,L(console_font_data) subl %d0,L(console_font_data)
#endif #endif
#ifdef MAC_SERIAL_DEBUG #ifdef SERIAL_DEBUG
orl #0x50000000,L(mac_sccbase) orl #0x50000000,L(mac_sccbase)
#endif #endif
1: 1:
...@@ -1917,7 +1908,7 @@ mmu_030_print: ...@@ -1917,7 +1908,7 @@ mmu_030_print:
jbne 30b jbne 30b
mmu_print_done: mmu_print_done:
puts "\n\n" puts "\n"
func_return mmu_print func_return mmu_print
...@@ -2768,7 +2759,7 @@ L(scc_initable_mac): ...@@ -2768,7 +2759,7 @@ L(scc_initable_mac):
.byte 9,0 /* no interrupts */ .byte 9,0 /* no interrupts */
.byte 10,0 /* NRZ */ .byte 10,0 /* NRZ */
.byte 11,0x50 /* use baud rate generator */ .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 14,1 /* Baud rate generator enable */
.byte 3,0xc1 /* enable receiver */ .byte 3,0xc1 /* enable receiver */
.byte 5,0xea /* enable transmitter */ .byte 5,0xea /* enable transmitter */
...@@ -2906,10 +2897,12 @@ func_start serial_init,%d0/%d1/%a0/%a1 ...@@ -2906,10 +2897,12 @@ func_start serial_init,%d0/%d1/%a0/%a1
#endif #endif
#ifdef CONFIG_MAC #ifdef CONFIG_MAC
is_not_mac(L(serial_init_not_mac)) is_not_mac(L(serial_init_not_mac))
#ifdef MAC_SERIAL_DEBUG
#if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B) #ifdef SERIAL_DEBUG
#define MAC_USE_SCC_B /* You may define either or both of these. */
#endif #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_b_ctrl_offset 0x0
#define mac_scc_cha_a_ctrl_offset 0x2 #define mac_scc_cha_a_ctrl_offset 0x2
#define mac_scc_cha_b_data_offset 0x4 #define mac_scc_cha_b_data_offset 0x4
...@@ -2940,7 +2933,7 @@ func_start serial_init,%d0/%d1/%a0/%a1 ...@@ -2940,7 +2933,7 @@ func_start serial_init,%d0/%d1/%a0/%a1
jra 7b jra 7b
8: 8:
#endif /* MAC_USE_SCC_B */ #endif /* MAC_USE_SCC_B */
#endif /* MAC_SERIAL_DEBUG */ #endif /* SERIAL_DEBUG */
jra L(serial_init_done) jra L(serial_init_done)
L(serial_init_not_mac): L(serial_init_not_mac):
...@@ -3011,7 +3004,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 ...@@ -3011,7 +3004,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
#ifdef CONFIG_MAC #ifdef CONFIG_MAC
is_not_mac(5f) is_not_mac(5f)
#ifdef MAC_SERIAL_DEBUG #ifdef SERIAL_DEBUG
#ifdef MAC_USE_SCC_A #ifdef MAC_USE_SCC_A
movel %pc@(L(mac_sccbase)),%a1 movel %pc@(L(mac_sccbase)),%a1
...@@ -3029,7 +3022,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 ...@@ -3029,7 +3022,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
moveb %d0,%a1@(mac_scc_cha_b_data_offset) moveb %d0,%a1@(mac_scc_cha_b_data_offset)
#endif /* MAC_USE_SCC_B */ #endif /* MAC_USE_SCC_B */
#endif /* MAC_SERIAL_DEBUG */ #endif /* SERIAL_DEBUG */
jra L(serial_putc_done) jra L(serial_putc_done)
5: 5:
...@@ -3248,33 +3241,39 @@ func_return putn ...@@ -3248,33 +3241,39 @@ func_return putn
#ifdef CONFIG_MAC #ifdef CONFIG_MAC
/* /*
* mac_serial_print * mac_early_print
* *
* This routine takes its parameters on the stack. It then * This routine takes its parameters on the stack. It then
* turns around and calls the internal routine. This routine * turns around and calls the internal routines. This routine
* is used until the Linux console driver initializes itself. * is used by the boot console.
* *
* The calling parameters are: * 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 * This routine does NOT understand variable arguments only
* simple strings! * simple strings!
*/ */
ENTRY(mac_serial_print) ENTRY(mac_early_print)
moveml %d0/%a0,%sp@- moveml %d0/%d1/%a0,%sp@-
#if 1 movew %sr,%sp@-
move %sr,%sp@-
ori #0x0700,%sr ori #0x0700,%sr
#endif movel %sp@(18),%a0 /* fetch parameter */
movel %sp@(10),%a0 /* fetch parameter */ movel %sp@(22),%d1 /* fetch parameter */
jra 2f jra 2f
1: serial_putc %d0 1:
2: moveb %a0@+,%d0 #ifdef CONSOLE
jne 1b console_putc %d0
#if 1
move %sp@+,%sr
#endif #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 rts
#endif /* CONFIG_MAC */ #endif /* CONFIG_MAC */
...@@ -3409,10 +3408,10 @@ func_start console_put_stats,%a0/%d7 ...@@ -3409,10 +3408,10 @@ func_start console_put_stats,%a0/%d7
* a0 = pointer to boot_info * a0 = pointer to boot_info
* d7 = value of boot_info fields * d7 = value of boot_info fields
*/ */
puts "\nMacLinux\n\n" puts "\nMacLinux\n"
#ifdef SERIAL_DEBUG #ifdef SERIAL_DEBUG
puts " vidaddr:" puts "\n vidaddr:"
putn %pc@(L(mac_videobase)) /* video addr. */ putn %pc@(L(mac_videobase)) /* video addr. */
puts "\n _stext:" puts "\n _stext:"
...@@ -3423,19 +3422,21 @@ func_start console_put_stats,%a0/%d7 ...@@ -3423,19 +3422,21 @@ func_start console_put_stats,%a0/%d7
lea %pc@(_end),%a0 lea %pc@(_end),%a0
putn %a0 putn %a0
puts "\ncpuid:" puts "\n cpuid:"
putn %pc@(L(cputype)) putn %pc@(L(cputype))
putc '\n'
#ifdef MAC_SERIAL_DEBUG # ifdef CONFIG_MAC
puts "\n sccbase:"
putn %pc@(L(mac_sccbase)) putn %pc@(L(mac_sccbase))
# endif
# ifdef MMU_PRINT
putc '\n' putc '\n'
#endif
# if defined(MMU_PRINT)
jbsr mmu_print_machine_cpu_types jbsr mmu_print_machine_cpu_types
# endif /* MMU_PRINT */ # endif
#endif /* SERIAL_DEBUG */ #endif /* SERIAL_DEBUG */
putc '\n'
func_return console_put_stats func_return console_put_stats
#ifdef CONSOLE_PENGUIN #ifdef CONSOLE_PENGUIN
...@@ -3896,11 +3897,11 @@ L(mac_dimensions): ...@@ -3896,11 +3897,11 @@ L(mac_dimensions):
.long 0 .long 0
L(mac_rowbytes): L(mac_rowbytes):
.long 0 .long 0
#ifdef MAC_SERIAL_DEBUG #ifdef SERIAL_DEBUG
L(mac_sccbase): L(mac_sccbase):
.long 0 .long 0
#endif /* MAC_SERIAL_DEBUG */
#endif #endif
#endif /* CONFIG_MAC */
#if defined (CONFIG_APOLLO) #if defined (CONFIG_APOLLO)
LSRB0 = 0x10412 LSRB0 = 0x10412
......
...@@ -8,13 +8,8 @@ ...@@ -8,13 +8,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/traps.h>
#include <asm/bootinfo.h>
#include <asm/macintosh.h> #include <asm/macintosh.h>
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/mac_baboon.h> #include <asm/mac_baboon.h>
...@@ -23,7 +18,6 @@ ...@@ -23,7 +18,6 @@
int baboon_present; int baboon_present;
static volatile struct baboon *baboon; static volatile struct baboon *baboon;
static unsigned char baboon_disabled;
#if 0 #if 0
extern int macide_ack_intr(struct ata_channel *); extern int macide_ack_intr(struct ata_channel *);
...@@ -89,51 +83,32 @@ static void baboon_irq(unsigned int irq, struct irq_desc *desc) ...@@ -89,51 +83,32 @@ static void baboon_irq(unsigned int irq, struct irq_desc *desc)
void __init baboon_register_interrupts(void) void __init baboon_register_interrupts(void)
{ {
baboon_disabled = 0;
irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq); irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq);
} }
/* /*
* The means for masking individual baboon interrupts remains a mystery, so * The means for masking individual Baboon interrupts remains a mystery.
* enable the umbrella interrupt only when no baboon interrupt is disabled. * 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) void baboon_irq_enable(int irq)
{ {
int irq_idx = IRQ_IDX(irq);
#ifdef DEBUG_IRQUSE #ifdef DEBUG_IRQUSE
printk("baboon_irq_enable(%d)\n", irq); printk("baboon_irq_enable(%d)\n", irq);
#endif #endif
baboon_disabled &= ~(1 << irq_idx); mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
if (!baboon_disabled)
mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
} }
void baboon_irq_disable(int irq) void baboon_irq_disable(int irq)
{ {
int irq_idx = IRQ_IDX(irq);
#ifdef DEBUG_IRQUSE #ifdef DEBUG_IRQUSE
printk("baboon_irq_disable(%d)\n", irq); printk("baboon_irq_disable(%d)\n", irq);
#endif #endif
baboon_disabled |= 1 << irq_idx; mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
if (baboon_disabled)
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);
return baboon->mb_ifr & (1 << irq_idx);
} }
...@@ -71,6 +71,31 @@ static void mac_get_model(char *str); ...@@ -71,6 +71,31 @@ static void mac_get_model(char *str);
static void mac_identify(void); static void mac_identify(void);
static void mac_report_hardware(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) static void __init mac_sched_init(irq_handler_t vector)
{ {
via_init_clock(vector); via_init_clock(vector);
...@@ -164,6 +189,10 @@ void __init config_mac(void) ...@@ -164,6 +189,10 @@ void __init config_mac(void)
mach_beep = mac_mksound; mach_beep = mac_mksound;
#endif #endif
#ifdef CONFIG_EARLY_PRINTK
register_console(&mac_early_cons);
#endif
/* /*
* Determine hardware present * Determine hardware present
*/ */
...@@ -192,7 +221,7 @@ void __init config_mac(void) ...@@ -192,7 +221,7 @@ void __init config_mac(void)
* inaccurate, so look here if a new Mac model won't run. Example: if * 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 * a Mac crashes immediately after the VIA1 registers have been dumped
* to the screen, it probably died attempting to read DirB on a RBV. * 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; struct mac_model *macintosh_config;
...@@ -267,7 +296,7 @@ static struct mac_model mac_data_table[] = { ...@@ -267,7 +296,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_IICI, .ident = MAC_MODEL_IICI,
.name = "IIci", .name = "IIci",
.adb_type = MAC_ADB_II, .adb_type = MAC_ADB_II,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -276,7 +305,7 @@ static struct mac_model mac_data_table[] = { ...@@ -276,7 +305,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_IIFX, .ident = MAC_MODEL_IIFX,
.name = "IIfx", .name = "IIfx",
.adb_type = MAC_ADB_IOP, .adb_type = MAC_ADB_IOP,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_IOP, .scc_type = MAC_SCC_IOP,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -285,7 +314,7 @@ static struct mac_model mac_data_table[] = { ...@@ -285,7 +314,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_IISI, .ident = MAC_MODEL_IISI,
.name = "IIsi", .name = "IIsi",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -294,7 +323,7 @@ static struct mac_model mac_data_table[] = { ...@@ -294,7 +323,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_IIVI, .ident = MAC_MODEL_IIVI,
.name = "IIvi", .name = "IIvi",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -303,7 +332,7 @@ static struct mac_model mac_data_table[] = { ...@@ -303,7 +332,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_IIVX, .ident = MAC_MODEL_IIVX,
.name = "IIvx", .name = "IIvx",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -318,7 +347,7 @@ static struct mac_model mac_data_table[] = { ...@@ -318,7 +347,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_CLII, .ident = MAC_MODEL_CLII,
.name = "Classic II", .name = "Classic II",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -327,7 +356,7 @@ static struct mac_model mac_data_table[] = { ...@@ -327,7 +356,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_CCL, .ident = MAC_MODEL_CCL,
.name = "Color Classic", .name = "Color Classic",
.adb_type = MAC_ADB_CUDA, .adb_type = MAC_ADB_CUDA,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -336,7 +365,7 @@ static struct mac_model mac_data_table[] = { ...@@ -336,7 +365,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_CCLII, .ident = MAC_MODEL_CCLII,
.name = "Color Classic II", .name = "Color Classic II",
.adb_type = MAC_ADB_CUDA, .adb_type = MAC_ADB_CUDA,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -351,7 +380,7 @@ static struct mac_model mac_data_table[] = { ...@@ -351,7 +380,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_LC, .ident = MAC_MODEL_LC,
.name = "LC", .name = "LC",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -360,7 +389,7 @@ static struct mac_model mac_data_table[] = { ...@@ -360,7 +389,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_LCII, .ident = MAC_MODEL_LCII,
.name = "LC II", .name = "LC II",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -369,7 +398,7 @@ static struct mac_model mac_data_table[] = { ...@@ -369,7 +398,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_LCIII, .ident = MAC_MODEL_LCIII,
.name = "LC III", .name = "LC III",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -497,7 +526,7 @@ static struct mac_model mac_data_table[] = { ...@@ -497,7 +526,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_P460, .ident = MAC_MODEL_P460,
.name = "Performa 460", .name = "Performa 460",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -524,7 +553,7 @@ static struct mac_model mac_data_table[] = { ...@@ -524,7 +553,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_P520, .ident = MAC_MODEL_P520,
.name = "Performa 520", .name = "Performa 520",
.adb_type = MAC_ADB_CUDA, .adb_type = MAC_ADB_CUDA,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -533,7 +562,7 @@ static struct mac_model mac_data_table[] = { ...@@ -533,7 +562,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_P550, .ident = MAC_MODEL_P550,
.name = "Performa 550", .name = "Performa 550",
.adb_type = MAC_ADB_CUDA, .adb_type = MAC_ADB_CUDA,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -565,7 +594,7 @@ static struct mac_model mac_data_table[] = { ...@@ -565,7 +594,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_TV, .ident = MAC_MODEL_TV,
.name = "TV", .name = "TV",
.adb_type = MAC_ADB_CUDA, .adb_type = MAC_ADB_CUDA,
.via_type = MAC_VIA_QUADRA, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -574,7 +603,7 @@ static struct mac_model mac_data_table[] = { ...@@ -574,7 +603,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_P600, .ident = MAC_MODEL_P600,
.name = "Performa 600", .name = "Performa 600",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_IISI,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -645,8 +674,8 @@ static struct mac_model mac_data_table[] = { ...@@ -645,8 +674,8 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_PB150, .ident = MAC_MODEL_PB150,
.name = "PowerBook 150", .name = "PowerBook 150",
.adb_type = MAC_ADB_PB1, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.ide_type = MAC_IDE_PB, .ide_type = MAC_IDE_PB,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
...@@ -732,17 +761,13 @@ static struct mac_model mac_data_table[] = { ...@@ -732,17 +761,13 @@ static struct mac_model mac_data_table[] = {
* PowerBook Duos are pretty much like normal PowerBooks * PowerBook Duos are pretty much like normal PowerBooks
* All of these probably have onboard SONIC in the Dock which * All of these probably have onboard SONIC in the Dock which
* means we'll have to probe for it eventually. * 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, .ident = MAC_MODEL_PB210,
.name = "PowerBook Duo 210", .name = "PowerBook Duo 210",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -751,7 +776,7 @@ static struct mac_model mac_data_table[] = { ...@@ -751,7 +776,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_PB230, .ident = MAC_MODEL_PB230,
.name = "PowerBook Duo 230", .name = "PowerBook Duo 230",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -760,7 +785,7 @@ static struct mac_model mac_data_table[] = { ...@@ -760,7 +785,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_PB250, .ident = MAC_MODEL_PB250,
.name = "PowerBook Duo 250", .name = "PowerBook Duo 250",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -769,7 +794,7 @@ static struct mac_model mac_data_table[] = { ...@@ -769,7 +794,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_PB270C, .ident = MAC_MODEL_PB270C,
.name = "PowerBook Duo 270c", .name = "PowerBook Duo 270c",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -778,7 +803,7 @@ static struct mac_model mac_data_table[] = { ...@@ -778,7 +803,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_PB280, .ident = MAC_MODEL_PB280,
.name = "PowerBook Duo 280", .name = "PowerBook Duo 280",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -787,7 +812,7 @@ static struct mac_model mac_data_table[] = { ...@@ -787,7 +812,7 @@ static struct mac_model mac_data_table[] = {
.ident = MAC_MODEL_PB280C, .ident = MAC_MODEL_PB280C,
.name = "PowerBook Duo 280c", .name = "PowerBook Duo 280c",
.adb_type = MAC_ADB_PB2, .adb_type = MAC_ADB_PB2,
.via_type = MAC_VIA_IIci, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_QUADRA, .scc_type = MAC_SCC_QUADRA,
.nubus_type = MAC_NUBUS, .nubus_type = MAC_NUBUS,
...@@ -864,8 +889,14 @@ static void __init mac_identify(void) ...@@ -864,8 +889,14 @@ static void __init mac_identify(void)
scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
break; break;
default: default:
scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; /* On non-PSC machines, the serial ports share an IRQ. */
scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; 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; break;
} }
......
...@@ -115,7 +115,6 @@ ...@@ -115,7 +115,6 @@
#include <asm/macintosh.h> #include <asm/macintosh.h>
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/mac_iop.h> #include <asm/mac_iop.h>
#include <asm/mac_oss.h>
/*#define DEBUG_IOP*/ /*#define DEBUG_IOP*/
...@@ -149,8 +148,6 @@ static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN]; ...@@ -149,8 +148,6 @@ static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN];
irqreturn_t iop_ism_irq(int, void *); irqreturn_t iop_ism_irq(int, void *);
extern void oss_irq_enable(int);
/* /*
* Private access functions * Private access functions
*/ */
...@@ -304,11 +301,10 @@ void __init iop_init(void) ...@@ -304,11 +301,10 @@ void __init iop_init(void)
void __init iop_register_interrupts(void) void __init iop_register_interrupts(void)
{ {
if (iop_ism_present) { if (iop_ism_present) {
if (oss_present) { if (macintosh_config->ident == MAC_MODEL_IIFX) {
if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 0, if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0,
"ISM IOP", (void *)IOP_NUM_ISM)) "ISM IOP", (void *)IOP_NUM_ISM))
pr_err("Couldn't register ISM IOP interrupt\n"); pr_err("Couldn't register ISM IOP interrupt\n");
oss_irq_enable(IRQ_MAC_ADB);
} else { } else {
if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP", if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP",
(void *)IOP_NUM_ISM)) (void *)IOP_NUM_ISM))
......
...@@ -26,10 +26,6 @@ ...@@ -26,10 +26,6 @@
* - slot 6: timer 1 (not on IIci) * - slot 6: timer 1 (not on IIci)
* - slot 7: status of IRQ; signals 'any enabled int.' * - 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: * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes:
* *
* 3 - unused (?) * 3 - unused (?)
...@@ -42,21 +38,30 @@ ...@@ -42,21 +38,30 @@
* *
* 6 - off switch (?) * 6 - off switch (?)
* *
* For OSS Macintoshes (IIfx only at this point): * 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:
* *
* 3 - Nubus interrupt * 1 - unused (?)
* - slot 0: Slot $9
* - slot 1: Slot $A
* - slot 2: Slot $B
* - slot 3: Slot $C
* - slot 4: Slot $D
* - slot 5: Slot $E
* *
* 4 - SCC IOP * 3 - on-board SONIC
*
* 5 - Apple Sound Chip (ASC)
*
* 6 - VIA1
*
* For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to
* the Quadra (A/UX) mapping:
*
* 1 - ISM IOP (ADB)
* *
* 5 - ISM IOP (ADB?) * 2 - SCSI
* *
* 6 - unused * 3 - NuBus
*
* 4 - SCC IOP
*
* 6 - VIA1
* *
* For PSC Macintoshes (660AV, 840AV): * For PSC Macintoshes (660AV, 840AV):
* *
...@@ -100,87 +105,28 @@ ...@@ -100,87 +105,28 @@
* case. They're hidden behind the Nubus slot $C interrupt thus adding a * 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? * 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 <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel_stat.h> #include <linux/interrupt.h>
#include <linux/interrupt.h> /* for intr_count */ #include <linux/irq.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/seq_file.h>
#include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/traps.h>
#include <asm/bootinfo.h>
#include <asm/macintosh.h> #include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/mac_via.h> #include <asm/mac_via.h>
#include <asm/mac_psc.h> #include <asm/mac_psc.h>
#include <asm/mac_oss.h>
#include <asm/mac_iop.h>
#include <asm/mac_baboon.h>
#include <asm/hwtest.h> #include <asm/hwtest.h>
#include <asm/errno.h>
#include <asm/macints.h>
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#include <asm/mac_oss.h>
#define SHUTUP_SONIC #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);
extern int via_irq_pending(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);
extern int oss_irq_pending(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);
extern int psc_irq_pending(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 * console_loglevel determines NMI handler function
*/ */
...@@ -190,10 +136,15 @@ irqreturn_t mac_debug_handler(int, void *); ...@@ -190,10 +136,15 @@ irqreturn_t mac_debug_handler(int, void *);
/* #define DEBUG_MACINTS */ /* #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 = { static struct irq_chip mac_irq_chip = {
.name = "mac", .name = "mac",
.irq_enable = mac_irq_enable, .irq_enable = mac_irq_enable,
.irq_disable = mac_irq_disable, .irq_disable = mac_irq_disable,
.irq_startup = mac_irq_startup,
.irq_shutdown = mac_irq_shutdown,
}; };
void __init mac_init_IRQ(void) void __init mac_init_IRQ(void)
...@@ -239,8 +190,6 @@ void __init mac_init_IRQ(void) ...@@ -239,8 +190,6 @@ void __init mac_init_IRQ(void)
/* /*
* mac_irq_enable - enable an interrupt source * mac_irq_enable - enable an interrupt source
* mac_irq_disable - disable 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. * These routines are just dispatchers to the VIA/OSS/PSC routines.
*/ */
...@@ -252,8 +201,6 @@ void mac_irq_enable(struct irq_data *data) ...@@ -252,8 +201,6 @@ void mac_irq_enable(struct irq_data *data)
switch(irq_src) { switch(irq_src) {
case 1: case 1:
via_irq_enable(irq);
break;
case 2: case 2:
case 7: case 7:
if (oss_present) if (oss_present)
...@@ -262,6 +209,7 @@ void mac_irq_enable(struct irq_data *data) ...@@ -262,6 +209,7 @@ void mac_irq_enable(struct irq_data *data)
via_irq_enable(irq); via_irq_enable(irq);
break; break;
case 3: case 3:
case 4:
case 5: case 5:
case 6: case 6:
if (psc_present) if (psc_present)
...@@ -269,10 +217,6 @@ void mac_irq_enable(struct irq_data *data) ...@@ -269,10 +217,6 @@ void mac_irq_enable(struct irq_data *data)
else if (oss_present) else if (oss_present)
oss_irq_enable(irq); oss_irq_enable(irq);
break; break;
case 4:
if (psc_present)
psc_irq_enable(irq);
break;
case 8: case 8:
if (baboon_present) if (baboon_present)
baboon_irq_enable(irq); baboon_irq_enable(irq);
...@@ -287,8 +231,6 @@ void mac_irq_disable(struct irq_data *data) ...@@ -287,8 +231,6 @@ void mac_irq_disable(struct irq_data *data)
switch(irq_src) { switch(irq_src) {
case 1: case 1:
via_irq_disable(irq);
break;
case 2: case 2:
case 7: case 7:
if (oss_present) if (oss_present)
...@@ -297,6 +239,7 @@ void mac_irq_disable(struct irq_data *data) ...@@ -297,6 +239,7 @@ void mac_irq_disable(struct irq_data *data)
via_irq_disable(irq); via_irq_disable(irq);
break; break;
case 3: case 3:
case 4:
case 5: case 5:
case 6: case 6:
if (psc_present) if (psc_present)
...@@ -304,10 +247,6 @@ void mac_irq_disable(struct irq_data *data) ...@@ -304,10 +247,6 @@ void mac_irq_disable(struct irq_data *data)
else if (oss_present) else if (oss_present)
oss_irq_disable(irq); oss_irq_disable(irq);
break; break;
case 4:
if (psc_present)
psc_irq_disable(irq);
break;
case 8: case 8:
if (baboon_present) if (baboon_present)
baboon_irq_disable(irq); baboon_irq_disable(irq);
...@@ -315,65 +254,27 @@ void mac_irq_disable(struct irq_data *data) ...@@ -315,65 +254,27 @@ void mac_irq_disable(struct irq_data *data)
} }
} }
void mac_clear_irq(unsigned int irq) static unsigned int mac_irq_startup(struct irq_data *data)
{ {
switch(IRQ_SRC(irq)) { int irq = data->irq;
case 1:
via_irq_clear(irq); if (IRQ_SRC(irq) == 7 && !oss_present)
break; via_nubus_irq_startup(irq);
case 2: else
case 7: mac_irq_enable(data);
if (oss_present)
oss_irq_clear(irq); return 0;
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) static void mac_irq_shutdown(struct irq_data *data)
{ {
switch(IRQ_SRC(irq)) { int irq = data->irq;
case 1:
return via_irq_pending(irq); if (IRQ_SRC(irq) == 7 && !oss_present)
case 2: via_nubus_irq_shutdown(irq);
case 7: else
if (oss_present) mac_irq_disable(data);
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]; static int num_debug[8];
......
/* /*
* OSS handling * Operating System Services (OSS) chip handling
* Written by Joshua M. Thompson (funaho@jurai.org) * Written by Joshua M. Thompson (funaho@jurai.org)
* *
* *
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
int oss_present; int oss_present;
volatile struct mac_oss *oss; volatile struct mac_oss *oss;
extern void via1_irq(unsigned int irq, struct irq_desc *desc);
/* /*
* Initialize the OSS * Initialize the OSS
* *
...@@ -51,10 +49,8 @@ void __init oss_init(void) ...@@ -51,10 +49,8 @@ void __init oss_init(void)
/* do this by setting the source's interrupt level to zero. */ /* do this by setting the source's interrupt level to zero. */
for (i = 0; i <= OSS_NUM_SOURCES; i++) { 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;
} }
/* /*
...@@ -66,17 +62,13 @@ void __init oss_nubus_init(void) ...@@ -66,17 +62,13 @@ void __init oss_nubus_init(void)
} }
/* /*
* Handle miscellaneous OSS interrupts. Right now that's just sound * Handle miscellaneous OSS interrupts.
* and SCSI; everything else is routed to its own autovector IRQ.
*/ */
static void oss_irq(unsigned int irq, struct irq_desc *desc) static void oss_irq(unsigned int irq, struct irq_desc *desc)
{ {
int events; int events = oss->irq_pending &
(OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM);
events = oss->irq_pending & (OSS_IP_SOUND|OSS_IP_SCSI);
if (!events)
return;
#ifdef DEBUG_IRQS #ifdef DEBUG_IRQS
if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) { if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) {
...@@ -84,16 +76,20 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc) ...@@ -84,16 +76,20 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc)
(int) oss->irq_pending); (int) oss->irq_pending);
} }
#endif #endif
/* FIXME: how do you clear a pending IRQ? */
if (events & OSS_IP_SOUND) { if (events & OSS_IP_IOPSCC) {
oss->irq_pending &= ~OSS_IP_SOUND; oss->irq_pending &= ~OSS_IP_IOPSCC;
/* FIXME: call sound handler */ generic_handle_irq(IRQ_MAC_SCC);
} else if (events & OSS_IP_SCSI) { }
if (events & OSS_IP_SCSI) {
oss->irq_pending &= ~OSS_IP_SCSI; oss->irq_pending &= ~OSS_IP_SCSI;
generic_handle_irq(IRQ_MAC_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);
} }
} }
...@@ -132,14 +128,29 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc) ...@@ -132,14 +128,29 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)
/* /*
* Register the OSS and NuBus interrupt dispatchers. * 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) void __init oss_register_interrupts(void)
{ {
irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); irq_set_chained_handler(OSS_IRQLEV_IOPISM, oss_irq);
irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq);
irq_set_chained_handler(OSS_IRQLEV_SOUND, oss_irq); irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq);
irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_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;
} }
/* /*
...@@ -158,13 +169,13 @@ void oss_irq_enable(int irq) { ...@@ -158,13 +169,13 @@ void oss_irq_enable(int irq) {
switch(irq) { switch(irq) {
case IRQ_MAC_SCC: case IRQ_MAC_SCC:
oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC;
break; return;
case IRQ_MAC_ADB: case IRQ_MAC_ADB:
oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM; oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM;
break; return;
case IRQ_MAC_SCSI: case IRQ_MAC_SCSI:
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
break; return;
case IRQ_NUBUS_9: case IRQ_NUBUS_9:
case IRQ_NUBUS_A: case IRQ_NUBUS_A:
case IRQ_NUBUS_B: case IRQ_NUBUS_B:
...@@ -173,13 +184,11 @@ void oss_irq_enable(int irq) { ...@@ -173,13 +184,11 @@ void oss_irq_enable(int irq) {
case IRQ_NUBUS_E: case IRQ_NUBUS_E:
irq -= NUBUS_SOURCE_BASE; irq -= NUBUS_SOURCE_BASE;
oss->irq_level[irq] = OSS_IRQLEV_NUBUS; oss->irq_level[irq] = OSS_IRQLEV_NUBUS;
break; return;
#ifdef DEBUG_IRQUSE
default:
printk("%s unknown irq %d\n", __func__, irq);
break;
#endif
} }
if (IRQ_SRC(irq) == 1)
via_irq_enable(irq);
} }
/* /*
...@@ -195,50 +204,14 @@ void oss_irq_disable(int irq) { ...@@ -195,50 +204,14 @@ void oss_irq_disable(int irq) {
#endif #endif
switch(irq) { switch(irq) {
case IRQ_MAC_SCC: case IRQ_MAC_SCC:
oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; oss->irq_level[OSS_IOPSCC] = 0;
break; return;
case IRQ_MAC_ADB:
oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_DISABLED;
break;
case IRQ_MAC_SCSI:
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
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_level[irq] = OSS_IRQLEV_DISABLED;
break;
#ifdef DEBUG_IRQUSE
default:
printk("%s unknown irq %d\n", __func__, irq);
break;
#endif
}
}
/*
* 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: case IRQ_MAC_ADB:
oss->irq_pending &= ~OSS_IP_IOPISM; oss->irq_level[OSS_IOPISM] = 0;
break; return;
case IRQ_MAC_SCSI: case IRQ_MAC_SCSI:
oss->irq_pending &= ~OSS_IP_SCSI; oss->irq_level[OSS_SCSI] = 0;
break; return;
case IRQ_NUBUS_9: case IRQ_NUBUS_9:
case IRQ_NUBUS_A: case IRQ_NUBUS_A:
case IRQ_NUBUS_B: case IRQ_NUBUS_B:
...@@ -246,36 +219,10 @@ void oss_irq_clear(int irq) { ...@@ -246,36 +219,10 @@ void oss_irq_clear(int irq) {
case IRQ_NUBUS_D: case IRQ_NUBUS_D:
case IRQ_NUBUS_E: case IRQ_NUBUS_E:
irq -= NUBUS_SOURCE_BASE; irq -= NUBUS_SOURCE_BASE;
oss->irq_pending &= ~(1 << irq); oss->irq_level[irq] = 0;
break; return;
} }
}
/*
* Check to see if a specific OSS interrupt is pending
*/
int oss_irq_pending(int irq) if (IRQ_SRC(irq) == 1)
{ via_irq_disable(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;
} }
...@@ -180,20 +180,3 @@ void psc_irq_disable(int irq) { ...@@ -180,20 +180,3 @@ void psc_irq_disable(int irq) {
#endif #endif
psc_write_byte(pIER, 1 << irq_idx); 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);
int irq_idx = IRQ_IDX(irq);
int pIFR = pIERbase + (irq_src << 4);
return psc_read_byte(pIFR) & (1 << irq_idx);
}
This diff is collapsed.
...@@ -124,6 +124,163 @@ static void __init mvme16x_init_IRQ (void) ...@@ -124,6 +124,163 @@ static void __init mvme16x_init_IRQ (void)
#define PccSCCMICR 0x1d #define PccSCCMICR 0x1d
#define PccSCCTICR 0x1e #define PccSCCTICR 0x1e
#define PccSCCRICR 0x1f #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) void __init config_mvme16x(void)
{ {
...@@ -183,6 +340,9 @@ void __init config_mvme16x(void) ...@@ -183,6 +340,9 @@ void __init config_mvme16x(void)
pcc2chip[PccSCCMICR] = 0x10; pcc2chip[PccSCCMICR] = 0x10;
pcc2chip[PccSCCTICR] = 0x10; pcc2chip[PccSCCTICR] = 0x10;
pcc2chip[PccSCCRICR] = 0x10; pcc2chip[PccSCCRICR] = 0x10;
#ifdef CONFIG_EARLY_PRINTK
mvme16x_early_console();
#endif
} }
} }
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <asm/macintosh.h>
#include <asm/mac_via.h> #include <asm/mac_via.h>
#define CARDNAME "swim" #define CARDNAME "swim"
......
...@@ -142,8 +142,7 @@ static int macsonic_open(struct net_device* dev) ...@@ -142,8 +142,7 @@ static int macsonic_open(struct net_device* dev)
{ {
int retval; int retval;
retval = request_irq(dev->irq, sonic_interrupt, IRQ_FLG_FAST, retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);
"sonic", dev);
if (retval) { if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n", printk(KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, dev->irq); dev->name, dev->irq);
...@@ -154,8 +153,8 @@ static int macsonic_open(struct net_device* dev) ...@@ -154,8 +153,8 @@ static int macsonic_open(struct net_device* dev)
* rupt as well, which must prevent re-entrance of the sonic handler. * rupt as well, which must prevent re-entrance of the sonic handler.
*/ */
if (dev->irq == IRQ_AUTO_3) { if (dev->irq == IRQ_AUTO_3) {
retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, retval = request_irq(IRQ_NUBUS_9, macsonic_interrupt, 0,
IRQ_FLG_FAST, "sonic", dev); "sonic", dev);
if (retval) { if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n", printk(KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, IRQ_NUBUS_9); dev->name, IRQ_NUBUS_9);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/macintosh.h> #include <asm/macintosh.h>
#include <asm/mac_via.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
...@@ -149,7 +150,7 @@ static inline int mac_esp_wait_for_dreq(struct esp *esp) ...@@ -149,7 +150,7 @@ static inline int mac_esp_wait_for_dreq(struct esp *esp)
do { do {
if (mep->pdma_regs == NULL) { if (mep->pdma_regs == NULL) {
if (mac_irq_pending(IRQ_MAC_SCSIDRQ)) if (via2_scsi_drq_pending())
return 0; return 0;
} else { } else {
if (nubus_readl(mep->pdma_regs) & 0x200) if (nubus_readl(mep->pdma_regs) & 0x200)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment