Hello guys,
I'd like to invoke a reset of the K2K with the self-refresh mode enabled, so the memory content is preserved over the Linux reboot. Based on Keystone II Architecture DDR3 Memory Controller User's Guide document[http://www.ti.com/lit/pdf/SPRUHN7], section 2.8, we know that:
The user must ensure that all memory accesses have been completed, and verify that self-refresh is set in the STATUS register before initiating a reset.
The latter requirement is clear and obvious - one has to check (read) that the self-refresh mode bit is properly set in the STATUS register before initiating a reset. How about the former requirement and how to completely fulfill the memory access completion from within Linux? I believe I checked all available docs from the TI K2K main page, but were not able to find any guides or suggestions how to properly handle and test such requirement.
By reset/SoC reset, I understand a software driven, hard reset via PLL controller, invoked by setting RSTCTRL[16].
First assumption is that user has to take care about DMA controller before initiating a reset. If that's true, how it should be done correctly? Should DMA be disabled before entering a self-refresh mode and enabled when we are out of the self-refresh mode (so in u-boot, as self-refresh mode is disabled in u-boot)? Or should it (DMA) be just reset before the self-refresh mode is entered or before the SoC reset is invoked? (so no enabling in u-boot would be needed).
Second assumption is similar to the first one, but in the context of C66x DSPs. Should DSPs be also powered off/on or reset to make sure that self-refresh mode won't be interrupted during the SoC reset? If yes, what is the proper way of handling that? In case of DMA, reset/power off-on should be achieved via PDCTL/MDCTL (correct me if that's a wrong assumption), but it's not so clear how to deal with DSP, based on the C66x CorePac User's Guide.
If my assumptions above are correct, it would be really great to get a reliable information of how to handle these problems correctly. Also, please let me know of any missing parts in my whole reasoning regarding self-refresh mode on this K2K.