e9471b5ad448e9ce3daaadd00fee9a380a5ef195
[openwrt.git] / target / linux / adm5120 / files / include / asm-mips / mach-adm5120 / prom / zynos.h
1 /*
2  *  $Id$
3  *
4  *  ZyNOS (ZyXEL's Networking OS) definitions
5  *
6  *  Copyright (C) 2007 OpenWrt.org
7  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8  *
9  *  This program is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU General Public License
11  *  as published by the Free Software Foundation; either version 2
12  *  of the License, or (at your option) any later version.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the
21  *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  *  Boston, MA  02110-1301, USA.
23  */
24
25 #ifndef _ZYNOS_H
26 #define _ZYNOS_H
27
28 #define ZYNOS_NAME_LEN          32
29 #define ZYNOS_FEAT_BYTES        22
30 #define ZYNOS_MAC_LEN           6
31
32 struct zynos_board_info {
33         unsigned char   vendor[ZYNOS_NAME_LEN];
34         unsigned char   product[ZYNOS_NAME_LEN];
35         u32             bootext_addr;
36         u32             res0;
37         u16             board_id;
38         u8              res1[6];
39         u8              feat_other[ZYNOS_FEAT_BYTES];
40         u8              feat_main;
41         u8              res2;
42         u8              mac[ZYNOS_MAC_LEN];
43         u8              country;
44         u8              dbgflag;
45 } __attribute__ ((packed));
46
47 /*
48  * Vendor IDs
49  */
50 #define ZYNOS_VENDOR_ID_ZYXEL   0
51 #define ZYNOS_VENDOR_ID_NETGEAR 1
52 #define ZYNOS_VENDOR_ID_DLINK   2
53 #define ZYNOS_VENDOR_ID_OTHER   3
54 #define ZYNOS_VENDOR_ID_LUCENT  4
55
56 /*
57  * Vendor names
58  */
59 #define ZYNOS_VENDOR_DLINK      "D-Link"
60 #define ZYNOS_VENDOR_LUCENT     "LUCENT"
61 #define ZYNOS_VENDOR_NETGEAR    "NetGear"
62 #define ZYNOS_VENDOR_ZYXEL      "ZyXEL"
63
64 /*
65  * Board IDs (big-endian)
66  */
67 #define ZYNOS_BOARD_ES2108      0x00F2  /* Ethernet Switch 2108 */
68 #define ZYNOS_BOARD_ES2108F     0x01AF  /* Ethernet Switch 2108-F */
69 #define ZYNOS_BOARD_ES2108G     0x00F3  /* Ethernet Switch 2108-G */
70 #define ZYNOS_BOARD_ES2108LC    0x00FC  /* Ethernet Switch 2108-LC */
71 #define ZYNOS_BOARD_ES2108PWR   0x00F4  /* Ethernet Switch 2108PWR */
72 #define ZYNOS_BOARD_HS100       0x9FF1  /* HomeSafe 100/100W */
73 #define ZYNOS_BOARD_P334        0x9FF5  /* Prestige 334 */
74 #define ZYNOS_BOARD_P334U       0x9FDD  /* Prestige 334U */
75 #define ZYNOS_BOARD_P334W       0x9FF3  /* Prestige 334W */
76 #define ZYNOS_BOARD_P334WH      0x00E0  /* Prestige 334WH */
77 #define ZYNOS_BOARD_P334WHD     0x00E1  /* Prestige 334WHD */
78 #define ZYNOS_BOARD_P334WT      0x9FEF  /* Prestige 334WT */
79 #define ZYNOS_BOARD_P335        0x9FED  /* Prestige 335/335WT */
80 #define ZYNOS_BOARD_P335PLUS    0x0025  /* Prestige 335Plus */
81 #define ZYNOS_BOARD_P335U       0x9FDC  /* Prestige 335U */
82
83 /*
84  * Some magic numbers (big-endian)
85  */
86 #define ZYNOS_MAGIC_DBGAREA1    0x48646267      /* "Hdbg" */
87 #define ZYNOS_MAGIC_DBGAREA2    0x61726561      /* "area" */
88
89 struct bootbase_info {
90         u16             vendor_id;
91         u16             board_id;
92         u8              mac[6];
93 };
94
95 extern struct bootbase_info bootbase_info;
96 extern int bootbase_present(void) __init;
97
98 #endif /* _ZYNOS_H */