diff options
author | Tom Rini | 2018-06-28 09:04:41 -0400 |
---|---|---|
committer | Tom Rini | 2018-06-28 09:04:41 -0400 |
commit | fb77a9e3537039664ad42992bef6688869eda7c1 (patch) | |
tree | c493b2ea4e38e252732de6c453a2156b7a11afdc /drivers | |
parent | af15946aa081dbcd0bec7d507a2b2db4e6b6cda5 (diff) | |
parent | 51dce7d2bfdecd974412634e4a0758ac55edcc00 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-spi
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/spi/spi_flash_ids.c | 2 | ||||
-rw-r--r-- | drivers/spi/mxc_spi.c | 8 | ||||
-rw-r--r-- | drivers/spi/omap3_spi.c | 18 | ||||
-rw-r--r-- | drivers/spi/zynq_qspi.c | 2 |
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 c45d2e80be0..54d491c8734 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 b77129cc317..0dccc38b82d 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 4169abdef67..766436ea5f9 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 ee8796d470b..9ad1927a5d5 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) |