OpenOCD
davinci.c File Reference
Include dependency graph for davinci.c:

Go to the source code of this file.

Data Structures

struct  davinci_nand
 

Macros

#define NAND4BITECC   0xc0 /* 4-bit ECC data, 1st of 4 */
 
#define NAND4BITECCLOAD   0xbc /* 4-bit ECC, load saved values */
 
#define NANDERRADDR   0xd0 /* 4-bit ECC err addr, 1st of 2 */
 
#define NANDERRVAL   0xd8 /* 4-bit ECC err value, 1st of 2 */
 
#define NANDFCR   0x60 /* flash control register */
 
#define NANDFECC   0x70 /* 1-bit ECC data, CS0, 1st of 4 */
 
#define NANDFSR   0x64 /* flash status register */
 

Enumerations

enum  ecc { HWECC1 , HWECC4 , HWECC4_INFIX }
 

Functions

static int davinci_address (struct nand_device *nand, uint8_t address)
 
static int davinci_command (struct nand_device *nand, uint8_t command)
 
static int davinci_init (struct nand_device *nand)
 
static int davinci_nand_ready (struct nand_device *nand, int timeout)
 
static int davinci_read_block_data (struct nand_device *nand, uint8_t *data, int data_size)
 
static int davinci_read_data (struct nand_device *nand, void *data)
 
static int davinci_read_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static int davinci_read_page_ecc4infix (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static int davinci_reset (struct nand_device *nand)
 
static int davinci_seek_column (struct nand_device *nand, uint16_t column)
 
static int davinci_write_block_data (struct nand_device *nand, uint8_t *data, int data_size)
 
static int davinci_write_data (struct nand_device *nand, uint16_t data)
 
static int davinci_write_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static int davinci_write_page_ecc1 (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static int davinci_write_page_ecc4 (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static int davinci_write_page_ecc4infix (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
 
static void davinci_write_pagecmd (struct nand_device *nand, uint8_t cmd, uint32_t page)
 
static int davinci_writepage_tail (struct nand_device *nand, uint8_t *oob, uint32_t oob_size)
 
static int halted (struct target *target, const char *label)
 
 NAND_DEVICE_COMMAND_HANDLER (davinci_nand_device_command)
 

Variables

struct nand_flash_controller davinci_nand_controller
 

Macro Definition Documentation

◆ NAND4BITECC

#define NAND4BITECC   0xc0 /* 4-bit ECC data, 1st of 4 */

Definition at line 54 of file davinci.c.

◆ NAND4BITECCLOAD

#define NAND4BITECCLOAD   0xbc /* 4-bit ECC, load saved values */

Definition at line 53 of file davinci.c.

◆ NANDERRADDR

#define NANDERRADDR   0xd0 /* 4-bit ECC err addr, 1st of 2 */

Definition at line 55 of file davinci.c.

◆ NANDERRVAL

#define NANDERRVAL   0xd8 /* 4-bit ECC err value, 1st of 2 */

Definition at line 56 of file davinci.c.

◆ NANDFCR

#define NANDFCR   0x60 /* flash control register */

Definition at line 50 of file davinci.c.

◆ NANDFECC

#define NANDFECC   0x70 /* 1-bit ECC data, CS0, 1st of 4 */

Definition at line 52 of file davinci.c.

◆ NANDFSR

#define NANDFSR   0x64 /* flash status register */

Definition at line 51 of file davinci.c.

Enumeration Type Documentation

◆ ecc

enum ecc
Enumerator
HWECC1 
HWECC4 
HWECC4_INFIX 

Definition at line 22 of file davinci.c.

Function Documentation

◆ davinci_address()

static int davinci_address ( struct nand_device nand,
uint8_t  address 
)
static

◆ davinci_command()

static int davinci_command ( struct nand_device nand,
uint8_t  command 
)
static

◆ davinci_init()

static int davinci_init ( struct nand_device nand)
static

◆ davinci_nand_ready()

static int davinci_nand_ready ( struct nand_device nand,
int  timeout 
)
static

◆ davinci_read_block_data()

static int davinci_read_block_data ( struct nand_device nand,
uint8_t *  data,
int  data_size 
)
static

◆ davinci_read_data()

static int davinci_read_data ( struct nand_device nand,
void *  data 
)
static

◆ davinci_read_page()

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

◆ davinci_read_page_ecc4infix()

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

◆ davinci_reset()

static int davinci_reset ( struct nand_device nand)
static

Definition at line 92 of file davinci.c.

References ERROR_OK.

◆ davinci_seek_column()

static int davinci_seek_column ( struct nand_device nand,
uint16_t  column 
)
static

◆ davinci_write_block_data()

◆ davinci_write_data()

static int davinci_write_data ( struct nand_device nand,
uint16_t  data 
)
static

◆ davinci_write_page()

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

◆ davinci_write_page_ecc1()

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

◆ davinci_write_page_ecc4()

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

◆ davinci_write_page_ecc4infix()

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

◆ davinci_write_pagecmd()

static void davinci_write_pagecmd ( struct nand_device nand,
uint8_t  cmd,
uint32_t  page 
)
static

◆ davinci_writepage_tail()

◆ halted()

◆ NAND_DEVICE_COMMAND_HANDLER()

NAND_DEVICE_COMMAND_HANDLER ( davinci_nand_device_command  )

Definition at line 661 of file davinci.c.

Variable Documentation

◆ davinci_nand_controller

struct nand_flash_controller davinci_nand_controller
Initial value:
= {
.name = "davinci",
.usage = "chip_addr hwecc_mode aemif_addr",
.nand_device_command = davinci_nand_device_command,
.init = davinci_init,
.reset = davinci_reset,
.command = davinci_command,
.address = davinci_address,
.write_data = davinci_write_data,
.read_data = davinci_read_data,
.write_page = davinci_write_page,
.read_page = davinci_read_page,
.write_block_data = davinci_write_block_data,
.read_block_data = davinci_read_block_data,
.nand_ready = davinci_nand_ready,
}
static int davinci_read_block_data(struct nand_device *nand, uint8_t *data, int data_size)
Definition: davinci.c:170
static int davinci_read_data(struct nand_device *nand, void *data)
Definition: davinci.c:156
static int davinci_address(struct nand_device *nand, uint8_t address)
Definition: davinci.c:132
static int davinci_write_data(struct nand_device *nand, uint16_t data)
Definition: davinci.c:144
static int davinci_write_block_data(struct nand_device *nand, uint8_t *data, int data_size)
Definition: davinci.c:203
static int davinci_init(struct nand_device *nand)
Definition: davinci.c:67
static int davinci_reset(struct nand_device *nand)
Definition: davinci.c:92
static int davinci_write_page(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
Definition: davinci.c:239
static int davinci_command(struct nand_device *nand, uint8_t command)
Definition: davinci.c:120
static int davinci_nand_ready(struct nand_device *nand, int timeout)
Definition: davinci.c:97
static int davinci_read_page(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
Definition: davinci.c:290

Definition at line 661 of file davinci.c.