@@ -224,6 +224,14 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
size_t len, void *data);
+int clean_bar(struct spi_flash *flash);
+int write_bar(struct spi_flash *flash, u32 offset);
+
+int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
+ const void *buf);
+int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len);
+int spi_flash_std_probe(struct udevice *dev);
+
#ifdef CONFIG_SPI_FLASH_MTD
int spi_flash_mtd_register(struct spi_flash *flash);
void spi_flash_mtd_unregister(void);
@@ -100,8 +100,8 @@ static int spi_flash_std_read(struct udevice *dev, u32 offset, size_t len,
return log_ret(spi_flash_cmd_read_ops(flash, offset, len, buf));
}
-static int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
- const void *buf)
+int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
+ const void *buf)
{
struct spi_flash *flash = dev_get_uclass_priv(dev);
@@ -117,7 +117,7 @@ static int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
return spi_flash_cmd_write_ops(flash, offset, len, buf);
}
-static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)
+int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)
{
struct spi_flash *flash = dev_get_uclass_priv(dev);
@@ -131,7 +131,7 @@ static int spi_flash_std_get_sw_write_prot(struct udevice *dev)
return spi_flash_cmd_get_sw_write_prot(flash);
}
-static int spi_flash_std_probe(struct udevice *dev)
+int spi_flash_std_probe(struct udevice *dev)
{
struct spi_slave *slave = dev_get_parent_priv(dev);
struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
@@ -133,7 +133,7 @@ int spi_flash_cmd_get_sw_write_prot(struct spi_flash *flash)
* Otherwise, the BA24 bit may be left set and then after reset, the
* ROM would read/write/erase SPL from 16 MiB * bank_sel address.
*/
-static int clean_bar(struct spi_flash *flash)
+int clean_bar(struct spi_flash *flash)
{
u8 cmd, bank_sel = 0;
@@ -145,7 +145,7 @@ static int clean_bar(struct spi_flash *flash)
return spi_flash_write_common(flash, &cmd, 1, &bank_sel, 1);
}
-static int write_bar(struct spi_flash *flash, u32 offset)
+int write_bar(struct spi_flash *flash, u32 offset)
{
u8 cmd, bank_sel;
int ret;
Expose the following functions: clean_bar, write_bar, spi_flash_std_write, spi_flash_std_erase and spi_flash_std_probe to sf_internal.h to be able to reuse them. Cc: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> --- drivers/mtd/spi/sf_internal.h | 8 ++++++++ drivers/mtd/spi/sf_probe.c | 8 ++++---- drivers/mtd/spi/spi_flash.c | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-)