Lines Matching +full:dsp +full:- +full:ctrl
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
16 #include "prm-regbits-33xx.h"
34 /* Read-modify-write a register in PRM. Caller must lock */
48 * am33xx_prm_is_hardreset_asserted - read the HW reset line state of
57 * -EINVAL upon parameter error.
72 * am33xx_prm_assert_hardreset - assert the HW reset line of a submodule
78 * Some IPs like dsp, ipu or iva contain processors that require an HW
80 * IP. These modules may have multiple hard-reset lines that reset
82 * place the submodule into reset. Returns 0 upon success or -EINVAL
96 * am33xx_prm_deassert_hardreset - deassert a submodule hardreset line and
105 * Some IPs like dsp, ipu or iva contain processors that require an HW
107 * IP. These modules may have multiple hard-reset lines that reset
111 * -EINVAL upon an argument error, -EEXIST if the submodule was already out
112 * of reset, or -EBUSY if the submodule did not exit reset promptly.
121 /* Check the current status to avoid de-asserting the line twice */ in am33xx_prm_deassert_hardreset()
123 return -EEXIST; in am33xx_prm_deassert_hardreset()
128 /* de-assert the reset control line */ in am33xx_prm_deassert_hardreset()
138 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; in am33xx_prm_deassert_hardreset()
145 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_set_next_pwrst()
153 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_read_next_pwrst()
164 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs); in am33xx_pwrdm_read_pwrst()
175 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_set_lowpwrstchange()
183 pwrdm->prcm_offs, pwrdm->pwrstst_offs); in am33xx_pwrdm_clear_all_prev_pwrst()
191 m = pwrdm->logicretstate_mask; in am33xx_pwrdm_set_logic_retst()
193 return -EINVAL; in am33xx_pwrdm_set_logic_retst()
196 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_set_logic_retst()
205 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs); in am33xx_pwrdm_read_logic_pwrst()
216 m = pwrdm->logicretstate_mask; in am33xx_pwrdm_read_logic_retst()
218 return -EINVAL; in am33xx_pwrdm_read_logic_retst()
220 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_read_logic_retst()
232 m = pwrdm->mem_on_mask[bank]; in am33xx_pwrdm_set_mem_onst()
234 return -EINVAL; in am33xx_pwrdm_set_mem_onst()
237 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_set_mem_onst()
247 m = pwrdm->mem_ret_mask[bank]; in am33xx_pwrdm_set_mem_retst()
249 return -EINVAL; in am33xx_pwrdm_set_mem_retst()
252 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_set_mem_retst()
261 m = pwrdm->mem_pwrst_mask[bank]; in am33xx_pwrdm_read_mem_pwrst()
263 return -EINVAL; in am33xx_pwrdm_read_mem_pwrst()
265 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs); in am33xx_pwrdm_read_mem_pwrst()
276 m = pwrdm->mem_retst_mask[bank]; in am33xx_pwrdm_read_mem_retst()
278 return -EINVAL; in am33xx_pwrdm_read_mem_retst()
280 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs); in am33xx_pwrdm_read_mem_retst()
293 * via a callback and a periodic timer check -- how long do we expect in am33xx_pwrdm_wait_transition()
298 while ((am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs) in am33xx_pwrdm_wait_transition()
305 pwrdm->name); in am33xx_pwrdm_wait_transition()
306 return -EAGAIN; in am33xx_pwrdm_wait_transition()
321 * am33xx_prm_global_warm_sw_reset - reboot the device via warm reset
339 pwrdm->context = am33xx_prm_read_reg(pwrdm->prcm_offs, in am33xx_pwrdm_save_context()
340 pwrdm->pwrstctrl_offs); in am33xx_pwrdm_save_context()
345 pwrdm->context &= ~AM33XX_LOWPOWERSTATECHANGE_MASK; in am33xx_pwrdm_save_context()
350 int st, ctrl; in am33xx_pwrdm_restore_context() local
352 st = am33xx_prm_read_reg(pwrdm->prcm_offs, in am33xx_pwrdm_restore_context()
353 pwrdm->pwrstst_offs); in am33xx_pwrdm_restore_context()
355 am33xx_prm_write_reg(pwrdm->context, pwrdm->prcm_offs, in am33xx_pwrdm_restore_context()
356 pwrdm->pwrstctrl_offs); in am33xx_pwrdm_restore_context()
360 ctrl = OMAP_POWERSTATEST_MASK & pwrdm->context; in am33xx_pwrdm_restore_context()
362 if (st != ctrl) in am33xx_pwrdm_restore_context()