ARM: OMAP: Add Secure HAL and monitor mode API infrastructure.

On OMAP secure/emulation devices, certain APIs are exported by secure
code. Add an infrastructure so that relevant operations on secure
devices can be implemented using it.

While at this, rename omap44xx-smc.S to omap-smc.S since the common APIs
can be used on other OMAP's too.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>

Conflicts:
	arch/arm/mach-omap2/Makefile
ARM: OMAP4: Remove __INIT from omap_secondary_startup() to re-use it for hotplug.

Remove the __INIT from omap_secondary_startup() so that it can
be re-used for CPU hotplug.

While at this, remove the un-used AUXBOOT register reference.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP4: add omap-secure.h
ARM: OMAP2+: I2C: always compile I2C reset code, even if I2C driver is not built

During kernel init, we reset all IP blocks on the OMAP that we can,
even if there is no driver compiled for that IP block.  Unlike most IP
blocks, the I2C block requires some extra programming for this to
work.  This reset code is incorrectly omitted when the I2C driver is
deselected.  In this circumstance, the build breaks.  Fix by compiling
the I2C reset code unconditionally.

Problem reported by Russell King <linux@arm.linux.org.uk>.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: Shubhrajyoti <shubhrajyoti@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP2+: Fix Kconfig dependencies for USB_ARCH_HAS_EHCI

Otherwise we get:

warning: (ARCH_OMAP3 && ARCH_OMAP4) selects USB_ARCH_HAS_EHCI
which has unmet direct dependencies (USB_SUPPORT)

Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP2+: Fix OMAP_HDQ_BASE build error

If CONFIG_SOC_OMAP3430 is not set and CONFIG_HDQ_MASTER_OMAP
is selected for w1 driver we get the following error:

arch/arm/mach-omap2/devices.c:662:13: error:
'OMAP_HDQ_BASE' undeclared here (not in a function)

Looks like OMAP_HDQ_BASE is valid for all omaps except
2420, so we can remove the ifdef and not register
the device on 2420.

Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP2+: Fix board_mux section type conflict when OMAP_MUX is not set

Otherwise we can get:

arch/arm/mach-omap2/mux.h:249:31: error: board_mux causes a section type conflict

Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP2+: Fix zoom LCD backlight if TWL_CORE is not selected

Otherwise we get:

arch/arm/mach-omap2/board-zoom-display.c:64: undefined reference to `twl_i2c_read_u8'
arch/arm/mach-omap2/board-zoom-display.c:65: undefined reference to `twl_i2c_read_u8'
arch/arm/mach-omap2/board-zoom-display.c:84: undefined reference to `twl_i2c_write_u8'
arch/arm/mach-omap2/board-zoom-display.c:86: undefined reference to `twl_i2c_write_u8'
arch/arm/mach-omap2/board-zoom-display.c:91: undefined reference to `twl_i2c_write_u8'
arch/arm/mach-omap2/board-zoom-display.c:92: undefined reference to `twl_i2c_write_u8'
arch/arm/mach-omap2/board-zoom-display.c:72: undefined reference to `twl_i2c_write_u8'

Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP2+: Fix devexit for smartreflex when CONFIG_HOTPLUG is not set

Otherwise we get:

`omap_sr_remove' referenced in section `.data' of arch/arm/mach-omap2/built-in.o:
defined in discarded section `.devexit.text' of arch/arm/mach-omap2/built-in.o

Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP3+: SmartReflex: Add a shutdown hook

SmartReflex fix for erratum ID i724.

Since OMAP's VP and PRM modules do not get reset by warm reset,
we should ensure that proper shutdown procedure is followed prior
to allowing the kernel to reboot back up.

Without this, Smartreflex module might be left active or
system might be caught in an indeterminate sequence when
software controlled reboot is triggered, leaving the next
reboot behavior to be unpredictable.

In the case of hardware controlled warm reset such as that
by watchdog timer, prevention of this scenario is not possible.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: add missing platform_set_drvdata()

That's very useful to fetch the correct struct sr_info
from the PM handlers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: move late_initcall() closer to its argument

no functional changes, trivial patch.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: micro-optimization for sanity check

val && (val != 1) == val > 1

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API

The debugfs_create_* API returns a return code or NULL
in the return ptr in case of problem.
Fix the smartreflex code to take this into account.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: fix error handling

Fix the code to correctly use IS_ERR and PTR_ERR on the return
values pointers

Reported-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Revert "OMAP: DSS: Add device latency constraint"

This reverts commit 22accbf5e4be27132bd3576cda803a85d7c34c0c.
Revert "OMAP: DSS2: Fix callback completion issue in mgr->blank"

This reverts commit d04b061e570964c10c9cf5871b2f55de51cdeb4f.
Revert "OMAP: DSS2: Taal: Set first_vsync flag during panel poweron()"

This reverts commit 21f14eaa425d71fb5dad34a4177a874fa5f37c5c.