blob: 928dbd4f20ed7d7809eb21bd0abb061d944259d5 [file] [log] [blame]
Paul Walmsley2ace8312010-12-21 21:05:14 -07001/*
2 * OMAP4 PRCM_MPU module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
Tony Lindgrenee0839c2012-02-24 10:34:35 -080018#include "iomap.h"
Tony Lindgren4e653312011-11-10 22:45:17 +010019#include "common.h"
Paul Walmsley2ace8312010-12-21 21:05:14 -070020#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h"
22
23/* PRCM_MPU low-level functions */
24
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
26{
27 return __raw_readl(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
28}
29
30void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
31{
32 __raw_writel(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
33}
34
35u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
36{
37 u32 v;
38
39 v = omap4_prcm_mpu_read_inst_reg(inst, reg);
40 v &= ~mask;
41 v |= bits;
42 omap4_prcm_mpu_write_inst_reg(v, inst, reg);
43
44 return v;
45}