GPIO twiddling on the i440MX (i82443MX) ???

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
hi,
i am working with a 440MX-based embedded system -- specifically,
it uses the Intel 82443MX integrated north/south device ("Banister").

i would like to be able to toggle the GPIO pins from a userland
application running under linux (2.4 kernel).  i.e., i need to
toggle GPIO1 (pin E4) through GPIO20 (pin K3).

according to the 440MX/82443 datasheet and application programming
guides, the GPIO pins are accessible through PCI config function 0,
registers B0-B3, D4-DB, and E0-E3.  this is from section 6-15 of
http://developer.intel.com/design/chipsets/datashts/24529201.pdf

my question is, how  do i access the PCI registers from userland C?
i have seen some examples using inb/outb but for the most part they
are geared towards addressing the parallel port.  i can look up the
exact register values for the 440MX, that's not the problem -- the
question is how does one implement userland-to-PCI-space read/write
routines using the linux inb/outb primitives?  

additionally, i understand some measures need to be taken to allow
a userland application to write directly to PCI memory (ostensibly
bypassing memory bounds checking).  can anyone suggest some links
which demonstrate how this is implemented as well?

any pointers appreciated.

thanks and regards,
jim

Re: GPIO twiddling on the i440MX (i82443MX) ???
snipped-for-privacy@losdos.dyndns.org (google) writes:

Quoted text here. Click to load it

You don't. You use a device driver for this.

Quoted text here. Click to load it

You don't want to do that.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88   Web: www.denx.de
We've slightly trimmed the long signature. Click to see the full one.
Re: GPIO twiddling on the i440MX (i82443MX) ???
wolfgang,

thank you for your insight.  

Wolfgang Denk <wd> wrote in message
Quoted text here. Click to load it

ideally, yes.  i've been reading, among other things,
http://www.xml.com/ldd/chapter/book/ch15.html#t1
http://kernel-janitor.sourceforge.net/kernel-janitor/docs/driver-howto.html
http://w3.icpdas.com/reed/cahier/ldd.shtml
http://www.linuxgazette.com/issue93/bhaskaran.html
to understand the structure and implementation of a driver which would
allow me to abstract the register accesses.  i.e., the Right Solution.

Quoted text here. Click to load it

yes, see above.  i was hoping that there was a quick and dirty solution,
as i'm working on a demo, not a finished product.   but i think i'll
work for a while on implementing the device driver since i'll learn
something along the way.

you would not happen to have a link to sample source for a simple driver
suitable for use as a template for me?

Quoted text here. Click to load it

and regards to you as well.

jim

Re: GPIO twiddling on the i440MX (i82443MX) ???
Quoted text here. Click to load it

And, as you elaborated later, in a prototype/demo fashion, which
rather matters.

Quoted text here. Click to load it

/proc/bus/pci/ will probably get you what you're looking for.
Caution: Sharp edges.
--
Steve Watt KD6GGD  PP-ASEL-IA          ICBM: 121W 56' 57.8" / 37N 20' 14.9"
 Internet: steve @ Watt.COM                         Whois: SW32
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline