X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fstr9xpec.c;h=4a24d85d1117ff82ec39bdf4c043ce12d72e818b;hp=eb08eb244eeefdbb7705e7ed5f3ba68fced25804;hb=e66f9aaba94e232f87c725f2fce98cfb3f92679f;hpb=8c634335b41a805998e5bae05328bb47057cce0b diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index eb08eb244e..4a24d85d11 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -87,6 +87,7 @@ flash_driver_t str9xpec_flash = .protect = str9xpec_protect, .write = str9xpec_write, .probe = str9xpec_probe, + .auto_probe = str9xpec_probe, .erase_check = str9xpec_erase_check, .protect_check = str9xpec_protect_check, .info = str9xpec_info @@ -147,7 +148,7 @@ int str9xpec_set_instr(int chain_pos, u32 new_instr, enum tap_state end_state) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_ir_scan(1, &field, end_state, NULL); + jtag_add_ir_scan(1, &field, end_state); free(field.out_value); } @@ -173,7 +174,7 @@ u8 str9xpec_isc_status(int chain_pos) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); jtag_execute_queue(); DEBUG("status: 0x%2.2x", status); @@ -265,7 +266,7 @@ int str9xpec_read_config(struct flash_bank_s *bank) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); jtag_execute_queue(); status = str9xpec_isc_status(chain_pos); @@ -408,7 +409,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); jtag_add_sleep(40000); /* read blank check result */ @@ -422,7 +423,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_PI, NULL); + jtag_add_dr_scan(1, &field, TAP_PI); jtag_execute_queue(); status = str9xpec_isc_status(chain_pos); @@ -524,7 +525,7 @@ int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); jtag_execute_queue(); jtag_add_sleep(10); @@ -590,7 +591,7 @@ int str9xpec_lock_device(struct flash_bank_s *bank) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, -1, NULL); + jtag_add_dr_scan(1, &field, -1); jtag_execute_queue(); } while(!(status & ISC_STATUS_BUSY)); @@ -676,7 +677,7 @@ int str9xpec_set_address(struct flash_bank_s *bank, u8 sector) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, -1, NULL); + jtag_add_dr_scan(1, &field, -1); return ERROR_OK; } @@ -765,7 +766,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); /* small delay before polling */ jtag_add_sleep(50); @@ -783,7 +784,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, -1, NULL); + jtag_add_dr_scan(1, &field, -1); jtag_execute_queue(); status = buf_get_u32(scanbuf, 0, 8); @@ -793,8 +794,8 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS) return ERROR_FLASH_OPERATION_FAILED; - //if ((status & ISC_STATUS_INT_ERROR) != STR9XPEC_ISC_INTFAIL) - // return ERROR_FLASH_OPERATION_FAILED; + /* if ((status & ISC_STATUS_INT_ERROR) != STR9XPEC_ISC_INTFAIL) + return ERROR_FLASH_OPERATION_FAILED; */ dwords_remaining--; bytes_written += 8; @@ -825,7 +826,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); /* small delay before polling */ jtag_add_sleep(50); @@ -843,7 +844,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, -1, NULL); + jtag_add_dr_scan(1, &field, -1); jtag_execute_queue(); status = buf_get_u32(scanbuf, 0, 8); @@ -853,8 +854,8 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS) return ERROR_FLASH_OPERATION_FAILED; - //if ((status & ISC_STATUS_INT_ERROR) != STR9XPEC_ISC_INTFAIL) - // return ERROR_FLASH_OPERATION_FAILED; + /* if ((status & ISC_STATUS_INT_ERROR) != STR9XPEC_ISC_INTFAIL) + return ERROR_FLASH_OPERATION_FAILED; */ } free(scanbuf); @@ -880,8 +881,7 @@ int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd if (argc < 1) { - command_print(cmd_ctx, "usage: str9xpec part_id "); - return ERROR_OK; + return ERROR_COMMAND_SYNTAX_ERROR; } bank = get_flash_bank_by_num(strtoul(args[0], NULL, 0)); @@ -908,7 +908,7 @@ int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); jtag_execute_queue(); idcode = buf_get_u32(buffer, 0, 32); @@ -1033,7 +1033,7 @@ int str9xpec_write_options(struct flash_bank_s *bank) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, TAP_RTI, NULL); + jtag_add_dr_scan(1, &field, TAP_RTI); /* small delay before polling */ jtag_add_sleep(50); @@ -1051,7 +1051,7 @@ int str9xpec_write_options(struct flash_bank_s *bank) field.in_handler = NULL; field.in_handler_priv = NULL; - jtag_add_dr_scan(1, &field, -1, NULL); + jtag_add_dr_scan(1, &field, -1); jtag_execute_queue(); } while(!(status & ISC_STATUS_BUSY));