Skip to content

Commit

Permalink
add W25N01GW and GD5F1GQ4RB9IG
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkucera committed Jan 19, 2023
1 parent e9c27d3 commit a76fcf9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/spi_nand_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@

/* SPI NAND Device ID */
#define _SPI_NAND_DEVICE_ID_GD5F1GQ4UAYIG 0xF1
#define _SPI_NAND_DEVICE_ID_GD5F1GQ4RB9IG 0xC1
#define _SPI_NAND_DEVICE_ID_GD5F1GQ4UBYIG 0xD1
#define _SPI_NAND_DEVICE_ID_GD5F1GQ4UCYIG 0xB1
#define _SPI_NAND_DEVICE_ID_GD5F2GQ4UBYIG 0xD2
Expand All @@ -133,6 +134,8 @@
#define _SPI_NAND_DEVICE_ID_F50L2G41LB 0x0A
#define _SPI_NAND_DEVICE_ID_1_W25N01GV 0xAA
#define _SPI_NAND_DEVICE_ID_2_W25N01GV 0x21
#define _SPI_NAND_DEVICE_ID_1_W25N01GW 0xBA
#define _SPI_NAND_DEVICE_ID_2_W25N01GW 0x21
#define _SPI_NAND_DEVICE_ID_1_W25N02KV 0xAA
#define _SPI_NAND_DEVICE_ID_2_W25N02KV 0x22
#define _SPI_NAND_DEVICE_ID_1_W25M02GV 0xAB
Expand Down Expand Up @@ -500,6 +503,21 @@ static const struct SPI_NAND_FLASH_INFO_T spi_nand_flash_tables[] = {
feature: SPI_NAND_FLASH_FEATURE_NONE,
},

{
mfr_id: _SPI_NAND_MANUFACTURER_ID_GIGADEVICE,
dev_id: _SPI_NAND_DEVICE_ID_GD5F1GQ4RB9IG,
ptr_name: "GIGADEVICE GD5F1GQ4xBxIG",
device_size: _SPI_NAND_CHIP_SIZE_1GBIT,
page_size: _SPI_NAND_PAGE_SIZE_2KBYTE,
oob_size: _SPI_NAND_OOB_SIZE_128BYTE,
erase_size: _SPI_NAND_BLOCK_SIZE_128KBYTE,
dummy_mode: SPI_NAND_FLASH_READ_DUMMY_BYTE_APPEND,
read_mode: SPI_NAND_FLASH_READ_SPEED_MODE_DUAL,
write_mode: SPI_NAND_FLASH_WRITE_SPEED_MODE_SINGLE,
oob_free_layout: &ooblayout_gigadevice_a,
feature: SPI_NAND_FLASH_FEATURE_NONE,
},

{
mfr_id: _SPI_NAND_MANUFACTURER_ID_GIGADEVICE,
dev_id: _SPI_NAND_DEVICE_ID_GD5F1GQ4UBYIG,
Expand Down Expand Up @@ -726,6 +744,22 @@ static const struct SPI_NAND_FLASH_INFO_T spi_nand_flash_tables[] = {
feature: SPI_NAND_FLASH_FEATURE_NONE,
},

{
mfr_id: _SPI_NAND_MANUFACTURER_ID_WINBOND,
dev_id: _SPI_NAND_DEVICE_ID_1_W25N01GW,
dev_id_2: _SPI_NAND_DEVICE_ID_2_W25N01GW,
ptr_name: "WINBOND W25N01G",
device_size: _SPI_NAND_CHIP_SIZE_1GBIT,
page_size: _SPI_NAND_PAGE_SIZE_2KBYTE,
oob_size: _SPI_NAND_OOB_SIZE_64BYTE,
erase_size: _SPI_NAND_BLOCK_SIZE_128KBYTE,
dummy_mode: SPI_NAND_FLASH_READ_DUMMY_BYTE_APPEND,
read_mode: SPI_NAND_FLASH_READ_SPEED_MODE_DUAL,
write_mode: SPI_NAND_FLASH_WRITE_SPEED_MODE_SINGLE,
oob_free_layout: &ooblayout_winbond,
feature: SPI_NAND_FLASH_FEATURE_NONE,
},

{
mfr_id: _SPI_NAND_MANUFACTURER_ID_WINBOND,
dev_id: _SPI_NAND_DEVICE_ID_1_W25N02KV,
Expand Down Expand Up @@ -2594,6 +2628,7 @@ static SPI_NAND_FLASH_RTN_T ecc_fail_check( u32 page_number )

if((ptr_dev_info_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) &&
((ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UAYIG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4RB9IG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UBYIG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UCYIG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UEYIS) ||
Expand All @@ -2606,6 +2641,7 @@ static SPI_NAND_FLASH_RTN_T ecc_fail_check( u32 page_number )
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F4GQ4UCYIG)))
{
if((ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UAYIG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4RB9IG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UBYIG) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UEYIS) ||
(ptr_dev_info_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ5UEYIG) ||
Expand Down Expand Up @@ -3466,6 +3502,7 @@ static void spi_nand_manufacute_init( struct SPI_NAND_FLASH_INFO_T *ptr_device_t
_SPI_NAND_DEBUG_PRINTF(SPI_NAND_FLASH_DEBUG_LEVEL_1,"SPI NAND Chip Init : Unlock all block and Enable Quad Mode\n");

if(((ptr_device_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) && (ptr_device_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UAYIG)) ||
((ptr_device_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) && (ptr_device_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4RB9IG)) ||
((ptr_device_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) && (ptr_device_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UBYIG)) ||
((ptr_device_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) && (ptr_device_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UCYIG)) ||
((ptr_device_t->mfr_id == _SPI_NAND_MANUFACTURER_ID_GIGADEVICE) && (ptr_device_t->dev_id == _SPI_NAND_DEVICE_ID_GD5F1GQ4UEYIS)) ||
Expand Down

0 comments on commit a76fcf9

Please sign in to comment.