OpenOCD
flash/nand/core.c File Reference
Include dependency graph for flash/nand/core.c:

Go to the source code of this file.

Functions

 COMMAND_HELPER (nand_command_get_device, unsigned name_index, struct nand_device **nand)
 helper for parsing a nand device command argument string More...
 
static struct nand_deviceget_nand_device_by_name (const char *name)
 Returns the flash bank specified by name, which matches the driver name and a suffix (option) specify the driver-specific bank number. More...
 
struct nand_deviceget_nand_device_by_num (int num)
 
int nand_build_bbt (struct nand_device *nand, int first, int last)
 
void nand_device_add (struct nand_device *c)
 
int nand_erase (struct nand_device *nand, int first_block, int last_block)
 
int nand_page_command (struct nand_device *nand, uint32_t page, uint8_t cmd, bool oob_only)
 
static int nand_poll_ready (struct nand_device *nand, int timeout)
 
int nand_probe (struct nand_device *nand)
 
int nand_read_data_page (struct nand_device *nand, uint8_t *data, uint32_t size)
 
int nand_read_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
int nand_read_page_raw (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
int nand_read_status (struct nand_device *nand, uint8_t *status)
 
int nand_write_data_page (struct nand_device *nand, uint8_t *data, uint32_t size)
 
int nand_write_finish (struct nand_device *nand)
 
int nand_write_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
int nand_write_page_raw (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 

Variables

struct nand_devicenand_devices
 
static struct nand_info nand_flash_ids []
 
static struct nand_manufacturer nand_manuf_ids []
 

Function Documentation

◆ COMMAND_HELPER()

COMMAND_HELPER ( nand_command_get_device  ,
unsigned  name_index,
struct nand_device **  nand 
)

helper for parsing a nand device command argument string

Definition at line 197 of file flash/nand/core.c.

References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_nand_device_by_name(), and get_nand_device_by_num().

◆ get_nand_device_by_name()

static struct nand_device* get_nand_device_by_name ( const char *  name)
static

Returns the flash bank specified by name, which matches the driver name and a suffix (option) specify the driver-specific bank number.

The suffix consists of the '.' and the driver-specific bank number: when two davinci banks are defined, then 'davinci.1' refers to the second (e.g. DM355EVM).

Definition at line 166 of file flash/nand/core.c.

References nand_device::controller, flash_driver_name_matches(), get_flash_name_index(), nand_device::name, nand_flash_controller::name, name, nand_devices, nand_device::next, and NULL.

Referenced by COMMAND_HELPER().

◆ get_nand_device_by_num()

struct nand_device* get_nand_device_by_num ( int  num)

Definition at line 184 of file flash/nand/core.c.

References nand_devices, nand_device::next, and NULL.

Referenced by COMMAND_HANDLER(), and COMMAND_HELPER().

◆ nand_build_bbt()

◆ nand_device_add()

void nand_device_add ( struct nand_device c)

Definition at line 20 of file flash/nand/core.c.

References nand_devices, and nand_device::next.

Referenced by COMMAND_HELPER().

◆ nand_erase()

◆ nand_page_command()

◆ nand_poll_ready()

◆ nand_probe()

◆ nand_read_data_page()

int nand_read_data_page ( struct nand_device nand,
uint8_t *  data,
uint32_t  size 
)

◆ nand_read_page()

int nand_read_page ( struct nand_device nand,
uint32_t  page,
uint8_t *  data,
uint32_t  data_size,
uint8_t *  oob,
uint32_t  oob_size 
)

◆ nand_read_page_raw()

int nand_read_page_raw ( struct nand_device nand,
uint32_t  page,
uint8_t *  data,
uint32_t  data_size,
uint8_t *  oob,
uint32_t  oob_size 
)

◆ nand_read_status()

◆ nand_write_data_page()

◆ nand_write_finish()

◆ nand_write_page()

int nand_write_page ( struct nand_device nand,
uint32_t  page,
uint8_t *  data,
uint32_t  data_size,
uint8_t *  oob,
uint32_t  oob_size 
)

◆ nand_write_page_raw()

int nand_write_page_raw ( struct nand_device nand,
uint32_t  page,
uint8_t *  data,
uint32_t  data_size,
uint8_t *  oob,
uint32_t  oob_size 
)

Variable Documentation

◆ nand_devices

◆ nand_flash_ids

struct nand_info nand_flash_ids[]
static

Definition at line 20 of file flash/nand/core.c.

Referenced by nand_probe().

◆ nand_manuf_ids

struct nand_manufacturer nand_manuf_ids[]
static
Initial value:
= {
{0x0, "unknown"},
{NAND_MFR_TOSHIBA, "Toshiba"},
{NAND_MFR_SAMSUNG, "Samsung"},
{NAND_MFR_FUJITSU, "Fujitsu"},
{NAND_MFR_NATIONAL, "National"},
{NAND_MFR_RENESAS, "Renesas"},
{NAND_MFR_STMICRO, "ST Micro"},
{NAND_MFR_HYNIX, "Hynix"},
{NAND_MFR_MICRON, "Micron"},
{0x0, NULL},
}
@ NAND_MFR_NATIONAL
Definition: nand/core.h:70
@ NAND_MFR_RENESAS
Definition: nand/core.h:71
@ NAND_MFR_STMICRO
Definition: nand/core.h:72
@ NAND_MFR_MICRON
Definition: nand/core.h:74
@ NAND_MFR_SAMSUNG
Definition: nand/core.h:68
@ NAND_MFR_FUJITSU
Definition: nand/core.h:69
@ NAND_MFR_TOSHIBA
Definition: nand/core.h:67
@ NAND_MFR_HYNIX
Definition: nand/core.h:73
#define NULL
Definition: usb.h:16

Definition at line 20 of file flash/nand/core.c.

Referenced by nand_probe().