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