fix MMCM parameter discovery - #210
Merged
quetric merged 1 commit intoSep 1, 2026
Merged
Conversation
Coverage
Lines covered at a1157f9, compared with the most recent successful |
quetric
deleted the
206-not-able-to-set-the-frequency-properly-via-devicesetfrequencyfreq
branch
September 1, 2026 15:11
quetric
added a commit
that referenced
this pull request
Sep 2, 2026
clock_driver_wait_for_lock() read the lock bit from offset 0x33C, which is not the status register. 0x33C is the second word of the CLKOUT0 leaf register pair, holding the high-time count in both of its low bytes, so the predicate tested bit 0 of the output divider's high-time count rather than PLL lock. The status register is at offset 0x04 and reports lock in bit 0, as the upstream Linux clocking wizard driver does. The consequence was that candidate selection rejected any (M, D, O) tuple whose high-time count was even, after stalling for the full 200 ms lock timeout. For a 365 MHz request this discarded the best-ranked candidate and settled on one producing a different VCO frequency; for requests where every candidate has an even high-time count it failed outright. Requests that happened to work, such as 200 MHz, did so only because the first candidate had an odd count. Read the status register instead, both when waiting for lock and when dumping wizard state for diagnostics. The state dump also carried its own copy of the leaf offset computation that still had the off-by-three error corrected in #210; call the shared helper. Fixes #206
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve MMCM parameter read-back and setting. More verbose logging of MMCM related activity in VRTD. Fixed #206