Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-omap2 / utils.c
index 7d1ca274bf3a3cd722d754529f494cb449e143ac..6e6791fc6595320c56ea745573c1e88c433d9aac 100644 (file)
@@ -1,10 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2011 Linaro Limited
  * Aneesh V <aneesh@ti.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
+#include <env.h>
+#include <part.h>
 #include <asm/setup.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_common.h>
@@ -29,6 +30,8 @@ static void omap_set_fastboot_cpu(void)
 
        switch (cpu_rev) {
        case DRA762_ES1_0:
+       case DRA762_ABZ_ES1_0:
+       case DRA762_ACD_ES1_0:
                cpu = "DRA762";
                break;
        case DRA752_ES1_0:
@@ -83,12 +86,12 @@ static void omap_set_fastboot_board_rev(void)
        env_set("fastboot.board_rev", board_rev);
 }
 
-#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
+#ifdef CONFIG_FASTBOOT_FLASH_MMC
 static u32 omap_mmc_get_part_size(const char *part)
 {
        int res;
        struct blk_desc *dev_desc;
-       disk_partition_t info;
+       struct disk_partition info;
        u64 sz = 0;
 
        dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
@@ -126,13 +129,26 @@ static void omap_set_fastboot_userdata_size(void)
 static inline void omap_set_fastboot_userdata_size(void)
 {
 }
-#endif /* CONFIG_FASTBOOT_FLASH_MMC_DEV */
+#endif /* CONFIG_FASTBOOT_FLASH_MMC */
+
+static void omap_set_fastboot_product(void)
+{
+       const char *board_name;
+
+       board_name = env_get("board_name");
+       if (board_name == NULL)
+               printf("Warning: fastboot.product: unknown board\n");
+
+       env_set("fastboot.product", board_name);
+}
+
 void omap_set_fastboot_vars(void)
 {
        omap_set_fastboot_cpu();
        omap_set_fastboot_secure();
        omap_set_fastboot_board_rev();
        omap_set_fastboot_userdata_size();
+       omap_set_fastboot_product();
 }
 #endif /* CONFIG_FASTBOOT_FLASH */