Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Provide a menu of available bootflows and related options |
| 4 | * |
| 5 | * Copyright 2022 Google LLC |
| 6 | * Written by Simon Glass <sjg@chromium.org> |
| 7 | */ |
| 8 | |
| 9 | #define LOG_CATEGORY UCLASS_BOOTSTD |
| 10 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 11 | #include <bootflow.h> |
Quentin Schulz | 21a6aec | 2024-06-12 16:58:49 +0200 | [diff] [blame] | 12 | #include <bootmeth.h> |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 13 | #include <bootstd.h> |
| 14 | #include <cli.h> |
| 15 | #include <dm.h> |
| 16 | #include <expo.h> |
| 17 | #include <malloc.h> |
| 18 | #include <menu.h> |
| 19 | #include <video_console.h> |
| 20 | #include <watchdog.h> |
| 21 | #include <linux/delay.h> |
| 22 | #include "bootflow_internal.h" |
| 23 | |
| 24 | /** |
| 25 | * struct menu_priv - information about the menu |
| 26 | * |
| 27 | * @num_bootflows: Number of bootflows in the menu |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 28 | * @last_bootdev: bootdev of the last bootflow added to the menu, NULL if none |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 29 | */ |
| 30 | struct menu_priv { |
| 31 | int num_bootflows; |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 32 | struct udevice *last_bootdev; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | int bootflow_menu_new(struct expo **expp) |
| 36 | { |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 37 | struct scene_obj_menu *menu; |
| 38 | struct menu_priv *priv; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 39 | struct scene *scn; |
| 40 | struct expo *exp; |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 41 | bool use_font; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 42 | void *logo; |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 43 | int ret; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 44 | |
| 45 | priv = calloc(1, sizeof(*priv)); |
| 46 | if (!priv) |
| 47 | return log_msg_ret("prv", -ENOMEM); |
| 48 | |
| 49 | ret = expo_new("bootflows", priv, &exp); |
| 50 | if (ret) |
| 51 | return log_msg_ret("exp", ret); |
| 52 | |
| 53 | ret = scene_new(exp, "main", MAIN, &scn); |
| 54 | if (ret < 0) |
| 55 | return log_msg_ret("scn", ret); |
| 56 | |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 57 | ret = scene_box(scn, "box", OBJ_BOX, 2, NULL); |
| 58 | if (ret < 0) |
| 59 | return log_msg_ret("bmb", ret); |
| 60 | ret |= scene_obj_set_bbox(scn, OBJ_BOX, 30, 90, 1366 - 30, 720); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 61 | |
| 62 | ret = scene_menu(scn, "main", OBJ_MENU, &menu); |
| 63 | ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100); |
| 64 | ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE, |
| 65 | "U-Boot - Boot Menu", NULL); |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 66 | ret |= scene_obj_set_bbox(scn, OBJ_MENU_TITLE, 0, 32, |
| 67 | SCENEOB_DISPLAY_MAX, 30); |
| 68 | ret |= scene_obj_set_halign(scn, OBJ_MENU_TITLE, SCENEOA_CENTRE); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 69 | |
| 70 | logo = video_get_u_boot_logo(); |
| 71 | if (logo) { |
| 72 | ret |= scene_img(scn, "ulogo", OBJ_U_BOOT_LOGO, logo, NULL); |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 73 | ret |= scene_obj_set_pos(scn, OBJ_U_BOOT_LOGO, 1165, 100); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 74 | } |
| 75 | |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 76 | ret |= scene_txt_str(scn, "prompt1a", OBJ_PROMPT1A, STR_PROMPT1A, |
| 77 | "Use the \x18 and \x19 keys to select which entry is highlighted.", |
| 78 | NULL); |
| 79 | ret |= scene_txt_str(scn, "prompt1b", OBJ_PROMPT1B, STR_PROMPT1B, |
| 80 | "Use the UP and DOWN keys to select which entry is highlighted.", |
| 81 | NULL); |
| 82 | ret |= scene_txt_str(scn, "prompt2", OBJ_PROMPT2, STR_PROMPT2, |
| 83 | "Press enter to boot the selected OS, 'e' to edit the commands " |
| 84 | "before booting or 'c' for a command-line. ESC to return to " |
| 85 | "previous menu", NULL); |
| 86 | ret |= scene_txt_str(scn, "autoboot", OBJ_AUTOBOOT, STR_AUTOBOOT, |
| 87 | "The highlighted entry will be executed automatically in %ds.", |
| 88 | NULL); |
| 89 | ret |= scene_obj_set_bbox(scn, OBJ_PROMPT1A, 0, 590, |
| 90 | SCENEOB_DISPLAY_MAX, 30); |
| 91 | ret |= scene_obj_set_bbox(scn, OBJ_PROMPT1B, 0, 620, |
| 92 | SCENEOB_DISPLAY_MAX, 30); |
| 93 | ret |= scene_obj_set_bbox(scn, OBJ_PROMPT2, 100, 650, |
| 94 | 1366 - 100, 700); |
| 95 | ret |= scene_obj_set_bbox(scn, OBJ_AUTOBOOT, 0, 720, |
| 96 | SCENEOB_DISPLAY_MAX, 750); |
| 97 | ret |= scene_obj_set_halign(scn, OBJ_PROMPT1A, SCENEOA_CENTRE); |
| 98 | ret |= scene_obj_set_halign(scn, OBJ_PROMPT1B, SCENEOA_CENTRE); |
| 99 | ret |= scene_obj_set_halign(scn, OBJ_PROMPT2, SCENEOA_CENTRE); |
| 100 | ret |= scene_obj_set_valign(scn, OBJ_PROMPT2, SCENEOA_CENTRE); |
| 101 | ret |= scene_obj_set_halign(scn, OBJ_AUTOBOOT, SCENEOA_CENTRE); |
| 102 | |
| 103 | use_font = IS_ENABLED(CONFIG_CONSOLE_TRUETYPE); |
| 104 | scene_obj_set_hide(scn, OBJ_PROMPT1A, use_font); |
| 105 | scene_obj_set_hide(scn, OBJ_PROMPT1B, !use_font); |
| 106 | scene_obj_set_hide(scn, OBJ_AUTOBOOT, use_font); |
| 107 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 108 | ret |= scene_txt_str(scn, "cur_item", OBJ_POINTER, STR_POINTER, ">", |
| 109 | NULL); |
| 110 | ret |= scene_menu_set_pointer(scn, OBJ_MENU, OBJ_POINTER); |
| 111 | if (ret < 0) |
| 112 | return log_msg_ret("new", -EINVAL); |
| 113 | |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 114 | exp->show_highlight = true; |
| 115 | |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 116 | *expp = exp; |
| 117 | |
| 118 | return 0; |
| 119 | } |
| 120 | |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 121 | int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, |
| 122 | struct scene **scnp) |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 123 | { |
| 124 | struct menu_priv *priv = exp->priv; |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 125 | char str[2], *label, *key; |
Simon Glass | cffde57 | 2025-05-02 08:46:47 -0600 | [diff] [blame] | 126 | struct udevice *media; |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 127 | struct scene *scn; |
Simon Glass | cffde57 | 2025-05-02 08:46:47 -0600 | [diff] [blame] | 128 | const char *name; |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 129 | uint preview_id; |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 130 | uint scene_id; |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 131 | bool add_gap; |
| 132 | int ret; |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 133 | |
| 134 | ret = expo_first_scene_id(exp); |
| 135 | if (ret < 0) |
| 136 | return log_msg_ret("scn", ret); |
| 137 | scene_id = ret; |
| 138 | scn = expo_lookup_scene_id(exp, scene_id); |
| 139 | |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 140 | *str = seq < 10 ? '0' + seq : 'A' + seq - 10; |
| 141 | str[1] = '\0'; |
| 142 | key = strdup(str); |
| 143 | if (!key) |
| 144 | return log_msg_ret("key", -ENOMEM); |
Simon Glass | cffde57 | 2025-05-02 08:46:47 -0600 | [diff] [blame] | 145 | |
| 146 | media = dev_get_parent(bflow->dev); |
| 147 | if (device_get_uclass_id(media) == UCLASS_MASS_STORAGE) |
| 148 | name = "usb"; |
| 149 | else |
| 150 | name = media->name; |
| 151 | label = strdup(name); |
| 152 | |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 153 | if (!label) { |
| 154 | free(key); |
| 155 | return log_msg_ret("nam", -ENOMEM); |
| 156 | } |
| 157 | |
| 158 | add_gap = priv->last_bootdev != bflow->dev; |
Simon Glass | dd7ff43 | 2025-05-02 08:46:48 -0600 | [diff] [blame] | 159 | |
| 160 | /* disable this gap for now, since it looks a little ugly */ |
| 161 | add_gap = false; |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 162 | priv->last_bootdev = bflow->dev; |
| 163 | |
| 164 | ret = expo_str(exp, "prompt", STR_POINTER, ">"); |
| 165 | ret |= scene_txt_str(scn, "label", ITEM_LABEL + seq, |
| 166 | STR_LABEL + seq, label, NULL); |
| 167 | ret |= scene_txt_str(scn, "desc", ITEM_DESC + seq, STR_DESC + seq, |
| 168 | bflow->os_name ? bflow->os_name : |
| 169 | bflow->name, NULL); |
| 170 | ret |= scene_txt_str(scn, "key", ITEM_KEY + seq, STR_KEY + seq, key, |
| 171 | NULL); |
| 172 | preview_id = 0; |
| 173 | if (bflow->logo) { |
| 174 | preview_id = ITEM_PREVIEW + seq; |
| 175 | ret |= scene_img(scn, "preview", preview_id, |
| 176 | bflow->logo, NULL); |
| 177 | } |
| 178 | ret |= scene_menuitem(scn, OBJ_MENU, "item", ITEM + seq, |
| 179 | ITEM_KEY + seq, ITEM_LABEL + seq, |
| 180 | ITEM_DESC + seq, preview_id, |
| 181 | add_gap ? SCENEMIF_GAP_BEFORE : 0, |
| 182 | NULL); |
| 183 | |
| 184 | if (ret < 0) |
| 185 | return log_msg_ret("itm", -EINVAL); |
| 186 | priv->num_bootflows++; |
| 187 | *scnp = scn; |
| 188 | |
| 189 | return 0; |
| 190 | } |
| 191 | |
| 192 | int bootflow_menu_add_all(struct expo *exp) |
| 193 | { |
| 194 | struct bootflow *bflow; |
| 195 | struct scene *scn; |
| 196 | int ret, i; |
| 197 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 198 | for (ret = bootflow_first_glob(&bflow), i = 0; !ret && i < 36; |
| 199 | ret = bootflow_next_glob(&bflow), i++) { |
Quentin Schulz | 21a6aec | 2024-06-12 16:58:49 +0200 | [diff] [blame] | 200 | struct bootmeth_uc_plat *ucp; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 201 | |
| 202 | if (bflow->state != BOOTFLOWST_READY) |
| 203 | continue; |
| 204 | |
Quentin Schulz | 21a6aec | 2024-06-12 16:58:49 +0200 | [diff] [blame] | 205 | /* No media to show for BOOTMETHF_GLOBAL bootmeths */ |
| 206 | ucp = dev_get_uclass_plat(bflow->method); |
| 207 | if (ucp->flags & BOOTMETHF_GLOBAL) |
| 208 | continue; |
| 209 | |
Simon Glass | 9f5a792 | 2025-05-02 08:46:29 -0600 | [diff] [blame] | 210 | ret = bootflow_menu_add(exp, bflow, i, &scn); |
| 211 | if (ret) |
| 212 | return log_msg_ret("bao", ret); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 213 | } |
| 214 | |
Simon Glass | d7e32a8 | 2023-06-01 10:22:35 -0600 | [diff] [blame] | 215 | ret = scene_arrange(scn); |
| 216 | if (ret) |
| 217 | return log_msg_ret("arr", ret); |
| 218 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 219 | return 0; |
| 220 | } |
| 221 | |
Simon Glass | d92bcc4 | 2023-01-06 08:52:42 -0600 | [diff] [blame] | 222 | int bootflow_menu_apply_theme(struct expo *exp, ofnode node) |
| 223 | { |
| 224 | struct menu_priv *priv = exp->priv; |
| 225 | struct scene *scn; |
| 226 | u32 font_size; |
| 227 | int ret; |
| 228 | |
| 229 | log_debug("Applying theme %s\n", ofnode_get_name(node)); |
| 230 | scn = expo_lookup_scene_id(exp, MAIN); |
| 231 | if (!scn) |
| 232 | return log_msg_ret("scn", -ENOENT); |
| 233 | |
| 234 | /* Avoid error-checking optional items */ |
| 235 | if (!ofnode_read_u32(node, "font-size", &font_size)) { |
| 236 | int i; |
| 237 | |
| 238 | log_debug("font size %d\n", font_size); |
Simon Glass | fe80599 | 2025-05-02 08:46:54 -0600 | [diff] [blame] | 239 | scene_txt_set_font(scn, OBJ_PROMPT1A, NULL, font_size); |
Simon Glass | d92bcc4 | 2023-01-06 08:52:42 -0600 | [diff] [blame] | 240 | scene_txt_set_font(scn, OBJ_POINTER, NULL, font_size); |
| 241 | for (i = 0; i < priv->num_bootflows; i++) { |
| 242 | ret = scene_txt_set_font(scn, ITEM_DESC + i, NULL, |
| 243 | font_size); |
| 244 | if (ret) |
| 245 | return log_msg_ret("des", ret); |
| 246 | scene_txt_set_font(scn, ITEM_KEY + i, NULL, font_size); |
| 247 | scene_txt_set_font(scn, ITEM_LABEL + i, NULL, |
| 248 | font_size); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | ret = scene_arrange(scn); |
| 253 | if (ret) |
| 254 | return log_msg_ret("arr", ret); |
| 255 | |
| 256 | return 0; |
| 257 | } |
| 258 | |
Simon Glass | 6f10080 | 2025-05-02 08:46:56 -0600 | [diff] [blame^] | 259 | int bootflow_menu_setup(struct bootstd_priv *std, bool text_mode, |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 260 | struct expo **expp) |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 261 | { |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 262 | struct udevice *dev; |
| 263 | struct expo *exp; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 264 | int ret; |
| 265 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 266 | ret = bootflow_menu_new(&exp); |
| 267 | if (ret) |
Simon Glass | d9da19a | 2025-05-02 08:46:28 -0600 | [diff] [blame] | 268 | return log_msg_ret("bmn", ret); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 269 | |
Simon Glass | d92bcc4 | 2023-01-06 08:52:42 -0600 | [diff] [blame] | 270 | if (ofnode_valid(std->theme)) { |
| 271 | ret = bootflow_menu_apply_theme(exp, std->theme); |
| 272 | if (ret) |
| 273 | return log_msg_ret("thm", ret); |
| 274 | } |
| 275 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 276 | /* For now we only support a video console */ |
| 277 | ret = uclass_first_device_err(UCLASS_VIDEO, &dev); |
| 278 | if (ret) |
| 279 | return log_msg_ret("vid", ret); |
| 280 | ret = expo_set_display(exp, dev); |
| 281 | if (ret) |
| 282 | return log_msg_ret("dis", ret); |
| 283 | |
| 284 | ret = expo_set_scene_id(exp, MAIN); |
| 285 | if (ret) |
| 286 | return log_msg_ret("scn", ret); |
| 287 | |
| 288 | if (text_mode) |
Simon Glass | b2c4034 | 2023-06-01 10:22:37 -0600 | [diff] [blame] | 289 | expo_set_text_mode(exp, text_mode); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 290 | |
Simon Glass | 6f10080 | 2025-05-02 08:46:56 -0600 | [diff] [blame^] | 291 | *expp = exp; |
| 292 | |
| 293 | return 0; |
| 294 | } |
| 295 | |
| 296 | int bootflow_menu_start(struct bootstd_priv *std, bool text_mode, |
| 297 | struct expo **expp) |
| 298 | { |
| 299 | struct expo *exp; |
| 300 | int ret; |
| 301 | |
| 302 | ret = bootflow_menu_setup(std, text_mode, &exp); |
| 303 | if (ret) |
| 304 | return log_msg_ret("bmd", ret); |
| 305 | |
| 306 | ret = bootflow_menu_add_all(exp); |
| 307 | if (ret) |
| 308 | return log_msg_ret("bma", ret); |
| 309 | |
| 310 | if (ofnode_valid(std->theme)) { |
| 311 | ret = expo_apply_theme(exp, std->theme); |
| 312 | if (ret) |
| 313 | return log_msg_ret("thm", ret); |
| 314 | } |
| 315 | |
Simon Glass | cfb4f2c | 2025-05-02 08:46:42 -0600 | [diff] [blame] | 316 | ret = expo_calc_dims(exp); |
| 317 | if (ret) |
| 318 | return log_msg_ret("bmd", ret); |
| 319 | |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 320 | *expp = exp; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 321 | |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 322 | return 0; |
| 323 | } |
| 324 | |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 325 | int bootflow_menu_poll(struct expo *exp, int *seqp) |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 326 | { |
| 327 | struct bootflow *sel_bflow; |
| 328 | struct expo_action act; |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 329 | struct scene *scn; |
| 330 | int item, ret; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 331 | |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 332 | sel_bflow = NULL; |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 333 | |
| 334 | scn = expo_lookup_scene_id(exp, exp->scene_id); |
| 335 | |
| 336 | item = scene_menu_get_cur_item(scn, OBJ_MENU); |
| 337 | *seqp = item > 0 ? item - ITEM : -1; |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 338 | |
| 339 | ret = expo_poll(exp, &act); |
| 340 | if (ret) |
| 341 | return log_msg_ret("bmp", ret); |
| 342 | |
| 343 | switch (act.type) { |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 344 | case EXPOACT_SELECT: |
| 345 | *seqp = act.select.id - ITEM; |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 346 | break; |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 347 | case EXPOACT_POINT_ITEM: { |
| 348 | struct scene *scn = expo_lookup_scene_id(exp, MAIN); |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 349 | |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 350 | if (!scn) |
| 351 | return log_msg_ret("bms", -ENOENT); |
| 352 | ret = scene_menu_select_item(scn, OBJ_MENU, act.select.id); |
| 353 | if (ret) |
| 354 | return log_msg_ret("bmp", ret); |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 355 | return -ERESTART; |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 356 | } |
| 357 | case EXPOACT_QUIT: |
| 358 | return -EPIPE; |
| 359 | default: |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 360 | return -EAGAIN; |
Simon Glass | d7cef83 | 2025-05-02 08:46:27 -0600 | [diff] [blame] | 361 | } |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 362 | |
Simon Glass | 7bbbcbf | 2025-05-02 08:46:55 -0600 | [diff] [blame] | 363 | return 0; |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 364 | } |