OMAP: omap_device: API to modify SYSCONFIG register
Subsystems (4)
v3 cover OMAP: omap_device: API to modify SYSCONFIG register
Certain peripherals require autoidle bits to be disabled before performing some operations. This patch series provides APIs in omap_device layer and omap_hwmod layer to modify the SYSCONFIG register.
Since current implementation of PM run time framework does not support changing sysconfig settings during middle of the on going operation, these APIs will support the same.
For e.g McBSP 2 and 3 in OMAP3 has sidetone feature which requires autoidle to be disabled before starting the sidetone.
McBSP also requires the SYSCONFIG to be in NOIDLE when ELEMENTSYNCH mode is selected for DMA operation.
Created on top of linux OMAP master (linux-omap-2.6 :master)
commit-id: d9be6df1331f8078618745298d38ed619729ec91 Tested on OMAP4430 and OMAP3430 SDP boards. Verified that this patch series does not break the OMAP1 build.
V3:
created one-one mapping between omap_device APIs and omap_hwmod APIs to modify the sysconfig register.
V2:
Mutex is replaced with spinlock.
V1:
* Creates 3 separate API's to change the idle mode to NOIDLE, SMARTIDLE and FORCEIDLE and one more API to change the idlemode to default value based on the hwmod flag. This change is done to align with the discussion on [3]
* Added hwmod mutex in omap hwmod APIs that modifies SYSCONFIG register.
* omap_hwmod_set_slave_idlemode() is not modified to take true/false kind-of argument since 3 states are associated with SIDLE bits (force, no and smart).
These changes were made to align with Benoit's and Paul's comments for a similar patch written by Manjunath [1] for changing MSTANDBY bits.
The discussions that happened for the RFC patch can be found at [2]
[1]: http://www.mail-archive.com/linux-omap <at> vger.kernel.org/msg39647.html [2]: https://patchwork.kernel.org/patch/134371/
[3]: http://www.mail-archive.com/linux-omap <at> vger.kernel.org/msg39615.html
Kishon Vijay Abraham I (2):
OMAP: omap_hwmod: API to modify AUTOIDLE and SMARTIDLE bits
OMAP: omap_device: API to modify AUTOIDLE and SMARTIDLE bits
arch/arm/mach-omap2/omap_hwmod.c | 93 ++++++++++++++ arch/arm/plat-omap/include/plat/omap_device.h | 6 + arch/arm/plat-omap/include/plat/omap_hwmod.h | 11 ++ arch/arm/plat-omap/omap_device.c | 165 +++++++++++++++++++++++++ 4 files changed, 275 insertions(+), 0 deletions(-)
PATCH v3 1/2 OMAP: omap_hwmod: API to modify AUTOIDLE and SMARTIDLE bits
Provide APIs to be used by the omap_device layer in order to modify AUTOIDLE and SIDLE bits.
--- arch/arm/mach-omap2/omap_hwmod.c | 93 ++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/omap_hwmod.h | 11 +++ 2 files changed, 104 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +93 -0
@@ -1340,6 +1340,34 @@ int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle) }/** +* omap_hwmod_enable_autoidle - set the hwmod's OCP autoidle bit +* @oh: struct omap_hwmod * +* +* Sets the IP block's OCP autoidle bit in hardware. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. +* Returns the return value from omap_hwmod_set_ocp_autoidle. +*/ +int omap_hwmod_enable_autoidle (struct omap_hwmod *oh) +{ +return omap_hwmod_set_ocp_autoidle (oh,HWMOD_IDLEMODE_ENABLEAUTO ); +} + +/** +* omap_hwmod_disable_autoidle - reset the hwmod's OCP autoidle bit +* @oh: struct omap_hwmod * +* +* Resets the IP block's OCP autoidle bit in hardware. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. +* Returns the return value from omap_hwmod_set_ocp_autoidle. +*/ +int omap_hwmod_disable_autoidle (struct omap_hwmod *oh) +{ +return omap_hwmod_set_ocp_autoidle (oh,HWMOD_IDLEMODE_DISABLEAUTO ); +} + +/** * _shutdown - shutdown an omap_hwmod * @oh: struct omap_hwmod * *
@@ -1594,6 +1622,71 @@ int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode) }/** +* omap_hwmod_noidle - set the hwmod's slave idlemode to no idle +* @oh: struct omap_hwmod * +* +* Sets the IP block's OCP slave idlemode in hardware to no idle. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. +* Returns the return value from omap_hwmod_set_slave_idlemode(). +*/ +int omap_hwmod_noidle (struct omap_hwmod *oh) +{ +return omap_hwmod_set_slave_idlemode (oh,HWMOD_IDLEMODE_NO ); +} + +/** +* omap_hwmod_smartidle - set the hwmod's slave idlemode to smart idle +* @oh: struct omap_hwmod * +* +* Sets the IP block's OCP slave idlemode in hardware to smart idle. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. +* Returns the return value from omap_hwmod_set_slave_idlemode(). +*/ +int omap_hwmod_smartidle (struct omap_hwmod *oh) +{ +return omap_hwmod_set_slave_idlemode (oh,HWMOD_IDLEMODE_SMART ); +} + +/** +* omap_hwmod_forceidle - set the hwmod's slave idlemode to force idle +* @oh: struct omap_hwmod * +* +* Sets the IP block's OCP slave idlemode in hardware to force idle. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. +* Returns the return value from omap_hwmod_set_slave_idlemode(). +*/ +int omap_hwmod_forceidle (struct omap_hwmod *oh) +{ +return omap_hwmod_set_slave_idlemode (oh,HWMOD_IDLEMODE_FORCE ); +} + +/** +* omap_hwmod_default_idle - set the hwmod's slave idlemode to no idle or +* smart idle based on the hwmod flag +* @oh: struct omap_hwmod * +* +* Sets the IP block's OCP slave idlemode in hardware to no idle or smart idle +* based on the hwmod flag. +* Intended to be used by drivers that have some erratum that requires direct +* manipulation of the SIDLEMODE bits. Returns -EINVAL if @oh is NULL, +* or passes along the return value from omap_hwmod_set_slave_idlemode(). +*/ +int omap_hwmod_default_idle (struct omap_hwmod *oh) +{ +u8 idlemode; + +if (!oh) +return -EINVAL ; + + idlemode = (oh->flags &HWMOD_SWSUP_SIDLE ) ? +HWMOD_IDLEMODE_NO :HWMOD_IDLEMODE_SMART ; +return omap_hwmod_set_slave_idlemode (oh, idlemode); +} + +/** * omap_hwmod_lookup - look up a registered omap_hwmod by name * @name: name of the omap_hwmod to look up *
arch/arm/plat-omap/include/plat/omap_hwmod.h +11 -0
@@ -80,6 +80,9 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;/* Slave idle mode flag only */ #define HWMOD_IDLEMODE_SMART_WKUP (1 << 3) +#define HWMOD_IDLEMODE_ENABLEAUTO (1 << 0) +#define HWMOD_IDLEMODE_DISABLEAUTO 0x0 +/** * struct omap_hwmod_mux_info - hwmod specific mux configuration * @pads: array of omap_device_pad entries
@@ -567,6 +570,14 @@ int omap_hwmod_disable_clocks(struct omap_hwmod *oh);int omap_hwmod_set_slave_idlemode (struct omap_hwmod *oh,u8 idlemode);int omap_hwmod_set_ocp_autoidle (struct omap_hwmod *oh,u8 autoidle); +int omap_hwmod_noidle (struct omap_hwmod *oh); +int omap_hwmod_smartidle (struct omap_hwmod *oh); +int omap_hwmod_forceidle (struct omap_hwmod *oh); +int omap_hwmod_default_idle (struct omap_hwmod *oh); + +int omap_hwmod_enable_autoidle (struct omap_hwmod *oh); +int omap_hwmod_disable_autoidle (struct omap_hwmod *oh); +int omap_hwmod_reset (struct omap_hwmod *oh);void omap_hwmod_ocp_barrier (struct omap_hwmod *oh);
Signature · 1 line
1.7.0.4
PATCH v3 2/2 OMAP: omap_device: API to modify AUTOIDLE and SMARTIDLE bits
In reply to Kishon Vijay Abraham IProvide APIs to be used by the driver in order to modify AUTOIDLE and SIDLE bits. These APIs in turn call hwmod APIs to modify the SYSCONFIG register.
--- arch/arm/plat-omap/include/plat/omap_device.h | 6 + arch/arm/plat-omap/omap_device.c | 165 +++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/plat/omap_device.h +6 -0
@@ -110,6 +110,12 @@ struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);u32 omap_device_get_context_loss_count (struct platform_device *pdev);/* Other */ +int omap_device_noidle (struct omap_device *od); +int omap_device_smartidle (struct omap_device *od); +int omap_device_forceidle (struct omap_device *od); +int omap_device_default_idle (struct omap_device *od); +int omap_device_enable_autoidle (struct omap_device *od); +int omap_device_disable_autoidle (struct omap_device *od);int omap_device_idle_hwmods (struct omap_device *od);int omap_device_enable_hwmods (struct omap_device *od);
arch/arm/plat-omap/omap_device.c +165 -0
171 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Paul, Benoit,
Do you have any comments for this series?
Regards
Kishon
Quoted 50 lines · Kishon Vijay Abraham I
Certain peripherals require autoidle bits to be disabled before performing some operations. This patch series provides APIs in
omap_devicelayer andomap_hwmodlayer to modify the SYSCONFIG register.Since current implementation of PM run time framework does not support changing sysconfig settings during middle of the on going operation, these APIs will support the same.
For e.g McBSP 2 and 3 in OMAP3 has sidetone feature which requires autoidle to be disabled before starting the sidetone.
McBSP also requires the SYSCONFIG to be in NOIDLE when ELEMENTSYNCH mode is selected for DMA operation.
Created on top of linux OMAP master (linux-omap-2.6 :master)
commit-id:d9be6df1331f8078618745298d38ed619729ec91Tested on OMAP4430 and OMAP3430 SDP boards. Verified that this patch series does not break the OMAP1 build.V3:
created one-one mapping betweenomap_deviceAPIs andomap_hwmodAPIs to modify the sysconfig register.V2:
Mutex is replaced with spinlock.V1:
* Creates 3 separate API's to change the idle mode to NOIDLE, SMARTIDLE and FORCEIDLE and one more API to change the idlemode to default value based on the hwmod flag. This change is done to align with the discussion on [3]* Added hwmod mutex in omap hwmod APIs that modifies SYSCONFIG register.
*
omap_hwmod_set_slave_idlemode()is not modified to take true/false kind-of argument since 3 states are associated with SIDLE bits (force, no and smart).These changes were made to align with Benoit's and Paul's comments for a similar patch written by Manjunath [1] for changing MSTANDBY bits.
The discussions that happened for the RFC patch can be found at [2]
[1]: http://www.mail-archive.com/linux-omap <at> vger.kernel.org/msg39647.html [2]: https://patchwork.kernel.org/patch/134371/
[3]: http://www.mail-archive.com/linux-omap <at> vger.kernel.org/msg39615.htmlKishon Vijay Abraham I (2):
OMAP:omap_hwmod: API to modify AUTOIDLE and SMARTIDLE bits
OMAP:omap_device: API to modify AUTOIDLE and SMARTIDLE bits
Quoted 7 lines
arch/arm/mach-omap2/omap_hwmod.c | 93 ++++++++++++++
arch/arm/plat-omap/include/plat/omap_device.h| 6 +arch/arm/plat-omap/include/plat/omap_hwmod.h| 11 ++arch/arm/plat-omap/omap_device.c| 165 +++++++++++++++++++++++++4 files changed, 275 insertions(+), 0 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html