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-hsmmc: Implementation of i761 errata

Errata description:
Due to a bad behavior of an internal signal, the Card Error interrupt bit
MMCHS_STAT[28] CERR may not be set sometimes when an error occurred in the
card response.

Workaround:
After responses of type R1/R1b for all cards and responses of type R5/R5b/R6
for SD and SDIO cards, software must read two registers: MMCHS_RSP10 and
MMCHS_CSRE. When a MMCHS_CSRE[i] bit is set to 1, if the corresponding bit at
the same position in the response MMCHS_RSP10[i] is set to 1, the host
controller indicates a card error and software should proceed in the same way
as if a CERR interrupt would have been detected in the MMCHS_STAT register.

Note:
This errata is applicable for omap44xx.

Change-Id: Ib024bfb0624df04b7d6c61c129cbd9a34f919814
Signed-off-by: Semen Protsenko <semen.protsenko@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>
OMAPDSS: DSS: SyncLost WA for wb m2m-manager mode.

This is a workaround that prevents SYNC_LOST on changing pipe
channelout from manager which was used as a source of wb to
another manager. Manager could free pipes after wb will
send SYNC message but that will start wb capture. To prevent
that we reconnect the pipe from the manager to wb and do a
dummy enabling and disabling of wb - the pipe will be freed
and capture won't start because source pipe is switched off.

Change-Id: Ib4cfbb1854c92a2e507589fbe8cf00e5cb6831ca
Signed-off-by: Artem Rudenko <x0150883@ti.com>
OMAPDSS: OMAPFB : Add support for default display scaling.
OMAP4: HDMI : Support default display configuration for HDMI
OMAP4 : DSSCOMP : Avoid pushing content if no panel is active

Currently we push content on a blanked manager in case it is
default display. This causes a lot of logging in dsscomp call
back when we apply blank to manager.

Check added to see if any dss device is active and then only
push data to panel.

Change-Id: Idffd022e293949bfea260a01b96b8f6eff8327d3
Signed-off-by: Dandawate Saket <dsaket@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OMAP4: OMAPFB: Dont error if display is already ON

Dont error if display state is already ON.

Change-Id: Ibad859847f2edd19cf6cd0d285461c66ed43c9a2
Signed-off-by: Dandawate Saket <dsaket@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>