[PATCH v2 4/8] powerpc/fsl_booke: set the tlb entry for the kernel address in AS1

Scott Wood scottwood at freescale.com
Sat Jul 27 09:37:10 EST 2013


On 07/04/2013 07:54:10 AM, Kevin Hao wrote:
> We use the tlb1 entries to map low mem to the kernel space. In the
> current code, it assumes that the first tlb entry would cover the
> kernel image. But this is not true for some special cases, such as
> when we run a relocatable kernel above the 256M or set
> CONFIG_KERNEL_START above 256M. So we choose to switch to address
> space 1 before setting these tlb entries.

If you're doing this, then I see even less reason to use such a large  
boot TLB1 entry.

> Signed-off-by: Kevin Hao <haokexin at gmail.com>
> ---
> A new patch in v2.
> 
>  arch/powerpc/kernel/head_fsl_booke.S | 81  
> ++++++++++++++++++++++++++++++++++++
>  arch/powerpc/mm/fsl_booke_mmu.c      |  2 +
>  arch/powerpc/mm/mmu_decl.h           |  2 +
>  3 files changed, 85 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/head_fsl_booke.S  
> b/arch/powerpc/kernel/head_fsl_booke.S
> index 134064d..0cbfe95 100644
> --- a/arch/powerpc/kernel/head_fsl_booke.S
> +++ b/arch/powerpc/kernel/head_fsl_booke.S
> @@ -1172,6 +1172,87 @@ __secondary_hold_acknowledge:
>  #endif
> 
>  /*
> + * Create a tbl entry

s/tbl/tlb/

> diff --git a/arch/powerpc/mm/fsl_booke_mmu.c  
> b/arch/powerpc/mm/fsl_booke_mmu.c
> index 5fe271c..8f60ef8 100644
> --- a/arch/powerpc/mm/fsl_booke_mmu.c
> +++ b/arch/powerpc/mm/fsl_booke_mmu.c
> @@ -222,7 +222,9 @@ void __init adjust_total_lowmem(void)
>  	/* adjust lowmem size to __max_low_memory */
>  	ram = min((phys_addr_t)__max_low_memory,  
> (phys_addr_t)total_lowmem);
> 
> +	i = switch_to_as1();
>  	__max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM);
> +	restore_to_as0(i);

Wouldn't it be simpler to just run out of AS1 from the end of  
fsl_booke_entry_mapping.S, similar to what U-Boot does?  With ESEL  
being changed to something non-conflicting, of course.

-Scott


More information about the Linuxppc-dev mailing list