summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/omap3
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2014-03-25 14:49:49 +0100
committerTom Rini <trini@ti.com>2014-04-17 14:39:54 -0400
commit4e4685027cc8e940d43a4d6e63773bfab9165913 (patch)
tree70ad3fd63d5d7e7d818169e99e9f8405defb562a /arch/arm/cpu/armv7/omap3
parente7300f463d0c5f414d4cb717cad925554564a92e (diff)
downloadu-boot-imx-4e4685027cc8e940d43a4d6e63773bfab9165913.zip
u-boot-imx-4e4685027cc8e940d43a4d6e63773bfab9165913.tar.gz
u-boot-imx-4e4685027cc8e940d43a4d6e63773bfab9165913.tar.bz2
ARM: OMAP: hide custom bit manipulation function sr32()
The only remaining user of the custom bit manipulation function sr32() is arch/arm/cpu/armv7/omap3/clock.c, so make it a static function in that file to prepare complete removal. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Diffstat (limited to 'arch/arm/cpu/armv7/omap3')
-rw-r--r--arch/arm/cpu/armv7/omap3/clock.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap3/clock.c b/arch/arm/cpu/armv7/omap3/clock.c
index 1bc27bd..16e6c5f 100644
--- a/arch/arm/cpu/armv7/omap3/clock.c
+++ b/arch/arm/cpu/armv7/omap3/clock.c
@@ -21,6 +21,19 @@
#include <environment.h>
#include <command.h>
+/*
+ * sr32 - clear & set a value in a bit range for a 32 bit address
+ */
+static inline void sr32(void *addr, u32 start_bit, u32 num_bits, u32 value)
+{
+ u32 tmp, msk = 0;
+ msk = 1 << num_bits;
+ --msk;
+ tmp = readl((u32)addr) & ~(msk << start_bit);
+ tmp |= value << start_bit;
+ writel(tmp, (u32)addr);
+}
+
/******************************************************************************
* get_sys_clk_speed() - determine reference oscillator speed
* based on known 32kHz clock and gptimer.