bdk: se: add T210 SHA256 silicon errata WAR
Apparently, some T210 silicon have an undocumented errata where the MSG_LEFT2/3 registers are not ignored as they should. When they have random data in POR they cause a hang as long as the message and SHA calculation speed. So always clear them. Additionally, clear MSG_LENGTH2/3 registers too even though they do not matter.
This commit is contained in:
@@ -512,10 +512,14 @@ static int _se_sha_hash_256(void *hash, u64 total_size, const void *src, u32 src
|
||||
// Set total size: BITS(total_size), up to 2 EB.
|
||||
SE(SE_SHA_MSG_LENGTH_0_REG) = (u32)(total_size << 3);
|
||||
SE(SE_SHA_MSG_LENGTH_1_REG) = (u32)(total_size >> 29);
|
||||
SE(SE_SHA_MSG_LENGTH_2_REG) = 0;
|
||||
SE(SE_SHA_MSG_LENGTH_3_REG) = 0;
|
||||
|
||||
// Set leftover size: BITS(src_size).
|
||||
SE(SE_SHA_MSG_LEFT_0_REG) = (u32)(msg_left << 3);
|
||||
SE(SE_SHA_MSG_LEFT_1_REG) = (u32)(msg_left >> 29);
|
||||
SE(SE_SHA_MSG_LEFT_2_REG) = 0;
|
||||
SE(SE_SHA_MSG_LEFT_3_REG) = 0;
|
||||
|
||||
// Set config based on init or partial continuation.
|
||||
if (total_size == src_size || !total_size)
|
||||
|
||||
Reference in New Issue
Block a user