OMAP2+: hwmod: Follow the recommended PRCM module enable sequence
authorRajendra Nayak <rnayak@ti.com>
Sun, 10 Jul 2011 11:57:07 +0000 (05:57 -0600)
committerPaul Walmsley <paul@pwsan.com>
Sun, 10 Jul 2011 11:57:07 +0000 (05:57 -0600)
commit665d001338b494d6d62810aa99b4c0fa1a0884b9
treecd86d6a86edce56931c261b79d1d5706b2f0c667
parent12706c542574ea0127a13815efe59ca9ba6d88d7
OMAP2+: hwmod: Follow the recommended PRCM module enable sequence

On OMAP4, the PRCM recommended sequence for enabling
a module after power-on-reset is:
-1- Force clkdm to SW_WKUP
-2- Enabling the clocks
-3- Configure desired module mode to "enable" or "auto"
-4- Wait for the desired module idle status to be FUNC
-5- Program clkdm in HW_AUTO(if supported)

This sequence applies to all older OMAPs' as well,
however since they use autodeps, it makes sure that
no clkdm is in IDLE, and hence not requiring a force
SW_WKUP when a module is being enabled.

OMAP4 does not need to support autodeps, because
of the dyanamic dependency feature, wherein
the HW takes care of waking up a clockdomain from
idle and hence the module, whenever an interconnect
access happens to the given module.

Implementing the sequence for OMAP4 requires
the clockdomain handling that is currently done in
clock framework to be done as part of hwmod framework
since the step -4- above to "Wait for the desired
module idle status to be FUNC" is done as part of
hwmod framework.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[b-cousson@ti.com: Adapt it to the new clkdm hwmod attribute and API]
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
[paul@pwsan.com: dropped mach-omap2/clock.c changes; modified to only
 call the clockdomain code if oh->clkdm is set; disable clock->clockdomain
 interaction on OMAP4]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/clock44xx_data.c
arch/arm/mach-omap2/omap_hwmod.c