[U-Boot] [U-Boot,17/27] sandbox: Use asm-generic/io.h

Tom Rini trini at konsulko.com
Thu Oct 13 18:16:03 CEST 2016


On Sat, Oct 01, 2016 at 03:19:20PM +0100, Paul Burton wrote:

> Convert the sandbox architecture to make use of the new asm-generic/io.h
> to provide address mapping functions. As sandbox actually performs
> non-identity mapping between physical & virtual addresses we can't
> simply make use of the generic mapping functions, but are able to
> implement phys_to_virt() & make use of it from map_physmem().
[snip]
> +phys_addr_t virt_to_phys(void *vaddr)
> +{
> +	return (phys_addr_t)(vaddr - gd->arch.ram_buf);

../arch/sandbox/cpu/cpu.c: In function ‘virt_to_phys’:
../arch/sandbox/cpu/cpu.c:65:29: error: invalid operands to binary - (have ‘void *’ and ‘uint8_t *’)
  return (phys_addr_t)(vaddr - gd->arch.ram_buf);

[snip]
> -/*
> - * Given a physical address and a length, return a virtual address
> - * that can be used to access the memory range with the caching
> - * properties specified by "flags".
> - */
> -#define MAP_NOCACHE	(0)
> -#define MAP_WRCOMBINE	(0)
> -#define MAP_WRBACK	(0)
> -#define MAP_WRTHROUGH	(0)
[snip]
> @@ -71,6 +69,7 @@ static inline void _outsw(volatile u16 *port, const void *buf, int ns)
>  #define out16(addr, val)
>  #define in16(addr)		0
>  
> +#include <asm-generic/io.h>

... but we use MAP_WRBACK in map/unmap_sysmem which are before we
include this so they don't compile.

Please fix and run test/py/test.py for sandbox when you're done to
ensure it's still all happy, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161013/b913d81b/attachment.sig>


More information about the U-Boot mailing list