[comp.sys.mac.hardware] 68030 Data Cache and NuBus cards?

huff@mcclb0.med.nyu.edu (Edward J. Huff) (06/19/91)

Page 59 of Designing Cards and Drivers for the Macintosh Family 2nd edition,
states:  "Note that the caching of data can be controlled by software;
that is, some address spaces can be declared as noncacheable.  Any card that is
not capable of supporting a full 32-bit read must have its corresponding driver
software set up the caching control appropriately."

Page 28-20 of IM-VI (LockMemory function) states:  "The main reason to disable
movement of pages in physical memory is to translate virtual addresses to
physical addresses.  This translation is needed by bus masters, which must
write to memory in the physical address space.  To avoid stale data, the memory
locked in RAM is marked noncacheable in the CPU cache."

I am working with a NuBus card and software provided by its manufacturer,
which attempts to determine the presence of an optional feature by storing
a value into a RAM location which is "silently" absent (no bus error) on
the standard card.  The experiment frequently misidentifies a standard card.
The code generated is MOVE.L D0,(A0) / MOVE.L (A0),D1 / etc.  I attempted
to eliminate the problem by clearing the 68030 data cache.  This did not
help.  When I reported the problem to the manufacturer, they reported that
caching is not the problem, all NuBus references are not cached.  Instead,
it seems that the data is hanging around on the bus for a while after
the write, and since no hardware would drive the data bus on a reference to
nonexistent RAM, this sounds plausible.  Allegedly, using two writes and
then two reads fixes the problem.

Having a 32meg RAM card on the NuBus, I wondered if my contact was correct
in saying that all NuBus references are not cached.  The above quotes 
suggest that it is not.  On the other hand, I/O addresses definitely need
to be uncached at all times.

Does anyone know how this is done?  I have never heard of anything in
the 68030 which permits selective disabling of the data cache for
certain addresses.  But it certainly sounds like there must be a way.
What is it?