diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index ec0362574b5e..051213fbc346 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -118,7 +118,8 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | |||
118 | /** | 118 | /** |
119 | * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait | 119 | * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait |
120 | * @prm_mod: PRM submodule base (e.g. CORE_MOD) | 120 | * @prm_mod: PRM submodule base (e.g. CORE_MOD) |
121 | * @shift: register bit shift corresponding to the reset line to deassert | 121 | * @rst_shift: register bit shift corresponding to the reset line to deassert |
122 | * @st_shift: register bit shift for the status of the deasserted submodule | ||
122 | * | 123 | * |
123 | * Some IPs like dsp or iva contain processors that require an HW | 124 | * Some IPs like dsp or iva contain processors that require an HW |
124 | * reset line to be asserted / deasserted in order to fully enable the | 125 | * reset line to be asserted / deasserted in order to fully enable the |
@@ -129,27 +130,28 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | |||
129 | * -EINVAL upon an argument error, -EEXIST if the submodule was already out | 130 | * -EINVAL upon an argument error, -EEXIST if the submodule was already out |
130 | * of reset, or -EBUSY if the submodule did not exit reset promptly. | 131 | * of reset, or -EBUSY if the submodule did not exit reset promptly. |
131 | */ | 132 | */ |
132 | int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) | 133 | int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift) |
133 | { | 134 | { |
134 | u32 mask; | 135 | u32 rst, st; |
135 | int c; | 136 | int c; |
136 | 137 | ||
137 | if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) | 138 | if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) |
138 | return -EINVAL; | 139 | return -EINVAL; |
139 | 140 | ||
140 | mask = 1 << shift; | 141 | rst = 1 << rst_shift; |
142 | st = 1 << st_shift; | ||
141 | 143 | ||
142 | /* Check the current status to avoid de-asserting the line twice */ | 144 | /* Check the current status to avoid de-asserting the line twice */ |
143 | if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) | 145 | if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, rst) == 0) |
144 | return -EEXIST; | 146 | return -EEXIST; |
145 | 147 | ||
146 | /* Clear the reset status by writing 1 to the status bit */ | 148 | /* Clear the reset status by writing 1 to the status bit */ |
147 | omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); | 149 | omap2_prm_rmw_mod_reg_bits(0xffffffff, st, prm_mod, OMAP2_RM_RSTST); |
148 | /* de-assert the reset control line */ | 150 | /* de-assert the reset control line */ |
149 | omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); | 151 | omap2_prm_rmw_mod_reg_bits(rst, 0, prm_mod, OMAP2_RM_RSTCTRL); |
150 | /* wait the status to be set */ | 152 | /* wait the status to be set */ |
151 | omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, | 153 | omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, |
152 | mask), | 154 | st), |
153 | MAX_MODULE_HARDRESET_WAIT, c); | 155 | MAX_MODULE_HARDRESET_WAIT, c); |
154 | 156 | ||
155 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; | 157 | return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; |