From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 03/12] ARM omap: make sr32 a static inline function
Date: Mon, 11 Apr 2011 16:39:42 +0200 [thread overview]
Message-ID: <1302532791-20664-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302532791-20664-1-git-send-email-s.hauer@pengutronix.de>
This generates smaller code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-omap/include/mach/syslib.h | 23 ++++++++++++++++++++++-
arch/arm/mach-omap/syslib.c | 20 --------------------
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 c89f50b..6a7044a 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 2b25dc1..677de6a 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
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-04-11 14:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 14:39 OMAP4 support Sascha Hauer
2011-04-11 14:39 ` [PATCH 01/12] ARM omap: Add omap signGP tool and possibility to build ift images Sascha Hauer
2011-04-11 14:39 ` [PATCH 02/12] mci omap: hsmmc is also found on the omap3 Sascha Hauer
2011-04-11 14:39 ` Sascha Hauer [this message]
2011-04-11 14:39 ` [PATCH 04/12] ARM omap: Add omap4 support Sascha Hauer
2011-04-11 14:39 ` [PATCH 05/12] ARM omap: add xload helper functions Sascha Hauer
2011-04-11 14:39 ` [PATCH 06/12] ARM omap4: panda board support Sascha Hauer
2011-04-12 8:18 ` Marc Kleine-Budde
2011-04-11 14:39 ` [PATCH 07/12] add panda defconfigs Sascha Hauer
2011-04-11 14:39 ` [PATCH 08/12] ARM omap4: Add pcm049 board support Sascha Hauer
2011-04-12 8:16 ` Marc Kleine-Budde
2011-04-11 14:39 ` [PATCH 09/12] ARM: add pcm049 defconfigs Sascha Hauer
2011-04-11 14:39 ` [PATCH 10/12] ARM omap beagle: Add noshell support for booting from MMC Sascha Hauer
2011-04-11 14:39 ` [PATCH 11/12] ARM omap beagle: update defconfig Sascha Hauer
2011-04-11 14:39 ` [PATCH 12/12] ARM beagle board: add xload defconfig Sascha Hauer
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=1302532791-20664-4-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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