ts-7000
[Top] [All Lists]

[ts-7000] Re: gpio kernel drivers....

To:
Subject: [ts-7000] Re: gpio kernel drivers....
From: "Yan Seiner" <>
Date: Fri, 17 Mar 2006 19:34:18 -0000
--- In  "Rich Wilson" <> wrote:
>
> On 3/17/06, Lennert Buytenhek <> wrote:
> >
> >  On Thu, Mar 16, 2006 at 04:53:35PM -0800, Rich Wilson wrote:
> >
> > > I suspect you're having problems because you're not page aligned.
> >
> > That's odd, does the book say that?  I always thought that ioremap()
> > deals with non-page aligned addresses itself, and having a peek at
> > the 2.6.16-rc5 source code (arch/arm/mm/ioremap.c) seems to confirm
> > this..
> >
> >
> > --L
> >
> >
> >
> Ah, but this is a 2.4 kernel, isn't it? Edition 2 of the book
includes the
> code
> which I posted, but edition 3 (2.6 specific) omits it.
> 
> Yan, why don't you try remapping a page and see what happens?

I did... Same thing....

Seems that the code from the book is now folded into the arm/ioremap.c
code....

Per Russel King, commenting on my code:
==================
This looks fine as far as it goes.  However, the argument which ioremap()
takes is not well defined.  For some, it happens to be a PCI address.
For most, it happens to be a physical address.

Which it is depends whether __arch_ioremap() has been defined for your
machine class (in include/asm-arm/arch-???/io.h), and what that function
actually does.

Assuming that it is not defined, the above code _will_ read from physical
address 0x11e00104 and the following 3 bytes.
===================

So.... Either something is broken in the
include/asm-arm/arch-ep93xx/io.h, which I doubt, or ....

Reading the io.h comments one finds the following gem:

/*
 * ioremap and friends.
 *
 * ioremap takes a PCI memory address, as specified in
 * linux/Documentation/IO-mapping.txt.  If you want a
 * physical address, use __ioremap instead.
 */

And in fact __ioremap(blah) does return the same as mmap(blah) for the
same memory address....

(It's 5 o'clock somewhere, isn't it?  Time for a corona and lime.... 
This programming stuff is hard....  :-) )

--Yan







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU