Loading...
Searching...
No Matches
Serial NOR flash

Driver for serial NOR flash memory technology devices attached via SPI. More...

Detailed Description

Driver for serial NOR flash memory technology devices attached via SPI.

Files

file  mtd_spi_nor.h
 Interface definition for the serial flash memory driver.
 

Data Structures

struct  mtd_spi_nor_opcode_t
 SPI NOR flash opcode table. More...
 
struct  mtd_jedec_id_t
 Internal representation of JEDEC memory ID codes. More...
 
struct  mtd_spi_nor_params_t
 Compile-time parameters for a serial flash device. More...
 
struct  mtd_spi_nor_t
 Device descriptor for serial flash memory devices. More...
 

Macros

#define JEDEC_NEXT_BANK   (0x7f)
 Byte to signal increment bank number when reading manufacturer ID.
 
#define JEDEC_BANK_MAX   (10)
 The highest possible bank number when reading manufacturer ID.
 
#define SPI_NOR_F_SECT_4K   (1)
 Flag to set when the device support 4KiB sector erase (sector_erase opcode)
 
#define SPI_NOR_F_SECT_32K   (2)
 Flag to set when the device support 32KiB block erase (block_erase_32k opcode)
 
#define SPI_NOR_F_SECT_64K   (4)
 Flag to set when the device support 64KiB block erase (block_erase_32k opcode)
 

Variables

const mtd_desc_t mtd_spi_nor_driver
 NOR flash SPI MTD device operations table.
 
const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default
 Default command opcodes.
 
const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default_4bytes
 Default 4-byte addresses opcodes.
 

Macro Definition Documentation

◆ JEDEC_BANK_MAX

#define JEDEC_BANK_MAX   (10)

The highest possible bank number when reading manufacturer ID.

See also
http://www.jedec.org/standards-documents/results/jep106

Definition at line 82 of file mtd_spi_nor.h.

◆ JEDEC_NEXT_BANK

#define JEDEC_NEXT_BANK   (0x7f)

Byte to signal increment bank number when reading manufacturer ID.

See also
http://www.jedec.org/standards-documents/results/jep106

Definition at line 75 of file mtd_spi_nor.h.

◆ SPI_NOR_F_SECT_32K

#define SPI_NOR_F_SECT_32K   (2)

Flag to set when the device support 32KiB block erase (block_erase_32k opcode)

Definition at line 92 of file mtd_spi_nor.h.

◆ SPI_NOR_F_SECT_4K

#define SPI_NOR_F_SECT_4K   (1)

Flag to set when the device support 4KiB sector erase (sector_erase opcode)

Definition at line 87 of file mtd_spi_nor.h.

◆ SPI_NOR_F_SECT_64K

#define SPI_NOR_F_SECT_64K   (4)

Flag to set when the device support 64KiB block erase (block_erase_32k opcode)

Definition at line 97 of file mtd_spi_nor.h.

Variable Documentation

◆ mtd_spi_nor_opcode_default

const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default
extern

Default command opcodes.

The numbers were taken from Micron M25P16, but the same opcodes can be found in Macronix MX25L25735E, and multiple other data sheets for different devices, as well as in the Linux kernel, so they seem quite sensible for default values.

◆ mtd_spi_nor_opcode_default_4bytes

const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default_4bytes
extern

Default 4-byte addresses opcodes.

Commands for 4-byte addresses chips (above 128Mb)