* understanding GPIO registers
@ 2011-08-25 18:50 OrazioPirataDelloSpazio (Lorenzo)
2011-08-28 6:59 ` vichy
0 siblings, 1 reply; 4+ messages in thread
From: OrazioPirataDelloSpazio (Lorenzo) @ 2011-08-25 18:50 UTC (permalink / raw)
To: kernelnewbies
Hi there,
I have a motherbord (VIA EPIA LT) with a digital I/O port composed by 4
GPI and 4 GPO (chip: SMSC SCH3114).
I want to provide voltage to GPO and read the input value of GPI with a
software.
Using the generic gpio kernel module, I tried to export pins without
success :
echo N > /sys/class/gpio/export
write error : invalid argument
I tried for several values of N (from 1 to 1000 !) then I gave up
thinking I would have needed some information from the hardware producer.
Now I have got this information that is the following offsets and addresses.
How can I use these registers to fix the export problem or alternatively
how to write a simple userspace C program to read and write these GPIO?
I read gpio.txt but I'm still confused on how to pass from GPIO numbers
to registers.
Thanks
Lorenzo
#define sGPIOBaseAddr 0A00
#define GPI1_CTRL_REG 0x6E
#define GPI2_CTRL_REG 0x6F
#define GPI3_CTRL_REG 0x72
#define GPI4_CTRL_REG 0x73
#define GPO1_CTRL_REG 0x2C
#define GPO2_CTRL_REG 0x2D
#define GPO3_CTRL_REG 0x35
#define GPO4_CTRL_REG 0x36
^ permalink raw reply [flat|nested] 4+ messages in thread
* understanding GPIO registers
2011-08-25 18:50 understanding GPIO registers OrazioPirataDelloSpazio (Lorenzo)
@ 2011-08-28 6:59 ` vichy
2011-08-28 10:51 ` OrazioPirataDelloSpazio (Lorenzo)
0 siblings, 1 reply; 4+ messages in thread
From: vichy @ 2011-08-28 6:59 UTC (permalink / raw)
To: kernelnewbies
hi:
2011/8/26 OrazioPirataDelloSpazio (Lorenzo) <ziducaixao@autistici.org>:
> Hi there,
> I have a motherbord (VIA EPIA LT) with a digital I/O port composed by 4
> GPI and 4 GPO (chip: SMSC SCH3114).
>
> I want to provide voltage to GPO and read the input value of GPI with a
> software.
>
> Using the generic gpio kernel module, I tried to export pins without
> success :
>
> echo N > /sys/class/gpio/export
> write error : invalid argument
>
> I tried for several values of N (from 1 to 1000 !) then I gave up
> thinking I would have needed some information from the hardware producer.
> Now I have got this information that is the following offsets and addresses.
>
> How can I use these registers to fix the export problem or alternatively
> how to write a simple userspace C program to read and write these GPIO?
>
> I read gpio.txt but I'm still confused on how to pass from GPIO numbers
> to registers.
>
> Thanks
>
>
> Lorenzo
>
>
> #define sGPIOBaseAddr ? 0A00
> #define GPI1_CTRL_REG ? 0x6E
> #define GPI2_CTRL_REG ? 0x6F
> #define GPI3_CTRL_REG ? 0x72
> #define GPI4_CTRL_REG ? 0x73
> #define GPO1_CTRL_REG ? 0x2C
> #define GPO2_CTRL_REG ? 0x2D
> #define GPO3_CTRL_REG ? 0x35
> #define GPO4_CTRL_REG ? 0x36
>
does the base address of gpio in kernel you use is the same or you
have modified for your board?
BR
^ permalink raw reply [flat|nested] 4+ messages in thread
* understanding GPIO registers
2011-08-28 6:59 ` vichy
@ 2011-08-28 10:51 ` OrazioPirataDelloSpazio (Lorenzo)
2011-08-28 11:05 ` vichy
0 siblings, 1 reply; 4+ messages in thread
From: OrazioPirataDelloSpazio (Lorenzo) @ 2011-08-28 10:51 UTC (permalink / raw)
To: kernelnewbies
On 8/28/11 8:59 AM, vichy wrote:
> does the base address of gpio in kernel you use is the same or you
> have modified for your board?
I didn't modify the kernel.
VIA EPIA LT BIOS set SCH3114 PME BASE ADDRESS at 0A00H
How do you suggest to proceed?
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 4+ messages in thread
* understanding GPIO registers
2011-08-28 10:51 ` OrazioPirataDelloSpazio (Lorenzo)
@ 2011-08-28 11:05 ` vichy
0 siblings, 0 replies; 4+ messages in thread
From: vichy @ 2011-08-28 11:05 UTC (permalink / raw)
To: kernelnewbies
hi:
2011/8/28 OrazioPirataDelloSpazio (Lorenzo) <ziducaixao@autistici.org>:
> On 8/28/11 8:59 AM, vichy wrote:
>> does the base address of gpio in kernel you use is the same or you
>> have modified for your board?
> I didn't modify the kernel.
> VIA EPIA LT BIOS set SCH3114 PME BASE ADDRESS at 0A00H
>
> How do you suggest to proceed?
>
> Thanks,
How about adding debug messages in the driver?
If that is a PCI device, you may use mmap to map the memory for programming.
BR,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-28 11:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 18:50 understanding GPIO registers OrazioPirataDelloSpazio (Lorenzo)
2011-08-28 6:59 ` vichy
2011-08-28 10:51 ` OrazioPirataDelloSpazio (Lorenzo)
2011-08-28 11:05 ` vichy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.