| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2009, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bxvd_image_header.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/2 $ |
|---|
| 12 | * $brcm_Date: 12/8/09 1:53p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/xvd/7401/bxvd_image_header.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/2 12/8/09 1:53p davidp |
|---|
| 21 | * SW7405-3531: Decoder EOC value incorrrectly calculated during |
|---|
| 22 | * authenticated FW load. |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/1 11/15/06 12:20p nilesh |
|---|
| 25 | * PR25868: Separated image header definition from image types to support |
|---|
| 26 | * svp_relocate utility |
|---|
| 27 | * |
|---|
| 28 | * Hydra_Software_Devel/PR25868/1 11/15/06 11:57a nilesh |
|---|
| 29 | * PR25868: Added authenticated image support |
|---|
| 30 | * |
|---|
| 31 | ***************************************************************************/ |
|---|
| 32 | |
|---|
| 33 | #ifndef BXVD_IMAGE_HEADER_H__ |
|---|
| 34 | #define BXVD_IMAGE_HEADER_H__ |
|---|
| 35 | |
|---|
| 36 | #ifdef __cplusplus |
|---|
| 37 | extern "C" { |
|---|
| 38 | #endif |
|---|
| 39 | |
|---|
| 40 | /* |
|---|
| 41 | * "Self-describing" firmware header |
|---|
| 42 | * |
|---|
| 43 | * This structure contains the information necessary for the Aegis processor |
|---|
| 44 | * to initiate the loading and execution of the AVD firmware. The members of |
|---|
| 45 | * the structure correspond to the following map of the firmware after being |
|---|
| 46 | * restructured and relocated by the SVP relocation utility: |
|---|
| 47 | * |
|---|
| 48 | * +------------+ -> uiRelocationBase and outerCode.uiAddr |
|---|
| 49 | * | Outer Loop | |
|---|
| 50 | * | Code | |
|---|
| 51 | * +------------+ -> outerCode.uiAddr + outerCode.uiSize (end of OUTER code) |
|---|
| 52 | * ~~~~~~~~~~~~~~~~ |
|---|
| 53 | * +------------+ -> innerCode.uiAddr |
|---|
| 54 | * | Inner Loop | |
|---|
| 55 | * | Code | |
|---|
| 56 | * +------------+ -> innerCode.uiAddr + innerCode.uiSize (end of INNER code) |
|---|
| 57 | * ~~~~~~~~~~~~~~~~ |
|---|
| 58 | * +------------+ -> signature.uiAddr |
|---|
| 59 | * | Signature | |
|---|
| 60 | * +------------+ -> signature.uiAddr + signature.uiSize |
|---|
| 61 | * ~~~~~~~~~~~~~~~~ |
|---|
| 62 | * +------------+ -> outerData.uiAddr |
|---|
| 63 | * | Outer Loop | |
|---|
| 64 | * | Data | |
|---|
| 65 | * +------------+ |
|---|
| 66 | * | Outer Loop | |
|---|
| 67 | * | BSS | |
|---|
| 68 | * +------------+ -> outerData.uiAddr + outerData.uiSize |
|---|
| 69 | * ~~~~~~~~~~~~~~~~ |
|---|
| 70 | * +------------+ -> innerData.uiAddr |
|---|
| 71 | * | Inner Loop | |
|---|
| 72 | * | Data | |
|---|
| 73 | * +------------+ |
|---|
| 74 | * | Inner Loop | |
|---|
| 75 | * | BSS | |
|---|
| 76 | * +------------+ -> innerData.uiAddr + innerData.uiSize |
|---|
| 77 | * |
|---|
| 78 | * ol_code_size, ol_data_size, il_code_size and il_data_size are values that |
|---|
| 79 | * are known to the MetaWare linker but not included in the FW image. These |
|---|
| 80 | * values could be provided by the firmware team or calculated by the SVP |
|---|
| 81 | * relocation utility, but this would yield a value considerably smaller than |
|---|
| 82 | * that given to the linker. |
|---|
| 83 | * |
|---|
| 84 | * signature_size is an optional argument passed to the SVP relocation utility. |
|---|
| 85 | * If the size is not specified to the utility, it defaults to 0 and the |
|---|
| 86 | * signature_addr member is set to NULL. This means that the signature is |
|---|
| 87 | * external to the firmware and that its location and size must be managed by |
|---|
| 88 | * the application that created it. The signature_addr, if it is non-NULL |
|---|
| 89 | * will always be equal to il_end_of_code. |
|---|
| 90 | * |
|---|
| 91 | * cmd_buffer_addr is the first 128 bytes of the outer loop data section. This |
|---|
| 92 | * is equal to il_end_of_code or, if signature size is non-zero, il_end_of_code |
|---|
| 93 | * + signature_size. |
|---|
| 94 | * |
|---|
| 95 | */ |
|---|
| 96 | |
|---|
| 97 | typedef struct _BXVD_AvdImgSegment_ |
|---|
| 98 | { |
|---|
| 99 | uint32_t uiOffset; /* Offset of the segment in the image (*** |
|---|
| 100 | * TODO: absolute or relative to end of |
|---|
| 101 | * header?)*** */ |
|---|
| 102 | uint32_t uiAddress; /* Absolute physical address of the |
|---|
| 103 | * segment in memory */ |
|---|
| 104 | uint32_t uiSize; /* Size of this segment */ |
|---|
| 105 | } BXVD_AvdImgSegment; |
|---|
| 106 | |
|---|
| 107 | typedef struct _BXVD_AvdImgHdr_ |
|---|
| 108 | { |
|---|
| 109 | uint32_t uiHeaderVersion; /* header version */ |
|---|
| 110 | uint32_t uiHeaderSize; /* size of entire header */ |
|---|
| 111 | uint32_t uiImageSize; /* total size of image, not including header */ |
|---|
| 112 | uint32_t uiRelocationBase; /* relocation base address */ |
|---|
| 113 | BXVD_AvdImgSegment outerCode; |
|---|
| 114 | BXVD_AvdImgSegment innerCode; |
|---|
| 115 | BXVD_AvdImgSegment commandBuffer; |
|---|
| 116 | BXVD_AvdImgSegment outerData; |
|---|
| 117 | BXVD_AvdImgSegment innerData; |
|---|
| 118 | BXVD_AvdImgSegment signature; |
|---|
| 119 | } BXVD_AvdImgHdr; |
|---|
| 120 | |
|---|
| 121 | #define BXVD_AVD_IMG_HDR_VERSION 1 |
|---|
| 122 | #define BXVD_AVD_IMG_HDR_SIZE sizeof(BXVD_AvdImgHdr) |
|---|
| 123 | |
|---|
| 124 | #ifdef __cplusplus |
|---|
| 125 | } |
|---|
| 126 | #endif |
|---|
| 127 | |
|---|
| 128 | #endif /* BXVD_IMAGE_HEADER_H__ */ |
|---|
| 129 | /* End of file. */ |
|---|