common: board_r: move init_addr_map() to init.h
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sat, 1 Jan 2022 17:13:29 +0000 (19:13 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 18 Jan 2022 13:31:02 +0000 (08:31 -0500)
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 <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
arch/arm/include/asm/mmu.h [deleted file]
arch/powerpc/cpu/mpc85xx/tlb.c
arch/powerpc/include/asm/mmu.h
board/freescale/common/fsl_chain_of_trust.c
common/board_r.c
include/init.h

diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
deleted file mode 100644 (file)
index 8449720..0000000
+++ /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
index aa9b59d..550d45d 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/bitops.h>
 #include <asm/global_data.h>
 #include <asm/processor.h>
index cb5b26c..2e6255f 100644 (file)
@@ -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,
index cafb249..7ffb315 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
+#include <init.h>
 #include <fsl_validate.h>
 #include <fsl_secboot_err.h>
 #include <fsl_sfp.h>
 #include <spl.h>
 #endif
 
-#ifdef CONFIG_ADDR_MAP
-#include <asm/mmu.h>
-#endif
-
 #ifdef CONFIG_FSL_CORENET
 #include <asm/fsl_pamu.h>
 #endif
index de6a20b..b891c84 100644 (file)
@@ -59,9 +59,6 @@
 #ifdef CONFIG_XEN
 #include <xen.h>
 #endif
-#ifdef CONFIG_ADDR_MAP
-#include <asm/mmu.h>
-#endif
 #include <asm/sections.h>
 #include <dm/root.h>
 #include <dm/ofnode.h>
index dcd682c..20c3976 100644 (file)
@@ -311,6 +311,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
  *
  * This normally runs the command line.