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

platform, common, lowlevel modules cleanup #4249

Draft
wants to merge 7 commits into
base: cepetr/unit-props-refactoring
Choose a base branch
from

Conversation

cepetr
Copy link
Contributor

@cepetr cepetr commented Oct 7, 2024

This PR focuses on cleaning up tangled code in the platform.c/h, common.c/h, lowlevel.c/h modules, as well as the Unix emulator.

  1. Removed some inappropriate dependencies (such as CPU clock setting and the main_clean_exit cyclic dependency) from the emulator code.
  2. Most code from the lowlevel module has been relocated to the new option_bytes module.
  3. Introduced a small pvd (Power Voltage Detector) module, which was previously split across two different places.
  4. Introduced a small reset_flags module, which was previously located in the lowlevel module. Although it's currently not very useful, it might be improved in the future.
  5. Most code from platform.c has been moved to a new startup_init module, which better reflects its purpose.
  6. The platform.h header no longer exists, freeing up the name for potential future use.

Possible next steps:

  1. common.h now only contains just utility functions. We might consider renaming this module to better reflect its purpose.
  2. The routines in utils.s seem slightly out of place and could be better organized between bootutil and startup_init.

@cepetr cepetr added the core Trezor Core firmware. Runs on Trezor Model T and T2B1. label Oct 7, 2024
@cepetr cepetr self-assigned this Oct 7, 2024
Copy link

github-actions bot commented Oct 7, 2024

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3B1 Safe 3 test(screens) main(screens) test(screens) main(screens) 2724
T3T1 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Trezor Core firmware. Runs on Trezor Model T and T2B1.
Projects
Status: 🔎 Needs review
Development

Successfully merging this pull request may close these issues.

1 participant