linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* fixup_bigphys_addr and ioremap64 question
@ 2006-11-06  3:17 Benjamin Herrenschmidt
  2006-11-06  3:44 ` Josh Boyer
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2006-11-06  3:17 UTC (permalink / raw)
  To: linuxppc-dev list

While merging io.h between 32 and 64 bits arch/powerpc, I stumbled upon
this little gem :-)

So we have these:

 - If CONFIG_PHYS_64BIT is not set, nothing special. phys_addr_t is
defined to be 32 bits.

 - If it is set however, we have phys_addr_t defined to be 64 bits in
asm-ppc/mmu.h. 

So why do we have both ioremap and ioremap64 knowing that the former is
defined to take a phys_addr_t argument ?

Currently, we have both, with the only difference being that ioremap
calls ioremap64 but also passes the argument through a
fixup_bigphys_addr() function first.

It took me a while to find it ... it's not defined in generic code but
in platform code (ugh !). In fact, the only version of it we have in
arch/powerpc is in the 85xx support and does:

phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
{
	return addr;
};

So here's my question: Is it, as I think, some old mecanism that was
useful when ioremap didn't take a phys_addr_t argument and resources
didn't have 64 bits fields and thus we had a way to "remap" IOs from a
32 bits space into a 64 bits space in a platform specific way ?

Now, the big question is: do we still need that ?

If, as I expect, the answer is no, then I'll just remove it. I'll also
remove ioremap64 from arch/powerpc since ioremap can take a 64 bits
value directly.

Now, if the answer is yes, then I'll turn it into a ppc_md. call since
it its current form, it's just broken.

Ben.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-06 19:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06  3:17 fixup_bigphys_addr and ioremap64 question Benjamin Herrenschmidt
2006-11-06  3:44 ` Josh Boyer
2006-11-06  4:09   ` Benjamin Herrenschmidt
2006-11-06  4:16     ` Josh Boyer
2006-11-06  4:46       ` Benjamin Herrenschmidt
2006-11-06 16:45       ` Matt Porter
2006-11-06 19:27         ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).