Add support for GD25Q256, a 32MiB SPI Nor flash from Gigadevice. Signed-off-by: Andy Yan <andy....@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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot