Skip to content

Commit

Permalink
plat-ti: Add support for using HUK on DRA7xx/AM57xx
Browse files Browse the repository at this point in the history
On DRA7xx/AM57xx the initial secure software will pass OP-TEE a
Hardware Unique Key (HUK), use this key when requested.

Signed-off-by: Andrew F. Davis <afd@ti.com>
  • Loading branch information
glneo committed Apr 21, 2017
1 parent d25dd27 commit 33cd878
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/arch/arm/plat-ti/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $(call force,CFG_PL310_LOCKED,y)
$(call force,CFG_SECURE_TIME_SOURCE_REE,y)
arm32-platform-cpuarch := cortex-a9
else
$(call force,CFG_OTP_SUPPORT,y)
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y)
$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y)
arm32-platform-cpuarch := cortex-a15
Expand Down
22 changes: 22 additions & 0 deletions core/arch/arm/plat-ti/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <kernel/misc.h>
#include <kernel/mutex.h>
#include <kernel/tee_time.h>
#include <kernel/tee_common_otp.h>
#include <mm/core_mmu.h>
#include <mm/core_memprot.h>
#include <tee/entry_std.h>
Expand Down Expand Up @@ -175,3 +176,24 @@ void console_init(void)
CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE);
register_serial_console(&console_data.chip);
}

#if defined(CFG_OTP_SUPPORT)

void tee_otp_get_hw_unique_key(struct tee_hw_unique_key *hwkey)
{
memcpy(&hwkey->data[0], &plat_huk[0], sizeof(hwkey->data));
}

/* TODO */
int tee_otp_get_die_id(uint8_t *buffer, size_t len)
{
size_t i;

char pattern[4] = { 'B', 'E', 'E', 'F' };
for (i = 0; i < len; i++)
buffer[i] = pattern[i % 4];

return 0;
}

#endif

0 comments on commit 33cd878

Please sign in to comment.