summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-04-07 17:00:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-04-12 09:54:57 +0200
commitd0874a846fd11ce9947130156573b50fb0cc4b38 (patch)
treeb1d9f43feadf26b4adaec47db5865afd0311e2e1
parent355b713b8638dd0a10ebe0c5c3c79044d957980f (diff)
downloadbarebox-d0874a846fd11ce9947130156573b50fb0cc4b38.tar.gz
barebox-d0874a846fd11ce9947130156573b50fb0cc4b38.tar.xz
ARM omap: make sr32 a static inline function
This generates smaller code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-omap/include/mach/syslib.h23
-rw-r--r--arch/arm/mach-omap/syslib.c20
2 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/mach-omap/include/mach/syslib.h b/arch/arm/mach-omap/include/mach/syslib.h
index c89f50b816..6a7044adcc 100644
--- a/arch/arm/mach-omap/include/mach/syslib.h
+++ b/arch/arm/mach-omap/include/mach/syslib.h
@@ -30,9 +30,30 @@
*/
#ifndef __ASM_ARCH_OMAP_SYSLIB_H_
#define __ASM_ARCH_OMAP_SYSLIB_H_
+#include <asm/io.h>
/** System Independent functions */
-void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value);
+
+/**
+ * @brief clear & set a value in a bit range for a 32 bit address
+ *
+ * @param[in] addr Address to set/read from
+ * @param[in] start_bit Where to put the value
+ * @param[in] num_bits number of bits the value should be set
+ * @param[in] value the value to set
+ *
+ * @return void
+ */
+static inline void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value)
+{
+ u32 tmp, msk = 0;
+ msk = 1 << num_bits;
+ --msk;
+ tmp = readl(addr) & ~(msk << start_bit);
+ tmp |= value << start_bit;
+ writel(tmp, addr);
+}
+
u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound);
void sdelay(unsigned long loops);
diff --git a/arch/arm/mach-omap/syslib.c b/arch/arm/mach-omap/syslib.c
index 2b25dc153c..677de6a27d 100644
--- a/arch/arm/mach-omap/syslib.c
+++ b/arch/arm/mach-omap/syslib.c
@@ -53,26 +53,6 @@ void sdelay(unsigned long loops)
}
/**
- * @brief clear & set a value in a bit range for a 32 bit address
- *
- * @param[in] addr Address to set/read from
- * @param[in] start_bit Where to put the value
- * @param[in] num_bits number of bits the value should be set
- * @param[in] value the value to set
- *
- * @return void
- */
-void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value)
-{
- u32 tmp, msk = 0;
- msk = 1 << num_bits;
- --msk;
- tmp = readl(addr) & ~(msk << start_bit);
- tmp |= value << start_bit;
- writel(tmp, addr);
-}
-
-/**
* @brief common routine to allow waiting for changes in volatile regs.
*
* @param[in] read_bit_mask the bit mask to read