The size argument is always set to bank->bus_width and bank pointer
is now passed into cfi_target_{read,write}_memory(), so the size
can be accessed through the bank pointer inside the function instead
of being explicitly passed in.
Change-Id: I0abc1cc3bf513281c10cb5de7a21cb0e75cb7676
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: http://openocd.zylin.com/5389
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
}
static int cfi_target_write_memory(struct flash_bank *bank, target_addr_t addr,
}
static int cfi_target_write_memory(struct flash_bank *bank, target_addr_t addr,
- uint32_t size, uint32_t count,
- const uint8_t *buffer)
+ uint32_t count, const uint8_t *buffer)
- return target_write_memory(bank->target, addr, size, count, buffer);
+ return target_write_memory(bank->target, addr, bank->bus_width,
+ count, buffer);
}
static int cfi_target_read_memory(struct flash_bank *bank, target_addr_t addr,
}
static int cfi_target_read_memory(struct flash_bank *bank, target_addr_t addr,
- uint32_t size, uint32_t count,
- uint8_t *buffer)
+ uint32_t count, uint8_t *buffer)
- return target_read_memory(bank->target, addr, size, count, buffer);
+ return target_read_memory(bank->target, addr, bank->bus_width,
+ count, buffer);
}
static void cfi_command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf)
}
static void cfi_command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf)
uint8_t command[CFI_MAX_BUS_WIDTH];
cfi_command(bank, cmd, command);
uint8_t command[CFI_MAX_BUS_WIDTH];
cfi_command(bank, cmd, command);
- return cfi_target_write_memory(bank, address, bank->bus_width, 1, command);
+ return cfi_target_write_memory(bank, address, 1, command);
}
/* read unsigned 8-bit value from the bank
}
/* read unsigned 8-bit value from the bank
int retval;
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
int retval;
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
- bank->bus_width, 1, data);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
int retval;
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
int retval;
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
- bank->bus_width, 1, data);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
uint8_t i;
for (i = 0; i < 2; i++) {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset + i),
uint8_t i;
for (i = 0; i < 2; i++) {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset + i),
- bank->bus_width, 1, &data[i * bank->bus_width]);
+ 1, &data[i * bank->bus_width]);
if (retval != ERROR_OK)
return retval;
}
} else {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
if (retval != ERROR_OK)
return retval;
}
} else {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
- bank->bus_width, 2, data);
if (retval != ERROR_OK)
return retval;
}
if (retval != ERROR_OK)
return retval;
}
uint8_t i;
for (i = 0; i < 4; i++) {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset + i),
uint8_t i;
for (i = 0; i < 4; i++) {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset + i),
- bank->bus_width, 1, &data[i * bank->bus_width]);
+ 1, &data[i * bank->bus_width]);
if (retval != ERROR_OK)
return retval;
}
} else {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
if (retval != ERROR_OK)
return retval;
}
} else {
retval = cfi_target_read_memory(bank, flash_address(bank, sector, offset),
- bank->bus_width, 4, data);
if (retval != ERROR_OK)
return retval;
}
if (retval != ERROR_OK)
return retval;
}
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = cfi_target_write_memory(bank, address, bank->bus_width, 1, word);
+ retval = cfi_target_write_memory(bank, address, 1, word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = cfi_target_write_memory(bank, address, bank->bus_width, bufferwsize, word);
+ retval = cfi_target_write_memory(bank, address, bufferwsize, word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = cfi_target_write_memory(bank, address, bank->bus_width, 1, word);
+ retval = cfi_target_write_memory(bank, address, 1, word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = cfi_target_write_memory(bank, address, bank->bus_width, bufferwsize, word);
+ retval = cfi_target_write_memory(bank, address, bufferwsize, word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
LOG_INFO("Fixup %d unaligned read head bytes", align);
/* read a complete word from flash */
LOG_INFO("Fixup %d unaligned read head bytes", align);
/* read a complete word from flash */
- retval = cfi_target_read_memory(bank, read_p, bank->bus_width, 1, current_word);
+ retval = cfi_target_read_memory(bank, read_p, 1, current_word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
align = count / bank->bus_width;
if (align) {
align = count / bank->bus_width;
if (align) {
- retval = cfi_target_read_memory(bank, read_p, bank->bus_width, align, buffer);
+ retval = cfi_target_read_memory(bank, read_p, align, buffer);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
LOG_INFO("Fixup %" PRIu32 " unaligned read tail bytes", count);
/* read a complete word from flash */
LOG_INFO("Fixup %" PRIu32 " unaligned read tail bytes", count);
/* read a complete word from flash */
- retval = cfi_target_read_memory(bank, read_p, bank->bus_width, 1, current_word);
+ retval = cfi_target_read_memory(bank, read_p, 1, current_word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
LOG_INFO("Fixup %d unaligned head bytes", align);
/* read a complete word from flash */
LOG_INFO("Fixup %d unaligned head bytes", align);
/* read a complete word from flash */
- retval = cfi_target_read_memory(bank, write_p, bank->bus_width, 1, current_word);
+ retval = cfi_target_read_memory(bank, write_p, 1, current_word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
LOG_INFO("Fixup %" PRId32 " unaligned tail bytes", count);
/* read a complete word from flash */
LOG_INFO("Fixup %" PRId32 " unaligned tail bytes", count);
/* read a complete word from flash */
- retval = cfi_target_read_memory(bank, write_p, bank->bus_width, 1, current_word);
+ retval = cfi_target_read_memory(bank, write_p, 1, current_word);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
return retval;
retval = cfi_target_read_memory(bank, flash_address(bank, 0, 0x00),
return retval;
retval = cfi_target_read_memory(bank, flash_address(bank, 0, 0x00),
- bank->bus_width, 1, value_buf0);
if (retval != ERROR_OK)
return retval;
retval = cfi_target_read_memory(bank, flash_address(bank, 0, 0x01),
if (retval != ERROR_OK)
return retval;
retval = cfi_target_read_memory(bank, flash_address(bank, 0, 0x01),
- bank->bus_width, 1, value_buf1);
if (retval != ERROR_OK)
return retval;
switch (bank->chip_width) {
if (retval != ERROR_OK)
return retval;
switch (bank->chip_width) {
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)