bootm.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * (C) Copyright 2000-2009
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _BOOTM_H
  8. #define _BOOTM_H
  9. #include <command.h>
  10. #include <image.h>
  11. #define BOOTM_ERR_RESET (-1)
  12. #define BOOTM_ERR_OVERLAP (-2)
  13. #define BOOTM_ERR_UNIMPLEMENTED (-3)
  14. /*
  15. * Continue booting an OS image; caller already has:
  16. * - copied image header to global variable `header'
  17. * - checked header magic number, checksums (both header & image),
  18. * - verified image architecture (PPC) and type (KERNEL or MULTI),
  19. * - loaded (first part of) image to header load address,
  20. * - disabled interrupts.
  21. *
  22. * @flag: Flags indicating what to do (BOOTM_STATE_...)
  23. * @argc: Number of arguments. Note that the arguments are shifted down
  24. * so that 0 is the first argument not processed by U-Boot, and
  25. * argc is adjusted accordingly. This avoids confusion as to how
  26. * many arguments are available for the OS.
  27. * @images: Pointers to os/initrd/fdt
  28. * @return 1 on error. On success the OS boots so this function does
  29. * not return.
  30. */
  31. typedef int boot_os_fn(int flag, int argc, char * const argv[],
  32. bootm_headers_t *images);
  33. extern boot_os_fn do_bootm_linux;
  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. int bootm_host_load_images(const void *fit, int cfg_noffset);
  38. int boot_selected_os(int argc, char * const argv[], int state,
  39. bootm_headers_t *images, boot_os_fn *boot_fn);
  40. ulong bootm_disable_interrupts(void);
  41. /* This is a special function used by booti/bootz */
  42. int bootm_find_images(int flag, int argc, char * const argv[]);
  43. int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
  44. int states, bootm_headers_t *images, int boot_progress);
  45. void arch_preboot_os(void);
  46. /**
  47. * bootm_decomp_image() - decompress the operating system
  48. *
  49. * @comp: Compression algorithm that is used (IH_COMP_...)
  50. * @load: Destination load address in U-Boot memory
  51. * @image_start Image start address (where we are decompressing from)
  52. * @type: OS type (IH_OS_...)
  53. * @load_bug: Place to decompress to
  54. * @image_buf: Address to decompress from
  55. * @image_len: Number of bytes in @image_buf to decompress
  56. * @unc_len: Available space for decompression
  57. * @return 0 if OK, -ve on error (BOOTM_ERR_...)
  58. */
  59. int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
  60. void *load_buf, void *image_buf, ulong image_len,
  61. uint unc_len, ulong *load_end);
  62. #endif