]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
verdin-imx8mm: automatic ram size detection
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>
Wed, 28 Oct 2020 09:58:16 +0000 (11:58 +0200)
committerStefano Babic <sbabic@denx.de>
Sun, 6 Dec 2020 14:31:37 +0000 (15:31 +0100)
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>
board/toradex/verdin-imx8mm/verdin-imx8mm.c

index 9c6f35e778f7ca380539dc0cfd0a204f68cbb7dd..7cfae8767cecfdfb04361764383139317b8b1242 100644 (file)
@@ -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)
 {