From: Ovidiu Panait Date: Sat, 1 Jan 2022 17:13:29 +0000 (+0200) Subject: common: board_r: move init_addr_map() to init.h X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=2fd81be11c9042fa072d1a616c928c406746f68c;p=u-boot.git common: board_r: move init_addr_map() to init.h asm/mmu.h include is currently guarded by CONFIG_ADDR_MAP ifdef because the header is only present on arm and powerpc. In order to remove the dependency on this header and the associated ifdef, move init_addr_map() declaration to init.h, since it is only called during the common init sequence. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h deleted file mode 100644 index 8449720fad..0000000000 --- a/arch/arm/include/asm/mmu.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ - -#ifndef __ASM_ARM_MMU_H -#define __ASM_ARM_MMU_H - -int init_addr_map(void); - -#endif diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index aa9b59d487..550d45da0e 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index cb5b26cd77..2e6255f0d6 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -137,10 +137,6 @@ typedef struct _MMU_context { extern void _tlbie(unsigned long va); /* invalidate a TLB entry */ extern void _tlbia(void); /* invalidate all TLB entries */ -#ifdef CONFIG_ADDR_MAP -extern int init_addr_map(void); -#endif - typedef enum { IBAT0 = 0, IBAT1, IBAT2, IBAT3, DBAT0, DBAT1, DBAT2, DBAT3, diff --git a/board/freescale/common/fsl_chain_of_trust.c b/board/freescale/common/fsl_chain_of_trust.c index cafb24971b..7ffb315bc9 100644 --- a/board/freescale/common/fsl_chain_of_trust.c +++ b/board/freescale/common/fsl_chain_of_trust.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -16,10 +17,6 @@ #include #endif -#ifdef CONFIG_ADDR_MAP -#include -#endif - #ifdef CONFIG_FSL_CORENET #include #endif diff --git a/common/board_r.c b/common/board_r.c index de6a20b0b2..b891c84462 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -59,9 +59,6 @@ #ifdef CONFIG_XEN #include #endif -#ifdef CONFIG_ADDR_MAP -#include -#endif #include #include #include diff --git a/include/init.h b/include/init.h index dcd682c1bf..20c3976af0 100644 --- a/include/init.h +++ b/include/init.h @@ -310,6 +310,16 @@ int board_early_init_r(void); */ int arch_initr_trap(void); +/** + * init_addr_map() + * + * Initialize non-identity virtual-physical memory mappings for 32bit CPUs. + * It is called during the generic board init sequence, after relocation. + * + * Return: 0 if OK + */ +int init_addr_map(void); + /** * main_loop() - Enter the main loop of U-Boot *