diff options
author | Inha Song <ideal.song@samsung.com> | 2015-05-22 18:14:25 +0200 |
---|---|---|
committer | Lukasz Majewski <l.majewski@samsung.com> | 2015-06-08 15:25:55 +0200 |
commit | cac178781ded415b005a9f0e198d14b53d8268cd (patch) | |
tree | 92a880776650b15b1f34f228bfce90746f708f35 /board/samsung/smdk5420 | |
parent | 302a7d0006da530ffbb771677ea71d61b0f1cb7e (diff) |
smdk5420: board: add functions to init dfu environment settings
This commit extends SMDK5420 board's file by adding functions:
- get_dfu_alt_system()
- get_dfu_alt_boot()
This allows setting the DFU environment by function set_dfu_alt_info()
from: board/samsung/common/misc.c
Signed-off-by: Inha Song <ideal.song@samsung.com>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'board/samsung/smdk5420')
-rw-r--r-- | board/samsung/smdk5420/smdk5420.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/board/samsung/smdk5420/smdk5420.c b/board/samsung/smdk5420/smdk5420.c index 8021f779e0..88f4044d63 100644 --- a/board/samsung/smdk5420/smdk5420.c +++ b/board/samsung/smdk5420/smdk5420.c @@ -19,6 +19,7 @@ #include <power/tps65090_pmic.h> #include <i2c.h> #include <lcd.h> +#include <mmc.h> #include <parade.h> #include <spi.h> #include <usb.h> @@ -111,3 +112,32 @@ int board_usb_init(int index, enum usb_init_type init) return dwc3_uboot_init(&dwc3_device_data); } #endif +#ifdef CONFIG_SET_DFU_ALT_INFO +char *get_dfu_alt_system(char *interface, char *devstr) +{ + return getenv("dfu_alt_system"); +} + +char *get_dfu_alt_boot(char *interface, char *devstr) +{ + struct mmc *mmc; + char *alt_boot; + int dev_num; + + dev_num = simple_strtoul(devstr, NULL, 10); + + mmc = find_mmc_device(dev_num); + if (!mmc) + return NULL; + + if (mmc_init(mmc)) + return NULL; + + if (IS_SD(mmc)) + alt_boot = CONFIG_DFU_ALT_BOOT_SD; + else + alt_boot = CONFIG_DFU_ALT_BOOT_EMMC; + + return alt_boot; +} +#endif |