From: Ovidiu Panait <ovidiu.panait@windriver.com>
To: u-boot@lists.denx.de
Cc: Ovidiu Panait <ovidiu.panait@windriver.com>,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
Bin Meng <bmeng.cn@gmail.com>,
Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
Priyanka Jain <priyanka.jain@nxp.com>,
Simon Glass <sjg@chromium.org>,
Tim Harvey <tharvey@gateworks.com>, Wolfgang Denk <wd@denx.de>
Subject: [PATCH 5/7] common: board_r: move init_addr_map() to init.h
Date: Sat, 30 Oct 2021 09:51:38 +0300 [thread overview]
Message-ID: <20211030065140.3589529-5-ovidiu.panait@windriver.com> (raw)
In-Reply-To: <20211030065140.3589529-1-ovidiu.panait@windriver.com>
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.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---
arch/arm/include/asm/mmu.h | 8 --------
arch/powerpc/cpu/mpc85xx/tlb.c | 1 +
arch/powerpc/include/asm/mmu.h | 4 ----
board/freescale/common/fsl_chain_of_trust.c | 5 +----
common/board_r.c | 3 ---
include/init.h | 10 ++++++++++
6 files changed, 12 insertions(+), 19 deletions(-)
delete mode 100644 arch/arm/include/asm/mmu.h
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 <common.h>
+#include <init.h>
#include <asm/bitops.h>
#include <asm/global_data.h>
#include <asm/processor.h>
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 <common.h>
#include <dm.h>
#include <env.h>
+#include <init.h>
#include <fsl_validate.h>
#include <fsl_secboot_err.h>
#include <fsl_sfp.h>
@@ -16,10 +17,6 @@
#include <spl.h>
#endif
-#ifdef CONFIG_ADDR_MAP
-#include <asm/mmu.h>
-#endif
-
#ifdef CONFIG_FSL_CORENET
#include <asm/fsl_pamu.h>
#endif
diff --git a/common/board_r.c b/common/board_r.c
index 0b8f2a0b91..af900e2c6e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -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>
diff --git a/include/init.h b/include/init.h
index e11472ac09..09a1ccefc9 100644
--- a/include/init.h
+++ b/include/init.h
@@ -318,6 +318,16 @@ int arch_initr_trap(void);
*/
int bedbug_init(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
*
--
2.25.1
next prev parent reply other threads:[~2021-10-30 6:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 6:51 [PATCH 1/7] common: spl: move armv7m-specific code to spl_perform_fixups() Ovidiu Panait
2021-10-30 6:51 ` [PATCH 2/7] common: board_r: move bedbug_init() to common code Ovidiu Panait
2021-10-30 6:51 ` [PATCH 3/7] common: board_r: drop initr_kgdb wrapper Ovidiu Panait
2021-10-30 6:51 ` [PATCH 4/7] common: board_r: drop initr_addr_map wrapper Ovidiu Panait
2021-11-03 12:15 ` Matthias Brugger
2021-11-05 2:02 ` Simon Glass
2021-10-30 6:51 ` Ovidiu Panait [this message]
2021-10-30 6:51 ` [PATCH 6/7] common: board_r: include asm-generic/gpio.h Ovidiu Panait
2021-10-30 6:51 ` [PATCH 7/7] common: board_r: drop ifdefs around header includes Ovidiu Panait
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211030065140.3589529-5-ovidiu.panait@windriver.com \
--to=ovidiu.panait@windriver.com \
--cc=bmeng.cn@gmail.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=priyanka.jain@nxp.com \
--cc=sjg@chromium.org \
--cc=takahiro.akashi@linaro.org \
--cc=tharvey@gateworks.com \
--cc=u-boot@lists.denx.de \
--cc=wd@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.