omap: hwmod: enable clocks before deasserting hardreset

The enable code currently deasserts the hard-reset before
turning on the clocks. These kind of reset lines are limited
only to processor-device like IPs such as DSP or IPU or
IVA, which actually need the clock to be enabled first.

The code that deasserts the hard-reset has therefore been
relocated to execute after the clocks are enabled, to avoid
the hard-deassert traces (failed to hard reset).

Change-Id: Id9c413b315c927295cf4be7f986f6e1a710b9ef8
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
Signed-off-by: Paul Hunt <hunt@ti.com>
OMAP4: clocks: skip module idle status check for processor devices

The module idle status for processor devices (hwmod devices) like IPU,
DSP & IVA will fail the functional status check as long as the module
is held in reset. The status would always show that the module is in
transition, and would complete only after the relevant hwmod's reset
line is deasserted.

The initialization sequence for these processor devices require the
clocks to be enabled first before deasserting the reset lines. This
would cause a failure in _omap4_module_wait_ready which checks for
the module idle status to be functional. The clk ops for dsp, ipu
and iva in the clock data has therefore been redefined such that
the module idlest status check in the clock enable code is skipped
over.

Change-Id: I799b30c5f86e51739a56538f602a8030fd4bdb09
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Paul Hunt <hunt@ti.com>
OMAP: I2C: Disable interrupts in omap_i2c_bus_clear()

Interrupts that occur during omap_i2c_bus_clear() can cause to
erroneous behaviour in interrupt handler, i.e. multiple printing of
"RRDY IRQ while no data requested" message. So disable interrupts
in omap_i2c_bus_clear() function since they can't be handled correctly.

Change-Id: If4525c93284766d0a2705d7ca4d1f962e3cc4b15
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
OMAP: hwmod: Don't update sysc cache on soft-reset

When the module is resetted using via SYSCONFIG.SOFTRESET the following
sequence causes SYSC cache value to be updated:
omap_hwmod_softreset()
 |-->_write_sysconfig()

_ocp_softreset
 |-->_write_sysconfig()

As result, when the module is enabled next time the SYSC cache value
with SYSCONFIG.SOFTRESET=1 will be used by _enable_sysc() and that
will cause unexpected reset of module. This commit prevents SYSC
cache updating during soft reset.

New static function _write_sysconfig_raw() is introduced for writing
value to the module's OCP_SYSCONFIG register without cache updating.

Change-Id: I0058740c2888c23648a498597142a5c0d1b550ba
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
OMAPDSS: DSS: Add MEM2MEM manager mode

This change adds memory-to-memory (M2M) mode with using of the
manager. The main idea is to connect write back (WB) pipeline to
the manager (overlay, in terms of technical reference manual)
which is not in use (physical interface is turned-off) for using
advantages of hardware manager in M2M mode. In this case several
pipelines can be connected to the manager.

Change-Id: Ifa649bd5b18f54f3ce583fdee802c799b2c30711
Co-author: Sergiy Kibrik <sergiikibrik@ti.com>
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
OMAPDSS: DSSCOMP: Add MEM2MEM with manager mode
OMAPDSS: DSS: workaround for errata i642

This change adds workaround for errata i642.

Description of Errata i642:
VID /GFX Pipeline Underflow Interrupt Generated When In WB
Memory-to-memory Operation. Errata ID: i642.

Recommended workaround:
Software should disable the VID/GFX pipeline underflow interrupt
by writing 0x0 in DISPC_IRQENABLE[20-12-10-6] bit if it is
connected to the WB pipeline in memory-to-memory mode.
Software should not consider the underflow interrupt generated in
DISPC_IRQSTATUS[20-12-10-6] bit when in memory-to-memory mode.

This change do not disable interrupt, but ignores its handler in
case if pipeline connected to the manager, which is used in MEM2MEM
mode.

Silicon Versions Impacted:
OMAP4430 ES1.0, ES2.0, ES2.1, ES2.2, ES2.3
OMAP4460 ES1.0, ES1.1
OMAP4470 ES1.0

Change-Id: If7532b1b7454d92a648673b6da29cc31448519ab
Author: Rohit Choraria <rohitkc@ti.com>
Co-author: Mykhailo Denysiuk <x0172934@ti.com>
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
OMAPDSS: DSS: fix for black frames in mem2mem mode

This change fixes black frames issue in MEM2MEM mode.
The root of the problem is in apply_irq_handler function, which
time-to-time is called between calls to omap_dss_wb_apply() and
omap_dss_mgr_apply() functions. So, apply_irq_handler sometimes
is called when WB cache was updated, but managr cache and others
caches were not updated yet.

Change-Id: I308f5ef7d7b6e790382c22c40b8cddedaf91308e
Signed-off-by: Rohit Choraria <rohitkc@ti.com>
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
gcx: added support for rotation.

Also added GC_C_BUFFER debugger option.

Change-Id: I3eeec9ed523632a80892494d2b77a486309f4c12
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
gcx: driver optimizations.

Optimized interrupt usage.
Optimize throughput by having the main thread program
the hardware directly rather than handing off cmd
buffers to the gccmdthread.

Change-Id: I0f4eb1b3d00cc02d5bc02b9b511df782bb8fc0c5
Signed-off-by: Craig Stout <craig.stout@ti.com>
gcx: yuv support improvements.

Added UYVY and YUY2 formats for input and output.
Also fixes some issues with alignment for NV12.
Also adds destination stride check for all surfaces.

Change-Id: Ie8baa7fdba184ae6ca853499b886511869bef762
Signed-off-by: Craig Stout <craig.stout@ti.com>
gcx: process cleanup

Properly free kernel resources when userspace application gets killed

Change-Id: I00d2b7ddc6e37036ae66a16740c709b68dd0bfc7
Signed-off-by: Jack Yen <jyen@ti.com>
gcx: rotation fixes.

Fixed 90/270 degree rotation.
Fixed clipping for multi-source setup.
Fixed thread racing condition.
Also adds 8-pixel source stride check.

Change-Id: Ie7a83c738079a5930259ec520cc78970c69109f5
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
gcx: bump version to 2.1.2

Change-Id: I97c3c17e6b1cb74f110bd15c4c61bcf031c91b57
Signed-off-by: Craig Stout <craig.stout@ti.com>