Skip to content

Commit

Permalink
jtag: Rename 'hasidcode' to 'has_idcode'
Browse files Browse the repository at this point in the history
While at it, fix some coding style issues.

Change-Id: I8196045f46ce043ed0d28cb95470132b3a7de1bb
Signed-off-by: Marc Schink <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8039
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
zapb-0 authored and borneoa committed Dec 16, 2023
1 parent d3d287b commit f018cd7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/flash/nor/xcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int xcf_probe(struct flash_bank *bank)
}

/* check idcode and alloc memory for sector table */
if (!bank->target->tap->hasidcode)
if (!bank->target->tap->has_idcode)
return ERROR_FLASH_OPERATION_FAILED;

/* guess number of blocks using chip ID */
Expand Down
6 changes: 3 additions & 3 deletions src/jtag/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ static bool jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned ma
static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap)
{

if (tap->expected_ids_cnt == 0 || !tap->hasidcode)
if (tap->expected_ids_cnt == 0 || !tap->has_idcode)
return true;

/* optionally ignore the JTAG version field - bits 28-31 of IDCODE */
Expand Down Expand Up @@ -1283,13 +1283,13 @@ static int jtag_examine_chain(void)
/* Zero for LSB indicates a device in bypass */
LOG_INFO("TAP %s does not have valid IDCODE (idcode=0x%" PRIx32 ")",
tap->dotted_name, idcode);
tap->hasidcode = false;
tap->has_idcode = false;
tap->idcode = 0;

bit_count += 1;
} else {
/* Friendly devices support IDCODE */
tap->hasidcode = true;
tap->has_idcode = true;
tap->idcode = idcode;
jtag_examine_chain_display(LOG_LVL_INFO, "tap/device found", tap->dotted_name, idcode);

Expand Down
2 changes: 1 addition & 1 deletion src/jtag/hla/hla_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int hl_interface_init_target(struct target *t)
}

t->tap->priv = &hl_if;
t->tap->hasidcode = 1;
t->tap->has_idcode = true;

return ERROR_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/jtag.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct jtag_tap {
uint32_t idcode; /**< device identification code */
/** not all devices have idcode,
* we'll discover this during chain examination */
bool hasidcode;
bool has_idcode;

/** Array of expected identification codes */
uint32_t *expected_ids;
Expand Down
2 changes: 1 addition & 1 deletion src/pld/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int intel_check_for_unique_id(struct intel_pld_device *intel_info)

static int intel_check_config(struct intel_pld_device *intel_info)
{
if (!intel_info->tap->hasidcode) {
if (!intel_info->tap->has_idcode) {
LOG_ERROR("no IDCODE");
return ERROR_FAIL;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pld/lattice.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int lattice_check_device_family(struct lattice_pld_device *lattice_device
if (lattice_device->family != LATTICE_UNKNOWN && lattice_device->preload_length != 0)
return ERROR_OK;

if (!lattice_device->tap || !lattice_device->tap->hasidcode)
if (!lattice_device->tap || !lattice_device->tap->has_idcode)
return ERROR_FAIL;

for (size_t i = 0; i < ARRAY_SIZE(lattice_devices); ++i) {
Expand Down Expand Up @@ -280,7 +280,7 @@ static int lattice_load_command(struct pld_device *pld_device, const char *filen
return ERROR_FAIL;
struct jtag_tap *tap = lattice_device->tap;

if (!tap || !tap->hasidcode)
if (!tap || !tap->has_idcode)
return ERROR_FAIL;

int retval = lattice_check_device_family(lattice_device);
Expand Down
2 changes: 1 addition & 1 deletion src/target/dsp563xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static int dsp563xx_examine(struct target *target)
{
uint32_t chip;

if (target->tap->hasidcode == false) {
if (!target->tap->has_idcode) {
LOG_ERROR("no IDCODE present on device");
return ERROR_COMMAND_SYNTAX_ERROR;
}
Expand Down

0 comments on commit f018cd7

Please sign in to comment.