X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fspi_flash.h;h=0b23f57a71b34f502f8801dcaa11d6f3158e2fd2;hb=51f6c52e6b12d7bc7a82db566057efe731f5aae9;hp=97ec2b3e586186067209a8b74febe2cf17a22559;hpb=14453fbfadc2f98ca35d6033140466c7a4b4947a;p=oweals%2Fu-boot.git diff --git a/include/spi_flash.h b/include/spi_flash.h index 97ec2b3e58..0b23f57a71 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -13,6 +13,20 @@ #include #include +/* by default ENV use the same parameters than SF command */ +#ifndef CONFIG_ENV_SPI_BUS +# define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS +#endif +#ifndef CONFIG_ENV_SPI_CS +# define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS +#endif +#ifndef CONFIG_ENV_SPI_MAX_HZ +# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#endif +#ifndef CONFIG_ENV_SPI_MODE +# define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE +#endif + struct spi_slave; struct dm_spi_flash_ops { @@ -88,6 +102,18 @@ int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len); */ int spl_flash_get_sw_write_prot(struct udevice *dev); +/** + * spi_flash_std_probe() - Probe a SPI flash device + * + * This is the standard internal method for probing a SPI flash device to + * determine its type. It can be used in chip-specific drivers which need to + * do this, typically with of-platdata + * + * @dev: SPI-flash device to probe + * @return 0 if OK, -ve on error + */ +int spi_flash_std_probe(struct udevice *dev); + int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs, unsigned int max_hz, unsigned int spi_mode, struct udevice **devp);