[U-Boot] [PATCH] RFC: sandbox: Change md command to use map_physmem

Mike Frysinger vapier at gentoo.org
Tue Oct 25 15:11:28 CEST 2011


On Tue, Oct 25, 2011 at 08:59, Simon Glass wrote:
> --- a/common/cmd_mem.c
> +++ b/common/cmd_mem.c
>
> +               int bytes = size * length;

unsigned long

> +               char *buf = map_physmem(addr, bytes, MAP_WRBACK);

probably want void *

> +               /* TODO: create a utility function to map and print error */
> +               if (!buf) {
> +                       puts("Failed to map physical memory\n");
> +                       return 1;
> +               }

unfortunately, this breaks some arches.  address 0 is valid on some
targets.  maybe change the logic to:
    if (addr && !buf)

the rest makes sense to me
-mike


More information about the U-Boot mailing list