7685cbb90a49eb2f67f4893e852bb00b7f5b8c3c
[openwrt-10.03/.git] / tools / firmware-utils / src / csysimg.h
1 /*
2  *  $Id$
3  *
4  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
5  *
6  *  This program was based on the code found in various Linux
7  *  source tarballs released by Edimax for it's devices.
8  *  Original author: David Hsu <davidhsu@realtek.com.tw>
9  *
10  *  This program is free software; you can redistribute it and/or
11  *  modify it under the terms of the GNU General Public License
12  *  as published by the Free Software Foundation; either version 2
13  *  of the License, or (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the
22  *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23  *  Boston, MA  02110-1301, USA.
24  */
25
26 #define SIG_LEN         4
27
28 #define ADM_CODE_ADDR   0x80500000
29 #define ADM_WEBP_ADDR   0x10000
30 #define ADM_WEBP_SIZE   0x10000
31 #define ADM_BOOT_SIZE   0x8000
32 #define ADM_CONF_SIZE   0x8000
33 #define ADM_BOOT_SIG    "\x00\x60\x1A\x40"
34
35
36 /*
37  * Generic signatures
38  */
39 #define SIG_CSYS        "CSYS"
40 #define SIG_CONF        "HS\x00\x00"
41 #define SIG_BOOT_RTL    "\x00\x00\x40\x21"
42
43 /*
44  * Web page signatures
45  */
46 #define SIG_BR6104K     "WB4K"
47 #define SIG_BR6104KP    "WBKP"
48 #define SIG_BR6104Wg    "WBGW"
49 #define SIG_BR6104IPC   "WBIP"
50 #define SIG_BR6114WG    SIG_BR6104IPC
51 #define SIG_BR6524K     "2-K-"
52 #define SIG_BR6524KP    "2-KP"  /* FIXME: valid? */
53 #define SIG_BR6524WG    "2-WG"  /* FIXME: valid? */
54 #define SIG_BR6524WP    "2-WP"  /* FIXME: valid? */
55 #define SIG_BR6541K     "4--K"
56 #define SIG_BR6541KP    "4-KP"  /* FIXME: valid? */
57 #define SIG_BR6541WP    "4-WP"  /* FIXME: valid? */
58 #define SIG_C54BSR4     SIG_BR6104IPC
59 #define SIG_EW7207APg   "EWAS"
60 #define SIG_PS1205UWg   "4000"
61 #define SIG_PS3205U     "5010"
62 #define SIG_PS3205UWg   "5011"
63 #define SIG_RALINK      "RNRA"
64
65 #define SIG_H2BR4       SIG_BR6524K
66 #define SIG_H2WR54G     SIG_BR6524WG
67
68 #define SIG_XRT401D     SIG_BR6104K
69 #define SIG_XRT402D     SIG_BR6524K
70
71 /*
72  * CSYS image file header
73  */
74 struct csys_header {
75         unsigned char sig[SIG_LEN];
76         uint32_t addr;
77         uint32_t size;
78 };
79
80
81