From: Ovidiu Panait <ovpanait@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 3/3] common/board_f: Make reserve_mmu generic
Date: Sun, 29 Mar 2020 20:57:41 +0300 [thread overview]
Message-ID: <20200329175741.26297-4-ovpanait@gmail.com> (raw)
In-Reply-To: <20200329175741.26297-1-ovpanait@gmail.com>
Introduce arch_reserve_mmu to allow for architecture-specific reserve_mmu
routines. Also, define a weak nop stub for it.
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
---
arch/arm/lib/cache.c | 2 +-
common/board_f.c | 9 ++++++---
include/init.h | 13 ++++++++++++-
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 3cbed602eb..44dde26065 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -121,7 +121,7 @@ void invalidate_l2_cache(void)
}
#endif
-__weak int reserve_mmu(void)
+int arch_reserve_mmu(void)
{
return arm_reserve_mmu();
}
diff --git a/common/board_f.c b/common/board_f.c
index a88bd64630..52750dd307 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -385,6 +385,11 @@ static int reserve_round_4k(void)
return 0;
}
+__weak int arch_reserve_mmu(void)
+{
+ return 0;
+}
+
static int reserve_video(void)
{
#ifdef CONFIG_DM_VIDEO
@@ -942,9 +947,7 @@ static const init_fnc_t init_sequence_f[] = {
reserve_pram,
#endif
reserve_round_4k,
-#ifdef CONFIG_ARM
- reserve_mmu,
-#endif
+ arch_reserve_mmu,
reserve_video,
reserve_trace,
reserve_uboot,
diff --git a/include/init.h b/include/init.h
index 2a33a3fd1e..9ef88c966b 100644
--- a/include/init.h
+++ b/include/init.h
@@ -129,6 +129,18 @@ int testdram(void);
*/
int arch_reserve_stacks(void);
+/**
+ * arch_reserve_mmu() - Reserve memory for MMU TLB table
+ *
+ * Architecture-specific routine for reserving memory for the MMU TLB table.
+ * This is used in generic board init sequence in common/board_f.c.
+ *
+ * If an implementation is not provided, it will just be a nop stub.
+ *
+ * Return: 0 if OK
+ */
+int arch_reserve_mmu(void);
+
/**
* init_cache_f_r() - Turn on the cache in preparation for relocation
*
@@ -145,7 +157,6 @@ int init_cache_f_r(void);
int print_cpuinfo(void);
#endif
int timer_init(void);
-int reserve_mmu(void);
int misc_init_f(void);
#if defined(CONFIG_DTB_RESELECT)
--
2.17.1
next prev parent reply other threads:[~2020-03-29 17:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-29 17:57 [PATCH v2 0/3] common/board_f: Make reserve_mmu generic Ovidiu Panait
2020-03-29 17:57 ` [PATCH v2 1/3] common/board_f: Move arm-specific reserve_mmu to arch/arm/lib/cache.c Ovidiu Panait
2020-03-30 23:56 ` Simon Glass
2020-04-26 11:25 ` Tom Rini
2020-03-29 17:57 ` [PATCH v2 2/3] arm: asm/cache.c: Introduce arm_reserve_mmu Ovidiu Panait
2020-03-30 23:57 ` Simon Glass
2020-04-26 11:26 ` Tom Rini
2020-03-29 17:57 ` Ovidiu Panait [this message]
2020-03-30 23:57 ` [PATCH v2 3/3] common/board_f: Make reserve_mmu generic Simon Glass
2020-04-26 11:26 ` Tom Rini
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=20200329175741.26297-4-ovpanait@gmail.com \
--to=ovpanait@gmail.com \
--cc=u-boot@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox