Skip to content

Commit d592d6a

Browse files
committed
MA-23233-2 Load SRM before loading kernel
Because if device support hdcp, hdcp will be enabled when display initialize successfully, so the srm need to be loaded before Android UI ready. Change-Id: I629afa7ec2d5f7f165289fed4939f3f8f232f974 Signed-off-by: He Zhai <[email protected]>
1 parent f6bc9fb commit d592d6a

File tree

8 files changed

+23
-0
lines changed

8 files changed

+23
-0
lines changed

arch/arm/mach-imx/Kconfig

+6
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,12 @@ config VPU_SECURE_HEAP
451451
to linux. It is only used by imx8qm.
452452
default n
453453

454+
config IMX_SUPPORT_SRM
455+
bool "Support SRM feature"
456+
help
457+
Let trusty to load srm before loading kernel.
458+
default n
459+
454460
endmenu
455461

456462
config APPEND_BOOTARGS

configs/imx8mq_evk_android_trusty_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,4 @@ CONFIG_ATTESTATION_ID_MODEL="EVK_8MQ"
212212
CONFIG_CMD_ERASEENV=y
213213
CONFIG_DM_RNG=y
214214
CONFIG_KASLR=y
215+
CONFIG_IMX_SUPPORT_SRM=y

configs/imx8mq_evk_android_trusty_dual_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,4 @@ CONFIG_DUAL_BOOTLOADER=y
211211
CONFIG_CMD_ERASEENV=y
212212
CONFIG_DM_RNG=y
213213
CONFIG_KASLR=y
214+
CONFIG_IMX_SUPPORT_SRM=y

configs/imx8mq_evk_android_trusty_secure_unlock_dual_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,4 @@ CONFIG_CMD_DEKBLOB=y
217217
CONFIG_CMD_PRIBLOB=y
218218
CONFIG_DM_RNG=y
219219
CONFIG_KASLR=y
220+
CONFIG_IMX_SUPPORT_SRM=y

drivers/fastboot/fb_fsl/fb_fsl_boot.c

+4
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,10 @@ int do_boota(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) {
11161116

11171117
/* populate secretkeeper public key */
11181118
trusty_populate_sk_key((void *)(ulong)fdt_addr);
1119+
1120+
#ifdef CONFIG_IMX_SUPPORT_SRM
1121+
hwcrypto_load_srm();
1122+
#endif
11191123
#endif
11201124

11211125
/* Dump image info */

include/interface/hwcrypto/hwcrypto.h

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ enum hwcrypto_command {
5454
HWCRYPTO_GET_BOOTLOADER_DEK_BLOB = (16 << HWCRYPTO_REQ_SHIFT),
5555
HWCRYPTO_GET_BOOTLOADER_DEK_BLOB_SIZE = (17 << HWCRYPTO_REQ_SHIFT),
5656
HWCRYPTO_PROVISION_SRM = (18 << HWCRYPTO_REQ_SHIFT),
57+
HWCRYPTO_LOAD_SRM = (19 << HWCRYPTO_REQ_SHIFT),
5758
};
5859

5960
/**

include/trusty/hwcrypto.h

+3
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,7 @@ int hwcrypto_get_dek_blob(char *data, uint32_t *data_size, enum dek_blob_part);
121121
/* Send request to secure side to provision srm
122122
* */
123123
int hwcrypto_provision_srm(const char *data, uint32_t data_size);
124+
/* Send request to secure side to load SRM
125+
* */
126+
int hwcrypto_load_srm(void);
124127
#endif /* TRUSTY_HWCRYPTO_H_ */

lib/trusty/ql-tipc/hwcrypto.c

+6
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,12 @@ int hwcrypto_provision_srm(const char *data, uint32_t data_size)
541541
return rc;
542542
}
543543

544+
int hwcrypto_load_srm(void)
545+
{
546+
int rc = hwcrypto_do_tipc(HWCRYPTO_LOAD_SRM, NULL, 0, NULL, 0);
547+
return rc;
548+
}
549+
544550
int hwcrypto_get_dek_blob(char *data, uint32_t *data_size, enum dek_blob_part part)
545551
{
546552
uint32_t dek_blob_size = 0, tmp = 0;

0 commit comments

Comments
 (0)