projects
/
openwrt
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kernel: bump 4.9 to 4.9.77
[openwrt/openwrt.git]
/
target
/
linux
/
ramips
/
patches-4.9
/
0054-mtd-add-chunked-read-io-to-m25p80.patch
diff --git
a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
index ffea0b45db171c613e53d9ebbd4809ff0ca1ac4a..d6133e15965e707a928cf3c35a2e6d9ea0427d37 100644
(file)
--- a/
target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/
target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
@@
-1,6
+1,6
@@
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1
381,6 +1381,66
@@ write_err:
+@@ -1
453,6 +1453,67
@@ write_err:
return ret;
}
return ret;
}
@@
-8,6
+8,7
@@
+ size_t *_retlen, const u_char *_buf)
+{
+ struct spi_nor *nor = mtd_to_spi_nor(mtd);
+ size_t *_retlen, const u_char *_buf)
+{
+ struct spi_nor *nor = mtd_to_spi_nor(mtd);
++ u32 addr_width = nor->addr_width + !!(nor->flags & SNOR_F_4B_EXT_ADDR);
+ int chunk_size;
+ int retlen = 0;
+ int ret;
+ int chunk_size;
+ int retlen = 0;
+ int ret;
@@
-16,8
+17,8
@@
+ if (!chunk_size)
+ chunk_size = _len;
+
+ if (!chunk_size)
+ chunk_size = _len;
+
-+ if (
nor->
addr_width > 3)
-+ chunk_size -=
nor->
addr_width - 3;
++ if (addr_width > 3)
++ chunk_size -= addr_width - 3;
+
+ while (retlen < _len) {
+ size_t len = min_t(int, chunk_size, _len - retlen);
+
+ while (retlen < _len) {
+ size_t len = min_t(int, chunk_size, _len - retlen);
@@
-67,7
+68,7
@@
static int macronix_quad_enable(struct spi_nor *nor)
{
int ret, val;
static int macronix_quad_enable(struct spi_nor *nor)
{
int ret, val;
-@@ -1
623,10 +1683
,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1
704,10 +1765
,12 @@ int spi_nor_scan(struct spi_nor *nor, co
}
/* sst nor chips use AAI word program */
}
/* sst nor chips use AAI word program */
@@
-82,7
+83,7
@@
if (info->flags & USE_FSR)
nor->flags |= SNOR_F_USE_FSR;
if (info->flags & USE_FSR)
nor->flags |= SNOR_F_USE_FSR;
-@@ -1
656,11 +1718
,20 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1
739,11 +1802
,20 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->writebufsize = nor->page_size;
if (np) {
mtd->writebufsize = nor->page_size;
if (np) {
@@
-105,15
+106,15
@@
nor->flash_read = SPI_NOR_FAST;
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
nor->flash_read = SPI_NOR_FAST;
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
-@@ -141,6 +141,7 @@ enum spi_nor_option_flags {
- SNOR_F_NO_OP_CHIP_ERASE = BIT(2),
+@@ -143,6 +143,7 @@ enum spi_nor_option_flags {
SNOR_F_S3AN_ADDR_DEFAULT = BIT(3),
SNOR_F_READY_XSR_RDY = BIT(4),
SNOR_F_S3AN_ADDR_DEFAULT = BIT(3),
SNOR_F_READY_XSR_RDY = BIT(4),
-+ SNOR_F_SST = BIT(5),
+ SNOR_F_4B_EXT_ADDR = BIT(5),
++ SNOR_F_SST = BIT(6),
};
/**
};
/**
-@@ -18
0,6 +181
,7 @@ struct spi_nor {
+@@ -18
2,6 +183
,7 @@ struct spi_nor {
struct mutex lock;
struct device *dev;
u32 page_size;
struct mutex lock;
struct device *dev;
u32 page_size;