bootm.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 <image.h>
  9. struct cmd_tbl;
  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(struct cmd_tbl *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[], ulong start,
  45. ulong size);
  46. int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
  47. char *const argv[], int states, bootm_headers_t *images,
  48. int boot_progress);
  49. void arch_preboot_os(void);
  50. /*
  51. * boards should define this to disable devices when EFI exits from boot
  52. * services.
  53. *
  54. * TODO(sjg@chromium.org>): Update this to use driver model's device_remove().
  55. */
  56. void board_quiesce_devices(void);
  57. /**
  58. * switch_to_non_secure_mode() - switch to non-secure mode
  59. */
  60. void switch_to_non_secure_mode(void);
  61. /**
  62. * arch_preboot_os() - arch specific configuration before booting
  63. */
  64. void arch_preboot_os(void);
  65. /**
  66. * board_preboot_os() - board specific configuration before booting
  67. */
  68. void board_preboot_os(void);
  69. #endif