ram: k3-ddrss: fix ecc range checking bug
PATCH 1/1 ram: k3-ddrss: fix ecc range checking bug
The original checking is wrong, it basically compares memory address
end = r->start + r->range;
with memory size:
if (end > (ddr_ram_size - ecc_res))
so the if() condition would be always true. This causes the ECC config never take input from the devicetree.
Fixes f43f71012254 ("ram: k3-ddrss: Add support for a partial inline ECC region")
Signed-off-by Bin Liu <[email protected]>
--- drivers/ram/k3-ddrss/k3-ddrss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ram/k3-ddrss/k3-ddrss.c +1 -2
@@ -931,11 +931,10 @@ static int k3_ddrss_probe(struct udevice *dev)struct k3_ddrss_ecc_region *r = range;for (int i =0 ; (i <K3_DDRSS_MAX_ECC_REG ) && (r->range !=0 ); i++, r++) { - end = r->start + r->range; ddr_ram_size = ddrss->ddr_ram_size; ecc_res = ddrss->ecc_reserved_space; -if (end > (ddr_ram_size - ecc_res)) +if (r->range > (ddr_ram_size - ecc_res)) ddrss->ecc_regions[i].range = ddr_ram_size - ecc_res;else ddrss->ecc_regions[i].range = r->range;
Signature · 1 line
2.34.1
Quoted 1 line · Bin Liu
ram: k3-ddrss: fix ecc range checking bug
Reviewed-by Neha Malcom Francis <[email protected]>
Signature · 1 line
Neha Malcom Francis <[email protected]>
Quoted 9 lines · Bin Liu
The original checking is wrong, it basically compares memory address
end = r->start + r->range;with memory size:
if (end > (ddr_ram_size - ecc_res))[...]
Applied to u-boot/main, thanks!
[1/1] ram: k3-ddrss: fix ecc range checking bug
commit: 616c3d79f01cf9204e38738857c4647a730dcb3b
Signature · 1 line
Tom