mirror of
https://xff.cz/git/u-boot/
synced 2025-10-29 01:23:25 +01:00
x86: coreboot: Allow building an expo for editing CMOS config
Coreboot provides the CMOS layout in the tables it passes to U-Boot. Use that to build an editor for the CMOS settings. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -6,12 +6,16 @@
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <cedit.h>
|
||||
#include <command.h>
|
||||
#include <dm.h>
|
||||
#include <expo.h>
|
||||
#include <rtc.h>
|
||||
#include <test/cedit-test.h>
|
||||
#include <test/cmd.h>
|
||||
#include <test/test.h>
|
||||
#include <test/ut.h>
|
||||
#include "../../boot/scene_internal.h"
|
||||
|
||||
enum {
|
||||
CSUM_LOC = 0x3f0 / 8,
|
||||
@@ -82,3 +86,34 @@ static int test_cmd_cbcmos(struct unit_test_state *uts)
|
||||
return 0;
|
||||
}
|
||||
CMD_TEST(test_cmd_cbcmos, UTF_CONSOLE);
|
||||
|
||||
/* test 'cedit cb_load' command */
|
||||
static int test_cmd_cedit_cb_load(struct unit_test_state *uts)
|
||||
{
|
||||
struct scene_obj_menu *menu;
|
||||
struct video_priv *vid_priv;
|
||||
struct scene_obj_txt *txt;
|
||||
struct scene *scn;
|
||||
struct expo *exp;
|
||||
int scn_id;
|
||||
|
||||
ut_assertok(run_command("cedit cb_load", 0));
|
||||
ut_assertok(run_command("cedit read_cmos", 0));
|
||||
ut_assert_console_end();
|
||||
|
||||
exp = cur_exp;
|
||||
scn_id = cedit_prepare(exp, &vid_priv, &scn);
|
||||
ut_assert(scn_id > 0);
|
||||
ut_assertnonnull(scn);
|
||||
|
||||
/* just do a very basic test that the first menu is present */
|
||||
menu = scene_obj_find(scn, scn->highlight_id, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(menu);
|
||||
|
||||
txt = scene_obj_find(scn, menu->title_id, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(txt);
|
||||
ut_asserteq_str("Boot option", expo_get_str(exp, txt->str_id));
|
||||
|
||||
return 0;
|
||||
}
|
||||
CMD_TEST(test_cmd_cedit_cb_load, UTF_CONSOLE);
|
||||
|
||||
Reference in New Issue
Block a user