]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: dts: imx: Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC
authorMarek Vasut <marex@denx.de>
Fri, 29 Nov 2024 00:13:54 +0000 (01:13 +0100)
committerFabio Estevam <festevam@gmail.com>
Fri, 29 Nov 2024 12:19:00 +0000 (09:19 -0300)
In case gpio_request_list_by_name_nodev() in board dmo_get_memcfg()
returns error code, pick a safe default DRAM configuration instead
of bailing out with some sort of hang() or panic(). The BIT(2)|BIT(0)
strap option is the lowest known option of 2 GiB , use that.

Signed-off-by: Marek Vasut <marex@denx.de>
board/data_modul/common/common.c

index b5f8390877138f04733cc94c0317951d8ff2108c..9e35dc5d6cb125e3190a0c79293ceba76c730981 100644 (file)
@@ -47,6 +47,9 @@ u8 dmo_get_memcfg(void)
                                              "dmo,ram-coding-gpios",
                                              gpio, ARRAY_SIZE(gpio),
                                              GPIOD_IS_IN);
+       if (ret < 0)
+               return BIT(2) | BIT(0);
+
        for (i = 0; i < ret; i++)
                memcfg |= !!dm_gpio_get_value(&(gpio[i])) << i;