Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1580167 > unrolled thread
| Started by | Andy Yan <andy.yan@rock-chips.com> |
|---|---|
| First post | 2017-02-14 01:40 +0100 |
| Last post | 2017-02-14 11:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] mtd: spi-nor: add support for GD25Q256 Andy Yan <andy.yan@rock-chips.com> - 2017-02-14 01:40 +0100
Re: [PATCH] mtd: spi-nor: add support for GD25Q256 Marek Vasut <marek.vasut@gmail.com> - 2017-02-14 06:10 +0100
Re: [PATCH] mtd: spi-nor: add support for GD25Q256 Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2017-02-14 11:40 +0100
| From | Andy Yan <andy.yan@rock-chips.com> |
|---|---|
| Date | 2017-02-14 01:40 +0100 |
| Subject | [PATCH] mtd: spi-nor: add support for GD25Q256 |
| Message-ID | <tazjX-2HA-9@gated-at.bofh.it> |
GD25Q256 is a 32MiB SPI Nor flash from Gigadevice.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---
drivers/mtd/spi-nor/spi-nor.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
mode change 100644 => 100755 drivers/mtd/spi-nor/spi-nor.c
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
old mode 100644
new mode 100755
index da7cd69..0917dd3
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -852,6 +852,10 @@ static const struct flash_info spi_nor_ids[] = {
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
},
+ {
+ "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+ },
/* Intel/Numonyx -- xxxs33b */
{ "160s33b", INFO(0x898911, 0, 64 * 1024, 32, 0) },
@@ -1483,7 +1487,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
else if (mtd->size > 0x1000000) {
/* enable 4-byte addressing if the device exceeds 16MiB */
nor->addr_width = 4;
- if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) {
+ if (JEDEC_MFR(info) == SNOR_MFR_SPANSION ||
+ JEDEC_MFR(info) == SNOR_MFR_GIGADEVICE) {
/* Dedicated 4-byte command set */
switch (nor->flash_read) {
case SPI_NOR_QUAD:
@@ -1519,7 +1524,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
dev_info(dev, "%s (%lld Kbytes)\n", info->name,
(long long)mtd->size >> 10);
-
dev_dbg(dev,
"mtd .name = %s, .size = 0x%llx (%lldMiB), "
".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
--
2.7.4
[toc] | [next] | [standalone]
| From | Marek Vasut <marek.vasut@gmail.com> |
|---|---|
| Date | 2017-02-14 06:10 +0100 |
| Message-ID | <taDxg-5GH-5@gated-at.bofh.it> |
| In reply to | #1580167 |
On 02/14/2017 01:36 AM, Andy Yan wrote:
> GD25Q256 is a 32MiB SPI Nor flash from Gigadevice.
That's great, and what is this patch doing with it ? Adding support for
it, right? Then it should be in the commit message.
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> drivers/mtd/spi-nor/spi-nor.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
> mode change 100644 => 100755 drivers/mtd/spi-nor/spi-nor.c
>
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> old mode 100644
> new mode 100755
> index da7cd69..0917dd3
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -852,6 +852,10 @@ static const struct flash_info spi_nor_ids[] = {
> SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
> SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
> },
> + {
> + "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512,
> + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
> + },
>
> /* Intel/Numonyx -- xxxs33b */
> { "160s33b", INFO(0x898911, 0, 64 * 1024, 32, 0) },
> @@ -1483,7 +1487,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
> else if (mtd->size > 0x1000000) {
> /* enable 4-byte addressing if the device exceeds 16MiB */
> nor->addr_width = 4;
> - if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) {
> + if (JEDEC_MFR(info) == SNOR_MFR_SPANSION ||
> + JEDEC_MFR(info) == SNOR_MFR_GIGADEVICE) {
> /* Dedicated 4-byte command set */
> switch (nor->flash_read) {
> case SPI_NOR_QUAD:
> @@ -1519,7 +1524,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
>
> dev_info(dev, "%s (%lld Kbytes)\n", info->name,
> (long long)mtd->size >> 10);
> -
Drop this one new line.
> dev_dbg(dev,
> "mtd .name = %s, .size = 0x%llx (%lldMiB), "
> ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
>
--
Best regards,
Marek Vasut
[toc] | [prev] | [next] | [standalone]
| From | Cyrille Pitchen <cyrille.pitchen@atmel.com> |
|---|---|
| Date | 2017-02-14 11:40 +0100 |
| Message-ID | <taIGC-HJ-5@gated-at.bofh.it> |
| In reply to | #1580167 |
Hi Andy,
Le 14/02/2017 à 01:36, Andy Yan a écrit :
> GD25Q256 is a 32MiB SPI Nor flash from Gigadevice.
>
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> drivers/mtd/spi-nor/spi-nor.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
> mode change 100644 => 100755 drivers/mtd/spi-nor/spi-nor.c
>
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> old mode 100644
> new mode 100755
> index da7cd69..0917dd3
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -852,6 +852,10 @@ static const struct flash_info spi_nor_ids[] = {
> SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
> SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
> },
> + {
> + "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512,
> + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
> + },
>
> /* Intel/Numonyx -- xxxs33b */
> { "160s33b", INFO(0x898911, 0, 64 * 1024, 32, 0) },
> @@ -1483,7 +1487,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
> else if (mtd->size > 0x1000000) {
> /* enable 4-byte addressing if the device exceeds 16MiB */
> nor->addr_width = 4;
> - if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) {
> + if (JEDEC_MFR(info) == SNOR_MFR_SPANSION ||
> + JEDEC_MFR(info) == SNOR_MFR_GIGADEVICE) {
> /* Dedicated 4-byte command set */
> switch (nor->flash_read) {
> case SPI_NOR_QUAD:
This doesn't apply to the spi-nor tree and also, please use the
SPI_NOR_4B_OPCODES info->flags instead of adding a "JEDEC_MFR(info) ==
SNOR_MFR_GIGADEVICE" line.
I think setting flags at the memory part level is safer than applying a
global policy per manufacturer.
Best regards,
Cyrille
> @@ -1519,7 +1524,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
>
> dev_info(dev, "%s (%lld Kbytes)\n", info->name,
> (long long)mtd->size >> 10);
> -
> dev_dbg(dev,
> "mtd .name = %s, .size = 0x%llx (%lldMiB), "
> ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web