-
Notifications
You must be signed in to change notification settings - Fork 214
Clock v2 thumbv6m #892
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
base: master
Are you sure you want to change the base?
Clock v2 thumbv6m #892
Conversation
00dc127
to
82875e2
Compare
Note to self: #908 |
8367534
to
b169704
Compare
I've spent some more time on this today, and have moved the thumbv6 clock v2 support up to just before #728 . From a not-very-close inspection of the newer history of the project, this seems like the last major snag to resurrect this work. It seems like using diff/patch (IOW Git rebase) isn't a good approach to update the thumbv6 clock v2 work on to the new config scheme, there are tons of small changes spread through the codebase. I'm thinking that manually replicating the changes from the thumbv6 clock v2 work is the way forward, directly on to the current master. If anyone else feels like taking a crack at this, please feel free! |
c2282e3
to
7676db0
Compare
I've saved the branch that attempted to do this with rebase as clock_v2_thumbv6m_rebase and started manually transcribing the work on top of current master here. |
7676db0
to
08e9ec1
Compare
I've advanced to somewhere between Bradley's second and third "stash" commits, the code at the current head (commit message "WIP stash 2 enable v2 for thumbv6m") comments out some important stuff but builds much of the clock v2 code for thumbv6m (with some warnings that should be addressed), and the commit before that cleanly builds for thumbv7em (though isn't tested to still work). Some of the changes I've made are a little bit hacky; I'm trying to create a finer-grained history to keep things compiling in intermediate steps so that it'll be easier to go back and clean up that stuff once the bulk of the work is done. |
|
Have made a bit more progress on this today, largely splitting up the last few commits in clock_v2_thumbv6m_rebase to make them a bit easier to digest |
f3d9269
to
8931976
Compare
The bulk of the clock v2 support is now in place for SAMD21, I've not been exercising SAMD11 builds and those currently error. There are a couple of Bradley's changes that still need to be ported, and the above list of TODOs, I'll try to chip away at it more tomorrow. |
d03a44b
to
fa7de36
Compare
Changes to clock v2 API for thumbv7 introduced by this PR:
|
36f5b4d
to
a8d4920
Compare
8d8f126
to
bd81455
Compare
I've done some basic testing on both Metro M0 and Metro M4, seems to work OK. Will chip away at updating the tier-1 BSPs for thumbv6m chips, but this seems ready for wider testing and feedback if anyone's got spare cycles to work on it. |
7ce8fb9
to
7a2a60a
Compare
Manually replicated from Bradley Harden's work, rebased as 4b94fb0
This makes a `hal_cfg()` argument available for xosc1 on bigger chips
Decided not to split the file up, doesn't seem necessary
Couldn't deduplicate with the feather_m4 and metro_m4 examples, because the alias used for the LED is different. Sorting that out seems like a separate project.
Reading the GCLK GENCTRL register isn't possible on the thumbv6m chips, on these there is only one GENCTRL register for the whole GCLK peripheral, in contrast to one GENCTRL per generator on the thumbv7em chips. On the thumbv6m chips, modifying GENCTRL is done by atomically writing the whole register, which has a field for the generator ID to be modified. The GENCTRL register had been modified from the GclkToken<> impl, per-field, but the state required to fill the other fields for the atomic register write wasn't available in the GclkToken<> scope. So, these GENCTRL accesses were moved up in to the Gclk<> impl. One more bit of state was added to the settings to handle the Output Enable bit.
7a2a60a
to
8b89a3b
Compare
Woohoo! Green tick from the CI. |
Resurrecting @bradleyharden's work on clockv2 for thumbv6m. Will begin by rebasing on to current master, then try to finish things up!