Skip to contentSkip to conversation

OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that.

PATCH New Alexander Holler 3 participants 3 messages Dec 18, 2010 – Nov 18, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that.

There is no need to have such a function twice.

---
 arch/arm/cpu/armv7/omap3/board.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +1 -11
index 6c2a132..0e62626 100644
@@ -41,16 +41,6 @@
 extern omap3_sysinfo sysinfo;
 
 /******************************************************************************
- * Routine: delay
- * Description: spinning delay to use before udelay works
- *****************************************************************************/
-static inline void delay(unsigned long loops)
-{
-	__asm__ volatile ("1:\n" "subs %0, %1, #1\n"
-			  "bne 1b":"=r" (loops):"0"(loops));
-}
-
-/******************************************************************************
  * Routine: secure_unlock
  * Description: Setup security registers for access
  *              (GP Device only)
@@ -189,7 +179,7 @@ void s_init(void)
 		setup_auxcr();
 
 	set_muxconf_regs();
-	delay(100);
+	sdelay(100);
 
 	prcm_init();
 
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH 1/1 OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that.

Quoted 29 lines · Alexander Holler

There is no need to have such a function twice.

---
  arch/arm/cpu/armv7/omap3/board.c |   12 +-----------
  1 files changed, 1 insertions(+), 11 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +0 -10
index 6c2a132..0e62626 100644
@@ -41,16 +41,6 @@
  extern omap3_sysinfo sysinfo;
 
  /******************************************************************************
- * Routine: delay
- * Description: spinning delay to use before udelay works
- *****************************************************************************/
-static inline void delay(unsigned long loops)
-{
-	__asm__ volatile ("1:\n" "subs %0, %1, #1\n"
-			  "bne 1b":"=r" (loops):"0"(loops));
-}
-
-/******************************************************************************
   * Routine: secure_unlock
   * Description: Setup security registers for access
   *              (GP Device only)

arch/arm/cpu/armv7/omap3/board.c void s_init(void) · line 185

Quoted 8 lines
arch/arm/cpu/armv7/omap3/board.c +1 -1
@@ -189,7 +179,7 @@ void s_init(void)
  		setup_auxcr();
 
  	set_muxconf_regs();
-	delay(100);
+	sdelay(100);
 
  	prcm_init();
 

Looking at the implementation of sdelay(), yes, it seems it's just an identical copy of delay(). So:

Thanks

Dirk

#2 lore raw

PATCH 1/1 OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that.

In reply to Alexander Holler
Quoted 6 lines · On Sat, 18 Dec 2010 13:24:20 +0100 Alexander Holler <[email protected]>…

There is no need to have such a function twice.

---
 arch/arm/cpu/armv7/omap3/board.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

Applied rebased version to u-boot-staging agust at denx.de

Thanks,
Anatolij