X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstr9xpec.c;h=f0af53a4154801647a2b15d86708ce90490cdd0b;hp=e89ecf49f0838f86a5c5cfa7e00bef8a4adf77e7;hb=90ae846fc4009f8e466566ee0371398e52beecca;hpb=9f0cba528a163645c8ecace413731c23310f2c26 diff --git a/src/flash/nor/str9xpec.c b/src/flash/nor/str9xpec.c index e89ecf49f0..f0af53a415 100644 --- a/src/flash/nor/str9xpec.c +++ b/src/flash/nor/str9xpec.c @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -199,7 +199,6 @@ static int str9xpec_read_config(struct flash_bank *bank) field.out_value = NULL; field.in_value = str9xpec_info->options; - jtag_add_dr_scan(tap, 1, &field, TAP_IDLE); jtag_execute_queue(); @@ -566,7 +565,7 @@ static int str9xpec_set_address(struct flash_bank *bank, uint8_t sector) return ERROR_OK; } -static int str9xpec_write(struct flash_bank *bank, uint8_t *buffer, +static int str9xpec_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) { struct str9xpec_flash_controller *str9xpec_info = bank->driver_priv; @@ -761,12 +760,6 @@ static int str9xpec_erase_check(struct flash_bank *bank) return str9xpec_blank_check(bank, 0, bank->num_sectors - 1); } -static int get_str9xpec_info(struct flash_bank *bank, char *buf, int buf_size) -{ - snprintf(buf, buf_size, "str9xpec flash driver info"); - return ERROR_OK; -} - COMMAND_HANDLER(str9xpec_handle_flash_options_read_command) { uint8_t status; @@ -1050,20 +1043,24 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command) str9xpec_info = bank->driver_priv; - tap0 = str9xpec_info->tap; - /* remove arm core from chain - enter turbo mode */ + tap0 = str9xpec_info->tap; + if (tap0 == NULL) { + /* things are *WRONG* */ + command_print(CMD_CTX, "**STR9FLASH** (tap0) invalid chain?"); + return ERROR_FAIL; + } tap1 = tap0->next_tap; if (tap1 == NULL) { /* things are *WRONG* */ command_print(CMD_CTX, "**STR9FLASH** (tap1) invalid chain?"); - return ERROR_OK; + return ERROR_FAIL; } tap2 = tap1->next_tap; if (tap2 == NULL) { /* things are *WRONG* */ command_print(CMD_CTX, "**STR9FLASH** (tap2) invalid chain?"); - return ERROR_OK; + return ERROR_FAIL; } /* enable turbo mode - TURBO-PROG-ENABLE */ @@ -1212,5 +1209,4 @@ struct flash_driver str9xpec_flash = { .auto_probe = str9xpec_probe, .erase_check = str9xpec_erase_check, .protect_check = str9xpec_protect_check, - .info = get_str9xpec_info, };