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

V2.2.0 work #43

Merged
merged 13 commits into from
Jun 7, 2024
Merged

V2.2.0 work #43

merged 13 commits into from
Jun 7, 2024

Conversation

jonasblixt
Copy link
Owner

No description provided.

Jonas Blixt added 3 commits June 7, 2024 06:48
If a board command reset's the board the command response is never sent
and will result in timeouts.

This extra function let's board command reboot the system through the CM
code instead, after the respons has been transmitted.
library_version tried to call a now removed c function to report
version. Since everyting is versioned together nowdays we can just do
the same as the CLI to report version. The 'library_version' function is
keept for compability for now but might be deprecated in the future.
Instead of logging everything to the root logger. This way it's easier
to selectivly control debug output from the punchboot library.
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 70.93023% with 25 lines in your changes missing coverage. Please review.

Project coverage is 64.68%. Comparing base (00ed5d2) to head (66f3e41).
Report is 9 commits behind head on master.

Files Patch % Lines
src/cm/cm_main.c 79.68% 13 Missing ⚠️
src/drivers/virtio/virtio_serial.c 45.45% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage   64.75%   64.68%   -0.08%     
==========================================
  Files          58       58              
  Lines        2846     2891      +45     
==========================================
+ Hits         1843     1870      +27     
- Misses       1003     1021      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Jonas Blixt added 6 commits June 7, 2024 07:32
Actually try to find a device within the specified timeout. Before this
commit the code would return early if no device was enumerated which is
not the expected behaviour.
Change the usbd to be async. This way we don't have to kick the WDT in
more than one place and we can allow for timeout management and periodic
processing through the command mode code instead.
This uses the new async xfer calls in the CM main loop. With this change
we only need to kick the WDT in one place.
Board code can optionally implement this callback. It's called whenever
we're waiting for the next command.
Jonas Blixt added 4 commits June 7, 2024 14:18
This interferes with RPBM access. At least on some devices it seems to
reset the internal state between writing a command and reading the
result. Therfore we can't change the partition access like this.

Normally both boot partitions are updated and therefor it should be okay
if either one is set to active.

And regardless of partition access setting there is always one active
boot partition so we should not be able to end up in a non bootable
state as the comment suggested.

The R/O issue fixes it self in the next boot cycle since we're usually
going to be reading from the USER area, which put's the boot R/W
settings back to normal.
The write function is needed to properly interact with RPMB even for
just read operations.
Access to RPMB always uses the multiple blocks command even if there's
just one block to be handled. RPMB access also requires us to set
the block count. Because the standard says so.

This seems to be different between manufacturers, at least some Micron
memories seem fine without this and just works when reading blocks.
Other memories refuse to do read accesses without this and the standard
also says that it should be done in this way.
@jonasblixt jonasblixt merged commit 50c41d7 into master Jun 7, 2024
16 checks passed
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.

None yet

1 participant