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>
fmc: fmc@A0000000 {
compatible = "st,stm32-fmc";
reg = <0xA0000000 0x1000>;
+ clocks = <&rcc 0 64>;
u-boot,dm-pre-reloc;
};
if (rv)
return rv;
- clock_setup(FMC_CLOCK_CFG);
-
rv = uclass_get_device(UCLASS_RAM, 0, &dev);
if (rv) {
debug("DRAM init failed: %d\n", rv);
*/
#include <common.h>
+#include <clk.h>
#include <dm.h>
#include <ram.h>
#include <asm/io.h>
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;
}