Skip to contentSkip to conversation

OMAP3: hwmod: support to specify the offset position of various SYSCONFIG register bits.

PATCH Superseded Thara Gopinath 2 participants 2 messages Jan 12, 2010 – Jan 13, 2010

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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 legacy or HL.

31:30 SCHEME Used to distinguish between old scheme and current.
Read 0x0: Legacy ASP or WTBU scheme
Read 0x1: Highlander 0.8 scheme

For legacy IP
13:12 MIDLEMODE

 11:8  CLOCKACTIVITY
 6     EMUSOFT
 5     EMUFREE
 4:3   SIDLEMODE
 2     ENAWAKEUP
 1     SOFTRESET
 0     AUTOIDLE

For Highlander IP, 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_fields and omap_hwmod_sysc_highlander are defined which can be used directly to populate the sysc_fields if the IP follows legacy or highlander 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.

---

This patch is based off Kevin's PM tree origin/pm-wip/omap_device branch.

 arch/arm/mach-omap2/Makefile                 |    3 +-
 arch/arm/mach-omap2/omap_hwmod.c             |  100 ++++++++++++++++++++++----
 arch/arm/mach-omap2/omap_hwmod_common_data.c |   51 +++++++++++++
 arch/arm/plat-omap/include/plat/omap_hwmod.h |   65 +++++++++++++----
 4 files changed, 191 insertions(+), 28 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_common_data.c
arch/arm/mach-omap2/Makefile +2 -1
index a08aa62..cbeb8bd 100644
@@ -5,7 +5,8 @@
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o
 
-omap-2-3-common				= irq.o sdrc.o omap_hwmod.o
+omap-2-3-common				= irq.o sdrc.o omap_hwmod.o \
+					  omap_hwmod_common_data.o
 omap-3-4-common				= dpll.o
 prcm-common				= prcm.o powerdomain.o
 clock-common				= clock.o clock_common_data.o clockdomain.o
arch/arm/mach-omap2/omap_hwmod.c +87 -13

174 lines not on this page · raw message

arch/arm/mach-omap2/omap_hwmod_common_data.c new file +51 -0

51 lines not on this page · raw message

arch/arm/plat-omap/include/plat/omap_hwmod.h +51 -14

95 lines not on this page · raw message

Signature · 1 line
1.5.6.3
maintainer
#1 lore raw

Hello Thara,

two more minor changes to make:

arch/arm/mach-omap2/omap_hwmod_common_data.c line 6

Quoted 9 lines · Thara Gopinath
arch/arm/mach-omap2/omap_hwmod_common_data.c new file +6 -0
@@ -0,0 +1,51 @@
+/*
+ * omap_hwmod common data structures
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ * Paul Walmsley
+ *

Please remove the above copyright, etc., since you created it, your code.

Quoted 35 lines
arch/arm/mach-omap2/omap_hwmod_common_data.c new file +35 -0
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Thara Gopinath <[email protected]>
+ *
+ * Created in collaboration with (alphabetical order): Benoit Cousson,
+ * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
+ * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This data/structures are to be used while defining OMAP on-chip module
+ * data and their integration with other OMAP modules and Linux.
+ */
+
+#include <linux/list.h>
+
+#include <plat/omap_hwmod.h>
+
+/**
+ * struct omap_hwmod_sysc_legacy - OMAP3 legacy scheme for old IPs
+ *
+ * To be used by hwmod structure to specify the sysconfig offsets
+ * if the device ip follows the Legacy scheme.
+ */
+struct omap_hwmod_sysc_fields omap_hwmod_sysc_legacy = {
+	.midle_shift        = SYSC_LGCY_MIDLEMODE_SHIFT,
+	.clkact_shift       = SYSC_LGCY_CLOCKACTIVITY_SHIFT,
+	.sidle_shift        = SYSC_LGCY_SIDLEMODE_SHIFT,
+	.enwkup_shift       = SYSC_LGCY_ENAWAKEUP_SHIFT,
+	.srst_shift         = SYSC_LGCY_SOFTRESET_SHIFT,
+	.autoidle_shift     = SYSC_LGCY_AUTOIDLE_SHIFT,
+};
+
+/**

arch/arm/mach-omap2/omap_hwmod_common_data.c line 51

Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_common_data.c new file +10 -0
+ * struct omap_hwmod_sysc_fields - OMAP4 new scheme for Highlander compliant IPs
+ *
+ * To be used by hwmod structure to specify the sysconfig offsets if the
+ * device ip follows the highlander scheme
+ */
+struct omap_hwmod_sysc_fields omap_hwmod_sysc_highlander = {
+	.midle_shift        = SYSC_HIGH_MIDLEMODE_SHIFT,
+	.sidle_shift        = SYSC_HIGH_SIDLEMODE_SHIFT,
+	.srst_shift         = SYSC_HIGH_SOFTRESET_SHIFT,
+};

All of these assignment lines have whitespace problems. The whitespace between the field names and the equal signs should be implemented with tabs, not spaces.

Once these two issues are fixed, I'll queue the patch.

- Paul