ram: k3-ddrss: Add k3_ddrss_ddr_bank_base_size_calc() to solve 'calculations restrict...
authorSanthosh Kumar K <s-k6@ti.com>
Mon, 6 Jan 2025 09:07:02 +0000 (14:37 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 14 Jan 2025 21:47:07 +0000 (15:47 -0600)
commit22ce56a3ebdbd5fa5c8e727042f6b4af345112f2
treedeb8f7ada097354d42ac6d22ea3fbcbc86588c6b
parentfed3b1eb9bf81928d54136aceeb671bdd22c66a9
ram: k3-ddrss: Add k3_ddrss_ddr_bank_base_size_calc() to solve 'calculations restricted to 32 bits' issue

As R5 is a 32 bit processor, the RAM banks' base and size calculation
is restricted to 32 bits, which results in wrong values if bank's base
is greater than 32 bits or bank's size is greater than or equal to 4GB.

So, add k3_ddrss_ddr_bank_base_size_calc() to get the base address and
size of RAM's banks from the device tree memory node, and store in a
64 bit device private data which can be used for ECC reserved memory
calculation, Setting ECC range and Fixing up bank size in device tree
when ECC is enabled.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
drivers/ram/k3-ddrss/k3-ddrss.c