From 0cb050a8ccab7c2936027fe239797789a07e0f36 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 30 Jun 2011 02:16:18 +0000 Subject: [PATCH] cmd_bfin: add a check when doing "bfin reset" to make sure we are in emulation mode first git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1928 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/src/cmd/cmd_bfin.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 9b445948..40dbb8db 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -7,6 +7,9 @@ avoid constant generation loops where other files are newer, but not a different list of commands. + * src/cmd/cmd_bfin.c (cmd_bfin_run): Make sure the part is in emulation mode + first before attempting a reset (since we need to be). + 2011-06-27 Jie Zhang * include/urjtag/Makefile.am (nodist_pkginclude_HEADERS): New and diff --git a/urjtag/src/cmd/cmd_bfin.c b/urjtag/src/cmd/cmd_bfin.c index acec61b9..5e404dfa 100644 --- a/urjtag/src/cmd/cmd_bfin.c +++ b/urjtag/src/cmd/cmd_bfin.c @@ -439,6 +439,15 @@ cmd_bfin_run (urj_chain_t *chain, char *params[]) { int reset_what = 0; + part_dbgstat_get (chain, chain->active_part); + + if (!part_dbgstat_is_emuready (chain, chain->active_part)) + { + urj_error_set (URJ_ERROR_BFIN, "Run '%s' first", + "bfin emulation enter"); + return URJ_STATUS_FAIL; + } + if (num_params == 3) { if (!strcmp (params[2], "core"))