Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2800852a authored by Rajendra Nayak's avatar Rajendra Nayak Committed by Paul Walmsley
Browse files

ARM: OMAP2+: hwmod: Restore sysc after a reset



After a softreset, make sure the sysc settings are correctly
restored.

Reported-by: default avatarAnand Gadiyar <gadiyar@ti.com>
Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Shubhrajyoti D <shubhrajyoti@ti.com>
[paul@pwsan.com: combined post-reset SYSCONFIG reload code into the
 _reset() function to avoid duplication and future mistakes]
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 2a1cc144
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh)

	ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);

	if (oh->class->sysc) {
		_update_sysc_cache(oh);
		_enable_sysc(oh);
	}

	return ret;
}

@@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data)
		return 0;
	}

	if (!(oh->flags & HWMOD_INIT_NO_RESET)) {
	if (!(oh->flags & HWMOD_INIT_NO_RESET))
		_reset(oh);

		/*
		 * OCP_SYSCONFIG bits need to be reprogrammed after a softreset.
		 * The _enable() function should be split to
		 * avoid the rewrite of the OCP_SYSCONFIG register.
		 */
		if (oh->class->sysc) {
			_update_sysc_cache(oh);
			_enable_sysc(oh);
		}
	}

	postsetup_state = oh->_postsetup_state;
	if (postsetup_state == _HWMOD_STATE_UNKNOWN)
		postsetup_state = _HWMOD_STATE_ENABLED;