summaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorNeha Malcom Francis <[email protected]>2025-08-12 18:13:18 +0530
committerTom Rini <[email protected]>2025-08-19 11:26:19 -0600
commit1c70e33b0aca6d5d84145636400e496feb19c8b9 (patch)
treed940ad238e154990ec83b11de6cec033099be1ca /drivers/ram
parente511c651f6dd0ec89a4b7dec25140540740cf13e (diff)
ram: k3-ddrss: Add comment about ecc_reserved_space
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 <[email protected]> Signed-off-by: Neha Malcom Francis <[email protected]>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/k3-ddrss/k3-ddrss.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ram/k3-ddrss/k3-ddrss.c b/drivers/ram/k3-ddrss/k3-ddrss.c
index 2fdbd4609a8..d35adc840f4 100644
--- a/drivers/ram/k3-ddrss/k3-ddrss.c
+++ b/drivers/ram/k3-ddrss/k3-ddrss.c
@@ -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);