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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-18-2011, 10:42 AM
|
#1
|
LQ Newbie
Registered: Nov 2011
Posts: 2
Rep: 
|
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.
|
|
|
11-18-2011, 03:40 PM
|
#2
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by mechatrix
|
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
|
|
|
11-20-2011, 07:28 AM
|
#3
|
LQ Newbie
Registered: Nov 2011
Posts: 2
Original Poster
Rep: 
|
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
At http://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?
|
|
|
11-20-2011, 03:57 PM
|
#4
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by mechatrix
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
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
|
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
|
|
|
All times are GMT -5. The time now is 06:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|