From: "Guillaume Dargaud" <dargaud@lpsc.in2p3.fr>
To: "John Bonesio" <john.bonesio@xilinx.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: Still struggling with Xilinx GPIO...
Date: Wed, 28 May 2008 11:51:09 +0200 [thread overview]
Message-ID: <052501c8c0a8$5e3cc9e0$ad289e86@LPSC0173W> (raw)
In-Reply-To: 20080527164222.E226818D0062@mail151-sin.bigfish.com
Hi John,
> Try using channel 1. It may be set up where the first channel is 1 and not
> 0.
Not sure what you mean...
I'm actually not clear how many devices I should have:
$ grep "GPIO.*BASEADDR"
arch/ppc/platforms/4xx/xparameters/xparameters_ml405.h
#define XPAR_GPIO_0_BASEADDR XPAR_LEDS_4BIT_BASEADDR
#define XPAR_GPIO_1_BASEADDR XPAR_LEDS_POSITIONS_BASEADDR
#define XPAR_GPIO_2_BASEADDR XPAR_PUSH_BUTTONS_POSITION_BASEADDR
But depending on the examples I look at, they define either:
crw-rw-rw- 1 root root 10, 185 May 26 13:49 xgpio
or:
crw-rw-rw- 1 root root 10, 185 May 26 13:18 xgpio0
crw-rw-rw- 1 root root 10, 186 May 26 13:18 xgpio1
crw-rw-rw- 1 root root 10, 187 May 26 13:18 xgpio2
If that is the former, I see the code uses:
gpio_ioctl.chan=0;
And I guess that's what you are refering to, right ?
Putting 1 gives me a working program, but no LED lights up and the buttons
are always shown at 0.
Putting 0 gives a nice core dump as in my previous msg.
Putting 2 locks up the system.
And... I don't see how the code manages to read/wite all 3 GPIOs with only
two IOCTL calls. Shouldn't they be 3 different calls using different
addresses ?!? Argh, this complete lack of documentation in maddening. Not
everything can be understood from reading the source.
Thanks.
--
Guillaume Dargaud
http://www.gdargaud.net/
next prev parent reply other threads:[~2008-05-28 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-26 15:43 Still struggling with Xilinx GPIO Guillaume Dargaud
2008-05-27 16:42 ` John Bonesio
2008-05-28 9:51 ` Guillaume Dargaud [this message]
2008-05-28 16:09 ` John Bonesio
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='052501c8c0a8$5e3cc9e0$ad289e86@LPSC0173W' \
--to=dargaud@lpsc.in2p3.fr \
--cc=john.bonesio@xilinx.com \
--cc=linuxppc-dev@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