]> git.sur5r.net Git - u-boot/commitdiff
stm32f7: use clock driver to enable qspi controller clock
authorVikas Manocha <vikas.manocha@st.com>
Mon, 10 Apr 2017 22:02:50 +0000 (15:02 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 8 May 2017 15:38:41 +0000 (11:38 -0400)
Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
cc: Christophe KERELLO <christophe.kerello@st.com>

arch/arm/dts/stm32f746.dtsi
drivers/spi/stm32_qspi.c

index b2b0b5f09928ca53cfb4684b97bdaba2a162f7c8..883f818578c144cc7c48bfdd6392e0b07abd3c65 100644 (file)
@@ -78,6 +78,7 @@
                        reg-names = "QuadSPI", "QuadSPI-memory";
                        interrupts = <92>;
                        spi-max-frequency = <108000000>;
+                       clocks = <&rcc 0 65>;
                        status = "disabled";
                };
                usart1: serial@40011000 {
index 05358ebf4cd1bbb7512acf7d4049b53e60dd6191..f0434a4413dd2ec8179d27c981f1f7bd7b7af531 100644 (file)
@@ -17,6 +17,7 @@
 #include <errno.h>
 #include <asm/arch/stm32.h>
 #include <asm/arch/stm32_defs.h>
+#include <clk.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -457,7 +458,20 @@ static int stm32_qspi_probe(struct udevice *bus)
 
        priv->max_hz = plat->max_hz;
 
-       clock_setup(QSPI_CLOCK_CFG);
+#ifdef CONFIG_CLK
+       int ret;
+       struct clk clk;
+       ret = clk_get_by_index(bus, 0, &clk);
+       if (ret < 0)
+               return ret;
+
+       ret = clk_enable(&clk);
+
+       if (ret) {
+               dev_err(bus, "failed to enable clock\n");
+               return ret;
+       }
+#endif
 
        setbits_le32(&priv->regs->cr, STM32_QSPI_CR_SSHIFT);