OMAP4: cpuidle: don't touch mpu and core state until CPU1 is off

MPU/Core logic and PD states shouldn't be changed until CPU1 is
completely off

Change-Id: Ia90126776e7bd7108c7b885c622df36323982cb0
Signed-off-by: Lianwei Wang <lian-wei.wang@motorola.com>
Signed-off-by: suilunlam <a0868997@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Linux 3.0.26
OMAP: MUSB: Fix for issue when booting with USB charger connected

Issue:
When the charger is disconnected after bootup, the device fails
to go into OFF mode.
Bug Details:
1. At the end of Gadget Driver probe pm_runtime_put()is not called in
case of charger/USB cable connected during bootup.
2. After bootup when we disconnect the charger, the disconnect handler
for USB_EVENT_NONE checks first if the disconnect was for charger.
If yes it returns without autosuspend else it call pm_runtime_autosuspend.
So because of this PM calls get imbalanced and system does not go to OFF.
Fix:
Logic at the end of the gadget probe function is fixed to prevent
the above problem.

Change-Id: Ief7daade9aed7460bd4d1d576c22024a419ddbda
Signed-off-by: Mantesh Sarashetti <mantesh@ti.com>
CC: Ruchika Kharwar <ruchika@ti.com>

Conflicts:

	drivers/usb/musb/musb_gadget.c
omap:musb:PHY powering time change to longer

This patch helps to avoid problems in coldboot stage with some
selfpowered hubs, like old belkin. Problem looks like this:

[ 1019.749084] usb 2-1: reset high speed USB device number 107 using musb-hdrc
[ 1034.881805] usb 2-1: device descriptor read/64, error -110
[ 1040.115386] usb 2-1: device descriptor read/64, error -19
[ 1043.303710] hub 2-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[ 1046.389648] hub 2-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[ 1049.475555] hub 2-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[ 1049.483459] usb 2-1: USB disconnect, device number 107
[ 1052.569366] hub 2-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[ 1055.655242] hub 2-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

At boot time DEVCTL register occasionaly change it's state from
IRQ host to IRQ device but musb->xceiv->state is still host what cause messages.
Problem caused transient processes caused powering after enabling clocks.

Powering on the phy need more time after enabling the internal phy clocks.
It was done because 300ms give us possibility to avoid problems caused transient
processes after powering that was found in the experimental practice
with a larger number of selfpowered hubs.

Also it should make work with chain of two selfpowered hubs more stable.

Change-Id: Ib0add65ab2be6fc2f0123538fb0b6447fa140f8b
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Andrii Danylov <x0158318@ti.com>
OMAP4: ERRATA: ARM: Fix ARM Errata 742230

Errata 742230: This Errata workaround requires bit 4 to be set in the CP15
diagnostic control register. This patch takes care of this errata fix for GP
devices at CPU init time and at the cpu_resume stage.

Change-Id: I5244bec9544fddc9fff33ca2903f5ec19bcc52a7
Signed-off-by: Ruchika Kharwar <ruchika@ti.com>

Conflicts:

	arch/arm/mach-omap2/Kconfig

Conflicts:

	arch/arm/mach-omap2/Kconfig
OMAP4: ERRATA: ARM: Fix ARM Errata 751472

Errata 751472: This Errata workaround requires bit 11 to be set in the CP15
diagnostic control register. This patch takes care of this errata fix for GP
devices at CPU init time and at the cpu_resume stage.

Change-Id: I3a8d2b825ac59719233275a77c5fbf5175b35bcb
Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
OMAP4: ERRATA: ARM: Fix ARM Errata 743622

Errata 743622: This Errata workaround requires bit 6 to be set in the CP15
diagnostic control register. This patch takes care of this errata fix for GP
devices at CPU init time and at the cpu_resume stage.

Change-Id: I6b9cf510ca631f74da4ce2f31c1190a2216aa5bb
Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
OMAP MUSB: Finish cherry-pick of 4e8fb4f