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