130 #include <linux/kernel.h>
131 #include <linux/errno.h>
136 #include <linux/list.h>
139 #include <linux/slab.h>
142 #include <plat/clock.h>
161 #define MAX_MODULE_SOFTRESET_WAIT 10000
164 #define MPU_INITIATOR_NAME "mpu"
170 #define LINKS_PER_OCP_IF 2
218 static unsigned short free_ls, max_ls, ls_supp;
256 static int _update_sysc_cache(
struct omap_hwmod *oh)
258 if (!oh->
class->sysc) {
259 WARN(1,
"omap_hwmod: %s: cannot read OCP_SYSCONFIG: not defined on hwmod's class\n", oh->
name);
283 if (!oh->
class->sysc) {
284 WARN(1,
"omap_hwmod: %s: cannot write OCP_SYSCONFIG: not defined on hwmod's class\n", oh->
name);
305 static int _set_master_standbymode(
struct omap_hwmod *oh,
u8 standbymode,
311 if (!oh->
class->sysc ||
315 if (!oh->
class->sysc->sysc_fields) {
316 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
320 mstandby_shift = oh->
class->sysc->sysc_fields->midle_shift;
321 mstandby_mask = (0x3 << mstandby_shift);
323 *v &= ~mstandby_mask;
324 *v |=
__ffs(standbymode) << mstandby_shift;
339 static int _set_slave_idlemode(
struct omap_hwmod *oh,
u8 idlemode,
u32 *v)
344 if (!oh->
class->sysc ||
348 if (!oh->
class->sysc->sysc_fields) {
349 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
353 sidle_shift = oh->
class->sysc->sysc_fields->sidle_shift;
354 sidle_mask = (0x3 << sidle_shift);
357 *v |=
__ffs(idlemode) << sidle_shift;
373 static int _set_clockactivity(
struct omap_hwmod *oh,
u8 clockact,
u32 *v)
378 if (!oh->
class->sysc ||
382 if (!oh->
class->sysc->sysc_fields) {
383 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
387 clkact_shift = oh->
class->sysc->sysc_fields->clkact_shift;
388 clkact_mask = (0x3 << clkact_shift);
391 *v |= clockact << clkact_shift;
408 if (!oh->
class->sysc ||
412 if (!oh->
class->sysc->sysc_fields) {
413 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
417 softrst_mask = (0x1 << oh->
class->sysc->sysc_fields->srst_shift);
434 static int _wait_softreset_complete(
struct omap_hwmod *oh)
440 sysc = oh->
class->sysc;
447 softrst_mask = (0x1 << sysc->
sysc_fields->srst_shift);
468 static int _set_dmadisable(
struct omap_hwmod *oh)
473 if (!oh->
class->sysc ||
477 if (!oh->
class->sysc->sysc_fields) {
478 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
484 pr_warn(
"omap_hwmod: %s: dma can be disabled only from enabled state\n", oh->
name);
488 pr_debug(
"omap_hwmod: %s: setting DMADISABLE\n", oh->
name);
492 (0x1 << oh->
class->sysc->sysc_fields->dmadisable_shift);
493 v |= dmadisable_mask;
494 _write_sysconfig(v, oh);
512 static int _set_module_autoidle(
struct omap_hwmod *oh,
u8 autoidle,
518 if (!oh->
class->sysc ||
522 if (!oh->
class->sysc->sysc_fields) {
523 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
527 autoidle_shift = oh->
class->sysc->sysc_fields->autoidle_shift;
528 autoidle_mask = (0x1 << autoidle_shift);
530 *v &= ~autoidle_mask;
531 *v |= autoidle << autoidle_shift;
550 static void _set_idle_ioring_wakeup(
struct omap_hwmod *oh,
bool set_wake)
557 if (!oh->
mux || !oh->
mux->enabled)
560 for (j = 0; j < oh->
mux->nr_pads_dynamic; j++) {
561 pad = oh->
mux->pads_dynamic[
j];
566 prev_idle = pad->
idle;
573 if (prev_idle != pad->
idle)
590 if (!oh->
class->sysc ||
596 if (!oh->
class->sysc->sysc_fields) {
597 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
602 *v |= 0x1 << oh->
class->sysc->sysc_fields->enwkup_shift;
625 if (!oh->
class->sysc ||
631 if (!oh->
class->sysc->sysc_fields) {
632 WARN(1,
"omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->
name);
637 *v &= ~(0x1 << oh->
class->sysc->sysc_fields->enwkup_shift);
707 static int _init_main_clk(
struct omap_hwmod *oh)
715 if (IS_ERR(oh->
_clk)) {
716 pr_warning(
"omap_hwmod: %s: cannot clk_get main_clk %s\n",
730 if (!oh->
_clk->clkdm)
731 pr_debug(
"omap_hwmod: %s: missing clockdomain for %s.\n",
744 static int _init_interface_clks(
struct omap_hwmod *oh)
754 while (i < oh->slaves_cnt) {
755 os = _fetch_next_ocp_if(&p, &i);
761 pr_warning(
"omap_hwmod: %s: cannot clk_get interface_clk %s\n",
787 static int _init_opt_clks(
struct omap_hwmod *oh)
797 pr_warning(
"omap_hwmod: %s: cannot clk_get opt_clk %s\n",
823 static int _enable_clocks(
struct omap_hwmod *oh)
829 pr_debug(
"omap_hwmod: %s: enabling clocks\n", oh->
name);
836 while (i < oh->slaves_cnt) {
837 os = _fetch_next_ocp_if(&p, &i);
854 static int _disable_clocks(
struct omap_hwmod *oh)
860 pr_debug(
"omap_hwmod: %s: disabling clocks\n", oh->
name);
867 while (i < oh->slaves_cnt) {
868 os = _fetch_next_ocp_if(&p, &i);
879 static void _enable_optional_clocks(
struct omap_hwmod *oh)
884 pr_debug(
"omap_hwmod: %s: enabling optional clocks\n", oh->
name);
894 static void _disable_optional_clocks(
struct omap_hwmod *oh)
899 pr_debug(
"omap_hwmod: %s: disabling optional clocks\n", oh->
name);
916 static void _omap4_enable_module(
struct omap_hwmod *oh)
921 pr_debug(
"omap_hwmod: %s: %s: %d\n",
925 oh->
clkdm->prcm_partition,
927 oh->
clkdm->clkdm_offs,
938 static void _am33xx_enable_module(
struct omap_hwmod *oh)
943 pr_debug(
"omap_hwmod: %s: %s: %d\n",
947 oh->
clkdm->clkdm_offs,
960 static int _omap4_wait_target_disable(
struct omap_hwmod *oh)
973 oh->
clkdm->clkdm_offs,
986 static int _am33xx_wait_target_disable(
struct omap_hwmod *oh)
998 oh->
clkdm->clkdm_offs,
1010 static int _count_mpu_irqs(
struct omap_hwmod *oh)
1020 }
while (ohii->
irq != -1);
1033 static int _count_sdma_reqs(
struct omap_hwmod *oh)
1043 }
while (ohdi->
dma_req != -1);
1061 if (!os || !os->
addr)
1065 mem = &os->
addr[i++];
1088 static int _get_mpu_irq_by_name(
struct omap_hwmod *oh,
const char *
name,
1098 while (oh->
mpu_irqs[i].irq != -1) {
1099 if (name == oh->
mpu_irqs[i].name ||
1131 static int _get_sdma_req_by_name(
struct omap_hwmod *oh,
const char *name,
1141 while (oh->
sdma_reqs[i].dma_req != -1) {
1176 static int _get_addr_space_by_name(
struct omap_hwmod *oh,
const char *name,
1187 while (i < oh->slaves_cnt) {
1188 os = _fetch_next_ocp_if(&p, &i);
1194 while (os->
addr[j].pa_start != os->
addr[j].pa_end) {
1195 if (name == os->
addr[j].name ||
1210 *pa_start = os->
addr[
j].pa_start;
1211 *pa_end = os->
addr[
j].pa_end;
1238 while (i < oh->slaves_cnt) {
1239 os = _fetch_next_ocp_if(&p, &i);
1282 int found = 0, i = 0;
1284 os = _find_mpu_rt_port(oh);
1285 if (!os || !os->
addr)
1289 mem = &os->
addr[i++];
1294 return (found) ? mem :
NULL;
1308 static void _enable_sysc(
struct omap_hwmod *oh)
1314 if (!oh->
class->sysc)
1324 _enable_optional_clocks(oh);
1325 _wait_softreset_complete(oh);
1327 _disable_optional_clocks(oh);
1330 sf = oh->
class->sysc->sysc_flags;
1333 clkdm_act = ((oh->
clkdm &&
1337 if (clkdm_act && !(oh->
class->sysc->idlemodes &
1343 _set_slave_idlemode(oh, idlemode, &v);
1351 _enable_wakeup(oh, &v);
1357 _set_master_standbymode(oh, idlemode, &v);
1367 _set_clockactivity(oh, oh->
class->sysc->clockact, &v);
1371 _enable_wakeup(oh, &v);
1373 _write_sysconfig(v, oh);
1382 _set_module_autoidle(oh, idlemode, &v);
1383 _write_sysconfig(v, oh);
1396 static void _idle_sysc(
struct omap_hwmod *oh)
1401 if (!oh->
class->sysc)
1405 sf = oh->
class->sysc->sysc_flags;
1407 if (sf & SYSC_HAS_SIDLEMODE) {
1410 !(oh->
class->sysc->idlemodes &
1415 _set_slave_idlemode(oh, idlemode, &v);
1418 if (sf & SYSC_HAS_MIDLEMODE) {
1423 _enable_wakeup(oh, &v);
1429 _set_master_standbymode(oh, idlemode, &v);
1434 _enable_wakeup(oh, &v);
1436 _write_sysconfig(v, oh);
1446 static void _shutdown_sysc(
struct omap_hwmod *oh)
1451 if (!oh->
class->sysc)
1455 sf = oh->
class->sysc->sysc_flags;
1457 if (sf & SYSC_HAS_SIDLEMODE)
1460 if (sf & SYSC_HAS_MIDLEMODE)
1464 _set_module_autoidle(oh, 1, &v);
1466 _write_sysconfig(v, oh);
1475 static struct omap_hwmod *_lookup(
const char *name)
1499 static int _init_clkdm(
struct omap_hwmod *oh)
1502 pr_debug(
"omap_hwmod: %s: missing clockdomain\n", oh->
name);
1508 pr_warning(
"omap_hwmod: %s: could not associate to clkdm %s\n",
1513 pr_debug(
"omap_hwmod: %s: associated to clkdm %s\n",
1536 pr_debug(
"omap_hwmod: %s: looking up clocks\n", oh->
name);
1538 ret |= _init_main_clk(oh);
1539 ret |= _init_interface_clks(oh);
1540 ret |= _init_opt_clks(oh);
1542 ret |=
soc_ops.init_clkdm(oh);
1561 static int _lookup_hardreset(
struct omap_hwmod *oh,
const char *name,
1567 const char *rst_line = oh->
rst_lines[
i].name;
1568 if (!
strcmp(rst_line, name)) {
1571 pr_debug(
"omap_hwmod: %s: %s: %s: rst %d st %d\n",
1595 static int _assert_hardreset(
struct omap_hwmod *oh,
const char *name)
1603 if (!
soc_ops.assert_hardreset)
1606 ret = _lookup_hardreset(oh, name, &ohri);
1610 ret =
soc_ops.assert_hardreset(oh, &ohri);
1628 static int _deassert_hardreset(
struct omap_hwmod *oh,
const char *name)
1637 if (!
soc_ops.deassert_hardreset)
1640 ret = _lookup_hardreset(oh, name, &ohri);
1653 WARN(1,
"omap_hwmod: %s: could not enable clockdomain %s: %d\n",
1663 ret =
soc_ops.deassert_hardreset(oh, &ohri);
1667 _disable_clocks(oh);
1677 if (oh->
clkdm && hwsup)
1699 static int _read_hardreset(
struct omap_hwmod *oh,
const char *name)
1707 if (!
soc_ops.is_hardreset_asserted)
1710 ret = _lookup_hardreset(oh, name, &ohri);
1714 return soc_ops.is_hardreset_asserted(oh, &ohri);
1727 static bool _are_all_hardreset_lines_asserted(
struct omap_hwmod *oh)
1735 if (_read_hardreset(oh, oh->
rst_lines[i].name) > 0)
1755 static bool _are_any_hardreset_lines_asserted(
struct omap_hwmod *oh)
1761 if (_read_hardreset(oh, oh->
rst_lines[i].name) > 0)
1764 return (rst_cnt) ?
true :
false;
1774 static int _omap4_disable_module(
struct omap_hwmod *oh)
1785 if (_are_any_hardreset_lines_asserted(oh))
1792 oh->
clkdm->clkdm_offs,
1795 v = _omap4_wait_target_disable(oh);
1797 pr_warn(
"omap_hwmod: %s: _wait_target_disable failed\n",
1810 static int _am33xx_disable_module(
struct omap_hwmod *oh)
1819 if (_are_any_hardreset_lines_asserted(oh))
1825 v = _am33xx_wait_target_disable(oh);
1827 pr_warn(
"omap_hwmod: %s: _wait_target_disable failed\n",
1849 static int _ocp_softreset(
struct omap_hwmod *oh)
1855 if (!oh->
class->sysc ||
1861 pr_warn(
"omap_hwmod: %s: reset can only be entered from enabled state\n",
1868 _enable_optional_clocks(oh);
1870 pr_debug(
"omap_hwmod: %s: resetting via OCP SOFTRESET\n", oh->
name);
1873 ret = _set_softreset(oh, &v);
1876 _write_sysconfig(v, oh);
1878 if (oh->
class->sysc->srst_udelay)
1881 c = _wait_softreset_complete(oh);
1883 pr_warning(
"omap_hwmod: %s: softreset failed (waited %d usec)\n",
1886 pr_debug(
"omap_hwmod: %s: softreset in %d usec\n", oh->
name, c);
1897 _disable_optional_clocks(oh);
1941 if (oh->
class->reset) {
1942 r = oh->
class->reset(oh);
1946 _assert_hardreset(oh, oh->
rst_lines[i].name);
1949 r = _ocp_softreset(oh);
1955 _set_dmadisable(oh);
1962 if (oh->
class->sysc) {
1963 _update_sysc_cache(oh);
1982 static void _reconfigure_io_chain(
void)
1984 unsigned long flags;
1993 spin_unlock_irqrestore(&io_chain_lock, flags);
2032 WARN(1,
"omap_hwmod: %s: enabled state can only be entered from initialized, idle, or disabled state\n",
2046 if (_are_all_hardreset_lines_asserted(oh))
2050 if (oh->
mux && (!oh->
mux->enabled ||
2052 oh->
mux->pads_dynamic))) {
2054 _reconfigure_io_chain();
2057 _add_initiator_dep(oh, mpu_oh);
2069 WARN(1,
"omap_hwmod: %s: could not enable clockdomain %s: %d\n",
2079 r = (
soc_ops.wait_target_ready) ?
soc_ops.wait_target_ready(oh) :
2086 if (oh->
clkdm && hwsup)
2092 if (oh->
class->sysc) {
2094 _update_sysc_cache(oh);
2098 _omap4_disable_module(oh);
2099 _disable_clocks(oh);
2100 pr_debug(
"omap_hwmod: %s: _wait_target_ready: %d\n",
2123 WARN(1,
"omap_hwmod: %s: idle state can only be entered from enabled state\n",
2128 if (_are_all_hardreset_lines_asserted(oh))
2131 if (oh->
class->sysc)
2133 _del_initiator_dep(oh, mpu_oh);
2144 _disable_clocks(oh);
2149 if (oh->
mux && oh->
mux->pads_dynamic) {
2151 _reconfigure_io_chain();
2176 unsigned long flags;
2185 retval = _set_module_autoidle(oh, autoidle, &v);
2188 _write_sysconfig(v, oh);
2190 spin_unlock_irqrestore(&oh->
_lock, flags);
2211 WARN(1,
"omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n",
2216 if (_are_all_hardreset_lines_asserted(oh))
2221 if (oh->
class->pre_shutdown) {
2225 ret = oh->
class->pre_shutdown(oh);
2233 if (oh->
class->sysc) {
2241 _del_initiator_dep(oh, mpu_oh);
2245 _disable_clocks(oh);
2252 _assert_hardreset(oh, oh->
rst_lines[i].name);
2280 _save_mpu_port_index(oh);
2285 mem = _find_mpu_rt_addr_space(oh);
2287 pr_debug(
"omap_hwmod: %s: no MPU register target found\n",
2294 pr_err(
"omap_hwmod: %s: Could not ioremap\n", oh->
name);
2298 pr_debug(
"omap_hwmod: %s: MPU register target at va %p\n",
2299 oh->
name, va_start);
2324 _init_mpu_rt_base(oh,
NULL);
2326 r = _init_clocks(oh,
NULL);
2328 WARN(1,
"omap_hwmod: %s: couldn't init clocks\n", oh->
name);
2355 while (i < oh->slaves_cnt) {
2356 os = _fetch_next_ocp_if(&p, &i);
2393 pr_warning(
"omap_hwmod: %s: cannot be enabled for reset (%d)\n",
2467 WARN(1,
"hwmod: %s: unknown postsetup state %d! defaulting to enabled\n",
2468 oh->
name, postsetup_state);
2494 _setup_iclk_autoidle(oh);
2496 if (!_setup_reset(oh))
2497 _setup_postsetup(oh);
2527 if (_lookup(oh->
name))
2567 *ml = &linkspace[free_ls++];
2568 *sl = &linkspace[free_ls++];
2582 pr_debug(
"omap_hwmod: supplemental link allocations needed: %d\n",
2583 ls_supp * LINKS_PER_OCP_IF);
2603 pr_debug(
"omap_hwmod: %s -> %s: adding link\n", oi->
master->name,
2606 _alloc_links(&ml, &sl);
2609 INIT_LIST_HEAD(&ml->
node);
2610 list_add(&ml->
node, &oi->
master->master_ports);
2611 oi->
master->masters_cnt++;
2614 INIT_LIST_HEAD(&sl->
node);
2615 list_add(&sl->
node, &oi->
slave->slave_ports);
2616 oi->
slave->slaves_cnt++;
2642 pr_debug(
"omap_hwmod: registering link from %s to %s\n",
2653 _register(oi->
slave);
2683 WARN(1,
"linkspace already allocated\n");
2693 pr_debug(
"omap_hwmod: %s: allocating %d byte linkspace (%d links)\n",
2694 __func__, sz, max_ls);
2698 memset(linkspace, 0, sz);
2714 static int _omap2_wait_target_ready(
struct omap_hwmod *oh)
2722 if (!_find_mpu_rt_port(oh))
2741 static int _omap4_wait_target_ready(
struct omap_hwmod *oh)
2749 if (!_find_mpu_rt_port(oh))
2756 oh->
clkdm->clkdm_offs,
2769 static int _am33xx_wait_target_ready(
struct omap_hwmod *oh)
2771 if (!oh || !oh->
clkdm)
2777 if (!_find_mpu_rt_port(oh))
2783 oh->
clkdm->clkdm_offs,
2798 static int _omap2_assert_hardreset(
struct omap_hwmod *oh,
2816 static int _omap2_deassert_hardreset(
struct omap_hwmod *oh,
2836 static int _omap2_is_hardreset_asserted(
struct omap_hwmod *oh,
2855 static int _omap4_assert_hardreset(
struct omap_hwmod *oh,
2862 oh->
clkdm->pwrdm.ptr->prcm_partition,
2863 oh->
clkdm->pwrdm.ptr->prcm_offs,
2879 static int _omap4_deassert_hardreset(
struct omap_hwmod *oh,
2886 pr_err(
"omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
2889 oh->
clkdm->pwrdm.ptr->prcm_partition,
2890 oh->
clkdm->pwrdm.ptr->prcm_offs,
2906 static int _omap4_is_hardreset_asserted(
struct omap_hwmod *oh,
2913 oh->
clkdm->pwrdm.ptr->prcm_partition,
2914 oh->
clkdm->pwrdm.ptr->prcm_offs,
2930 static int _am33xx_assert_hardreset(
struct omap_hwmod *oh,
2935 oh->
clkdm->pwrdm.ptr->prcm_offs,
2951 static int _am33xx_deassert_hardreset(
struct omap_hwmod *oh,
2955 pr_err(
"omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
2959 oh->
clkdm->pwrdm.ptr->prcm_offs,
2976 static int _am33xx_is_hardreset_asserted(
struct omap_hwmod *oh,
2980 oh->
clkdm->pwrdm.ptr->prcm_offs,
3020 ret = _set_softreset(oh, &v);
3023 _write_sysconfig(v, oh);
3054 retval = _set_slave_idlemode(oh, idlemode, &v);
3056 _write_sysconfig(v, oh);
3102 ret = (*fn)(temp_oh,
data);
3132 if (_alloc_linkspace(ois)) {
3133 pr_err(
"omap_hwmod: could not allocate link space\n");
3140 r = _register_link(ois[i]);
3142 "omap_hwmod: _register_link(%s -> %s) returned %d\n",
3143 ois[i]->master->name, ois[i]->
slave->name, r);
3162 pr_err(
"omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n",
3183 pr_debug(
"omap_hwmod: %s: %s\n", oh_name, __func__);
3185 oh = _lookup(oh_name);
3187 WARN(1,
"omap_hwmod: %s: hwmod not yet registered\n", oh_name);
3191 _ensure_mpu_hwmod_is_setup(oh);
3207 static int __init omap_hwmod_setup_all(
void)
3209 _ensure_mpu_hwmod_is_setup(
NULL);
3228 unsigned long flags;
3235 spin_unlock_irqrestore(&oh->
_lock, flags);
3249 unsigned long flags;
3256 spin_unlock_irqrestore(&oh->
_lock, flags);
3271 unsigned long flags;
3278 spin_unlock_irqrestore(&oh->
_lock, flags);
3291 unsigned long flags;
3295 spin_unlock_irqrestore(&oh->
_lock, flags);
3308 unsigned long flags;
3311 _disable_clocks(oh);
3312 spin_unlock_irqrestore(&oh->
_lock, flags);
3332 if (!oh->
class->sysc || !oh->
class->sysc->sysc_flags) {
3333 WARN(1,
"omap_device: %s: OCP barrier impossible due to device configuration\n",
3356 unsigned long flags;
3363 spin_unlock_irqrestore(&oh->
_lock, flags);
3395 ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
3399 while (i < oh->slaves_cnt) {
3400 os = _fetch_next_ocp_if(&p, &i);
3401 ret += _count_ocp_if_addr_spaces(os);
3421 int i,
j, mpu_irqs_cnt, sdma_reqs_cnt, addr_cnt;
3426 mpu_irqs_cnt = _count_mpu_irqs(oh);
3427 for (i = 0; i < mpu_irqs_cnt; i++) {
3428 (res +
r)->name = (oh->
mpu_irqs + i)->name;
3435 sdma_reqs_cnt = _count_sdma_reqs(oh);
3436 for (i = 0; i < sdma_reqs_cnt; i++) {
3447 while (i < oh->slaves_cnt) {
3448 os = _fetch_next_ocp_if(&p, &i);
3449 addr_cnt = _count_ocp_if_addr_spaces(os);
3451 for (j = 0; j < addr_cnt; j++) {
3452 (res +
r)->name = (os->
addr + j)->name;
3454 (res +
r)->
end = (os->
addr + j)->pa_end;
3475 int i, sdma_reqs_cnt;
3478 sdma_reqs_cnt = _count_sdma_reqs(oh);
3479 for (i = 0; i < sdma_reqs_cnt; i++) {
3513 const char *name,
struct resource *rsrc)
3516 unsigned int irq,
dma;
3517 u32 pa_start, pa_end;
3523 r = _get_mpu_irq_by_name(oh, name, &irq);
3530 r = _get_sdma_req_by_name(oh, name, &dma);
3537 r = _get_addr_space_by_name(oh, name, &pa_start, &pa_end);
3541 rsrc->
start = pa_start;
3575 oi = _find_mpu_rt_port(oh);
3584 return c->clkdm->pwrdm.ptr;
3628 return _add_initiator_dep(oh, init_oh);
3653 return _del_initiator_dep(oh, init_oh);
3671 unsigned long flags;
3676 if (oh->
class->sysc &&
3679 _enable_wakeup(oh, &v);
3680 _write_sysconfig(v, oh);
3683 _set_idle_ioring_wakeup(oh,
true);
3684 spin_unlock_irqrestore(&oh->
_lock, flags);
3704 unsigned long flags;
3709 if (oh->
class->sysc &&
3712 _disable_wakeup(oh, &v);
3713 _write_sysconfig(v, oh);
3716 _set_idle_ioring_wakeup(oh,
false);
3717 spin_unlock_irqrestore(&oh->
_lock, flags);
3737 unsigned long flags;
3743 ret = _assert_hardreset(oh, name);
3744 spin_unlock_irqrestore(&oh->
_lock, flags);
3764 unsigned long flags;
3770 ret = _deassert_hardreset(oh, name);
3771 spin_unlock_irqrestore(&oh->
_lock, flags);
3790 unsigned long flags;
3796 ret = _read_hardreset(oh, name);
3797 spin_unlock_irqrestore(&oh->
_lock, flags);
3823 if (!classname || !
fn)
3826 pr_debug(
"omap_hwmod: %s: looking for modules of class %s\n",
3827 __func__, classname);
3831 pr_debug(
"omap_hwmod: %s: %s: calling callback fn\n",
3832 __func__, temp_oh->
name);
3833 ret = (*fn)(temp_oh,
user);
3840 pr_debug(
"omap_hwmod: %s: iterator terminated early: %d\n",
3860 unsigned long flags;
3881 spin_unlock_irqrestore(&oh->
_lock, flags);
3924 pr_err(
"omap_hwmod: %s: cannot prevent setup reset; in wrong state\n",
3965 if (!oh || !oh->
mux || !oh->
mpu_irqs || pad_idx < 0 ||
3966 pad_idx >= oh->
mux->nr_pads_dynamic)
3973 if (irq_idx >= nr_irqs)
3976 if (!oh->
mux->irqs) {
3978 oh->
mux->irqs = kzalloc(
sizeof(
int) * oh->
mux->nr_pads_dynamic,
3983 oh->
mux->irqs[pad_idx] = irq_idx;
3998 soc_ops.wait_target_ready = _omap2_wait_target_ready;
3999 soc_ops.assert_hardreset = _omap2_assert_hardreset;
4000 soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
4001 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
4003 soc_ops.enable_module = _omap4_enable_module;
4004 soc_ops.disable_module = _omap4_disable_module;
4005 soc_ops.wait_target_ready = _omap4_wait_target_ready;
4006 soc_ops.assert_hardreset = _omap4_assert_hardreset;
4007 soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
4008 soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
4009 soc_ops.init_clkdm = _init_clkdm;
4011 soc_ops.enable_module = _am33xx_enable_module;
4012 soc_ops.disable_module = _am33xx_disable_module;
4013 soc_ops.wait_target_ready = _am33xx_wait_target_ready;
4014 soc_ops.assert_hardreset = _am33xx_assert_hardreset;
4015 soc_ops.deassert_hardreset = _am33xx_deassert_hardreset;
4016 soc_ops.is_hardreset_asserted = _am33xx_is_hardreset_asserted;
4017 soc_ops.init_clkdm = _init_clkdm;
4019 WARN(1,
"omap_hwmod: unknown SoC type\n");