GPIO twiddling on the i440MX (i82443MX) ???

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

formatting link

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

Reply to
google
Loading thread data ...

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

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
 Click to see the full signature
Reply to
Wolfgang Denk

wolfgang,

thank you for your insight.

ideally, yes. i've been reading, among other things,

formatting link
formatting link
formatting link
formatting link
to understand the structure and implementation of a driver which would allow me to abstract the register accesses. i.e., the Right Solution.

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?

and regards to you as well.

jim

Reply to
google

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

/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
 Click to see the full signature
Reply to
Steve Watt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.