BOOTLOADER
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
define.h
Go to the documentation of this file.
1 #ifndef __DEF_H__
2 #define __DEF_H__
3 
4 #define INT32U unsigned int
5 #define INT16U unsigned short
6 #define INT8U unsigned char
7 #define INT32 int
8 #define INT16 short
9 #define INT8 char
10 #define U32 unsigned int
11 #define U16 unsigned short
12 #define S32 int
13 #define S16 short int
14 #define U8 unsigned char
15 #define S8 signed char
16 
17 #define BYTE char
18 #define WORD short
19 #define DWORD int
20 #define UINT U32
21 //#define LPSTR (U8 *) //???
22 typedef U8 * LPSTR;
23 #define BOOL unsigned char
24 #define USHORT U16
25 
26 #define TRUE 1
27 #define FALSE 0
28 #define ON 1
29 #define OFF 0
30 #define OK 1
31 #define FAIL 0
32 
33 //#define NULL (void *)0
34 
35 // debug message control
36 #define DEBUG_CS8900 0
37 #define DEBUG_DM9000A 0
38 #define DEBUG_TESTVGA 0
39 #define DEBUG_ETHERNET_BUFFER 0
40 #define DEBUG_ETHERNET 0
41 #define DEBUG_ETHERNET_IP 0
42 #define DEBUG_ETHERNET_ARP 0
43 #define DEBUG_ETHERNET_UDP 0
44 #define DEBUG_ETHERNET_TFTP 0
45 #define DEBUG_ETHERNET_ICMP 0
46 #define DEBUG_SHELL 1
47 #define DEBUG_SHELLARGUMENT 1
48 // program control
49 #define ENABLE_UART_IRQ 1
50 #define ENABLE_TIMER_IRQ 1
51 //#define ENABLE_IIC_IRQ 0
52 
53 // resource id...for resource management
54 #define ID_IIC 0x0000
55 #define ID_IIS 0x0001
56 #define ID_GPIO 0x0002
57 #define ID_RTC 0x0003
58 #define ID_ADC 0x0004
59 #define ID_TIMER0 0x0005
60 #define ID_TIMER1 0x0006
61 #define ID_TIMER2 0x0007
62 #define ID_TIMER3 0x0008
63 #define ID_TIMER4 0x0009
64 #define ID_TIMER5 0x000a
65 #define ID_UART0 0x000b
66 #define ID_UART1 0x000c
67 #define ID_UART2 0x000d
68 #define ID_USBDEVICE 0x000e
69 #define ID_SD 0x000f
70 #define ID_WTD 0x0010
71 #define ID_SPI0 0x0011
72 #define ID_SPI1 0x0012
73 #define ID_INTERRUPT 0x0013
74 #define ID_POWER_MANAGEMENT 0x0014
75 #define ID_MEMORY 0x0015
76 #define ID_LCD 0x0016
77 #define ID_USBHOST 0x0017
78 #define ID_NANDFLASH 0x0018
79 #define ID_DMA0 0x0019
80 #define ID_DMA1 0x001a
81 #define ID_DMA2 0x001b
82 #define ID_DMA3 0x001c
83 #define ID_IDE 0x0020
84 #define ID_CS8900 0x0021
85 #define ID_UDA1341 0x0022
86 #define ID_CH7005C 0x0023
87 #define ID_DM9000 0x0024
88 
89 // middle ware
90 #define ID_FILESYSTEM 0x0100
91 #define ID_NORDISK 0x0101
92 #define ID_NANDFLASHDISK 0x0102
93 #define ID_HARDDRIVE 0x0103
94 #define ID_ETHERNET 0x0104
95 #define ID_ETHERNET_TFTP 0x0105
96 #define ID_ETHERNET_ARP 0x0106
97 #define ID_ETHERNET_IP 0x0107
98 #define ID_ETHERNET_UDP 0x0108
99 #define ID_XMODEM 0x0109
100 #define ID_TFTP_MW 0x010a
101 
102 // application id
103 #define ID_MONITOR 0x0200
104 #define ID_TESTVGA 0x0201
105 #define ID_TESTAUDIO 0x0202
106 #define ID_TESTDMA 0x0203
107 #define ID_TESTSPI 0x0204
108 #define ID_SHELL 0x0205
109 #define ID_TESTINFO 0x0206
110 
111 // memory size definition
112 #define SIZE_1K 0x00000400
113 #define SIZE_2K 0x00000800
114 #define SIZE_4K 0x00001000
115 #define SIZE_8K 0x00002000
116 #define SIZE_16K 0x00004000
117 #define SIZE_32K 0x00008000
118 #define SIZE_64K 0x00010000
119 #define SIZE_128K 0x00020000
120 #define SIZE_256K 0x00040000
121 #define SIZE_512K 0x00080000
122 #define SIZE_1M 0x00100000
123 #define SIZE_2M 0x00200000
124 #define SIZE_4M 0x00400000
125 #define SIZE_8M 0x00800000
126 #define SIZE_16M 0x01000000
127 #define SIZE_32M 0x02000000
128 #define SIZE_64M 0x04000000
129 #define SIZE_128M 0x08000000
130 #define SIZE_256M 0x10000000
131 #define SIZE_512M 0x20000000
132 #define SIZE_1G 0x40000000
133 #define SIZE_2G 0x80000000
134 // key definition
135 #define ENTER_KEY 0x0d
136 #define BACK_KEY 0x08
137 #define BEEP_KEY 0x07
138 #define UP_KEY 0x41
139 #define DOWN_KEY 0x42
140 #define RIGHT_KEY 0x43
141 #define LEFT_KEY 0x44
142 #define HOME_KEY 0x48
143 #define END_KEY 0x4b
144 #define ESC_KEY 0x1b
145 // image download address
146 #define IMAGE_ADDRESS 0x30000000
147 
148 typedef struct{
149  char *name;
151 }SysClock;
152 
153 typedef struct{
154  unsigned short year;
155  unsigned char month;
156  unsigned char day;
157  unsigned char weekday;
158  unsigned char hour;
159  unsigned char min;
160  unsigned char sec;
161 }TIME_STRUC;
162 
163 struct Partition{
164  U32 offset;
165  U32 size;
166  char *name;
167 };
168 
169 typedef struct {
170  unsigned char flag[8];
171  struct {
172  unsigned long ip;
173  unsigned long mask;
174  unsigned long gate;
175  }nic_cfg;
176  unsigned long baud;
177  unsigned int current_uart;
178  unsigned long clk_para[4];
179  unsigned long prog_s_addr;
180  unsigned long prog_r_addr;
181  struct Partition NandPartition[8];
182  unsigned char boot_params[256];
183  unsigned long boot_key;
184  unsigned long saved_in;
185  unsigned long initrd_addr;
186  unsigned long machine;
187  unsigned char name[32];
188  unsigned char leng_name;
189  unsigned char web[32];
190  unsigned char leng_web;
191 }EnvParams;
192 
193 typedef int (*TEST_PROGRAM)(U32 a1, U32 a2, U32 a3 ,U32 a4);
194 
195 typedef struct {
197  char *title;
198  char *tip;
201 
202 extern INT8U ucTemp;
203 extern INT16U usTemp;
204 extern INT32U uiTemp;
205 
206 #endif
207