summaryrefslogtreecommitdiff
path: root/test/cmd/coreboot.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-10-14 16:32:11 -0600
committerTom Rini <trini@konsulko.com>2024-11-03 21:27:12 -0600
commitae3b5928d61190d0faef7dfb2bbfc415a25b6ca5 (patch)
treeae3f75cd3750f675aeaaa2282d8c8cbe5a42649f /test/cmd/coreboot.c
parente25c34ddb524043c26ff1db820584a40c0f094b8 (diff)
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>
Diffstat (limited to 'test/cmd/coreboot.c')
-rw-r--r--test/cmd/coreboot.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/cmd/coreboot.c b/test/cmd/coreboot.c
index e1acf8697e8..a99898d15c4 100644
--- a/test/cmd/coreboot.c
+++ b/test/cmd/coreboot.c
@@ -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);