From 010e51b58593757dbc7eee96d63a3fdd8b6b65dc Mon Sep 17 00:00:00 2001 From: Sharon Topaz Date: Tue, 29 Oct 2024 16:49:29 +0200 Subject: [PATCH] [SPI,dv] Set strong drive strength and fast slew rate for SPI device pads This is a cherry pick of commit 1f8d77f413b3cb204ea202daa07d578c118c66de to branch earlgrey_1.0.0. Signed-off-by: Sharon Topaz --- sw/device/tests/BUILD | 1 + sw/device/tests/spi_device_tpm_tx_rx_test.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sw/device/tests/BUILD b/sw/device/tests/BUILD index 428a4ade4260a3..ecb10ca44d50e5 100644 --- a/sw/device/tests/BUILD +++ b/sw/device/tests/BUILD @@ -3294,6 +3294,7 @@ opentitan_test( "//sw/device/lib/runtime:irq", "//sw/device/lib/runtime:log", "//sw/device/lib/testing:isr_testutils", + "//sw/device/lib/testing:spi_device_testutils", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/lib/testing/test_framework:status", ], diff --git a/sw/device/tests/spi_device_tpm_tx_rx_test.c b/sw/device/tests/spi_device_tpm_tx_rx_test.c index 440dd74b718b06..2cdc01a54b294b 100644 --- a/sw/device/tests/spi_device_tpm_tx_rx_test.c +++ b/sw/device/tests/spi_device_tpm_tx_rx_test.c @@ -11,6 +11,7 @@ #include "sw/device/lib/runtime/hart.h" #include "sw/device/lib/runtime/irq.h" #include "sw/device/lib/runtime/log.h" +#include "sw/device/lib/testing/spi_device_testutils.h" #include "sw/device/lib/testing/test_framework/check.h" #include "sw/device/lib/testing/test_framework/ottf_main.h" #include "sw/device/lib/testing/test_framework/status.h" @@ -155,6 +156,9 @@ bool test_main(void) { &out_attr)); } + // Configure fast slew rate and strong drive strength for SPI device pads. + CHECK_STATUS_OK(spi_device_testutils_configure_pad_attrs(&pinmux)); + CHECK_DIF_OK( dif_spi_device_tpm_configure(&spi_device, kDifToggleEnabled, kTpmConfig));