aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2016-10-20 09:35:21 -0400
committerTony Lindgren <tony@atomide.com>2016-11-10 14:42:38 -0500
commitb42814557fd5a9cc943dbe326b99dd104af23195 (patch)
tree8b3e53d012757bea3eb916d97e7e0a5350fc084d
parent4e37d32fef08e83de330bd8dda2c50aa7db7361a (diff)
ARM: OMAP2+: Remove legacy hwmod mux code
This is no longer needed when booted with device tree. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/devices.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c107
2 files changed, 1 insertions, 107 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 60a20f3b44de..3fdb94599184 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -30,7 +30,6 @@
30 30
31#include "soc.h" 31#include "soc.h"
32#include "common.h" 32#include "common.h"
33#include "mux.h"
34#include "control.h" 33#include "control.h"
35#include "display.h" 34#include "display.h"
36 35
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 1052b29697b8..759e1d45ba25 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -160,7 +160,6 @@
160#include "prm44xx.h" 160#include "prm44xx.h"
161#include "prm33xx.h" 161#include "prm33xx.h"
162#include "prminst44xx.h" 162#include "prminst44xx.h"
163#include "mux.h"
164#include "pm.h" 163#include "pm.h"
165 164
166/* Name of the OMAP hwmod for the MPU */ 165/* Name of the OMAP hwmod for the MPU */
@@ -217,9 +216,6 @@ static LIST_HEAD(omap_hwmod_list);
217/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 216/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
218static struct omap_hwmod *mpu_oh; 217static struct omap_hwmod *mpu_oh;
219 218
220/* io_chain_lock: used to serialize reconfigurations of the I/O chain */
221static DEFINE_SPINLOCK(io_chain_lock);
222
223/* 219/*
224 * linkspace: ptr to a buffer that struct omap_hwmod_link records are 220 * linkspace: ptr to a buffer that struct omap_hwmod_link records are
225 * allocated from - used to reduce the number of small memory 221 * allocated from - used to reduce the number of small memory
@@ -594,51 +590,6 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
594} 590}
595 591
596/** 592/**
597 * _set_idle_ioring_wakeup - enable/disable IO pad wakeup on hwmod idle for mux
598 * @oh: struct omap_hwmod *
599 * @set_wake: bool value indicating to set (true) or clear (false) wakeup enable
600 *
601 * Set or clear the I/O pad wakeup flag in the mux entries for the
602 * hwmod @oh. This function changes the @oh->mux->pads_dynamic array
603 * in memory. If the hwmod is currently idled, and the new idle
604 * values don't match the previous ones, this function will also
605 * update the SCM PADCTRL registers. Otherwise, if the hwmod is not
606 * currently idled, this function won't touch the hardware: the new
607 * mux settings are written to the SCM PADCTRL registers when the
608 * hwmod is idled. No return value.
609 */
610static void _set_idle_ioring_wakeup(struct omap_hwmod *oh, bool set_wake)
611{
612 struct omap_device_pad *pad;
613 bool change = false;
614 u16 prev_idle;
615 int j;
616
617 if (!oh->mux || !oh->mux->enabled)
618 return;
619
620 for (j = 0; j < oh->mux->nr_pads_dynamic; j++) {
621 pad = oh->mux->pads_dynamic[j];
622
623 if (!(pad->flags & OMAP_DEVICE_PAD_WAKEUP))
624 continue;
625
626 prev_idle = pad->idle;
627
628 if (set_wake)
629 pad->idle |= OMAP_WAKEUP_EN;
630 else
631 pad->idle &= ~OMAP_WAKEUP_EN;
632
633 if (prev_idle != pad->idle)
634 change = true;
635 }
636
637 if (change && oh->_state == _HWMOD_STATE_IDLE)
638 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
639}
640
641/**
642 * _enable_wakeup: set OCP_SYSCONFIG.ENAWAKEUP bit in the hardware 593 * _enable_wakeup: set OCP_SYSCONFIG.ENAWAKEUP bit in the hardware
643 * @oh: struct omap_hwmod * 594 * @oh: struct omap_hwmod *
644 * 595 *
@@ -2018,29 +1969,6 @@ static int _reset(struct omap_hwmod *oh)
2018} 1969}
2019 1970
2020/** 1971/**
2021 * _reconfigure_io_chain - clear any I/O chain wakeups and reconfigure chain
2022 *
2023 * Call the appropriate PRM function to clear any logged I/O chain
2024 * wakeups and to reconfigure the chain. This apparently needs to be
2025 * done upon every mux change. Since hwmods can be concurrently
2026 * enabled and idled, hold a spinlock around the I/O chain
2027 * reconfiguration sequence. No return value.
2028 *
2029 * XXX When the PRM code is moved to drivers, this function can be removed,
2030 * as the PRM infrastructure should abstract this.
2031 */
2032static void _reconfigure_io_chain(void)
2033{
2034 unsigned long flags;
2035
2036 spin_lock_irqsave(&io_chain_lock, flags);
2037
2038 omap_prm_reconfigure_io_chain();
2039
2040 spin_unlock_irqrestore(&io_chain_lock, flags);
2041}
2042
2043/**
2044 * _omap4_update_context_lost - increment hwmod context loss counter if 1972 * _omap4_update_context_lost - increment hwmod context loss counter if
2045 * hwmod context was lost, and clear hardware context loss reg 1973 * hwmod context was lost, and clear hardware context loss reg
2046 * @oh: hwmod to check for context loss 1974 * @oh: hwmod to check for context loss
@@ -2109,18 +2037,9 @@ static int _enable(struct omap_hwmod *oh)
2109 2037
2110 /* 2038 /*
2111 * hwmods with HWMOD_INIT_NO_IDLE flag set are left in enabled 2039 * hwmods with HWMOD_INIT_NO_IDLE flag set are left in enabled
2112 * state at init. Now that someone is really trying to enable 2040 * state at init.
2113 * them, just ensure that the hwmod mux is set.
2114 */ 2041 */
2115 if (oh->_int_flags & _HWMOD_SKIP_ENABLE) { 2042 if (oh->_int_flags & _HWMOD_SKIP_ENABLE) {
2116 /*
2117 * If the caller has mux data populated, do the mux'ing
2118 * which wouldn't have been done as part of the _enable()
2119 * done during setup.
2120 */
2121 if (oh->mux)
2122 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
2123
2124 oh->_int_flags &= ~_HWMOD_SKIP_ENABLE; 2043 oh->_int_flags &= ~_HWMOD_SKIP_ENABLE;
2125 return 0; 2044 return 0;
2126 } 2045 }
@@ -2145,16 +2064,6 @@ static int _enable(struct omap_hwmod *oh)
2145 if (_are_all_hardreset_lines_asserted(oh)) 2064 if (_are_all_hardreset_lines_asserted(oh))
2146 return 0; 2065 return 0;
2147 2066
2148 /* Mux pins for device runtime if populated */
2149 if (oh->mux && (!oh->mux->enabled ||
2150 ((oh->_state == _HWMOD_STATE_IDLE) &&
2151 oh->mux->pads_dynamic))) {
2152 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
2153 _reconfigure_io_chain();
2154 } else if (oh->flags & HWMOD_RECONFIG_IO_CHAIN) {
2155 _reconfigure_io_chain();
2156 }
2157
2158 _add_initiator_dep(oh, mpu_oh); 2067 _add_initiator_dep(oh, mpu_oh);
2159 2068
2160 if (oh->clkdm) { 2069 if (oh->clkdm) {
@@ -2260,14 +2169,6 @@ static int _idle(struct omap_hwmod *oh)
2260 clkdm_hwmod_disable(oh->clkdm, oh); 2169 clkdm_hwmod_disable(oh->clkdm, oh);
2261 } 2170 }
2262 2171
2263 /* Mux pins for device idle if populated */
2264 if (oh->mux && oh->mux->pads_dynamic) {
2265 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
2266 _reconfigure_io_chain();
2267 } else if (oh->flags & HWMOD_RECONFIG_IO_CHAIN) {
2268 _reconfigure_io_chain();
2269 }
2270
2271 oh->_state = _HWMOD_STATE_IDLE; 2172 oh->_state = _HWMOD_STATE_IDLE;
2272 2173
2273 return 0; 2174 return 0;
@@ -2334,10 +2235,6 @@ static int _shutdown(struct omap_hwmod *oh)
2334 for (i = 0; i < oh->rst_lines_cnt; i++) 2235 for (i = 0; i < oh->rst_lines_cnt; i++)
2335 _assert_hardreset(oh, oh->rst_lines[i].name); 2236 _assert_hardreset(oh, oh->rst_lines[i].name);
2336 2237
2337 /* Mux pins to safe mode or use populated off mode values */
2338 if (oh->mux)
2339 omap_hwmod_mux(oh->mux, _HWMOD_STATE_DISABLED);
2340
2341 oh->_state = _HWMOD_STATE_DISABLED; 2238 oh->_state = _HWMOD_STATE_DISABLED;
2342 2239
2343 return 0; 2240 return 0;
@@ -3729,7 +3626,6 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
3729 _write_sysconfig(v, oh); 3626 _write_sysconfig(v, oh);
3730 } 3627 }
3731 3628
3732 _set_idle_ioring_wakeup(oh, true);
3733 spin_unlock_irqrestore(&oh->_lock, flags); 3629 spin_unlock_irqrestore(&oh->_lock, flags);
3734 3630
3735 return 0; 3631 return 0;
@@ -3762,7 +3658,6 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
3762 _write_sysconfig(v, oh); 3658 _write_sysconfig(v, oh);
3763 } 3659 }
3764 3660
3765 _set_idle_ioring_wakeup(oh, false);
3766 spin_unlock_irqrestore(&oh->_lock, flags); 3661 spin_unlock_irqrestore(&oh->_lock, flags);
3767 3662
3768 return 0; 3663 return 0;