bootefi.c (5e44489bc19dad344e0019f4a6926aa5f29b4456) bootefi.c (623b3a579765f8e05723bd1eff6f8c7e56d33922)
1/*
2 * EFI application loader
3 *
4 * Copyright (c) 2016 Alexander Graf
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8

--- 271 unchanged lines hidden (view full) ---

280 /* Should never reach here, efi exits with longjmp */
281 while (1) { }
282 }
283#endif
284
285 return efi_do_enter(&loaded_image_info, &systab, entry);
286}
287
1/*
2 * EFI application loader
3 *
4 * Copyright (c) 2016 Alexander Graf
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8

--- 271 unchanged lines hidden (view full) ---

280 /* Should never reach here, efi exits with longjmp */
281 while (1) { }
282 }
283#endif
284
285 return efi_do_enter(&loaded_image_info, &systab, entry);
286}
287
288
289/* Interpreter command to boot an arbitrary EFI image from memory */
290static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
291{
292 char *saddr, *sfdt;
293 unsigned long addr, fdt_addr = 0;
294 unsigned long r;
295
296 if (argc < 2)

--- 5 unchanged lines hidden (view full) ---

302 saddr = env_get("loadaddr");
303 if (saddr)
304 addr = simple_strtoul(saddr, NULL, 16);
305 else
306 addr = CONFIG_SYS_LOAD_ADDR;
307 memcpy((char *)addr, __efi_helloworld_begin, size);
308 } else
309#endif
288/* Interpreter command to boot an arbitrary EFI image from memory */
289static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
290{
291 char *saddr, *sfdt;
292 unsigned long addr, fdt_addr = 0;
293 unsigned long r;
294
295 if (argc < 2)

--- 5 unchanged lines hidden (view full) ---

301 saddr = env_get("loadaddr");
302 if (saddr)
303 addr = simple_strtoul(saddr, NULL, 16);
304 else
305 addr = CONFIG_SYS_LOAD_ADDR;
306 memcpy((char *)addr, __efi_helloworld_begin, size);
307 } else
308#endif
309#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
310 if (!strcmp(argv[1], "selftest")) {
311 /*
312 * gd lives in a fixed register which may get clobbered while we
313 * execute the payload. So save it here and restore it on every
314 * callback entry
315 */
316 efi_save_gd();
317 /* Initialize and populate EFI object list */
318 if (!efi_obj_list_initalized)
319 efi_init_obj_list();
320 loaded_image_info.device_handle = bootefi_device_path;
321 loaded_image_info.file_path = bootefi_image_path;
322 return efi_selftest(&loaded_image_info, &systab);
323 } else
324#endif
310 {
311 saddr = argv[1];
312
313 addr = simple_strtoul(saddr, NULL, 16);
314
315 if (argc > 2) {
316 sfdt = argv[2];
317 fdt_addr = simple_strtoul(sfdt, NULL, 16);

--- 13 unchanged lines hidden (view full) ---

331
332#ifdef CONFIG_SYS_LONGHELP
333static char bootefi_help_text[] =
334 "<image address> [fdt address]\n"
335 " - boot EFI payload stored at address <image address>.\n"
336 " If specified, the device tree located at <fdt address> gets\n"
337 " exposed as EFI configuration table.\n"
338#ifdef CONFIG_CMD_BOOTEFI_HELLO
325 {
326 saddr = argv[1];
327
328 addr = simple_strtoul(saddr, NULL, 16);
329
330 if (argc > 2) {
331 sfdt = argv[2];
332 fdt_addr = simple_strtoul(sfdt, NULL, 16);

--- 13 unchanged lines hidden (view full) ---

346
347#ifdef CONFIG_SYS_LONGHELP
348static char bootefi_help_text[] =
349 "<image address> [fdt address]\n"
350 " - boot EFI payload stored at address <image address>.\n"
351 " If specified, the device tree located at <fdt address> gets\n"
352 " exposed as EFI configuration table.\n"
353#ifdef CONFIG_CMD_BOOTEFI_HELLO
339 "hello\n"
340 " - boot a sample Hello World application stored within U-Boot"
354 "bootefi hello\n"
355 " - boot a sample Hello World application stored within U-Boot\n"
341#endif
356#endif
357#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
358 "bootefi selftest\n"
359 " - boot an EFI selftest application stored within U-Boot\n"
360#endif
342 ;
343#endif
344
345U_BOOT_CMD(
346 bootefi, 3, 0, do_bootefi,
347 "Boots an EFI payload from memory",
348 bootefi_help_text
349);

--- 56 unchanged lines hidden ---
361 ;
362#endif
363
364U_BOOT_CMD(
365 bootefi, 3, 0, do_bootefi,
366 "Boots an EFI payload from memory",
367 bootefi_help_text
368);

--- 56 unchanged lines hidden ---