[U-Boot] [PATCH] common/memsize.c: Increase save array for supporting memory size > 4GB

Tom Rini trini at konsulko.com
Mon Jun 18 16:59:22 UTC 2018


On Wed, Jun 13, 2018 at 03:32:43PM +0800, tien.fong.chee at intel.com wrote:

> From: Tien Fong Chee <tien.fong.chee at intel.com>
> 
> In ARM 64-bits, memory size can be supported is more than 4GB,
> hence increasing save array is needed to cope with testing larger memory.
> 
> Signed-off-by: Tien Fong Chee <tien.fong.chee at intel.com>
> ---
>  common/memsize.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/memsize.c b/common/memsize.c
> index 5670e95..b091203 100644
> --- a/common/memsize.c
> +++ b/common/memsize.c
> @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  long get_ram_size(long *base, long maxsize)
>  {
>  	volatile long *addr;
> -	long           save[31];
> +	long           save[BITS_PER_LONG];
>  	long           save_base;
>  	long           cnt;
>  	long           val;

Since BITS_PER_LONG is 32 or 64, shouldn't we use B_P_L - 1 here?  Or
are you saying there's also a case where this is wrong on 32bit today?
Thanks!

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


More information about the U-Boot mailing list