From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3 v2] ARM: Clean arch/arm/lib/cache.c
Date: Fri, 19 Aug 2011 11:38:39 +0200 [thread overview]
Message-ID: <201108191138.39710.marek.vasut@gmail.com> (raw)
In-Reply-To: <1313745795-1326-1-git-send-email-hong.xu@atmel.com>
On Friday, August 19, 2011 11:23:13 AM Hong Xu wrote:
> The default cache operations defined in arch/arm/lib/cache.c
> do not perform any real cache operation, and instead a WARNING
> will be emitted.
>
> Signed-off-by: Hong Xu <hong.xu@atmel.com>
> Tested-by: Elen Song <elen.song@atmel.com>
> CC: Albert Aribaud <albert.u.boot@aribaud.net>
You can add my:
Tested-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Cheers!
> ---
> Since V1
> Modified copyright line
> Used `debug' to replace `printf'
>
> arch/arm/lib/cache.c | 58
> +++++++++++++++++++++++++++---------------------- 1 files changed, 32
> insertions(+), 26 deletions(-)
>
> diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
> index 92b61a2..ce9b712 100644
> --- a/arch/arm/lib/cache.c
> +++ b/arch/arm/lib/cache.c
> @@ -1,6 +1,5 @@
> /*
> - * (C) Copyright 2002
> - * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + * (C) Copyright 2011 Atmel Corporation
> *
> * See file CREDITS for list of people who contributed to this
> * project.
> @@ -20,36 +19,43 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> * MA 02111-1307 USA
> */
> +#include <linux/compiler.h>
> +#include <common.h>
>
> -/* for now: just dummy functions to satisfy the linker */
> +#define EMIT_WARNING debug("WARNING: %s - CPU cache operation is not " \
> +"implemented!\n", __func__)
>
> -#include <common.h>
> +/*
> + * Default implementations
> + *
> + * Warn user if CPU code does not implement necessary cache functions
> + */
> +void __weak flush_cache(unsigned long start, unsigned long size)
> +{
> + EMIT_WARNING;
> +}
>
> -void __flush_cache(unsigned long start, unsigned long size)
> +void __weak flush_dcache_all(void)
> {
> -#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
> - void arm1136_cache_flush(void);
> + EMIT_WARNING;
> +}
>
> - arm1136_cache_flush();
> -#endif
> -#ifdef CONFIG_ARM926EJS
> - /* test and clean, page 2-23 of arm926ejs manual */
> - asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
> - /* disable write buffer as well (page 2-22) */
> - asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
> -#endif
> - return;
> +void __weak flush_dcache_range(unsigned long start, unsigned long stop)
> +{
> + EMIT_WARNING;
> }
> -void flush_cache(unsigned long start, unsigned long size)
> - __attribute__((weak, alias("__flush_cache")));
>
> -/*
> - * Default implementation:
> - * do a range flush for the entire range
> - */
> -void __flush_dcache_all(void)
> +void __weak invalidate_dcache_range(unsigned long start, unsigned long
> stop) +{
> + EMIT_WARNING;
> +}
> +
> +void __weak invalidate_dcache_all(void)
> +{
> + EMIT_WARNING;
> +}
> +
> +void __weak invalidate_icache_all(void)
> {
> - flush_cache(0, ~0);
> + EMIT_WARNING;
> }
> -void flush_dcache_all(void)
> - __attribute__((weak, alias("__flush_dcache_all")));
prev parent reply other threads:[~2011-08-19 9:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 9:23 [U-Boot] [PATCH 1/3 v2] ARM: Clean arch/arm/lib/cache.c Hong Xu
2011-08-19 9:23 ` [U-Boot] [PATCH 2/3 v2] ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c Hong Xu
2011-08-19 9:40 ` Marek Vasut
2011-08-19 9:59 ` Hong Xu
2011-08-19 12:57 ` Marek Vasut
2011-10-06 21:50 ` Wolfgang Denk
2011-08-19 9:23 ` [U-Boot] [PATCH 3/3 v2] ARM: ARM926EJS - Add cache operations Hong Xu
2011-08-19 9:37 ` Aneesh V
2011-08-19 9:46 ` Marek Vasut
2011-08-19 10:43 ` Aneesh V
2011-08-19 12:55 ` Marek Vasut
2011-08-19 14:16 ` Aneesh V
2011-08-28 19:16 ` Marek Vasut
2011-08-19 9:41 ` Marek Vasut
2011-08-19 10:17 ` Lei Wen
2011-08-19 10:30 ` Hong Xu
2011-08-19 10:31 ` Lei Wen
2011-08-22 2:03 ` Hong Xu
2011-08-19 14:20 ` Aneesh V
2011-08-22 2:14 ` Hong Xu
2011-08-22 3:31 ` V, Aneesh
2011-08-19 9:38 ` Marek Vasut [this message]
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=201108191138.39710.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--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