diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2020-10-28 11:58:16 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-12-06 15:31:37 +0100 |
commit | 72a1b9a977e8636b9c364f2cbf21371afe143c68 (patch) | |
tree | da86b6b3f4647860bbe47eb892cba2b0416c9327 /board/toradex | |
parent | 2a1a2559fbc7f629fbf80a5478bcc252b9cd25b2 (diff) | |
download | u-boot-72a1b9a977e8636b9c364f2cbf21371afe143c68.tar.gz u-boot-72a1b9a977e8636b9c364f2cbf21371afe143c68.tar.bz2 u-boot-72a1b9a977e8636b9c364f2cbf21371afe143c68.zip |
verdin-imx8mm: automatic ram size detection
Implement board_phys_sdram_size() to automatically detect Verdin iMX8M
Mini DualLite 1GB vs. Verdin iMX8M Mini Quad 2GB.
Note: This only works if we keep using similar RAM chips!
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/verdin-imx8mm/verdin-imx8mm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 9c6f35e778..7cfae8767c 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -180,6 +180,16 @@ int board_late_init(void) return 0; } +int board_phys_sdram_size(phys_size_t *size) +{ + if (!size) + return -EINVAL; + + *size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); + + return 0; +} + #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { |