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.

DRA829V: DDR SECDED configuration and memory layout

Part Number: DRA829V

Dear TI Team, 

we are currently working on activation and testing of DDR memory SECDED protection on our Jacinto 7 custom board and faced some difficulties, which hopefully you could help us with.
With help of other threads at E2E we could activate ECC for some sub-region of memory, make some fault injection tests and for the first look it works, but we still cannot understand and explain some behavior.

Here is a list of things, which we do not understand:

  • What is the memory layout in case of the activated ECC? I suppose there are two models, one with deactivated ECC and one with the activated one. It explains why we need to reserve 1/9 of memory independently on the protected range sizes, just cause two layouts are fixed.
    In the SDL library I found the function DDRGetTranslatedAddress, which I suppose translates a 'user-view' address to a address of data or Hamming code for it in case of the activated SECDED. With which function I was able to inject single/multiple bits error in different parts of the protected region, but what I cannot understand, how it works if I try to calculate and corrupt data for the address close to the end of memory. 
    If we assume that DDR memory range is 0x80000000-0x9FFFFFFF (512Mb) and it is completely protected, available range is something like 0x80000000-0x9C71C71C. If we apply DDRGetTranslatedAddress to the last address, we get 0xB000001C, what is far outside of the memory range. So how it works, does the function works correctly for the whole range?
  • Protected regions are defined by upper 19-bits (out of 35) of its start and end addresses (DDRSS_ECC_Rx_STR_ADDR_REG). So either protected range is rounded up or down. By injection tests I observe that range is rounded up, but currently we have a board with wrong DDR chip connection (only part of DRAM is accessible), so I'm not sure that everything is configured correctly in our case.
    Therefore the question is - are protected regions are rounded up or down to be 64Kb aligned? As a simple example, if DDRSS_ECC_R0_STR_ADDR_REG = 0x1000 and DDRSS_ECC_R0_END_ADDR_REG = 0x1FFF, is the protected region 0x90000000-0x9FFFFFFF or 0x90000000-0x9FFF0000? Acc. to my check it is rounded up but I couldn't confirm it by the TRM.

Best regards,
Dmitry

  • Hi Dmitry,

    If we assume that DDR memory range is 0x80000000-0x9FFFFFFF (512Mb) and it is completely protected, available range is something like 0x80000000-0x9C71C71C.

    It is true that 1/9th of the physical memory size is used to store ECC codes when ECC is enabled, but the system could lose slightly more as the data + ECC are stored in blocks. Thus if you have 512 MB total memory, the actual physical usage should be:

    • 0x80000000 - 0x9FFFFEBF (536,870,592 bytes used for both data and ECC codes)
    • 0x9FFFFEC0 - 0x9FFFFFFF (320 bytes unused)

    From a system stand point, software could make use of:

    • 0x80000000 - 0x9C71C5FF
    If we apply DDRGetTranslatedAddress to the last address, we get 0xB000001C, what is far outside of the memory range.

    I found the function you have referenced (@/ti/csl/example/ecc/ecc_test_app/ecc_ddr.c) , and it appears what this function is doing is translating a system address (data only) to a physical address (data + ECC). If you translate the last 32-bit address available from the system view (0x9C71C5FC), I believe you should get an output of 0x9FFFFE7C, which is within the physical memory range.

    Therefore the question is - are protected regions are rounded up or down to be 64Kb aligned?

    My understanding is that the region start address has address bits [15:0] = 0x0 and region end address has address bits [15:0] = 0xFFFF. 

    Regards,
    Kevin

  • Hi Kevin,

    thank you for the prompt and detailed answer.
    Now everything is more clear and correlates with the observed behavior.

    Pity that you haven't provided detailed information regarding the memory mapping in case of activated ECC, but logic of the DDRGetTranslatedAddress gives some basis which is enough for the moment.

    Best regards,
    Dmitry