How do I access my VME hardware from MVME3100?

rtwas rtwas at comcast.net
Thu Jan 28 23:54:43 UTC 2010


Dimitrios Tsifakis wrote:
>  Hello everyone,
>
>  I am a new RTEMS user. I have just managed to compile 4.9.3 for an
>  MVME3100 and run the hello_world_c program. The second step I had in
>  mind was to access the VME cards that are also installed in that
>  crate, but I cannot find any documentation that describes how to
>  achieve that.
>
>  Any help and pointing to the right direction would be greatly
>  appreciated.
>
>  Regards Dimitris
>


Hello,

My understanding is that the mvme ppc bsp's use the motorola setup
defaults for each of the address space types (32bit (extended), 24bit 
(standard), 16 (short io)).
The BSP_vme2local_adrs() function (according to Till) just does a 
verification of an
existing mapping.

"
This function doesn't do any mapping but it checks if the given local
address is mapped on the VME bus ('visible to other VME masters')
using already existing mappings and translates it into a VME address.
" -Till Strauman

You need to use a "BSP" function, here's a 24bit (Standard) address space
example:

...................................................................
      unsigned long    local_address;
   volatile uint32_t * vme32p;

  return = BSP_vme2local_adrs(VME_AM_STD_SUP_DATA, 0x00000000, 
&local_address); // map the space

  if(return <0)
     printf("BSP_vme2local_adrs(): failed \n");

  else
     // to acess address 0x1000
    *(vme32p + 0x1000/4) = 0xdeadbeef; // for a 32 bit word write

// the "/4" thing is there because the address space is in *bytes* but 
the pointer
// is 4 times that size.
....................................................................................

The "am" codes can be found:
     "/opt/rtems-4.9/powerpc-rtems4.9/mvme5500/lib/include/bs/vme_am_defs.h"
         (in the case of an mvme5500 on a Linux system install)

          -or-
          "./c/src/lib/libbsp/shared/vmeUniverse/vme_am_defs.h"


The relevant BSP functions can be found:
             "c/src/lib/libbsp/powerpc/shared/vme/vme_universe.c"

If your write/read *order* is important you'd probably want to do an 
*inline* "eieio" instruction
to force "in order execution". There was talk in one of the past emails 
about using some io functions
to do this but I've not located them yet.

I asked this question not long ago. You should be able to find it in the 
email archives.

Robert W.




More information about the users mailing list