aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2018-04-20 08:59:07 +0200
committerTom Rini <trini@konsulko.com>2018-04-28 18:32:24 -0400
commit8dc4e1fbf439d63082419640b6e797dfdfcc4720 (patch)
tree2bb0083fd24aabfff0caf2591ed50f930eac1b3c
parent7b3b74d321279b8aaee448d136fa9d20f8fd0739 (diff)
downloadu-boot-8dc4e1fbf439d63082419640b6e797dfdfcc4720.zip
u-boot-8dc4e1fbf439d63082419640b6e797dfdfcc4720.tar.gz
u-boot-8dc4e1fbf439d63082419640b6e797dfdfcc4720.tar.bz2
serial: serial_stm32: Rename status register flags
Uart status register is named USART_ISR on STM32F7, STM32H7 and STM32MP1 SoCs family, but USART_SR only on STM32F4 SoCs. Use USART_ISR_ prefix instead of USART_SR_ . Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
-rw-r--r--drivers/serial/serial_stm32.c10
-rw-r--r--drivers/serial/serial_stm32.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index e2eeade..216a803 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -45,10 +45,10 @@ static int stm32_serial_getc(struct udevice *dev)
fdt_addr_t base = plat->base;
u32 isr = readl(base + ISR_OFFSET(stm32f4));
- if ((isr & USART_SR_FLAG_RXNE) == 0)
+ if ((isr & USART_ISR_FLAG_RXNE) == 0)
return -EAGAIN;
- if (isr & USART_SR_FLAG_ORE) {
+ if (isr & USART_ISR_FLAG_ORE) {
if (!stm32f4)
setbits_le32(base + ICR_OFFSET, USART_ICR_OREF);
else
@@ -65,7 +65,7 @@ static int stm32_serial_putc(struct udevice *dev, const char c)
bool stm32f4 = plat->uart_info->stm32f4;
fdt_addr_t base = plat->base;
- if ((readl(base + ISR_OFFSET(stm32f4)) & USART_SR_FLAG_TXE) == 0)
+ if ((readl(base + ISR_OFFSET(stm32f4)) & USART_ISR_FLAG_TXE) == 0)
return -EAGAIN;
writel(c, base + TDR_OFFSET(stm32f4));
@@ -81,10 +81,10 @@ static int stm32_serial_pending(struct udevice *dev, bool input)
if (input)
return readl(base + ISR_OFFSET(stm32f4)) &
- USART_SR_FLAG_RXNE ? 1 : 0;
+ USART_ISR_FLAG_RXNE ? 1 : 0;
else
return readl(base + ISR_OFFSET(stm32f4)) &
- USART_SR_FLAG_TXE ? 0 : 1;
+ USART_ISR_FLAG_TXE ? 0 : 1;
}
static int stm32_serial_probe(struct udevice *dev)
diff --git a/drivers/serial/serial_stm32.h b/drivers/serial/serial_stm32.h
index 42fb132..6ebec0a 100644
--- a/drivers/serial/serial_stm32.h
+++ b/drivers/serial/serial_stm32.h
@@ -60,9 +60,9 @@ struct stm32x7_serial_platdata {
#define USART_CR3_OVRDIS BIT(12)
-#define USART_SR_FLAG_ORE BIT(3)
-#define USART_SR_FLAG_RXNE BIT(5)
-#define USART_SR_FLAG_TXE BIT(7)
+#define USART_ISR_FLAG_ORE BIT(3)
+#define USART_ISR_FLAG_RXNE BIT(5)
+#define USART_ISR_FLAG_TXE BIT(7)
#define USART_BRR_F_MASK GENMASK(7, 0)
#define USART_BRR_M_SHIFT 4