summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/spi/spi_flash_ids.c2
-rw-r--r--drivers/spi/mxc_spi.c8
-rw-r--r--drivers/spi/omap3_spi.c18
-rw-r--r--drivers/spi/zynq_qspi.c2
4 files changed, 14 insertions, 16 deletions
diff --git a/drivers/mtd/spi/spi_flash_ids.c b/drivers/mtd/spi/spi_flash_ids.c
index c45d2e80be..54d491c873 100644
--- a/drivers/mtd/spi/spi_flash_ids.c
+++ b/drivers/mtd/spi/spi_flash_ids.c
@@ -110,7 +110,7 @@ const struct spi_flash_info spi_flash_ids[] = {
{"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024, 128, RD_FULL | WR_QPP) },
{"s25fs256s_64k", INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
{"s25fl256s_64k", INFO(0x010219, 0x4d01, 64 * 1024, 512, RD_FULL | WR_QPP) },
- {"s25fs512s", INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
+ {"s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256, RD_FULL | WR_QPP | SECT_4K) },
{"s25fl512s_256k", INFO(0x010220, 0x4d00, 256 * 1024, 256, RD_FULL | WR_QPP) },
{"s25fl512s_64k", INFO(0x010220, 0x4d01, 64 * 1024, 1024, RD_FULL | WR_QPP) },
{"s25fl512s_512k", INFO(0x010220, 0x4f00, 256 * 1024, 256, RD_FULL | WR_QPP) },
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index b77129cc31..0dccc38b82 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -60,7 +60,7 @@ static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
{
if (CONFIG_IS_ENABLED(DM_SPI)) {
- dm_gpio_set_value(&mxcs->ss, mxcs->ss_pol);
+ dm_gpio_set_value(&mxcs->ss, 1);
} else {
if (mxcs->gpio > 0)
gpio_set_value(mxcs->gpio, mxcs->ss_pol);
@@ -70,7 +70,7 @@ static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
{
if (CONFIG_IS_ENABLED(DM_SPI)) {
- dm_gpio_set_value(&mxcs->ss, !(mxcs->ss_pol));
+ dm_gpio_set_value(&mxcs->ss, 0);
} else {
if (mxcs->gpio > 0)
gpio_set_value(mxcs->gpio, !(mxcs->ss_pol));
@@ -504,11 +504,11 @@ static int mxc_spi_probe(struct udevice *bus)
return -EINVAL;
}
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
if (plat->base == FDT_ADDR_T_NONE)
return -ENODEV;
- ret = dm_gpio_set_value(&plat->ss, !(mxcs->ss_pol));
+ ret = dm_gpio_set_value(&plat->ss, 0);
if (ret) {
dev_err(bus, "Setting cs error\n");
return ret;
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 4169abdef6..766436ea5f 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -590,6 +590,8 @@ static int omap3_spi_claim_bus(struct udevice *dev)
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
priv->cs = slave_plat->cs;
+ priv->freq = slave_plat->max_hz;
+
_omap3_spi_claim_bus(priv);
return 0;
@@ -648,12 +650,10 @@ static int omap3_spi_xfer(struct udevice *dev, unsigned int bitlen,
static int omap3_spi_set_speed(struct udevice *dev, unsigned int speed)
{
- struct udevice *bus = dev->parent;
- struct omap3_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
- priv->cs = slave_plat->cs;
- priv->freq = slave_plat->max_hz;
+ struct omap3_spi_priv *priv = dev_get_priv(dev);
+
+ priv->freq = speed;
_omap3_spi_set_speed(priv);
return 0;
@@ -661,12 +661,10 @@ static int omap3_spi_set_speed(struct udevice *dev, unsigned int speed)
static int omap3_spi_set_mode(struct udevice *dev, uint mode)
{
- struct udevice *bus = dev->parent;
- struct omap3_spi_priv *priv = dev_get_priv(bus);
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct omap3_spi_priv *priv = dev_get_priv(dev);
+
+ priv->mode = mode;
- priv->cs = slave_plat->cs;
- priv->mode = slave_plat->mode;
_omap3_spi_set_mode(priv);
return 0;
diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
index ee8796d470..9ad1927a5d 100644
--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
@@ -486,7 +486,7 @@ static int zynq_qspi_transfer(struct zynq_qspi_priv *priv)
break;
}
- return 0;
+ return status;
}
static int zynq_qspi_claim_bus(struct udevice *dev)