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

Simon Glass sjg at chromium.org
Wed Oct 26 01:52:05 CEST 2011


Hi Mike,

On Tue, Oct 25, 2011 at 6:11 AM, Mike Frysinger <vapier at gentoo.org> wrote:
> 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)
>

I think I should just take this out, in the absence of anything that
explains what the failure case for map_physmem() returns. I don't
think it is permitted to fail at present.

Will resend.

Regards,
Simon

> the rest makes sense to me
> -mike
>


More information about the U-Boot mailing list