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

init: make the write leveling MR bit configurable #232

Merged
merged 4 commits into from
Feb 2, 2021

Conversation

jedrzejboczar
Copy link
Collaborator

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 generating DDRX_MR1 define we now have 3 DDRX_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), so DDRX_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 original DDRX_MR_WRLVL_RESET value when leaving.

@jedrzejboczar jedrzejboczar mentioned this pull request Jan 29, 2021
@jedrzejboczar
Copy link
Collaborator Author

test_genesys2 fails because the litex used in CI doesn't include enjoy-digital/litex#791

Copy link
Owner

@enjoy-digital enjoy-digital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jedrzejboczar, this makes sense and looks good. Initial return of mr1 was indeed a quick workaround to get the confguration value of MR1 in the BIOS, thanks for making this more flexible.

@enjoy-digital enjoy-digital merged commit 2c60861 into enjoy-digital:master Feb 2, 2021
@jedrzejboczar jedrzejboczar deleted the jboc/init-mr branch February 3, 2021 13:46
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

2 participants