Optimize the `sdram_size` function by caching the calculated SDRAM size in a static variable. This prevents redundant calls to `mtk_dram_size()` or `mem_chip_info_total_density_bytes()` if the size has already been determined, improving performance in scenarios where `sdram_size` is called multiple times. BUG=none TEST=emerege-tanjiro coreboot Change-Id: I0ca0df80ee9cb781a5bb6d55ee28a2c1153be0ad Signed-off-by: Yidi Lin <yidilin@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90485 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> |
||
|---|---|---|
| .. | ||
| amd | ||
| cavium | ||
| example/min86 | ||
| ibm/power9 | ||
| intel | ||
| mediatek | ||
| nvidia | ||
| qualcomm | ||
| rockchip | ||
| samsung | ||
| sifive | ||
| ti | ||
| ucb/riscv | ||
| xilinx | ||