]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
serial: stm32x7: add STM32F4 support
authorPatrice Chotard <patrice.chotard@st.com>
Wed, 27 Sep 2017 13:44:52 +0000 (15:44 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 8 Oct 2017 20:19:56 +0000 (16:19 -0400)
stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
drivers/serial/Kconfig
drivers/serial/serial_stm32x7.c
drivers/serial/serial_stm32x7.h

index 9bf2e26e9d11e96cda926c2ee1616d0340d1a498..7c54a49bb32ec050a0dfd1968f7a1d55527e7d1a 100644 (file)
@@ -531,9 +531,9 @@ config STI_ASC_SERIAL
 
 config STM32X7_SERIAL
        bool "STMicroelectronics STM32 SoCs on-chip UART"
-       depends on DM_SERIAL && (STM32F7 || STM32H7)
+       depends on DM_SERIAL && (STM32F4 || STM32F7 || STM32H7)
        help
-         If you have a machine based on a STM32 F7 or H7 SoC you can
+         If you have a machine based on a STM32 F4, F7 or H7 SoC you can
          enable its onboard serial ports, say Y to this option.
          If unsure, say N.
 
index 19697e31e748e719e02e2c4cbe2a26864e6b7e2b..44e8b42c7bc5a7bb4d9500b594a823ac4b9f10b1 100644 (file)
@@ -127,6 +127,7 @@ static int stm32_serial_probe(struct udevice *dev)
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id stm32_serial_id[] = {
+       { .compatible = "st,stm32-uart", .data = (ulong)&stm32f4_info},
        { .compatible = "st,stm32f7-uart", .data = (ulong)&stm32f7_info},
        { .compatible = "st,stm32h7-uart", .data = (ulong)&stm32h7_info},
        {}
index ed8a3eeb2cb7fb190c0ef3957f228d33879b049d..b914edf28a11905399c236a4312da671474bd797 100644 (file)
@@ -27,6 +27,13 @@ struct stm32_uart_info {
        bool has_fifo;
 };
 
+struct stm32_uart_info stm32f4_info = {
+       .stm32f4 = true,
+       .uart_enable_bit = 13,
+       .has_overrun_disable = false,
+       .has_fifo = false,
+};
+
 struct stm32_uart_info stm32f7_info = {
        .uart_enable_bit = 0,
        .stm32f4 = false,