bootm.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2000-2009
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #ifndef _BOOTM_H
  7. #define _BOOTM_H
  8. #include <command.h>
  9. #include <image.h>
  10. #define BOOTM_ERR_RESET (-1)
  11. #define BOOTM_ERR_OVERLAP (-2)
  12. #define BOOTM_ERR_UNIMPLEMENTED (-3)
  13. /*
  14. * Continue booting an OS image; caller already has:
  15. * - copied image header to global variable `header'
  16. * - checked header magic number, checksums (both header & image),
  17. * - verified image architecture (PPC) and type (KERNEL or MULTI),
  18. * - loaded (first part of) image to header load address,
  19. * - disabled interrupts.
  20. *
  21. * @flag: Flags indicating what to do (BOOTM_STATE_...)
  22. * @argc: Number of arguments. Note that the arguments are shifted down
  23. * so that 0 is the first argument not processed by U-Boot, and
  24. * argc is adjusted accordingly. This avoids confusion as to how
  25. * many arguments are available for the OS.
  26. * @images: Pointers to os/initrd/fdt
  27. * @return 1 on error. On success the OS boots so this function does
  28. * not return.
  29. */
  30. typedef int boot_os_fn(int flag, int argc, char * const argv[],
  31. bootm_headers_t *images);
  32. extern boot_os_fn do_bootm_linux;
  33. extern boot_os_fn do_bootm_vxworks;
  34. int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
  35. void lynxkdi_boot(image_header_t *hdr);
  36. boot_os_fn *bootm_os_get_boot_func(int os);
  37. #if defined(CONFIG_FIT_SIGNATURE)
  38. int bootm_host_load_images(const void *fit, int cfg_noffset);
  39. #endif
  40. int boot_selected_os(int argc, char * const argv[], int state,
  41. bootm_headers_t *images, boot_os_fn *boot_fn);
  42. ulong bootm_disable_interrupts(void);
  43. /* This is a special function used by booti/bootz */
  44. int bootm_find_images(int flag, int argc, char * const argv[]);
  45. int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
  46. int states, bootm_headers_t *images, int boot_progress);
  47. void arch_preboot_os(void);
  48. /*
  49. * boards should define this to disable devices when EFI exits from boot
  50. * services.
  51. *
  52. * TODO(sjg@chromium.org>): Update this to use driver model's device_remove().
  53. */
  54. void board_quiesce_devices(void);
  55. /**
  56. * switch_to_non_secure_mode() - switch to non-secure mode
  57. */
  58. void switch_to_non_secure_mode(void);
  59. #endif