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/omap_hwmod.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/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e436dcb19795..4a134c4d2271 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -819,11 +819,8 @@ static int _wait_target_ready(struct omap_hwmod *oh) | |||
819 | ret = omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs, | 819 | ret = omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs, |
820 | oh->prcm.omap2.idlest_reg_id, | 820 | oh->prcm.omap2.idlest_reg_id, |
821 | oh->prcm.omap2.idlest_idle_bit); | 821 | oh->prcm.omap2.idlest_idle_bit); |
822 | #if 0 | ||
823 | } else if (cpu_is_omap44xx()) { | 822 | } else if (cpu_is_omap44xx()) { |
824 | ret = omap4_cm_wait_module_ready(oh->prcm.omap4.module_offs, | 823 | ret = omap4_cm_wait_module_ready(oh->prcm.omap4.clkctrl_reg); |
825 | oh->prcm.omap4.device_offs); | ||
826 | #endif | ||
827 | } else { | 824 | } else { |
828 | BUG(); | 825 | BUG(); |
829 | }; | 826 | }; |
@@ -912,16 +909,21 @@ static int _enable(struct omap_hwmod *oh) | |||
912 | _add_initiator_dep(oh, mpu_oh); | 909 | _add_initiator_dep(oh, mpu_oh); |
913 | _enable_clocks(oh); | 910 | _enable_clocks(oh); |
914 | 911 | ||
915 | if (oh->class->sysc) { | ||
916 | if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED)) | ||
917 | _update_sysc_cache(oh); | ||
918 | _sysc_enable(oh); | ||
919 | } | ||
920 | |||
921 | r = _wait_target_ready(oh); | 912 | r = _wait_target_ready(oh); |
922 | if (!r) | 913 | if (!r) { |
923 | oh->_state = _HWMOD_STATE_ENABLED; | 914 | oh->_state = _HWMOD_STATE_ENABLED; |
924 | 915 | ||
916 | /* Access the sysconfig only if the target is ready */ | ||
917 | if (oh->class->sysc) { | ||
918 | if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED)) | ||
919 | _update_sysc_cache(oh); | ||
920 | _sysc_enable(oh); | ||
921 | } | ||
922 | } else { | ||
923 | pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", | ||
924 | oh->name, r); | ||
925 | } | ||
926 | |||
925 | return r; | 927 | return r; |
926 | } | 928 | } |
927 | 929 | ||
@@ -999,7 +1001,7 @@ static int _shutdown(struct omap_hwmod *oh) | |||
999 | static int _setup(struct omap_hwmod *oh) | 1001 | static int _setup(struct omap_hwmod *oh) |
1000 | { | 1002 | { |
1001 | struct omap_hwmod_ocp_if *os; | 1003 | struct omap_hwmod_ocp_if *os; |
1002 | int i; | 1004 | int i, r; |
1003 | 1005 | ||
1004 | if (!oh) | 1006 | if (!oh) |
1005 | return -EINVAL; | 1007 | return -EINVAL; |
@@ -1023,7 +1025,12 @@ static int _setup(struct omap_hwmod *oh) | |||
1023 | 1025 | ||
1024 | oh->_state = _HWMOD_STATE_INITIALIZED; | 1026 | oh->_state = _HWMOD_STATE_INITIALIZED; |
1025 | 1027 | ||
1026 | _enable(oh); | 1028 | r = _enable(oh); |
1029 | if (r) { | ||
1030 | pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n", | ||
1031 | oh->name, oh->_state); | ||
1032 | return 0; | ||
1033 | } | ||
1027 | 1034 | ||
1028 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) { | 1035 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) { |
1029 | /* | 1036 | /* |