/* NOTE: double check command sets and memory organization when you add
* more nor chips. This current list focusses on newer chips, which
* have been converging on command sets which including JEDEC ID.
-@@ -1014,6 +1073,13 @@ static const struct flash_info spi_nor_i
+@@ -1020,6 +1079,13 @@ static const struct flash_info spi_nor_i
{ "cat25c09", CAT25_INFO( 128, 8, 32, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) },
{ "cat25c17", CAT25_INFO( 256, 8, 32, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) },
{ "cat25128", CAT25_INFO(2048, 8, 64, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) },
{ },
};
-@@ -1054,7 +1120,12 @@ static int spi_nor_read(struct mtd_info
+@@ -1060,7 +1126,12 @@ static int spi_nor_read(struct mtd_info
return ret;
while (len) {
if (ret == 0) {
/* We shouldn't see 0-length reads */
ret = -EIO;
-@@ -1175,8 +1246,23 @@ static int spi_nor_write(struct mtd_info
+@@ -1181,8 +1252,23 @@ static int spi_nor_write(struct mtd_info
for (i = 0; i < len; ) {
ssize_t written;
WARN_ONCE(page_offset,
"Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.",
page_offset);
-@@ -1184,8 +1270,11 @@ static int spi_nor_write(struct mtd_info
+@@ -1190,8 +1276,11 @@ static int spi_nor_write(struct mtd_info
page_remain = min_t(size_t,
nor->page_size - page_offset, len - i);
if (ret < 0)
goto write_err;
written = ret;
-@@ -1319,6 +1408,47 @@ static int spi_nor_check(struct spi_nor
+@@ -1325,6 +1414,47 @@ static int spi_nor_check(struct spi_nor
return 0;
}
int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
{
const struct flash_info *info = NULL;
-@@ -1367,6 +1497,14 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1373,6 +1503,14 @@ int spi_nor_scan(struct spi_nor *nor, co
mutex_init(&nor->lock);
/*
* Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up
* with the software protection bits set
*/
-@@ -1524,6 +1662,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1530,6 +1668,12 @@ int spi_nor_scan(struct spi_nor *nor, co
nor->read_dummy = spi_nor_read_dummy_cycles(nor);