board: stm32f429-disco: switch to DM STM32 clock driver

Use available DM clk_stm32f.c driver instead of dedicated
mach-stm32/stm32f4/clock.c.

Migrate periph_clock defines from stm32_periph.h directly in
CLK driver. These periph_clock defines will be removed when STMMAC,
TIMER2 and SYSCFG drivers will support DM CLK.

Enable also CLK flag.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c
index 7e62bd2..c5f4573 100644
--- a/board/st/stm32f429-discovery/stm32f429-discovery.c
+++ b/board/st/stm32f429-discovery/stm32f429-discovery.c
@@ -13,12 +13,10 @@
 
 #include <common.h>
 #include <dm.h>
-#include <stm32_rcc.h>
+
 #include <asm/io.h>
 #include <asm/arch/stm32.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/stm32_periph.h>
-#include <asm/arch/stm32_defs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -48,7 +46,6 @@
 	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)
@@ -114,13 +111,6 @@
 	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);
@@ -132,11 +122,6 @@
 	return rv;
 }
 
-/*
- * STM32 RCC FMC specific definitions
- */
-#define STM32_RCC_ENR_FMC	(1 << 0)	/* FMC module clock  */
-
 int dram_init(void)
 {
 	int rv;
@@ -145,9 +130,6 @@
 	rv = fmc_setup_gpio();
 	if (rv)
 		return rv;
-
-	setbits_le32(&STM32_RCC->ahb3enr, STM32_RCC_ENR_FMC);
-
 	rv = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (rv) {
 		debug("DRAM init failed: %d\n", rv);
@@ -176,13 +158,9 @@
 {
 	int res;
 
-	configure_clocks();
-
 	res = uart_setup_gpio();
 	if (res)
 		return res;
-	clock_setup(USART1_CLOCK_CFG);
-
 	return 0;
 }