U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] m68k: Implement a default flush_dcache_all
@ 2024-06-19 21:27 Tom Rini
  2024-06-19 21:27 ` [PATCH 2/7] m68k: Rename icache_invalid to invalidate_icache_all Tom Rini
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas, Huan Wang,
	Angelo Dureghello

Implement a weak default version of flush_dcache_all which is based on
the ARM default, which is to flush the entire range via
flush_dcache_range(...).

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Huan Wang <alison.wang@nxp.com>
Cc: Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/lib/cache.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
index de04124404cf..dab834c1cbd8 100644
--- a/arch/m68k/lib/cache.c
+++ b/arch/m68k/lib/cache.c
@@ -134,6 +134,15 @@ void dcache_invalid(void)
 #endif
 }
 
+/*
+ * Default implementation:
+ * do a range flush for the entire range
+ */
+__weak void flush_dcache_all(void)
+{
+	flush_dcache_range(0, ~0);
+}
+
 __weak void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
 	/* An empty stub, real implementation should be in platform code */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/7] m68k: Rename icache_invalid to invalidate_icache_all
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
@ 2024-06-19 21:27 ` 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
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas

The implementation of icache_invalid appears to be doing what other
architectures call invalidate_icache_all so rename to match.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Huan Wang <alison.wang@nxp.com>
Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/include/asm/cache.h | 1 -
 arch/m68k/lib/cache.c         | 6 +++---
 drivers/net/mcffec.c          | 5 +++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h
index 6ef7f7be1af8..aa8d2edb40ba 100644
--- a/arch/m68k/include/asm/cache.h
+++ b/arch/m68k/include/asm/cache.h
@@ -185,7 +185,6 @@
 
 #ifndef __ASSEMBLY__		/* put C only stuff in this section */
 
-void icache_invalid(void);
 void dcache_invalid(void);
 
 #endif
diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
index dab834c1cbd8..370ad40f1423 100644
--- a/arch/m68k/lib/cache.c
+++ b/arch/m68k/lib/cache.c
@@ -29,7 +29,7 @@ int dcache_status(void)
 
 void icache_enable(void)
 {
-	icache_invalid();
+	invalidate_icache_all();
 
 	*cf_icache_status = 1;
 
@@ -53,7 +53,7 @@ void icache_disable(void)
 	u32 temp = 0;
 
 	*cf_icache_status = 0;
-	icache_invalid();
+	invalidate_icache_all();
 
 #if defined(CONFIG_CF_V4) || defined(CFG_CF_V4E)
 	__asm__ __volatile__("movec %0, %%acr2"::"r"(temp));
@@ -68,7 +68,7 @@ void icache_disable(void)
 #endif
 }
 
-void icache_invalid(void)
+void invalidate_icache_all(void)
 {
 	u32 temp;
 
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 04b711e4f650..7e53492733ed 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -11,6 +11,7 @@
  */
 
 #include <config.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <hang.h>
 #include <malloc.h>
@@ -399,7 +400,7 @@ static int mcffec_send(struct udevice *dev, void *packet, int length)
 #endif
 
 #ifdef CONFIG_SYS_UNIFY_CACHE
-	icache_invalid();
+	invalidate_icache_all();
 #endif
 
 	j = 0;
@@ -433,7 +434,7 @@ static int mcffec_recv(struct udevice *dev, int flags, uchar **packetp)
 
 	for (;;) {
 #ifdef CONFIG_SYS_UNIFY_CACHE
-		icache_invalid();
+		invalidate_icache_all();
 #endif
 		/* If nothing received - leave for() loop */
 		if (info->rxbd[info->rx_idx].cbd_sc & BD_ENET_RX_EMPTY)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/7] sh: Implement a default flush_dcache_all
  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-19 21:27 ` 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
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Marek Vasut,
	Nobuhiro Iwamatsu

Implement a weak default version of flush_dcache_all which is based on
the ARM default, which is to flush the entire range via
flush_dcache_range(...).

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Marek Vasut <marex@denx.de>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 arch/sh/cpu/sh4/cache.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index 8c1839935ca1..f0cb39d6a923 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -65,6 +65,15 @@ void flush_dcache_range(unsigned long start, unsigned long end)
 	}
 }
 
+/*
+ * Default implementation:
+ * do a range flush for the entire range
+ */
+void flush_dcache_all(void)
+{
+	flush_dcache_range(0, ~0);
+}
+
 void invalidate_dcache_range(unsigned long start, unsigned long end)
 {
 	u32 v;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/7] sh: Add the old invalidate_icache_all function
  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-19 21:27 ` [PATCH 3/7] sh: Implement a default flush_dcache_all Tom Rini
@ 2024-06-19 21:27 ` 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
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Marek Vasut,
	Nobuhiro Iwamatsu

Add the old invalidate_icache_all function that prints a warning that
was previously found in cmd/cache.c

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Marek Vasut <marex@denx.de>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 arch/sh/cpu/sh4/cache.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index f0cb39d6a923..d3c480e79ed2 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -6,6 +6,7 @@
 
 #include <command.h>
 #include <cpu_func.h>
+#include <stdio.h>
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/processor.h>
@@ -100,6 +101,11 @@ void icache_disable(void)
 	cache_control(CACHE_DISABLE);
 }
 
+void invalidate_icache_all(void)
+{
+	puts("No arch specific invalidate_icache_all available!\n");
+}
+
 int icache_status(void)
 {
 	return 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/7] powerpc: Implement a default flush_dcache_all
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (2 preceding siblings ...)
  2024-06-19 21:27 ` [PATCH 4/7] sh: Add the old invalidate_icache_all function Tom Rini
@ 2024-06-19 21:27 ` 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
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas

Implement a weak default version of flush_dcache_all which is based on
the ARM default, which is to flush the entire range via
flush_dcache_range(...).

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/powerpc/lib/cache.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/powerpc/lib/cache.c b/arch/powerpc/lib/cache.c
index e480b2696494..130318d745aa 100644
--- a/arch/powerpc/lib/cache.c
+++ b/arch/powerpc/lib/cache.c
@@ -43,3 +43,12 @@ void flush_cache(ulong start_addr, ulong size)
 	/* flush prefetch queue */
 	asm volatile("isync" : : : "memory");
 }
+
+/*
+ * Default implementation:
+ * do a range flush for the entire range
+ */
+void flush_dcache_all(void)
+{
+	flush_dcache_range(0, ~0);
+}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/7] powerpc: Add the old invalidate_icache_all function
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (3 preceding siblings ...)
  2024-06-19 21:27 ` [PATCH 5/7] powerpc: Implement a default flush_dcache_all Tom Rini
@ 2024-06-19 21:27 ` Tom Rini
  2024-06-19 21:27 ` [PATCH 7/7] cmd: cache: Remove weak functions Tom Rini
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas

Add the old invalidate_icache_all function that prints a warning that
was previously found in cmd/cache.c

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/powerpc/lib/cache.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/lib/cache.c b/arch/powerpc/lib/cache.c
index 130318d745aa..a9cd7b8d30ac 100644
--- a/arch/powerpc/lib/cache.c
+++ b/arch/powerpc/lib/cache.c
@@ -5,6 +5,7 @@
  */
 
 #include <cpu_func.h>
+#include <stdio.h>
 #include <asm/cache.h>
 #include <watchdog.h>
 
@@ -52,3 +53,8 @@ void flush_dcache_all(void)
 {
 	flush_dcache_range(0, ~0);
 }
+
+void invalidate_icache_all(void)
+{
+	puts("No arch specific invalidate_icache_all available!\n");
+}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 7/7] cmd: cache: Remove weak functions
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (4 preceding siblings ...)
  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
  2024-06-20  5:48   ` Ilias Apalodimas
  2024-06-24  7:37 ` Acked Angelo Dureghello
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2024-06-19 21:27 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas

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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] m68k: Rename icache_invalid to invalidate_icache_all
  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
  0 siblings, 0 replies; 16+ messages in thread
From: Ilias Apalodimas @ 2024-06-20  5:47 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt

On Thu, 20 Jun 2024 at 00:28, Tom Rini <trini@konsulko.com> wrote:
>
> The implementation of icache_invalid appears to be doing what other
> architectures call invalidate_icache_all so rename to match.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Huan Wang <alison.wang@nxp.com>
> Angelo Dureghello <angelo@kernel-space.org>
> ---
>  arch/m68k/include/asm/cache.h | 1 -
>  arch/m68k/lib/cache.c         | 6 +++---
>  drivers/net/mcffec.c          | 5 +++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h
> index 6ef7f7be1af8..aa8d2edb40ba 100644
> --- a/arch/m68k/include/asm/cache.h
> +++ b/arch/m68k/include/asm/cache.h
> @@ -185,7 +185,6 @@
>
>  #ifndef __ASSEMBLY__           /* put C only stuff in this section */
>
> -void icache_invalid(void);
>  void dcache_invalid(void);
>
>  #endif
> diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
> index dab834c1cbd8..370ad40f1423 100644
> --- a/arch/m68k/lib/cache.c
> +++ b/arch/m68k/lib/cache.c
> @@ -29,7 +29,7 @@ int dcache_status(void)
>
>  void icache_enable(void)
>  {
> -       icache_invalid();
> +       invalidate_icache_all();
>
>         *cf_icache_status = 1;
>
> @@ -53,7 +53,7 @@ void icache_disable(void)
>         u32 temp = 0;
>
>         *cf_icache_status = 0;
> -       icache_invalid();
> +       invalidate_icache_all();
>
>  #if defined(CONFIG_CF_V4) || defined(CFG_CF_V4E)
>         __asm__ __volatile__("movec %0, %%acr2"::"r"(temp));
> @@ -68,7 +68,7 @@ void icache_disable(void)
>  #endif
>  }
>
> -void icache_invalid(void)
> +void invalidate_icache_all(void)
>  {
>         u32 temp;
>
> diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
> index 04b711e4f650..7e53492733ed 100644
> --- a/drivers/net/mcffec.c
> +++ b/drivers/net/mcffec.c
> @@ -11,6 +11,7 @@
>   */
>
>  #include <config.h>
> +#include <cpu_func.h>
>  #include <env.h>
>  #include <hang.h>
>  #include <malloc.h>
> @@ -399,7 +400,7 @@ static int mcffec_send(struct udevice *dev, void *packet, int length)
>  #endif
>
>  #ifdef CONFIG_SYS_UNIFY_CACHE
> -       icache_invalid();
> +       invalidate_icache_all();
>  #endif
>
>         j = 0;
> @@ -433,7 +434,7 @@ static int mcffec_recv(struct udevice *dev, int flags, uchar **packetp)
>
>         for (;;) {
>  #ifdef CONFIG_SYS_UNIFY_CACHE
> -               icache_invalid();
> +               invalidate_icache_all();
>  #endif
>                 /* If nothing received - leave for() loop */
>                 if (info->rxbd[info->rx_idx].cbd_sc & BD_ENET_RX_EMPTY)
> --
> 2.34.1
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 7/7] cmd: cache: Remove weak functions
  2024-06-19 21:27 ` [PATCH 7/7] cmd: cache: Remove weak functions Tom Rini
@ 2024-06-20  5:48   ` Ilias Apalodimas
  0 siblings, 0 replies; 16+ messages in thread
From: Ilias Apalodimas @ 2024-06-20  5:48 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt

On Thu, 20 Jun 2024 at 00:28, Tom Rini <trini@konsulko.com> wrote:
>
> 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
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Acked
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (5 preceding siblings ...)
  2024-06-19 21:27 ` [PATCH 7/7] cmd: cache: Remove weak functions Tom Rini
@ 2024-06-24  7:37 ` 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
  8 siblings, 0 replies; 16+ messages in thread
From: Angelo Dureghello @ 2024-06-24  7:37 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas, Huan Wang

Hi Tom,

Acked-by: Angelo Dureghello <angelo@kernel-space.org>


thanks,
angelo

On 19/06/24 11:27 PM, Tom Rini wrote:
> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Huan Wang <alison.wang@nxp.com>
> Cc: Angelo Dureghello <angelo@kernel-space.org>
> ---
>   arch/m68k/lib/cache.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
> index de04124404cf..dab834c1cbd8 100644
> --- a/arch/m68k/lib/cache.c
> +++ b/arch/m68k/lib/cache.c
> @@ -134,6 +134,15 @@ void dcache_invalid(void)
>   #endif
>   }
>   
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +__weak void flush_dcache_all(void)
> +{
> +	flush_dcache_range(0, ~0);
> +}
> +
>   __weak void invalidate_dcache_range(unsigned long start, unsigned long stop)
>   {
>   	/* An empty stub, real implementation should be in platform code */

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/7] m68k: Implement a default flush_dcache_all
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (6 preceding siblings ...)
  2024-06-24  7:37 ` Acked Angelo Dureghello
@ 2024-06-25  8:23 ` Ilias Apalodimas
  2024-07-03 23:22 ` Tom Rini
  8 siblings, 0 replies; 16+ messages in thread
From: Ilias Apalodimas @ 2024-06-25  8:23 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt, Huan Wang, Angelo Dureghello

On Thu, 20 Jun 2024 at 00:28, Tom Rini <trini@konsulko.com> wrote:
>
> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Huan Wang <alison.wang@nxp.com>
> Cc: Angelo Dureghello <angelo@kernel-space.org>
> ---
>  arch/m68k/lib/cache.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
> index de04124404cf..dab834c1cbd8 100644
> --- a/arch/m68k/lib/cache.c
> +++ b/arch/m68k/lib/cache.c
> @@ -134,6 +134,15 @@ void dcache_invalid(void)
>  #endif
>  }
>
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +__weak void flush_dcache_all(void)
> +{
> +       flush_dcache_range(0, ~0);
> +}
> +
>  __weak void invalidate_dcache_range(unsigned long start, unsigned long stop)
>  {
>         /* An empty stub, real implementation should be in platform code */
> --
> 2.34.1
>

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/7] sh: Implement a default flush_dcache_all
  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
  1 sibling, 0 replies; 16+ messages in thread
From: Ilias Apalodimas @ 2024-06-25  8:23 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt, Marek Vasut, Nobuhiro Iwamatsu

On Thu, 20 Jun 2024 at 00:28, Tom Rini <trini@konsulko.com> wrote:
>
> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Marek Vasut <marex@denx.de>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
>  arch/sh/cpu/sh4/cache.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
> index 8c1839935ca1..f0cb39d6a923 100644
> --- a/arch/sh/cpu/sh4/cache.c
> +++ b/arch/sh/cpu/sh4/cache.c
> @@ -65,6 +65,15 @@ void flush_dcache_range(unsigned long start, unsigned long end)
>         }
>  }
>
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +void flush_dcache_all(void)
> +{
> +       flush_dcache_range(0, ~0);
> +}
> +
>  void invalidate_dcache_range(unsigned long start, unsigned long end)
>  {
>         u32 v;
> --
> 2.34.1
>

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/7] powerpc: Implement a default flush_dcache_all
  2024-06-19 21:27 ` [PATCH 5/7] powerpc: Implement a default flush_dcache_all Tom Rini
@ 2024-06-25  9:57   ` Ilias Apalodimas
  0 siblings, 0 replies; 16+ messages in thread
From: Ilias Apalodimas @ 2024-06-25  9:57 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt

On Thu, 20 Jun 2024 at 00:28, Tom Rini <trini@konsulko.com> wrote:
>
> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/powerpc/lib/cache.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/powerpc/lib/cache.c b/arch/powerpc/lib/cache.c
> index e480b2696494..130318d745aa 100644
> --- a/arch/powerpc/lib/cache.c
> +++ b/arch/powerpc/lib/cache.c
> @@ -43,3 +43,12 @@ void flush_cache(ulong start_addr, ulong size)
>         /* flush prefetch queue */
>         asm volatile("isync" : : : "memory");
>  }
> +
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +void flush_dcache_all(void)
> +{
> +       flush_dcache_range(0, ~0);
> +}
> --
> 2.34.1
>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/7] m68k: Implement a default flush_dcache_all
  2024-06-19 21:27 [PATCH 1/7] m68k: Implement a default flush_dcache_all Tom Rini
                   ` (7 preceding siblings ...)
  2024-06-25  8:23 ` [PATCH 1/7] m68k: Implement a default flush_dcache_all Ilias Apalodimas
@ 2024-07-03 23:22 ` Tom Rini
  8 siblings, 0 replies; 16+ messages in thread
From: Tom Rini @ 2024-07-03 23:22 UTC (permalink / raw)
  To: u-boot, Tom Rini
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Huan Wang,
	Angelo Dureghello

On Wed, 19 Jun 2024 15:27:53 -0600, Tom Rini wrote:

> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
> 
> 

Applied to u-boot/master, thanks!

-- 
Tom



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/7] sh: Implement a default flush_dcache_all
  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
  1 sibling, 0 replies; 16+ messages in thread
From: Marek Vasut @ 2024-09-10  0:17 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas, Nobuhiro Iwamatsu

On 6/19/24 11:27 PM, Tom Rini wrote:
> Implement a weak default version of flush_dcache_all which is based on
> the ARM default, which is to flush the entire range via
> flush_dcache_range(...).
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Marek Vasut <marex@denx.de>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
>   arch/sh/cpu/sh4/cache.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
> index 8c1839935ca1..f0cb39d6a923 100644
> --- a/arch/sh/cpu/sh4/cache.c
> +++ b/arch/sh/cpu/sh4/cache.c
> @@ -65,6 +65,15 @@ void flush_dcache_range(unsigned long start, unsigned long end)
>   	}
>   }
>   
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +void flush_dcache_all(void)
> +{
> +	flush_dcache_range(0, ~0);
> +}
The current implementation that is in tree should be fine, thanks.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/7] sh: Add the old invalidate_icache_all function
  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
  0 siblings, 0 replies; 16+ messages in thread
From: Marek Vasut @ 2024-09-10  0:18 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas, Nobuhiro Iwamatsu

On 6/19/24 11:27 PM, Tom Rini wrote:
> Add the old invalidate_icache_all function that prints a warning that
> was previously found in cmd/cache.c
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Marek Vasut <marex@denx.de>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
>   arch/sh/cpu/sh4/cache.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
> index f0cb39d6a923..d3c480e79ed2 100644
> --- a/arch/sh/cpu/sh4/cache.c
> +++ b/arch/sh/cpu/sh4/cache.c
> @@ -6,6 +6,7 @@
>   
>   #include <command.h>
>   #include <cpu_func.h>
> +#include <stdio.h>
>   #include <asm/cache.h>
>   #include <asm/io.h>
>   #include <asm/processor.h>
> @@ -100,6 +101,11 @@ void icache_disable(void)
>   	cache_control(CACHE_DISABLE);
>   }
>   
> +void invalidate_icache_all(void)
> +{
> +	puts("No arch specific invalidate_icache_all available!\n");
> +}
> +
>   int icache_status(void)
>   {
>   	return 0;

I just posted

sh: cache: Fill in invalidate_icache_all()

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-09-10  0:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 7/7] cmd: cache: Remove weak functions Tom Rini
2024-06-20  5:48   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox