Configuration values for DRAM on BeagleBone Black

Hello. I’m trying to write some code for bare-metal BBB(without any OS) and i’m stuck on DRAM initialization. Does anyone have configuration values for registers or some code that’s already working? I tried to copy code from U-Boot but wasn’t successful, seems too complicated. Also tried TI’s tool for configuration but it seems i put some wrong data in.

I’m working with BeagleBone Black Rev. A5