Skip to content
Snippets Groups Projects
Commit d0b24c1a authored by Vikas Manocha's avatar Vikas Manocha Committed by Tom Rini
Browse files

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: default avatarVikas Manocha <vikas.manocha@st.com>
cc: Christophe KERELLO <christophe.kerello@st.com>
parent 2d9c33ca
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
fmc: fmc@A0000000 { fmc: fmc@A0000000 {
compatible = "st,stm32-fmc"; compatible = "st,stm32-fmc";
reg = <0xA0000000 0x1000>; reg = <0xA0000000 0x1000>;
clocks = <&rcc 0 64>;
u-boot,dm-pre-reloc; u-boot,dm-pre-reloc;
}; };
......
...@@ -51,8 +51,6 @@ int dram_init(void) ...@@ -51,8 +51,6 @@ int dram_init(void)
if (rv) if (rv)
return rv; return rv;
clock_setup(FMC_CLOCK_CFG);
rv = uclass_get_device(UCLASS_RAM, 0, &dev); rv = uclass_get_device(UCLASS_RAM, 0, &dev);
if (rv) { if (rv) {
debug("DRAM init failed: %d\n", rv); debug("DRAM init failed: %d\n", rv);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <common.h> #include <common.h>
#include <clk.h>
#include <dm.h> #include <dm.h>
#include <ram.h> #include <ram.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -122,6 +123,20 @@ int stm32_sdram_init(void) ...@@ -122,6 +123,20 @@ int stm32_sdram_init(void)
static int stm32_fmc_probe(struct udevice *dev) 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(); stm32_sdram_init();
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment