vme csr access

Artem Kazakov kazakov at gmail.com
Sun Jun 4 08:45:10 UTC 2006


Hello All, 

I'm using MVM5500 to run rtems-4.6.99.3
I'm trying to access vme boards through pci-to-vme bridge (Universe II).
So, the first task is to access CR/CSR to find my boards (EVG-200 &
EVR-200 by Microresearch Oy); 
it's my first experience with vme bus, and think I missed something
important. 
Could anyone tell me, what is CR/CSR address space on VME bus exactly? 
at least where should I search for my boards in that address space. 
Or what vme address should I provide to 
vmeUniverseMasterPortCfg - function? 
I tried two options: 0, and 0xff000000 (this is from sample code for
vxWorks);
But none of them works for me. 
When I read from mapped area I only get 0xffffffff values, which is
somewhat strange. 
What do I do wrong? 

Here is the code I use: 

#include <bsp.h>
#include <bsp/pci.h>
#include <libcpu/byteorder.h>
#include <stdio.h>
#include <bsp/VME.h>
#define _VME_UNIVERSE_DECLARE_SHOW_ROUTINES
#include <bsp/vmeUniverse.h>
#include <stdlib.h>

rtems_task Init(
  rtems_task_argument ignored
)
{
        unsigned long addr;
        int status, slot;
        unsigned int *ptr;
        printf("\n **** START **** \n");
        vmeUniverseMasterPortsShow(NULL);
        vmeUniverseSlavePortsShow(NULL);
vmeUniverseMasterPortCfg(0,VME_AM_CSR,0xff000000,0x90000000,16*1024*1024);
        vmeUniverseMasterPortsShow(NULL);
        for (slot = 1; slot < 32; slot++)
        {
                addr = 0x90000000 + (slot << 19);
                printf("%d %8lx: %2x %2x %2x\n",slot, addr,
*(char*)(addr + 0x27), *(char *)(addr + 0x2b), *(char *)(addr + 0x2f));
        }

        printf("\n **** STOP ***** \n");
        exit( 0 );
}

/* configuration information */
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_INIT
#include <rtems/confdefs.h>






More information about the users mailing list