diff options
Diffstat (limited to 'arch/arm/mach-rockchip/rk3399/rk3399.c')
-rw-r--r-- | arch/arm/mach-rockchip/rk3399/rk3399.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index d8467d7333..a5d93329b4 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -7,6 +7,8 @@ #include <asm/armv8/mmu.h> #include <asm/io.h> #include <asm/arch/hardware.h> +#include <asm/arch/bootrom.h> +#include <dm/ofnode.h> DECLARE_GLOBAL_DATA_PTR; @@ -54,3 +56,19 @@ int arch_cpu_init(void) return 0; } + +#ifdef CONFIG_ENV_IS_IN_MMC + +int mmc_get_env_dev(void) +{ + const char *boot_device = + ofnode_get_chosen_prop("u-boot,spl-boot-device"); + if (!strcmp(boot_device, "/dwmmc@fe320000")) + return 1; + else if (!strcmp(boot_device, "/sdhci@fe330000")) + return 0; + + return CONFIG_SYS_MMC_ENV_DEV; +} + +#endif /* CONFIG_ENV_IS_IN_MMC */ |