LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 11-18-2011, 10:42 AM   #1
mechatrix
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO


Hey folks,
I'd like to ask you for some help to get access to the GPIO-Pins on my Fujitsu Mini-ITX Industrial Mainboard (D2963-S).
I found a documentation already,
http://www.avrfreaks.net/wiki/index....PIO#gpio-sysfs
but I don't know what's the right way to set the registers etc in my case.
The datasheet says....
Code:
  8Bit gpio port connected to the SB600.
  Gpio00 to Gpio07 are connected to gpio53 to gpio60 of SB600
  The registers are in PCI config space: Bus 00h, Device 14h, Function 00h

                              Direction (0-output;1-input)  input status     output value(0-Low;1-high)
                                    default is output                              default is low

Feature connector Gpio 0  Gpio53  PCI_Reg:52h;Bit[4]       PCI_Reg:52h;Bit[8]    PCI-Reg:52h;Bit[0]
Feature connector Gpio 1  Gpio54  PCI_Reg:52h;Bit[5]       PCI_Reg:52h;Bit[9]    PCI-Reg:52h;Bit[1]
Feature connector Gpio 2  Gpio55  PCI_Reg:52h;Bit[6]       PCI_Reg:52h;Bit[10]   PCI-Reg:52h;Bit[2]
Feature connector Gpio 3  Gpio56  PCI_Reg:52h;Bit[7]       PCI_Reg:52h;Bit[11]   PCI-Reg:52h;Bit[3]

Feature connector Gpio 4  Gpio57  PCI_Reg:52h;Bit[4]       PCI_Reg:52h;Bit[8]    PCI-Reg:52h;Bit[0]
Feature connector Gpio 5  Gpio58  PCI_Reg:52h;Bit[5]       PCI_Reg:52h;Bit[9]    PCI-Reg:52h;Bit[1]
Feature connector Gpio 6  Gpio59  PCI_Reg:52h;Bit[6]       PCI_Reg:52h;Bit[10]   PCI-Reg:52h;Bit[2]
Feature connector Gpio 7  Gpio60  PCI_Reg:52h;Bit[7]       PCI_Reg:52h;Bit[11]   PCI-Reg:52h;Bit[3]
Anybody some hints for me?
thanks

Last edited by mechatrix; 11-23-2011 at 03:25 AM.
 
Old 11-18-2011, 03:40 PM   #2
Doc CPU
Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 999

Rep: Reputation: 294Reputation: 294Reputation: 294
Hi there,

Quote:
Originally Posted by mechatrix View Post
I'd like to ask you for some help to get access to the GPIO-Pins on my Fujitsu Mini-ITX Industrial Mainboard (D2963-S).
I found a documentation already,
http://www.avrfreaks.net/wiki/index....PIO#gpio-sysfs
what a pity that the documentation you found doesn't match your problem. Not at all.
The document you linked to describes Linux running on an AVR micro controller system, not on a PC-like hardware.

This How-To seems more appropriate to your situation.

[X] Doc CPU
 
Old 11-20-2011, 07:28 AM   #3
mechatrix
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks a lot for your advice Doc CPU!
But I'm still not sure if I realy understand the howto / if I understand the hole task right:
The GPIOs are connected via PCI
Quote:
8Bit gpio port connected to the SB600.
Gpio00 to Gpio07 are connected to gpio53 to gpio60 of SB600
The registers are in PCI config space: Bus 00h, Device 14h, Function 00h
Do I have to write a driver for the access to the GPIOs first?
The howto explains giving permission with ioperm, but [...] ioperm() can only give access to ports 0x000 through 0x3ff
Athttp://www.makelinux.co.il/ldd3/chp-12-sect-1
I found a explanation of PCI,
Quote:
[...]Each PCI peripheral is identified by a bus number, a device number, and a function number. [...]Each function can be identified at hardware level by a 16-bit address, or key. Device drivers written for Linux, though, don't need to deal with those binary addresses, because they use a specific data structure, called pci_dev, to act on the devices.[...]When power is applied to a PCI device, the hardware remains inactive. In other words, the device responds only to configuration transactions.[...]
Nevertheless I'm not sure what to do next, someone out there who can push me in the right direction?
 
Old 11-20-2011, 03:57 PM   #4
Doc CPU
Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 999

Rep: Reputation: 294Reputation: 294Reputation: 294
Hi there,

Quote:
Originally Posted by mechatrix View Post
But I'm still not sure if I realy understand the howto / if I understand the hole task right:
The GPIOs are connected via PCI
in a way, you have to write your own PCI driver to access the GPIO port on that board. I hadn't thought it would be that complicated; all boards featuring a GPIO board that I've had so far, initialized that port on their own during BIOS startup, so that I only had to read or write one I/O address to use the GPIO.

Your Fujitsu board, however, seems to leave the entire task of addressing and initializing this port to the application. And honestly I've never done that. Would probably take me hours to dig into PCI documentation.

Quote:
Originally Posted by mechatrix View Post
The howto explains giving permission with ioperm, but [...] ioperm() can only give access to ports 0x000 through 0x3ff
Using the PCI functions of the Linux kernel, you probably don't need ioperm().

Quote:
Originally Posted by mechatrix View Post
At http://www.makelinux.co.il/ldd3/chp-12-sect-1
I found a explanation of PCI
That looks promising, but I'd allow for at least a day of studying this and other documents before I could achieve anything.
Sorry I'm out here, I thought it would be easier ...

[X] Doc CPU
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] AT91 gpio device driver access Gobliins Linux - Embedded & Single-board computer 2 11-01-2013 04:56 AM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM
GPIO access from users pace? ra2008 Linux - Embedded & Single-board computer 13 08-05-2008 08:48 AM
Linux desktop on mini-itx VIA mainboard jlinkels Linux - Hardware 2 08-08-2006 06:02 AM
Gpio Twiddling In Embedded Linux? or How to access PCI memory space regs? jds-linux Programming 1 07-11-2004 02:17 AM


All times are GMT -5. The time now is 09:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration