* 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
field.out_value = NULL;
field.in_value = str9xpec_info->options;
-
jtag_add_dr_scan(tap, 1, &field, TAP_IDLE);
jtag_execute_queue();
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;
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;
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 */
.auto_probe = str9xpec_probe,
.erase_check = str9xpec_erase_check,
.protect_check = str9xpec_protect_check,
- .info = get_str9xpec_info,
};