Change-Id: Ic812098d3ed5a2992c26bb57d08ae350e2c5d5d8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2040
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
39 files changed:
* Caller should not check for other return values specifically
*/
static int aduc702x_write_block(struct flash_bank *bank,
* Caller should not check for other return values specifically
*/
static int aduc702x_write_block(struct flash_bank *bank,
uint32_t offset,
uint32_t count)
{
uint32_t offset,
uint32_t count)
{
/* All-JTAG, single-access method. Very slow. Used only if there is no
* working area available. */
static int aduc702x_write_single(struct flash_bank *bank,
/* All-JTAG, single-access method. Very slow. Used only if there is no
* working area available. */
static int aduc702x_write_single(struct flash_bank *bank,
uint32_t offset,
uint32_t count)
{
uint32_t offset,
uint32_t count)
{
-static int aduc702x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int aduc702x_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
0x00, 0xBE /* bkpt #0 */
};
0x00, 0xBE /* bkpt #0 */
};
-static int sam3_page_write(struct sam3_bank_private *pPrivate, unsigned pagenum, uint8_t *buf)
+static int sam3_page_write(struct sam3_bank_private *pPrivate, unsigned pagenum, const uint8_t *buf)
{
uint32_t adr;
uint32_t status;
{
uint32_t adr;
uint32_t status;
}
static int sam3_write(struct flash_bank *bank,
}
static int sam3_write(struct flash_bank *bank,
uint32_t offset,
uint32_t count)
{
uint32_t offset,
uint32_t count)
{
-static int sam4_page_write(struct sam4_bank_private *pPrivate, unsigned pagenum, uint8_t *buf)
+static int sam4_page_write(struct sam4_bank_private *pPrivate, unsigned pagenum, const uint8_t *buf)
{
uint32_t adr;
uint32_t status;
{
uint32_t adr;
uint32_t status;
}
static int sam4_write(struct flash_bank *bank,
}
static int sam4_write(struct flash_bank *bank,
uint32_t offset,
uint32_t count)
{
uint32_t offset,
uint32_t count)
{
/* Write an entire page from host buffer 'buf' to page-aligned 'address' in the
* Flash. */
static int sam4l_write_page(struct sam4l_info *chip, struct target *target,
/* Write an entire page from host buffer 'buf' to page-aligned 'address' in the
* Flash. */
static int sam4l_write_page(struct sam4l_info *chip, struct target *target,
- uint32_t address, uint8_t *buf)
+ uint32_t address, const uint8_t *buf)
/* Write partial contents into page-aligned 'address' on the Flash from host
* buffer 'buf' by writing 'nb' of 'buf' at 'offset' into the Flash page. */
static int sam4l_write_page_partial(struct sam4l_info *chip,
/* Write partial contents into page-aligned 'address' on the Flash from host
* buffer 'buf' by writing 'nb' of 'buf' at 'offset' into the Flash page. */
static int sam4l_write_page_partial(struct sam4l_info *chip,
- struct flash_bank *bank, uint32_t address, uint8_t *buf,
+ struct flash_bank *bank, uint32_t address, const uint8_t *buf,
uint32_t page_offset, uint32_t nb)
{
int res;
uint32_t page_offset, uint32_t nb)
{
int res;
-static int sam4l_write(struct flash_bank *bank, uint8_t *buffer,
+static int sam4l_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
int res;
uint32_t offset, uint32_t count)
{
int res;
#define FLASH_SIZE_2048KB 14
static int at91sam7_protect_check(struct flash_bank *bank);
#define FLASH_SIZE_2048KB 14
static int at91sam7_protect_check(struct flash_bank *bank);
-static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset,
+static int at91sam7_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset,
uint32_t count);
static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number);
uint32_t count);
static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number);
-static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int at91sam7_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
int retval;
struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
{
int retval;
struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
/* Write an entire row (four pages) from host buffer 'buf' to row-aligned
* 'address' in the Flash. */
static int samd_write_row(struct flash_bank *bank, uint32_t address,
/* Write an entire row (four pages) from host buffer 'buf' to row-aligned
* 'address' in the Flash. */
static int samd_write_row(struct flash_bank *bank, uint32_t address,
{
int res;
struct samd_info *chip = (struct samd_info *)bank->driver_priv;
{
int res;
struct samd_info *chip = (struct samd_info *)bank->driver_priv;
/* Write partial contents into row-aligned 'address' on the Flash from host
* buffer 'buf' by writing 'nb' of 'buf' at 'row_offset' into the Flash row. */
static int samd_write_row_partial(struct flash_bank *bank, uint32_t address,
/* Write partial contents into row-aligned 'address' on the Flash from host
* buffer 'buf' by writing 'nb' of 'buf' at 'row_offset' into the Flash row. */
static int samd_write_row_partial(struct flash_bank *bank, uint32_t address,
- uint8_t *buf, uint32_t row_offset, uint32_t nb)
+ const uint8_t *buf, uint32_t row_offset, uint32_t nb)
{
int res;
struct samd_info *chip = (struct samd_info *)bank->driver_priv;
{
int res;
struct samd_info *chip = (struct samd_info *)bank->driver_priv;
-static int samd_write(struct flash_bank *bank, uint8_t *buffer,
+static int samd_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
int res;
uint32_t offset, uint32_t count)
{
int res;
}
static int avr_jtagprg_writeflashpage(struct avr_common *avr,
}
static int avr_jtagprg_writeflashpage(struct avr_common *avr,
+ const uint8_t *page_buf,
uint32_t buf_size,
uint32_t addr,
uint32_t page_size)
uint32_t buf_size,
uint32_t addr,
uint32_t page_size)
-static int avrf_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int avrf_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
struct avr_common *avr = target->arch_info;
{
struct target *target = bank->target;
struct avr_common *avr = target->arch_info;
-static int cfi_intel_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int cfi_intel_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t address, uint32_t count)
{
struct target *target = bank->target;
uint32_t address, uint32_t count)
{
struct target *target = bank->target;
-static int cfi_spansion_write_block_mips(struct flash_bank *bank, uint8_t *buffer,
+static int cfi_spansion_write_block_mips(struct flash_bank *bank, const uint8_t *buffer,
uint32_t address, uint32_t count)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
uint32_t address, uint32_t count)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
-static int cfi_spansion_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int cfi_spansion_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t address, uint32_t count)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
uint32_t address, uint32_t count)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
-static int cfi_intel_write_words(struct flash_bank *bank, uint8_t *word,
+static int cfi_intel_write_words(struct flash_bank *bank, const uint8_t *word,
uint32_t wordcount, uint32_t address)
{
int retval;
uint32_t wordcount, uint32_t address)
{
int retval;
-static int cfi_spansion_write_words(struct flash_bank *bank, uint8_t *word,
+static int cfi_spansion_write_words(struct flash_bank *bank, const uint8_t *word,
uint32_t wordcount, uint32_t address)
{
int retval;
uint32_t wordcount, uint32_t address)
{
int retval;
return ERROR_FLASH_OPERATION_FAILED;
}
return ERROR_FLASH_OPERATION_FAILED;
}
-static int cfi_write_words(struct flash_bank *bank, uint8_t *word,
+static int cfi_write_words(struct flash_bank *bank, const uint8_t *word,
uint32_t wordcount, uint32_t address)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
uint32_t wordcount, uint32_t address)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
-static int cfi_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int cfi_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
struct target *target = bank->target;
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
struct target *target = bank->target;
* @returns ERROR_OK if successful; otherwise, an error code.
*/
int (*write)(struct flash_bank *bank,
* @returns ERROR_OK if successful; otherwise, an error code.
*/
int (*write)(struct flash_bank *bank,
- uint8_t *buffer, uint32_t offset, uint32_t count);
+ const uint8_t *buffer, uint32_t offset, uint32_t count);
/**
* Read data from the flash. Note CPU address will be
/**
* Read data from the flash. Note CPU address will be
-static int dsp5680xx_flash_write(struct flash_bank *bank, uint8_t * buffer,
+static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t* buffer,
uint32_t offset, uint32_t count)
{
int retval;
uint32_t offset, uint32_t count)
{
int retval;
-static int efm32x_write(struct flash_bank *bank, uint8_t *buffer,
+static int efm32x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count);
static int efm32x_get_flash_size(struct flash_bank *bank, uint16_t *flash_sz)
uint32_t offset, uint32_t count);
static int efm32x_get_flash_size(struct flash_bank *bank, uint16_t *flash_sz)
-static int efm32x_write_block(struct flash_bank *bank, uint8_t *buf,
+static int efm32x_write_block(struct flash_bank *bank, const uint8_t *buf,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int efm32x_write(struct flash_bank *bank, uint8_t *buffer,
+static int efm32x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
return em357_write_options(bank);
}
return em357_write_options(bank);
}
-static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int em357_write(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int faux_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int faux_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct faux_flash_bank *info = bank->driver_priv;
memcpy(info->memory + offset, buffer, count);
{
struct faux_flash_bank *info = bank->driver_priv;
memcpy(info->memory + offset, buffer, count);
-static int fm3_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int fm3_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct fm3_flash_bank *fm3_info = bank->driver_priv;
uint32_t offset, uint32_t count)
{
struct fm3_flash_bank *fm3_info = bank->driver_priv;
};
/* Program LongWord Block Write */
};
/* Program LongWord Block Write */
-static int kinetis_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int kinetis_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t wcount)
{
struct target *target = bank->target;
uint32_t offset, uint32_t wcount)
{
struct target *target = bank->target;
-static int kinetis_write(struct flash_bank *bank, uint8_t *buffer,
+static int kinetis_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
unsigned int i, result, fallback = 0;
uint32_t offset, uint32_t count)
{
unsigned int i, result, fallback = 0;
-static int lpc2000_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int lpc2000_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
{
struct target *target = bank->target;
/* check if exception vectors should be flashed */
if ((offset == 0) && (count >= 0x20) && lpc2000_info->calc_checksum) {
/* check if exception vectors should be flashed */
if ((offset == 0) && (count >= 0x20) && lpc2000_info->calc_checksum) {
+ assert(lpc2000_info->checksum_vector < 8);
uint32_t checksum = 0;
for (int i = 0; i < 8; i++) {
LOG_DEBUG("Vector 0x%2.2x: 0x%8.8" PRIx32, i * 4, buf_get_u32(buffer + (i * 4), 0, 32));
uint32_t checksum = 0;
for (int i = 0; i < 8; i++) {
LOG_DEBUG("Vector 0x%2.2x: 0x%8.8" PRIx32, i * 4, buf_get_u32(buffer + (i * 4), 0, 32));
- buf_set_u32(buffer + (lpc2000_info->checksum_vector * 4), 0, 32, checksum);
+ /* FIXME: WARNING! This code is broken because it modifies the callers buffer in place. */
+ buf_set_u32((uint8_t *)buffer + (lpc2000_info->checksum_vector * 4), 0, 32, checksum);
}
struct working_area *iap_working_area;
}
struct working_area *iap_working_area;
-static int lpc288x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int lpc288x_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
uint8_t page_buffer[FLASH_PAGE_SIZE];
uint32_t status, source_offset, dest_offset;
{
uint8_t page_buffer[FLASH_PAGE_SIZE];
uint32_t status, source_offset, dest_offset;
* @param offset Start address (relative to bank start)
* @param count Number of bytes to be programmed
*/
* @param offset Start address (relative to bank start)
* @param count Number of bytes to be programmed
*/
-static int lpc2900_write(struct flash_bank *bank, uint8_t *buffer,
+static int lpc2900_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
uint8_t page[FLASH_PAGE_SIZE];
uint32_t offset, uint32_t count)
{
uint8_t page[FLASH_PAGE_SIZE];
/* Write to flash in large blocks */
while (count != 0) {
uint32_t this_npages;
/* Write to flash in large blocks */
while (count != 0) {
uint32_t this_npages;
+ const uint8_t *this_buffer;
int start_sector = lpc2900_address2sector(bank, offset);
/* First page / last page / rest */
int start_sector = lpc2900_address2sector(bank, offset);
/* First page / last page / rest */
-static int lpcspifi_write(struct flash_bank *bank, uint8_t *buffer,
+static int lpcspifi_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int mdr_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int mdr_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int mdr_write(struct flash_bank *bank, uint8_t *buffer,
+static int mdr_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
LOG_INFO("odd number of bytes to write, padding with 0xff");
buffer = memcpy(new_buffer, buffer, count);
while (rem--)
LOG_INFO("odd number of bytes to write, padding with 0xff");
buffer = memcpy(new_buffer, buffer, count);
while (rem--)
- buffer[count++] = 0xff;
+ new_buffer[count++] = 0xff;
}
uint32_t flash_cmd, cur_per_clock;
}
uint32_t flash_cmd, cur_per_clock;
return ERROR_FLASH_OPERATION_FAILED;
}
return ERROR_FLASH_OPERATION_FAILED;
}
-static int mini51_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int mini51_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
int status;
int timeout;
{
int status;
int timeout;
-static int nrf51_write_page(struct flash_bank *bank, uint32_t offset, uint8_t *buffer)
+static int nrf51_write_page(struct flash_bank *bank, uint32_t offset, const uint8_t *buffer)
{
assert(offset % 4 == 0);
{
assert(offset % 4 == 0);
-static int nrf51_write(struct flash_bank *bank, uint8_t *buffer,
+static int nrf51_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
int res;
uint32_t offset, uint32_t count)
{
int res;
} start_extra, end_extra;
start_extra.length = region.start % chip->code_page_size;
} start_extra, end_extra;
start_extra.length = region.start % chip->code_page_size;
}
/* The write routine stub. */
}
/* The write routine stub. */
-static int nuc1x_write(struct flash_bank *bank, uint8_t *buffer,
+static int nuc1x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int ocl_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int ocl_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct ocl_priv *ocl = bank->driver_priv;
int retval;
{
struct ocl_priv *ocl = bank->driver_priv;
int retval;
-static int pic32mx_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int pic32mx_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
return pic32mx_nvm_exec(bank, NVMCON_OP_WORD_PROG, 5);
}
return pic32mx_nvm_exec(bank, NVMCON_OP_WORD_PROG, 5);
}
-static int pic32mx_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int pic32mx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
uint32_t words_remaining = (count / 4);
uint32_t bytes_remaining = (count & 0x00000003);
{
uint32_t words_remaining = (count / 4);
uint32_t bytes_remaining = (count & 0x00000003);
0x01, 0x00, 0x42, 0xA4 /* .word 0xA4420001 */
};
static int stellaris_write_block(struct flash_bank *bank,
0x01, 0x00, 0x42, 0xA4 /* .word 0xA4420001 */
};
static int stellaris_write_block(struct flash_bank *bank,
- uint8_t *buffer, uint32_t offset, uint32_t wcount)
+ const uint8_t *buffer, uint32_t offset, uint32_t wcount)
{
struct target *target = bank->target;
uint32_t buffer_size = 16384;
{
struct target *target = bank->target;
uint32_t buffer_size = 16384;
-static int stellaris_write(struct flash_bank *bank, uint8_t *buffer,
+static int stellaris_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct stellaris_flash_bank *stellaris_info = bank->driver_priv;
uint32_t offset, uint32_t count)
{
struct stellaris_flash_bank *stellaris_info = bank->driver_priv;
static int stm32x_mass_erase(struct flash_bank *bank);
static int stm32x_get_device_id(struct flash_bank *bank, uint32_t *device_id);
static int stm32x_mass_erase(struct flash_bank *bank);
static int stm32x_get_device_id(struct flash_bank *bank, uint32_t *device_id);
-static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int stm32x_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count);
/* flash bank stm32x <base> <size> 0 0 <target#>
uint32_t offset, uint32_t count);
/* flash bank stm32x <base> <size> 0 0 <target#>
return stm32x_write_options(bank);
}
return stm32x_write_options(bank);
}
-static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int stm32x_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct stm32x_flash_bank *stm32x_info = bank->driver_priv;
uint32_t offset, uint32_t count)
{
struct stm32x_flash_bank *stm32x_info = bank->driver_priv;
-static int stm32x_write(struct flash_bank *bank, uint8_t *buffer,
+static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
}
LOG_INFO("odd number of bytes to write, padding with 0xff");
buffer = memcpy(new_buffer, buffer, count);
}
LOG_INFO("odd number of bytes to write, padding with 0xff");
buffer = memcpy(new_buffer, buffer, count);
- buffer[count++] = 0xff;
+ new_buffer[count++] = 0xff;
}
uint32_t words_remaining = count / 2;
}
uint32_t words_remaining = count / 2;
-static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int stm32x_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int stm32x_write(struct flash_bank *bank, uint8_t *buffer,
+static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int stm32lx_write_half_pages(struct flash_bank *bank, uint8_t *buffer,
+static int stm32lx_write_half_pages(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int stm32lx_write(struct flash_bank *bank, uint8_t *buffer,
+static int stm32lx_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int smi_write_buffer(struct flash_bank *bank, uint8_t *buffer,
+static int smi_write_buffer(struct flash_bank *bank, const uint8_t *buffer,
uint32_t address, uint32_t len)
{
struct target *target = bank->target;
uint32_t address, uint32_t len)
{
struct target *target = bank->target;
-static int stmsmi_write(struct flash_bank *bank, uint8_t *buffer,
+static int stmsmi_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
-static int str7x_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int str7x_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct str7x_flash_bank *str7x_info = bank->driver_priv;
uint32_t offset, uint32_t count)
{
struct str7x_flash_bank *str7x_info = bank->driver_priv;
-static int str7x_write(struct flash_bank *bank, uint8_t *buffer,
+static int str7x_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
}
static int str9x_write_block(struct flash_bank *bank,
}
static int str9x_write_block(struct flash_bank *bank,
- uint8_t *buffer, uint32_t offset, uint32_t count)
+ const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t buffer_size = 32768;
{
struct target *target = bank->target;
uint32_t buffer_size = 32768;
}
static int str9x_write(struct flash_bank *bank,
}
static int str9x_write(struct flash_bank *bank,
- uint8_t *buffer, uint32_t offset, uint32_t count)
+ const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t words_remaining = (count / 2);
{
struct target *target = bank->target;
uint32_t words_remaining = (count / 2);
-static int str9xpec_write(struct flash_bank *bank, uint8_t *buffer,
+static int str9xpec_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct str9xpec_flash_controller *str9xpec_info = bank->driver_priv;
uint32_t offset, uint32_t count)
{
struct str9xpec_flash_controller *str9xpec_info = bank->driver_priv;
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
-static int tms470_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
+static int tms470_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
uint32_t glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat;
{
struct target *target = bank->target;
uint32_t glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat;
-static int virtual_write(struct flash_bank *bank, uint8_t *buffer,
+static int virtual_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct flash_bank *master_bank = virtual_get_master_bank(bank);
uint32_t offset, uint32_t count)
{
struct flash_bank *master_bank = virtual_get_master_bank(bank);
-static int perl_crc(uint8_t *buff8, uint32_t word_count)
+static int perl_crc(const uint8_t *buff8, uint32_t word_count)
{
uint16_t checksum = 0xffff;
{
uint16_t checksum = 0xffff;
const uint32_t pgm_write_pflash_length = 31;
const uint32_t pgm_write_pflash_length = 31;
-int dsp5680xx_f_wr(struct target *t, uint8_t *b, uint32_t a, uint32_t count,
+int dsp5680xx_f_wr(struct target *t, const uint8_t *b, uint32_t a, uint32_t count,
int is_flash_lock)
{
struct target *target = t;
uint32_t address = a;
int is_flash_lock)
{
struct target *target = t;
uint32_t address = a;
+ const uint8_t *buffer = b;
-int dsp5680xx_f_wr(struct target *target, uint8_t * buffer, uint32_t address,
+int dsp5680xx_f_wr(struct target *target, const uint8_t * buffer, uint32_t address,
uint32_t count, int is_flash_lock);
/**
uint32_t count, int is_flash_lock);
/**
*/
int target_run_flash_async_algorithm(struct target *target,
*/
int target_run_flash_async_algorithm(struct target *target,
- uint8_t *buffer, uint32_t count, int block_size,
+ const uint8_t *buffer, uint32_t count, int block_size,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t buffer_start, uint32_t buffer_size,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t buffer_start, uint32_t buffer_size,
*
*/
int target_run_flash_async_algorithm(struct target *target,
*
*/
int target_run_flash_async_algorithm(struct target *target,
- uint8_t *buffer, uint32_t count, int block_size,
+ const uint8_t *buffer, uint32_t count, int block_size,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t buffer_start, uint32_t buffer_size,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t buffer_start, uint32_t buffer_size,
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)