summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_stm32.c
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2018-05-17 14:50:43 +0200
committerTom Rini <trini@konsulko.com>2018-05-26 18:19:17 -0400
commitbe1a6f775e7615f93b7d9ef3bdbcbb335dbfea6e (patch)
treecae53c5afbd610fad7ce5f814d5574a66badbf53 /drivers/serial/serial_stm32.c
parent215c8bed126313afd8c3b978c95b35ce7252c9c7 (diff)
downloadu-boot-be1a6f775e7615f93b7d9ef3bdbcbb335dbfea6e.tar.gz
u-boot-be1a6f775e7615f93b7d9ef3bdbcbb335dbfea6e.tar.bz2
u-boot-be1a6f775e7615f93b7d9ef3bdbcbb335dbfea6e.zip
serial: stm32: Fix bits defines name
Rename USART_ISR_FLAG_xxx bits to USART_ISR_xxx bits and USART_ICR_OREF to USART_ICR_ORECF in order to match datasheets. Sort defines by descendant order. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial/serial_stm32.c')
-rw-r--r--drivers/serial/serial_stm32.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 724d6f9672..eeaa8ab050 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -54,12 +54,12 @@ static int stm32_serial_getc(struct udevice *dev)
fdt_addr_t base = plat->base;
u32 isr = readl(base + ISR_OFFSET(stm32f4));
- if ((isr & USART_ISR_FLAG_RXNE) == 0)
+ if ((isr & USART_ISR_RXNE) == 0)
return -EAGAIN;
- if (isr & USART_ISR_FLAG_ORE) {
+ if (isr & (USART_ISR_ORE)) {
if (!stm32f4)
- setbits_le32(base + ICR_OFFSET, USART_ICR_OREF);
+ setbits_le32(base + ICR_OFFSET, USART_ICR_ORECF);
else
readl(base + RDR_OFFSET(stm32f4));
return -EIO;
@@ -74,7 +74,7 @@ static int _stm32_serial_putc(fdt_addr_t base,
{
bool stm32f4 = uart_info->stm32f4;
- if ((readl(base + ISR_OFFSET(stm32f4)) & USART_ISR_FLAG_TXE) == 0)
+ if ((readl(base + ISR_OFFSET(stm32f4)) & USART_ISR_TXE) == 0)
return -EAGAIN;
writel(c, base + TDR_OFFSET(stm32f4));
@@ -97,10 +97,10 @@ static int stm32_serial_pending(struct udevice *dev, bool input)
if (input)
return readl(base + ISR_OFFSET(stm32f4)) &
- USART_ISR_FLAG_RXNE ? 1 : 0;
+ USART_ISR_RXNE ? 1 : 0;
else
return readl(base + ISR_OFFSET(stm32f4)) &
- USART_ISR_FLAG_TXE ? 0 : 1;
+ USART_ISR_TXE ? 0 : 1;
}
static void _stm32_serial_init(fdt_addr_t base,