#include "chip.h"
Go to the source code of this file.
Data Structures | |
union | SmcStatus |
struct | SmcStatus::_SmcStatusBits |
Defines | |
#define | NFC_SRAM_BASE_ADDRESS 0x200000 |
#define | NFC_CMD_BASE_ADDR 0x70000000 |
#define | NFCADDR_CMD_CMD1 (0xFFu << 2) |
#define | NFCADDR_CMD_CMD2 (0xFFu << 10) |
#define | NFCADDR_CMD_VCMD2 (0x1u << 18) |
#define | NFCADDR_CMD_ACYCLE (0x7u << 19) |
#define | NFCADDR_CMD_ACYCLE_NONE (0x0u << 19) |
#define | NFCADDR_CMD_ACYCLE_ONE (0x1u << 19) |
#define | NFCADDR_CMD_ACYCLE_TWO (0x2u << 19) |
#define | NFCADDR_CMD_ACYCLE_THREE (0x3u << 19) |
#define | NFCADDR_CMD_ACYCLE_FOUR (0x4u << 19) |
#define | NFCADDR_CMD_ACYCLE_FIVE (0x5u << 19) |
#define | NFCADDR_CMD_CSID (0x7u << 22) |
#define | NFCADDR_CMD_CSID_0 (0x0u << 22) |
#define | NFCADDR_CMD_CSID_1 (0x1u << 22) |
#define | NFCADDR_CMD_CSID_2 (0x2u << 22) |
#define | NFCADDR_CMD_CSID_3 (0x3u << 22) |
#define | NFCADDR_CMD_CSID_4 (0x4u << 22) |
#define | NFCADDR_CMD_CSID_5 (0x5u << 22) |
#define | NFCADDR_CMD_CSID_6 (0x6u << 22) |
#define | NFCADDR_CMD_CSID_7 (0x7u << 22) |
#define | NFCADDR_CMD_DATAEN (0x1u << 25) |
#define | NFCADDR_CMD_DATADIS (0x0u << 25) |
#define | NFCADDR_CMD_NFCRD (0x0u << 26) |
#define | NFCADDR_CMD_NFCWR (0x1u << 26) |
#define | NFCADDR_CMD_NFCCMD (0x1u << 27) |
#define | Hsiao_ERROR_SINGLEBIT 1 |
#define | Hsiao_ERROR_ECC 2 |
#define | Hsiao_ERROR_MULTIPLEBITS 3 |
Functions | |
void | SMC_NFC_Configure (uint32_t mode) |
Sets NFC configuration. | |
void | SMC_NFC_Reset (void) |
Reset NFC controller. | |
void | SMC_NFC_EnableNfc (void) |
Enable NFC controller. | |
void | SMC_NFC_EnableSpareRead (void) |
Enable NFC controller reads both main and spare area in read mode. | |
void | SMC_NFC_DisableSpareRead (void) |
The NFC controller skips spare area in read mode. | |
void | SMC_NFC_EnableSpareWrite (void) |
Enables the NFC controller writes both main and spare area in write. | |
void | SMC_NFC_DisableSpareWrite (void) |
The NFC controller skips spare area in write mode. | |
uint8_t | SMC_NFC_isSpareRead (void) |
Check if spare area be read in read mode. | |
uint8_t | SMC_NFC_isSpareWrite (void) |
Check if spare area be written in write mode. | |
uint8_t | SMC_NFC_isTransferComplete (void) |
Check if NFC transfer complete. | |
uint8_t | SMC_NFC_isReadyBusy (void) |
Check Ready/Busy line. | |
uint8_t | SMC_NFC_isNfcBusy (void) |
Check if NFC Controller is busy. | |
uint32_t | SMC_NFC_GetStatus (void) |
Get NFC Status. | |
void | SMC_NFC_SendCommand (uint32_t cmd, uint32_t addressCycle, uint32_t cycle0) |
Uses the HOST nandflash controller to send a command to the NFC. | |
void | SMC_NFC_Wait_CommandDone (void) |
Wait for NFC command has done. | |
void | SMC_NFC_Wait_XfrDone (void) |
Wait for NFC Data Transfer Terminated. | |
void | SMC_NFC_Wait_RBbusy (void) |
Wait for NFC Ready/Busy Line 3 Edge Detected. | |
void | SMC_NFC_Wait_HammingReady (void) |
Wait for NFC Data Transfer Terminated. | |
void | SMC_ECC_Configure (uint32_t type, uint32_t pageSize) |
Configures ECC mode. | |
uint32_t | SMC_ECC_GetCorrectoinType (void) |
Get ECC correction type. | |
uint8_t | SMC_ECC_GetStatus (uint8_t eccNumber) |
Get ECC status. | |
void | SMC_ECC_GetValue (uint32_t *ecc) |
Get all ECC parity and Nparity value. | |
void | SMC_ECC_GetEccParity (uint32_t pageDataSize, uint8_t *code, uint8_t busWidth) |
uint8_t | SMC_ECC_VerifyHsiao (uint8_t *data, uint32_t size, const uint8_t *originalCode, const uint8_t *verifyCode, uint8_t busWidth) |
Definitions and function prototype for SMC module
Definition in file smc.h.
#define Hsiao_ERROR_ECC 2 |
#define Hsiao_ERROR_MULTIPLEBITS 3 |
#define Hsiao_ERROR_SINGLEBIT 1 |
#define NFC_CMD_BASE_ADDR 0x70000000 |
#define NFC_SRAM_BASE_ADDRESS 0x200000 |
void SMC_ECC_Configure | ( | uint32_t | type, | |
uint32_t | pageSize | |||
) |
uint32_t SMC_ECC_GetCorrectoinType | ( | void | ) |
void SMC_ECC_GetEccParity | ( | uint32_t | pageDataSize, | |
uint8_t * | code, | |||
uint8_t | busWidth | |||
) |
Get ECC code for 8bit/16-bit data path NAND flash by giving data path. 24-bit or 32-bit ECC is generated in order to perform one bit correction for a page in page 512/1024/2048/4096.
size | Data size in bytes. | |
code | Codes buffer. | |
busWidth | 8bit/16bit data path. |
Definition at line 674 of file smc.c.
uint8_t SMC_ECC_GetStatus | ( | uint8_t | eccNumber | ) |
uint8_t SMC_ECC_VerifyHsiao | ( | uint8_t * | data, | |
uint32_t | size, | |||
const uint8_t * | originalCode, | |||
const uint8_t * | verifyCode, | |||
uint8_t | busWidth | |||
) |
Verifies hsiao codes for a data block. The block is verified between the given HSIAO code generated by hardware and original HSIAO codes store has been previously stored. Returns 0 if the data is correct, Hsiao_ERROR_SINGLEBIT if one or more block(s) have had a single bit corrected, or either Hsiao_ERROR_ECC or Hsiao_ERROR_MULTIPLEBITS.
data | Data buffer to verify. | |
size | Size of the data in words. | |
originalCode | Original codes. | |
verifyCode | codes to be verified. | |
dataPath | 8bit/16bit data path. |
Definition at line 712 of file smc.c.
void SMC_NFC_Configure | ( | uint32_t | cfg | ) |
uint32_t SMC_NFC_GetStatus | ( | void | ) |
uint8_t SMC_NFC_isNfcBusy | ( | void | ) |
uint8_t SMC_NFC_isReadyBusy | ( | void | ) |
uint8_t SMC_NFC_isSpareRead | ( | void | ) |
uint8_t SMC_NFC_isSpareWrite | ( | void | ) |
uint8_t SMC_NFC_isTransferComplete | ( | void | ) |
void SMC_NFC_SendCommand | ( | uint32_t | cmd, | |
uint32_t | addressCycle, | |||
uint32_t | cycle0 | |||
) |