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

Go to the source code of this file.

Functions

static int do_data_output (struct nand_device *nand)
 
static int get_next_byte_from_sram_buffer (struct target *target, uint8_t *value)
 
static int get_next_halfword_from_sram_buffer (struct target *target, uint16_t *value)
 
static int imx31_address (struct nand_device *nand, uint8_t address)
 
static int imx31_command (struct nand_device *nand, uint8_t command)
 
static int imx31_init (struct nand_device *nand)
 
static int imx31_nand_ready (struct nand_device *nand, int tout)
 
static int imx31_read_data (struct nand_device *nand, void *data)
 
static int imx31_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 imx31_reset (struct nand_device *nand)
 
static int imx31_write_data (struct nand_device *nand, uint16_t data)
 
static int imx31_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 initialize_nf_controller (struct nand_device *nand)
 
 NAND_DEVICE_COMMAND_HANDLER (imx31_nand_device_command)
 
static int poll_for_complete_op (struct target *target, const char *text)
 
static int test_iomux_settings (struct target *target, uint32_t value, uint32_t mask, const char *text)
 
static int validate_target_state (struct nand_device *nand)
 

Variables

static const char data_block_size_err_msg []
 
static const char get_status_register_err_msg [] = "can't get NAND status"
 
struct nand_flash_controller imx31_nand_flash_controller
 
static uint32_t in_sram_address
 
static unsigned char sign_of_sequental_byte_read
 
static const char sram_buffer_bounds_err_msg []
 
static const char target_not_halted_err_msg []
 

Function Documentation

◆ do_data_output()

◆ get_next_byte_from_sram_buffer()

static int get_next_byte_from_sram_buffer ( struct target target,
uint8_t *  value 
)
static

◆ get_next_halfword_from_sram_buffer()

static int get_next_halfword_from_sram_buffer ( struct target target,
uint16_t *  value 
)
static

◆ imx31_address()

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

◆ imx31_command()

◆ imx31_init()

◆ imx31_nand_ready()

static int imx31_nand_ready ( struct nand_device nand,
int  tout 
)
static

◆ imx31_read_data()

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

◆ imx31_read_page()

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

◆ imx31_reset()

static int imx31_reset ( struct nand_device nand)
static

Definition at line 231 of file mx3.c.

References ERROR_OK, initialize_nf_controller(), and validate_target_state().

◆ imx31_write_data()

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

Definition at line 225 of file mx3.c.

References ERROR_NAND_OPERATION_FAILED, and LOG_ERROR.

◆ imx31_write_page()

◆ initialize_nf_controller()

◆ NAND_DEVICE_COMMAND_HANDLER()

◆ poll_for_complete_op()

static int poll_for_complete_op ( struct target target,
const char *  text 
)
static

◆ test_iomux_settings()

static int test_iomux_settings ( struct target target,
uint32_t  value,
uint32_t  mask,
const char *  text 
)
static

Definition at line 505 of file mx3.c.

References ERROR_FAIL, ERROR_OK, LOG_ERROR, mask, and target_read_u32().

Referenced by imx31_init().

◆ validate_target_state()

Variable Documentation

◆ data_block_size_err_msg

const char data_block_size_err_msg[]
static
Initial value:
=
"minimal granularity is one half-word, %" PRIu32 " is incorrect"

Definition at line 31 of file mx3.c.

Referenced by imx31_read_page(), and imx31_write_page().

◆ get_status_register_err_msg

const char get_status_register_err_msg[] = "can't get NAND status"
static

Definition at line 35 of file mx3.c.

Referenced by imx31_init(), and imx31_write_page().

◆ imx31_nand_flash_controller

struct nand_flash_controller imx31_nand_flash_controller
Initial value:
= {
.name = "imx31",
.usage = "nand device imx31 target noecc|hwecc",
.nand_device_command = &imx31_nand_device_command,
.init = &imx31_init,
.reset = &imx31_reset,
.command = &imx31_command,
.address = &imx31_address,
.write_data = &imx31_write_data,
.read_data = &imx31_read_data,
.write_page = &imx31_write_page,
.read_page = &imx31_read_page,
.nand_ready = &imx31_nand_ready,
}
static int imx31_command(struct nand_device *nand, uint8_t command)
Definition: mx3.c:244
static int imx31_init(struct nand_device *nand)
Definition: mx3.c:85
static int imx31_address(struct nand_device *nand, uint8_t address)
Definition: mx3.c:312
static int imx31_reset(struct nand_device *nand)
Definition: mx3.c:231
static int imx31_write_page(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
Definition: mx3.c:363
static int imx31_write_data(struct nand_device *nand, uint16_t data)
Definition: mx3.c:225
static int imx31_nand_ready(struct nand_device *nand, int tout)
Definition: mx3.c:339
static int imx31_read_data(struct nand_device *nand, void *data)
Definition: mx3.c:194
static int imx31_read_page(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size)
Definition: mx3.c:452

Definition at line 645 of file mx3.c.

◆ in_sram_address

uint32_t in_sram_address
static

◆ sign_of_sequental_byte_read

unsigned char sign_of_sequental_byte_read
static

Definition at line 37 of file mx3.c.

Referenced by get_next_byte_from_sram_buffer(), imx31_command(), and initialize_nf_controller().

◆ sram_buffer_bounds_err_msg

const char sram_buffer_bounds_err_msg[]
static
Initial value:
=
"trying to access out of SRAM buffer bound (addr=0x%" PRIx32 ")"

Definition at line 33 of file mx3.c.

Referenced by get_next_byte_from_sram_buffer(), and get_next_halfword_from_sram_buffer().

◆ target_not_halted_err_msg

const char target_not_halted_err_msg[]
static
Initial value:
=
"target must be halted to use mx3 NAND flash controller"

Definition at line 29 of file mx3.c.

Referenced by validate_target_state().