From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/8] arm: minor fixes for cache and mmu handling
Date: Sat, 08 Jan 2011 08:04:47 +0100 [thread overview]
Message-ID: <4D280C8F.605@free.fr> (raw)
In-Reply-To: <1293018898-13253-5-git-send-email-aneesh@ti.com>
Hi Aneesh,
Le 22/12/2010 12:54, Aneesh V a ?crit :
> 1. make sure that page table setup is not done multiple times
> 2. flush_dcache_all() is more appropriate while disabling cache
> than a range flush on the entire memory(flush_cache())
>
> Provide a default implementation for flush_dcache_all()
> for backward compatibility and to avoid build issues.
>
> Signed-off-by: Aneesh V<aneesh@ti.com>
> ---
> arch/arm/lib/cache-cp15.c | 9 +++++++--
> arch/arm/lib/cache.c | 13 ++++++++++++-
> 2 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
> index ca526fb..20aa993 100644
> --- a/arch/arm/lib/cache-cp15.c
> +++ b/arch/arm/lib/cache-cp15.c
> @@ -94,13 +94,18 @@ static inline void mmu_setup(void)
> set_cr(reg | CR_M);
> }
>
> +static int mmu_enabled(void)
> +{
> + return get_cr()& CR_M;
> +}
> +
> /* cache_bit must be either CR_I or CR_C */
> static void cache_enable(uint32_t cache_bit)
> {
> uint32_t reg;
>
> /* The data cache is not active unless the mmu is enabled too */
> - if (cache_bit == CR_C)
> + if ((cache_bit == CR_C)&& !mmu_enabled())
> mmu_setup();
> reg = get_cr(); /* get control reg. */
> cp_delay();
Do you know why double MMU setups happen? Can we not fix the execution
path and remove the second MMU setup call there, rather that catching t
on the fly to ignore it?
> @@ -119,7 +124,7 @@ static void cache_disable(uint32_t cache_bit)
> return;
> /* if disabling data cache, disable mmu too */
> cache_bit |= CR_M;
> - flush_cache(0, ~0);
> + flush_dcache_all();
> }
> reg = get_cr();
> cp_delay();
> diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
> index 275b6e1..363609a 100644
> --- a/arch/arm/lib/cache.c
> +++ b/arch/arm/lib/cache.c
> @@ -25,7 +25,7 @@
>
> #include<common.h>
>
> -void __flush_cache(unsigned long dummy1, unsigned long dummy2)
> +void __flush_cache(unsigned long start, unsigned long size)
> {
> #if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
> void arm1136_cache_flush(void);
> @@ -42,3 +42,14 @@ void __flush_cache(unsigned long dummy1, unsigned long dummy2)
> }
> void flush_cache(unsigned long dummy1, unsigned long dummy2)
Please fix also parameters in this declaration.
> __attribute__((weak, alias("__flush_cache")));
> +
> +/*
> + * Default implementation:
> + * do a range flush for the entire range
> + */
> +void __flush_dcache_all(void)
> +{
> + flush_cache(0, ~0);
> +}
> +void flush_dcache_all(void)
> + __attribute__((weak, alias("__flush_dcache_all")));
Amicalement,
--
Albert.
next prev parent reply other threads:[~2011-01-08 7:04 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-22 11:54 [U-Boot] [PATCH 0/8] armv7: cache maintenance operations Aneesh V
2010-12-22 11:54 ` [U-Boot] [PATCH 1/8] arm: make default implementation of cache_flush() weakly linked Aneesh V
2011-01-08 6:40 ` Albert ARIBAUD
2010-12-22 11:54 ` [U-Boot] [PATCH 2/8] armv7: cache maintenance operations for armv7 Aneesh V
2011-01-08 6:36 ` Albert ARIBAUD
2011-01-08 8:40 ` Albert ARIBAUD
2011-01-08 10:06 ` Aneesh V
2011-01-12 19:18 ` Albert ARIBAUD
2011-01-13 11:10 ` Aneesh V
2011-01-13 12:14 ` Aneesh V
2011-01-13 17:12 ` Albert ARIBAUD
2011-01-08 13:17 ` Aneesh V
2011-01-08 14:06 ` Albert ARIBAUD
2011-01-09 22:41 ` Wolfgang Denk
2011-01-10 4:56 ` Aneesh V
2011-01-17 21:47 ` Wolfgang Denk
2011-01-12 9:08 ` Aneesh V
2011-01-12 19:23 ` Albert ARIBAUD
2011-01-13 12:05 ` Aneesh V
2011-01-13 13:14 ` Albert ARIBAUD
2011-01-13 14:30 ` Aneesh V
2011-01-13 17:06 ` Albert ARIBAUD
2011-03-01 11:54 ` Aneesh V
2011-03-01 13:36 ` Albert ARIBAUD
2010-12-22 11:54 ` [U-Boot] [PATCH 3/8] armv7: integrate cache maintenance support Aneesh V
2011-01-08 6:54 ` Albert ARIBAUD
2011-01-08 8:15 ` Aneesh V
2010-12-22 11:54 ` [U-Boot] [PATCH 4/8] arm: minor fixes for cache and mmu handling Aneesh V
2011-01-08 7:04 ` Albert ARIBAUD [this message]
2011-01-08 9:13 ` Aneesh V
2010-12-22 11:54 ` [U-Boot] [PATCH 5/8] armv7: add PL310 support to u-boot Aneesh V
2011-01-09 22:48 ` Wolfgang Denk
2011-01-10 13:41 ` Aneesh V
2010-12-22 11:54 ` [U-Boot] [PATCH 6/8] armv7: adapt omap4 to the new cache maintenance framework Aneesh V
2011-01-09 22:52 ` Wolfgang Denk
2011-01-10 14:33 ` Aneesh V
2011-01-17 21:52 ` Wolfgang Denk
2010-12-22 11:54 ` [U-Boot] [PATCH 7/8] armv7: adapt omap3 " Aneesh V
2011-01-09 22:57 ` Wolfgang Denk
2011-01-10 14:41 ` Aneesh V
2011-01-17 21:55 ` Wolfgang Denk
2011-01-18 5:31 ` Aneesh V
2011-01-18 9:23 ` Wolfgang Denk
2010-12-22 11:54 ` [U-Boot] [PATCH 8/8] armv7: adapt s5pc1xx " Aneesh V
2010-12-27 7:25 ` Minkyu Kang
2010-12-27 11:22 ` Aneesh V
2011-01-07 5:27 ` Minkyu Kang
2010-12-23 4:53 ` [U-Boot] [PATCH 0/8] armv7: cache maintenance operations Steve Sakoman
2010-12-28 19:51 ` Paulraj, Sandeep
2011-01-08 7:07 ` 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=4D280C8F.605@free.fr \
--to=albert.aribaud@free.fr \
--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