aboutsummaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2019-02-27 15:36:44 +0100
committerJagan Teki <jagan@amarulasolutions.com>2019-04-12 11:54:50 +0530
commitb0cc1b846fcb310c0ac2f8cbeb4ed5947dc52912 (patch)
tree7d112ac9bc6474fe26d616721e49d672b9413f51 /include/spi.h
parentf909ddb3e1770a5ef18606b46000e0d3eaf63b2e (diff)
downloadu-boot-b0cc1b846fcb310c0ac2f8cbeb4ed5947dc52912.zip
u-boot-b0cc1b846fcb310c0ac2f8cbeb4ed5947dc52912.tar.gz
u-boot-b0cc1b846fcb310c0ac2f8cbeb4ed5947dc52912.tar.bz2
dm: spi: Read default speed and mode values from DT
This patch update the behavior introduced by commit 96907c0fe50a ("dm: spi: Read default speed and mode values from DT") In case of DT boot, don't read default speed and mode for SPI from CONFIG_* but instead read from DT node. This will make sure that boards with multiple SPI/QSPI controllers can be probed at different bus frequencies and SPI modes. Remove also use in boards of the value speed=0 (no more supported) for ENV in SPI by using CONFIG_ENV_SPI_MAX_HZ=0. DT values will be always used when available (full DM support of SPI slave with available DT node) even if speed and mode are requested; for example in splash screen support (in splash_sf_read_raw) or in SPL boot (in spl_spi_load_image). The caller of spi_get_bus_and_cs() no more need to force speed=0. But the current behavior don't change if the SPI slave is not present (device with generic driver is created automatically) or if platdata is used (CONFIG_OF_PLATDATA). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/spi.h b/include/spi.h
index 92427e5..3785941 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -496,14 +496,15 @@ int spi_find_bus_and_cs(int busnum, int cs, struct udevice **busp,
* device and slave device.
*
* If no such slave exists, and drv_name is not NULL, then a new slave device
- * is automatically bound on this chip select.
+ * is automatically bound on this chip select with requested speed and mode.
*
- * Ths new slave device is probed ready for use with the given speed and mode.
+ * Ths new slave device is probed ready for use with the speed and mode
+ * from platdata when available or the requested values.
*
* @busnum: SPI bus number
* @cs: Chip select to look for
- * @speed: SPI speed to use for this slave
- * @mode: SPI mode to use for this slave
+ * @speed: SPI speed to use for this slave when not available in platdata
+ * @mode: SPI mode to use for this slave when not available in platdata
* @drv_name: Name of driver to attach to this chip select
* @dev_name: Name of the new device thus created
* @busp: Returns bus device