All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] sf: add support for GD25Q256
@ 2017-08-04  9:33 Andy Yan
  2017-08-07  8:44 ` Jagan Teki
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Yan @ 2017-08-04  9:33 UTC (permalink / raw)
  To: u-boot

Add support for GD25Q256, a 32MiB SPI Nor
flash from Gigadevice.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

 drivers/mtd/spi/sf_internal.h   | 1 +
 drivers/mtd/spi/spi_flash.c     | 7 ++++---
 drivers/mtd/spi/spi_flash_ids.c | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 839cdbe..357b3bc 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -37,6 +37,7 @@ enum spi_nor_option_flags {
 #define SPI_FLASH_CFI_MFR_SST		0xbf
 #define SPI_FLASH_CFI_MFR_WINBOND	0xef
 #define SPI_FLASH_CFI_MFR_ATMEL		0x1f
+#define SPI_FLASH_CIF_MFR_GIGADEVICE	0xc8
 
 /* Erase commands */
 #define CMD_ERASE_4K			0x20
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 0034a28..cf23077 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -74,7 +74,7 @@ static int write_sr(struct spi_flash *flash, u8 ws)
 	return 0;
 }
 
-#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
+#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND) || defined(CONFIG_SPI_FLASH_GIGADEVICE)
 static int read_cr(struct spi_flash *flash, u8 *rc)
 {
 	int ret;
@@ -807,7 +807,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 #endif
 
 
-#ifdef CONFIG_SPI_FLASH_MACRONIX
+#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_GIGADEVICE)
 static int macronix_quad_enable(struct spi_flash *flash)
 {
 	u8 qeb_status;
@@ -892,8 +892,9 @@ static int set_quad_mode(struct spi_flash *flash,
 			 const struct spi_flash_info *info)
 {
 	switch (JEDEC_MFR(info)) {
-#ifdef CONFIG_SPI_FLASH_MACRONIX
+#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_GIGADEVICE)
 	case SPI_FLASH_CFI_MFR_MACRONIX:
+	case SPI_FLASH_CIF_MFR_GIGADEVICE:
 		return macronix_quad_enable(flash);
 #endif
 #if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
diff --git a/drivers/mtd/spi/spi_flash_ids.c b/drivers/mtd/spi/spi_flash_ids.c
index edca94e..46d5e67 100644
--- a/drivers/mtd/spi/spi_flash_ids.c
+++ b/drivers/mtd/spi/spi_flash_ids.c
@@ -65,6 +65,7 @@ const struct spi_flash_info spi_flash_ids[] = {
 #ifdef CONFIG_SPI_FLASH_GIGADEVICE	/* GIGADEVICE */
 	{"gd25q64b",	   INFO(0xc84017, 0x0, 64 * 1024,   128, SECT_4K) },
 	{"gd25lq32",	   INFO(0xc86016, 0x0, 64 * 1024,    64, SECT_4K) },
+	{"GD25Q256",       INFO(0xc84019, 0x0, 64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K)},
 #endif
 #ifdef CONFIG_SPI_FLASH_ISSI		/* ISSI */
 	{"is25lp032",	   INFO(0x9d6016, 0x0, 64 * 1024,    64, 0) },
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/2] sf: add support for GD25Q256
  2017-08-04  9:33 [U-Boot] [PATCH 1/2] sf: add support for GD25Q256 Andy Yan
@ 2017-08-07  8:44 ` Jagan Teki
  2017-08-08  9:13   ` Andy Yan
  0 siblings, 1 reply; 3+ messages in thread
From: Jagan Teki @ 2017-08-07  8:44 UTC (permalink / raw)
  To: u-boot

On Fri, Aug 4, 2017 at 3:03 PM, Andy Yan <andy.yan@rock-chips.com> wrote:
> Add support for GD25Q256, a 32MiB SPI Nor
> flash from Gigadevice.
>
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
>
>  drivers/mtd/spi/sf_internal.h   | 1 +
>  drivers/mtd/spi/spi_flash.c     | 7 ++++---
>  drivers/mtd/spi/spi_flash_ids.c | 1 +
>  3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index 839cdbe..357b3bc 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -37,6 +37,7 @@ enum spi_nor_option_flags {
>  #define SPI_FLASH_CFI_MFR_SST          0xbf
>  #define SPI_FLASH_CFI_MFR_WINBOND      0xef
>  #define SPI_FLASH_CFI_MFR_ATMEL                0x1f
> +#define SPI_FLASH_CIF_MFR_GIGADEVICE   0xc8
>
>  /* Erase commands */
>  #define CMD_ERASE_4K                   0x20
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 0034a28..cf23077 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -74,7 +74,7 @@ static int write_sr(struct spi_flash *flash, u8 ws)
>         return 0;
>  }
>
> -#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
> +#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND) || defined(CONFIG_SPI_FLASH_GIGADEVICE)
>  static int read_cr(struct spi_flash *flash, u8 *rc)
>  {
>         int ret;
> @@ -807,7 +807,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
>  #endif
>
>
> -#ifdef CONFIG_SPI_FLASH_MACRONIX
> +#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_GIGADEVICE)

So GB and Macronix has same procedure bit for Quadenable? in that case
why you need read_cr bcz it is part of spansion.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/2] sf: add support for GD25Q256
  2017-08-07  8:44 ` Jagan Teki
@ 2017-08-08  9:13   ` Andy Yan
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Yan @ 2017-08-08  9:13 UTC (permalink / raw)
  To: u-boot

Hi Jagan:

2017-08-07 16:44 GMT+08:00 Jagan Teki <jagannadh.teki@gmail.com>:

> On Fri, Aug 4, 2017 at 3:03 PM, Andy Yan <andy.yan@rock-chips.com> wrote:
> > Add support for GD25Q256, a 32MiB SPI Nor
> > flash from Gigadevice.
> >
> > Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> > ---
> >
> >  drivers/mtd/spi/sf_internal.h   | 1 +
> >  drivers/mtd/spi/spi_flash.c     | 7 ++++---
> >  drivers/mtd/spi/spi_flash_ids.c | 1 +
> >  3 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mtd/spi/sf_internal.h
> b/drivers/mtd/spi/sf_internal.h
> > index 839cdbe..357b3bc 100644
> > --- a/drivers/mtd/spi/sf_internal.h
> > +++ b/drivers/mtd/spi/sf_internal.h
> > @@ -37,6 +37,7 @@ enum spi_nor_option_flags {
> >  #define SPI_FLASH_CFI_MFR_SST          0xbf
> >  #define SPI_FLASH_CFI_MFR_WINBOND      0xef
> >  #define SPI_FLASH_CFI_MFR_ATMEL                0x1f
> > +#define SPI_FLASH_CIF_MFR_GIGADEVICE   0xc8
> >
> >  /* Erase commands */
> >  #define CMD_ERASE_4K                   0x20
> > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> > index 0034a28..cf23077 100644
> > --- a/drivers/mtd/spi/spi_flash.c
> > +++ b/drivers/mtd/spi/spi_flash.c
> > @@ -74,7 +74,7 @@ static int write_sr(struct spi_flash *flash, u8 ws)
> >         return 0;
> >  }
> >
> > -#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_
> WINBOND)
> > +#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
> || defined(CONFIG_SPI_FLASH_GIGADEVICE)
> >  static int read_cr(struct spi_flash *flash, u8 *rc)
> >  {
> >         int ret;
> > @@ -807,7 +807,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs,
> size_t len)
> >  #endif
> >
> >
> > -#ifdef CONFIG_SPI_FLASH_MACRONIX
> > +#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_
> GIGADEVICE)
>
> So GB and Macronix has same procedure bit for Quadenable? in that case
> why you need read_cr bcz it is part of spansion.
>


 Sorr, I forgot remove it. It has been removed in V2.



> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-08  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04  9:33 [U-Boot] [PATCH 1/2] sf: add support for GD25Q256 Andy Yan
2017-08-07  8:44 ` Jagan Teki
2017-08-08  9:13   ` Andy Yan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.