Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / board / ti / am57xx / board.c
index 7528de3e5c3c9955b7f5e54f7a38ff0887d3d7a0..8720eb87a55d5e5a4f71287560922ff23cee7b73 100644 (file)
 #include <common.h>
 #include <env.h>
 #include <fdt_support.h>
+#include <image.h>
 #include <init.h>
 #include <malloc.h>
+#include <net.h>
 #include <palmas.h>
 #include <sata.h>
 #include <serial.h>
@@ -36,6 +38,7 @@
 #include <ti-usb-phy-uboot.h>
 #include <mmc.h>
 #include <dm/uclass.h>
+#include <hang.h>
 
 #include "../common/board_detect.h"
 #include "mux_data.h"
@@ -707,6 +710,18 @@ void am57x_idk_lcd_detect(void)
        }
 out:
        env_set("idk_lcd", idk_lcd);
+
+       /*
+        * On AM571x_IDK, no Display with J51 set to LCD is considered as an
+        * invalid configuration and we prevent boot to get user attention.
+        */
+       if (board_is_am571x_idk() && am571x_idk_needs_lcd() &&
+           !strncmp(idk_lcd, "no", 2)) {
+               printf("%s: Invalid HW configuration: display not detected/supported but J51 is set. Remove J51 to boot without display.\n",
+                      __func__);
+               hang();
+       }
+
        return;
 }