Subject: Re: Daystar '030 patch & questions
To: John Valdes <valdes@uchicago.edu>
From: Allen Briggs <briggs@wasabisystems.com>
List: port-mac68k
Date: 01/09/2002 23:15:59
Oh, cool.  Thank you, John.  :-)

On Wed, Jan 09, 2002 at 09:45:05PM -0600, John Valdes wrote:
> 1) How do I catch a bus error in the kernel?

Basically just as you do in userland.  For an example of how it's done
for bus_space(9), see mac68k_bus_space_probe().

> 2) How do I map a single page of memory over the 5 Daystar pages, and
>    what page of memory should I use for this?  Presumedly I just use
>    pmap_enter() and specify the same physical page address for all 5
>    virtual page addresses.

Yeah.  I'd probably malloc a page and get the physical address for that
page with pmap_extract() or some such.

This is ugly, but I can't think of another way to do it without
incurring another couple of data accesses.

Hmm...  Actually, it would probably be best to use macros in locore
instead of subroutine jumps...  e.g. something like:

#if defined(DAYSTAR_030)
#define DISABLE_DAYSTAR_030
	tstb	0x52040000	| disable writeback cache ; \
	tstb	0x52060000	| disable daystar external cache ; \
	tstb	0x520f0000	| flush daystar external cache

ENTRY(disable_daystar)
	DISABLE_DAYSTAR_030
	rts
#else
#define DISABLE_DAYSTAR_030
#endif
...

(replacing any '#ifdef DAYSTAR_030\njbsr	disable_daystar\n#endif'
 with DISABLE_DAYSTAR_030, of course)

This will avoid the extra cost of the jbsr and rts.

I'd probably also make sure DAYSTAR_030 is a defflag in conf/files.mac68k.

-allen

-- 
 Allen Briggs                     briggs@wasabisystems.com
 http://www.wasabisystems.com/    Quality NetBSD CDs, Sales, Support, Service
NetBSD dev. for _your_ Alpha, ARM, M68K, MIPS, PowerPC, SH3, Sparc, x86, etc...