On Fri, 22 Jun 2007 11:03:18 -0700, David Brownell <[EMAIL PROTECTED]> wrote:
> > + if (res->start >= TXX9_DIRECTMAP_BASE)
> > + c->membase = (void __iomem *)(unsigned long)(int)res->start;
> > + else {
> > + c->membase = ioremap(res->start, res->end - res->start + 1);
> > + c->mapped = 1;
> > + }
>
> That looks plain wrong. Maybe it reflects a platform-level bug,
> but ioremap(res->start) should Just Work even when it performs
> an identity mapping on a given system. Remove this ugly code.
> Always map.
Ralf, (as I said some time ago) TX39XX and TX49XX have "reserved"
segment in CKSEG3 area. 0xff000000-0xff3fffff on TX49XX and
0xff000000-0xfffeffff on TX39XX are reserved (unmapped, uncached).
Controllers on these SoCs are placed in this segment.
If ioremap()/iounmap() could handle these special case, I can remove
this hack in this driver.
Is something like this acceptable?
include/asm-mips/io.h:
static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
unsigned long flags)
{
void __iomem *addr = plat_ioremap(offset, size, flags);
if (addr)
return addr;
...
}
static inline void iounmap(const volatile void __iomem *addr)
{
if (plat_iounmap(addr))
returnl
...
}
include/asm-mips/mach-generic/ioremap.h:
static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
unsigned long flags)
{
return NULL;
}
static inline int plat_iounmap(const volatile void __iomem *addr)
{
return 0;
}
---
Atsushi Nemoto
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general