71 lines
2.0 KiB
C
71 lines
2.0 KiB
C
/*
|
|
* TRX image file header format.
|
|
*
|
|
* Copyright 2001-2003, Broadcom Corporation
|
|
* All Rights Reserved.
|
|
*
|
|
* THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
|
|
* KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
|
|
* SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
* FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
|
|
*
|
|
* $Id: trxhdr.h,v 1.2 2004/03/31 02:25:17 jerry Exp $
|
|
*/
|
|
|
|
#include <typedefs.h>
|
|
|
|
#define TRX_MAGIC 0x30524448 /* "HDR0" */
|
|
#define TRX_VERSION 1
|
|
#define TRX_MAX_LEN 0x3A0000
|
|
#define TRX_NO_HEADER 1 /* Do not write TRX header */
|
|
|
|
struct trx_header {
|
|
uint32 magic; /* "HDR0" */
|
|
uint32 len; /* Length of file including header */
|
|
uint32 crc32; /* 32-bit CRC from flag_version to end of file */
|
|
uint32 flag_version; /* 0:15 flags, 16:31 version */
|
|
uint32 offsets[3]; /* Offsets of partitions from start of header */
|
|
};
|
|
|
|
/* Compatibility */
|
|
typedef struct trx_header TRXHDR, *PTRXHDR;
|
|
|
|
|
|
/* THE FOLLOWING ADDED BY Jerry Lee,2002/06/27, for upload 3-in-1 image files */
|
|
|
|
#define ULE_PMON_CS 1
|
|
#define ULE_OS_CS 2
|
|
#define ULE_NVRAM_CS 3
|
|
#define ULE_FILE_CS 4
|
|
#define ULE_PMON_MAGIC 5
|
|
#define ULE_OS_MAGIC 6
|
|
#define ULE_NVRAM_MAGIC 7
|
|
#define ULE_FILE_MAGIC 8
|
|
#define ULE_PMON_LEN 9
|
|
#define ULE_OS_LEN 10
|
|
#define ULE_NVRAM_LEN 11
|
|
#define ULE_FILE_LEN 12
|
|
#define ULE_SYS_SOCK 13
|
|
#define ULE_SYS_MTD 14
|
|
#define ULE_SYS_MEM 15
|
|
#define ULE_NVRAM_PARSE 16
|
|
|
|
/* uploaded file */
|
|
#define FILE_MAGIC 0x44414F4C // "LOAD"
|
|
#define FILE_MAX_LEN 0x3C0400 // below 0x400000(4 MB)
|
|
|
|
/* PMON image */
|
|
#define PMON_MAGIC 0x4E4F4D50 // "PMON"
|
|
#define PMON_MAX_LEN 0x40000 // 256 KB
|
|
|
|
/* NVRAM image */
|
|
#define NVAR_MAGIC 0x5241564E // "NVAR"
|
|
#define NVRAM_MAX_LEN 0x20000 // 128 KB
|
|
|
|
// for fw_magic checking
|
|
#define VENDOR_MASK 0xF0000000
|
|
#define MODEL_MASK 0x0F000000
|
|
#define TYPE_MASK 0x00FF8000
|
|
#define RELEASE_MASK 0x00007FFF
|
|
|