1 /** @file
2 *
3 *  Copyright (c) 2012-2014, ARM Limited. All rights reserved.
4 *
5 *  This program and the accompanying materials
6 *  are licensed and made available under the terms and conditions of the BSD License
7 *  which accompanies this distribution.  The full text of the license may be found at
8 *  http://opensource.org/licenses/bsd-license.php
9 *
10 *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 *  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14 
15 #ifndef __BOOTMON_FS_HW_H__
16 #define __BOOTMON_FS_HW_H__
17 
18 #define MAX_NAME_LENGTH 32
19 
20 #define HW_IMAGE_FOOTER_SIGNATURE_1 0x464C5348
21 #define HW_IMAGE_FOOTER_SIGNATURE_2 0x464F4F54
22 
23 #define HW_IMAGE_FOOTER_VERSION     1
24 #define HW_IMAGE_FOOTER_OFFSET      92
25 
26 #define HW_IMAGE_FOOTER_VERSION2    2
27 #define HW_IMAGE_FOOTER_OFFSET2     96
28 
29 typedef struct {
30   CHAR8  Filename[MAX_NAME_LENGTH];
31   UINT32 Offset;
32   UINT32 Version;
33   UINT32 FooterSignature1;
34   UINT32 FooterSignature2;
35 } HW_IMAGE_FOOTER;
36 
37 #define HW_IMAGE_DESCRIPTION_REGION_MAX 4
38 
39 // This structure is located at the end of a block when a file is present
40 typedef struct {
41   UINT32  EntryPoint;
42   UINT32  Attributes;
43   UINT32  RegionCount;
44   struct {
45     UINT32 LoadAddress;
46     UINT32 Size;
47     UINT32 Offset;
48     UINT32 Checksum;
49   } Region[HW_IMAGE_DESCRIPTION_REGION_MAX];
50   UINT32  BlockStart;
51   UINT32  BlockEnd;
52   UINT32  FooterChecksum;
53 
54   HW_IMAGE_FOOTER Footer;
55 } HW_IMAGE_DESCRIPTION;
56 
57 #endif
58