All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Delaunay <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] splash: sf: Read default speed and mode values from DT
Date: Thu, 8 Nov 2018 17:57:20 +0100	[thread overview]
Message-ID: <1541696240-11680-3-git-send-email-patrick.delaunay@st.com> (raw)
In-Reply-To: <1541696240-11680-1-git-send-email-patrick.delaunay@st.com>

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@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

      parent reply	other threads:[~2018-11-08 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 16:57 [U-Boot] [PATCH 0/2] Read default speed and mode values from DT Patrick Delaunay
2018-11-08 16:57 ` [U-Boot] [PATCH 1/2] spl_spi: " Patrick Delaunay
2018-11-09  6:44   ` Simon Goldschmidt
2018-11-12 12:32     ` Patrick DELAUNAY
2018-11-08 16:57 ` Patrick Delaunay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541696240-11680-3-git-send-email-patrick.delaunay@st.com \
    --to=patrick.delaunay@st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.