summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVenkatesh Yadav Abbarapu <[email protected]>2024-06-14 18:18:10 +0530
committerMichal Simek <[email protected]>2024-08-05 16:10:36 +0200
commit7d84ad1da0e32f4525cee9b35bc5a4f3b5585ed8 (patch)
tree510151b9bcf2bd22bd6352bd84bc16a8ac954418 /include
parentc43d65e2664397141834bad6f08711bdb8b2df70 (diff)
env_spi: support overriding spi dev from board code
This enables boards to choose where to/from the environment should be saved/loaded. They can then for example support using the same device (dynamically) from which the bootloader was launched to load and save env data and do not have to define CONFIG_ENV_SPI_BUS statically. In my use case, the environment needs to be on the same device I booted from. It can be the QSPI or OSPI device. I therefore would override spi_get_env_dev in the board code, read the bootmode registers to determine where we booted from and return the corresponding device index. Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]> # Move spi_get_env_dev to sf.c
Diffstat (limited to 'include')
-rw-r--r--include/spi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/spi.h b/include/spi.h
index 7e38cc2a2ad..9e9851284c8 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -743,4 +743,6 @@ int dm_spi_get_mmap(struct udevice *dev, ulong *map_basep, uint *map_sizep,
#define spi_get_ops(dev) ((struct dm_spi_ops *)(dev)->driver->ops)
#define spi_emul_get_ops(dev) ((struct dm_spi_emul_ops *)(dev)->driver->ops)
+int spi_get_env_dev(void);
+
#endif /* _SPI_H_ */