CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
uboot_image_format.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bootm_headers
struct  image_header
struct  image_info
struct  table_entry

Macros

#define BOOTM_STATE_FDT   (0x00000008)
#define BOOTM_STATE_LOADOS   (0x00000002)
#define BOOTM_STATE_OS_BD_T   (0x00000020)
#define BOOTM_STATE_OS_CMDLINE   (0x00000010)
#define BOOTM_STATE_OS_GO   (0x00000080)
#define BOOTM_STATE_OS_PREP   (0x00000040)
#define BOOTM_STATE_RAMDISK   (0x00000004)
#define BOOTM_STATE_START   (0x00000001)
#define CHUNKSZ   (64 * 1024)
#define CHUNKSZ_CRC32   (64 * 1024)
#define CHUNKSZ_MD5   (64 * 1024)
#define CHUNKSZ_SHA1   (64 * 1024)
#define cpu_to_uimage(x)   cpu_to_be32(x)
#define IH_ARCH_ALPHA   1 /* Alpha */
#define IH_ARCH_ARM   2 /* ARM */
#define IH_ARCH_AVR32   17 /* AVR32 */
#define IH_ARCH_BLACKFIN   16 /* Blackfin */
#define IH_ARCH_I386   3 /* Intel x86 */
#define IH_ARCH_IA64   4 /* IA64 */
#define IH_ARCH_INVALID   0 /* Invalid CPU */
#define IH_ARCH_M68K   12 /* M68K */
#define IH_ARCH_MICROBLAZE   14 /* MicroBlaze */
#define IH_ARCH_MIPS   5 /* MIPS */
#define IH_ARCH_MIPS64   6 /* MIPS 64 Bit */
#define IH_ARCH_NDS32   20 /* ANDES Technology - NDS32 */
#define IH_ARCH_NIOS2   15 /* Nios-II */
#define IH_ARCH_OPENRISC   21 /* OpenRISC 1000 */
#define IH_ARCH_PPC   7 /* PowerPC */
#define IH_ARCH_S390   8 /* IBM S390 */
#define IH_ARCH_SANDBOX   19 /* Sandbox architecture (test only) */
#define IH_ARCH_SH   9 /* SuperH */
#define IH_ARCH_SPARC   10 /* Sparc */
#define IH_ARCH_SPARC64   11 /* Sparc 64 Bit */
#define IH_ARCH_ST200   18 /* STMicroelectronics ST200 */
#define IH_COMP_BZIP2   2 /* bzip2 Compression Used */
#define IH_COMP_GZIP   1 /* gzip Compression Used */
#define IH_COMP_LZMA   3 /* lzma Compression Used */
#define IH_COMP_LZO   4 /* lzo Compression Used */
#define IH_COMP_NONE   0 /* No Compression Used */
#define IH_MAGIC   0x27051956 /* Image Magic Number */
#define IH_NMLEN   32 /* Image Name Length */
#define IH_OS_4_4BSD   4 /* 4.4BSD */
#define IH_OS_ARTOS   19 /* ARTOS */
#define IH_OS_DELL   11 /* Dell */
#define IH_OS_ESIX   7 /* Esix */
#define IH_OS_FREEBSD   3 /* FreeBSD */
#define IH_OS_INTEGRITY   21 /* INTEGRITY */
#define IH_OS_INVALID   0 /* Invalid OS */
#define IH_OS_IRIX   9 /* Irix */
#define IH_OS_LINUX   5 /* Linux */
#define IH_OS_LYNXOS   13 /* LynxOS */
#define IH_OS_NCR   12 /* NCR */
#define IH_OS_NETBSD   2 /* NetBSD */
#define IH_OS_OPENBSD   1 /* OpenBSD */
#define IH_OS_OSE   22 /* OSE */
#define IH_OS_PSOS   15 /* pSOS */
#define IH_OS_QNX   16 /* QNX */
#define IH_OS_RTEMS   18 /* RTEMS */
#define IH_OS_SCO   10 /* SCO */
#define IH_OS_SOLARIS   8 /* Solaris */
#define IH_OS_SVR4   6 /* SVR4 */
#define IH_OS_U_BOOT   17 /* Firmware */
#define IH_OS_UNITY   20 /* Unity OS */
#define IH_OS_VXWORKS   14 /* VxWorks */
#define IH_TYPE_AISIMAGE   13 /* TI Davinci AIS Image */
#define IH_TYPE_FILESYSTEM   7 /* Filesystem Image (any type) */
#define IH_TYPE_FIRMWARE   5 /* Firmware Image */
#define IH_TYPE_FLATDT   8 /* Binary Flat Device Tree Blob */
#define IH_TYPE_IMXIMAGE   10 /* Freescale IMXBoot Image */
#define IH_TYPE_INVALID   0 /* Invalid Image */
#define IH_TYPE_KERNEL   2 /* OS Kernel Image */
#define IH_TYPE_KERNEL_NOLOAD   14 /* OS Kernel Image, can run from any load address */
#define IH_TYPE_KWBIMAGE   9 /* Kirkwood Boot Image */
#define IH_TYPE_MULTI   4 /* Multi-File Image */
#define IH_TYPE_OMAPIMAGE   12 /* TI OMAP Config Header Image */
#define IH_TYPE_PBLIMAGE   15 /* Freescale PBL Boot Image */
#define IH_TYPE_RAMDISK   3 /* RAMDisk Image */
#define IH_TYPE_SCRIPT   6 /* Script file */
#define IH_TYPE_STANDALONE   1 /* Standalone Program */
#define IH_TYPE_UBLIMAGE   11 /* Davinci UBL Image */
#define IMAGE_FORMAT_FIT   0x02 /* new, libfdt based format */
#define IMAGE_FORMAT_INVALID   0x00
#define IMAGE_FORMAT_LEGACY   0x01 /* legacy image_header based format */
#define image_get_hdr_b(f)
#define image_get_hdr_l(f)
#define image_set_hdr_b(f)
#define image_set_hdr_l(f)
#define uimage_to_cpu(x)   be32_to_cpu(x)

Typedefs

typedef struct bootm_headers bootm_headers_t
typedef struct image_header image_header_t
typedef struct image_info image_info_t
typedef struct table_entry table_entry_t

Functions

int boot_get_ramdisk (int argc, char *const argv[], bootm_headers_t *images, uint8_t arch, ulong *rd_start, ulong *rd_end)
int genimg_get_arch_id (const char *name)
const char * genimg_get_arch_name (uint8_t arch)
int genimg_get_comp_id (const char *name)
const char * genimg_get_comp_name (uint8_t comp)
int genimg_get_format (void *img_addr)
ulong genimg_get_image (ulong img_addr)
int genimg_get_os_id (const char *name)
const char * genimg_get_os_name (uint8_t os)
int genimg_get_type_id (const char *name)
const char * genimg_get_type_name (uint8_t type)
int genimg_has_config (bootm_headers_t *images)
void genimg_print_size (uint32_t size)
int get_table_entry_id (const table_entry_t *table, const char *table_name, const char *name)
char * get_table_entry_name (const table_entry_t *table, char *msg, int id)
ulong getenv_bootm_low (void)
phys_size_t getenv_bootm_mapsize (void)
phys_size_t getenv_bootm_size (void)
int getenv_yesno (char *var)
static int image_check_arch (const image_header_t *hdr, uint8_t arch)
int image_check_dcrc (const image_header_t *hdr)
static int image_check_magic (const image_header_t *hdr)
static int image_check_os (const image_header_t *hdr, uint8_t os)
static int image_check_target_arch (const image_header_t *hdr)
static int image_check_type (const image_header_t *hdr, uint8_t type)
static ulong image_get_data (const image_header_t *hdr)
 image_get_data - get image payload start address : image header
static uint32_t image_get_data_size (const image_header_t *hdr)
 image_get_hdr_l (magic) image_get_hdr_l(hcrc) image_get_hdr_l(time) image_get_hdr_l(size) image_get_hdr_l(load) image_get_hdr_l(ep) image_get_hdr_l(dcrc) image_get_hdr_b(os) image_get_hdr_b(arch) image_get_hdr_b(type) image_get_hdr_b(comp) static inline char *image_get_name(const image_header_t *hdr)
static uint32_t image_get_header_size (void)
static ulong image_get_image_end (const image_header_t *hdr)
static uint32_t image_get_image_size (const image_header_t *hdr)
ulong image_multi_count (const image_header_t *hdr)
void image_multi_getimg (const image_header_t *hdr, ulong idx, ulong *data, ulong *len)
void image_print_contents (const void *hdr)
 image_set_hdr_l (magic) image_set_hdr_l(hcrc) image_set_hdr_l(time) image_set_hdr_l(size) image_set_hdr_l(load) image_set_hdr_l(ep) image_set_hdr_l(dcrc) image_set_hdr_b(os) image_set_hdr_b(arch) image_set_hdr_b(type) image_set_hdr_b(comp) static inline void image_set_name(image_header_t *hdr
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)

Variables

bootm_headers_t images

Macro Definition Documentation

#define BOOTM_STATE_FDT   (0x00000008)

Definition at line 260 of file uboot_image_format.h.

#define BOOTM_STATE_LOADOS   (0x00000002)

Definition at line 258 of file uboot_image_format.h.

#define BOOTM_STATE_OS_BD_T   (0x00000020)

Definition at line 262 of file uboot_image_format.h.

#define BOOTM_STATE_OS_CMDLINE   (0x00000010)

Definition at line 261 of file uboot_image_format.h.

#define BOOTM_STATE_OS_GO   (0x00000080)

Definition at line 264 of file uboot_image_format.h.

#define BOOTM_STATE_OS_PREP   (0x00000040)

Definition at line 263 of file uboot_image_format.h.

#define BOOTM_STATE_RAMDISK   (0x00000004)

Definition at line 259 of file uboot_image_format.h.

#define BOOTM_STATE_START   (0x00000001)

Definition at line 257 of file uboot_image_format.h.

#define CHUNKSZ   (64 * 1024)

Definition at line 280 of file uboot_image_format.h.

#define CHUNKSZ_CRC32   (64 * 1024)

Definition at line 284 of file uboot_image_format.h.

#define CHUNKSZ_MD5   (64 * 1024)

Definition at line 288 of file uboot_image_format.h.

#define CHUNKSZ_SHA1   (64 * 1024)

Definition at line 292 of file uboot_image_format.h.

#define cpu_to_uimage (   x)    cpu_to_be32(x)

Definition at line 296 of file uboot_image_format.h.

#define IH_ARCH_ALPHA   1 /* Alpha */

Definition at line 92 of file uboot_image_format.h.

#define IH_ARCH_ARM   2 /* ARM */

Definition at line 93 of file uboot_image_format.h.

#define IH_ARCH_AVR32   17 /* AVR32 */

Definition at line 107 of file uboot_image_format.h.

#define IH_ARCH_BLACKFIN   16 /* Blackfin */

Definition at line 106 of file uboot_image_format.h.

#define IH_ARCH_I386   3 /* Intel x86 */

Definition at line 94 of file uboot_image_format.h.

#define IH_ARCH_IA64   4 /* IA64 */

Definition at line 95 of file uboot_image_format.h.

#define IH_ARCH_INVALID   0 /* Invalid CPU */

Definition at line 91 of file uboot_image_format.h.

#define IH_ARCH_M68K   12 /* M68K */

Definition at line 103 of file uboot_image_format.h.

#define IH_ARCH_MICROBLAZE   14 /* MicroBlaze */

Definition at line 104 of file uboot_image_format.h.

#define IH_ARCH_MIPS   5 /* MIPS */

Definition at line 96 of file uboot_image_format.h.

#define IH_ARCH_MIPS64   6 /* MIPS 64 Bit */

Definition at line 97 of file uboot_image_format.h.

#define IH_ARCH_NDS32   20 /* ANDES Technology - NDS32 */

Definition at line 110 of file uboot_image_format.h.

#define IH_ARCH_NIOS2   15 /* Nios-II */

Definition at line 105 of file uboot_image_format.h.

#define IH_ARCH_OPENRISC   21 /* OpenRISC 1000 */

Definition at line 111 of file uboot_image_format.h.

#define IH_ARCH_PPC   7 /* PowerPC */

Definition at line 98 of file uboot_image_format.h.

#define IH_ARCH_S390   8 /* IBM S390 */

Definition at line 99 of file uboot_image_format.h.

#define IH_ARCH_SANDBOX   19 /* Sandbox architecture (test only) */

Definition at line 109 of file uboot_image_format.h.

#define IH_ARCH_SH   9 /* SuperH */

Definition at line 100 of file uboot_image_format.h.

#define IH_ARCH_SPARC   10 /* Sparc */

Definition at line 101 of file uboot_image_format.h.

#define IH_ARCH_SPARC64   11 /* Sparc 64 Bit */

Definition at line 102 of file uboot_image_format.h.

#define IH_ARCH_ST200   18 /* STMicroelectronics ST200 */

Definition at line 108 of file uboot_image_format.h.

#define IH_COMP_BZIP2   2 /* bzip2 Compression Used */

Definition at line 174 of file uboot_image_format.h.

#define IH_COMP_GZIP   1 /* gzip Compression Used */

Definition at line 173 of file uboot_image_format.h.

#define IH_COMP_LZMA   3 /* lzma Compression Used */

Definition at line 175 of file uboot_image_format.h.

#define IH_COMP_LZO   4 /* lzo Compression Used */

Definition at line 176 of file uboot_image_format.h.

Referenced by uboot_file_load().

#define IH_COMP_NONE   0 /* No Compression Used */

Definition at line 172 of file uboot_image_format.h.

Referenced by uboot_file_load().

#define IH_MAGIC   0x27051956 /* Image Magic Number */

Definition at line 178 of file uboot_image_format.h.

Referenced by image_check_magic(), and memmem_magic_number().

#define IH_NMLEN   32 /* Image Name Length */

Definition at line 179 of file uboot_image_format.h.

#define IH_OS_4_4BSD   4 /* 4.4BSD */

Definition at line 68 of file uboot_image_format.h.

#define IH_OS_ARTOS   19 /* ARTOS */

Definition at line 83 of file uboot_image_format.h.

#define IH_OS_DELL   11 /* Dell */

Definition at line 75 of file uboot_image_format.h.

#define IH_OS_ESIX   7 /* Esix */

Definition at line 71 of file uboot_image_format.h.

#define IH_OS_FREEBSD   3 /* FreeBSD */

Definition at line 67 of file uboot_image_format.h.

#define IH_OS_INTEGRITY   21 /* INTEGRITY */

Definition at line 85 of file uboot_image_format.h.

#define IH_OS_INVALID   0 /* Invalid OS */

Definition at line 64 of file uboot_image_format.h.

#define IH_OS_IRIX   9 /* Irix */

Definition at line 73 of file uboot_image_format.h.

#define IH_OS_LINUX   5 /* Linux */

Definition at line 69 of file uboot_image_format.h.

#define IH_OS_LYNXOS   13 /* LynxOS */

Definition at line 77 of file uboot_image_format.h.

#define IH_OS_NCR   12 /* NCR */

Definition at line 76 of file uboot_image_format.h.

#define IH_OS_NETBSD   2 /* NetBSD */

Definition at line 66 of file uboot_image_format.h.

#define IH_OS_OPENBSD   1 /* OpenBSD */

Definition at line 65 of file uboot_image_format.h.

#define IH_OS_OSE   22 /* OSE */

Definition at line 86 of file uboot_image_format.h.

#define IH_OS_PSOS   15 /* pSOS */

Definition at line 79 of file uboot_image_format.h.

#define IH_OS_QNX   16 /* QNX */

Definition at line 80 of file uboot_image_format.h.

#define IH_OS_RTEMS   18 /* RTEMS */

Definition at line 82 of file uboot_image_format.h.

#define IH_OS_SCO   10 /* SCO */

Definition at line 74 of file uboot_image_format.h.

#define IH_OS_SOLARIS   8 /* Solaris */

Definition at line 72 of file uboot_image_format.h.

#define IH_OS_SVR4   6 /* SVR4 */

Definition at line 70 of file uboot_image_format.h.

#define IH_OS_U_BOOT   17 /* Firmware */

Definition at line 81 of file uboot_image_format.h.

#define IH_OS_UNITY   20 /* Unity OS */

Definition at line 84 of file uboot_image_format.h.

#define IH_OS_VXWORKS   14 /* VxWorks */

Definition at line 78 of file uboot_image_format.h.

#define IH_TYPE_AISIMAGE   13 /* TI Davinci AIS Image */

Definition at line 165 of file uboot_image_format.h.

#define IH_TYPE_FILESYSTEM   7 /* Filesystem Image (any type) */

Definition at line 159 of file uboot_image_format.h.

#define IH_TYPE_FIRMWARE   5 /* Firmware Image */

Definition at line 157 of file uboot_image_format.h.

#define IH_TYPE_FLATDT   8 /* Binary Flat Device Tree Blob */

Definition at line 160 of file uboot_image_format.h.

#define IH_TYPE_IMXIMAGE   10 /* Freescale IMXBoot Image */

Definition at line 162 of file uboot_image_format.h.

#define IH_TYPE_INVALID   0 /* Invalid Image */

Definition at line 152 of file uboot_image_format.h.

#define IH_TYPE_KERNEL   2 /* OS Kernel Image */

Definition at line 154 of file uboot_image_format.h.

#define IH_TYPE_KERNEL_NOLOAD   14 /* OS Kernel Image, can run from any load address */

Definition at line 166 of file uboot_image_format.h.

#define IH_TYPE_KWBIMAGE   9 /* Kirkwood Boot Image */

Definition at line 161 of file uboot_image_format.h.

#define IH_TYPE_MULTI   4 /* Multi-File Image */

Definition at line 156 of file uboot_image_format.h.

#define IH_TYPE_OMAPIMAGE   12 /* TI OMAP Config Header Image */

Definition at line 164 of file uboot_image_format.h.

#define IH_TYPE_PBLIMAGE   15 /* Freescale PBL Boot Image */

Definition at line 167 of file uboot_image_format.h.

#define IH_TYPE_RAMDISK   3 /* RAMDisk Image */

Definition at line 155 of file uboot_image_format.h.

#define IH_TYPE_SCRIPT   6 /* Script file */

Definition at line 158 of file uboot_image_format.h.

#define IH_TYPE_STANDALONE   1 /* Standalone Program */

Definition at line 153 of file uboot_image_format.h.

#define IH_TYPE_UBLIMAGE   11 /* Davinci UBL Image */

Definition at line 163 of file uboot_image_format.h.

#define IMAGE_FORMAT_FIT   0x02 /* new, libfdt based format */

Definition at line 336 of file uboot_image_format.h.

#define IMAGE_FORMAT_INVALID   0x00

Definition at line 334 of file uboot_image_format.h.

#define IMAGE_FORMAT_LEGACY   0x01 /* legacy image_header based format */

Definition at line 335 of file uboot_image_format.h.

#define image_get_hdr_b (   f)
Value:
static inline uint8_t image_get_##f(const image_header_t *hdr) \
{ \
return hdr->ih_##f; \
}

Referenced by image_get_hdr_l().

#define image_get_hdr_l (   f)
Value:
static inline uint32_t image_get_##f(const image_header_t *hdr) \
{ \
return uimage_to_cpu(hdr->ih_##f); \
}

Definition at line 373 of file uboot_image_format.h.

#define image_set_hdr_b (   f)
Value:
static inline void image_set_##f(image_header_t *hdr, uint8_t val) \
{ \
hdr->ih_##f = val; \
}
#define image_set_hdr_l (   f)
Value:
static inline void image_set_##f(image_header_t *hdr, uint32_t val) \
{ \
hdr->ih_##f = cpu_to_uimage(val); \
}

Definition at line 431 of file uboot_image_format.h.

#define uimage_to_cpu (   x)    be32_to_cpu(x)

Definition at line 295 of file uboot_image_format.h.

Typedef Documentation

typedef struct image_header image_header_t
typedef struct image_info image_info_t
typedef struct table_entry table_entry_t

Function Documentation

int boot_get_ramdisk ( int  argc,
char *const  argv[],
bootm_headers_t images,
uint8_t  arch,
ulong rd_start,
ulong rd_end 
)
int genimg_get_arch_id ( const char *  name)
const char* genimg_get_arch_name ( uint8_t  arch)
int genimg_get_comp_id ( const char *  name)
const char* genimg_get_comp_name ( uint8_t  comp)
int genimg_get_format ( void *  img_addr)
ulong genimg_get_image ( ulong  img_addr)
int genimg_get_os_id ( const char *  name)
const char* genimg_get_os_name ( uint8_t  os)
int genimg_get_type_id ( const char *  name)
const char* genimg_get_type_name ( uint8_t  type)
int genimg_has_config ( bootm_headers_t images)
void genimg_print_size ( uint32_t  size)
int get_table_entry_id ( const table_entry_t table,
const char *  table_name,
const char *  name 
)
char* get_table_entry_name ( const table_entry_t table,
char *  msg,
int  id 
)
ulong getenv_bootm_low ( void  )
phys_size_t getenv_bootm_mapsize ( void  )
phys_size_t getenv_bootm_size ( void  )
int getenv_yesno ( char *  var)
static int image_check_arch ( const image_header_t hdr,
uint8_t  arch 
)
inlinestatic

Definition at line 477 of file uboot_image_format.h.

Referenced by image_check_target_arch(), and uboot_check_image_at_addr().

Here is the caller graph for this function:

int image_check_dcrc ( const image_header_t hdr)

Definition at line 187 of file uboot_file.c.

References crc32(), image_get_data(), and image_get_data_size().

Here is the call graph for this function:

static int image_check_magic ( const image_header_t hdr)
inlinestatic

Definition at line 469 of file uboot_image_format.h.

References IH_MAGIC.

Referenced by uboot_check_image_at_addr().

Here is the caller graph for this function:

static int image_check_os ( const image_header_t hdr,
uint8_t  os 
)
inlinestatic

Definition at line 481 of file uboot_image_format.h.

static int image_check_target_arch ( const image_header_t hdr)
inlinestatic

Definition at line 493 of file uboot_image_format.h.

References IH_ARCH_DEFAULT, and image_check_arch().

Here is the call graph for this function:

static int image_check_type ( const image_header_t hdr,
uint8_t  type 
)
inlinestatic

Definition at line 473 of file uboot_image_format.h.

static ulong image_get_data ( const image_header_t hdr)
inlinestatic

image_get_data - get image payload start address : image header

image_get_data() returns address of the image payload. For single component images it is image data start. For multi component images it points to the null terminated table of sub-images sizes.

returns: image payload data start address

Definition at line 417 of file uboot_image_format.h.

References image_get_header_size(), and ulong.

Referenced by image_check_dcrc(), and uboot_file_load().

Here is the call graph for this function:

Here is the caller graph for this function:

static uint32_t image_get_data_size ( const image_header_t hdr)
inlinestatic

Definition at line 401 of file uboot_image_format.h.

Referenced by image_check_dcrc(), and uboot_file_load().

Here is the caller graph for this function:

image_get_hdr_l ( magic  ) const

Definition at line 378 of file uboot_image_format.h.

References image_get_hdr_b.

static uint32_t image_get_header_size ( void  )
inlinestatic

Definition at line 368 of file uboot_image_format.h.

Referenced by image_check_hcrc(), image_get_data(), and image_get_image_size().

Here is the caller graph for this function:

static ulong image_get_image_end ( const image_header_t hdr)
inlinestatic

Definition at line 426 of file uboot_image_format.h.

References image_get_image_size(), and ulong.

Here is the call graph for this function:

static uint32_t image_get_image_size ( const image_header_t hdr)
inlinestatic

Definition at line 422 of file uboot_image_format.h.

References image_get_header_size().

Referenced by image_get_image_end().

Here is the call graph for this function:

Here is the caller graph for this function:

ulong image_multi_count ( const image_header_t hdr)
void image_multi_getimg ( const image_header_t hdr,
ulong  idx,
ulong data,
ulong len 
)
void image_print_contents ( const void *  hdr)
image_set_hdr_l ( magic  )
void memmove_wd ( void *  to,
void *  from,
size_t  len,
ulong  chunksz 
)

Variable Documentation