This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4378: DDR Write and Read in Kernel

Part Number: AM4378

Hi,

Our main objective is to do DDR R/W in the kernel. 

EMIF start address is 0x80000000 which is the physical address in the device memory map which is logical address 0 of the DDR. In DDR configuration, EBANK_POS=0 and IBANK_POS=0, so SDRAM Address mapping is 

Bit 0 - By default 0
Bit 1 to Bit 10 - Column Address
Bit 11 to Bit 13 - Bank Address
Bit 14 to Bit 28 - Row address.
So address 0x90000802 - It maps to Row - 16384, Bank - 1, and column - 1 of the DDR. We want to do R/W the DDR, so we developed an application using a pointer to access the DDR memory using both physical address 0x90000802 and logical address 0x10000802, but we are getting the segmentation fault (a memory location that it is not allowed to access) when we tried to access it.
Also, we don't want to write the whole memory because kernel image and dtb are stored in DDR RAM after kernel loads. We want to write some address only,  also if we want to access the memory using the pointer, we need to give the correct logical address. We want to know whether the above logical address can be used to access the DDR memory using pointer. Otherwise, is there any other way to do DDR R/W?
Regards,
Monish P