Problem using SA-1100 GPIO registers
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
#define GPIO_LENGTH 0xFFF
static void *io_base, *GPLR, *GPDR, *GPSR, *GPCR;
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.