Paul Walmsley | 2ace831 | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * OMAP4 CM1, CM2 module low-level functions |
| 3 | * |
| 4 | * Copyright (C) 2010 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 | * These functions are intended to be used only by the cminst44xx.c file. |
| 12 | * XXX Perhaps we should just move them there and make them static. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/types.h> |
| 17 | #include <linux/errno.h> |
| 18 | #include <linux/err.h> |
| 19 | #include <linux/io.h> |
| 20 | |
Tony Lindgren | ee0839c | 2012-02-24 10:34:35 -0800 | [diff] [blame] | 21 | #include "iomap.h" |
Tony Lindgren | 4e65331 | 2011-11-10 22:45:17 +0100 | [diff] [blame] | 22 | #include "common.h" |
Paul Walmsley | 2ace831 | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 23 | #include "cm.h" |
| 24 | #include "cm1_44xx.h" |
| 25 | #include "cm2_44xx.h" |
| 26 | #include "cm-regbits-44xx.h" |
| 27 | |
| 28 | /* CM1 hardware module low-level functions */ |
| 29 | |
| 30 | /* Read a register in CM1 */ |
| 31 | u32 omap4_cm1_read_inst_reg(s16 inst, u16 reg) |
| 32 | { |
| 33 | return __raw_readl(OMAP44XX_CM1_REGADDR(inst, reg)); |
| 34 | } |
| 35 | |
| 36 | /* Write into a register in CM1 */ |
| 37 | void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 reg) |
| 38 | { |
| 39 | __raw_writel(val, OMAP44XX_CM1_REGADDR(inst, reg)); |
| 40 | } |
| 41 | |
| 42 | /* Read a register in CM2 */ |
| 43 | u32 omap4_cm2_read_inst_reg(s16 inst, u16 reg) |
| 44 | { |
| 45 | return __raw_readl(OMAP44XX_CM2_REGADDR(inst, reg)); |
| 46 | } |
| 47 | |
| 48 | /* Write into a register in CM2 */ |
| 49 | void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 reg) |
| 50 | { |
| 51 | __raw_writel(val, OMAP44XX_CM2_REGADDR(inst, reg)); |
| 52 | } |