00001 /* 00002 * (C) Copyright 2000-2005 00003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 00004 * 00005 * See file CREDITS for list of people who contributed to this 00006 * project. 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License along 00019 * with this program; if not, write to the Free Software Foundation, Inc. 00020 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00021 * 00022 ******************************************************************** 00023 * NOTE: This header file defines an interface to U-Boot. Including 00024 * this (unmodified) header file in another file is considered normal 00025 * use of U-Boot, and does *not* fall under the heading of "derived 00026 * work". 00027 ******************************************************************** 00028 */ 00029 00030 #ifndef __UBOOT_IMAGE_H__ 00031 #define __UBOOT_IMAGE_H__ 00032 00033 /* 00034 * Operating System Codes 00035 */ 00036 #define IH_OS_INVALID 0 /* Invalid OS */ 00037 #define IH_OS_OPENBSD 1 /* OpenBSD */ 00038 #define IH_OS_NETBSD 2 /* NetBSD */ 00039 #define IH_OS_FREEBSD 3 /* FreeBSD */ 00040 #define IH_OS_4_4BSD 4 /* 4.4BSD */ 00041 #define IH_OS_LINUX 5 /* Linux */ 00042 #define IH_OS_SVR4 6 /* SVR4 */ 00043 #define IH_OS_ESIX 7 /* Esix */ 00044 #define IH_OS_SOLARIS 8 /* Solaris */ 00045 #define IH_OS_IRIX 9 /* Irix */ 00046 #define IH_OS_SCO 10 /* SCO */ 00047 #define IH_OS_DELL 11 /* Dell */ 00048 #define IH_OS_NCR 12 /* NCR */ 00049 #define IH_OS_LYNXOS 13 /* LynxOS */ 00050 #define IH_OS_VXWORKS 14 /* VxWorks */ 00051 #define IH_OS_PSOS 15 /* pSOS */ 00052 #define IH_OS_QNX 16 /* QNX */ 00053 #define IH_OS_U_BOOT 17 /* Firmware */ 00054 #define IH_OS_RTEMS 18 /* RTEMS */ 00055 #define IH_OS_ARTOS 19 /* ARTOS */ 00056 #define IH_OS_UNITY 20 /* Unity OS */ 00057 00058 /* 00059 * CPU Architecture Codes (supported by Linux) 00060 */ 00061 #define IH_CPU_INVALID 0 /* Invalid CPU */ 00062 #define IH_CPU_ALPHA 1 /* Alpha */ 00063 #define IH_CPU_ARM 2 /* ARM */ 00064 #define IH_CPU_I386 3 /* Intel x86 */ 00065 #define IH_CPU_IA64 4 /* IA64 */ 00066 #define IH_CPU_MIPS 5 /* MIPS */ 00067 #define IH_CPU_MIPS64 6 /* MIPS 64 Bit */ 00068 #define IH_CPU_PPC 7 /* PowerPC */ 00069 #define IH_CPU_S390 8 /* IBM S390 */ 00070 #define IH_CPU_SH 9 /* SuperH */ 00071 #define IH_CPU_SPARC 10 /* Sparc */ 00072 #define IH_CPU_SPARC64 11 /* Sparc 64 Bit */ 00073 #define IH_CPU_M68K 12 /* M68K */ 00074 #define IH_CPU_NIOS 13 /* Nios-32 */ 00075 #define IH_CPU_MICROBLAZE 14 /* MicroBlaze */ 00076 #define IH_CPU_NIOS2 15 /* Nios-II */ 00077 #define IH_CPU_BLACKFIN 16 /* Blackfin */ 00078 #define IH_CPU_AVR32 17 /* AVR32 */ 00079 00080 /* 00081 * Image Types 00082 * 00083 * "Standalone Programs" are directly runnable in the environment 00084 * provided by U-Boot; it is expected that (if they behave 00085 * well) you can continue to work in U-Boot after return from 00086 * the Standalone Program. 00087 * "OS Kernel Images" are usually images of some Embedded OS which 00088 * will take over control completely. Usually these programs 00089 * will install their own set of exception handlers, device 00090 * drivers, set up the MMU, etc. - this means, that you cannot 00091 * expect to re-enter U-Boot except by resetting the CPU. 00092 * "RAMDisk Images" are more or less just data blocks, and their 00093 * parameters (address, size) are passed to an OS kernel that is 00094 * being started. 00095 * "Multi-File Images" contain several images, typically an OS 00096 * (Linux) kernel image and one or more data images like 00097 * RAMDisks. This construct is useful for instance when you want 00098 * to boot over the network using BOOTP etc., where the boot 00099 * server provides just a single image file, but you want to get 00100 * for instance an OS kernel and a RAMDisk image. 00101 * 00102 * "Multi-File Images" start with a list of image sizes, each 00103 * image size (in bytes) specified by an "uint32_t" in network 00104 * byte order. This list is terminated by an "(uint32_t)0". 00105 * Immediately after the terminating 0 follow the images, one by 00106 * one, all aligned on "uint32_t" boundaries (size rounded up to 00107 * a multiple of 4 bytes - except for the last file). 00108 * 00109 * "Firmware Images" are binary images containing firmware (like 00110 * U-Boot or FPGA images) which usually will be programmed to 00111 * flash memory. 00112 * 00113 * "Script files" are command sequences that will be executed by 00114 * U-Boot's command interpreter; this feature is especially 00115 * useful when you configure U-Boot to use a real shell (hush) 00116 * as command interpreter (=> Shell Scripts). 00117 */ 00118 00119 #define IH_TYPE_INVALID 0 /* Invalid Image */ 00120 #define IH_TYPE_STANDALONE 1 /* Standalone Program */ 00121 #define IH_TYPE_KERNEL 2 /* OS Kernel Image */ 00122 #define IH_TYPE_RAMDISK 3 /* RAMDisk Image */ 00123 #define IH_TYPE_MULTI 4 /* Multi-File Image */ 00124 #define IH_TYPE_FIRMWARE 5 /* Firmware Image */ 00125 #define IH_TYPE_SCRIPT 6 /* Script file */ 00126 #define IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */ 00127 #define IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ 00128 00129 /* 00130 * Compression Types 00131 */ 00132 #define IH_COMP_NONE 0 /* No Compression Used */ 00133 #define IH_COMP_GZIP 1 /* gzip Compression Used */ 00134 #define IH_COMP_BZIP2 2 /* bzip2 Compression Used */ 00135 00136 #define IH_MAGIC 0x27051956 /* Image Magic Number */ 00137 #define IH_NMLEN 32 /* Image Name Length */ 00138 00139 /* 00140 * all data in network byte order (aka natural aka bigendian) 00141 */ 00142 00143 typedef struct uboot_image_header { 00144 uint32_t ih_magic; /* Image Header Magic Number */ 00145 uint32_t ih_hcrc; /* Image Header CRC Checksum */ 00146 uint32_t ih_time; /* Image Creation Timestamp */ 00147 uint32_t ih_size; /* Image Data Size */ 00148 uint32_t ih_load; /* Data Load Address */ 00149 uint32_t ih_ep; /* Entry Point Address */ 00150 uint32_t ih_dcrc; /* Image Data CRC Checksum */ 00151 uint8_t ih_os; /* Operating System */ 00152 uint8_t ih_arch; /* CPU architecture */ 00153 uint8_t ih_type; /* Image Type */ 00154 uint8_t ih_comp; /* Compression Type */ 00155 uint8_t ih_name[IH_NMLEN]; /* Image Name */ 00156 } uboot_image_header_t; 00157 00158 00159 #endif /* __IMAGE_H__ */