init: make the write leveling MR bit configurable #232
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.
This is a part of splitting #224 into smaller PRs.
Requires corresponding PR in litex: enjoy-digital/litex#791.
In LPDDR4 the write leveling mode is configured with MR2[7] instead of MR1[7]. This PR changes the way
get_sdram_phy_init_sequence
returns mode register values. Now it should return a dictionary{mr_num: mr_value, ...}
. Instead of generatingDDRX_MR1
define we now have 3DDRX_MR_WRLVL_*
defines that specify the mode register changes required to enter/leave write leveling mode.Note that
DDRX_MR_WRLVL_BIT
is the bit that gets flipped (with xor), soDDRX_MR_WRLVL_RESET
is the state when write leveling is disabled and software just filps given bit when entering write leveling mode and writes the originalDDRX_MR_WRLVL_RESET
value when leaving.