~ubuntu-branches/ubuntu/trusty/grub2/trusty

« back to all changes in this revision

Viewing changes to include/grub/uboot/image.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-01-16 15:18:04 UTC
  • mfrom: (17.6.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140116151804-3foouk7fpqcq3sxx
Tags: 2.02~beta2-2
* Convert patch handling to git-dpm.
* Add bi-endian support to ELF parser (Tomohiro B Berry).
* Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
  to appease "gcc -Werror=missing-prototypes".
* Cherry-pick from upstream:
  - Change grub-macbless' manual page section to 8.
* Install grub-glue-efi, grub-macbless, grub-render-label, and
  grub-syslinux2cfg.
* grub-shell: Pass -no-pad to xorriso when building floppy images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) Copyright 2008 Semihalf
 
3
 *
 
4
 * (C) Copyright 2000-2005
 
5
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
6
 *
 
7
 * See file CREDITS for list of people who contributed to this
 
8
 * project.
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or
 
11
 * modify it under the terms of the GNU General Public License as
 
12
 * published by the Free Software Foundation; either version 2 of
 
13
 * the License, or (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 
23
 * MA 02111-1307 USA
 
24
 *
 
25
 ********************************************************************
 
26
 * NOTE: This header file defines an interface to U-Boot. Including
 
27
 * this (unmodified) header file in another file is considered normal
 
28
 * use of U-Boot, and does *not* fall under the heading of "derived
 
29
 * work".
 
30
 ********************************************************************
 
31
 */
 
32
 
 
33
#ifndef __GRUB_UBOOT_IMAGE_H__
 
34
#define __GRUB_UBOOT_IMAGE_H__
 
35
 
 
36
/*
 
37
 * Operating System Codes
 
38
 */
 
39
#define GRUB_UBOOT_IH_OS_INVALID                0       /* Invalid OS   */
 
40
#define GRUB_UBOOT_IH_OS_OPENBSD                1       /* OpenBSD      */
 
41
#define GRUB_UBOOT_IH_OS_NETBSD         2       /* NetBSD       */
 
42
#define GRUB_UBOOT_IH_OS_FREEBSD                3       /* FreeBSD      */
 
43
#define GRUB_UBOOT_IH_OS_4_4BSD         4       /* 4.4BSD       */
 
44
#define GRUB_UBOOT_IH_OS_LINUX          5       /* Linux        */
 
45
#define GRUB_UBOOT_IH_OS_SVR4           6       /* SVR4         */
 
46
#define GRUB_UBOOT_IH_OS_ESIX           7       /* Esix         */
 
47
#define GRUB_UBOOT_IH_OS_SOLARIS                8       /* Solaris      */
 
48
#define GRUB_UBOOT_IH_OS_IRIX           9       /* Irix         */
 
49
#define GRUB_UBOOT_IH_OS_SCO            10      /* SCO          */
 
50
#define GRUB_UBOOT_IH_OS_DELL           11      /* Dell         */
 
51
#define GRUB_UBOOT_IH_OS_NCR            12      /* NCR          */
 
52
#define GRUB_UBOOT_IH_OS_LYNXOS         13      /* LynxOS       */
 
53
#define GRUB_UBOOT_IH_OS_VXWORKS                14      /* VxWorks      */
 
54
#define GRUB_UBOOT_IH_OS_PSOS           15      /* pSOS         */
 
55
#define GRUB_UBOOT_IH_OS_QNX            16      /* QNX          */
 
56
#define GRUB_UBOOT_IH_OS_U_BOOT         17      /* Firmware     */
 
57
#define GRUB_UBOOT_IH_OS_RTEMS          18      /* RTEMS        */
 
58
#define GRUB_UBOOT_IH_OS_ARTOS          19      /* ARTOS        */
 
59
#define GRUB_UBOOT_IH_OS_UNITY          20      /* Unity OS     */
 
60
#define GRUB_UBOOT_IH_OS_INTEGRITY              21      /* INTEGRITY    */
 
61
#define GRUB_UBOOT_IH_OS_OSE            22      /* OSE          */
 
62
 
 
63
/*
 
64
 * CPU Architecture Codes (supported by Linux)
 
65
 */
 
66
#define GRUB_UBOOT_IH_ARCH_INVALID              0       /* Invalid CPU  */
 
67
#define GRUB_UBOOT_IH_ARCH_ALPHA                1       /* Alpha        */
 
68
#define GRUB_UBOOT_IH_ARCH_ARM          2       /* ARM          */
 
69
#define GRUB_UBOOT_IH_ARCH_I386         3       /* Intel x86    */
 
70
#define GRUB_UBOOT_IH_ARCH_IA64         4       /* IA64         */
 
71
#define GRUB_UBOOT_IH_ARCH_MIPS         5       /* MIPS         */
 
72
#define GRUB_UBOOT_IH_ARCH_MIPS64               6       /* MIPS  64 Bit */
 
73
#define GRUB_UBOOT_IH_ARCH_PPC          7       /* PowerPC      */
 
74
#define GRUB_UBOOT_IH_ARCH_S390         8       /* IBM S390     */
 
75
#define GRUB_UBOOT_IH_ARCH_SH           9       /* SuperH       */
 
76
#define GRUB_UBOOT_IH_ARCH_SPARC                10      /* Sparc        */
 
77
#define GRUB_UBOOT_IH_ARCH_SPARC64              11      /* Sparc 64 Bit */
 
78
#define GRUB_UBOOT_IH_ARCH_M68K         12      /* M68K         */
 
79
#define GRUB_UBOOT_IH_ARCH_MICROBLAZE   14      /* MicroBlaze   */
 
80
#define GRUB_UBOOT_IH_ARCH_NIOS2                15      /* Nios-II      */
 
81
#define GRUB_UBOOT_IH_ARCH_BLACKFIN     16      /* Blackfin     */
 
82
#define GRUB_UBOOT_IH_ARCH_AVR32                17      /* AVR32        */
 
83
#define GRUB_UBOOT_IH_ARCH_ST200                18      /* STMicroelectronics ST200  */
 
84
#define GRUB_UBOOT_IH_ARCH_SANDBOX              19      /* Sandbox architecture (test only) */
 
85
#define GRUB_UBOOT_IH_ARCH_NDS32                20      /* ANDES Technology - NDS32  */
 
86
#define GRUB_UBOOT_IH_ARCH_OPENRISC        21   /* OpenRISC 1000  */
 
87
 
 
88
/*
 
89
 * Image Types
 
90
 *
 
91
 * "Standalone Programs" are directly runnable in the environment
 
92
 *      provided by U-Boot; it is expected that (if they behave
 
93
 *      well) you can continue to work in U-Boot after return from
 
94
 *      the Standalone Program.
 
95
 * "OS Kernel Images" are usually images of some Embedded OS which
 
96
 *      will take over control completely. Usually these programs
 
97
 *      will install their own set of exception handlers, device
 
98
 *      drivers, set up the MMU, etc. - this means, that you cannot
 
99
 *      expect to re-enter U-Boot except by resetting the CPU.
 
100
 * "RAMDisk Images" are more or less just data blocks, and their
 
101
 *      parameters (address, size) are passed to an OS kernel that is
 
102
 *      being started.
 
103
 * "Multi-File Images" contain several images, typically an OS
 
104
 *      (Linux) kernel image and one or more data images like
 
105
 *      RAMDisks. This construct is useful for instance when you want
 
106
 *      to boot over the network using BOOTP etc., where the boot
 
107
 *      server provides just a single image file, but you want to get
 
108
 *      for instance an OS kernel and a RAMDisk image.
 
109
 *
 
110
 *      "Multi-File Images" start with a list of image sizes, each
 
111
 *      image size (in bytes) specified by an "uint32_t" in network
 
112
 *      byte order. This list is terminated by an "(uint32_t)0".
 
113
 *      Immediately after the terminating 0 follow the images, one by
 
114
 *      one, all aligned on "uint32_t" boundaries (size rounded up to
 
115
 *      a multiple of 4 bytes - except for the last file).
 
116
 *
 
117
 * "Firmware Images" are binary images containing firmware (like
 
118
 *      U-Boot or FPGA images) which usually will be programmed to
 
119
 *      flash memory.
 
120
 *
 
121
 * "Script files" are command sequences that will be executed by
 
122
 *      U-Boot's command interpreter; this feature is especially
 
123
 *      useful when you configure U-Boot to use a real shell (hush)
 
124
 *      as command interpreter (=> Shell Scripts).
 
125
 */
 
126
 
 
127
#define GRUB_UBOOT_IH_TYPE_INVALID              0       /* Invalid Image                */
 
128
#define GRUB_UBOOT_IH_TYPE_STANDALONE   1       /* Standalone Program           */
 
129
#define GRUB_UBOOT_IH_TYPE_KERNEL               2       /* OS Kernel Image              */
 
130
#define GRUB_UBOOT_IH_TYPE_RAMDISK              3       /* RAMDisk Image                */
 
131
#define GRUB_UBOOT_IH_TYPE_MULTI                4       /* Multi-File Image             */
 
132
#define GRUB_UBOOT_IH_TYPE_FIRMWARE     5       /* Firmware Image               */
 
133
#define GRUB_UBOOT_IH_TYPE_SCRIPT               6       /* Script file                  */
 
134
#define GRUB_UBOOT_IH_TYPE_FILESYSTEM   7       /* Filesystem Image (any type)  */
 
135
#define GRUB_UBOOT_IH_TYPE_FLATDT               8       /* Binary Flat Device Tree Blob */
 
136
#define GRUB_UBOOT_IH_TYPE_KWBIMAGE     9       /* Kirkwood Boot Image          */
 
137
#define GRUB_UBOOT_IH_TYPE_IMXIMAGE     10      /* Freescale IMXBoot Image      */
 
138
#define GRUB_UBOOT_IH_TYPE_UBLIMAGE     11      /* Davinci UBL Image            */
 
139
#define GRUB_UBOOT_IH_TYPE_OMAPIMAGE    12      /* TI OMAP Config Header Image  */
 
140
#define GRUB_UBOOT_IH_TYPE_AISIMAGE     13      /* TI Davinci AIS Image         */
 
141
#define GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD        14      /* OS Kernel Image, can run from any load address */
 
142
#define GRUB_UBOOT_IH_TYPE_PBLIMAGE     15      /* Freescale PBL Boot Image     */
 
143
 
 
144
/*
 
145
 * Compression Types
 
146
 */
 
147
#define GRUB_UBOOT_IH_COMP_NONE         0       /*  No   Compression Used       */
 
148
#define GRUB_UBOOT_IH_COMP_GZIP         1       /* gzip  Compression Used       */
 
149
#define GRUB_UBOOT_IH_COMP_BZIP2                2       /* bzip2 Compression Used       */
 
150
#define GRUB_UBOOT_IH_COMP_LZMA         3       /* lzma  Compression Used       */
 
151
#define GRUB_UBOOT_IH_COMP_LZO          4       /* lzo   Compression Used       */
 
152
 
 
153
#define GRUB_UBOOT_IH_MAGIC     0x27051956      /* Image Magic Number           */
 
154
#define GRUB_UBOOT_IH_NMLEN             32      /* Image Name Length            */
 
155
 
 
156
/*
 
157
 * Legacy format image header,
 
158
 * all data in network byte order (aka natural aka bigendian).
 
159
 */
 
160
struct grub_uboot_image_header {
 
161
        grub_uint32_t   ih_magic;       /* Image Header Magic Number    */
 
162
        grub_uint32_t   ih_hcrc;        /* Image Header CRC Checksum    */
 
163
        grub_uint32_t   ih_time;        /* Image Creation Timestamp     */
 
164
        grub_uint32_t   ih_size;        /* Image Data Size              */
 
165
        grub_uint32_t   ih_load;        /* Data  Load  Address          */
 
166
        grub_uint32_t   ih_ep;          /* Entry Point Address          */
 
167
        grub_uint32_t   ih_dcrc;        /* Image Data CRC Checksum      */
 
168
        grub_uint8_t    ih_os;          /* Operating System             */
 
169
        grub_uint8_t    ih_arch;        /* CPU architecture             */
 
170
        grub_uint8_t    ih_type;        /* Image Type                   */
 
171
        grub_uint8_t    ih_comp;        /* Compression Type             */
 
172
        grub_uint8_t    ih_name[GRUB_UBOOT_IH_NMLEN];   /* Image Name           */
 
173
};
 
174
 
 
175
#endif  /* __IMAGE_H__ */