1/*
2 * Copyright 2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Fran��ois Revol, revol@free.fr
7 */
8#ifndef KERNEL_BOOT_PLATFORM_UBOOT_UIMAGE_H
9#define KERNEL_BOOT_PLATFORM_UBOOT_UIMAGE_H
10
11#include <SupportDefs.h>
12
13/* same type and constant names as U-Boot */
14
15#define IH_TYPE_STANDALONE 1
16#define IH_TYPE_KERNEL 2
17#define IH_TYPE_RAMDISK 3
18#define IH_TYPE_MULTI 4
19
20#define IH_COMP_NONE 0
21
22#define IH_MAGIC 0x27051956
23#define IH_NMLEN 32
24
25typedef struct image_header {
26	uint32 ih_magic;
27	uint32 ih_hcrc;
28	uint32 ih_time;
29	uint32 ih_size;
30	uint32 ih_load;
31	uint32 ih_ep;
32	uint32 ih_dcrc;
33	uint8 ih_os;
34	uint8 ih_arch;
35	uint8 ih_type;
36	uint8 ih_comp;
37	char ih_name[IH_NMLEN];
38} image_header_t;
39
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45void dump_uimage(struct image_header *image);
46bool image_multi_getimg(struct image_header *image, uint32 idx,
47	uint32 *data, uint32 *size);
48
49#ifdef __cplusplus
50}
51#endif
52
53
54#endif	/* KERNEL_BOOT_PLATFORM_UBOOT_UIMAGE_H */
55