public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm1136: Fix enable_caches()
Date: Fri, 5 Oct 2012 20:23:14 +0200	[thread overview]
Message-ID: <20121005202314.22af6462@lilith> (raw)
In-Reply-To: <2073292623.6157135.1349381042411.JavaMail.root@advansee.com>

 Beno?t,

On Thu, 4 Oct 2012 22:04:02 +0200 (CEST), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> enable_caches() did not enable icache if CONFIG_SYS_ICACHE_OFF was not defined
> but CONFIG_SYS_DCACHE_OFF was.
> 
> Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> ---
> This patch supersedes http://patchwork.ozlabs.org/patch/177263/ .
> 
> Changes for v2:
>  - Move enable_caches() outside of the main #if in order to fix this icache
>    issue rather than doing only #if cosmetic cleanup.
> 
>  .../arch/arm/cpu/arm1136/cpu.c                     |   22 +++++++++++---------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git u-boot-arm-1dfc916.orig/arch/arm/cpu/arm1136/cpu.c u-boot-arm-1dfc916/arch/arm/cpu/arm1136/cpu.c
> index b98e3d9..32a4c24 100644
> --- u-boot-arm-1dfc916.orig/arch/arm/cpu/arm1136/cpu.c
> +++ u-boot-arm-1dfc916/arch/arm/cpu/arm1136/cpu.c
> @@ -141,16 +141,6 @@ void flush_cache(unsigned long start, unsigned long size)
>  	flush_dcache_range(start, start + size);
>  }
>  
> -void enable_caches(void)
> -{
> -#ifndef CONFIG_SYS_ICACHE_OFF
> -	icache_enable();
> -#endif
> -#ifndef CONFIG_SYS_DCACHE_OFF
> -	dcache_enable();
> -#endif
> -}
> -
>  #else /* #ifndef CONFIG_SYS_DCACHE_OFF */
>  void invalidate_dcache_all(void)
>  {
> @@ -172,3 +162,15 @@ void flush_cache(unsigned long start, unsigned long size)
>  {
>  }
>  #endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
> +
> +#if !defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF)
> +void enable_caches(void)
> +{
> +#ifndef CONFIG_SYS_ICACHE_OFF
> +	icache_enable();
> +#endif
> +#ifndef CONFIG_SYS_DCACHE_OFF
> +	dcache_enable();
> +#endif
> +}
> +#endif
> 

Applied to u-boot-arm/next, thanks!

Amicalement,
-- 
Albert.

  reply	other threads:[~2012-10-05 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 13:17 [U-Boot] [PATCH] arm1136: cosmetic: Remove double test on CONFIG_SYS_DCACHE_OFF Benoît Thébaudeau
2012-10-04 13:39 ` Albert ARIBAUD
2012-10-04 16:57   ` Benoît Thébaudeau
2012-10-05 17:05     ` Albert ARIBAUD
2012-10-05 17:36       ` Benoît Thébaudeau
2012-10-05 18:15         ` Albert ARIBAUD
2012-10-04 20:04 ` [U-Boot] [PATCH v2] arm1136: Fix enable_caches() Benoît Thébaudeau
2012-10-05 18:23   ` Albert ARIBAUD [this message]
2012-10-31 14:41     ` Benoît Thébaudeau
2012-11-10 11:29       ` Albert ARIBAUD

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=20121005202314.22af6462@lilith \
    --to=albert.u.boot@aribaud.net \
    --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