Skip to content

Commit

Permalink
mtd_spi_nor: add 4-byte address flash support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Dupont committed May 14, 2018
1 parent d6f9be7 commit 53b3d1a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/include/mtd_spi_nor.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ extern const mtd_desc_t mtd_spi_nor_driver;
* sensible for default values. */
extern const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default;

/**
* @brief Default 4-byte addresses opcodes
*
* Commands for 4-byte addresses chips (above 128Mb)
*/
extern const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default_4bytes;

#ifdef __cplusplus
}
#endif
Expand Down
16 changes: 16 additions & 0 deletions drivers/mtd_spi_nor/mtd_spi_nor_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@ const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default = {
.wake = 0xab,
};

const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default_4bytes = {
.rdid = 0x9f,
.wren = 0x06,
.rdsr = 0x05,
.wrsr = 0x01,
.read = 0x13,
.read_fast = 0x0c,
.page_program = 0x12,
.sector_erase = 0x21,
.block_erase_32k = 0x5c,
.block_erase = 0xdc,
.chip_erase = 0xc7,
.sleep = 0xb9,
.wake = 0xab,
};

/** @} */

0 comments on commit 53b3d1a

Please sign in to comment.