[U-Boot] [PATCH v3 5/6] serial: stm32: add stm32f1 support

Matt Porter mporter at konsulko.com
Tue May 5 21:00:26 CEST 2015


Add support for the STM32F1 famly to the STM32 serial driver.

Signed-off-by: Matt Porter <mporter at konsulko.com>
---
v3:
	- Update copyright notice
v2:
	- Explicitly check for F4/F1 family and error if not
	  set to a supported STM32 family.

 drivers/serial/serial_stm32.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 3c80096..2a029ce 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -2,6 +2,9 @@
  * (C) Copyright 2015
  * Kamil Lulko, <rev13 at wp.pl>
  *
+ * Copyright 2015 ATS Advanced Telematics Systems GmbH
+ * Copyright 2015 Konsulko Group, Matt Porter <mporter at konsulko.com>
+ *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
@@ -10,8 +13,15 @@
 #include <serial.h>
 #include <asm/arch/stm32.h>
 
+#if defined(CONFIG_STM32F4)
 #define STM32_USART1_BASE	(STM32_APB2PERIPH_BASE + 0x1000)
 #define RCC_APB2ENR_USART1EN	(1 << 4)
+#elif defined(CONFIG_STM32F1)
+#define STM32_USART1_BASE	(STM32_APB2PERIPH_BASE + 0x3800)
+#define RCC_APB2ENR_USART1EN	(1 << 14)
+#else
+#error STM32 family not supported
+#endif
 
 #define USART_BASE		STM32_USART1_BASE
 #define RCC_USART_ENABLE	RCC_APB2ENR_USART1EN
-- 
2.1.0



More information about the U-Boot mailing list