Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM should ignore some bits while abstract command is executing #1046

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions debug_module.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ of {dm-data0}) or hart (e.g. contents of a register modified by a Program Buffe
Before starting an abstract command, a debugger must ensure that {dmcontrol-haltreq}, {dmcontrol-resumereq}, and {dmcontrol-ackhavereset} are all 0.

While an abstract command is executing ({abstractcs-busy} in {dm-abstractcs} is high), a debugger must not change {hartsel}, and must not write 1 to {dmcontrol-haltreq}, {dmcontrol-resumereq}, {dmcontrol-ackhavereset}, {dmcontrol-setresethaltreq}, or {dmcontrol-clrresethaltreq}.
The exception to this rule is when 0 is written to {dmcontrol-dmactive}, in
which case the DM may ignore all bits other than {dmcontrol-dmactive}.

If an abstract command does not complete in the expected time and
appears to be hung, the debugger can try to reset the hart (using {dmcontrol-hartreset} or {dmcontrol-ndmreset}).
Expand Down
6 changes: 5 additions & 1 deletion xml/dm_registers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,17 @@ same project unless stated otherwise.
state change has completed. Hardware may
take an arbitrarily long time to complete activation or deactivation and will
indicate completion by setting {dmcontrol-dmactive} to the requested value.
During this time, the DM may ignore any register writes.

<value v="0" name="inactive">
The module's state, including authentication mechanism,
takes its reset values (the {dmcontrol-dmactive} bit is the only bit which can
be written to something other than its reset value). Any accesses
to the module may fail. Specifically, {dmstatus-version} might not return
correct data.

When this value is written, the DM may ignore any other bits written
rtwfroody marked this conversation as resolved.
Show resolved Hide resolved
to {dmcontrol} in the same write.
</value>

<value v="1" name="active">
Expand All @@ -356,7 +360,7 @@ same project unless stated otherwise.
No other mechanism should exist that may result in resetting the
Debug Module after power up.

To place the Debug Module into a known state, a debugger may write 0 to {dmcontrol-dmactive},
To place the Debug Module into a known state, a debugger should write 0 to {dmcontrol-dmactive},
poll until {dmcontrol-dmactive} is observed 0, write 1 to {dmcontrol-dmactive}, and
poll until {dmcontrol-dmactive} is observed 1.

Expand Down
Loading