1/* 2 * TRX image file header format. 3 * 4 * Copyright (C) 2010, Broadcom Corporation. All Rights Reserved. 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * $Id: trxhdr.h,v 13.16.10.1 2010/09/07 19:23:08 Exp $ 19 */ 20 21#ifndef _TRX_HDR_H 22#define _TRX_HDR_H 23 24#include <typedefs.h> 25 26#define TRX_MAGIC 0x30524448 /* "HDR0" */ 27#define TRX_VERSION 1 /* Version 1 */ 28#define TRX_MAX_LEN 0x3B0000 /* Max length */ 29#define TRX_NO_HEADER 1 /* Do not write TRX header */ 30#define TRX_GZ_FILES 0x2 /* Contains up to TRX_MAX_OFFSET individual gzip files */ 31#define TRX_OVERLAYS 0x4 /* Contains an overlay header after the trx header */ 32#define TRX_MAX_OFFSET 3 /* Max number of individual files */ 33#define TRX_UNCOMP_IMAGE 0x20 /* Trx contains uncompressed rtecdc.bin image */ 34 35struct trx_header { 36 uint32 magic; /* "HDR0" */ 37 uint32 len; /* Length of file including header */ 38 uint32 crc32; /* 32-bit CRC from flag_version to end of file */ 39 uint32 flag_version; /* 0:15 flags, 16:31 version */ 40 uint32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions from start of header */ 41}; 42 43/* Compatibility */ 44typedef struct trx_header TRXHDR, *PTRXHDR; 45 46#endif /* _TRX_HDR_H */ 47