[U-Boot] [PATCH 3/7] da850evm: sf: Read default speed and mode values from DT

Patrick Delaunay patrick.delaunay at st.com
Mon Dec 10 10:52:42 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>
---

 board/davinci/da8xxevm/da850evm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index b0b29b3..4ef454e 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -44,8 +44,15 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define CFG_MAC_ADDR_SPI_BUS	0
 #define CFG_MAC_ADDR_SPI_CS	0
+
+#ifdef CONFIG_DM_SPI_FLASH
+/* In DM mode, speed and mode value will be taken from DT */
+#define CFG_MAC_ADDR_SPI_MAX_HZ	0
+#define CFG_MAC_ADDR_SPI_MODE	0
+#else
 #define CFG_MAC_ADDR_SPI_MAX_HZ	CONFIG_SF_DEFAULT_SPEED
 #define CFG_MAC_ADDR_SPI_MODE	SPI_MODE_3
+#endif
 
 #define CFG_MAC_ADDR_OFFSET	(flash->size - SZ_64K)
 
-- 
2.7.4



More information about the U-Boot mailing list