From: David B. <dbr...@us...> - 2010-01-30 00:25:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3d3128a8f5bb15f1d05ac5eb7ecc5e692ae290ce (commit) via 2248c387f2c413c89d0f175b464a6e60ea20e75b (commit) via 303b493c229475df26d69d102bbaf5ae5e5e7a3f (commit) from cd3017cffa68e6f56419177e66332f86ab45675b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3d3128a8f5bb15f1d05ac5eb7ecc5e692ae290ce Author: David Brownell <dbr...@us...> Date: Fri Jan 29 14:31:19 2010 -0800 ADIv5: cleanup, rename swjdp_transaction_endcheck() Make messages reference "DAP" if they're actually transport-agnostic, or "JTAG-DP" when they're JTAG-specific. Saying SWJ-DP is often wrong (on most Cortex-A8 chips) and is confusing even if correct (since we don't yet support SWD). Rename a JTAG-specific routine to jtagdp_transaction_endcheck() to highlight that it's JTAG-specific, and that identify DAP clients undesirably depending on JTAG. (They will all need to change for SWD support.) Shrink a few overlong lines of code. Copy a comment from code removed in a previous patch (for the ARMv7-M "dap baseaddr" command). Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 2ba89e5..b8744d5 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -220,7 +220,7 @@ static int scan_inout_check(struct swjdp_common *swjdp, */ if ((instr == JTAG_DP_APACC) && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) - return swjdp_transaction_endcheck(swjdp); + return jtagdp_transaction_endcheck(swjdp); return ERROR_OK; } @@ -244,12 +244,12 @@ static int scan_inout_check_u32(struct swjdp_common *swjdp, */ if ((instr == JTAG_DP_APACC) && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) - return swjdp_transaction_endcheck(swjdp); + return jtagdp_transaction_endcheck(swjdp); return ERROR_OK; } -int swjdp_transaction_endcheck(struct swjdp_common *swjdp) +int jtagdp_transaction_endcheck(struct swjdp_common *swjdp) { int retval; uint32_t ctrlstat; @@ -322,7 +322,7 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) /* Check for STICKYERR and STICKYORUN */ if (ctrlstat & (SSTICKYORUN | SSTICKYERR)) { - LOG_DEBUG("swjdp: CTRL/STAT error 0x%" PRIx32 "", ctrlstat); + LOG_DEBUG("jtag-dp: CTRL/STAT error, 0x%" PRIx32, ctrlstat); /* Check power to debug regions */ if ((ctrlstat & 0xf0000000) != 0xf0000000) { @@ -333,7 +333,10 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) uint32_t mem_ap_csw, mem_ap_tar; /* Print information about last AHBAP access */ - LOG_ERROR("AHBAP Cached values: dp_select 0x%" PRIx32 ", ap_csw 0x%" PRIx32 ", ap_tar 0x%" PRIx32 "", swjdp->dp_select_value, swjdp->ap_csw_value, swjdp->ap_tar_value); + LOG_ERROR("AHBAP Cached values: dp_select 0x%" PRIx32 + ", ap_csw 0x%" PRIx32 ", ap_tar 0x%" PRIx32, + swjdp->dp_select_value, swjdp->ap_csw_value, + swjdp->ap_tar_value); if (ctrlstat & SSTICKYORUN) LOG_ERROR("JTAG-DP OVERRUN - " "check clock or reduce jtag speed"); @@ -351,13 +354,14 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; - LOG_DEBUG("swjdp: status 0x%" PRIx32 "", ctrlstat); + LOG_DEBUG("jtag-dp: CTRL/STAT 0x%" PRIx32, ctrlstat); dap_ap_read_reg_u32(swjdp, AP_REG_CSW, &mem_ap_csw); dap_ap_read_reg_u32(swjdp, AP_REG_TAR, &mem_ap_tar); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; - LOG_ERROR("Read MEM_AP_CSW 0x%" PRIx32 ", MEM_AP_TAR 0x%" PRIx32 "", mem_ap_csw, mem_ap_tar); + LOG_ERROR("MEM_AP_CSW 0x%" PRIx32 ", MEM_AP_TAR 0x%" + PRIx32, mem_ap_csw, mem_ap_tar); } if ((retval = jtag_execute_queue()) != ERROR_OK) @@ -461,13 +465,13 @@ int dap_setup_accessport(struct swjdp_common *swjdp, uint32_t csw, uint32_t tar) csw = csw | CSW_DBGSWENABLE | CSW_MASTER_DEBUG | CSW_HPROT; if (csw != swjdp->ap_csw_value) { - /* LOG_DEBUG("swjdp : Set CSW %x",csw); */ + /* LOG_DEBUG("DAP: Set CSW %x",csw); */ dap_ap_write_reg_u32(swjdp, AP_REG_CSW, csw); swjdp->ap_csw_value = csw; } if (tar != swjdp->ap_tar_value) { - /* LOG_DEBUG("swjdp : Set TAR %x",tar); */ + /* LOG_DEBUG("DAP: Set TAR %x",tar); */ dap_ap_write_reg_u32(swjdp, AP_REG_TAR, tar); swjdp->ap_tar_value = tar; } @@ -501,7 +505,7 @@ int mem_ap_read_atomic_u32(struct swjdp_common *swjdp, uint32_t address, uint32_ { mem_ap_read_u32(swjdp, address, value); - return swjdp_transaction_endcheck(swjdp); + return jtagdp_transaction_endcheck(swjdp); } /***************************************************************************** @@ -525,7 +529,7 @@ int mem_ap_write_atomic_u32(struct swjdp_common *swjdp, uint32_t address, uint32 { mem_ap_write_u32(swjdp, address, value); - return swjdp_transaction_endcheck(swjdp); + return jtagdp_transaction_endcheck(swjdp); } /***************************************************************************** @@ -583,7 +587,7 @@ int mem_ap_write_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, dap_ap_write_reg(swjdp, AP_REG_DRW, buffer + 4 * writecount); } - if (swjdp_transaction_endcheck(swjdp) == ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) == ERROR_OK) { wcount = wcount - blocksize; address = address + 4 * blocksize; @@ -659,7 +663,7 @@ static int mem_ap_write_buf_packed_u16(struct swjdp_common *swjdp, memcpy(&outvalue, buffer, sizeof(uint32_t)); dap_ap_write_reg_u32(swjdp, AP_REG_DRW, outvalue); - if (swjdp_transaction_endcheck(swjdp) != ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) != ERROR_OK) { LOG_WARNING("Block read error address 0x%" PRIx32 ", count 0x%x", address, count); return ERROR_JTAG_DEVICE_ERROR; @@ -692,7 +696,7 @@ int mem_ap_write_buf_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, memcpy(&svalue, buffer, sizeof(uint16_t)); uint32_t outvalue = (uint32_t)svalue << 8 * (address & 0x3); dap_ap_write_reg_u32(swjdp, AP_REG_DRW, outvalue); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); count -= 2; address += 2; buffer += 2; @@ -752,7 +756,7 @@ static int mem_ap_write_buf_packed_u8(struct swjdp_common *swjdp, memcpy(&outvalue, buffer, sizeof(uint32_t)); dap_ap_write_reg_u32(swjdp, AP_REG_DRW, outvalue); - if (swjdp_transaction_endcheck(swjdp) != ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) != ERROR_OK) { LOG_WARNING("Block read error address 0x%" PRIx32 ", count 0x%x", address, count); return ERROR_JTAG_DEVICE_ERROR; @@ -783,7 +787,7 @@ int mem_ap_write_buf_u8(struct swjdp_common *swjdp, uint8_t *buffer, int count, dap_setup_accessport(swjdp, CSW_8BIT | CSW_ADDRINC_SINGLE, address); uint32_t outvalue = (uint32_t)*buffer << 8 * (address & 0x3); dap_ap_write_reg_u32(swjdp, AP_REG_DRW, outvalue); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); count--; address++; buffer++; @@ -843,7 +847,7 @@ int mem_ap_read_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, adi_jtag_dp_scan(swjdp, JTAG_DP_DPACC, DP_RDBUFF, DPAP_READ, 0, buffer + 4 * readcount, &swjdp->ack); - if (swjdp_transaction_endcheck(swjdp) == ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) == ERROR_OK) { wcount = wcount - blocksize; address += 4 * blocksize; @@ -912,7 +916,7 @@ static int mem_ap_read_buf_packed_u16(struct swjdp_common *swjdp, do { dap_ap_read_reg_u32(swjdp, AP_REG_DRW, &invalue); - if (swjdp_transaction_endcheck(swjdp) != ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) != ERROR_OK) { LOG_WARNING("Block read error address 0x%" PRIx32 ", count 0x%x", address, count); return ERROR_JTAG_DEVICE_ERROR; @@ -949,7 +953,7 @@ int mem_ap_read_buf_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, { dap_setup_accessport(swjdp, CSW_16BIT | CSW_ADDRINC_SINGLE, address); dap_ap_read_reg_u32(swjdp, AP_REG_DRW, &invalue); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); if (address & 0x1) { for (i = 0; i < 2; i++) @@ -1005,7 +1009,7 @@ static int mem_ap_read_buf_packed_u8(struct swjdp_common *swjdp, do { dap_ap_read_reg_u32(swjdp, AP_REG_DRW, &invalue); - if (swjdp_transaction_endcheck(swjdp) != ERROR_OK) + if (jtagdp_transaction_endcheck(swjdp) != ERROR_OK) { LOG_WARNING("Block read error address 0x%" PRIx32 ", count 0x%x", address, count); return ERROR_JTAG_DEVICE_ERROR; @@ -1042,7 +1046,7 @@ int mem_ap_read_buf_u8(struct swjdp_common *swjdp, uint8_t *buffer, int count, u { dap_setup_accessport(swjdp, CSW_8BIT | CSW_ADDRINC_SINGLE, address); dap_ap_read_reg_u32(swjdp, AP_REG_DRW, &invalue); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); *((uint8_t*)buffer) = (invalue >> 8 * (address & 0x3)); count--; address++; @@ -1095,7 +1099,7 @@ int ahbap_debugport_init(struct swjdp_common *swjdp) /* Check that we have debug power domains activated */ while (!(ctrlstat & CDBGPWRUPACK) && (cnt++ < 10)) { - LOG_DEBUG("swjdp: wait CDBGPWRUPACK"); + LOG_DEBUG("DAP: wait CDBGPWRUPACK"); dap_dp_read_reg(swjdp, &ctrlstat, DP_CTRL_STAT); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; @@ -1104,7 +1108,7 @@ int ahbap_debugport_init(struct swjdp_common *swjdp) while (!(ctrlstat & CSYSPWRUPACK) && (cnt++ < 10)) { - LOG_DEBUG("swjdp: wait CSYSPWRUPACK"); + LOG_DEBUG("DAP: wait CSYSPWRUPACK"); dap_dp_read_reg(swjdp, &ctrlstat, DP_CTRL_STAT); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; @@ -1163,7 +1167,7 @@ int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp dap_ap_select(swjdp, apsel); dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &dbgbase); dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); - swjdp_transaction_endcheck(swjdp); + jtagdp_transaction_endcheck(swjdp); /* Now we read ROM table ID registers, ref. ARM IHI 0029B sec */ mem_ap = ((apid&0x10000) && ((apid&0x0F) != 0)); command_print(cmd_ctx, "AP ID register 0x%8.8" PRIx32, apid); @@ -1215,7 +1219,7 @@ int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp mem_ap_read_u32(swjdp, (dbgbase&0xFFFFF000) | 0xFF8, &cid2); mem_ap_read_u32(swjdp, (dbgbase&0xFFFFF000) | 0xFFC, &cid3); mem_ap_read_u32(swjdp, (dbgbase&0xFFFFF000) | 0xFCC, &memtype); - swjdp_transaction_endcheck(swjdp); + jtagdp_transaction_endcheck(swjdp); if (!is_dap_cid_ok(cid3, cid2, cid1, cid0)) command_print(cmd_ctx, "\tCID3 0x%2.2" PRIx32 ", CID2 0x%2.2" PRIx32 @@ -1519,8 +1523,13 @@ DAP_COMMAND_HANDLER(dap_baseaddr_command) if (apselsave != apsel) dap_ap_select(swjdp, apsel); + /* NOTE: assumes we're talking to a MEM-AP, which + * has a base address. There are other kinds of AP, + * though they're not common for now. This should + * use the ID register to verify it's a MEM-AP. + */ dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "0x%8.8" PRIx32, baseaddr); if (apselsave != apsel) @@ -1569,7 +1578,7 @@ DAP_COMMAND_HANDLER(dap_apsel_command) dap_ap_select(swjdp, apsel); dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "ap %" PRIi32 " selected, identification register 0x%8.8" PRIx32, apsel, apid); @@ -1597,7 +1606,7 @@ DAP_COMMAND_HANDLER(dap_apid_command) dap_ap_select(swjdp, apsel); dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "0x%8.8" PRIx32, apid); if (apselsave != apsel) dap_ap_select(swjdp, apselsave); diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 861a13d..a807027 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -170,8 +170,8 @@ int dap_ap_write_reg_u32(struct swjdp_common *swjdp, int dap_ap_read_reg_u32(struct swjdp_common *swjdp, uint32_t addr, uint32_t *value); -/* Queued transactions must be completed with swjdp_transaction_endcheck() */ -int swjdp_transaction_endcheck(struct swjdp_common *swjdp); +/* Queued JTAG ops must be completed with jtagdp_transaction_endcheck() */ +int jtagdp_transaction_endcheck(struct swjdp_common *swjdp); /* MEM-AP memory mapped bus single uint32_t register transfers, without endcheck */ int mem_ap_read_u32(struct swjdp_common *swjdp, uint32_t address, uint32_t *value); diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 3bbe42c..3f34769 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -80,7 +80,7 @@ static int cortexm3_dap_read_coreregister_u32(struct swjdp_common *swjdp, dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRDR & 0xFFFFFFF0); dap_ap_read_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRDR & 0xC), value); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); /* restore DCB_DCRDR - this needs to be in a seperate * transaction otherwise the emulated DCC channel breaks */ @@ -111,7 +111,7 @@ static int cortexm3_dap_write_coreregister_u32(struct swjdp_common *swjdp, dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRSR & 0xFFFFFFF0); dap_ap_write_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRSR & 0xC), regnum | DCRSR_WnR); - retval = swjdp_transaction_endcheck(swjdp); + retval = jtagdp_transaction_endcheck(swjdp); /* restore DCB_DCRDR - this needs to be in a seperate * transaction otherwise the emulated DCC channel breaks */ @@ -238,7 +238,7 @@ static int cortex_m3_endreset_event(struct target *target) target_write_u32(target, dwt_list[i].dwt_comparator_address + 8, dwt_list[i].function); } - swjdp_transaction_endcheck(swjdp); + jtagdp_transaction_endcheck(swjdp); register_cache_invalidate(cortex_m3->armv7m.core_cache); @@ -317,7 +317,7 @@ static int cortex_m3_examine_exception_reason(struct target *target) except_sr = 0; break; } - swjdp_transaction_endcheck(swjdp); + jtagdp_transaction_endcheck(swjdp); LOG_DEBUG("%s SHCSR 0x%" PRIx32 ", SR 0x%" PRIx32 ", CFSR 0x%" PRIx32 ", AR 0x%" PRIx32 "", armv7m_exception_string(armv7m->exception_number), \ shcsr, except_sr, cfsr, except_ar); return ERROR_OK; commit 2248c387f2c413c89d0f175b464a6e60ea20e75b Author: David Brownell <dbr...@us...> Date: Fri Jan 29 14:16:14 2010 -0800 ARMv7-M: use command handler for "dap baseaddr". Make the ARMv7-M DAP code reuse the command handler for "dap baseaddr". For some reason, this DAP command wasn't converted earlier. This is a code shrink and simplification; it also removes a needless transport dependency on JTAG. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv7m.c b/src/target/armv7m.c index c172a27..edfcdf9 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -751,37 +751,8 @@ COMMAND_HANDLER(handle_dap_baseaddr_command) struct target *target = get_current_target(CMD_CTX); struct armv7m_common *armv7m = target_to_armv7m(target); struct swjdp_common *swjdp = &armv7m->swjdp_info; - uint32_t apsel, apselsave, baseaddr; - int retval; - apselsave = swjdp->apsel; - switch (CMD_ARGC) { - case 0: - apsel = swjdp->apsel; - break; - case 1: - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel); - break; - default: - return ERROR_COMMAND_SYNTAX_ERROR; - } - - if (apselsave != apsel) - dap_ap_select(swjdp, apsel); - - /* NOTE: assumes we're talking to a MEM-AP, which - * has a base address. There are other kinds of AP, - * though they're not common for now. This should - * use the ID register to verify it's a MEM-AP. - */ - dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr); - retval = swjdp_transaction_endcheck(swjdp); - command_print(CMD_CTX, "0x%8.8" PRIx32 "", baseaddr); - - if (apselsave != apsel) - dap_ap_select(swjdp, apselsave); - - return retval; + return CALL_COMMAND_HANDLER(dap_baseaddr_command, swjdp); } /* commit 303b493c229475df26d69d102bbaf5ae5e5e7a3f Author: David Brownell <dbr...@us...> Date: Fri Jan 29 13:52:08 2010 -0800 NOR: cleanup driver decls Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/flash/nor/aduc702x.c b/src/flash/nor/aduc702x.c index 211b54e..7e81b32 100644 --- a/src/flash/nor/aduc702x.c +++ b/src/flash/nor/aduc702x.c @@ -412,14 +412,14 @@ static int aduc702x_check_flash_completion(struct target* target, unsigned int t } struct flash_driver aduc702x_flash = { - .name = "aduc702x", - .flash_bank_command = &aduc702x_flash_bank_command, - .erase = &aduc702x_erase, - .protect = &aduc702x_protect, - .write = &aduc702x_write, - .probe = &aduc702x_probe, - .auto_probe = &aduc702x_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &aduc702x_protect_check, - .info = &aduc702x_info - }; + .name = "aduc702x", + .flash_bank_command = aduc702x_flash_bank_command, + .erase = aduc702x_erase, + .protect = aduc702x_protect, + .write = aduc702x_write, + .probe = aduc702x_probe, + .auto_probe = aduc702x_probe, + .erase_check = default_flash_blank_check, + .protect_check = aduc702x_protect_check, + .info = aduc702x_info +}; diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index 5dacf6f..1b2f27c 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -2501,15 +2501,15 @@ static const struct command_registration at91sam3_command_handlers[] = { }; struct flash_driver at91sam3_flash = { - .name = "at91sam3", - .commands = at91sam3_command_handlers, - .flash_bank_command = &sam3_flash_bank_command, - .erase = &sam3_erase, - .protect = &sam3_protect, - .write = &sam3_write, - .probe = &sam3_probe, - .auto_probe = &sam3_auto_probe, - .erase_check = &sam3_erase_check, - .protect_check = &sam3_protect_check, - .info = &sam3_info, - }; + .name = "at91sam3", + .commands = at91sam3_command_handlers, + .flash_bank_command = sam3_flash_bank_command, + .erase = sam3_erase, + .protect = sam3_protect, + .write = sam3_write, + .probe = sam3_probe, + .auto_probe = sam3_auto_probe, + .erase_check = sam3_erase_check, + .protect_check = sam3_protect_check, + .info = sam3_info, +}; diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 6c2d17f..c072419 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -452,7 +452,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) static const struct command_registration avrf_exec_command_handlers[] = { { .name = "mass_erase", - .handler = &avrf_handle_mass_erase_command, + .handler = avrf_handle_mass_erase_command, .mode = COMMAND_EXEC, .help = "erase entire device", }, @@ -469,15 +469,15 @@ static const struct command_registration avrf_command_handlers[] = { }; struct flash_driver avr_flash = { - .name = "avr", - .commands = avrf_command_handlers, - .flash_bank_command = &avrf_flash_bank_command, - .erase = &avrf_erase, - .protect = &avrf_protect, - .write = &avrf_write, - .probe = &avrf_probe, - .auto_probe = &avrf_auto_probe, - .erase_check = &default_flash_mem_blank_check, - .protect_check = &avrf_protect_check, - .info = &avrf_info, - }; + .name = "avr", + .commands = avrf_command_handlers, + .flash_bank_command = avrf_flash_bank_command, + .erase = avrf_erase, + .protect = avrf_protect, + .write = avrf_write, + .probe = avrf_probe, + .auto_probe = avrf_auto_probe, + .erase_check = default_flash_mem_blank_check, + .protect_check = avrf_protect_check, + .info = avrf_info, +}; diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 71270b9..42aa294 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -2618,14 +2618,14 @@ static int cfi_info(struct flash_bank *bank, char *buf, int buf_size) } struct flash_driver cfi_flash = { - .name = "cfi", - .flash_bank_command = &cfi_flash_bank_command, - .erase = &cfi_erase, - .protect = &cfi_protect, - .write = &cfi_write, - .probe = &cfi_probe, - .auto_probe = &cfi_auto_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &cfi_protect_check, - .info = &cfi_info, - }; + .name = "cfi", + .flash_bank_command = cfi_flash_bank_command, + .erase = cfi_erase, + .protect = cfi_protect, + .write = cfi_write, + .probe = cfi_probe, + .auto_probe = cfi_auto_probe, + .erase_check = default_flash_blank_check, + .protect_check = cfi_protect_check, + .info = cfi_info, +}; diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index b51e0a0..783a40c 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -431,14 +431,14 @@ static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char #endif struct flash_driver ecosflash_flash = { - .name = "ecosflash", - .flash_bank_command = &ecosflash_flash_bank_command, - .erase = &ecosflash_erase, - .protect = &ecosflash_protect, - .write = &ecosflash_write, - .probe = &ecosflash_probe, - .auto_probe = &ecosflash_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &ecosflash_protect_check, - .info = &ecosflash_info - }; + .name = "ecosflash", + .flash_bank_command = ecosflash_flash_bank_command, + .erase = ecosflash_erase, + .protect = ecosflash_protect, + .write = ecosflash_write, + .probe = ecosflash_probe, + .auto_probe = ecosflash_probe, + .erase_check = default_flash_blank_check, + .protect_check = ecosflash_protect_check, + .info = ecosflash_info +}; diff --git a/src/flash/nor/faux.c b/src/flash/nor/faux.c index 948f305..e1e77ea 100644 --- a/src/flash/nor/faux.c +++ b/src/flash/nor/faux.c @@ -135,15 +135,15 @@ static const struct command_registration faux_command_handlers[] = { }; struct flash_driver faux_flash = { - .name = "faux", - .commands = faux_command_handlers, - .flash_bank_command = &faux_flash_bank_command, - .erase = &faux_erase, - .protect = &faux_protect, - .write = &faux_write, - .probe = &faux_probe, - .auto_probe = &faux_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &faux_protect_check, - .info = &faux_info - }; + .name = "faux", + .commands = faux_command_handlers, + .flash_bank_command = faux_flash_bank_command, + .erase = faux_erase, + .protect = faux_protect, + .write = faux_write, + .probe = faux_probe, + .auto_probe = faux_probe, + .erase_check = default_flash_blank_check, + .protect_check = faux_protect_check, + .info = faux_info +}; diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c index ae0a384..fc2b1cf 100644 --- a/src/flash/nor/lpc2000.c +++ b/src/flash/nor/lpc2000.c @@ -783,7 +783,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command) static const struct command_registration lpc2000_exec_command_handlers[] = { { .name = "part_id", - .handler = &lpc2000_handle_part_id_command, + .handler = lpc2000_handle_part_id_command, .mode = COMMAND_EXEC, .help = "print part id of lpc2000 flash bank <num>", }, @@ -800,17 +800,15 @@ static const struct command_registration lpc2000_command_handlers[] = { }; struct flash_driver lpc2000_flash = { - .name = "lpc2000", - .commands = lpc2000_command_handlers, - .flash_bank_command = &lpc2000_flash_bank_command, - .erase = &lpc2000_erase, - .protect = &lpc2000_protect, - .write = &lpc2000_write, - .probe = &lpc2000_probe, - .auto_probe = &lpc2000_probe, - .erase_check = &lpc2000_erase_check, - .protect_check = &lpc2000_protect_check, - .info = &lpc2000_info, - }; - - + .name = "lpc2000", + .commands = lpc2000_command_handlers, + .flash_bank_command = lpc2000_flash_bank_command, + .erase = lpc2000_erase, + .protect = lpc2000_protect, + .write = lpc2000_write, + .probe = lpc2000_probe, + .auto_probe = lpc2000_probe, + .erase_check = lpc2000_erase_check, + .protect_check = lpc2000_protect_check, + .info = lpc2000_info, +}; diff --git a/src/flash/nor/lpc288x.c b/src/flash/nor/lpc288x.c index 5cb36d0..5ab4e9c 100644 --- a/src/flash/nor/lpc288x.c +++ b/src/flash/nor/lpc288x.c @@ -473,14 +473,14 @@ static int lpc288x_protect(struct flash_bank *bank, int set, int first, int last } struct flash_driver lpc288x_flash = { - .name = "lpc288x", - .flash_bank_command = &lpc288x_flash_bank_command, - .erase = &lpc288x_erase, - .protect = &lpc288x_protect, - .write = &lpc288x_write, - .probe = &lpc288x_probe, - .auto_probe = &lpc288x_probe, - .erase_check = &lpc288x_erase_check, - .protect_check = &lpc288x_protect_check, - .info = &lpc288x_info, - }; + .name = "lpc288x", + .flash_bank_command = lpc288x_flash_bank_command, + .erase = lpc288x_erase, + .protect = lpc288x_protect, + .write = lpc288x_write, + .probe = lpc288x_probe, + .auto_probe = lpc288x_probe, + .erase_check = lpc288x_erase_check, + .protect_check = lpc288x_protect_check, + .info = lpc288x_info, +}; diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index d39b2dd..360c14d 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -951,14 +951,14 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command) static const struct command_registration lpc2900_exec_command_handlers[] = { { .name = "signature", - .handler = &lpc2900_handle_signature_command, + .handler = lpc2900_handle_signature_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Calculate and display signature of flash bank.", }, { .name = "read_custom", - .handler = &lpc2900_handle_read_custom_command, + .handler = lpc2900_handle_read_custom_command, .mode = COMMAND_EXEC, .usage = "bank_id filename", .help = "Copies 912 bytes of customer information " @@ -966,14 +966,14 @@ static const struct command_registration lpc2900_exec_command_handlers[] = { }, { .name = "password", - .handler = &lpc2900_handle_password_command, + .handler = lpc2900_handle_password_command, .mode = COMMAND_EXEC, .usage = "bank_id password", .help = "Enter fixed password to enable 'dangerous' options.", }, { .name = "write_custom", - .handler = &lpc2900_handle_write_custom_command, + .handler = lpc2900_handle_write_custom_command, .mode = COMMAND_EXEC, .usage = "bank_id filename ('bin'|'ihex'|'elf'|'s19')", .help = "Copies 912 bytes of customer info from file " @@ -981,7 +981,7 @@ static const struct command_registration lpc2900_exec_command_handlers[] = { }, { .name = "secure_sector", - .handler = &lpc2900_handle_secure_sector_command, + .handler = lpc2900_handle_secure_sector_command, .mode = COMMAND_EXEC, .usage = "bank_id first_sector last_sector", .help = "Activate sector security for a range of sectors. " @@ -989,7 +989,7 @@ static const struct command_registration lpc2900_exec_command_handlers[] = { }, { .name = "secure_jtag", - .handler = &lpc2900_handle_secure_jtag_command, + .handler = lpc2900_handle_secure_jtag_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Disable the JTAG port. " diff --git a/src/flash/nor/ocl.c b/src/flash/nor/ocl.c index 961537e..5d93724 100644 --- a/src/flash/nor/ocl.c +++ b/src/flash/nor/ocl.c @@ -348,14 +348,14 @@ static int ocl_auto_probe(struct flash_bank *bank) } struct flash_driver ocl_flash = { - .name = "ocl", - .flash_bank_command = &ocl_flash_bank_command, - .erase = &ocl_erase, - .protect = &ocl_protect, - .write = &ocl_write, - .probe = &ocl_probe, - .erase_check = &ocl_erase_check, - .protect_check = &ocl_protect_check, - .info = &ocl_info, - .auto_probe = &ocl_auto_probe, - }; + .name = "ocl", + .flash_bank_command = ocl_flash_bank_command, + .erase = ocl_erase, + .protect = ocl_protect, + .write = ocl_write, + .probe = ocl_probe, + .erase_check = ocl_erase_check, + .protect_check = ocl_protect_check, + .info = ocl_info, + .auto_probe = ocl_auto_probe, +}; diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index 7d98af3..1f66346 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -886,13 +886,13 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command) static const struct command_registration pic32mx_exec_command_handlers[] = { { .name = "chip_erase", - .handler = &pic32mx_handle_chip_erase_command, + .handler = pic32mx_handle_chip_erase_command, .mode = COMMAND_EXEC, .help = "erase device", }, { .name = "pgm_word", - .handler = &pic32mx_handle_pgm_word_command, + .handler = pic32mx_handle_pgm_word_command, .mode = COMMAND_EXEC, .help = "program a word", }, @@ -909,15 +909,15 @@ static const struct command_registration pic32mx_command_handlers[] = { }; struct flash_driver pic32mx_flash = { - .name = "pic32mx", - .commands = pic32mx_command_handlers, - .flash_bank_command = &pic32mx_flash_bank_command, - .erase = &pic32mx_erase, - .protect = &pic32mx_protect, - .write = &pic32mx_write, - .probe = &pic32mx_probe, - .auto_probe = &pic32mx_auto_probe, - .erase_check = &default_flash_mem_blank_check, - .protect_check = &pic32mx_protect_check, - .info = &pic32mx_info, - }; + .name = "pic32mx", + .commands = pic32mx_command_handlers, + .flash_bank_command = pic32mx_flash_bank_command, + .erase = pic32mx_erase, + .protect = pic32mx_protect, + .write = pic32mx_write, + .probe = pic32mx_probe, + .auto_probe = pic32mx_auto_probe, + .erase_check = default_flash_mem_blank_check, + .protect_check = pic32mx_protect_check, + .info = pic32mx_info, +}; diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 8d35f9b..107b1c6 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -1173,7 +1173,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) static const struct command_registration stellaris_exec_command_handlers[] = { { .name = "mass_erase", - .handler = &stellaris_handle_mass_erase_command, + .handler = stellaris_handle_mass_erase_command, .mode = COMMAND_EXEC, .help = "erase entire device", }, diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index 75dcf3b..eaa3a0e 100644 --- a/src/flash/nor/stm32x.c +++ b/src/flash/nor/stm32x.c @@ -1193,35 +1193,35 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) static const struct command_registration stm32x_exec_command_handlers[] = { { .name = "lock", - .handler = &stm32x_handle_lock_command, + .handler = stm32x_handle_lock_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Lock entire flash device.", }, { .name = "unlock", - .handler = &stm32x_handle_unlock_command, + .handler = stm32x_handle_unlock_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Unlock entire protected flash device.", }, { .name = "mass_erase", - .handler = &stm32x_handle_mass_erase_command, + .handler = stm32x_handle_mass_erase_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Erase entire flash device.", }, { .name = "options_read", - .handler = &stm32x_handle_options_read_command, + .handler = stm32x_handle_options_read_command, .mode = COMMAND_EXEC, .usage = "bank_id", .help = "Read and display device option byte.", }, { .name = "options_write", - .handler = &stm32x_handle_options_write_command, + .handler = stm32x_handle_options_write_command, .mode = COMMAND_EXEC, .usage = "bank_id ('SWWDG'|'HWWDG') " "('RSTSTNDBY'|'NORSTSTNDBY') " @@ -1241,15 +1241,15 @@ static const struct command_registration stm32x_command_handlers[] = { }; struct flash_driver stm32x_flash = { - .name = "stm32x", - .commands = stm32x_command_handlers, - .flash_bank_command = &stm32x_flash_bank_command, - .erase = &stm32x_erase, - .protect = &stm32x_protect, - .write = &stm32x_write, - .probe = &stm32x_probe, - .auto_probe = &stm32x_auto_probe, - .erase_check = &default_flash_mem_blank_check, - .protect_check = &stm32x_protect_check, - .info = &stm32x_info, - }; + .name = "stm32x", + .commands = stm32x_command_handlers, + .flash_bank_command = stm32x_flash_bank_command, + .erase = stm32x_erase, + .protect = stm32x_protect, + .write = stm32x_write, + .probe = stm32x_probe, + .auto_probe = stm32x_auto_probe, + .erase_check = default_flash_mem_blank_check, + .protect_check = stm32x_protect_check, + .info = stm32x_info, +}; diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c index 040097a..a2e27da 100644 --- a/src/flash/nor/str7x.c +++ b/src/flash/nor/str7x.c @@ -676,7 +676,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) static const struct command_registration str7x_exec_command_handlers[] = { { .name = "disable_jtag", - .handler = &str7x_handle_disable_jtag_command, + .handler = str7x_handle_disable_jtag_command, .mode = COMMAND_EXEC, .help = "disable jtag access", }, @@ -693,15 +693,15 @@ static const struct command_registration str7x_command_handlers[] = { }; struct flash_driver str7x_flash = { - .name = "str7x", - .commands = str7x_command_handlers, - .flash_bank_command = &str7x_flash_bank_command, - .erase = &str7x_erase, - .protect = &str7x_protect, - .write = &str7x_write, - .probe = &str7x_probe, - .auto_probe = &str7x_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &str7x_protect_check, - .info = &str7x_info, - }; + .name = "str7x", + .commands = str7x_command_handlers, + .flash_bank_command = str7x_flash_bank_command, + .erase = str7x_erase, + .protect = str7x_protect, + .write = str7x_write, + .probe = str7x_probe, + .auto_probe = str7x_probe, + .erase_check = default_flash_blank_check, + .protect_check = str7x_protect_check, + .info = str7x_info, +}; diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c index d0c1278..0875851 100644 --- a/src/flash/nor/str9x.c +++ b/src/flash/nor/str9x.c @@ -668,7 +668,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command) static const struct command_registration str9x_config_command_handlers[] = { { .name = "flash_config", - .handler = &str9x_handle_flash_config_command, + .handler = str9x_handle_flash_config_command, .mode = COMMAND_EXEC, .help = "Configure str9x flash controller, prior to " "programming the flash.", @@ -687,15 +687,15 @@ static const struct command_registration str9x_command_handlers[] = { }; struct flash_driver str9x_flash = { - .name = "str9x", - .commands = str9x_command_handlers, - .flash_bank_command = &str9x_flash_bank_command, - .erase = &str9x_erase, - .protect = &str9x_protect, - .write = &str9x_write, - .probe = &str9x_probe, - .auto_probe = &str9x_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &str9x_protect_check, - .info = &str9x_info, - }; + .name = "str9x", + .commands = str9x_command_handlers, + .flash_bank_command = str9x_flash_bank_command, + .erase = str9x_erase, + .protect = str9x_protect, + .write = str9x_write, + .probe = str9x_probe, + .auto_probe = str9x_probe, + .erase_check = default_flash_blank_check, + .protect_check = str9x_protect_check, + .info = str9x_info, +}; diff --git a/src/flash/nor/str9xpec.c b/src/flash/nor/str9xpec.c index 734f2d1..f0e11a5 100644 --- a/src/flash/nor/str9xpec.c +++ b/src/flash/nor/str9xpec.c @@ -1244,15 +1244,15 @@ static const struct command_registration str9xpec_command_handlers[] = { }; struct flash_driver str9xpec_flash = { - .name = "str9xpec", - .commands = str9xpec_command_handlers, - .flash_bank_command = &str9xpec_flash_bank_command, - .erase = &str9xpec_erase, - .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, - }; + .name = "str9xpec", + .commands = str9xpec_command_handlers, + .flash_bank_command = str9xpec_flash_bank_command, + .erase = str9xpec_erase, + .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, +}; diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index cf40a81..a40230b 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -924,7 +924,7 @@ COMMAND_HANDLER(handle_flash_init_command) static const struct command_registration flash_config_command_handlers[] = { { .name = "bank", - .handler = &handle_flash_bank_command, + .handler = handle_flash_bank_command, .mode = COMMAND_CONFIG, .usage = "bank_id driver_name base_address size_bytes " "chip_width_bytes bus_width_bytes target " @@ -935,19 +935,19 @@ static const struct command_registration flash_config_command_handlers[] = { { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_flash_init_command, + .handler = handle_flash_init_command, .help = "Initialize flash devices.", }, { .name = "banks", .mode = COMMAND_ANY, - .handler = &handle_flash_banks_command, + .handler = handle_flash_banks_command, .help = "Display table with information about flash banks.", }, { .name = "list", .mode = COMMAND_ANY, - .jim_handler = &jim_flash_list, + .jim_handler = jim_flash_list, .help = "Returns a list of details about the flash banks.", }, COMMAND_REGISTRATION_DONE diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index 7efcbd4..af635d4 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -821,19 +821,19 @@ static int tms470_erase_sector(struct flash_bank *bank, int sector) static const struct command_registration tms470_any_command_handlers[] = { { .name = "flash_keyset", - .handler = &tms470_handle_flash_keyset_command, + .handler = tms470_handle_flash_keyset_command, .mode = COMMAND_ANY, .help = "tms470 flash_keyset <key0> <key1> <key2> <key3>", }, { .name = "osc_megahertz", - .handler = &tms470_handle_osc_megahertz_command, + .handler = tms470_handle_osc_megahertz_command, .mode = COMMAND_ANY, .help = "tms470 osc_megahertz <MHz>", }, { .name = "plldis", - .handler = &tms470_handle_plldis_command, + .handler = tms470_handle_plldis_command, .mode = COMMAND_ANY, .help = "tms470 plldis <0/1>", }, @@ -1258,15 +1258,15 @@ FLASH_BANK_COMMAND_HANDLER(tms470_flash_bank_command) } struct flash_driver tms470_flash = { - .name = "tms470", - .commands = tms470_command_handlers, - .flash_bank_command = &tms470_flash_bank_command, - .erase = &tms470_erase, - .protect = &tms470_protect, - .write = &tms470_write, - .probe = &tms470_probe, - .auto_probe = &tms470_auto_probe, - .erase_check = &tms470_erase_check, - .protect_check = &tms470_protect_check, - .info = &tms470_info, - }; + .name = "tms470", + .commands = tms470_command_handlers, + .flash_bank_command = tms470_flash_bank_command, + .erase = tms470_erase, + .protect = tms470_protect, + .write = tms470_write, + .probe = tms470_probe, + .auto_probe = tms470_auto_probe, + .erase_check = tms470_erase_check, + .protect_check = tms470_protect_check, + .info = tms470_info, +}; ----------------------------------------------------------------------- Summary of changes: src/flash/nor/aduc702x.c | 22 +++++++------- src/flash/nor/at91sam3.c | 24 ++++++++-------- src/flash/nor/avrf.c | 26 +++++++++--------- src/flash/nor/cfi.c | 22 +++++++------- src/flash/nor/ecos.c | 22 +++++++------- src/flash/nor/faux.c | 24 ++++++++-------- src/flash/nor/lpc2000.c | 28 +++++++++---------- src/flash/nor/lpc288x.c | 22 +++++++------- src/flash/nor/lpc2900.c | 12 ++++---- src/flash/nor/ocl.c | 22 +++++++------- src/flash/nor/pic32mx.c | 28 +++++++++--------- src/flash/nor/stellaris.c | 2 +- src/flash/nor/stm32x.c | 34 ++++++++++++------------ src/flash/nor/str7x.c | 26 +++++++++--------- src/flash/nor/str9x.c | 26 +++++++++--------- src/flash/nor/str9xpec.c | 24 ++++++++-------- src/flash/nor/tcl.c | 8 +++--- src/flash/nor/tms470.c | 30 ++++++++++---------- src/target/arm_adi_v5.c | 65 +++++++++++++++++++++++++------------------- src/target/arm_adi_v5.h | 4 +- src/target/armv7m.c | 31 +-------------------- src/target/cortex_m3.c | 8 +++--- 22 files changed, 244 insertions(+), 266 deletions(-) hooks/post-receive -- Main OpenOCD repository |