All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] IXP425: make cmd_go handle caches correctly	Part 1/1
Date: Sun, 4 Jan 2009 08:51:19 +0100	[thread overview]
Message-ID: <20090104075119.GF6960@game.jcrosoft.org> (raw)
In-Reply-To: <gi9cfv$224$1@ger.gmane.org>

> 
> diff --git a/cpu/ixp/cpu.c b/cpu/ixp/cpu.c
> index 27872fb..9035d98 100644
> --- a/cpu/ixp/cpu.c
> +++ b/cpu/ixp/cpu.c
> @@ -171,6 +171,22 @@ int icache_status (void)
>  	return (i & 0x1000);
>  }
> 
> +void icache_invalidate (void)
> +{
> +	register u32 i;
why do you need it?
> +
> +	/* FIXME: Required to check if icache is enabled before we do this? */
> +
> +	/* invalidate I-cache (i is ignored)*/
> +	i = 0;
> +	asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
> +
> +	/* cpwait */
> +	asm ("mrc  p15,0,%0,c2,c0,0;\
> +	    mov  %0,%0;\
> +	    sub  pc,pc,#4" : : "r" (i) );
> +}
> +
>  /* we will never enable dcache, because we have to setup MMU first */
>  void dcache_enable (void)
>  {
> @@ -187,6 +203,11 @@ int dcache_status (void)
>  	return 0;					/* always off */
>  }
> 
> +void dcache_flush (void)
> +{
> +	return;
> +}
> +
>  /* FIXME */
>  /*
>  void pci_init(void)
> @@ -195,6 +216,17 @@ void pci_init(void)
>  }
>  */
> 
general arm function need to be in the lib_arm
> +/* With IXP (and ARM generally) we need to handle caches to avoid
> +   stale data. */
> +unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> +{
> +	dcache_flush ();
> +	icache_invalidate ();
> +
> +	return entry (argc, argv);
> +}
> +
Best Regards,
J.

      reply	other threads:[~2009-01-04  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 21:09 [U-Boot] [PATCH] IXP425: make cmd_go handle caches correctly Part 1/1 Stefan Althoefer
2008-12-15 23:18 ` Wolfgang Denk
2008-12-16 23:11   ` Stefan Althoefer
2009-01-04  7:51     ` Jean-Christophe PLAGNIOL-VILLARD [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=20090104075119.GF6960@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.