Re: [hatari-devel] SCU/VME register access?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 4/6/20 10:57 AM, Nicolas Pomarède wrote:
Le 04/04/2020 à 16:42, Eero Tamminen a écrit :
Currently Hatari allows emulated code to access MegaSTE & TT SCU/VME registers without exceptions,
although Hatari doesn't actually emulate those
registers.

Based on code comment, this is done for TOS
(2.x I assume) to be able to recognize MegaSTE.
But there's no comment on why it's allowed for TT.

Linux tries to use those registers if they're
accessible, and will fail to boot under MegaSTE
and TT emulation because of that.

I've added patch to Hatari which can be used to
make this register access build-time configurable:
https://git.tuxfamily.org/hatari/hatari.git/tree/tools/linux/hatari-vme-access.patch

(With them being accessible by default.)

Would it be OK to commit that change to Hatari,
instead of just having it as a separate patch?

PS. SCC registers were earlier also a problem, but
not anymore as Hatari emulates them now.  However,
I don't see SCU/VME register getting emulated any
time soon.

instead of making these registers configurable at build-time, I'd rather we go through the specs of the megaste / tt and see which registers exactly should be emulated on both machine and whether they cause a bus error or not.
>
I'm not very fond of having different build options that require the user to know how the HW behave. HW behaviour should be known in Hatari code.

Ok, I'll leave it as a patch then.


VME / SCU is for interfacing with add-on devices
on the VME bus.

Linux checks accessibility of SCU mask register to
see whether it will map VME address range and set
up autovector stuff, whereas TOS v2 just checks register accessibility to detect MegaSTE.

Here are some relevant places in Linux code...

Detection:
https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/tree/arch/m68k/atari/config.c#n324

Comment on address mapping:
https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/tree/arch/m68k/atari/config.c#n395

Integrating Atari interrupt handling to rest of m68k:
https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/tree/arch/m68k/atari/ataints.c#n8

MFP & SCC interrupts are enabled in VME mask:
https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/tree/arch/m68k/atari/ataints.c#n303




	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/