summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorHyung Taek Ryoo <hryoo@nvidia.com>2012-12-03 17:46:13 -0800
committerMrutyunjay Sawant <msawant@nvidia.com>2012-12-04 22:30:13 -0800
commit19fb69f8325c4ebe2e846dc7dd5d91d9a3e2c3d0 (patch)
tree695fef2773549e7a68f692cd08711fd5532b4e5d /security
parentbc8eb78820818a735ddbde83890b778f66e2f2c4 (diff)
security: tf_driver: integrate latest TL release
Tegra4 version: TF_TEGRA4_AC02.02.39373 Create a new SMC (0xFFFFFFE7) for no flush operations in cluster power down. Bug 969937 Change-Id: Ie91d1ab2560ab56ee9ca2c8f35757a9bb5222c26 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/168212 Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'security')
-rw-r--r--security/tf_driver/Kconfig6
-rw-r--r--security/tf_driver/Makefile8
-rw-r--r--security/tf_driver/s_version.h53
-rw-r--r--security/tf_driver/tf_conn.c6
-rw-r--r--security/tf_driver/tf_teec.c1
-rw-r--r--security/tf_driver/tf_util.c15
-rw-r--r--security/tf_driver/tf_util.h2
7 files changed, 61 insertions, 30 deletions
diff --git a/security/tf_driver/Kconfig b/security/tf_driver/Kconfig
index 2a980c5ade43..82203c3eeadf 100644
--- a/security/tf_driver/Kconfig
+++ b/security/tf_driver/Kconfig
@@ -1,8 +1,8 @@
config TRUSTED_FOUNDATIONS
bool "Enable TF Driver"
default n
- select CRYPTO_SHA1
+ select CRYPTO_SHA1
help
This option adds kernel support for communication with the Trusted Foundations.
- If you are unsure how to answer this question, answer N.
-
+ Default options is n
+ If you are unsure how to answer this question, answer N. \ No newline at end of file
diff --git a/security/tf_driver/Makefile b/security/tf_driver/Makefile
index 2261b1f99886..9cf49e27507e 100644
--- a/security/tf_driver/Makefile
+++ b/security/tf_driver/Makefile
@@ -19,12 +19,12 @@
#
# debug options
-#EXTRA_CFLAGS += -O0 -DDEBUG -D_DEBUG -DCONFIG_TF_DRIVER_DEBUG_SUPPORT
-EXTRA_CFLAGS += -DNDEBUG
-EXTRA_CFLAGS += -DLINUX -DCONFIG_TF_TRUSTZONE -DCONFIG_TFN -DCONFIG_SECURE_TRACES -DCONFIG_TF_TEEC
+#ccflags-y += -O0 -DDEBUG -D_DEBUG -DCONFIG_TF_DRIVER_DEBUG_SUPPORT
+ccflags-y += -DNDEBUG
+ccflags-y += -DLINUX -DCONFIG_TF_TRUSTZONE -DCONFIG_TFN -DCONFIG_SECURE_TRACES -DCONFIG_TF_TEEC
ifdef S_VERSION_BUILD
-EXTRA_CFLAGS += -DS_VERSION_BUILD=$(S_VERSION_BUILD)
+ccflags-y += -DS_VERSION_BUILD=$(S_VERSION_BUILD)
endif
tf_driver-objs += tf_util.o
diff --git a/security/tf_driver/s_version.h b/security/tf_driver/s_version.h
index 232331672d3a..63b186591234 100644
--- a/security/tf_driver/s_version.h
+++ b/security/tf_driver/s_version.h
@@ -20,6 +20,8 @@
#ifndef __S_VERSION_H__
#define __S_VERSION_H__
+#include "linux/stringify.h"
+
/*
* Usage: define S_VERSION_BUILD on the compiler's command line.
*
@@ -32,21 +34,44 @@
* - S_VERSION_BUILD = 0 if S_VERSION_BUILD not defined or empty
*/
-#define S_VERSION_OS "A" /* "A" for all Android */
-#define S_VERSION_PLATFORM "C" /* "C" for Tegra4 */
+
/*
- * This version number must be updated for each new release
+ * This version number must be updated for each new release.
+ *
+ * If this is a patch or engineering version use the following
+ * defines to set the version number. Else set these values to 0.
*/
-#define S_VERSION_MAIN "02.01"
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
+#define S_VERSION_OS "A" /* "A" for all Android */
+#define S_VERSION_PLATFORM "A"
+#define S_VERSION_MAIN "01.11"
+#define S_VERSION_ENG 0
+#define S_VERSION_PATCH 0
-/*
-* If this is a patch or engineering version use the following
-* defines to set the version number. Else set these values to 0.
-*/
+#elif defined(CONFIG_ARCH_TEGRA_3x_SOC)
+#define S_VERSION_OS "A" /* "A" for all Android */
+#define S_VERSION_PLATFORM "B"
+#define S_VERSION_MAIN "02.02"
#define S_VERSION_ENG 0
#define S_VERSION_PATCH 0
+#elif defined(CONFIG_ARCH_TEGRA_11x_SOC)
+#define S_VERSION_OS "A" /* "A" for all Android */
+#define S_VERSION_PLATFORM "C"
+#define S_VERSION_MAIN "02.02"
+#define S_VERSION_ENG 0
+#define S_VERSION_PATCH 0
+
+#else
+#define S_VERSION_OS "Z" /* Unknown platform */
+#define S_VERSION_PLATFORM "Z" /* Unknown platform */
+#define S_VERSION_MAIN "00.00"
+#define S_VERSION_ENG 0
+#define S_VERSION_PATCH 0
+#endif
+
+
#ifdef S_VERSION_BUILD
/* TRICK: detect if S_VERSION is defined but empty */
#if 0 == S_VERSION_BUILD-0
@@ -58,17 +83,15 @@
#define S_VERSION_BUILD 0
#endif
-#define __STRINGIFY(X) #X
-#define __STRINGIFY2(X) __STRINGIFY(X)
#if S_VERSION_ENG != 0
-#define _S_VERSION_ENG "e" __STRINGIFY2(S_VERSION_ENG)
+#define _S_VERSION_ENG "e" __stringify(S_VERSION_ENG)
#else
#define _S_VERSION_ENG ""
#endif
#if S_VERSION_PATCH != 0
-#define _S_VERSION_PATCH "p" __STRINGIFY2(S_VERSION_PATCH)
+#define _S_VERSION_PATCH "p" __stringify(S_VERSION_PATCH)
#else
#define _S_VERSION_PATCH ""
#endif
@@ -79,14 +102,14 @@
#define S_VERSION_VARIANT " "
#endif
-#define S_VERSION_STRING \
+#define S_VERSION_STRING (\
"TFN" \
S_VERSION_OS \
S_VERSION_PLATFORM \
S_VERSION_MAIN \
_S_VERSION_ENG \
_S_VERSION_PATCH \
- "." __STRINGIFY2(S_VERSION_BUILD) " " \
- S_VERSION_VARIANT
+ "." __stringify(S_VERSION_BUILD) " " \
+ S_VERSION_VARIANT)
#endif /* __S_VERSION_H__ */
diff --git a/security/tf_driver/tf_conn.c b/security/tf_driver/tf_conn.c
index 781d2db32eee..6808f5485b27 100644
--- a/security/tf_driver/tf_conn.c
+++ b/security/tf_driver/tf_conn.c
@@ -1656,6 +1656,11 @@ void tf_close(struct tf_connection *connection)
*/
tf_cleanup_shared_memories(connection);
+#ifdef CONFIG_TF_ION
+ if (connection->ion_client != NULL)
+ ion_client_destroy(connection->ion_client);
+#endif
+
spin_lock(&(connection->dev->connection_list_lock));
list_del(&(connection->list));
spin_unlock(&(connection->dev->connection_list_lock));
@@ -1668,4 +1673,3 @@ error:
dprintk(KERN_DEBUG "tf_close(%p) failed with error code %d\n",
connection, error);
}
-
diff --git a/security/tf_driver/tf_teec.c b/security/tf_driver/tf_teec.c
index 38240e2b25b9..4b772215665d 100644
--- a/security/tf_driver/tf_teec.c
+++ b/security/tf_driver/tf_teec.c
@@ -378,7 +378,6 @@ void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem)
if (sharedMem->imp._allocated) {
if (sharedMem->buffer != TEEC_POINTER_TO_ZERO_SIZED_BUFFER)
internal_vfree(sharedMem->buffer);
-
sharedMem->buffer = NULL;
sharedMem->size = 0;
}
diff --git a/security/tf_driver/tf_util.c b/security/tf_driver/tf_util.c
index 936f8e16c247..303a5edefc03 100644
--- a/security/tf_driver/tf_util.c
+++ b/security/tf_driver/tf_util.c
@@ -670,23 +670,28 @@ static inline u32 rol(u32 value, u32 bits)
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
#define R0(v, w, x, y, z, i) do { \
z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \
- w = rol(w, 30); } while (0)
+ w = rol(w, 30); } \
+ while (0)
#define R1(v, w, x, y, z, i) do { \
z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \
- w = rol(w, 30); } while (0)
+ w = rol(w, 30); } \
+ while (0)
#define R2(v, w, x, y, z, i) do { \
z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \
- w = rol(w, 30); } while (0)
+ w = rol(w, 30); } \
+ while (0)
#define R3(v, w, x, y, z, i) do { \
z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \
- w = rol(w, 30); } while (0)
+ w = rol(w, 30); } \
+ while (0)
#define R4(v, w, x, y, z, i) do { \
z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \
- w = rol(w, 30); } while (0)
+ w = rol(w, 30); } \
+ while (0)
/* Hash a single 512-bit block. This is the core of the algorithm. */
diff --git a/security/tf_driver/tf_util.h b/security/tf_driver/tf_util.h
index 2fabf0127a2f..972aa7259299 100644
--- a/security/tf_driver/tf_util.h
+++ b/security/tf_driver/tf_util.h
@@ -55,7 +55,7 @@ void address_cache_property(unsigned long va);
#define dpr_info(args...) ((void)(tf_debug_level >= 3 ? pr_info(args) : 0))
#define dpr_err(args...) ((void)(tf_debug_level >= 1 ? pr_err(args) : 0))
#define INFO(fmt, args...) \
- (void)dprintk(KERN_INFO "%s: " fmt "\n", __func__, ## args)
+ ((void)dprintk(KERN_INFO "%s: " fmt "\n", __func__, ## args))
#define WARNING(fmt, args...) \
(tf_debug_level >= 3 ? \
printk(KERN_WARNING "%s: " fmt "\n", __func__, ## args) : \