1 /* 2 * TRX image file header format. 3 * 4 * Copyright (C) 1999-2012, Broadcom Corporation 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 260898 2011-05-20 23:11:12Z $ 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_EMBED_UCODE 0x8 /* Trx contains embedded ucode image */ 32 #define TRX_ROMSIM_IMAGE 0x10 /* Trx contains ROM simulation image */ 33 #define TRX_UNCOMP_IMAGE 0x20 /* Trx contains uncompressed rtecdc.bin image */ 34 #define TRX_MAX_OFFSET 3 /* Max number of individual files */ 35 36 struct trx_header { 37 uint32 magic; /* "HDR0" */ 38 uint32 len; /* Length of file including header */ 39 uint32 crc32; /* 32-bit CRC from flag_version to end of file */ 40 uint32 flag_version; /* 0:15 flags, 16:31 version */ 41 uint32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions from start of header */ 42 }; 43 44 /* Compatibility */ 45 typedef struct trx_header TRXHDR, *PTRXHDR; 46 47 #endif /* _TRX_HDR_H */ 48