[U-Boot] [PATCH 2/2] splash: sf: Read default speed and mode values from DT
Patrick Delaunay
patrick.delaunay at st.com
Thu Nov 8 16:57:20 UTC 2018
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.delaunay at 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
More information about the U-Boot
mailing list