35 ocl =
bank->driver_priv = malloc(
sizeof(
struct ocl_priv));
51 if (
bank->num_sectors == 0)
55 LOG_ERROR(
"target has to be running to communicate with the loader");
59 if ((first == 0) && (last ==
bank->num_sectors - 1)) {
111 LOG_ERROR(
"target has to be running to communicate with the loader");
128 *dcc_bufptr = 0xffffffff;
133 for (i = 0; i < runlen; i++) {
136 *dcc_bufptr &= *(
buffer++) | 0xffffff00;
139 *dcc_bufptr &= ((*(
buffer++)) << 8) | 0xffff00ff;
142 *dcc_bufptr &= ((*(
buffer++)) << 16) | 0xff00ffff;
145 *dcc_bufptr &= ((*(
buffer++)) << 24) | 0x00ffffff;
146 chksum ^= *(dcc_bufptr++);
147 *dcc_bufptr = 0xffffffff;
155 chksum ^= *(dcc_bufptr++);
157 *(dcc_bufptr++) = chksum;
259 if (
bank->num_sectors == 0) {
260 LOG_ERROR(
"number of sectors shall be non zero value");
263 if (
bank->size %
bank->num_sectors) {
264 LOG_ERROR(
"bank size not divisible by number of sectors");
267 sectsize =
bank->size /
bank->num_sectors;
268 for (
unsigned int i = 0; i <
bank->num_sectors; i++) {
269 bank->sectors[i].offset = i * sectsize;
270 bank->sectors[i].size = sectsize;
271 bank->sectors[i].is_erased = -1;
272 bank->sectors[i].is_protected = -1;
279 LOG_ERROR(
"buflen shall be non zero value");
284 LOG_ERROR(
"buflen is not multiple of bufalign");
289 LOG_ERROR(
"buflen shall be divisible by 4");
308 .flash_bank_command = ocl_flash_bank_command,
static const uint8_t * dcc_buffer
static struct arm7_9_common * target_to_arm7_9(struct target *target)
static bool is_arm7_9(struct arm7_9_common *arm7_9)
#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...
int embeddedice_handshake(struct arm_jtag *jtag_info, int hsbit, uint32_t timeout)
Poll DCC control register until read or write handshake completes.
int embeddedice_send(struct arm_jtag *jtag_info, uint32_t *data, uint32_t size)
Send a block of size 32-bit words to the DCC.
int embeddedice_receive(struct arm_jtag *jtag_info, uint32_t *data, uint32_t size)
Receive a block of size 32-bit words from the DCC.
#define ERROR_FLASH_BANK_INVALID
#define ERROR_FLASH_BANK_NOT_PROBED
#define ERROR_FLASH_OPERATION_FAILED
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
#define LOG_ERROR(expr ...)
FLASH_BANK_COMMAND_HANDLER(ocl_flash_bank_command)
static int ocl_probe(struct flash_bank *bank)
static int ocl_auto_probe(struct flash_bank *bank)
static int ocl_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
static int ocl_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
const struct flash_driver ocl_flash
Structure for items that are common between both ARM7 and ARM9 targets.
struct arm_jtag jtag_info
JTAG information for target.
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
Describes the geometry and status of a single flash sector within a flash bank.
struct arm_jtag * jtag_info
#define ERROR_TARGET_INVALID
#define ERROR_TARGET_NOT_RUNNING