From: Tim Harvey Date: Wed, 3 May 2023 00:05:54 +0000 (-0700) Subject: board: gateworks: venice: dynamically determine U-Boot env partition X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=2c2cc1eaabc7b4bb5af66830c59a810e97280545;p=u-boot.git board: gateworks: venice: dynamically determine U-Boot env partition Determine the U-Boot env hardware partition depending on the boot device. This allows the same boot firmware image to be placed on user, boot0, or boot1 without changing CONFIG_SYS_MMC_ENV_PART. Signed-off-by: Tim Harvey --- diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c index ca62f0be6d..7aca755038 100644 --- a/board/gateworks/venice/venice.c +++ b/board/gateworks/venice/venice.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,20 @@ int board_mmc_get_env_dev(int devno) return devno; } +uint mmc_get_env_part(struct mmc *mmc) +{ + if (!IS_SD(mmc)) { + switch (EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config)) { + case 1: + return 1; + case 2: + return 2; + } + } + + return 0; +} + int ft_board_setup(void *fdt, struct bd_info *bd) { const char *base_model = eeprom_get_baseboard_model();