a2f-actel-dev-brd.h 7.25 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * (C) Copyright 2011 Emcraft Systems
 *
 * Configuration settings for the Actel SmartFusion development board.
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef __CONFIG_H
#define __CONFIG_H

/*
 * Disable debug messages
 */
#undef DEBUG

/*
 * This is an ARM Cortex-M3 CPU core
 */
#define CONFIG_SYS_ARMCORTEXM3

/*
 * This is the Actel SmartFusion (aka A2F) device
 */
#define CONFIG_SYS_A2F

/*
 * This is a specific configuration of the board
 * User configurable jumpers define which of the two
 * sets of the memory devices (3.3V or 1.8 memories)
 * are accessible at a time
 */
49
#define CONFIG_SYS_BOARD_REV		0x18
50

51
52
#if (CONFIG_SYS_BOARD_REV!=0x18)
#error CONFIG_SYS_BOARD_REV must be 18
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#endif

/*
 * Display CPU and Board information
 */
#define CONFIG_DISPLAY_CPUINFO		1
#define CONFIG_DISPLAY_BOARDINFO	1

#if (CONFIG_SYS_BOARD_REV==0x33)
# define CONFIG_SYS_BOARD_REV_STR	"3.3V Memory"
#else
# define CONFIG_SYS_BOARD_REV_STR	"1.8V Memory"
#endif

/*
 * Monitor prompt
 */
#define CONFIG_SYS_PROMPT		"Actel-DEV-BRD> "

/*
 * We want to call the CPU specific initialization
 */
#define CONFIG_ARCH_CPU_INIT

/*
 * System frequency (FCLK) and the other derivative clocks
 * coming out from reset. These are defined by the Libero
 * project programmed onto SmartFusion.
 * It is possible to read these frequencies from SmartFusion
 * at run-time, however for simplicity of configuration we define these
 * clocks at build-time.
 */
#define CONFIG_SYS_CLK_FREQ		80000000uL
#define CONFIG_SYS_CLK_PCLK0		(CONFIG_SYS_CLK_FREQ / 4)
#define CONFIG_SYS_CLK_PCLK1		(CONFIG_SYS_CLK_FREQ / 4)
#define CONFIG_SYS_ACE_PCLK1		(CONFIG_SYS_CLK_FREQ / 2)
#define CONFIG_SYS_FPGA_PCLK1		(CONFIG_SYS_CLK_FREQ / 2)

/* 
 * Number of clock ticks in 1 sec
 */
#define CONFIG_SYS_HZ			1000

/*
 * Enable/disable h/w watchdog
 */
#undef CONFIG_HW_WATCHDOG

/*
 * No interrupts
 */
#undef CONFIG_USE_IRQ

/*
 * Configuration of the external memory
 */
#define CONFIG_NR_DRAM_BANKS		1
#define CONFIG_SYS_RAM_BASE		0x70000000
#if (CONFIG_SYS_BOARD_REV==0x33)
112
# error Define configuration for the 3.3V memory
113
114
115
116
117
118
#else
# define CONFIG_SYS_RAM_SIZE		(16 * 1024 * 1024)
#endif


/*
119
120
 * Optimized timings for external SRAM, including
 * timings for the external PSRAM in Page Mode
121
122
 */
#if (CONFIG_SYS_BOARD_REV==0x33)
123
# error Define configuration for the 3.3V memory
124
#else
125
# define CONFIG_SYS_EMC0CS0CR		0x00002AAD
126
# define CONFIG_SYS_EMC0CS0CR_PM        0x0000292D
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#endif

/*
 * Settings for the EMC MUX register
 */
#define CONFIG_SYS_EMCMUXCR		0x00000001

/*
 * Configuration of the external Flash
 */
#define CONFIG_SYS_FLASH_BANK1_BASE	0x74000000

/*
 * Timings for the external Flash
 */
#if (CONFIG_SYS_BOARD_REV==0x33)
143
# error Define configuration for the 3.3V memory
144
#else
145
# define CONFIG_SYS_EMC0CS1CR		0x00000137
146
147
148
149
150
#endif

/* 
 * Settings for the CFI Flash driver
 */
151
#if (CONFIG_SYS_BOARD_REV==0x33)
152
# error Define configuration for the 3.3V memory
153
#else
154
155
156
157
158
159
160
161
# define CONFIG_SYS_FLASH_CFI		1
# define CONFIG_FLASH_CFI_DRIVER	1
# define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
# define CONFIG_SYS_FLASH_BANKS_LIST	{ CONFIG_SYS_FLASH_BANK1_BASE }
# define CONFIG_SYS_MAX_FLASH_BANKS	1
# define CONFIG_SYS_MAX_FLASH_SECT	140
# define CONFIG_SYS_FLASH_CFI_AMD_RESET	1
# define CONFIG_SYS_FLASH_PROTECTION	1
162
#endif
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271

/* 
 * U-boot environment configruation
 */
#define CONFIG_ENV_IS_IN_FLASH		1
#define CONFIG_ENV_ADDR			CONFIG_SYS_FLASH_BANK1_BASE
#define CONFIG_ENV_SIZE			0x1000
#define CONFIG_INFERNO			1
#define CONFIG_ENV_OVERWRITE		1

/*
 * Serial console configuration
 */
#define CONFIG_SYS_NS16550		1
#undef CONFIG_NS16550_MIN_FUNCTIONS
#define CONFIG_SYS_NS16550_SERIAL	1
#define CONFIG_SYS_NS16550_REG_SIZE     (-4)
#define CONFIG_SYS_NS16550_CLK          CONFIG_SYS_CLK_PCLK0
#define CONFIG_CONS_INDEX               1
#define CONFIG_SYS_NS16550_COM1         0x40000000
#define CONFIG_BAUDRATE                 115200
#define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }

/*
 * MALLOC_LEN can't be more than the specified size!
 * Refer to u-boot.lds for further details.
 */
#define CONFIG_SYS_MALLOC_LEN		(1024*8)

/*
 * Console I/O buffer size
 */
#define CONFIG_SYS_CBSIZE		256

/*
 * Print buffer size
 */
#define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + \
                                        sizeof(CONFIG_SYS_PROMPT) + 16)

/* 
 * Ethernet driver configuration
 */
#define CONFIG_NET_MULTI
#define CONFIG_CORE10100		1

/*
 * Keep Rx & Tx buffers in internal RAM
 */
#define CONFIG_CORE10100_INTRAM_ADDRESS	0x20008000
#define CONFIG_BITBANGMII		1
#define CONFIG_BITBANGMII_MULTI		1

#define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_RAM_BASE
#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_RAM_BASE + \
					CONFIG_SYS_RAM_SIZE)

/* 
 * Needed by "loadb"
 */ 
#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_RAM_BASE

/*
 * Monitor is actually in eNVM. In terms of U-Boot, it is neither "flash", 
 * not RAM, but CONFIG_SYS_MONITOR_BASE must be defined.
 */
#define CONFIG_SYS_MONITOR_BASE  	0x0

/*
 * Monitor is not in flash. Needs to define this to prevent 
 * U-Boot from running flash_protect() on the monitor code.
 */
#define CONFIG_MONITOR_IS_IN_RAM  	1

/* 
 * Enable all those monitor commands that are needed
 */
#include <config_cmd_default.h>
#undef CONFIG_CMD_BOOTD
#undef CONFIG_CMD_CONSOLE
#undef CONFIG_CMD_ECHO
#undef CONFIG_CMD_EDITENV
#undef CONFIG_CMD_FPGA
#undef CONFIG_CMD_IMI
#undef CONFIG_CMD_ITEST
#undef CONFIG_CMD_IMLS
#undef CONFIG_CMD_LOADS
#undef CONFIG_CMD_MISC
#define CONFIG_CMD_NET
#undef CONFIG_CMD_NFS
#undef CONFIG_CMD_SOURCE
#undef CONFIG_CMD_XIMG

/*
 * To save memory disable long help
 */
#undef CONFIG_SYS_LONGHELP

/*
 * Max number of command args
 */
#define CONFIG_SYS_MAXARGS		16

/*
 * Auto-boot sequence configuration
 */
#define CONFIG_BOOTDELAY		3
#define CONFIG_ZERO_BOOTDELAY_CHECK
#define CONFIG_HOSTNAME			a2f-actel-dev-brd
272
273
#define CONFIG_BOOTARGS			"a2f_platform=a2f-actel-dev-brd "\
					 "console=ttyS0,115200 panic=10"
274
275
276
277
278
#define CONFIG_BOOTCOMMAND		"run flashboot"

/* 
 * Short-cuts to some useful commands (macros)
 */
279
280
#define CONFIG_EXTRA_ENV_SETTINGS				\
	"loadaddr=70000000\0"					\
281
	"addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off\0"				\
282
283
284
285
286
287
288
	"flashaddr=74020000\0"					\
	"flashboot=run addip;bootm ${flashaddr}\0"		\
	"ethaddr=C0:B1:3C:88:88:88\0"				\
	"ipaddr=172.17.4.206\0"					\
	"serverip=172.17.0.1\0"					\
	"image=a2f/uImage\0"					\
	"netboot=tftp ${image};run addip;bootm\0"
289
290
291
292
293
294
295
296

/*
 * Linux kernel boot parameters configuration
 */
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_CMDLINE_TAG

#endif /* __CONFIG_H */