diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-12-14 14:42:35 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-12-21 21:55:12 -0500 |
commit | bd36179eec2827cd60b4a8c6e180cc030c74a4ec (patch) | |
tree | 2de71af03907f561fc2a845e7579446b33099de5 /arch/arm/plat-omap | |
parent | 2092e5ccf89db09ebde94e9aabd3c86d5fa05c6c (diff) |
OMAP2+: hwmod: add support for per-class custom device reset functions
The standard omap_hwmod.c _reset() code relies on an IP block's
OCP_SYSCONFIG.SOFTRESET register bit to reset the IP block. This
works for most IP blocks on the chip, but unfortunately not all. For
example, initiator-only IP blocks often don't have any MPU-accessible
OCP-header registers, and therefore the MPU can't write to any
OCP_SYSCONFIG registers in that block. Other IP blocks, such as the
IVA and I2C, require a specialized reset sequence.
Since we need to be able to reset these IP blocks as well, allow
custom IP block reset functions to be passed into the hwmod code via a
per-hwmod-class reset function pointer, struct omap_hwmod_class.reset.
If .reset is non-null, then the hwmod _reset() code will call the custom
function instead of the standard OCP SOFTRESET-based code.
As part of this change, rename most of the existing _reset() function
code to _ocp_softreset(), to indicate more clearly that it does not work
for all cases.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Paul Hunt <hunt@ti.com>
Cc: Stanley Liu <stanley_liu@ti.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index b445ecdb95b8..e4c4fd4cc1ed 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -364,7 +364,7 @@ struct omap_hwmod_omap4_prcm { | |||
364 | * when module is enabled, rather than the default, which is to | 364 | * when module is enabled, rather than the default, which is to |
365 | * enable autoidle | 365 | * enable autoidle |
366 | * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup | 366 | * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup |
367 | * HWMOD_NO_IDLEST : this module does not have idle status - this is the case | 367 | * HWMOD_NO_IDLEST: this module does not have idle status - this is the case |
368 | * only for few initiator modules on OMAP2 & 3. | 368 | * only for few initiator modules on OMAP2 & 3. |
369 | * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset. | 369 | * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset. |
370 | * This is needed for devices like DSS that require optional clocks enabled | 370 | * This is needed for devices like DSS that require optional clocks enabled |
@@ -416,6 +416,7 @@ struct omap_hwmod_omap4_prcm { | |||
416 | * @sysc: device SYSCONFIG/SYSSTATUS register data | 416 | * @sysc: device SYSCONFIG/SYSSTATUS register data |
417 | * @rev: revision of the IP class | 417 | * @rev: revision of the IP class |
418 | * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown | 418 | * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown |
419 | * @reset: ptr to fn to be executed in place of the standard hwmod reset fn | ||
419 | * | 420 | * |
420 | * Represent the class of a OMAP hardware "modules" (e.g. timer, | 421 | * Represent the class of a OMAP hardware "modules" (e.g. timer, |
421 | * smartreflex, gpio, uart...) | 422 | * smartreflex, gpio, uart...) |
@@ -427,12 +428,18 @@ struct omap_hwmod_omap4_prcm { | |||
427 | * or some negative error upon failure. Returning an error will cause | 428 | * or some negative error upon failure. Returning an error will cause |
428 | * omap_hwmod_shutdown() to abort the device shutdown and return an | 429 | * omap_hwmod_shutdown() to abort the device shutdown and return an |
429 | * error. | 430 | * error. |
431 | * | ||
432 | * If @reset is defined, then the function it points to will be | ||
433 | * executed in place of the standard hwmod _reset() code in | ||
434 | * mach-omap2/omap_hwmod.c. This is needed for IP blocks which have | ||
435 | * unusual reset sequences - usually processor IP blocks like the IVA. | ||
430 | */ | 436 | */ |
431 | struct omap_hwmod_class { | 437 | struct omap_hwmod_class { |
432 | const char *name; | 438 | const char *name; |
433 | struct omap_hwmod_class_sysconfig *sysc; | 439 | struct omap_hwmod_class_sysconfig *sysc; |
434 | u32 rev; | 440 | u32 rev; |
435 | int (*pre_shutdown)(struct omap_hwmod *oh); | 441 | int (*pre_shutdown)(struct omap_hwmod *oh); |
442 | int (*reset)(struct omap_hwmod *oh); | ||
436 | }; | 443 | }; |
437 | 444 | ||
438 | /** | 445 | /** |