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
SDRAM initialization fails on some OrangeCrabs when LDM/UDM are used independently #174
Comments
May be the same root cause as in #154 I tried changing parameters in the |
@Disasm: thanks for the feedback. The bitstream from #164 has been tested on hardware. Can you also test this one that I just re-generated and tested? orange_crab_2020_12_22.zip For now I just want to see if there are variations between boards. |
Same error on both boards, but output is slightly different:
|
@Disasm: I'm not able to reproduce the issue. Can you provide more information:
|
I haven't tried older versions of It's a regular OrangeCrab from the GroupGets campaign, with the parts you mentioned. |
I am also getting memory failures on my OrangeCrab r0.2. This is built from all latest Git masters (I perform a pristine build on a local Gitlab CI/CD setup - trellis included). Pre built images are failing as well. I have not used LiteX on this board before, so I don't have any data if a previous revision worked or not. The code on the BGA is
|
Thanks @wtfuzz for the feedback. It seems the issue was already present before but hidden by the L2 cache that we no longer use here with VexRiscv-SMP. I've already fixed DM on the OrangeCrab that was inverted on the hardware (LDM/UDM) but there is probably something else. I've been able to reproduce the issue on a variant with a |
Some results of testing I just did with 3 OrangeCrabs I have. (2 On boards that are not working, we don't get complete garbage data, only miss-placed: This will need to be investigated further. |
Hmm, on my board read results seem to be affected by the previous reads: I found this on the board schematics: |
@Disasm: the LDQS/UDQS swap is explained here: orangecrab-fpga/orangecrab-hardware#24 but UDM/LDM should also have been swapped which is not the case. I've already been able to add a workaround for the UDM/LDM swap in the gateware with enjoy-digital/litedram@33f3aa5 and litex-hub/litex-boards@00fc2c5 but this just a workaround since UDM is still coupled to the LDQS/LDAT timings in the FPGA and same for LDM with UDQS/UDAT. This maybe explains why it works on some boards and not on others. We are currently not able to swap directly UDM/LDM due to the ODDRX2DQA that is used to drive DM and linked to the byte group through i_DQSW270. |
Huh, Maybe I'll have to dig into this a bit more. on my end if this is related to the OC hardware. When I swapped the UDQS/LDQS I had thought I also swapped UDM/DQ + LDM/DQ... This was mostly to assist with routing/layout. But then all the pin swapping was done in the LiteX board platform file, so I wouldn't have thought anything needed to change in LiteDRAM. |
@gregdavill: I've just been able to reproduce the issue on a Versa ECP5, so this probably has more chance to be related to the DM handling in the ECP5 LiteDRAM PHY than OC hardware (possible the DM swap does not help here, but this does not seem to be the root cause). I'll try to investigate more (and it's easier on the 45F of the Versa that has more room for LiteScope) but I have to work others priorities for now. |
@Disasm, @wtfuzz; would you mind testing this bitstream on your OrangeCrab?: orangecrab_2020_01_20_test.zip (and reset the board multiple times with the button of the OrangeCrab to verify it's calibrating correctly each time?) Thanks. |
@enjoy-digital no joy here.
|
Thanks for the test @wtfuzz, even if not working that's useful to collect results. I start understanding the issue I think and will probably have another bitstream to test soon. |
The output is consistent across different runs and two OrangeCrab boards. |
Thanks @Disasm, while you are testing this, would you mind also testing this one?: orangecrab_2021_01_21.zip |
I just gave this a spin. Same error.
|
@gregdavill: thanks, would you mind trying with CL=7?:
Just recopy the sdram_mr_write commands in the BIOS, then do |
Looks like it's applied the CL value, because cal shows a different position.
|
I got the same output as the one reported by @gregdavill. |
Use of DMs are also causing issues on the Colorlight I5: https://github.com/kazkojima/colorlight-i5-tips#sdram-issue-on-linux-on-litex-vexriscv-head here because DM are connected to ground. So even if the issue is fixed on OrangeCrab, we'll have to support a mode where we'll always doing non-masked access to the DRAM (as before with VexRiscv interfaced through Wishbone and L2 to LiteDRAM). |
Since DMs cannot be used on all boards, we added a mode with @Dolu1990 to do the DRAM accesses through the peripheral bus/L2 cache for boards that require it (this the the behavior that was previously in place for VexRiscv Linux non-SMP). Here is the bistream for the OrangeCrab re-generated with this: orangecrab_2021_01_24.zip @Disasm, @gregdavill, @wtfuzz would you mind testing it? If also working on your boards, I'll merge the changes and will enable this for the OrangeCrab. |
@enjoy-digital Now all DRAM tests passed. One small issue: |
Tests are passing here.
|
Thanks @Disasm, @wtfuzz. The double 0x0x was a typo in enjoy-digital/litex#776 that is fixed by enjoy-digital/litex@1a38d51. |
Works fine here too! Thanks @enjoy-digital & @Dolu1990 |
The changes have been merged:
And the OrangeCrab bistream updated in #164. A |
Thank you! |
DM swap is required for DRAM to work properly on OrangeCrab due to swapped LDM/UDM lines on the board. See litex-hub/linux-on-litex-vexriscv#174 (comment)
DM swap is required for DRAM to work properly on OrangeCrab due to swapped LDM/UDM lines on the board. See litex-hub/linux-on-litex-vexriscv#174 (comment)
I'm not sure where this bug belongs, but I found that a pre-built orangecrab image from #164 can't initialize SDRAM:
Same thing happens with a bitstream built with
./make.py --board=orangecrab --cpu-count=1 --build
.I tried with two different OrangeCrab boards, the outcome is the same. The orangecrab target from
litex-boards
works without problems.The text was updated successfully, but these errors were encountered: