board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when...
authorSanthosh Kumar K <s-k6@ti.com>
Mon, 6 Jan 2025 09:07:08 +0000 (14:37 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 14 Jan 2025 21:47:07 +0000 (15:47 -0600)
commitbc07851897bde0920dc034871e68b24c290d418f
tree7930d0e3be0da26e2a01f9e3087b5637ff1eb766
parent01fa91bd5bbcdb2dda4cc869da9d8fc782774a3c
board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled

As there are few redundant functions in board/ti/*/evm.c files, pull
them to a common location of access to reuse and include the common file
to access the functions.

Call k3-ddrss driver through fixup_ddr_driver_for_ecc() to fixup the
device tree and resize the available amount of DDR, if ECC is enabled.
Otherwise, fixup the device tree using the regular
fdt_fixup_memory_banks().

Also call dram_init_banksize() after every call to
fixup_ddr_driver_for_ecc() is made so that gd->bd is populated
correctly.

Ensure that fixup_ddr_driver_for_ecc() is agnostic to the number of DDR
controllers present.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
15 files changed:
arch/arm/mach-k3/Makefile
arch/arm/mach-k3/include/mach/k3-ddr.h [new file with mode: 0644]
arch/arm/mach-k3/k3-ddr.c [new file with mode: 0644]
board/ti/am62ax/evm.c
board/ti/am62px/evm.c
board/ti/am62x/evm.c
board/ti/am64x/evm.c
board/ti/am65x/evm.c
board/ti/common/Makefile
board/ti/common/k3-ddr.c [new file with mode: 0644]
board/ti/common/k3-ddr.h [new file with mode: 0644]
board/ti/j721e/evm.c
board/ti/j721s2/evm.c
board/ti/j722s/evm.c
board/ti/j784s4/evm.c