cmd: ti: Add DDRSS Inline ECC Error Injection command
authorGeorgi Vlaev <g-vlaev@ti.com>
Wed, 8 Oct 2025 11:34:35 +0000 (17:04 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 15 Oct 2025 21:08:27 +0000 (15:08 -0600)
commit4e4bbb49f9298ee8e5891c168ea4d6aa0463d285
treef06dd142518191500a6ffd23ecb7cb4ee47f0636
parent00ed9753c803402935c6d67e839637c5c144e70b
cmd: ti: Add DDRSS Inline ECC Error Injection command

Introduce a new version of the Keystone-II "ddr" command for testing the
inline ECC support in the DDRSS bridge available on K3 devices. The ECC
hardware support in K3's DDRSS and the test method differ substantially
from what we support in the K2 variant of the command. This K3 DDRSS
command currently supports only single controller testing.

The ECC error injection procedure follows these steps:
1) Flush and disable the data cache.
2) Disable the protected ECC Rx range.
3) Flip a bit in the address.
4) Restore the range to original.
5) Read the modified value (corrected).
6) Re-enable the data cache.

This will cause the 1-bit ECC error count to increase while the read
will return the corrected value.

The K3 version of the command extends the syntax for the "ecc_err"
argument by also introducing an argument for range which specifies which
range (0, 1, 2) the address is located in.

Multi-bit ECC errors are uncorrectable and will lead to a synchronous
abort.

Signed-off-by: Georgi Vlaev <g-vlaev@ti.com>
Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
[n-francis@ti.com: Add J7 and multiple-region support, simplify logic]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
cmd/ti/Kconfig
cmd/ti/Makefile
cmd/ti/ddr4.c [new file with mode: 0644]