int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state)
{
- if( tap == NULL ){
+ if (tap == NULL ){
return ERROR_TARGET_INVALID;
}
arm7_9 = armv4_5->arch_info;
jtag_info = &arm7_9->jtag_info;
- str9xpec_info->tap = jtag_tap_by_position( jtag_info->tap->abs_chain_position - 1);
+ str9xpec_info->tap = jtag_tap_by_position(jtag_info->tap->abs_chain_position - 1);
str9xpec_info->isc_enable = 0;
str9xpec_build_block_list(bank);
tap = str9xpec_info->tap;
if (!str9xpec_info->isc_enable) {
- str9xpec_isc_enable( bank );
+ str9xpec_isc_enable(bank );
}
if (!str9xpec_info->isc_enable) {
tap = str9xpec_info->tap;
if (!str9xpec_info->isc_enable) {
- str9xpec_isc_enable( bank );
+ str9xpec_isc_enable(bank );
}
if (!str9xpec_info->isc_enable) {
tap = str9xpec_info->tap;
if (!str9xpec_info->isc_enable) {
- str9xpec_isc_enable( bank );
+ str9xpec_isc_enable(bank );
}
if (!str9xpec_info->isc_enable) {
jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
- } while(!(status & ISC_STATUS_BUSY));
+ } while (!(status & ISC_STATUS_BUSY));
str9xpec_isc_disable(bank);
/* last bank: 0xFF signals a full device protect */
if (last == 0xFF)
{
- if( set )
+ if (set )
{
status = str9xpec_lock_device(bank);
}
{
for (i = first; i <= last; i++)
{
- if( set )
+ if (set )
buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 1);
else
buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 0);
if (offset & 0x7)
{
- LOG_WARNING("offset 0x%x breaks required 8-byte alignment", offset);
+ LOG_WARNING("offset 0x%" PRIx32 " breaks required 8-byte alignment", offset);
return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
}
status = buf_get_u32(scanbuf, 0, 8);
- } while(!(status & ISC_STATUS_BUSY));
+ } while (!(status & ISC_STATUS_BUSY));
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return ERROR_FLASH_OPERATION_FAILED;
uint8_t last_dword[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
int i = 0;
- while(bytes_remaining > 0)
+ while (bytes_remaining > 0)
{
last_dword[i++] = *(buffer + bytes_written);
bytes_remaining--;
status = buf_get_u32(scanbuf, 0, 8);
- } while(!(status & ISC_STATUS_BUSY));
+ } while (!(status & ISC_STATUS_BUSY));
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return ERROR_FLASH_OPERATION_FAILED;
idcode = buf_get_u32(buffer, 0, 32);
- command_print(cmd_ctx, "str9xpec part id: 0x%8.8x", idcode);
+ command_print(cmd_ctx, "str9xpec part id: 0x%8.8" PRIx32 "", idcode);
free(buffer);
tap = str9xpec_info->tap;
/* erase config options first */
- status = str9xpec_erase_area( bank, 0xFE, 0xFE );
+ status = str9xpec_erase_area(bank, 0xFE, 0xFE );
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return status;
if (!str9xpec_info->isc_enable) {
- str9xpec_isc_enable( bank );
+ str9xpec_isc_enable(bank );
}
if (!str9xpec_info->isc_enable) {
jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
- } while(!(status & ISC_STATUS_BUSY));
+ } while (!(status & ISC_STATUS_BUSY));
str9xpec_isc_disable(bank);
if (argc < 2)
{
- command_print(cmd_ctx, "str9xpec options_cmap <bank> <bank0|bank1>");
+ command_print(cmd_ctx, "str9xpec options_cmap <bank> <bank0 | bank1>");
return ERROR_OK;
}
if (argc < 2)
{
- command_print(cmd_ctx, "str9xpec options_lvdthd <bank> <2.4v|2.7v>");
+ command_print(cmd_ctx, "str9xpec options_lvdthd <bank> <2.4v | 2.7v>");
return ERROR_OK;
}
if (argc < 2)
{
- command_print(cmd_ctx, "str9xpec options_lvdsel <bank> <vdd|vdd_vddq>");
+ command_print(cmd_ctx, "str9xpec options_lvdsel <bank> <vdd | vdd_vddq>");
return ERROR_OK;
}
if (argc < 2)
{
- command_print(cmd_ctx, "str9xpec options_lvdwarn <bank> <vdd|vdd_vddq>");
+ command_print(cmd_ctx, "str9xpec options_lvdwarn <bank> <vdd | vdd_vddq>");
return ERROR_OK;
}