forked from OERV-BSP/u-boot
expo: cedit: Support reading settings from environment vars
Add a command to read cedit settings from environment variables so that they can be restored as part of the environment. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -114,7 +114,7 @@ static int cedit_fdt(struct unit_test_state *uts)
|
||||
}
|
||||
BOOTSTD_TEST(cedit_fdt, 0);
|
||||
|
||||
/* Check the cedit write_env command */
|
||||
/* Check the cedit write_env and read_env commands */
|
||||
static int cedit_env(struct unit_test_state *uts)
|
||||
{
|
||||
struct video_priv *vid_priv;
|
||||
@@ -142,6 +142,16 @@ static int cedit_env(struct unit_test_state *uts)
|
||||
ut_asserteq(7, env_get_ulong("c.cpu-speed", 10, 0));
|
||||
ut_asserteq_str("2.5 GHz", env_get("c.cpu-speed-str"));
|
||||
|
||||
/* reset the expo */
|
||||
menu->cur_item_id = ID_CPU_SPEED_1;
|
||||
|
||||
ut_assertok(run_command("cedit read_env -v", 0));
|
||||
ut_assert_nextlinen("c.cpu-speed=7");
|
||||
ut_assert_nextlinen("c.power-loss=10");
|
||||
ut_assert_console_end();
|
||||
|
||||
ut_asserteq(ID_CPU_SPEED_2, menu->cur_item_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
BOOTSTD_TEST(cedit_env, 0);
|
||||
|
||||
Reference in New Issue
Block a user