On 07/26/2018 07:00 AM, Philipp Tomsich wrote:
> With the change of the ram size fields to u64, we need to use explicit
> casts to ensure that min()-implementation sees the same type for both
> its arguments.
> 
> Signed-off-by: Philipp Tomsich <[email protected]>
> ---
> 
>  arch/powerpc/cpu/mpc85xx/cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
> index bf48836..5664872 100644
> --- a/arch/powerpc/cpu/mpc85xx/cpu.c
> +++ b/arch/powerpc/cpu/mpc85xx/cpu.c
> @@ -604,7 +604,8 @@ static int reset_tlb(phys_addr_t p_addr, u32 size, 
> phys_addr_t *phys_offset)
>  int arch_memory_test_advance(u32 *vstart, u32 *size, phys_addr_t 
> *phys_offset)
>  {
>       phys_addr_t test_cap, p_addr;
> -     phys_size_t p_size = min(gd->ram_size, CONFIG_MAX_MEM_MAPPED);
> +     phys_size_t p_size = min((phys_size_t)gd->ram_size,
> +                              (phys_size_t)CONFIG_MAX_MEM_MAPPED);
>  
>  #if !defined(CONFIG_PHYS_64BIT) || \
>      !defined(CONFIG_SYS_INIT_RAM_ADDR_PHYS) || \
> @@ -632,7 +633,8 @@ int arch_memory_test_advance(u32 *vstart, u32 *size, 
> phys_addr_t *phys_offset)
>  /* initialization for testing area */
>  int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t 
> *phys_offset)
>  {
> -     phys_size_t p_size = min(gd->ram_size, CONFIG_MAX_MEM_MAPPED);
> +     phys_size_t p_size = min((phys_size_t)gd->ram_size,
> +                              (phys_size_t)CONFIG_MAX_MEM_MAPPED);
>  
>       *vstart = CONFIG_SYS_DDR_SDRAM_BASE;
>       *size = (u32) p_size;   /* CONFIG_MAX_MEM_MAPPED < 4G */
> 

We didn't have any issue with 36-bit physical address on mpc85xx. I see
this change is needed after you change gd->ram_size.

Reviewed-by: York Sun <[email protected]>
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to