Re: [PATCH 11/27] ARM: Move early MMU after malloc initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12.05.23 13:09, Sascha Hauer wrote:
> Initialize the MMU after malloc so that we can use malloc in the
> MMU code, for example to allocate memory for page tables.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Acked-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

> ---
>  arch/arm/cpu/start.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> index bcfc630f3b..9d788eba2b 100644
> --- a/arch/arm/cpu/start.c
> +++ b/arch/arm/cpu/start.c
> @@ -167,16 +167,6 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
>  	arm_barebox_size = barebox_size;
>  	malloc_end = barebox_base;
>  
> -	if (IS_ENABLED(CONFIG_MMU_EARLY)) {
> -		unsigned long ttb = arm_mem_ttb(membase, endmem);
> -
> -		if (!IS_ENABLED(CONFIG_PBL_IMAGE)) {
> -			pr_debug("enabling MMU, ttb @ 0x%08lx\n", ttb);
> -			arm_early_mmu_cache_invalidate();
> -			mmu_early_enable(membase, memsize - OPTEE_SIZE, ttb);
> -		}
> -	}
> -
>  	if (boarddata) {
>  		uint32_t totalsize = 0;
>  		const char *name;
> @@ -226,6 +216,16 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
>  
>  	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
>  
> +	if (IS_ENABLED(CONFIG_MMU_EARLY)) {
> +		unsigned long ttb = arm_mem_ttb(membase, endmem);
> +
> +		if (!IS_ENABLED(CONFIG_PBL_IMAGE)) {
> +			pr_debug("enabling MMU, ttb @ 0x%08lx\n", ttb);
> +			arm_early_mmu_cache_invalidate();
> +			mmu_early_enable(membase, memsize - OPTEE_SIZE, ttb);
> +		}
> +	}
> +
>  	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
>  		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1);
>  

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux