summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormyfluxi <linflux@arcor.de>2015-11-04 00:46:09 +0100
committerSteve Kondik <steve@cyngn.com>2015-11-04 14:38:45 -0800
commitc12b0cc7fd9ab0521fdf0f355bd28c6f2f7c18a3 (patch)
tree8d9c132452ef6eeadbfcd42541b0cc6bfd44cec0
parent9093ff000a224fec6258013d1a6de4a1816d1b33 (diff)
downloadandroid_hardware_qcom_keymaster-c12b0cc7fd9ab0521fdf0f355bd28c6f2f7c18a3.tar.gz
android_hardware_qcom_keymaster-c12b0cc7fd9ab0521fdf0f355bd28c6f2f7c18a3.tar.bz2
android_hardware_qcom_keymaster-c12b0cc7fd9ab0521fdf0f355bd28c6f2f7c18a3.zip
keymaster: Featureize support for waiting on QSEE to start
New devices need to wait for QSEE to load the Keymaster into TZ. This is signalled by a property being set by qseecomd. Unfortunately we don't have a good way to determine if this is the case for a particular device, so make it opt-in. Set TARGET_KEYMASTER_WAIT_FOR_QSEE=true for this behavior. Change-Id: I99839b82fdd8ab6550a95e2676a5da03eccfe288
-rw-r--r--Android.mk3
-rw-r--r--keymaster_qcom.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 8f474c2..90bd8ab 100644
--- a/Android.mk
+++ b/Android.mk
@@ -12,6 +12,9 @@ ifeq ($(TARGET_BOARD_PLATFORM),msm8084)
keymaster-def += -D_ION_HEAP_MASK_COMPATIBILITY_WA
endif
endif
+ifeq ($(TARGET_KEYMASTER_WAIT_FOR_QSEE),true)
+LOCAL_CFLAGS += -DWAIT_FOR_QSEE
+endif
include $(CLEAR_VARS)
diff --git a/keymaster_qcom.cpp b/keymaster_qcom.cpp
index 98ca034..5856322 100644
--- a/keymaster_qcom.cpp
+++ b/keymaster_qcom.cpp
@@ -767,12 +767,16 @@ static int qcom_km_open(const hw_module_t* module, const char* name,
dev->context = (void *)km_handle;
while (attempt_num < MAX_PROPERTY_GET_ATTEMPTS)
{
+#ifdef WAIT_FOR_QSEE
property_get("sys.keymaster.loaded", property_val, "");
if (strncmp(property_val, "true", sizeof(property_val)) == 0)
{
+#endif
ALOGD("keymaster app is loaded");
break;
+#ifdef WAIT_FOR_QSEE
}
+#endif
if (attempt_num == 0)
ALOGE("keymaster app is not loaded, attempt number %d", attempt_num);
attempt_num++;