aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include
diff options
context:
space:
mode:
authorThara Gopinath <thara@ti.com>2010-02-24 14:05:58 -0500
committerPaul Walmsley <paul@pwsan.com>2010-02-24 14:05:58 -0500
commit358f0e630d5409ab3837b86db3595560eae773b6 (patch)
tree0b4d6d8c555bee693f50819e7d717a43548643a5 /arch/arm/plat-omap/include
parent5eb75f557843132da08938609def2774ee467d95 (diff)
OMAP3: hwmod: support to specify the offset position of various SYSCONFIG register bits.
In OMAP3 Some modules like Smartreflex do not have the regular sysconfig register.Instead clockactivity bits are part of another register at a different bit position than the usual bit positions 8 and 9. In OMAP4, a new scheme is available due to the new protocol between the PRCM and the IPs. Depending of the scheme, the SYSCONFIG bitfields position will be different. The IP_REVISION register should be at offset 0x00. It should contain a SCHEME field. From this we can determine whether the IP follows legacy scheme or the new scheme. 31:30 SCHEME Used to distinguish between old scheme and current. Read 0x0: Legacy protocol. Read 0x1: New PRCM protocol defined for new OMAP4 IPs For legacy IP 13:12 MIDLEMODE 11:8 CLOCKACTIVITY 6 EMUSOFT 5 EMUFREE 4:3 SIDLEMODE 2 ENAWAKEUP 1 SOFTRESET 0 AUTOIDLE For new OMAP4 IP's, the bit position in SYSCONFIG is (for simple target): 5:4 STANDBYMODE (Ex MIDLEMODE) 3:2 IDLEMODE (Ex SIDLEMODE) 1 FREEEMU (Ex EMUFREE) 0 SOFTRESET Unfortunately In OMAP4 also some IPs will not follow any of these two schemes. This is the case at least for McASP, SmartReflex and some security IPs. This patch introduces a new field sysc_fields in omap_hwmod_sysconfig which can be used by the hwmod structures to specify the offsets for the sysconfig register of the IP.Also two static structures omap_hwmod_sysc_type1 and omap_hwmod_sysc_type2 are defined which can be used directly to populate the sysc_fields if the IP follows legacy or new OMAP4 scheme. If the IP follows none of these two schemes a new omap_hwmod_sysc_fields structure has to be defined and passed as part of omap_hwmod_sysconfig. Signed-off-by: Thara Gopinath <thara@ti.com> Signed-off-by: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h73
1 files changed, 58 insertions, 15 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 921990e2a29a..665420e89c21 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -33,25 +33,42 @@
33#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H 33#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
34 34
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/list.h>
36#include <linux/ioport.h> 37#include <linux/ioport.h>
37
38#include <plat/cpu.h> 38#include <plat/cpu.h>
39 39
40struct omap_device; 40struct omap_device;
41 41
42/* OCP SYSCONFIG bit shifts/masks */ 42extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
43#define SYSC_MIDLEMODE_SHIFT 12 43extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
44#define SYSC_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) 44
45#define SYSC_CLOCKACTIVITY_SHIFT 8 45/*
46#define SYSC_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) 46 * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
47#define SYSC_SIDLEMODE_SHIFT 3 47 * with the original PRCM protocol defined for OMAP2420
48#define SYSC_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) 48 */
49#define SYSC_ENAWAKEUP_SHIFT 2 49#define SYSC_TYPE1_MIDLEMODE_SHIFT 12
50#define SYSC_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) 50#define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT)
51#define SYSC_SOFTRESET_SHIFT 1 51#define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
52#define SYSC_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) 52#define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT)
53#define SYSC_AUTOIDLE_SHIFT 0 53#define SYSC_TYPE1_SIDLEMODE_SHIFT 3
54#define SYSC_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) 54#define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT)
55#define SYSC_TYPE1_ENAWAKEUP_SHIFT 2
56#define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT)
57#define SYSC_TYPE1_SOFTRESET_SHIFT 1
58#define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT)
59#define SYSC_TYPE1_AUTOIDLE_SHIFT 0
60#define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT)
61
62/*
63 * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
64 * with the new PRCM protocol defined for new OMAP4 IPs.
65 */
66#define SYSC_TYPE2_SOFTRESET_SHIFT 0
67#define SYSC_TYPE2_SOFTRESET_MASK (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
68#define SYSC_TYPE2_SIDLEMODE_SHIFT 2
69#define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
70#define SYSC_TYPE2_MIDLEMODE_SHIFT 4
71#define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
55 72
56/* OCP SYSSTATUS bit shifts/masks */ 73/* OCP SYSSTATUS bit shifts/masks */
57#define SYSS_RESETDONE_SHIFT 0 74#define SYSS_RESETDONE_SHIFT 0
@@ -62,7 +79,6 @@ struct omap_device;
62#define HWMOD_IDLEMODE_NO (1 << 1) 79#define HWMOD_IDLEMODE_NO (1 << 1)
63#define HWMOD_IDLEMODE_SMART (1 << 2) 80#define HWMOD_IDLEMODE_SMART (1 << 2)
64 81
65
66/** 82/**
67 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod 83 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
68 * @name: name of the IRQ channel (module local name) 84 * @name: name of the IRQ channel (module local name)
@@ -236,6 +252,24 @@ struct omap_hwmod_ocp_if {
236#define CLOCKACT_TEST_NONE 0x3 252#define CLOCKACT_TEST_NONE 0x3
237 253
238/** 254/**
255 * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
256 * @midle_shift: Offset of the midle bit
257 * @clkact_shift: Offset of the clockactivity bit
258 * @sidle_shift: Offset of the sidle bit
259 * @enwkup_shift: Offset of the enawakeup bit
260 * @srst_shift: Offset of the softreset bit
261 * @autoidle_shift: Offset of the autoidle bit.
262 */
263struct omap_hwmod_sysc_fields {
264 u8 midle_shift;
265 u8 clkact_shift;
266 u8 sidle_shift;
267 u8 enwkup_shift;
268 u8 srst_shift;
269 u8 autoidle_shift;
270};
271
272/**
239 * struct omap_hwmod_sysconfig - hwmod OCP_SYSCONFIG/OCP_SYSSTATUS data 273 * struct omap_hwmod_sysconfig - hwmod OCP_SYSCONFIG/OCP_SYSSTATUS data
240 * @rev_offs: IP block revision register offset (from module base addr) 274 * @rev_offs: IP block revision register offset (from module base addr)
241 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr) 275 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
@@ -252,6 +286,14 @@ struct omap_hwmod_ocp_if {
252 * been associated with the clocks marked in @clockact. This field is 286 * been associated with the clocks marked in @clockact. This field is
253 * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below) 287 * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
254 * 288 *
289 *
290 * @sysc_fields: structure containing the offset positions of various bits in
291 * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
292 * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
293 * whether the device ip is compliant with the original PRCM protocol
294 * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
295 * If the device follows a differnt scheme for the sysconfig register ,
296 * then this field has to be populated with the correct offset structure.
255 */ 297 */
256struct omap_hwmod_sysconfig { 298struct omap_hwmod_sysconfig {
257 u16 rev_offs; 299 u16 rev_offs;
@@ -260,6 +302,7 @@ struct omap_hwmod_sysconfig {
260 u8 idlemodes; 302 u8 idlemodes;
261 u8 sysc_flags; 303 u8 sysc_flags;
262 u8 clockact; 304 u8 clockact;
305 struct omap_hwmod_sysc_fields *sysc_fields;
263}; 306};
264 307
265/** 308/**