[U-Boot-Users] [PATCH 6/6] cfi_flash: Use map_physmem() and unmap_physmem()

Haavard Skinnemoen hskinnemoen at atmel.com
Wed Dec 12 10:23:33 CET 2007

On Tue, 11 Dec 2007 23:10:40 +0100
Wolfgang Denk <wd at denx.de> wrote:

> In message <1197386900-14570-7-git-send-email-hskinnemoen at atmel.com> you wrote:
> > Use map_physmem() and unmap_physmem() to convert from physical to
> > virtual addresses. This gives the arch a chance to provide an uncached  
> Virtual addresses? We don't have virtual memory in U-Boot...

That's for the CPU to decide, not you.

All pointers are fundamentally virtual addresses. It's just that lots
of code all over u-boot assume that virtual and physical addresses are
the same. This results in, I suspect, lots of platforms running with
caches disabled and therefore take longer to boot than necessary.

By introducing mapping functions like this, we allow drivers to tell
the platform exactly what kind of caching behavior they want, so the
platform can allow caches to be enabled for all the memory where I/O
consistency is not an issue (e.g. code and data memory.)

Platforms that don't want this (for example platforms with no MMU, no
caches and/or built-in I/O coherency) can just implement it as a cast
to void *, which is exactly what we're doing today. In other words, no
overhead for platforms that don't (need to) care.

Btw, MIPS and SH (at least some versions) have very similar default
virtual memory layout as AVR32, so I'm pretty sure this can benefit
more than one platform.


More information about the U-Boot mailing list