From 5936d9bad40dfd6268728e700770ffcf656d0e3f Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 15 Jan 2026 19:09:34 +0200 Subject: [PATCH] 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. --- bdk/sec/se.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bdk/sec/se.c b/bdk/sec/se.c index 80031f19..ceabd8ca 100644 --- a/bdk/sec/se.c +++ b/bdk/sec/se.c @@ -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)