[adm5120] license cleanup
[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 modify it
10  *  under the terms of the GNU General Public License version 2 as published
11  *  by the Free Software Foundation.
12  *
13  */
14
15 #ifndef _ROUTERBOOT_H
16 #define _ROUTERBOOT_H
17
18 #define RB_MAC_SIZE             6
19
20 struct rb_bios_settings {
21         u32     hs_offs; /* hard settings offset */
22         u32     hs_size; /* hard settings size */
23         u32     fw_offs; /* firmware offset */
24         u32     ss_offs; /* soft settings offset */
25         u32     ss_size; /* soft settings size */
26 };
27
28 struct rb_hard_settings {
29         char    *name;          /* board name */
30         char    *bios_ver;      /* BIOS version */
31         u32     mem_size;       /* memory size in bytes */
32         u32     mac_count;      /* number of mac addresses */
33         u8      *mac_base;      /* mac address base */
34 };
35
36 /*
37  * Magic numbers
38  */
39 #define RB_MAGIC_HARD   0x64726148 /* "Hard" */
40 #define RB_MAGIC_SOFT   0x74666F53 /* "Soft" */
41 #define RB_MAGIC_DAWN   0x6E776144 /* "Dawn" */
42
43 #define RB_ID_TERMINATOR        0
44
45 /*
46  * ID values for Hardware settings
47  */
48 #define RB_ID_HARD_01           1
49 #define RB_ID_HARD_02           2
50 #define RB_ID_FLASH_INFO        3
51 #define RB_ID_MAC_ADDRESS_PACK  4
52 #define RB_ID_BOARD_NAME        5
53 #define RB_ID_BIOS_VERSION      6
54 #define RB_ID_HARD_07           7
55 #define RB_ID_SDRAM_TIMINGS     8
56 #define RB_ID_DEVICE_TIMINGS    9
57 #define RB_ID_SOFTWARE_ID       10
58 #define RB_ID_SERIAL_NUMBER     11
59 #define RB_ID_HARD_12           12
60 #define RB_ID_MEMORY_SIZE       13
61 #define RB_ID_MAC_ADDRESS_COUNT 14
62
63 /*
64  * ID values for Software settings
65  */
66 #define RB_ID_UART_SPEED        1
67 #define RB_ID_BOOT_DELAY        2
68 #define RB_ID_BOOT_DEVICE       3
69 #define RB_ID_BOOT_KEY          4
70 #define RB_ID_CPU_MODE          5
71 #define RB_ID_FW_VERSION        6
72 #define RB_ID_SOFT_07           7
73 #define RB_ID_SOFT_08           8
74 #define RB_ID_BOOT_PROTOCOL     9
75 #define RB_ID_SOFT_10           10
76 #define RB_ID_SOFT_11           11
77
78 /*
79  * UART_SPEED values
80  */
81 #define RB_UART_SPEED_115200    0
82 #define RB_UART_SPEED_57600     1
83 #define RB_UART_SPEED_38400     2
84 #define RB_UART_SPEED_19200     3
85 #define RB_UART_SPEED_9600      4
86 #define RB_UART_SPEED_4800      5
87 #define RB_UART_SPEED_2400      6
88 #define RB_UART_SPEED_1200      7
89
90 /*
91  * BOOT_DELAY values
92  */
93 #define RB_BOOT_DELAY_0SEC      0
94 #define RB_BOOT_DELAY_1SEC      1
95 #define RB_BOOT_DELAY_2SEC      2
96
97 /*
98  * BOOT_DEVICE values
99  */
100 #define RB_BOOT_DEVICE_ETHER    0
101 #define RB_BOOT_DEVICE_NANDETH  1
102 #define RB_BOOT_DEVICE_ETHONCE  2
103 #define RB_BOOT_DEVICE_NANDONLY 3
104
105 /*
106  * BOOT_KEY values
107  */
108 #define RB_BOOT_KEY_ANY         0
109 #define RB_BOOT_KEY_DEL         1
110
111 /*
112  * CPU_MODE values
113  */
114 #define RB_CPU_MODE_POWERSAVE   0
115 #define RB_CPU_MODE_REGULAR     1
116
117 /*
118  * BOOT_PROTOCOL values
119  */
120 #define RB_BOOT_PROTOCOL_BOOTP  0
121 #define RB_BOOT_PROTOCOL_DHCP   1
122
123 extern int routerboot_present(void) __init;
124 extern char *routerboot_get_boardname(void);
125
126 extern struct rb_hard_settings rb_hs;
127
128 #endif /* _ROUTERBOOT_H */