]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ram: k3-ddrss: Add comment about ecc_reserved_space
authorNeha Malcom Francis <n-francis@ti.com>
Tue, 12 Aug 2025 12:43:18 +0000 (18:13 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 19 Aug 2025 17:26:19 +0000 (11:26 -0600)
The reserved space needed for storing the parity remains the same no
matter the size of the region that is being protected. Add this as a
comment for better code understanding.

Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
drivers/ram/k3-ddrss/k3-ddrss.c

index 2fdbd4609a8e42611b51e3508718c23acba71211..d35adc840f43a42bc29a03629e9efe36bf38a1a9 100644 (file)
@@ -737,6 +737,12 @@ static void k3_ddrss_lpddr4_ecc_calc_reserved_mem(struct k3_ddrss_desc *ddrss)
 {
        fdtdec_setup_mem_size_base_lowest();
 
+       /*
+        * For every 512-byte data block, 64 bytes are used to store inline ECC
+        * information into a reserved region. It remains 1/9th of the total DDR
+        * size irrespective of the size of the region under protection.
+        */
+
        ddrss->ecc_reserved_space = ddrss->ddr_ram_size;
        do_div(ddrss->ecc_reserved_space, 9);