U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: [PATCH 7/7] cmd: cache: Remove weak functions
Date: Wed, 19 Jun 2024 15:27:59 -0600	[thread overview]
Message-ID: <20240619212759.3456158-7-trini@konsulko.com> (raw)
In-Reply-To: <20240619212759.3456158-1-trini@konsulko.com>

It should be up to an architecture to decide how to implement cache
functions, and if they need to use weak functions or not. Allowing the
cache command to be built without cache functionality implemented is
unhelpful. Further, guard the call to noncached_set_region with
CONFIG_SYS_NONCACHED_MEMORY as that's when it's implemented and again is
an architecture specific detail.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
This patch series is intended to replace
https://patchwork.ozlabs.org/project/uboot/patch/20240616173105.7430-2-heinrich.schuchardt@canonical.com/
---
 cmd/cache.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/cmd/cache.c b/cmd/cache.c
index 0254ff17f9b2..7a2068296ef1 100644
--- a/cmd/cache.c
+++ b/cmd/cache.c
@@ -13,16 +13,6 @@
 
 static int parse_argv(const char *);
 
-void __weak invalidate_icache_all(void)
-{
-	/* please define arch specific invalidate_icache_all */
-	puts("No arch specific invalidate_icache_all available!\n");
-}
-
-__weak void noncached_set_region(void)
-{
-}
-
 static int do_icache(struct cmd_tbl *cmdtp, int flag, int argc,
 		     char *const argv[])
 {
@@ -52,12 +42,6 @@ static int do_icache(struct cmd_tbl *cmdtp, int flag, int argc,
 	return 0;
 }
 
-void __weak flush_dcache_all(void)
-{
-	puts("No arch specific flush_dcache_all available!\n");
-	/* please define arch specific flush_dcache_all */
-}
-
 static int do_dcache(struct cmd_tbl *cmdtp, int flag, int argc,
 		     char *const argv[])
 {
@@ -69,7 +53,9 @@ static int do_dcache(struct cmd_tbl *cmdtp, int flag, int argc,
 			break;
 		case 1:
 			dcache_enable();
+#ifdef CONFIG_SYS_NONCACHED_MEMORY
 			noncached_set_region();
+#endif
 			break;
 		case 2:
 			flush_dcache_all();
-- 
2.34.1


  parent reply	other threads:[~2024-06-19 21:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
2024-06-19 21:27 ` [PATCH 2/7] m68k: Rename icache_invalid to invalidate_icache_all Tom Rini
2024-06-20  5:47   ` Ilias Apalodimas
2024-06-19 21:27 ` [PATCH 3/7] sh: Implement a default flush_dcache_all Tom Rini
2024-06-25  8:23   ` Ilias Apalodimas
2024-09-10  0:17   ` Marek Vasut
2024-06-19 21:27 ` [PATCH 4/7] sh: Add the old invalidate_icache_all function Tom Rini
2024-09-10  0:18   ` Marek Vasut
2024-06-19 21:27 ` [PATCH 5/7] powerpc: Implement a default flush_dcache_all Tom Rini
2024-06-25  9:57   ` Ilias Apalodimas
2024-06-19 21:27 ` [PATCH 6/7] powerpc: Add the old invalidate_icache_all function Tom Rini
2024-06-19 21:27 ` Tom Rini [this message]
2024-06-20  5:48   ` [PATCH 7/7] cmd: cache: Remove weak functions Ilias Apalodimas
2024-06-24  7:37 ` Acked Angelo Dureghello
2024-06-25  8:23 ` [PATCH 1/7] m68k: Implement a default flush_dcache_all Ilias Apalodimas
2024-07-03 23:22 ` 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=20240619212759.3456158-7-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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