]> git.sur5r.net Git - u-boot/commitdiff
OMAP3SOM BOARD: Auto detect Logic PD Models
authorAdam Ford <aford173@gmail.com>
Thu, 18 Feb 2016 03:49:49 +0000 (21:49 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 24 Feb 2016 23:44:00 +0000 (18:44 -0500)
Logic PD makes four different system on modules.  This patch will auto
detect the board type and identify the corresponding device tree image.

V2:
Added 'default:' case to switch statement
Since board_late_init() is defined as int, we now return 0

Signed-off-by: Derald Woods <woods.technical@gmail.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
board/logicpd/omap3som/omap3logic.c
include/configs/omap3_logic.h

index b5c44f915b4e8c04d1c1b9cb944d042f10025c1c..668f68476e681a7373cba5338b129a9fe517ad69 100644 (file)
@@ -228,6 +228,30 @@ int board_init(void)
        return 0;
 }
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+       switch (gd->bd->bi_arch_number) {
+       case MACH_TYPE_DM3730_TORPEDO:
+               setenv("fdtimage", "logicpd-torpedo-37xx-devkit.dtb");
+               break;
+       case MACH_TYPE_DM3730_SOM_LV:
+               setenv("fdtimage", "logicpd-som-lv-37xx-devkit.dtb");
+               break;
+       case MACH_TYPE_OMAP3_TORPEDO:
+               setenv("fdtimage", "logicpd-torpedo-35xx-devkit.dtb");
+               break;
+       case MACH_TYPE_OMAP3530_LV_SOM:
+               setenv("fdtimage", "logicpd-som-lv-35xx-devkit.dtb");
+               break;
+       default:
+               /* unknown machine type */
+               break;
+       }
+       return 0;
+}
+#endif
+
 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
index fba2a1256b84baaf3def372e22f305191e5d6263..0fc9d1c4e136ab9ffb53b78e996371d3d2f1264f 100644 (file)
@@ -40,7 +40,7 @@
 
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
-
+#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MISC_INIT_R             /* misc_init_r dumps the die id */
 #define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS