driver: serial: stm32u5: DMAT Errata behavior valid only on some SoCs
Workaround for DMAT errata was applied on all SoCs declaring STM32U5 DMA compatible. This errata has been fixed in later SoCs revisions and should not be applied anymore as this can cause compatibility issues with power mgmt (can not enter STOP1 in some cases). Declare a specific Kconfig symbol to restrict the workaround only to the set of SoCs impacted by the issue and requiring workaround. Note that I preferred using Kconfig over device tree since it doesn't feel right to declare a compatible on a silicon bug base. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This commit is contained in:
parent
c47880af0d
commit
d7513fb526
2 changed files with 19 additions and 4 deletions
|
@ -1321,7 +1321,7 @@ static inline void uart_stm32_dma_tx_enable(const struct device *dev)
|
|||
|
||||
static inline void uart_stm32_dma_tx_disable(const struct device *dev)
|
||||
{
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32u5_dma)
|
||||
#ifdef CONFIG_UART_STM32U5_ERRATA_DMAT
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
/*
|
||||
|
@ -1333,7 +1333,7 @@ static inline void uart_stm32_dma_tx_disable(const struct device *dev)
|
|||
const struct uart_stm32_config *config = dev->config;
|
||||
|
||||
LL_USART_DisableDMAReq_TX(config->usart);
|
||||
#endif /* ! st_stm32u5_dma */
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void uart_stm32_dma_rx_enable(const struct device *dev)
|
||||
|
@ -1633,9 +1633,9 @@ static int uart_stm32_async_tx_abort(const struct device *dev)
|
|||
data->dma_tx.counter = tx_buffer_length - stat.pending_length;
|
||||
}
|
||||
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32u5_dma)
|
||||
#ifdef CONFIG_UART_STM32U5_ERRATA_DMAT
|
||||
dma_suspend(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
|
||||
#endif /* st_stm32u5_dma */
|
||||
#endif
|
||||
dma_stop(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
|
||||
async_evt_tx_abort(data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue