aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVikas Manocha2017-04-10 15:02:55 -0700
committerTom Rini2017-05-08 11:39:04 -0400
commitd0b24c1aa96729d4d9fee02e2c60fc920068c6c5 (patch)
tree68e8193d2a4d92940e5083ba6666299ea5d38a47 /drivers
parent2d9c33ca3f7ba69eaf4b2b88f36a0f3cf1a1e19f (diff)
stm32f7: use clock driver to enable sdram controller clock
This patch also removes the sdram/fmc clock enable from board specific code. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> cc: Christophe KERELLO <christophe.kerello@st.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ram/stm32_sdram.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/ram/stm32_sdram.c b/drivers/ram/stm32_sdram.c
index 67be61f01ac..67d885572d6 100644
--- a/drivers/ram/stm32_sdram.c
+++ b/drivers/ram/stm32_sdram.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <clk.h>
#include <dm.h>
#include <ram.h>
#include <asm/io.h>
@@ -122,6 +123,20 @@ int stm32_sdram_init(void)
static int stm32_fmc_probe(struct udevice *dev)
{
+#ifdef CONFIG_CLK
+ int ret;
+ struct clk clk;
+ ret = clk_get_by_index(dev, 0, &clk);
+ if (ret < 0)
+ return ret;
+
+ ret = clk_enable(&clk);
+
+ if (ret) {
+ dev_err(dev, "failed to enable clock\n");
+ return ret;
+ }
+#endif
stm32_sdram_init();
return 0;
}