diff options
Diffstat (limited to 'arch/arm/cpu/armv7/omap3/clock.c')
-rw-r--r-- | arch/arm/cpu/armv7/omap3/clock.c | 13 |
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. |