Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE
Get series with b4
b4 am 1864460.dQVYCF6nug@np-p-burtonVersions newest first
- v1 Latest0 of 27 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 27 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [U-Boot] [PATCH 00/27] Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE
Quoted 26 lines · On Sunday, 2 October 2016 22:46:45 BST Masahiro Yamada wrote:
Hi Paul,
2016-10-01 23:19 GMT+09:00 Paul Burton <[email protected]>:
Quoted 14 lines
README states that
CONFIG_SYS_SDRAM_BASEshould be the physical address of the base of SDRAM memory. This is expected by some code such as the PCI layer, which usesCONFIG_SYS_SDRAM_BASEto set up a region for system memory. Other code such as the image loading code used by bootm or the genericboard_f.cexpectCONFIG_SYS_SDRAM_BASEto 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 doinga few things:
- Ensuring that we providevirt_to_phys()on all architectures.Quoted 8 lines
- Fixing code that expects to use
CONFIG_SYS_SDRAM_BASEas a virtualaddress 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.
Quoted 7 lines
Thanks for working on this.
As you may notice,
include/linux/io.hdefines the generic implementation ofioremap().(It is guarded by #ifndef
CONFIG_HAVE_ARCH_IOREMAPso that MIPS can work-around it.)
Hi Masahiro,
I hadn't actually noticed the generic ioremap - I suspect few do since you don't get it by including asm/io.h as you would in Linux. It'll also be wrong for other architectures that don't do a simple 1:1 physical:virtual translation but don't select CONFIG_HAVE_ARCH_IOREMAP (nios2, sandbox).
Quoted 7 lines
If you go with
asm-generic/io.h,
perhaps should we be consistent, that is, move the genericioremap()toasm-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.
Yeah I'd be fine with cleaning that up, preferrably after this series is merged so I don't have more out of tree patches to juggle. I'd propose that we implement the generic ioremap atop map_physmem, which we ought to be able to do for every arch if we clean up MIPS a little.
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161003/76f77660/attachment.sig>