aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Lapkin <email2tema@gmail.com>2021-05-27 15:35:28 +0800
committerNeil Armstrong <narmstrong@baylibre.com>2021-07-27 10:28:41 +0200
commit786c514946d485b009f49f8cb2231b83dfb22718 (patch)
tree611609c2af1aa7c8afc59b09708662728847da34
parente38f55d2e58b2c05b95006d41c59211420e73e62 (diff)
downloadu-boot-786c514946d485b009f49f8cb2231b83dfb22718.zip
u-boot-786c514946d485b009f49f8cb2231b83dfb22718.tar.gz
u-boot-786c514946d485b009f49f8cb2231b83dfb22718.tar.bz2
VIM3: mmc_get_env_dev correct non emmc boot sources
need return -1 if boot source is not EMMC or SD ( for example it will be useful if we have multy env sources configuration and device was booted from SPI flash and env need read from SPI not from mmc ) Signed-off-by: Artem Lapkin <art@khadas.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
-rw-r--r--board/amlogic/vim3/vim3.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c
index 6cd5f2e..71aaa0d 100644
--- a/board/amlogic/vim3/vim3.c
+++ b/board/amlogic/vim3/vim3.c
@@ -19,9 +19,15 @@
int mmc_get_env_dev(void)
{
- if (meson_get_boot_device() == BOOT_DEVICE_EMMC)
+ switch (meson_get_boot_device()) {
+ case BOOT_DEVICE_EMMC:
return 2;
- return 1;
+ case BOOT_DEVICE_SD:
+ return 1;
+ default:
+ /* boot device is not EMMC|SD */
+ return -1;
+ }
}
/*