strip the kernel version suffix from target directories, except for brcm-2.4 (the...
[15.05/openwrt.git] / target / linux / adm5120 / files / include / asm-mips / mach-adm5120 / prom / routerboot.h
1 /*
2  *  $Id$
3  *
4  *  Mikrotik's RouterBOOT 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 _ROUTERBOOT_H
26 #define _ROUTERBOOT_H
27
28 #define RB_MAC_SIZE             6
29 #define RB_MAX_MAC_COUNT        6
30
31 struct rb_bios_settings {
32         u32     hs_offs; /* hard settings offset */
33         u32     hs_size; /* hard settings size */
34         u32     fw_offs; /* firmware offset */
35         u32     ss_offs; /* soft settings offset */
36         u32     ss_size; /* soft settings size */
37 };
38
39 struct rb_hard_settings {
40         char    *name;          /* board name */
41         char    *bios_ver;      /* BIOS version */
42         u32     mem_size;       /* memory size in bytes */
43         u32     mac_count;      /* number of mac addresses */
44         u8      macs[RB_MAC_SIZE][RB_MAX_MAC_COUNT]; /* mac addresses */
45 };
46
47 /*
48  * Magic numbers
49  */
50 #define RB_MAGIC_HARD   0x64726148 /* "Hard" */
51 #define RB_MAGIC_SOFT   0x74666F53 /* "Soft" */
52 #define RB_MAGIC_DAWN   0x6E776144 /* "Dawn" */
53
54 #define RB_ID_TERMINATOR        0
55
56 /*
57  * ID values for Hardware settings
58  */
59 #define RB_ID_HARD_01           1
60 #define RB_ID_HARD_02           2
61 #define RB_ID_FLASH_INFO        3
62 #define RB_ID_MAC_ADDRESS_PACK  4
63 #define RB_ID_BOARD_NAME        5
64 #define RB_ID_BIOS_VERSION      6
65 #define RB_ID_HARD_07           7
66 #define RB_ID_SDRAM_TIMINGS     8
67 #define RB_ID_DEVICE_TIMINGS    9
68 #define RB_ID_SOFTWARE_ID       10
69 #define RB_ID_SERIAL_NUMBER     11
70 #define RB_ID_HARD_12           12
71 #define RB_ID_MEMORY_SIZE       13
72 #define RB_ID_MAC_ADDRESS_COUNT 14
73
74 /*
75  * ID values for Software settings
76  */
77 #define RB_ID_UART_SPEED        1
78 #define RB_ID_BOOT_DELAY        2
79 #define RB_ID_BOOT_DEVICE       3
80 #define RB_ID_BOOT_KEY          4
81 #define RB_ID_CPU_MODE          5
82 #define RB_ID_FW_VERSION        6
83 #define RB_ID_SOFT_07           7
84 #define RB_ID_SOFT_08           8
85 #define RB_ID_BOOT_PROTOCOL     9
86 #define RB_ID_SOFT_10           10
87 #define RB_ID_SOFT_11           11
88
89 /*
90  * UART_SPEED values
91  */
92 #define RB_UART_SPEED_115200    0
93 #define RB_UART_SPEED_57600     1
94 #define RB_UART_SPEED_38400     2
95 #define RB_UART_SPEED_19200     3
96 #define RB_UART_SPEED_9600      4
97 #define RB_UART_SPEED_4800      5
98 #define RB_UART_SPEED_2400      6
99 #define RB_UART_SPEED_1200      7
100
101 /*
102  * BOOT_DELAY values
103  */
104 #define RB_BOOT_DELAY_0SEC      0
105 #define RB_BOOT_DELAY_1SEC      1
106 #define RB_BOOT_DELAY_2SEC      2
107
108 /*
109  * BOOT_DEVICE values
110  */
111 #define RB_BOOT_DEVICE_ETHER    0
112 #define RB_BOOT_DEVICE_NANDETH  1
113 #define RB_BOOT_DEVICE_ETHONCE  2
114 #define RB_BOOT_DEVICE_NANDONLY 3
115
116 /*
117  * BOOT_KEY values
118  */
119 #define RB_BOOT_KEY_ANY         0
120 #define RB_BOOT_KEY_DEL         1
121
122 /*
123  * CPU_MODE values
124  */
125 #define RB_CPU_MODE_POWERSAVE   0
126 #define RB_CPU_MODE_REGULAR     1
127
128 /*
129  * BOOT_PROTOCOL values
130  */
131 #define RB_BOOT_PROTOCOL_BOOTP  0
132 #define RB_BOOT_PROTOCOL_DHCP   1
133
134 extern int routerboot_present(void) __init;
135 extern char *routerboot_get_boardname(void);
136
137 #endif /* _ROUTERBOOT_H */