public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix typo and cp_delay
@ 2008-11-10 20:00 dirk.behme at googlemail.com
  2008-11-20 22:44 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 2+ messages in thread
From: dirk.behme at googlemail.com @ 2008-11-10 20:00 UTC (permalink / raw)
  To: u-boot

Fix typo and cp_delay.

Note that most of ARM code uses for-loop as cp_delay() implementation.
Scott Wood made some tests and volatile prevents gcc from optimizing
loop away, so this implemention should be fine. For OMAP some nops are
sufficent, though. 

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>

---

Changes in v2:

- Correct patch header style.

v2 of this patch makes previous version v1 obsolete.

 cpu/arm_cortexa8/cpu.c   |    5 ++---
 cpu/arm_cortexa8/start.S |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

Index: u-boot-arm/cpu/arm_cortexa8/start.S
===================================================================
--- u-boot-arm.orig/cpu/arm_cortexa8/start.S
+++ u-boot-arm/cpu/arm_cortexa8/start.S
@@ -394,7 +394,7 @@ irq:
 	.align	5
 fiq:
 	get_fiq_stack
-	/* someone ought to write a more effiction fiq_save_user_regs */
+	/* someone ought to write a more effective fiq_save_user_regs */
 	irq_save_user_regs
 	bl	do_fiq
 	irq_restore_user_regs
Index: u-boot-arm/cpu/arm_cortexa8/cpu.c
===================================================================
--- u-boot-arm.orig/cpu/arm_cortexa8/cpu.c
+++ u-boot-arm/cpu/arm_cortexa8/cpu.c
@@ -68,10 +68,9 @@ static void write_p15_c1(unsigned long v
 
 static void cp_delay(void)
 {
-	volatile int i;
-
 	/* Many OMAP regs need at least 2 nops */
-	for (i = 0; i < 100; i++) ;
+	asm("nop");
+	asm("nop");
 }
 
 /* See also ARM Ref. Man. */

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

* [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix typo and cp_delay
  2008-11-10 20:00 [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix typo and cp_delay dirk.behme at googlemail.com
@ 2008-11-20 22:44 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-20 22:44 UTC (permalink / raw)
  To: u-boot

On 21:00 Mon 10 Nov     , dirk.behme at googlemail.com wrote:
> Fix typo and cp_delay.
> 
> Note that most of ARM code uses for-loop as cp_delay() implementation.
> Scott Wood made some tests and volatile prevents gcc from optimizing
> loop away, so this implemention should be fine. For OMAP some nops are
> sufficent, though. 
> 
> Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
> 
> ---
> 
> Changes in v2:
> 
> - Correct patch header style.
> 
> v2 of this patch makes previous version v1 obsolete.
> 
>  cpu/arm_cortexa8/cpu.c   |    5 ++---
>  cpu/arm_cortexa8/start.S |    2 +-
>  2 files changed, 3 insertions(+), 4 deletions(-)
apply to u-boot-arm/omap3

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

end of thread, other threads:[~2008-11-20 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 20:00 [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix typo and cp_delay dirk.behme at googlemail.com
2008-11-20 22:44 ` Jean-Christophe PLAGNIOL-VILLARD

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