linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Didier Kryn <kryn@in2p3.fr>
Cc: Konstantin Boyanov <kkboyanov@gmail.com>, linuxppc-embedded@ozlabs.org
Subject: Re: Reading and writing from/to VME device
Date: Mon, 02 Apr 2007 11:15:05 +0200	[thread overview]
Message-ID: <4610C999.5080405@in2p3.fr> (raw)
In-Reply-To: <460CD765.2060905@in2p3.fr>

    Konstantin, I reproduced your ioctl() problem with the attached=20
program. The conclusion is that the only valid size and base parameters=20
for A16 are windowSizeL=3D0x10000 and xlatedAddrL=3D0. This means the A16=
=20
space can only be mapped as a whole. What you observed with =20
xlatedAddrL=3D0x10100000 is that the ioctl(), gently masks the irrelevant=
=20
high order bits.

    Best regards.
    Didier

Didier Kryn a =E9crit :
>
>
>     Now, for the ioctl problem, Konstantin, did you try to set=20
> xlatedAddrL to zero. The Tsio148, and therefore the driver, enforce=20
> alignment on  rather big blocks and maybe misalignment is the cause of =

> the "invalid argument" error. I see no reason not to map the entire=20
> A16, A24 or CR/CSR spaces. For the others, of course, you are limited=20
> by the size of the cpu's address space.
>
>     I will eventually try to reproduce your ioctl problem next week.=20
> Hopping you will solve it before :-) .
>
>     Best regards. Didier
>
> Konstantin Boyanov said:
>> Hi again,
>>
>> Thank you once again for presenting the VME world to me :)
>>
>> >Looks like you're reading something.  Address 0x10100000 is larger th=
an
>> >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=20
>> 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=20
>> space. So no algorithms for geographical location of boards are=20
>> needed in my case I guess.
>> Actually the base address of CSR on the board is 0xA000 (10100000 is=20
>> the first byte of the address selection in inary, shame on me :( ).=20
>> But when I try to configure it with outWinCfgADC.zlatedAddrL =3D=20
>> 0xA000, when I run the programm I get an errno 29 (Invalid argument)=20
>> from ioctl(). In fact if I set the xlatedAddrL to some value smaller=20
>> that 0x10000 I get this error. Here's my most recent configuration:
>>
>>     outWinCfgADC.windowNbr           =3D 0;
>>     outWinCfgADC.windowEnable      =3D 1;
>>     outWinCfgADC.wrPostEnable      =3D 0;
>>     outWinCfgADC.userAccessType  =3D VME_SUPER;
>>     outWinCfgADC.dataAccessType  =3D VME_DATA;
>>     outWinCfgADC.windowSizeL       =3D 0x10000;
>>     outWinCfgADC.xferProtocol         =3D VME_SCT;
>>     outWinCfgADC.addrSpace           =3D VME_A16;
>>     outWinCfgADC.maxDataWidth     =3D VME_D16;
>>     outWinCfgADC.xlatedAddrL          =3D 0x10000000;
>>
>> I think that 0x10000 for window size is big enough to encompass the=20
>> whole A16 addressable space. With the 0x10000000 xlatedAddr I get no=20
>> errors and read the desired registers when I increment this address=20
>> to 0x1000A000. But nevertheless it seems strange to me that the=20
>> device does not accept xlatedAddr lower that 0x10000. Maybe its due=20
>> to the configuration of the VME controller?
>>
>

  reply	other threads:[~2007-04-02  9:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 15:14 Reading and writing from/to VME device Konstantin Boyanov
2007-03-26 18:31 ` Martin, Tim
2007-03-27  9:09 ` Didier Kryn
2007-03-27 12:38   ` Didier Kryn
2007-03-27 15:47   ` Konstantin Boyanov
2007-03-27 19:02     ` Martin, Tim
2007-03-28  9:56       ` Didier Kryn
2007-03-29 10:13         ` Konstantin Boyanov
2007-03-29 19:27           ` Martin, Tim
2007-03-30  9:24           ` Didier Kryn
2007-04-02  9:15             ` Didier Kryn [this message]
2007-04-02  9:21               ` Didier Kryn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4610C999.5080405@in2p3.fr \
    --to=kryn@in2p3.fr \
    --cc=kkboyanov@gmail.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).