OMAP4: PM: errata: Wkup clk recycling needed after warm reset.

As W/A the call to omap4_trigger_ioctrl() has been added
at PM initialization time for I/O pads daisy chain reseting.

TI EID: i612; IMPACTED: OMAP4430 all revisions

Change-Id: Ifff5cf4ed79e15bbeed97dd2b1cc7d7cf19d2387
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Conflicts:
	arch/arm/mach-omap2/pm44xx.c
OMAP4: PM: Enforce CPU0 waking from OFF/OSWR first for GP devices also

Note:
Patch with change Id I82c5880ec2d9a98a54755dfbd01aa981cfed9852
introduced this work around by default for all HS devices using PPA
version 1.6.4 or older.

It is determined that for GP devices the same workaround should be employed.

Change-Id: I3d307d7e6a9fb4532bd3017c0a452de8f612b314
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
Signed-off-by: Carlos Leija <cileija@ti.com>
ARM: OMAP4: Report clock module timeouts when enabling

When a clock module is enabled, we wait for the idle-status to indicate that
the module is now enabled before continuing. Although the current code returns
an error if the idle-status does not change, we do not display any warning
message to the user. So print a message if the module idle-status does not
change as expected.

Change-Id: Ia6583174ac209f78aeecefc80cd9872d899246a2
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
ARM: OMAP4: Only wait for module ready for clocks enabled via MODULEMODE

Some clocks are enabled by programming the MODULEMODE bit field of the PRCM
CLKCTRL registers. For these clocks, we should wait for the module to
transition from the idle state when we enable them. For other clocks, such as
optional clocks, that are enabled via other bits in the CLKCTRL registers, the
idle state is not updated when we enable them and so we should not wait for
the idle state to change when we enable them. This is causing unnecessary
delays to occur when enabling optional clocks as we are waiting for the idle
state to change and eventually timeout.

Change-Id: Iaa8a86d38a55b4faa95988c48e4bac0e772c7492
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Huzefa Kankroliwala <huzefank@ti.com>
usb: otg: OMAP4: Fix the omap4430_phy_set_clk function

If the clocks are enabled and we want to enable them again
omap4430_phy_set_clk disables them.

Fix this - so now if we try to enable already enabled clocks
it works correctly.

Change-Id: I657e13651c908eaa7caf2fd4ff86028c50902fd6
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
OMAP4430: OPP/voltage: 1.2GHz needs different SR ntarget

nTarget value for 1.2GHz uses the nTarget efuse offset meant
for 1GHz. This can cause instabilities since the voltage levels
are lower than required for operating at 1.2GHz.

Since SR nTarget values are hooked to omap_volt_data structure and
Vnom for 1.2GHz is same as 1GHz, we need to ensure a uniquely
identifiable voltage for 1.2GHz to supply the right offset.
We do this by adding a 10mV step on top of 1GHz Vnom. This
additional step should have no impact as SmartReflex AVS will
adjust this to optimal voltage on enabling SR from Vnom in operation.

With the unique voltage entry in omap_volt_data for 1.2GHz, we
provide the right efuse offset for 1.2GHz and map the OPP entry
for 1.2GHz to use this "OPPNITROSB" voltage. This will allow
voltage and SmartReflex AVS mapping back to the right nTarget
offsets + adjust voltage to the correct optimal voltage levels
for 1.2GHz.

Change-Id: I1e8d0efa46cfb5d6db1b54ef5fc323d0b7877fef
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
OMAP4:PM: Remove redundant SR disable call

SR disable is getting called twice in a row. This
patch removes the redundant call.

Change-Id: I7010347a24186d6abc693270d610482a36b6c7b8
Signed-off-by: Girish S G <girishsg@ti.com>
Reported-by: Bour Vincent <v-bour@ti.com>
ARM: OMAP4430: PM: errata i625, WUGEN lost for GP devices after OFF mode

This patch implements errata i625.

When coming back from device off mode, the Cortex-A9 WUGEN enable registers
are not restored by ROM code. The work around disables device power OFF
to maintain the proper register settings.
The affected devices are OMAP4430GP ES2.0 to ES2.2.

Change-Id: I6621c7a28d6657ec67d1af2b4a23b777b25510db
Signed-off-by: Mykola Oleksiienko <x0174904@ti.com>
Signed-off-by: K.Shlyakhovoy <x0155534@ti.com>
OMAP4: PM: Fix L3INSTR/IVAHD save/restore context logic

The L3INSTR/IVAHD contexts are restored
when MPU is going through both OSWR and OFF states
on HS/EMU devices (not only OFF state).

Change-Id: I516a9e88932485f6d77c529602647f7199fa7212
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
OMAP: PM: Fix the build error when SmartReflex is not selected

Fix a build error when Smart Reflex is not selected in kernel
configuration.

Corrected the api definition in header to add the omap_volt_data to
omap_sr_enable in the else of the CONFIG_OMAP_SMARTREFLEX.

Change-Id: I552c9092afcf00a9ac6f45402a2f4414890f87fc
Signed-off-by: Mohan V <mohanv@ti.com>
Fix build