
Hi Paul,
2016-10-01 23:19 GMT+09:00 Paul Burton paul.burton@imgtec.com:
README states that CONFIG_SYS_SDRAM_BASE should be the physical address of the base of SDRAM memory. This is expected by some code such as the PCI layer, which uses CONFIG_SYS_SDRAM_BASE to set up a region for system memory. Other code such as the image loading code used by bootm or the generic board_f.c expect CONFIG_SYS_SDRAM_BASE to be directly accessible by the CPU, which necessitates that it be a virtual address.
Where virtual & physical addresses aren't identity mapped, as is the case for MIPS, we cannot possibly satisfy both. Until now MIPS has used a virtual CONFIG_SYS_SDRAM_BASE. This series fixes up the mess by doing a few things:
Ensuring that we provide virt_to_phys() on all architectures.
Fixing code that expects to use CONFIG_SYS_SDRAM_BASE as a virtual address to instead convert it to a physical address using virt_to_phys().
Converts MIPS code & all MIPS boards to provide a physical CONFIG_SYS_SDRAM_BASE, which typically is zero.
Thanks for working on this.
As you may notice, include/linux/io.h defines the generic implementation of ioremap().
(It is guarded by #ifndef CONFIG_HAVE_ARCH_IOREMAP so that MIPS can work-around it.)
If you go with asm-generic/io.h, perhaps should we be consistent, that is, move the generic ioremap() to asm-generic/io.h?
We do not have to do it in this series, but it would be appreciated if you volunteer to make it in a better way.
Thanks,