OMAP4 crypto: Add support for omap4 hardware dm-crypt

Add the omap4 crypto driver from Trusted Logic, ported to 2.6.39,
and much code removed as we don't intend to run with the protected
app.

Change-Id: I176b27a222b7295b838a954e9b7f5397b23683be
Signed-off-by: Ken Sumrall <ksumrall@android.com>

Conflicts:
	security/Makefile
Revert "OMAP4 crypto: Add support for omap4 hardware dm-crypt"

Introduce new SMC driver, hence revert initial port.

This reverts commit 0abccad7be06f2698b03097f7fd528163f28de56.

Change-Id: Iddbb9cab1d3e6fabc2d59f36a4422c429acaef7a
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>

Conflicts:
	security/Makefile
OMAP4: SMC: 01.04 P6 Release

This patch is to port SMC 01.04 P6 Release for K3.0

Change-Id: Ia95fffd927b353eca3caf58bc4097eed97544705
Signed-off-by: Gonzalo Alexandre <alexandre.gonzalo@trusted-logic.com>
Signed-off-by: Florian Sylvestre <florian.sylvestre@trusted-logic.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>

Conflicts:
	arch/arm/mach-omap2/omap4-common.c
	security/Kconfig
	security/Makefile
OMAP4: SMC: Make print of allocation size clearer

Add 0x in front of hex value being printed.

Change-Id: Ia1e851077217ad20b29c4746bef69ae2dcf29c77
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: Fix MMU during invoke

During invoke command, fix a memory mapping issue. l2 descriptor to page.

Change-Id: Ib8146e5f1ffcc50489c2f1699285e719b5440ff0
Signed-off-by: Gonzalo Alexandre <alexandre.gonzalo@trusted-logic.com>
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: Correct a spinlock during rpc_execute

Change-Id: Ia87a536468a57256fb24de60e3782142825bd6aa
Signed-off-by: Gonzalo Alexandre <alexandre.gonzalo@trusted-logic.com>
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: Introduce Tee Client Driver

Change-Id: I63061d2ca811493bce0443f28978155bd61c53e7
Signed-off-by: Gonzalo Alexandre <alexandre.gonzalo@trusted-logic.com>
Signed-off-by: Florian Sylvestre <florian.sylvestre@trusted-logic.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: Introduce ION Handler

Change-Id: I5b60b02771ca56c9296a41f813c7807599904384
Signed-off-by: Gonzalo Alexandre <alexandre.gonzalo@trusted-logic.com>
Signed-off-by: Florian Sylvestre <florian.sylvestre@trusted-logic.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: add rproc interface for calling smc services

A thin wrapper is added to provide the interface for the rproc
driver to call into the SMC services. These services basically
allow the M3 image to be authenticated and have either the
firewalls installed or uninstalled.

Change-Id: I5d0bac6a5d73c28e1deb6a7c9e486de011842b79
Signed-off-by: Suman Anna <s-anna@ti.com>

Conflicts:
	include/linux/rproc_drm.h
omap4: smc: fix rproc_drm license

rproc_drm.c is wrongly licensed, should be GPLv2 licensed.

Change-Id: I9e94203d0797ed7624634fc290b35253f3de3329
Signed-off-by: Suman Anna <s-anna@ti.com>
OMAP4: SMC: Correct smc_l4_sec_clkdm_use_count decrement

tf_wake_lock_count and smc_l4_sec_clkdm_use_count were being decremented
incorrectly, thus never going to lower power states.

Change-Id: I749ec1b65d3e791e6dd19203e336e35528126ef5
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: remove group id check within SMC driver

Previously the driver will only allow the SMC daemon to start by the
kernel or a gid of 0. We remove this gid check and rely on the linux device
node access permissions.

Change-Id: Iaf2747c6f58a722f7668f9a5ad3ea7177c1233bf
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
OMAP4: SMC: enable smc instruction for newer binutils

New assemblers need -march=armv7-a+sec on command line or
.arch_extension sec inline to enable use of the smc
instruction.

Change-Id: I0eb3cc2c5ed20feeae3bcf7ba1bf396075fac94b
Signed-off-by: Dima Zavin <dima@android.com>