Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
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.


  Search this Thread
Old 12-09-2010, 03:28 AM   #1
LQ Newbie
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
Problem using SA-1100 GPIO registers

Hi there,

I'm having some serious trouble using my GPIO pin registers on my intel SA-1100 device, from kernel space ofc..
I want to map the physical addresses to some usable ones using ioremap and then use write32 and read32 to write and read them. Should be simple.. But is this the easiest way?
For reference, the devmanual of the SA-1100 can be found here: HERE

Here is the code I have:

#define GPIO_BASE 0x90040000

static void *io_base, *GPLR, *GPDR, *GPSR, *GPCR;

void InitGPIO(void)
io_base = ioremap(GPIO_BASE, GPIO_LENGTH);
GPLR = io_base;
GPDR = io_base + 0x04;
GPSR = io_base + 0x08;
GPCR = io_base + 0x0C;

printk("io ports remapped %p\n ", GPLR);

Now I should be able to read the pins using:


But this is returning the incorrect values.. (not dependent on what i write) Somehow I have the feeling that I didn't map the correct address. The address returned by ioremap is ca000000 but that shouldn't say anything right? What am I not seeing? Or am I not using the right methods?

Any help is greatly appreciated.
Old 12-13-2010, 03:25 PM   #2
Senior Member
Registered: Apr 2009
Posts: 1,526

Rep: Reputation: 137Reputation: 137
Using ioremap to access GPIO in kernel space is fine. The issue is GPIO_BASE define. Is it correct physical address?
Old 12-13-2010, 08:50 PM   #3
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
Perhaps the value of GPIO_BASE is already mapped or some mapped address space already covers it? Have you tried reading directly on the GPIO_BASE address?
Old 12-14-2010, 02:41 AM   #4
LQ Newbie
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Yes, since GPIO_BASE = GPLR. But the matter has just been solved using register shortcuts i found in hardware.h ... so much effort for nothing.

But thanks for the advice!


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
I2C problem (registers not writable) lqu Linux - Embedded & Single-board computer 0 11-08-2010 12:45 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 08:52 AM
Display problem on Dell Inspiron 1100 k.r.hiremath Linux - Laptop and Netbook 1 06-27-2006 08:04 PM
Problem with reading/writing GPIO on video card with bttv compatible chip boky Linux - Hardware 0 10-13-2005 06:08 AM
Inspiron 1100 HD Squeak problem in Fedora Darkskies Fedora 2 03-10-2004 09:41 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:13 PM.

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