3#ifndef __SYS_SPI_NOR_H__
4#define __SYS_SPI_NOR_H__
23#define SFDP_MAX_NPH (6)
u32_t uint32_t
Definition stdint.h:13
u8_t uint8_t
Definition stdint.h:7
Definition sys-spi-nor.h:64
uint8_t minor
Minor version of the basic parameter table.
Definition sys-spi-nor.h:65
uint8_t table[16 *4]
Basic parameter table (16 entries, each 4 bytes).
Definition sys-spi-nor.h:67
uint8_t major
Major version of the basic parameter table.
Definition sys-spi-nor.h:66
Definition sys-spi-nor.h:77
sfdp_parameter_header_t parameter_header[SFDP_MAX_NPH]
Array of parameter headers.
Definition sys-spi-nor.h:79
sfdp_header_t header
SFDP header containing signature and version info.
Definition sys-spi-nor.h:78
sfdp_basic_table_t basic_table
Basic parameter table containing the flash parameters.
Definition sys-spi-nor.h:80
Definition sys-spi-nor.h:90
uint8_t opcode_erase_64k
Opcode to erase a 64K block of the SPI NOR Flash.
Definition sys-spi-nor.h:103
uint32_t read_granularity
Read granularity, smallest read unit (in bytes).
Definition sys-spi-nor.h:95
uint32_t capacity
Total capacity of the SPI NOR Flash (in bytes).
Definition sys-spi-nor.h:93
uint32_t blksz
Block size of the SPI NOR Flash (in bytes).
Definition sys-spi-nor.h:94
uint8_t address_length
Length of the address field in the command (in bytes).
Definition sys-spi-nor.h:97
uint32_t write_granularity
Write granularity, smallest write unit (in bytes).
Definition sys-spi-nor.h:96
uint32_t id
Unique device ID for the SPI NOR Flash (manufacturer and model).
Definition sys-spi-nor.h:92
uint8_t opcode_write_enable
Opcode to enable write operations on the SPI NOR Flash.
Definition sys-spi-nor.h:100
uint8_t opcode_erase_4k
Opcode to erase a 4K block of the SPI NOR Flash.
Definition sys-spi-nor.h:101
uint8_t opcode_erase_256k
Opcode to erase a 256K block of the SPI NOR Flash.
Definition sys-spi-nor.h:104
uint8_t opcode_read
Opcode for the read operation.
Definition sys-spi-nor.h:98
uint8_t opcode_erase_32k
Opcode to erase a 32K block of the SPI NOR Flash.
Definition sys-spi-nor.h:102
char * name
Name of the SPI NOR Flash device (e.g., "MX25L12835E").
Definition sys-spi-nor.h:91
uint8_t opcode_write
Opcode for the write operation.
Definition sys-spi-nor.h:99
SPI Device Configuration Structure.
Definition sys-spi.h:92
uint32_t spi_nor_read_block(sunxi_spi_t *spi, uint8_t *buf, uint32_t blk_no, uint32_t blk_cnt)
Reads a block or multiple blocks of data from the SPI NAND flash memory.
Definition sys-spi-nor.c:528
uint32_t spi_nor_read(sunxi_spi_t *spi, uint8_t *buf, uint32_t addr, uint32_t rxlen)
Reads data from the SPI NOR flash memory.
Definition sys-spi-nor.c:574
struct sfdp_parameter_header sfdp_parameter_header_t
SPI_NOR_OPS
Enumeration of SPI NOR Flash operation opcodes.
Definition sys-spi-nor.h:116
@ NOR_OPCODE_WREN
Write Enable Command: Enable write operations on the memory.
Definition sys-spi-nor.h:121
@ NOR_OPCODE_SFDP
SFDP Read Command: Read Serial Flash Discoverable Parameters.
Definition sys-spi-nor.h:117
@ NOR_OPCODE_E32K
32K Block Erase Command: Erase a 32K block of memory
Definition sys-spi-nor.h:125
@ NOR_OPCODE_READ
Read Data Command: Read data from the memory.
Definition sys-spi-nor.h:122
@ NOR_OPCODE_RDID
Read ID Command: Retrieve the identity of the memory device.
Definition sys-spi-nor.h:118
@ NOR_OPCODE_E4K
4K Block Erase Command: Erase a 4K block of memory
Definition sys-spi-nor.h:124
@ NOR_OPCODE_EXIT_4B
Exit 4-Byte Address Mode Command: Return to 3-byte addressing mode.
Definition sys-spi-nor.h:128
@ NOR_OPCODE_E64K
64K Block Erase Command: Erase a 64K block of memory
Definition sys-spi-nor.h:126
@ NOR_OPCODE_RDSR
Read Status Register Command: Read the current status register.
Definition sys-spi-nor.h:120
@ NOR_OPCODE_WRSR
Write Status Register Command: Write to the status register.
Definition sys-spi-nor.h:119
@ NOR_OPCODE_ENTER_4B
Enter 4-Byte Address Mode Command: Switch to 4-byte addressing mode.
Definition sys-spi-nor.h:127
@ NOR_OPCODE_PROG
Page Program Command: Program data into a memory page.
Definition sys-spi-nor.h:123
SPI_CMD_OPS
Enumeration of SPI command operations.
Definition sys-spi-nor.h:140
@ SPI_CMD_SPINOR_WAIT
Wait Command for SPI NOR: Wait for the SPI NOR flash to complete its operation.
Definition sys-spi-nor.h:148
@ SPI_CMD_SPINAND_WAIT
Wait Command for SPI NAND: Wait for the SPI NAND flash to complete its operation.
Definition sys-spi-nor.h:149
@ SPI_CMD_TXBUF
Transmit Buffer Command: Transmit data from a buffer to the SPI device.
Definition sys-spi-nor.h:146
@ SPI_CMD_DESELECT
Deselect Command: Deselect the SPI device to end communication.
Definition sys-spi-nor.h:144
@ SPI_CMD_SELECT
Select Command: Select the SPI device for communication.
Definition sys-spi-nor.h:143
@ SPI_CMD_RXBUF
Receive Buffer Command: Receive data from the SPI device to a buffer.
Definition sys-spi-nor.h:147
@ SPI_CMD_FAST
Fast Command: Execute a fast operation or mode.
Definition sys-spi-nor.h:145
@ SPI_CMD_INIT
Initialization Command: Initialize the SPI device.
Definition sys-spi-nor.h:142
@ SPI_CMD_END
End Command: Mark the end of a command sequence.
Definition sys-spi-nor.h:141
struct sfdp_header sfdp_header_t
int spi_nor_detect(sunxi_spi_t *spi)
Detects the presence of an SPI NOR flash chip.
Definition sys-spi-nor.c:486
struct sfdp_basic_table sfdp_basic_table_t
struct spi_nor_info spi_nor_info_t
#define SFDP_MAX_NPH
Definition sys-spi-nor.h:23