drivers: stm32_reset adapt interface to timeout argument

Changes stm32mp1 reset driver to API to add a timeout argument
to stm32mp_reset_assert() and stm32mp_reset_deassert() and
a return value.

With a supplied timeout, the functions wait the target reset state
is reached before returning. With a timeout of zero, the functions
simply load target reset state in SoC interface and return without
waiting.

Helper functions stm32mp_reset_set() and stm32mp_reset_release()
use a zero timeout and return without a return code.

This change updates few stm32 drivers and plat/stm32mp1 blé_plat_setup.c
accordingly without any functional change.
functional change.

Change-Id: Ia1a73a15125d3055fd8739c125b70bcb9562c27f
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
index 652765c..e09ce63 100644
--- a/plat/st/stm32mp1/bl2_plat_setup.c
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
@@ -31,6 +31,8 @@
 #include <stm32mp1_context.h>
 #include <stm32mp1_dbgmcu.h>
 
+#define RESET_TIMEOUT_US_1MS		1000U
+
 static console_t console;
 static struct stm32mp_auth_ops stm32mp1_auth_ops;
 
@@ -263,9 +265,18 @@
 
 	stm32mp_clk_enable((unsigned long)dt_uart_info.clock);
 
+	if (stm32mp_reset_assert((uint32_t)dt_uart_info.reset,
+				 RESET_TIMEOUT_US_1MS) != 0) {
+		panic();
+	}
+
-	stm32mp_reset_assert((uint32_t)dt_uart_info.reset);
 	udelay(2);
-	stm32mp_reset_deassert((uint32_t)dt_uart_info.reset);
+
+	if (stm32mp_reset_deassert((uint32_t)dt_uart_info.reset,
+				   RESET_TIMEOUT_US_1MS) != 0) {
+		panic();
+	}
+
 	mdelay(1);
 
 	clk_rate = stm32mp_clk_get_rate((unsigned long)dt_uart_info.clock);