Skip to content

arc_ocd: Add Status32 halt bit check if jtag_status_ru=0 and target is running#33

Open
EvgeniiDidin wants to merge 285 commits into
foss-for-synopsys-dwc-arc-processors:masterfrom
EvgeniiDidin:master
Open

arc_ocd: Add Status32 halt bit check if jtag_status_ru=0 and target is running#33
EvgeniiDidin wants to merge 285 commits into
foss-for-synopsys-dwc-arc-processors:masterfrom
EvgeniiDidin:master

Conversation

@EvgeniiDidin
Copy link
Copy Markdown
Member

In rare cases ARC_JTAG_STAT_RU is set to 0, but STATUS32 halt bit is not "1". This
disparancy causes openocd to halt the processor. This patch
correctly handles sunch behaviour.

Signed-off-by: Evgeniy Didin didin@synopsys.com

fdols added 30 commits November 17, 2014 17:18
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
 >$ djtgcfg -d JtagHs2 prog -i 4 -f <fpga bit file to progam>.bit

Signed-off-by: Frank Dols <frank.dols@synopsys.com>
      particularly ARC-EM4 core registers r61 or r62

Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
Signed-off-by: Frank Dols <frank.dols@synopsys.com>
…tion

Signed-off-by: Frank Dols <frank.dols@synopsys.com>
…ss-for-synopsys-dwc-arc-processors/openocd.git into arc-0.7.0-dev-00151
afaerber and others added 14 commits May 11, 2017 16:06
Derived from tcl/interface/digilent-hs1.cfg.

JTAG-HS3 has an open drain buffer on pin 14 for SRST to work with
PS_SRST_B on Xilinx Zynq SoC.

Change-Id: I1e9e72d0511528a61207e318aff937ae9fad5bf9
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/2728
Tested-by: jenkins
Reviewed-by: Robert Jordens <jordens@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Spotted by gcc:

    arm7_9_common.c: In function ‘arm7_9_unset_breakpoint’:
    arm7_9_common.c:353:4: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
        if (current_instr == arm7_9->thumb_bkpt)
        ^~
    arm7_9_common.c:356:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (retval != ERROR_OK)
         ^~

The logic won't change once the braces have been added, as the new 'retval'
check only makes sense within the if().

Change-Id: I6a303e118f2150e5eb25c9268ad06de5d8a533b2
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-on: http://openocd.zylin.com/3477
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
It is identical to 2.2.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Real version number of EM Starter Kit is 2.3, but documentation references
2.03a by mistake, which made its way into GNU products as well.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
As documented in openocd manual, 'reset run' command should reset
the target and then let it run. There was an issue with that: after reset,
target was not being run. This commit fixes this issue.
Configure files is regenerated because after previous commits they
are not up to date.
Also, this patch splits invalidation/flushing of each cache on
a separate functions.
The patch fixes a bug: when a writing to memory is needed,
first of all, we should flush the cache, otherwise it may lead to
data inconsistency.
Comment thread src/target/arc_ocd.c Outdated
Comment thread src/target/arc_ocd.c Outdated
Comment thread src/target/arc_ocd.c Outdated
Comment thread src/target/arc_ocd.c Outdated
Comment thread src/target/arc_ocd.c Outdated
…->state=running

In rare cases ARC_JTAG_STAT_RU is set to 0, but STATUS32 halt bit is not "1". This
disparancy causes openocd to halt the processor. This patch
correctly handles sunch behaviour.

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
@anthony-kolesov
Copy link
Copy Markdown
Contributor

Ough, I see now an email.

@EvgeniiDidin
Copy link
Copy Markdown
Member Author

Hi @anthony-kolesov,

If everything is fine with updated commit, could you please apply it?
After that we could finally close the #30 issue.

@anthony-kolesov
Copy link
Copy Markdown
Contributor

anthony-kolesov commented May 28, 2019

You should assign merge request to me, when you want me to review it again.

@anthony-kolesov anthony-kolesov self-assigned this May 28, 2019
@anthony-kolesov anthony-kolesov self-requested a review May 28, 2019 15:53
@anthony-kolesov
Copy link
Copy Markdown
Contributor

Or, there is actually button to "Request review again".

Comment thread src/target/arc_ocd.c
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
/* In some cases JTAG status register indicates that
* processor is in halt mode, but processor is still running.
* We check halt bit of AUX STATUS32 register for setting correct state
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dot at the end of the sentence.

Comment thread src/target/arc_ocd.c
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
}
else {
LOG_DEBUG("Discrepancy of STATUS32[0] HALT bit and ARC_JTAG_STAT_RU, target is still running");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dot at the end of the message, line is too long.

Comment thread src/target/arc_ocd.c
* We check halt bit of AUX STATUS32 register for setting correct state
*/
if ((target->state == TARGET_RUNNING) || (target->state == TARGET_RESET)) {
CHECK_RETVAL(arc_jtag_read_aux_reg_one(&arc32->jtag_info, AUX_STATUS32_REG, &value));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long.

Comment thread src/target/arc_ocd.c

target_call_event_callbacks(target, TARGET_EVENT_HALTED);
/* In some cases JTAG status register indicates that
* processor is in halt mode, but processor is still running.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stars go under the star of the first line, not under the slash.

Comment thread src/target/arc_ocd.c
CHECK_RETVAL(arc_dbg_debug_entry(target));
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
}
else {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect formatting of } and else.

@anthony-kolesov anthony-kolesov removed their assignment May 28, 2019
EvgeniiDidin added a commit to EvgeniiDidin/openocd that referenced this pull request Jun 27, 2019
The code of the function is based on:
https://github.com/foss-for-synopsys-dwc-arc-processors/openocd/blob/master/src/target/arc_ocd.c#L49

Significant changes:
 * foss-for-synopsys-dwc-arc-processors#33
 * Replaced arc_jtag_read_aux_reg_one() with high-level arc_get_register_value()

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
EvgeniiDidin added a commit to EvgeniiDidin/openocd that referenced this pull request Oct 25, 2019
The code of the function is based on:
https://github.com/foss-for-synopsys-dwc-arc-processors/openocd/blob/master/src/target/arc_ocd.c#L49

Significant changes:
 * foss-for-synopsys-dwc-arc-processors#33
 * Replaced arc_jtag_read_aux_reg_one() with high-level arc_get_register_value()

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants