OMAP: hwmod: add read/write API for SYSCONFIG
Subsystems (4)
PATCH 1/2 OMAP: hwmod: add read/write API for SYSCONFIG
Some HW blocks have errata which requires selective enabling/disabling of SYSCONFIG bits. In particular, some blocks have known issues with smart-idle so smart-idle has to be disabled under certain conditions.
Add API to read/write a modules SYSCONFIG register which takes advantage of the built-in caching of omap_hwmod. Any manual reading/writing of SYSCONFIG registers outside of hwmod will cause potential problems in omap_hwmod due to the caching.
--- arch/arm/mach-omap2/omap_hwmod.c | 10 ++++++++++ arch/arm/plat-omap/include/plat/omap_hwmod.h | 3 +++ 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +10 -0
@@ -993,6 +993,16 @@ void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs)__raw_writel (v, oh->_rt_va + reg_offs); } +u32 omap_hwmod_read_sysc (struct omap_hwmod *oh) +{ +return oh->_sysc_cache; +} + +void omap_hwmod_write_sysc (u32 v,struct omap_hwmod *oh) +{ +_write_sysconfig (v, oh); +} +/** * omap_hwmod_register - register a struct omap_hwmod * @oh: struct omap_hwmod *
arch/arm/plat-omap/include/plat/omap_hwmod.h +3 -0
@@ -446,6 +446,9 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);void omap_hwmod_writel (u32 v,struct omap_hwmod *oh,u16 reg_offs);u32 omap_hwmod_readl (struct omap_hwmod *oh,u16 reg_offs); +void omap_hwmod_write_sysc (u32 v,struct omap_hwmod *oh); +u32 omap_hwmod_read_sysc (struct omap_hwmod *oh); +int omap_hwmod_count_resources (struct omap_hwmod *oh);int omap_hwmod_fill_resources (struct omap_hwmod *oh,struct resource *res);
Signature · 1 line
1.6.5.1
PATCH 2/2 OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE
If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is currently way to idle it since omap_hwmod_idle() requires the hwmod to be in the enabled state.
This patch adds a check to omap_hwmod_idle() so if the hwmod was has the INIT_NO_IDLE flag, calling omap_hwmod_idle() will still succeed.
--- arch/arm/mach-omap2/omap_hwmod.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +10 -1
@@ -869,7 +869,13 @@ static int _enable(struct omap_hwmod *oh)*/ static int _idle (struct omap_hwmod *oh) { -if (oh->_state != _HWMOD_STATE_ENABLED) { +/* +* To idle, hwmod must be enabled, EXCEPT if hwmod was +* initialized using the INIT_NO_IDLE flag. In this case it +* will not yet be enabled so we have to allow it to be idled. +*/ +if ((oh->_state != _HWMOD_STATE_ENABLED) && + !(oh->flags &HWMOD_INIT_NO_IDLE )) {WARN (1 ,"omap_hwmod: %s: idle state can only be entered from " "enabled state\n" , oh->name);return -EINVAL ;
@@ -884,6 +890,9 @@ static int _idle(struct omap_hwmod *oh) oh->_state = _HWMOD_STATE_IDLE; +/* Clear init flag which should only affect first call to idle */ + oh->flags &= ~HWMOD_INIT_NO_IDLE ; +return 0 ; }
Signature · 1 line
1.6.5.1