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.

SK-AM69: ECC functionality - status for Linux system

Part Number: SK-AM69


On my board I am trying to test out using ECC for a potential custom hardware platform.

I see that there is some level of support for enabling this added recently to the ti-u-boot code (and other commits around this):

https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ti-u-boot-2023.04&id=44c3e47fd1dc87817068260309a2277cb82ffa48

I am using u-boot from the tag: 09.02.00.007

Is it expected that I should be able to enable the K3_INLINE_ECC config option for the R5 u-boot build, and end up with a system running with ECC?  Or is more support required somewhere else?  Or is this development effort not yet fully implemented?

  • Hello, 

    We would like to let you know that our safety expert handling this topic is OoO for spring break and will be back next week. Please expect a delayed response. Thanks for understanding.

    In the meantime, sharing a few FAQs related to ECC if it helps:

    https://e2e.ti.com/f/791/t/1058618
    https://e2e.ti.com/f/791/t/1310234

    Thanks.

  • Thank you for the update.  I have seen these FAQs, but they did not really address my question.

  • Hi,

    It is supported. Can you please enable the option and test. By default it's disabled as it adds lot of boot time delay.

    Best Regards,

    Keerthy 

  • Hi Keerthy J,

    Thank you for the guidance.  I did enable the option in the R5 Bootloader by following the normal process to build the bootloader, but after running "make j784s4_evm_r5_defconfig", I ran "make menuconfig", and selected "Device Drivers", and then selected (enabled) "Enable TI Inline ECC support" which has the symbol "CONFIG_K3_INLINE_ECC".  Then I saved the configuration and built the r5 u-boot.  Then I built the rest of the bootloader (optee_os, tfa), and finally build the cortex-a72 u-boot with the "j784s4_evm_a72_defconfig" configuration untouched.

    When I boot my system with the resulting bootloader (from the uSD card), it does not take long to initialize, and when I boot into the Linux system, I see all 31842MB of RAM available.  Thus, it seems that the ECC support is not enabled.

    Can you tell if I am I missing something?

  • Hi,

    Could you please add some debug prints in the inline ecc code and check if that is indeed getting called and configured.

    Thanks,

    Keerthy

  • Hi Keerthy J,

    Today I spent some time investigating this further, and this is what I found:

    in ti-u-boot/drivers/ram/k3-ddrss/k3-ddrss.c in the function k3_ddrss_probe, I narrowed the problem down to the check of ddrss->ti_ecc_enabled.  This is always false in my testing.  I tried a couple of ways to get around this.  First, I simply set it to 1 in k3_ddrss_ofdata_to_priv where this variable is set, instead of obtaining it from dev_read_bool.  This actually seemed to work to some degree.  I saw these messages from the bootloader:

    EEPROM not available at 0x50, trying to read at 0x51
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    ECC is enabled, priming DDR which will take several seconds.
    ECC: priming DDR completed in 2395 msec
    ECC is enabled, priming DDR which will take several seconds.
    ECC: priming DDR completed in 2395 msec
    ECC is enabled, priming DDR which will take several seconds.
    ECC: priming DDR completed in 2395 msec
    ECC is enabled, priming DDR which will take several seconds.
    ECC: priming DDR completed in 2395 msec
    SPL initial stack usage: 13472 bytes
    Trying to boot from MMC2

    However, when my system booted, I still had all of the memory available, so either the memory size was not corrected in the R5 bootloader, or the ECC initialization was not completely successful.

    I tried to "correctly" get ddrss->ti_ecc_enabled to be true, and that led me to the dtsi file called k3-j784s4-ddr-evm-lp4-4266.dtsi.  It seems that MULTI_DDR_CFG_ECC_ENABLE should be related to this value.  However, in my testing I tried setting it to 1, and that did not change the value of ddrss->ti_ecc_enabled.

    I actually went all the way of investigating the Jacinto7 DDRSS register config tool (https://www.ti.com/lit/zip/spracu8), to see if my method of changing the MULTI_DDR_CFG_ECC_ENABLE value was correct.  But I discovered that this tool presently does not support enabling ECC.

    I also checked that my setting of "CONFIG_K3_INLINE_ECC" is working, by printing a message at the top of fixup_ddr_driver_for_ecc in k3-ddr-init.c, which is called by board/ti/j784s4/evm.c file only when CONFIG_K3_INLINE_ECC is enabled.  I saw this message on my serial console from the r5 bootloader.

    It seems there must be some other steps to enabling this that are not obvious, or maybe this is just presently broken?

  • Hi,

    Thanks. I have created an internal ticket & the expert is looking into this. I will revert back to you next week with more updates from the findings from the internal team.

    - Keerthy

  • Hi Caleb,

    Could you please try with the attached patches:

    AM69-ECC_Fix.zip

    This should fix the ECC issues that you are observing.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    I can confirm that applying these patches to ti-u-boot on top of tag 09.02.00.007 indeed enables ECC successfully without requiring any additional changes (this patch set even enables the CONFIG change CONFIG_K3_INLINE_ECC=y in the r5 config).  I see the bootloader priming the ECC regions, and when the Linux kernel has booted, I have roughly 28,672MB of ram total, which matches the expectation of less than (8/9) * 32GB.

    Will some of these (maybe at least patches 0001-0003) be applied in an upcoming ti-u-boot release?

    Thank you (and Neha) for your assistance with this.