Thread (1 message) 1 message, 1 author, 2007-06-24

Re: [PATCH] TXx9 SPI controller driver

From: Atsushi Nemoto <hidden>
Date: 2007-06-24 16:15:33
Also in: linux-spi

Possibly related (same subject, not in this thread)

On Fri, 22 Jun 2007 11:03:18 -0700, David Brownell [off-list ref] wrote:
quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help