Skip to contentSkip to conversation

stm32: add stm32f7 family support

PATCH New Vikas Manocha 3 participants 10 messages Feb 11, 2016 – Feb 25, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover stm32: add stm32f7 family support

This patchset:
- adds support for stm32f7 family.
- adds support for stm32f746 disco board.
- moves base addresses & clock config from stm32 gpio driver to soc area to be usable by stm32f7.

Vikas Manocha (4):
gpio: stm32_gpio: move clock config from driver to board
gpio: stm32_gpio: move base addresses to the soc file
stm32x7: add support for stm32x7 serial driver
stm32: add support for stm32f7 & stm32f746 discovery board

 arch/arm/include/asm/arch-stm32f1/stm32.h          |   8 ++
 arch/arm/include/asm/arch-stm32f4/stm32.h          |  10 ++
 arch/arm/include/asm/arch-stm32f4/stm32_periph.h   |  11 ++
 arch/arm/include/asm/arch-stm32f7/gpio.h           | 113 +++++++++++++++++++++
 arch/arm/include/asm/arch-stm32f7/gpt.h            |  53 ++++++++++
 arch/arm/include/asm/arch-stm32f7/rcc.h            |  64 ++++++++++++
 arch/arm/include/asm/arch-stm32f7/stm32.h          |  63 ++++++++++++
 arch/arm/include/asm/arch-stm32f7/stm32_defs.h     |  15 +++
 .../{arch-stm32f4 => arch-stm32f7}/stm32_periph.h  |  11 ++
 arch/arm/mach-stm32/Kconfig                        |   4 +
 arch/arm/mach-stm32/Makefile                       |   1 +
 arch/arm/mach-stm32/stm32f4/clock.c                |  48 +++++++++
 arch/arm/mach-stm32/stm32f7/Kconfig                |   8 ++
 arch/arm/mach-stm32/stm32f7/Makefile               |   8 ++
 arch/arm/mach-stm32/stm32f7/clock.c                |  56 ++++++++++
 arch/arm/mach-stm32/stm32f7/timer.c                | 112 ++++++++++++++++++++
 board/st/stm32f429-discovery/stm32f429-discovery.c |   8 ++
 board/st/stm32f746-disco/Kconfig                   |  19 ++++
 board/st/stm32f746-disco/MAINTAINERS               |   6 ++
 board/st/stm32f746-disco/Makefile                  |   8 ++
 board/st/stm32f746-disco/stm32f746-disco.c         |  99 ++++++++++++++++++
 configs/stm32f746-disco_defconfig                  |   9 ++
 drivers/gpio/stm32_gpio.c                          |  29 +-----
 drivers/serial/Makefile                            |   1 +
 drivers/serial/serial_stm32x7.c                    |  83 +++++++++++++++
 drivers/serial/serial_stm32x7.h                    |  37 +++++++
 include/configs/stm32f746-disco.h                  |  89 ++++++++++++++++
 include/dm/platform_data/serial_stm32x7.h          |  17 ++++
 28 files changed, 964 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpio.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpt.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/rcc.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_defs.h
 copy arch/arm/include/asm/{arch-stm32f4 => arch-stm32f7}/stm32_periph.h (71%)
 create mode 100644 arch/arm/mach-stm32/stm32f7/Kconfig
 create mode 100644 arch/arm/mach-stm32/stm32f7/Makefile
 create mode 100644 arch/arm/mach-stm32/stm32f7/clock.c
 create mode 100644 arch/arm/mach-stm32/stm32f7/timer.c
 create mode 100644 board/st/stm32f746-disco/Kconfig
 create mode 100644 board/st/stm32f746-disco/MAINTAINERS
 create mode 100644 board/st/stm32f746-disco/Makefile
 create mode 100644 board/st/stm32f746-disco/stm32f746-disco.c
 create mode 100644 configs/stm32f746-disco_defconfig
 create mode 100644 drivers/serial/serial_stm32x7.c
 create mode 100644 drivers/serial/serial_stm32x7.h
 create mode 100644 include/configs/stm32f746-disco.h
 create mode 100644 include/dm/platform_data/serial_stm32x7.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 gpio: stm32_gpio: move clock config from driver to board

This patch removes the gpio clock enable from gpio driver & move it in the board code, making it possible to use the gpio driver with other socs.

---
 arch/arm/include/asm/arch-stm32f4/stm32_periph.h   | 11 +++++
 arch/arm/mach-stm32/stm32f4/clock.c                | 48 ++++++++++++++++++++++
 board/st/stm32f429-discovery/stm32f429-discovery.c |  8 ++++
 drivers/gpio/stm32_gpio.c                          |  5 ---
 4 files changed, 67 insertions(+), 5 deletions(-)
arch/arm/include/asm/arch-stm32f4/stm32_periph.h +11 -0
index a1af25c..38adc4e 100644
@@ -22,6 +22,17 @@ enum periph_id {
 enum periph_clock {
 	USART1_CLOCK_CFG = 0,
 	USART2_CLOCK_CFG,
+	GPIO_A_CLOCK_CFG,
+	GPIO_B_CLOCK_CFG,
+	GPIO_C_CLOCK_CFG,
+	GPIO_D_CLOCK_CFG,
+	GPIO_E_CLOCK_CFG,
+	GPIO_F_CLOCK_CFG,
+	GPIO_G_CLOCK_CFG,
+	GPIO_H_CLOCK_CFG,
+	GPIO_I_CLOCK_CFG,
+	GPIO_J_CLOCK_CFG,
+	GPIO_K_CLOCK_CFG,
 };
 
 #endif /* __ASM_ARM_ARCH_PERIPH_H */
arch/arm/mach-stm32/stm32f4/clock.c +48 -0

60 lines not on this page · raw message

board/st/stm32f429-discovery/stm32f429-discovery.c +8 -0
index fb8475f..d16d73f 100644
@@ -50,6 +50,7 @@ int uart_setup_gpio(void)
 	int i;
 	int rv = 0;
 
+	clock_setup(GPIO_A_CLOCK_CFG);
 	for (i = 0; i < ARRAY_SIZE(usart_gpio); i++) {
 		rv = stm32_gpio_config(&usart_gpio[i], &gpio_ctl_usart);
 		if (rv)
@@ -115,6 +116,13 @@ static int fmc_setup_gpio(void)
 	int rv = 0;
 	int i;
 
+	clock_setup(GPIO_B_CLOCK_CFG);
+	clock_setup(GPIO_C_CLOCK_CFG);
+	clock_setup(GPIO_D_CLOCK_CFG);
+	clock_setup(GPIO_E_CLOCK_CFG);
+	clock_setup(GPIO_F_CLOCK_CFG);
+	clock_setup(GPIO_G_CLOCK_CFG);
+
 	for (i = 0; i < ARRAY_SIZE(ext_ram_fmc_gpio); i++) {
 		rv = stm32_gpio_config(&ext_ram_fmc_gpio[i],
 				&gpio_ctl_fmc);
drivers/gpio/stm32_gpio.c +0 -5
index 75a84e1..9f9ff48 100644
@@ -70,8 +70,6 @@ int stm32_gpio_config(const struct stm32_gpio_dsc *dsc,
 
 	gpio_regs = (struct stm32_gpio_regs *)io_base[dsc->port];
 
-	setbits_le32(&STM32_RCC->ahb1enr, 1 << dsc->port);
-
 	i = (dsc->pin & 0x07) * 4;
 	clrsetbits_le32(&gpio_regs->afr[dsc->pin >> 3], 0xF << i, ctl->af << i);
 
@@ -141,9 +139,6 @@ int stm32_gpio_config(const struct stm32_gpio_dsc *dsc,
 
 	gpio_regs = (struct stm32_gpio_regs *)io_base[dsc->port];
 
-	/* Enable clock for GPIO port */
-	setbits_le32(&STM32_RCC->apb2enr, 0x04 << dsc->port);
-
 	if (p < 8) {
 		cr = &gpio_regs->crl;
 		crp = p;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/4 gpio: stm32_gpio: move base addresses to the soc file

In reply to Vikas Manocha

Base addresses for GPIOs could be different for different socs, this patch moves the base addresses from driver to the soc specific location.

---
 arch/arm/include/asm/arch-stm32f1/stm32.h |  8 ++++++++
 arch/arm/include/asm/arch-stm32f4/stm32.h | 10 ++++++++++
 drivers/gpio/stm32_gpio.c                 | 18 ------------------
 3 files changed, 18 insertions(+), 18 deletions(-)
arch/arm/include/asm/arch-stm32f1/stm32.h +8 -0
index 4094a75..1af73c5 100644
@@ -24,6 +24,14 @@
 
 #define STM32_BUS_MASK		0xFFFF0000
 
+#define STM32_GPIOA_BASE	(STM32_APB2PERIPH_BASE + 0x0800)
+#define STM32_GPIOB_BASE	(STM32_APB2PERIPH_BASE + 0x0C00)
+#define STM32_GPIOC_BASE	(STM32_APB2PERIPH_BASE + 0x1000)
+#define STM32_GPIOD_BASE	(STM32_APB2PERIPH_BASE + 0x1400)
+#define STM32_GPIOE_BASE	(STM32_APB2PERIPH_BASE + 0x1800)
+#define STM32_GPIOF_BASE	(STM32_APB2PERIPH_BASE + 0x1C00)
+#define STM32_GPIOG_BASE	(STM32_APB2PERIPH_BASE + 0x2000)
+
 /*
  * Register maps
  */
arch/arm/include/asm/arch-stm32f4/stm32.h +10 -0
index 6b64d03..7d6331b 100644
@@ -23,6 +23,16 @@
 
 #define STM32_BUS_MASK		0xFFFF0000
 
+#define STM32_GPIOA_BASE	(STM32_AHB1PERIPH_BASE + 0x0000)
+#define STM32_GPIOB_BASE	(STM32_AHB1PERIPH_BASE + 0x0400)
+#define STM32_GPIOC_BASE	(STM32_AHB1PERIPH_BASE + 0x0800)
+#define STM32_GPIOD_BASE	(STM32_AHB1PERIPH_BASE + 0x0C00)
+#define STM32_GPIOE_BASE	(STM32_AHB1PERIPH_BASE + 0x1000)
+#define STM32_GPIOF_BASE	(STM32_AHB1PERIPH_BASE + 0x1400)
+#define STM32_GPIOG_BASE	(STM32_AHB1PERIPH_BASE + 0x1800)
+#define STM32_GPIOH_BASE	(STM32_AHB1PERIPH_BASE + 0x1C00)
+#define STM32_GPIOI_BASE	(STM32_AHB1PERIPH_BASE + 0x2000)
+
 /*
  * Register maps
  */
drivers/gpio/stm32_gpio.c +0 -18
index 9f9ff48..739de01 100644
@@ -20,16 +20,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_STM32F4)
-#define STM32_GPIOA_BASE	(STM32_AHB1PERIPH_BASE + 0x0000)
-#define STM32_GPIOB_BASE	(STM32_AHB1PERIPH_BASE + 0x0400)
-#define STM32_GPIOC_BASE	(STM32_AHB1PERIPH_BASE + 0x0800)
-#define STM32_GPIOD_BASE	(STM32_AHB1PERIPH_BASE + 0x0C00)
-#define STM32_GPIOE_BASE	(STM32_AHB1PERIPH_BASE + 0x1000)
-#define STM32_GPIOF_BASE	(STM32_AHB1PERIPH_BASE + 0x1400)
-#define STM32_GPIOG_BASE	(STM32_AHB1PERIPH_BASE + 0x1800)
-#define STM32_GPIOH_BASE	(STM32_AHB1PERIPH_BASE + 0x1C00)
-#define STM32_GPIOI_BASE	(STM32_AHB1PERIPH_BASE + 0x2000)
-
 static const unsigned long io_base[] = {
 	STM32_GPIOA_BASE, STM32_GPIOB_BASE, STM32_GPIOC_BASE,
 	STM32_GPIOD_BASE, STM32_GPIOE_BASE, STM32_GPIOF_BASE,
@@ -85,14 +75,6 @@ out:
 	return rv;
 }
 #elif defined(CONFIG_STM32F1)
-#define STM32_GPIOA_BASE	(STM32_APB2PERIPH_BASE + 0x0800)
-#define STM32_GPIOB_BASE	(STM32_APB2PERIPH_BASE + 0x0C00)
-#define STM32_GPIOC_BASE	(STM32_APB2PERIPH_BASE + 0x1000)
-#define STM32_GPIOD_BASE	(STM32_APB2PERIPH_BASE + 0x1400)
-#define STM32_GPIOE_BASE	(STM32_APB2PERIPH_BASE + 0x1800)
-#define STM32_GPIOF_BASE	(STM32_APB2PERIPH_BASE + 0x1C00)
-#define STM32_GPIOG_BASE	(STM32_APB2PERIPH_BASE + 0x2000)
-
 static const unsigned long io_base[] = {
 	STM32_GPIOA_BASE, STM32_GPIOB_BASE, STM32_GPIOC_BASE,
 	STM32_GPIOD_BASE, STM32_GPIOE_BASE, STM32_GPIOF_BASE,
Signature · 1 line
1.9.1
#5 lore raw

PATCH 3/4 stm32x7: add support for stm32x7 serial driver

In reply to Vikas Manocha

This patch adds support for stm32f7 family usart peripheral.

---
 drivers/serial/Makefile                   |  1 +
 drivers/serial/serial_stm32x7.c           | 83 +++++++++++++++++++++++++++++++
 drivers/serial/serial_stm32x7.h           | 37 ++++++++++++++
 include/dm/platform_data/serial_stm32x7.h | 17 +++++++
 4 files changed, 138 insertions(+)
 create mode 100644 drivers/serial/serial_stm32x7.c
 create mode 100644 drivers/serial/serial_stm32x7.h
 create mode 100644 include/dm/platform_data/serial_stm32x7.h
drivers/serial/Makefile +1 -0
index c63999a..05bdf56 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
 obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
 obj-$(CONFIG_PIC32_SERIAL) += serial_pic32.o
+obj-$(CONFIG_STM32X7_SERIAL) += serial_stm32x7.o
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_stm32x7.c new file +83 -0

83 lines not on this page · raw message

drivers/serial/serial_stm32x7.h new file +37 -0
new file mode 100644
index 0000000..6190d67
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _SERIAL_STM32_X7_
+#define _SERIAL_STM32_X7_
+
+struct stm32_usart {
+	u32 cr1;
+	u32 cr2;
+	u32 cr3;
+	u32 brr;
+	u32 gtpr;
+	u32 rtor;
+	u32 rqr;
+	u32 sr;
+	u32 icr;
+	u32 rd_dr;
+	u32 tx_dr;
+};
+
+
+#define USART_CR1_RE			(1 << 2)
+#define USART_CR1_TE			(1 << 3)
+#define USART_CR1_UE			(1 << 0)
+
+#define USART_SR_FLAG_RXNE		(1 << 5)
+#define USART_SR_FLAG_TXE		(1 << 7)
+
+#define USART_BRR_F_MASK		0xFF
+#define USART_BRR_M_SHIFT		4
+#define USART_BRR_M_MASK		0xFFF0
+
+#endif
include/dm/platform_data/serial_stm32x7.h new file +17 -0
new file mode 100644
index 0000000..328a8a3
@@ -0,0 +1,17 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __SERIAL_STM32x7_H
+#define __SERIAL_STM32x7_H
+
+/* Information about a serial port */
+struct stm32x7_serial_platdata {
+	struct stm32_usart *base;  /* address of registers in physical memory */
+	unsigned int clock;
+};
+
+#endif /* __SERIAL_STM32x7_H */
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/4 stm32: add support for stm32f7 & stm32f746 discovery board

In reply to Vikas Manocha

This patch adds support for stm32f7 family & stm32f746 board.

---
 arch/arm/include/asm/arch-stm32f7/gpio.h         | 113 +++++++++++++++++++++++
 arch/arm/include/asm/arch-stm32f7/gpt.h          |  53 +++++++++++
 arch/arm/include/asm/arch-stm32f7/rcc.h          |  64 +++++++++++++
 arch/arm/include/asm/arch-stm32f7/stm32.h        |  63 +++++++++++++
 arch/arm/include/asm/arch-stm32f7/stm32_defs.h   |  15 +++
 arch/arm/include/asm/arch-stm32f7/stm32_periph.h |  38 ++++++++
 arch/arm/mach-stm32/Kconfig                      |   4 +
 arch/arm/mach-stm32/Makefile                     |   1 +
 arch/arm/mach-stm32/stm32f7/Kconfig              |   8 ++
 arch/arm/mach-stm32/stm32f7/Makefile             |   8 ++
 arch/arm/mach-stm32/stm32f7/clock.c              |  56 +++++++++++
 arch/arm/mach-stm32/stm32f7/timer.c              | 112 ++++++++++++++++++++++
 board/st/stm32f746-disco/Kconfig                 |  19 ++++
 board/st/stm32f746-disco/MAINTAINERS             |   6 ++
 board/st/stm32f746-disco/Makefile                |   8 ++
 board/st/stm32f746-disco/stm32f746-disco.c       |  99 ++++++++++++++++++++
 configs/stm32f746-disco_defconfig                |   9 ++
 drivers/gpio/stm32_gpio.c                        |   6 +-
 include/configs/stm32f746-disco.h                |  89 ++++++++++++++++++
 19 files changed, 768 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpio.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpt.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/rcc.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_defs.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_periph.h
 create mode 100644 arch/arm/mach-stm32/stm32f7/Kconfig
 create mode 100644 arch/arm/mach-stm32/stm32f7/Makefile
 create mode 100644 arch/arm/mach-stm32/stm32f7/clock.c
 create mode 100644 arch/arm/mach-stm32/stm32f7/timer.c
 create mode 100644 board/st/stm32f746-disco/Kconfig
 create mode 100644 board/st/stm32f746-disco/MAINTAINERS
 create mode 100644 board/st/stm32f746-disco/Makefile
 create mode 100644 board/st/stm32f746-disco/stm32f746-disco.c
 create mode 100644 configs/stm32f746-disco_defconfig
 create mode 100644 include/configs/stm32f746-disco.h
arch/arm/include/asm/arch-stm32f7/gpio.h new file +113 -0
new file mode 100644
index 0000000..2942cd9
@@ -0,0 +1,113 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _STM32_GPIO_H_
+#define _STM32_GPIO_H_
+
+enum stm32_gpio_port {
+	STM32_GPIO_PORT_A = 0,
+	STM32_GPIO_PORT_B,
+	STM32_GPIO_PORT_C,
+	STM32_GPIO_PORT_D,
+	STM32_GPIO_PORT_E,
+	STM32_GPIO_PORT_F,
+	STM32_GPIO_PORT_G,
+	STM32_GPIO_PORT_H,
+	STM32_GPIO_PORT_I
+};
+
+enum stm32_gpio_pin {
+	STM32_GPIO_PIN_0 = 0,
+	STM32_GPIO_PIN_1,
+	STM32_GPIO_PIN_2,
+	STM32_GPIO_PIN_3,
+	STM32_GPIO_PIN_4,
+	STM32_GPIO_PIN_5,
+	STM32_GPIO_PIN_6,
+	STM32_GPIO_PIN_7,
+	STM32_GPIO_PIN_8,
+	STM32_GPIO_PIN_9,
+	STM32_GPIO_PIN_10,
+	STM32_GPIO_PIN_11,
+	STM32_GPIO_PIN_12,
+	STM32_GPIO_PIN_13,
+	STM32_GPIO_PIN_14,
+	STM32_GPIO_PIN_15
+};
+
+enum stm32_gpio_mode {
+	STM32_GPIO_MODE_IN = 0,
+	STM32_GPIO_MODE_OUT,
+	STM32_GPIO_MODE_AF,
+	STM32_GPIO_MODE_AN
+};
+
+enum stm32_gpio_otype {
+	STM32_GPIO_OTYPE_PP = 0,
+	STM32_GPIO_OTYPE_OD
+};
+
+enum stm32_gpio_speed {
+	STM32_GPIO_SPEED_2M = 0,
+	STM32_GPIO_SPEED_25M,
+	STM32_GPIO_SPEED_50M,
+	STM32_GPIO_SPEED_100M
+};
+
+enum stm32_gpio_pupd {
+	STM32_GPIO_PUPD_NO = 0,
+	STM32_GPIO_PUPD_UP,
+	STM32_GPIO_PUPD_DOWN
+};
+
+enum stm32_gpio_af {
+	STM32_GPIO_AF0 = 0,
+	STM32_GPIO_AF1,
+	STM32_GPIO_AF2,
+	STM32_GPIO_AF3,
+	STM32_GPIO_AF4,
+	STM32_GPIO_AF5,
+	STM32_GPIO_AF6,
+	STM32_GPIO_AF7,
+	STM32_GPIO_AF8,
+	STM32_GPIO_AF9,
+	STM32_GPIO_AF10,
+	STM32_GPIO_AF11,
+	STM32_GPIO_AF12,
+	STM32_GPIO_AF13,
+	STM32_GPIO_AF14,
+	STM32_GPIO_AF15
+};
+
+struct stm32_gpio_dsc {
+	enum stm32_gpio_port	port;
+	enum stm32_gpio_pin	pin;
+};
+
+struct stm32_gpio_ctl {
+	enum stm32_gpio_mode	mode;
+	enum stm32_gpio_otype	otype;
+	enum stm32_gpio_speed	speed;
+	enum stm32_gpio_pupd	pupd;
+	enum stm32_gpio_af	af;
+};
+
+static inline unsigned stm32_gpio_to_port(unsigned gpio)
+{
+	return gpio / 16;
+}
+
+static inline unsigned stm32_gpio_to_pin(unsigned gpio)
+{
+	return gpio % 16;
+}
+
+int stm32_gpio_config(const struct stm32_gpio_dsc *gpio_dsc,
+		const struct stm32_gpio_ctl *gpio_ctl);
+int stm32_gpout_set(const struct stm32_gpio_dsc *gpio_dsc, int state);
+
+#endif /* _STM32_GPIO_H_ */
arch/arm/include/asm/arch-stm32f7/gpt.h new file +53 -0

53 lines not on this page · raw message

arch/arm/include/asm/arch-stm32f7/rcc.h new file +64 -0

64 lines not on this page · raw message

arch/arm/include/asm/arch-stm32f7/stm32.h new file +63 -0

63 lines not on this page · raw message

arch/arm/include/asm/arch-stm32f7/stm32_defs.h new file +15 -0
new file mode 100644
index 0000000..29b98ae
@@ -0,0 +1,15 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, ST Micoelectronics, vikas.manocha at st.com.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __STM32_DEFS_H__
+#define __STM32_DEFS_H__
+#include <asm/arch/stm32_periph.h>
+
+int clock_setup(enum periph_clock);
+
+#endif
+
arch/arm/include/asm/arch-stm32f7/stm32_periph.h new file +38 -0
new file mode 100644
index 0000000..38adc4e
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, ST Micoelectronics, vikas.manocha at st.com.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ASM_ARM_ARCH_PERIPH_H
+#define __ASM_ARM_ARCH_PERIPH_H
+
+/*
+ * Peripherals required for pinmux configuration. List will
+ * grow with support for more devices getting added.
+ * Numbering based on interrupt table.
+ *
+ */
+enum periph_id {
+	UART1_GPIOA_9_10 = 0,
+	UART2_GPIOD_5_6,
+};
+
+enum periph_clock {
+	USART1_CLOCK_CFG = 0,
+	USART2_CLOCK_CFG,
+	GPIO_A_CLOCK_CFG,
+	GPIO_B_CLOCK_CFG,
+	GPIO_C_CLOCK_CFG,
+	GPIO_D_CLOCK_CFG,
+	GPIO_E_CLOCK_CFG,
+	GPIO_F_CLOCK_CFG,
+	GPIO_G_CLOCK_CFG,
+	GPIO_H_CLOCK_CFG,
+	GPIO_I_CLOCK_CFG,
+	GPIO_J_CLOCK_CFG,
+	GPIO_K_CLOCK_CFG,
+};
+
+#endif /* __ASM_ARM_ARCH_PERIPH_H */
arch/arm/mach-stm32/Kconfig +4 -0
index 7dbeb04..ec6b3ff 100644
@@ -6,7 +6,11 @@ config STM32F4
 config STM32F1
 	bool "stm32f1 family"
 
+config STM32F7
+	bool "stm32f7 family"
+
 source "arch/arm/mach-stm32/stm32f4/Kconfig"
 source "arch/arm/mach-stm32/stm32f1/Kconfig"
+source "arch/arm/mach-stm32/stm32f7/Kconfig"
 
 endif
arch/arm/mach-stm32/Makefile +1 -0
index ea06034..ffc537f 100644
@@ -7,3 +7,4 @@
 
 obj-$(CONFIG_STM32F1) += stm32f1/
 obj-$(CONFIG_STM32F4) += stm32f4/
+obj-$(CONFIG_STM32F7) += stm32f7/
arch/arm/mach-stm32/stm32f7/Kconfig new file +8 -0
new file mode 100644
index 0000000..287e5ad
@@ -0,0 +1,8 @@
+if STM32F7
+
+config TARGET_STM32F746_DISCO
+	bool "STM32F746 Discovery board"
+
+source "board/st/stm32f746-disco/Kconfig"
+
+endif
arch/arm/mach-stm32/stm32f7/Makefile new file +8 -0
new file mode 100644
index 0000000..40f1ad3
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2016
+# Vikas Manocha, <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += timer.o clock.o
arch/arm/mach-stm32/stm32f7/clock.c new file +56 -0

56 lines not on this page · raw message

arch/arm/mach-stm32/stm32f7/timer.c new file +112 -0

112 lines not on this page · raw message

board/st/stm32f746-disco/Kconfig new file +19 -0
new file mode 100644
index 0000000..09289d2
@@ -0,0 +1,19 @@
+if TARGET_STM32F746_DISCO
+
+config SYS_BOARD
+	string
+	default "stm32f746-disco"
+
+config SYS_VENDOR
+	string
+	default "st"
+
+config SYS_SOC
+	string
+	default "stm32f7"
+
+config SYS_CONFIG_NAME
+	string
+	default "stm32f746-disco"
+
+endif
board/st/stm32f746-disco/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..2df0a65
@@ -0,0 +1,6 @@
+STM32F746 DISCOVERY BOARD
+M:	Vikas Manocha <[email protected]>
+S:	Maintained
+F:	board/st/stm32f746-disco
+F:	include/configs/stm32f746-disco.h
+F:	configs/stm32f746-disco_defconfig
board/st/stm32f746-disco/Makefile new file +8 -0
new file mode 100644
index 0000000..db8a0a4
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2016
+# Vikas Manocha <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= stm32f746-disco.o
board/st/stm32f746-disco/stm32f746-disco.c new file +99 -0

99 lines not on this page · raw message

configs/stm32f746-disco_defconfig new file +9 -0
new file mode 100644
index 0000000..7cfed4a
@@ -0,0 +1,9 @@
+CONFIG_ARM=y
+CONFIG_STM32=y
+CONFIG_STM32F7=y
+CONFIG_TARGET_STM32F746_DISCO=y
+CONFIG_SYS_PROMPT="U-Boot > "
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
+CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_SETEXPR is not set
drivers/gpio/stm32_gpio.c +3 -3
index 739de01..50f86d3 100644
@@ -19,7 +19,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_STM32F4)
+#if defined(CONFIG_STM32F4) || defined(CONFIG_STM32F7)
 static const unsigned long io_base[] = {
 	STM32_GPIOA_BASE, STM32_GPIOB_BASE, STM32_GPIOC_BASE,
 	STM32_GPIOD_BASE, STM32_GPIOE_BASE, STM32_GPIOF_BASE,
@@ -207,7 +207,7 @@ int gpio_direction_input(unsigned gpio)
 
 	dsc.port = stm32_gpio_to_port(gpio);
 	dsc.pin = stm32_gpio_to_pin(gpio);
-#if defined(CONFIG_STM32F4)
+#if defined(CONFIG_STM32F4) || defined(CONFIG_STM32F7)
 	ctl.af = STM32_GPIO_AF0;
 	ctl.mode = STM32_GPIO_MODE_IN;
 	ctl.otype = STM32_GPIO_OTYPE_PP;
@@ -233,7 +233,7 @@ int gpio_direction_output(unsigned gpio, int value)
 
 	dsc.port = stm32_gpio_to_port(gpio);
 	dsc.pin = stm32_gpio_to_pin(gpio);
-#if defined(CONFIG_STM32F4)
+#if defined(CONFIG_STM32F4) || defined(CONFIG_STM32F7)
 	ctl.af = STM32_GPIO_AF0;
 	ctl.mode = STM32_GPIO_MODE_OUT;
 	ctl.pupd = STM32_GPIO_PUPD_NO;
include/configs/stm32f746-disco.h new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/4 stm32x7: add support for stm32x7 serial driver

In reply to Vikas Manocha
Quoted 12 lines · Vikas Manocha

This patch adds support for stm32f7 family usart peripheral.

---
 drivers/serial/Makefile                   |  1 +
 drivers/serial/serial_stm32x7.c           | 83 +++++++++++++++++++++++++++++++
 drivers/serial/serial_stm32x7.h           | 37 ++++++++++++++
 include/dm/platform_data/serial_stm32x7.h | 17 +++++++
 4 files changed, 138 insertions(+)
 create mode 100644 drivers/serial/serial_stm32x7.c
 create mode 100644 drivers/serial/serial_stm32x7.h
 create mode 100644 include/dm/platform_data/serial_stm32x7.h
#2 lore raw

PATCH 1/4 gpio: stm32_gpio: move clock config from driver to board

In reply to Vikas Manocha
Quoted 4 lines · Vikas Manocha

This patch removes the gpio clock enable from gpio driver & move it in the board code, making it possible to use the gpio driver with other socs.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160225/10939303/attachment.sig>
#4 lore raw

PATCH 2/4 gpio: stm32_gpio: move base addresses to the soc file

In reply to Vikas Manocha
Quoted 4 lines · Vikas Manocha

Base addresses for GPIOs could be different for different socs, this patch moves the base addresses from driver to the soc specific location.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160225/6a7f0852/attachment.sig>
#7 lore raw

PATCH 3/4 stm32x7: add support for stm32x7 serial driver

In reply to Vikas Manocha
Quoted 4 lines · Vikas Manocha

This patch adds support for stm32f7 family usart peripheral.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160225/321c1bcc/attachment.sig>
#9 lore raw

PATCH 4/4 stm32: add support for stm32f7 & stm32f746 discovery board

In reply to Vikas Manocha
Quoted 3 lines · Vikas Manocha

This patch adds support for stm32f7 family & stm32f746 board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160225/a25fb0bb/attachment.sig>