vme csr access

Till Straumann strauman at slac.stanford.edu
Tue Jun 6 02:13:06 UTC 2006


Artem Kazakov wrote:

>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);
>  
>
You might want to talk to Dayle Kotturi - she already ported this driver
to RTEMS.

>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?
>
Something similar to PCI configuration space.

> 
>at least where should I search for my boards in that address space. 
>Or what vme address should I provide to 
>vmeUniverseMasterPortCfg - function? 
>  
>
The address 0.  Note that you lose A32 if you reconfigure
master port 0 so you should be able to see the CSR but
you won't see the ordinary A32 anymore.

I'd reduce the A32 window (port 0) to free up some
PCI address range and open a new port to map CSR.

>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? 
>  
>
Could you attach the console messages, please?

Regards
-- Till

>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