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

core: use wider DFI address/bank if PHY requires it #237

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

jedrzejboczar
Copy link
Collaborator

This is a part of changes related to #224.

LiteDRAM normally encodes Mode Register Set command using DFIInjector, passing mode register address as dfi.baddress and value as dfi.address. In LPDDR4 there are more Mode Registers than in other DRAMs and we need 6 bits to store the address. So when a module has only 8 banks it is not possible to issue MRS via DFIInjector this way.

Initially I tried encoding both the address and the value in dfi.address, but then I had to modify the implementation of sdram_write_leveling_on/sdram_write_leveling_off in sdram.c for LPDDR4 specifically. To avoid it, now LPDDR4 PHY sets bankbits to 6: dfd7816#diff-d84b2ae2991ef50d505ebd78f702957557f81bdfcd77f1aafbdd7bc66cc86ae5L97, and with this PR DFIInjector would use the higher value of geom_settings.bankbits and phy.bankbits, making sure that there are enough bits for Mode Register address.

@jedrzejboczar jedrzejboczar mentioned this pull request Mar 26, 2021
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 is indeed a nice way to avoid extra changes in the other part of the code.

@enjoy-digital enjoy-digital merged commit df2a065 into enjoy-digital:master Mar 31, 2021
@tmichalak tmichalak deleted the jboc/dfii-bankbits branch May 11, 2022 09:36
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