mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-20 06:01:26 +02:00
board: st: stm32mp2: add env_get_location()
In case of several environment location support, env_get_location is needed to select the correct location depending of the boot device . Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
This commit is contained in:
parent
f9fc248995
commit
1b343e2603
@ -6,7 +6,7 @@
|
|||||||
#define LOG_CATEGORY LOGC_BOARD
|
#define LOG_CATEGORY LOGC_BOARD
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <env.h>
|
#include <env_internal.h>
|
||||||
#include <fdt_support.h>
|
#include <fdt_support.h>
|
||||||
#include <log.h>
|
#include <log.h>
|
||||||
#include <misc.h>
|
#include <misc.h>
|
||||||
@ -59,6 +59,25 @@ int board_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum env_location env_get_location(enum env_operation op, int prio)
|
||||||
|
{
|
||||||
|
u32 bootmode = get_bootmode();
|
||||||
|
|
||||||
|
if (prio)
|
||||||
|
return ENVL_UNKNOWN;
|
||||||
|
|
||||||
|
switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
|
||||||
|
case BOOT_FLASH_SD:
|
||||||
|
case BOOT_FLASH_EMMC:
|
||||||
|
if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
|
||||||
|
return ENVL_MMC;
|
||||||
|
else
|
||||||
|
return ENVL_NOWHERE;
|
||||||
|
default:
|
||||||
|
return ENVL_NOWHERE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
const void *fdt_compat;
|
const void *fdt_compat;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user