28 #define CHECK_HALTED \
30 if (target->state != TARGET_HALTED) { \
31 LOG_ERROR("NAND flash access requires halted target"); \
32 return ERROR_NAND_OPERATION_FAILED; \
111 hw = calloc(1,
sizeof(*hw));
113 LOG_ERROR(
"no memory for nand controller");
117 nand->controller_priv = hw;
124 hw->
cmd = base + (1 << cle);
125 hw->
addr = base + (1 << ale);
141 .usage =
"<target_id> <NAND_address>",
148 .nand_device_command = orion_nand_device_command,
Holds the interface to ARM cores.
int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size)
ARM-specific bulk write from buffer to address of 8-bit wide NAND.
@ ARM_NAND_NONE
No operation performed.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define LOG_ERROR(expr ...)
#define ERROR_NAND_NO_BUFFER
#define ERROR_NAND_DEVICE_INVALID
static int orion_nand_read(struct nand_device *nand, void *data)
static int orion_nand_write(struct nand_device *nand, uint16_t data)
static int orion_nand_slow_block_write(struct nand_device *nand, uint8_t *data, int size)
static int orion_nand_command(struct nand_device *nand, uint8_t command)
static int orion_nand_fast_block_write(struct nand_device *nand, uint8_t *data, int size)
NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
static int orion_nand_address(struct nand_device *nand, uint8_t address)
static int orion_nand_reset(struct nand_device *nand)
static int orion_nand_init(struct nand_device *nand)
size_t size
Size of the control block search area.
The arm_nand_data struct is used for defining NAND I/O operations on an ARM core.
struct target * target
Target is proxy for some ARM core.
unsigned chunk_size
The chunk size is the page size or ECC chunk.
enum arm_nand_op op
Last operation executed using this struct.
uint32_t data
Where data is read from or written to.
Interface for NAND flash controllers.
int target_write_u8(struct target *target, target_addr_t address, uint8_t value)
int target_read_u8(struct target *target, target_addr_t address, uint8_t *value)