Update bridge utils to latest version
[gumsense-br.git] / package / rok-flash / src / mfl-header.h
blob85ee9e2afaf66a629bbab19d50dfe0708fad3eb8
1 /*
3 * ROK-104001 flashing application
5 * Author: Craig Hughes <craig@gumstix.com>
6 * Please send patches to Craig at the above email address
7 * Latest version available from: $HeadURL$
8 * This version: $Id$
10 * Copyright (c) 2005, Gumstix, Inc. All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are
14 * met:
16 * - Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * - Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * - Neither the name of Gumstix, Inc. nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #ifndef __MFL_HEADER_H__
39 #define __MFL_HEADER_H__
41 #define NAMESZ 12
43 #ifndef uint32_t
44 #define uint32_t u_int32_t
45 #endif
47 typedef struct {
48 unsigned char ImageType;
49 unsigned char SectionVersion;
50 char CrcWord;
51 uint32_t SegmentSize; // 4 bytes
52 uint32_t SegmentOffset;
53 uint32_t SmcAddr;
54 unsigned char SegmentName[NAMESZ];
55 } ImageHeader;
57 typedef struct {
58 unsigned char MflSign[3];
59 unsigned char MflVers;
60 unsigned char ChipType;
61 unsigned char NoOfImages;
62 } MflHeader;
65 // sizeof() won't work below, due to alignment crapola
66 #define MFLHDR 6
67 #define IMAGEHDR 28
69 #endif