Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2021 Google LLC |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
| 5 | */ |
| 6 | |
| 7 | #ifndef __bootflow_h |
| 8 | #define __bootflow_h |
| 9 | |
Simon Glass | d92bcc4 | 2023-01-06 08:52:42 -0600 | [diff] [blame] | 10 | #include <dm/ofnode_decl.h> |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 11 | #include <linux/list.h> |
| 12 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 13 | struct bootstd_priv; |
| 14 | struct expo; |
| 15 | |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 16 | /** |
| 17 | * enum bootflow_state_t - states that a particular bootflow can be in |
| 18 | * |
| 19 | * Only bootflows in state BOOTFLOWST_READY can be used to boot. |
| 20 | * |
| 21 | * See bootflow_state[] for the names for each of these |
| 22 | */ |
| 23 | enum bootflow_state_t { |
| 24 | BOOTFLOWST_BASE, /**< Nothing known yet */ |
| 25 | BOOTFLOWST_MEDIA, /**< Media exists */ |
| 26 | BOOTFLOWST_PART, /**< Partition exists */ |
| 27 | BOOTFLOWST_FS, /**< Filesystem exists */ |
| 28 | BOOTFLOWST_FILE, /**< Bootflow file exists */ |
| 29 | BOOTFLOWST_READY, /**< Bootflow file loaded */ |
| 30 | |
| 31 | BOOTFLOWST_COUNT |
| 32 | }; |
| 33 | |
| 34 | /** |
| 35 | * struct bootflow - information about a bootflow |
| 36 | * |
| 37 | * This is connected into two separate linked lists: |
| 38 | * |
| 39 | * bm_sibling - links all bootflows in the same bootdev |
| 40 | * glob_sibling - links all bootflows in all bootdevs |
| 41 | * |
| 42 | * @bm_node: Points to siblings in the same bootdev |
| 43 | * @glob_node: Points to siblings in the global list (all bootdev) |
| 44 | * @dev: Bootdevice device which produced this bootflow |
| 45 | * @blk: Block device which contains this bootflow, NULL if this is a network |
Simon Glass | 4adeeb8 | 2023-01-17 10:47:59 -0700 | [diff] [blame] | 46 | * device or sandbox 'host' device |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 47 | * @part: Partition number (0 for whole device) |
| 48 | * @fs_type: Filesystem type (FS_TYPE...) if this is fixed by the media, else 0. |
| 49 | * For example, the sandbox host-filesystem bootdev sets this to |
| 50 | * FS_TYPE_SANDBOX |
| 51 | * @method: Bootmethod device used to perform the boot and read files |
| 52 | * @name: Name of bootflow (allocated) |
| 53 | * @state: Current state (enum bootflow_state_t) |
| 54 | * @subdir: Subdirectory to fetch files from (with trailing /), or NULL if none |
| 55 | * @fname: Filename of bootflow file (allocated) |
Simon Glass | 612b9cc | 2023-01-06 08:52:34 -0600 | [diff] [blame] | 56 | * @logo: Logo to display for this bootflow (BMP format) |
| 57 | * @logo_size: Size of the logo in bytes |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 58 | * @buf: Bootflow file contents (allocated) |
| 59 | * @size: Size of bootflow file in bytes |
| 60 | * @err: Error number received (0 if OK) |
Simon Glass | 72b7b19 | 2023-01-06 08:52:33 -0600 | [diff] [blame] | 61 | * @os_name: Name of the OS / distro being booted, or NULL if not known |
| 62 | * (allocated) |
Simon Glass | 7b8c634 | 2023-01-17 10:47:56 -0700 | [diff] [blame] | 63 | * @fdt_fname: Filename of FDT file |
| 64 | * @fdt_size: Size of FDT file |
| 65 | * @fdt_addr: Address of loaded fdt |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 66 | */ |
| 67 | struct bootflow { |
| 68 | struct list_head bm_node; |
| 69 | struct list_head glob_node; |
| 70 | struct udevice *dev; |
| 71 | struct udevice *blk; |
| 72 | int part; |
| 73 | int fs_type; |
| 74 | struct udevice *method; |
| 75 | char *name; |
| 76 | enum bootflow_state_t state; |
| 77 | char *subdir; |
| 78 | char *fname; |
Simon Glass | 612b9cc | 2023-01-06 08:52:34 -0600 | [diff] [blame] | 79 | void *logo; |
| 80 | uint logo_size; |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 81 | char *buf; |
| 82 | int size; |
| 83 | int err; |
Simon Glass | 72b7b19 | 2023-01-06 08:52:33 -0600 | [diff] [blame] | 84 | char *os_name; |
Simon Glass | 7b8c634 | 2023-01-17 10:47:56 -0700 | [diff] [blame] | 85 | char *fdt_fname; |
| 86 | int fdt_size; |
| 87 | ulong fdt_addr; |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 88 | }; |
| 89 | |
| 90 | /** |
| 91 | * enum bootflow_flags_t - flags for the bootflow iterator |
| 92 | * |
| 93 | * @BOOTFLOWF_FIXED: Only used fixed/internal media |
| 94 | * @BOOTFLOWF_SHOW: Show each bootdev before scanning it |
| 95 | * @BOOTFLOWF_ALL: Return bootflows with errors as well |
| 96 | * @BOOTFLOWF_SINGLE_DEV: Just scan one bootmeth |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 97 | * @BOOTFLOWF_SKIP_GLOBAL: Don't scan global bootmeths |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 98 | */ |
| 99 | enum bootflow_flags_t { |
| 100 | BOOTFLOWF_FIXED = 1 << 0, |
| 101 | BOOTFLOWF_SHOW = 1 << 1, |
| 102 | BOOTFLOWF_ALL = 1 << 2, |
| 103 | BOOTFLOWF_SINGLE_DEV = 1 << 3, |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 104 | BOOTFLOWF_SKIP_GLOBAL = 1 << 4, |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 105 | }; |
| 106 | |
| 107 | /** |
Simon Glass | e22fe92 | 2023-01-17 10:48:05 -0700 | [diff] [blame^] | 108 | * enum bootflow_meth_flags_t - flags controlling which bootmeths are used |
| 109 | * |
| 110 | * Used during iteration, e.g. by bootdev_find_by_label(), to determine which |
| 111 | * bootmeths are used for the current bootdev. The flags reset when the bootdev |
| 112 | * changes |
| 113 | * |
| 114 | * @BOOTFLOW_METHF_DHCP_ONLY: Only use dhcp (scripts and EFI) |
| 115 | * @BOOTFLOW_METHF_PXE_ONLY: Only use pxe (PXE boot) |
| 116 | */ |
| 117 | enum bootflow_meth_flags_t { |
| 118 | BOOTFLOW_METHF_DHCP_ONLY = 1 << 0, |
| 119 | BOOTFLOW_METHF_PXE_ONLY = 1 << 1, |
| 120 | }; |
| 121 | |
| 122 | /** |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 123 | * struct bootflow_iter - state for iterating through bootflows |
| 124 | * |
| 125 | * This starts at with the first bootdev/partition/bootmeth and can be used to |
| 126 | * iterate through all of them. |
| 127 | * |
| 128 | * Iteration starts with the bootdev. The first partition (0, i.e. whole device) |
| 129 | * is scanned first. For partition 0, it iterates through all the available |
| 130 | * bootmeths to see which one(s) can provide a bootflow. Then it moves to |
| 131 | * parition 1 (if there is one) and the process continues. Once all partitions |
| 132 | * are examined, it moves to the next bootdev. |
| 133 | * |
| 134 | * Initially @max_part is 0, meaning that only the whole device (@part=0) can be |
| 135 | * used. During scanning, if a partition table is found, then @max_part is |
| 136 | * updated to a larger value, no less than the number of available partitions. |
| 137 | * This ensures that iteration works through all partitions on the bootdev. |
| 138 | * |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 139 | * @flags: Flags to use (see enum bootflow_flags_t). If BOOTFLOWF_GLOBAL_FIRST is |
| 140 | * enabled then the global bootmeths are being scanned, otherwise we have |
| 141 | * moved onto the bootdevs |
| 142 | * @dev: Current bootdev, NULL if none |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 143 | * @part: Current partition number (0 for whole device) |
| 144 | * @method: Current bootmeth |
| 145 | * @max_part: Maximum hardware partition number in @dev, 0 if there is no |
| 146 | * partition table |
Simon Glass | 64cbc5c | 2023-01-17 10:47:42 -0700 | [diff] [blame] | 147 | * @first_bootable: First bootable partition, or 0 if none |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 148 | * @err: Error obtained from checking the last iteration. This is used to skip |
| 149 | * forward (e.g. to skip the current partition because it is not valid) |
| 150 | * -ESHUTDOWN: try next bootdev |
| 151 | * @num_devs: Number of bootdevs in @dev_order |
| 152 | * @cur_dev: Current bootdev number, an index into @dev_order[] |
| 153 | * @dev_order: List of bootdevs to scan, in order of priority. The scan starts |
| 154 | * with the first one on the list |
| 155 | * @num_methods: Number of bootmeth devices in @method_order |
| 156 | * @cur_method: Current method number, an index into @method_order |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 157 | * @first_glob_method: First global method, if any, else -1 |
| 158 | * @method_order: List of bootmeth devices to use, in order. The normal methods |
| 159 | * appear first, then the global ones, if any |
| 160 | * @doing_global: true if we are iterating through the global bootmeths (which |
| 161 | * happens before the normal ones) |
Simon Glass | 30fbeb5 | 2023-01-17 10:47:58 -0700 | [diff] [blame] | 162 | * @method_flags: flags controlling which methods should be used for this @dev |
| 163 | * (enum bootflow_meth_flags_t) |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 164 | */ |
| 165 | struct bootflow_iter { |
| 166 | int flags; |
| 167 | struct udevice *dev; |
| 168 | int part; |
| 169 | struct udevice *method; |
| 170 | int max_part; |
Simon Glass | 64cbc5c | 2023-01-17 10:47:42 -0700 | [diff] [blame] | 171 | int first_bootable; |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 172 | int err; |
| 173 | int num_devs; |
| 174 | int cur_dev; |
| 175 | struct udevice **dev_order; |
| 176 | int num_methods; |
| 177 | int cur_method; |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 178 | int first_glob_method; |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 179 | struct udevice **method_order; |
Simon Glass | 73fcf51 | 2022-07-30 15:52:25 -0600 | [diff] [blame] | 180 | bool doing_global; |
Simon Glass | 30fbeb5 | 2023-01-17 10:47:58 -0700 | [diff] [blame] | 181 | int method_flags; |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 182 | }; |
| 183 | |
| 184 | /** |
Simon Glass | 00501fc | 2022-10-20 18:22:51 -0600 | [diff] [blame] | 185 | * bootflow_init() - Set up a bootflow struct |
| 186 | * |
| 187 | * The bootflow is zeroed and set to state BOOTFLOWST_BASE |
| 188 | * |
| 189 | * @bflow: Struct to set up |
| 190 | * @bootdev: Bootdev to use |
| 191 | * @meth: Bootmeth to use |
| 192 | */ |
| 193 | void bootflow_init(struct bootflow *bflow, struct udevice *bootdev, |
| 194 | struct udevice *meth); |
| 195 | |
| 196 | /** |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 197 | * bootflow_iter_init() - Reset a bootflow iterator |
| 198 | * |
| 199 | * This sets everything to the starting point, ready for use. |
| 200 | * |
| 201 | * @iter: Place to store private info (inited by this call) |
| 202 | * @flags: Flags to use (see enum bootflow_flags_t) |
| 203 | */ |
| 204 | void bootflow_iter_init(struct bootflow_iter *iter, int flags); |
| 205 | |
| 206 | /** |
| 207 | * bootflow_iter_uninit() - Free memory used by an interator |
| 208 | * |
| 209 | * @iter: Iterator to free |
| 210 | */ |
| 211 | void bootflow_iter_uninit(struct bootflow_iter *iter); |
| 212 | |
| 213 | /** |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 214 | * bootflow_iter_drop_bootmeth() - Remove a bootmeth from an iterator |
| 215 | * |
| 216 | * Update the iterator so that the bootmeth will not be used again while this |
| 217 | * iterator is in use |
| 218 | * |
| 219 | * @iter: Iterator to update |
| 220 | * @bmeth: Boot method to remove |
| 221 | */ |
| 222 | int bootflow_iter_drop_bootmeth(struct bootflow_iter *iter, |
| 223 | const struct udevice *bmeth); |
| 224 | |
| 225 | /** |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 226 | * bootflow_scan_bootdev() - find the first bootflow in a bootdev |
| 227 | * |
| 228 | * If @flags includes BOOTFLOWF_ALL then bootflows with errors are returned too |
| 229 | * |
| 230 | * @dev: Boot device to scan, NULL to work through all of them until it |
Simon Glass | 943d38c | 2022-07-30 15:52:24 -0600 | [diff] [blame] | 231 | * finds one that can supply a bootflow |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 232 | * @iter: Place to store private info (inited by this call) |
Simon Glass | 943d38c | 2022-07-30 15:52:24 -0600 | [diff] [blame] | 233 | * @flags: Flags for iterator (enum bootflow_flags_t) |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 234 | * @bflow: Place to put the bootflow if found |
| 235 | * Return: 0 if found, -ENODEV if no device, other -ve on other error |
| 236 | * (iteration can continue) |
| 237 | */ |
| 238 | int bootflow_scan_bootdev(struct udevice *dev, struct bootflow_iter *iter, |
| 239 | int flags, struct bootflow *bflow); |
| 240 | |
| 241 | /** |
| 242 | * bootflow_scan_first() - find the first bootflow |
| 243 | * |
| 244 | * This works through the available bootdev devices until it finds one that |
| 245 | * can supply a bootflow. It then returns that |
| 246 | * |
| 247 | * If @flags includes BOOTFLOWF_ALL then bootflows with errors are returned too |
| 248 | * |
| 249 | * @iter: Place to store private info (inited by this call), with |
| 250 | * @flags: Flags for bootdev (enum bootflow_flags_t) |
| 251 | * @bflow: Place to put the bootflow if found |
| 252 | * Return: 0 if found, -ENODEV if no device, other -ve on other error (iteration |
| 253 | * can continue) |
| 254 | */ |
| 255 | int bootflow_scan_first(struct bootflow_iter *iter, int flags, |
| 256 | struct bootflow *bflow); |
| 257 | |
| 258 | /** |
| 259 | * bootflow_scan_next() - find the next bootflow |
| 260 | * |
| 261 | * This works through the available bootdev devices until it finds one that |
| 262 | * can supply a bootflow. It then returns that bootflow |
| 263 | * |
| 264 | * @iter: Private info (as set up by bootflow_scan_first()) |
| 265 | * @bflow: Place to put the bootflow if found |
| 266 | * Return: 0 if found, -ENODEV if no device, -ESHUTDOWN if no more bootflows, |
| 267 | * other -ve on other error (iteration can continue) |
| 268 | */ |
| 269 | int bootflow_scan_next(struct bootflow_iter *iter, struct bootflow *bflow); |
| 270 | |
| 271 | /** |
| 272 | * bootflow_first_glob() - Get the first bootflow from the global list |
| 273 | * |
| 274 | * Returns the first bootflow in the global list, no matter what bootflow it is |
| 275 | * attached to |
| 276 | * |
| 277 | * @bflowp: Returns a pointer to the bootflow |
| 278 | * Return: 0 if found, -ENOENT if there are no bootflows |
| 279 | */ |
| 280 | int bootflow_first_glob(struct bootflow **bflowp); |
| 281 | |
| 282 | /** |
| 283 | * bootflow_next_glob() - Get the next bootflow from the global list |
| 284 | * |
| 285 | * Returns the next bootflow in the global list, no matter what bootflow it is |
| 286 | * attached to |
| 287 | * |
| 288 | * @bflowp: On entry, the last bootflow returned , e.g. from |
| 289 | * bootflow_first_glob() |
| 290 | * Return: 0 if found, -ENOENT if there are no more bootflows |
| 291 | */ |
| 292 | int bootflow_next_glob(struct bootflow **bflowp); |
| 293 | |
| 294 | /** |
| 295 | * bootflow_free() - Free memory used by a bootflow |
| 296 | * |
| 297 | * This frees fields within @bflow, but not the @bflow pointer itself |
| 298 | */ |
| 299 | void bootflow_free(struct bootflow *bflow); |
| 300 | |
| 301 | /** |
| 302 | * bootflow_boot() - boot a bootflow |
| 303 | * |
| 304 | * @bflow: Bootflow to boot |
| 305 | * Return: -EPROTO if bootflow has not been loaded, -ENOSYS if the bootflow |
| 306 | * type is not supported, -EFAULT if the boot returned without an error |
| 307 | * when we are expecting it to boot, -ENOTSUPP if trying method resulted in |
| 308 | * finding out that is not actually supported for this boot and should not |
| 309 | * be tried again unless something changes |
| 310 | */ |
| 311 | int bootflow_boot(struct bootflow *bflow); |
| 312 | |
| 313 | /** |
| 314 | * bootflow_run_boot() - Try to boot a bootflow |
| 315 | * |
| 316 | * @iter: Current iteration (or NULL if none). Used to disable a bootmeth if the |
| 317 | * boot returns -ENOTSUPP |
| 318 | * @bflow: Bootflow to boot |
| 319 | * Return: result of trying to boot |
| 320 | */ |
| 321 | int bootflow_run_boot(struct bootflow_iter *iter, struct bootflow *bflow); |
| 322 | |
| 323 | /** |
| 324 | * bootflow_state_get_name() - Get the name of a bootflow state |
| 325 | * |
| 326 | * @state: State to check |
| 327 | * Return: name, or "?" if invalid |
| 328 | */ |
| 329 | const char *bootflow_state_get_name(enum bootflow_state_t state); |
| 330 | |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 331 | /** |
| 332 | * bootflow_remove() - Remove a bootflow and free its memory |
| 333 | * |
| 334 | * This updates the linked lists containing the bootflow then frees it. |
| 335 | * |
| 336 | * @bflow: Bootflow to remove |
| 337 | */ |
| 338 | void bootflow_remove(struct bootflow *bflow); |
| 339 | |
| 340 | /** |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 341 | * bootflow_iter_check_blk() - Check that a bootflow uses a block device |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 342 | * |
| 343 | * This checks the bootdev in the bootflow to make sure it uses a block device |
| 344 | * |
| 345 | * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. ethernet) |
| 346 | */ |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 347 | int bootflow_iter_check_blk(const struct bootflow_iter *iter); |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 348 | |
| 349 | /** |
Simon Glass | 215be68 | 2023-01-17 10:48:03 -0700 | [diff] [blame] | 350 | * bootflow_iter_check_sf() - Check that a bootflow uses SPI FLASH |
| 351 | * |
| 352 | * This checks the bootdev in the bootflow to make sure it uses SPI flash |
| 353 | * |
| 354 | * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. ethernet) |
| 355 | */ |
| 356 | int bootflow_iter_check_sf(const struct bootflow_iter *iter); |
| 357 | |
| 358 | /** |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 359 | * bootflow_iter_check_net() - Check that a bootflow uses a network device |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 360 | * |
| 361 | * This checks the bootdev in the bootflow to make sure it uses a network |
| 362 | * device |
| 363 | * |
| 364 | * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC) |
| 365 | */ |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 366 | int bootflow_iter_check_net(const struct bootflow_iter *iter); |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 367 | |
| 368 | /** |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 369 | * bootflow_iter_check_system() - Check that a bootflow uses the bootstd device |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 370 | * |
| 371 | * This checks the bootdev in the bootflow to make sure it uses the bootstd |
| 372 | * device |
| 373 | * |
| 374 | * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC) |
| 375 | */ |
Simon Glass | 18c5040 | 2023-01-17 10:47:54 -0700 | [diff] [blame] | 376 | int bootflow_iter_check_system(const struct bootflow_iter *iter); |
Simon Glass | 03fcbf9 | 2022-04-24 23:31:09 -0600 | [diff] [blame] | 377 | |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 378 | /** |
| 379 | * bootflow_menu_new() - Create a new bootflow menu |
| 380 | * |
| 381 | * @expp: Returns the expo created |
| 382 | * Returns 0 on success, -ve on error |
| 383 | */ |
| 384 | int bootflow_menu_new(struct expo **expp); |
| 385 | |
| 386 | /** |
Simon Glass | d92bcc4 | 2023-01-06 08:52:42 -0600 | [diff] [blame] | 387 | * bootflow_menu_apply_theme() - Apply a theme to a bootmenu |
| 388 | * |
| 389 | * @exp: Expo to update |
| 390 | * @node: Node containing the theme information |
| 391 | * Returns 0 on success, -ve on error |
| 392 | */ |
| 393 | int bootflow_menu_apply_theme(struct expo *exp, ofnode node); |
| 394 | |
| 395 | /** |
Simon Glass | 0a2f6a3 | 2023-01-06 08:52:40 -0600 | [diff] [blame] | 396 | * bootflow_menu_run() - Create and run a menu of available bootflows |
| 397 | * |
| 398 | * @std: Bootstd information |
| 399 | * @text_mode: Uses a text-based menu suitable for a serial port |
| 400 | * @bflowp: Returns chosen bootflow (set to NULL if nothing is chosen) |
| 401 | * @return 0 if an option was chosen, -EAGAIN if nothing was chosen, -ve on |
| 402 | * error |
| 403 | */ |
| 404 | int bootflow_menu_run(struct bootstd_priv *std, bool text_mode, |
| 405 | struct bootflow **bflowp); |
| 406 | |
Simon Glass | a16d87d | 2022-04-24 23:31:05 -0600 | [diff] [blame] | 407 | #endif |