Reading and writing from/to VME device

Konstantin Boyanov kkboyanov at gmail.com
Thu Mar 29 20:13:55 EST 2007


Hi again,

Thank you once again for presenting the VME world to me :)

>Looks like you're reading something.  Address 0x10100000 is larger than
>a 24 bit address.  Perhaps you should be using A32 transfers instead of
>A24?

No, no, I need to do A16 access, thats the only way to read the control
registers. Form here comes also my confusion - I thought that when I'm
reading CS/CSR register I need to do it in CSR address space. So no
algorithms for geographical location of boards are needed in my case I
guess.
Actually the base address of CSR on the board is 0xA000 (10100000 is the
first byte of the address selection in inary, shame on me :( ). But when I
try to configure it with outWinCfgADC.zlatedAddrL = 0xA000, when I run the
programm I get an errno 29 (Invalid argument) from ioctl(). In fact if I set
the xlatedAddrL to some value smaller that 0x10000 I get this error. Here's
my most recent configuration:

    outWinCfgADC.windowNbr           = 0;
    outWinCfgADC.windowEnable      = 1;
    outWinCfgADC.wrPostEnable      = 0;
    outWinCfgADC.userAccessType  = VME_SUPER;
    outWinCfgADC.dataAccessType  = VME_DATA;
    outWinCfgADC.windowSizeL       = 0x10000;
    outWinCfgADC.xferProtocol         = VME_SCT;
    outWinCfgADC.addrSpace           = VME_A16;
    outWinCfgADC.maxDataWidth     = VME_D16;
    outWinCfgADC.xlatedAddrL         = 0x10000000;

I think that 0x10000 for window size is big enough to encompass the whole
A16 addressable space. With the 0x10000000 xlatedAddr I get no errors and
read the desired registers when I increment this address to 0x1000A000. But
nevertheless it seems strange to me that the device does not accept
xlatedAddr lower that 0x10000. Maybe its due to the configuration of the VME
controller?

Best regards,
Konstantin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20070329/7bcd01bd/attachment.htm 


More information about the Linuxppc-embedded mailing list