OpenOCD
|
Go to the source code of this file.
Functions | |
static int | arm_code_to_working_area (struct target *target, const uint32_t *code, unsigned code_size, unsigned additional, struct working_area **area) |
Copies code to a working area. More... | |
int | arm_nandread (struct arm_nand_data *nand, uint8_t *data, uint32_t size) |
Uses an on-chip algorithm for an ARM device to read from a NAND device and store the data into the host machine's memory. More... | |
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. More... | |
|
static |
Copies code to a working area.
This will allocate room for the code plus the additional amount requested if the working area pointer is null.
target | Pointer to the target to copy code to |
code | Pointer to the code area to be copied |
code_size | Size of the code being copied |
additional | Size of the additional area to be allocated in addition to code |
area | Pointer to a pointer to a working area to copy code to |
Definition at line 33 of file arm_io.c.
References ERROR_NAND_NO_BUFFER, ERROR_OK, LOG_DEBUG, size, target_alloc_working_area(), target_buffer_set_u32_array(), and target_write_memory().
Referenced by arm_nandread(), and arm_nandwrite().
int arm_nandread | ( | struct arm_nand_data * | nand, |
uint8_t * | data, | ||
uint32_t | size | ||
) |
Uses an on-chip algorithm for an ARM device to read from a NAND device and store the data into the host machine's memory.
nand | Pointer to the arm_nand_data struct that defines the I/O |
data | Pointer to the data buffer to store the read data |
size | Amount of data to be stored to the buffer. |
Definition at line 190 of file arm_io.c.
References working_area::address, arm::arch, target::arch_info, ARM_ARCH_V4, arm_code_to_working_area(), ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_MODE_THREAD, ARM_NAND_READ, ARM_STATE_ARM, ARMV7M_COMMON_MAGIC, buf_set_u32(), arm_nand_data::chunk_size, arm_algorithm::common_magic, armv7m_algorithm::common_magic, arm_nand_data::copy_area, arm_algorithm::core_mode, armv7m_algorithm::core_mode, arm_algorithm::core_state, arm_nand_data::data, destroy_reg_param(), ERROR_OK, init_reg_param(), is_armv7m(), LOG_ERROR, NULL, arm_nand_data::op, PARAM_IN, size, arm_nand_data::target, target_read_buffer(), target_run_algorithm(), target_to_armv7m(), and reg_param::value.
Referenced by at91sam9_read_block_data(), and nuc910_nand_read_block_data().
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.
For now this supports ARMv4,ARMv5 and ARMv7-M cores.
Enhancements to target_run_algorithm() could enable:
Different code fragments could handle:
nand | Pointer to the arm_nand_data struct that defines the I/O |
data | Pointer to the data to be copied to flash |
size | Size of the data being copied |
Definition at line 80 of file arm_io.c.
References working_area::address, arm::arch, target::arch_info, ARM_ARCH_V4, arm_code_to_working_area(), ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_MODE_THREAD, ARM_NAND_WRITE, ARM_STATE_ARM, ARMV7M_COMMON_MAGIC, buf_set_u32(), arm_nand_data::chunk_size, arm_algorithm::common_magic, armv7m_algorithm::common_magic, arm_nand_data::copy_area, arm_algorithm::core_mode, armv7m_algorithm::core_mode, arm_algorithm::core_state, arm_nand_data::data, destroy_reg_param(), ERROR_OK, init_reg_param(), is_armv7m(), LOG_ERROR, NULL, arm_nand_data::op, PARAM_IN, size, arm_nand_data::target, target_run_algorithm(), target_to_armv7m(), target_write_buffer(), and reg_param::value.
Referenced by at91sam9_write_block_data(), davinci_write_block_data(), nuc910_nand_write_block_data(), and orion_nand_fast_block_write().