xref: /linux/arch/m68k/q40/README (revision 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2)
1*1da177e4SLinus TorvaldsLinux for the Q40
2*1da177e4SLinus Torvalds=================
3*1da177e4SLinus Torvalds
4*1da177e4SLinus TorvaldsYou may try http://www.geocities.com/SiliconValley/Bay/2602/ for
5*1da177e4SLinus Torvaldssome up to date information. Booter and other tools will be also
6*1da177e4SLinus Torvaldsavailable from this place or ftp.uni-erlangen.de/linux/680x0/q40/
7*1da177e4SLinus Torvaldsand mirrors.
8*1da177e4SLinus Torvalds
9*1da177e4SLinus TorvaldsHints to documentation usually refer to the linux source tree in
10*1da177e4SLinus Torvalds/usr/src/linux/Documentation unless URL given.
11*1da177e4SLinus Torvalds
12*1da177e4SLinus TorvaldsIt seems IRQ unmasking can't be safely done on a Q40. IRQ probing
13*1da177e4SLinus Torvaldsis not implemented - do not try it! (See below)
14*1da177e4SLinus Torvalds
15*1da177e4SLinus TorvaldsFor a list of kernel command-line options read the documentation for the
16*1da177e4SLinus Torvaldsparticular device drivers.
17*1da177e4SLinus Torvalds
18*1da177e4SLinus TorvaldsThe floppy imposes a very high interrupt load on the CPU, approx 30K/s.
19*1da177e4SLinus TorvaldsWhen something blocks interrupts (HD) it will lose some of them, so far
20*1da177e4SLinus Torvaldsthis is not known to have caused any data loss. On highly loaded systems
21*1da177e4SLinus Torvaldsit can make the floppy very slow or practically stop. Other Q40 OS' simply
22*1da177e4SLinus Torvaldspoll the floppy for this reason - something that can't be done in Linux.
23*1da177e4SLinus TorvaldsOnly possible cure is getting a 82072 controller with fifo instead of
24*1da177e4SLinus Torvaldsthe 8272A.
25*1da177e4SLinus Torvalds
26*1da177e4SLinus Torvaldsdrivers used by the Q40, apart from the very obvious (console etc.):
27*1da177e4SLinus Torvalds	drivers/char/q40_keyb.c		# use PC keymaps for national keyboards
28*1da177e4SLinus Torvalds		     serial.c		# normal PC driver - any speed
29*1da177e4SLinus Torvalds	             lp.c		# printer driver
30*1da177e4SLinus Torvalds		     genrtc.c		# RTC
31*1da177e4SLinus Torvalds		char/joystick/*		# most of this should work, not
32*1da177e4SLinus Torvalds				        # in default config.in
33*1da177e4SLinus Torvalds	        block/q40ide.c		# startup for ide
34*1da177e4SLinus Torvalds		      ide*		# see Documentation/ide.txt
35*1da177e4SLinus Torvalds		      floppy.c		# normal PC driver, DMA emu in asm/floppy.h
36*1da177e4SLinus Torvalds					# and arch/m68k/kernel/entry.S
37*1da177e4SLinus Torvalds					# see drivers/block/README.fd
38*1da177e4SLinus Torvalds		net/ne.c
39*1da177e4SLinus Torvalds		video/q40fb.c
40*1da177e4SLinus Torvalds		parport/*
41*1da177e4SLinus Torvalds		sound/dmasound_core.c
42*1da177e4SLinus Torvalds		      dmasound_q40.c
43*1da177e4SLinus Torvalds
44*1da177e4SLinus TorvaldsVarious other PC drivers can be enabled simply by adding them to
45*1da177e4SLinus Torvaldsarch/m68k/config.in, especially 8 bit devices should be without any
46*1da177e4SLinus Torvaldsproblems. For cards using 16bit io/mem more care is required, like
47*1da177e4SLinus Torvaldschecking byte order issues, hacking memcpy_*_io etc.
48*1da177e4SLinus Torvalds
49*1da177e4SLinus Torvalds
50*1da177e4SLinus TorvaldsDebugging
51*1da177e4SLinus Torvalds=========
52*1da177e4SLinus Torvalds
53*1da177e4SLinus TorvaldsUpon startup the kernel will usually output "ABCQGHIJ" into the SRAM,
54*1da177e4SLinus Torvaldspreceded by the booter signature. This is a trace just in case something
55*1da177e4SLinus Torvaldswent wrong during earliest setup stages of head.S.
56*1da177e4SLinus Torvalds**Changed** to preserve SRAM contents by default, this is only done when
57*1da177e4SLinus Torvaldsrequested - SRAM must start with '%LX$' signature to do this. '-d' option
58*1da177e4SLinus Torvaldsto 'lxx' loader enables this.
59*1da177e4SLinus Torvalds
60*1da177e4SLinus TorvaldsSRAM can also be used as additional console device, use debug=mem.
61*1da177e4SLinus TorvaldsThis will save kernel startup msgs into SRAM, the screen will display
62*1da177e4SLinus Torvaldsonly the penguin - and shell prompt if it gets that far..
63*1da177e4SLinus TorvaldsUnfortunately only 2000 bytes are available.
64*1da177e4SLinus Torvalds
65*1da177e4SLinus TorvaldsSerial console works and can also be used for debugging, see loader_txt
66*1da177e4SLinus Torvalds
67*1da177e4SLinus TorvaldsMost problems seem to be caused by fawlty or badly configured io-cards or
68*1da177e4SLinus Torvaldshard drives anyway.
69*1da177e4SLinus TorvaldsMake sure to configure the parallel port as SPP and remove IRQ/DMA jumpers
70*1da177e4SLinus Torvaldsfor first testing. The Q40 does not support DMA and may have trouble with
71*1da177e4SLinus Torvaldsparallel ports version of interrupts.
72*1da177e4SLinus Torvalds
73*1da177e4SLinus Torvalds
74*1da177e4SLinus TorvaldsQ40 Hardware Description
75*1da177e4SLinus Torvalds========================
76*1da177e4SLinus Torvalds
77*1da177e4SLinus TorvaldsThis is just an overview, see asm-m68k/* for details ask if you have any
78*1da177e4SLinus Torvaldsquestions.
79*1da177e4SLinus Torvalds
80*1da177e4SLinus TorvaldsThe Q40 consists of a 68040@40 MHz, 1MB video RAM, up to 32MB RAM, AT-style
81*1da177e4SLinus Torvaldskeyboard interface, 1 Programmable LED, 2x8bit DACs and up to 1MB ROM, 1MB
82*1da177e4SLinus Torvaldsshadow ROM.
83*1da177e4SLinus TorvaldsThe Q60 has any of 68060 or 68LC060 and up to 128 MB RAM.
84*1da177e4SLinus Torvalds
85*1da177e4SLinus TorvaldsMost interfacing like floppy, IDE, serial and parallel ports is done via ISA
86*1da177e4SLinus Torvaldsslots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate
87*1da177e4SLinus Torvaldsregions of the memory.
88*1da177e4SLinus TorvaldsThe main interrupt register IIRQ_REG will indicate whether an IRQ was internal
89*1da177e4SLinus Torvaldsor from some ISA devices, EIRQ_REG can distinguish up to 8 ISA IRQs.
90*1da177e4SLinus Torvalds
91*1da177e4SLinus TorvaldsThe Q40 custom chip is programmable to provide 2 periodic timers:
92*1da177e4SLinus Torvalds	- 50 or 200 Hz - level 2, !!THIS CANT BE DISABLED!!
93*1da177e4SLinus Torvalds	- 10 or 20 KHz - level 4, used for dma-sound
94*1da177e4SLinus Torvalds
95*1da177e4SLinus TorvaldsLinux uses the 200 Hz interrupt for timer and beep by default.
96*1da177e4SLinus Torvalds
97*1da177e4SLinus Torvalds
98*1da177e4SLinus TorvaldsInterrupts
99*1da177e4SLinus Torvalds==========
100*1da177e4SLinus Torvalds
101*1da177e4SLinus Torvaldsq40 master chip handles only a subset of level triggered interrupts.
102*1da177e4SLinus Torvalds
103*1da177e4SLinus TorvaldsLinux has some requirements wrt interrupt architecture, these are
104*1da177e4SLinus Torvaldsto my knowledge:
105*1da177e4SLinus Torvalds	(a) interrupt handler must not be reentered even when sti() is called
106*1da177e4SLinus Torvalds	    from within handler
107*1da177e4SLinus Torvalds	(b) working enable/disable_irq
108*1da177e4SLinus Torvalds
109*1da177e4SLinus TorvaldsLuckily these requirements are only important for drivers shared
110*1da177e4SLinus Torvaldswith other architectures - ide,serial,parallel, ethernet.
111*1da177e4SLinus Torvaldsq40ints.c now contains a trivial hack for (a), (b) is more difficult
112*1da177e4SLinus Torvaldsbecause only irq's 4-15 can be disabled - and only all of them at once.
113*1da177e4SLinus TorvaldsThus disable_irq() can effectively block the machine if the driver goes
114*1da177e4SLinus Torvaldsasleep.
115*1da177e4SLinus TorvaldsOne thing to keep in mind when hacking around the interrupt code is
116*1da177e4SLinus Torvaldsthat there is no way to find out which IRQ caused a request, [EI]IRQ_REG
117*1da177e4SLinus Torvaldsdisplays current state of the various IRQ lines.
118*1da177e4SLinus Torvalds
119*1da177e4SLinus TorvaldsKeyboard
120*1da177e4SLinus Torvalds========
121*1da177e4SLinus Torvalds
122*1da177e4SLinus Torvaldsq40 receives AT make/break codes from the keyboard, these are translated to
123*1da177e4SLinus Torvaldsthe PC scancodes x86 Linux uses. So by theory every national keyboard should
124*1da177e4SLinus Torvaldswork just by loading the appropriate x86 keytable - see any national-HOWTO.
125*1da177e4SLinus Torvalds
126*1da177e4SLinus TorvaldsUnfortunately the AT->PC translation isn't quite trivial and even worse, my
127*1da177e4SLinus Torvaldsdocumentation of it is absolutely minimal - thus some exotic keys may not
128*1da177e4SLinus Torvaldsbehave exactly as expected.
129*1da177e4SLinus Torvalds
130*1da177e4SLinus TorvaldsThere is still hope that it can be fixed completely though. If you encounter
131*1da177e4SLinus Torvaldsproblems, email me ideally this:
132*1da177e4SLinus Torvalds	- exact keypress/release sequence
133*1da177e4SLinus Torvalds	- 'showkey -s' run on q40, non-X session
134*1da177e4SLinus Torvalds	- 'showkey -s' run on a PC, non-X session
135*1da177e4SLinus Torvalds	- AT codes as displayed by the q40 debugging ROM
136*1da177e4SLinus Torvaldsbtw if the showkey output from PC and Q40 doesn't differ then you have some
137*1da177e4SLinus Torvaldsclassic configuration problem - don't send me anything in this case
138*1da177e4SLinus Torvalds
139