summaryrefslogtreecommitdiff
path: root/drivers/spi/designware_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/designware_spi.c')
-rw-r--r--drivers/spi/designware_spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 98c9f03..700f616 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -164,13 +164,13 @@ static void spi_hw_init(struct dw_spi_priv *priv)
if (!priv->fifo_len) {
u32 fifo;
- for (fifo = 2; fifo <= 257; fifo++) {
+ for (fifo = 2; fifo <= 256; fifo++) {
dw_writew(priv, DW_SPI_TXFLTR, fifo);
if (fifo != dw_readw(priv, DW_SPI_TXFLTR))
break;
}
- priv->fifo_len = (fifo == 257) ? 0 : fifo;
+ priv->fifo_len = (fifo == 2) ? 0 : fifo - 1;
dw_writew(priv, DW_SPI_TXFLTR, 0);
}
debug("%s: fifo_len=%d\n", __func__, priv->fifo_len);
@@ -409,7 +409,7 @@ static const struct dm_spi_ops dw_spi_ops = {
};
static const struct udevice_id dw_spi_ids[] = {
- { .compatible = "snps,dw-spi-mmio" },
+ { .compatible = "snps,dw-apb-ssi" },
{ }
};