diff --git a/drivers/crypto/crypto_npcx_sha.c b/drivers/crypto/crypto_npcx_sha.c index e2420134cfa..26403599360 100644 --- a/drivers/crypto/crypto_npcx_sha.c +++ b/drivers/crypto/crypto_npcx_sha.c @@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(sha_npcx, CONFIG_CRYPTO_LOG_LEVEL); #define NPCX_HASH_CAPS_SUPPORT (CAP_SEPARATE_IO_BUFS | CAP_SYNC_OPS) -#define NPCX_SHA256_HANDLE_SIZE 212 +#define NPCX_SHA256_HANDLE_SIZE DT_INST_PROP(0, context_buffer_size) #define NPCX_SHA_MAX_SESSION 1 /* The status code returns from Nuvoton Cryptographic Library ROM APIs */ diff --git a/dts/arm/nuvoton/npcx/npcx4.dtsi b/dts/arm/nuvoton/npcx/npcx4.dtsi index 56adb416d01..54616fbeed4 100644 --- a/dts/arm/nuvoton/npcx/npcx4.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4.dtsi @@ -292,6 +292,7 @@ sha0: sha@13c { compatible = "nuvoton,npcx-sha"; reg = <0x13c 0x3c>; + context-buffer-size = <228>; status = "disabled"; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx9.dtsi b/dts/arm/nuvoton/npcx/npcx9.dtsi index 18a1278de57..4d0cb7dc69e 100644 --- a/dts/arm/nuvoton/npcx/npcx9.dtsi +++ b/dts/arm/nuvoton/npcx/npcx9.dtsi @@ -269,6 +269,7 @@ sha0: sha@13c { compatible = "nuvoton,npcx-sha"; reg = <0x13c 0x3c>; + context-buffer-size = <212>; status = "disabled"; }; }; diff --git a/dts/bindings/crypto/nuvoton,npcx-sha.yaml b/dts/bindings/crypto/nuvoton,npcx-sha.yaml index 2670855d45b..237490840ad 100644 --- a/dts/bindings/crypto/nuvoton,npcx-sha.yaml +++ b/dts/bindings/crypto/nuvoton,npcx-sha.yaml @@ -10,3 +10,10 @@ include: base.yaml properties: reg: required: true + + context-buffer-size: + type: int + required: true + description: | + Size of the pre-allocated buffer for the SHA ROM API to store the + intermdiate computation result and final digest.