From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Delaunay Date: Mon, 19 Nov 2018 18:33:10 +0100 Subject: [U-Boot] [PATCH v2 2/2] splash: sf: Read default speed and mode values from DT In-Reply-To: <1542648790-21362-1-git-send-email-patrick.delaunay@st.com> References: <1542648790-21362-1-git-send-email-patrick.delaunay@st.com> Message-ID: <1542648790-21362-3-git-send-email-patrick.delaunay@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes in v2: - use variables to avoid duplicated code common/splash_source.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/splash_source.c b/common/splash_source.c index 62763b9..427196c 100644 --- a/common/splash_source.c +++ b/common/splash_source.c @@ -24,11 +24,19 @@ DECLARE_GLOBAL_DATA_PTR; static struct spi_flash *sf; static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size) { + unsigned int max_hz = CONFIG_SF_DEFAULT_SPEED; + unsigned int spi_mode = CONFIG_SF_DEFAULT_MODE; + +#ifdef CONFIG_DM_SPI_FLASH + /* In DM mode defaults will be taken from DT */ + max_hz = 0, spi_mode = 0; +#endif + if (!sf) { sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS, - CONFIG_SF_DEFAULT_SPEED, - CONFIG_SF_DEFAULT_MODE); + max_hz, + spi_mode); if (!sf) return -ENODEV; } -- 2.7.4