Question on fixup_bigphys_addr() in syslib/ibm44x_common.c
Hi,
When looking into ppc440 support, I'm confused on the functionality of fixup_bigphys_addr() in syslib/ibm44x_common.c. It's called by ioremap() in arch/ppc/mm/pgtable.c. The prototype is as follows.
phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
Why do we need this fixup? ioremap() takes a physical address as an argument and maps the physical address space to virtual address space with the specified size. Since it's already a physical address, which is 36-bit address in the case of 440, why do we need to fix up the ERPN? I must be missing something here.
Thanks,
-Shawn.
Quoted 7 lines · Shawn Jin
Hi,
When looking into ppc440 support, I'm confused on the functionality of
fixup_bigphys_addr()insyslib/ibm44x_common.c. It's called byioremap()inarch/ppc/mm/pgtable.c. The prototype is as follows.
phys_addr_tfixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
Quoted 5 lines
Why do we need this fixup?
ioremap()takes a physical address as an argument and maps the physical address space to virtual address space with the specified size. Since it's already a physical address, which is 36-bit address in the case of 440, why do we need to fix up the ERPN? I must be missing something here.
phys addr which is passed to ioremap doesn't always contain full 36-bit address. The reason for this is that some generic Linux subsystems (e.g. PCI) for 32-bit archs assume that physical address is always 32-bit. To make such generic (not 440-specific) drivers work on 44x we need this hack.
IIRC there is an effort under way to fix this generic kernel limitation, so hopefully we will be able to get rid of this hack soon.
--
Eugene