In case of DT boot, don't read default speed and mode for SPI from
CONFIG_*, instead read from DT node.

Signed-off-by: Patrick Delaunay <patrick.delau...@st.com>
---

 common/splash_source.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/splash_source.c b/common/splash_source.c
index 62763b9..f0b3407 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -25,10 +25,18 @@ static struct spi_flash *sf;
 static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 {
        if (!sf) {
+#ifdef CONFIG_DM_SPI_FLASH
+               /* In DM mode defaults will be taken from DT */
+               sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
+                                    CONFIG_SF_DEFAULT_CS,
+                                    0,
+                                    0);
+#else
                sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
                                     CONFIG_SF_DEFAULT_CS,
                                     CONFIG_SF_DEFAULT_SPEED,
                                     CONFIG_SF_DEFAULT_MODE);
+#endif
                if (!sf)
                        return -ENODEV;
        }
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to