Re: Interrupt problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi Prashant,

> Hello Dieter, 
> 
> I am also not very much experienced on linux. Your idea may work, but i don't know how to use sysfs.
> Can you please elaborate it? 
> 

You can have a look at Documentation/gpio.txt in the kernel tree. There is (hopefully) all what you need.

Dieter

> With Thanks and Regards, 
> Prashant Sangal
> 
> 
> ________________________________
> From: Dieter Kiermaier <dk-arm-linux@xxxxxx>
> To: linux-arm@xxxxxxxxxxxxxxxxxxxxxx
> Sent: Thursday, 9 July, 2009 9:14:51 PM
> Subject: Re: Interrupt problem
> 
> Hi all,
> 
> I'm fairly new to linux and also to this list so please don't hang me up if I'm wrong.
> But if your board provides gpiolib support it may be more easy to access gpios by using the sysfs?
> 
> Cheers,
> Dieter
> 
> 
> > Hello, 
> > 
> > I am working on AT91SAM9260 based board. The board is running linux. Using mmap, i can access GPIOs. 
> > I have been trying to access Interrupt controller through mmap, but failed. 
> > Is it possible to access Interrupt controller of processor using mmap? what may be alternate way without digging deep into kernel?
> > 
> > Also, I need a better understanding of how linux manages addressing of peripherals? For GPIOs, I am using a sample code as basis of my application. this sample code has been provided by the board manufacturer. The code snippets are as followed:
> > 
> > ----
> > ----
> > #define  AT_BASE     0xFFFFF000
> > --
> > ---
> > static void *piobase;
> > static unsigned int* base;
> > ---
> > ---
> > int main()
> > {
> >     static int fd, pagesize;
> >     int pattern;    
> >     pagesize = getpagesize();
> >     fd = open("/dev/mem", O_RDWR);
> >     piobase = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, AT_BASE);
> >     base = (unsigned int *) piobase + 0x100;
> > --------
> > ---------
> > 
> > }
> > 
> > Here i am unable to undersatnd the reason of choosing 0xFFFFF000 as AT_BASE, because as per the memory map of AT91SAM960, this particular location is assigned to Advanced Interrupt Controller. 
> > 
> > With Best Regards, 
> > Prashant 
> > 
> > 
> > 
> >       Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/
> > -------------------------------------------------------------------
> > List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> > FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> > Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
> > 
> 
> 
> 
> -------------------------------------------------------------------
> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
> 
> 
> 
>       Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/



-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter