Skip to content
Snippets Groups Projects
Commit 074eed51 authored by Bin Meng's avatar Bin Meng Committed by Jagannadha Sutradharudu Teki
Browse files

dm: sf: Make SST flash write op work again


With SPI flash moving to driver model, commit fbb09918 "dm: Convert
spi_flash_probe() and 'sf probe' to use driver model" ignored the
SST flash-specific write op (byte program & word program), which
actually broke the SST flash from wroking.

This commit makes SST flash work again under driver model, by adding
SST flash-specific handling in the spi_flash_std_write().

Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
parent be7be78e
No related branches found
No related tags found
No related merge requests found
......@@ -446,6 +446,15 @@ int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
{
struct spi_flash *flash = dev_get_uclass_priv(dev);
#if defined(CONFIG_SPI_FLASH_SST)
if (flash->flags & SST_WR) {
if (flash->spi->op_mode_tx & SPI_OPM_TX_BP)
return sst_write_bp(flash, offset, len, buf);
else
return sst_write_wp(flash, offset, len, buf);
}
#endif
return spi_flash_cmd_write_ops(flash, offset, len, buf);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment