mvme5500: mapping vme address spaces

Till Straumann strauman at slac.stanford.edu
Tue Dec 29 21:39:15 UTC 2009


rtwas wrote:
> Hello,
>
> I'm looking for better insight into the process of mapping vme address 
> spaces into
> user-app spaces.
>
> Firstly, looking at the function: "BSP_local2vme_adrs(unsigned long 
> am, unsigned long localaddr, unsigned long *pvmeaddr)" I see an "am" 
> code, a "localaddr", and a "pvmeaddr" parameter, I am not seeing 
> anyway to set the
> *window size* of the space mapped. For a the "A16" (am code: 0x29, 
> 0x2d)  address space, it's not much of a problem since the total size 
> of the space is relatively small.  For the "A32" space this is looking 
> like a real problem.
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.

If you need to create new mappings then you have to use
BSP_VMEOutboundPortCfg/BSP_VMEInboundPortCfg
but note that these create mappings from PCI to VME space.

>
> Another issue/question would be: how is this space actually mapped 
> into the programmers memory view?
> I'm assuming the mapped vme space shares the same address space as the 
> actual program. How to know
> *where* in local space to map the desired vme space (so that I don't 
> step on data/program memory)?
Unfortunately, it's even more complicated than that since you have to hop
through PCI, too. I.e., you have to

  1) map VME <-> PCI
  2) map PCI   <-> CPU physical address
  3) map CPU physical address <-> CPU virtual address

1) is done by the universe or Tsi148 chip. This is what 
BSP_OutboundPortCfg/BSP_InboundPortCfg
    do.
2) happens in the PCI host bridge. The RTEMS BSPs I know just inherit 
firmware settings.
3) The PPC uses BATs or page-tables for this mapping.

When creating a new mapping you must make sure the chosen address range
doesn't conflict with existing ones. Note that this applies to all the 
bus-spaces
involved (VME, PCI, physical and virtual).

Unfortunately, there is no API or portable way for managing address-spaces
and mappings but the following may be helpful:

For the MVME5500 you can consult the 'mvme5500 programmer's reference 
guide'.
Since RTEMS inherits the hostbridge setup from MotLoad you can look for the
MotLoad Processor and PCI memory maps.

As for the physical<->virtual address mapping powerpc-RTEMS usually
maps these 1:1 (i.e., without any offsets) but note that not the entire 
32-bit space
is mapped initially by the BSP. You may need a free BAT or use page tables.

HTH
-- Till
>
>
> Thanks.
>
> Robert W.
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users





More information about the users mailing list