diff options
author | Benoit Cousson <b-cousson@ti.com> | 2010-05-20 14:31:08 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-05-20 14:31:08 -0400 |
commit | 9a23dfe12806920a8dfadec5ea5b83e5ca5378c9 (patch) | |
tree | 491129978e63b080cbc7f6656387f03bd2564d49 /arch/arm/mach-omap2/cm4xxx.c | |
parent | d9e6625c70ff007ae246c9d62f8cdec8d08b2457 (diff) |
OMAP4: hwmod & CM: Implement the omap4_cm_wait_module_ready function
The return of the omap4_cm_wait_module_ready function is checked
in order to avoid accessing the sysconfig register if the module is
not in the correct state.
In that case the _setup will exit without trying to reset
using sysconfig.
For the moment a warning is printed. A proper management of fclk
and module reset will have to be done in order to init correctly
the problematic IPs listed below.
<4>omap_hwmod: ivahd: cannot be enabled (3)
<4>omap_hwmod: iss: cannot be enabled (3)
<4>omap_hwmod: tesla: cannot be enabled (3)
<4>omap_hwmod: sdma: cannot be enabled (3)
<4>omap_hwmod: sl2: cannot be enabled (3)
<4>omap_hwmod: sad2d: cannot be enabled (3)
<4>omap_hwmod: ducati: cannot be enabled (3)
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/cm4xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/cm4xxx.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c index af32a457a46b..b101091e95d6 100644 --- a/arch/arm/mach-omap2/cm4xxx.c +++ b/arch/arm/mach-omap2/cm4xxx.c | |||
@@ -21,19 +21,41 @@ | |||
21 | 21 | ||
22 | #include <asm/atomic.h> | 22 | #include <asm/atomic.h> |
23 | 23 | ||
24 | #include <plat/common.h> | ||
25 | |||
24 | #include "cm.h" | 26 | #include "cm.h" |
25 | #include "cm-regbits-44xx.h" | 27 | #include "cm-regbits-44xx.h" |
26 | 28 | ||
27 | /** | 29 | /** |
28 | * omap4_cm_wait_idlest_ready - wait for a module to leave idle or standby | 30 | * omap4_cm_wait_module_ready - wait for a module to be in 'func' state |
29 | * @prcm_mod: PRCM module offset (XXX example) | 31 | * @clkctrl_reg: CLKCTRL module address |
30 | * @prcm_dev_offs: PRCM device offset (e.g. MCASP XXX example) | 32 | * |
33 | * Wait for the module IDLEST to be functional. If the idle state is in any | ||
34 | * the non functional state (trans, idle or disabled), module and thus the | ||
35 | * sysconfig cannot be accessed and will probably lead to an "imprecise | ||
36 | * external abort" | ||
37 | * | ||
38 | * Module idle state: | ||
39 | * 0x0 func: Module is fully functional, including OCP | ||
40 | * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep | ||
41 | * abortion | ||
42 | * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if | ||
43 | * using separate functional clock | ||
44 | * 0x3 disabled: Module is disabled and cannot be accessed | ||
31 | * | 45 | * |
32 | * XXX document | 46 | * TODO: Need to handle module accessible in idle state |
33 | */ | 47 | */ |
34 | int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs) | 48 | int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg) |
35 | { | 49 | { |
36 | /* FIXME: Add clock manager related code */ | 50 | int i = 0; |
37 | return 0; | 51 | |
52 | if (!clkctrl_reg) | ||
53 | return 0; | ||
54 | |||
55 | omap_test_timeout(((__raw_readl(clkctrl_reg) & | ||
56 | OMAP4430_IDLEST_MASK) == 0), | ||
57 | MAX_MODULE_READY_TIME, i); | ||
58 | |||
59 | return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; | ||
38 | } | 60 | } |
39 | 61 | ||