diff options
author | Tom Rini <trini@konsulko.com> | 2019-12-27 16:46:15 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-27 16:46:15 -0500 |
commit | 1058bc5ccce5ffcd1e545313c3e032c8923aa7f0 (patch) | |
tree | 1672c83acacaf199421249d9a92ca56798eaa287 /drivers/mtd/spi | |
parent | 5278e25d99e278d764d6c0dff7d2ba898de0f367 (diff) | |
parent | dbbdc81c6064b4cb7ffc796b71713a19488a2c4c (diff) |
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi
- rk spi transfer limit fix
- Gigadevice, gd25q128 support
- spi-nor-core warnings
Diffstat (limited to 'drivers/mtd/spi')
-rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 6 | ||||
-rw-r--r-- | drivers/mtd/spi/spi-nor-ids.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 5a8c084255..eb49a6c11c 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -546,6 +546,9 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) dev_dbg(nor->dev, "at 0x%llx, len %lld\n", (long long)instr->addr, (long long)instr->len); + if (!instr->len) + return 0; + div_u64_rem(instr->len, mtd->erasesize, &rem); if (rem) return -EINVAL; @@ -1226,6 +1229,9 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len); + if (!len) + return 0; + for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index d3b84574ac..973b6f86c9 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -108,6 +108,11 @@ const struct flash_info spi_nor_ids[] = { SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, { + INFO("gd25q128", 0xc84018, 0, 64 * 1024, 256, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, + { INFO("gd25lq128", 0xc86018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) |