VME Address Modifier Codes

Chris Brown mcvax!aivru.sheffield.ac.uk!chris at uunet.uu.net
Fri Dec 16 23:32:36 AEST 1988


In v7n33 Steve Dyer poses a question about VME address modifiers. The key
issues raised were:

>  Only when the address is asserted with the VME address modifier
>  lines set to "data" (hex 29), are the boards on the Q bus accessed.

>  I don't have the faintest idea how I tell the Sun to generate a "data"
>  reference rather than a "supervisor" reference when I reference a
>  device register on the VMEbus.  Does anyone have a clue?

Sun have a document "Users Guide to the Sun-3 VME bus" by Jim Ludemann
which you may find helpful. It includes the following table of the VME
address modifier codes used by Sun:

Address Modifier (hex)          Function
----------------------		--------

    09			A32, User data space
    0a			A32, User program space
    0d			A32, Supervisor data space
    0e			A32, Supervisor program space
    29			A16, User data space 
    2a			A16, User program space
    2d			A16, Supervisor data space
    2e			A16, Supervisor program space
    39			A24, User data space
    3a			A24, User program space
    3d			A24, Supervisor data space
    3e			A24, Supervisor program space

There are three things which the address modifier code tells you: 

(1) Which address space (16, 24, or 32 bit addressing) is this bus cycle
    accessing? For a Sun device driver, this is determined by the line in
    the config file: something like this:

    controller  si0 at vme24d16 ? csr 0x200000 priority 2 vector siintr 0x40
			  ^^
	    This means you're in the 24-bit addressing space
    Of course it has to agree with how many address bits the controller
    actually decodes, AND which address modifiers it listens for.

(2) Is the processor in user mode or supervisor mode? In effect this
    means "is my code outside the kernel or inside it?"

(3) Is this cycle fetching an instruction (program space) or data
    (data space). Obviously, ALL accesses you generate in your C
    program are in data space.

So... if your controller really only responds to address modifier 29 as
you say, my understanding is you can ONLY talk to it in a 16 bit address
space from outside the kernel. The VME bus specification (Rev C.1 Section
2.2.2) suggests that A16 slave devices should respond to modifiers 29 and
2d.  Usually this stuff is incarcerated in a PAL on the controller.  (I
also vaguely remember that the 680x0 has some funny instructions that let
you cheat on the address modifiers. Or maybe it was the 32032?)

Hope this helps,

Chris Brown, A.I. Vision Research Unit, Sheffield University 
(chris at aivru.sheffield.ac.uk)



More information about the Comp.sys.sun mailing list