[U-Boot] [PATCH] powerpc/mpc85xx: Fix DDR TLB mapping leftover

Scott Wood scottwood at freescale.com
Wed Nov 26 02:39:32 CET 2014


On Tue, 2014-11-25 at 09:04 -0800, York Sun wrote:
> Commit f29f804a93e87c17670607641d120f431a3b0633 generalized the TLB
> mapping function, but made the DDR mapping leftover size to zero,
> causing the message not printed.
> 
> Signed-off-by: York Sun <yorksun at freescale.com>
> CC: Alexander Graf <agraf at suse.de>
> CC: Scott Wood <scottwood at freescale.com>
> ---
>  arch/powerpc/cpu/mpc85xx/tlb.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c
> index 129ec66..4f0f7d5 100644
> --- a/arch/powerpc/cpu/mpc85xx/tlb.c
> +++ b/arch/powerpc/cpu/mpc85xx/tlb.c
> @@ -299,12 +299,15 @@ unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr,
>  {
>  	unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE;
>  	u64 memsize = (u64)memsize_in_meg << 20;
> +	u64 size;
>  
> -	memsize = min(memsize, CONFIG_MAX_MEM_MAPPED);
> -	memsize = tlb_map_range(ram_tlb_address, p_addr, memsize, TLB_MAP_RAM);
> +	size = min(memsize, CONFIG_MAX_MEM_MAPPED);
> +	size = tlb_map_range(ram_tlb_address, p_addr, size, TLB_MAP_RAM);
>  
> -	if (memsize)
> -		print_size(memsize, " left unmapped\n");
> +	if ((size) || (memsize > CONFIG_MAX_MEM_MAPPED)) {

Unnecessary parentheses

-Scott




More information about the U-Boot mailing list