public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nios2: zap cache status enable and disable functions
@ 2015-10-09  3:32 Thomas Chou
  2015-10-09 12:57 ` Marek Vasut
  2015-10-13 13:19 ` Thomas Chou
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Chou @ 2015-10-09  3:32 UTC (permalink / raw)
  To: u-boot

As the icache and dcache of nios2 are always enabled, the
cmd_cache is no of use and the cache status, enable and
disable functions can be removed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 arch/nios2/cpu/cpu.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 229a07b..4183244 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -29,21 +29,6 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
-int dcache_status(void)
-{
-	return 1;
-}
-
-void dcache_enable(void)
-{
-	flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
-}
-
-void dcache_disable(void)
-{
-	flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
-}
-
 int arch_cpu_init_dm(void)
 {
 	struct udevice *dev;
-- 
2.1.4

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

* [U-Boot] [PATCH] nios2: zap cache status enable and disable functions
  2015-10-09  3:32 [U-Boot] [PATCH] nios2: zap cache status enable and disable functions Thomas Chou
@ 2015-10-09 12:57 ` Marek Vasut
  2015-10-10  7:38   ` Thomas Chou
  2015-10-13 13:19 ` Thomas Chou
  1 sibling, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2015-10-09 12:57 UTC (permalink / raw)
  To: u-boot

On Friday, October 09, 2015 at 05:32:47 AM, Thomas Chou wrote:
> As the icache and dcache of nios2 are always enabled, the
> cmd_cache is no of use and the cache status, enable and
> disable functions can be removed.

This is no good, I want to be able to enable/disable caches to look
for DMA-related issues. That is, if I disable cache, the suspicious
driver works and if I enable cache, the driver does not work, I can
conclude that it's a DMA/cache-related issue.

> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>  arch/nios2/cpu/cpu.c | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
> index 229a07b..4183244 100644
> --- a/arch/nios2/cpu/cpu.c
> +++ b/arch/nios2/cpu/cpu.c
> @@ -29,21 +29,6 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char
> * const argv[]) return 0;
>  }
> 
> -int dcache_status(void)
> -{
> -	return 1;
> -}
> -
> -void dcache_enable(void)
> -{
> -	flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
> -}
> -
> -void dcache_disable(void)
> -{
> -	flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
> -}
> -
>  int arch_cpu_init_dm(void)
>  {
>  	struct udevice *dev;

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] nios2: zap cache status enable and disable functions
  2015-10-09 12:57 ` Marek Vasut
@ 2015-10-10  7:38   ` Thomas Chou
  2015-10-10 18:10     ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Chou @ 2015-10-10  7:38 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On 10/09/2015 08:57 PM, Marek Vasut wrote:
> On Friday, October 09, 2015 at 05:32:47 AM, Thomas Chou wrote:
>> As the icache and dcache of nios2 are always enabled, the
>> cmd_cache is no of use and the cache status, enable and
>> disable functions can be removed.
>
> This is no good, I want to be able to enable/disable caches to look
> for DMA-related issues. That is, if I disable cache, the suspicious
> driver works and if I enable cache, the driver does not work, I can
> conclude that it's a DMA/cache-related issue.

I understand. But the hardware always enables the cache if it is 
configured in nios2 cpu.

We can bypass (partially disable) the cache using ioremap() or 
dma_alloc_coherent(). If the DMA buffer address is mangled with 
ioremap(), then it is uncached. You may use this to debug.

Best regards,
Thomas Chou

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

* [U-Boot] [PATCH] nios2: zap cache status enable and disable functions
  2015-10-10  7:38   ` Thomas Chou
@ 2015-10-10 18:10     ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2015-10-10 18:10 UTC (permalink / raw)
  To: u-boot

On Saturday, October 10, 2015 at 09:38:46 AM, Thomas Chou wrote:
> Hi Marek,
> 
> On 10/09/2015 08:57 PM, Marek Vasut wrote:
> > On Friday, October 09, 2015 at 05:32:47 AM, Thomas Chou wrote:
> >> As the icache and dcache of nios2 are always enabled, the
> >> cmd_cache is no of use and the cache status, enable and
> >> disable functions can be removed.
> > 
> > This is no good, I want to be able to enable/disable caches to look
> > for DMA-related issues. That is, if I disable cache, the suspicious
> > driver works and if I enable cache, the driver does not work, I can
> > conclude that it's a DMA/cache-related issue.
> 
> I understand. But the hardware always enables the cache if it is
> configured in nios2 cpu.
> 
> We can bypass (partially disable) the cache using ioremap() or
> dma_alloc_coherent(). If the DMA buffer address is mangled with
> ioremap(), then it is uncached. You may use this to debug.

OK, now it's clearer to me what you mean, thanks.

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] nios2: zap cache status enable and disable functions
  2015-10-09  3:32 [U-Boot] [PATCH] nios2: zap cache status enable and disable functions Thomas Chou
  2015-10-09 12:57 ` Marek Vasut
@ 2015-10-13 13:19 ` Thomas Chou
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Chou @ 2015-10-13 13:19 UTC (permalink / raw)
  To: u-boot



On 10/09/2015 11:32 AM, Thomas Chou wrote:
> As the icache and dcache of nios2 are always enabled, the
> cmd_cache is no of use and the cache status, enable and
> disable functions can be removed.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>   arch/nios2/cpu/cpu.c | 15 ---------------
>   1 file changed, 15 deletions(-)
>

Applied to u-boot-nios.

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

end of thread, other threads:[~2015-10-13 13:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09  3:32 [U-Boot] [PATCH] nios2: zap cache status enable and disable functions Thomas Chou
2015-10-09 12:57 ` Marek Vasut
2015-10-10  7:38   ` Thomas Chou
2015-10-10 18:10     ` Marek Vasut
2015-10-13 13:19 ` Thomas Chou

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