summaryrefslogtreecommitdiff
path: root/package/uboot-lantiq/files/include/configs/ifx-common.h
blob: 88569ada9c09aadab839059ca737207a58e1cad4 (plain)
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
49
50
51
52
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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
/*
 * (C) Copyright 2008
 * Stefan Roese, DENX Software Engineering, sr@denx.de.
 *
 * Common configuration options for all AMCC boards
 *
 * 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 __IFX_COMMON_H
#define __IFX_COMMON_H

#define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/

#define CONFIG_BAUDRATE		115200

/* valid baudrates */
#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }

#define CONFIG_TIMESTAMP		/* Print image info with timestamp */

#define CONFIG_PREBOOT	"echo;"	\
	"echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
	"echo"

#undef	CONFIG_BOOTARGS
#define CONFIG_EXTRA_ENV_SETTINGS					\
	"ram_addr=0x80500000\0"						\
	"kernel_addr=0xb0050000\0"					\
	"mtdparts=mtdparts=ifx-nor:256k(uboot)ro,64k(uboot_env)ro,64k(kernel),-(rootfs)\0" \
	"flashargs=setenv bootargs rootfstype=squashfs,jffs2\0"		\
	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
		"nfsroot=${serverip}:${rootpath} \0"			\
	"addip=setenv bootargs ${bootargs} "				\
		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"	\
		":${hostname}:${netdev}:off\0"				\
	"addmisc=setenv bootargs ${bootargs} init=/etc/preinit "	\
		"console=ttyS1,115200 ethaddr=${ethaddr} ${mtdparts}"		\
		"${mtdparts}\0"						\
	"flash_flash=run flashargs addip addmisc;"			\
		"bootm ${kernel_addr}\0"				\
	"flash_nfs=run nfsargs addip addmisc;bootm ${kernel_addr}\0"	\
	"net_flash=run load_kernel flashargs addip addmisc;"		\
		"bootm ${ram_addr}\0"					\
	"net_nfs=run load_kernel nfsargs addip addmisc;"		\
		"bootm ${ram_addr}\0"					\
	"load_kernel=tftp ${ram_addr} "					\
		"${tftppath}openwrt-ifxmips-uImage\0"			\
	"update_uboot=tftp 0x80500000 ${tftppath}u-boot.bin;era 0xb0000000 +${filesize};" \
		"cp.b 0x80500000 0xb0000000 ${filesize}\0" \
	"update_openwrt=tftp ${ram_addr} "				\
		"${tftppath}openwrt-ifxmips-squashfs.image;"		\
		"era ${kernel_addr} +${filesize};"			\
		"cp.b ${ram_addr} ${kernel_addr} ${filesize}\0"

#define CONFIG_BOOTCOMMAND	"run flash_flash"

/*
 * TFTP is using fragmented packets
*/
#define CONFIG_IP_DEFRAG

/*
 * BOOTP options
 */
#define CONFIG_BOOTP_BOOTFILESIZE
#define CONFIG_BOOTP_BOOTPATH
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME


/*
 * Command line configuration.
 */
#include <config_cmd_default.h>

#undef CONFIG_CMD_CONSOLE
#undef CONFIG_CMD_FPGA
#undef CONFIG_CMD_IMLS
#undef CONFIG_CMD_LOADB
#undef CONFIG_CMD_LOADS
#undef CONFIG_CMD_NFS
#undef CONFIG_CMD_XIMG

//#define CONFIG_CMD_ASKENV
//#define CONFIG_CMD_DHCP
//#define CONFIG_CMD_ELF
#define CONFIG_CMD_PING
//#define CONFIG_CMD_JFFS2
//#define CONFIG_CMD_SNTP


/*
 * Miscellaneous configurable options
 */

#define CONFIG_LZMA

#define CONFIG_SYS_LONGHELP				/* undef to save memory */
#ifndef CONFIG_SYS_PROMPT
#define CONFIG_SYS_PROMPT		"=> "		/* Monitor Command Prompt */
#endif
#define CONFIG_SYS_CBSIZE		256		/* Console I/O Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)  /* Print Buffer Size */
#define CONFIG_SYS_MAXARGS		16		/* max number of command args */

#define CONFIG_SYS_MALLOC_LEN		1024*1024
#define CONFIG_SYS_BOOTPARAMS_LEN	128*1024

#define CONFIG_SYS_MIPS_TIMER_FREQ	(CPU_CLOCK_RATE/2)
#define CONFIG_SYS_HZ			1000

#define CONFIG_SYS_SDRAM_BASE		0x80000000
#define CONFIG_SYS_LOAD_ADDR		0x80100000	/* default load address	*/
#define CONFIG_SYS_MEMTEST_START	0x80100000
#define CONFIG_SYS_MEMTEST_END		0x80800000

#define CONFIG_CMDLINE_EDITING		/* add command line history	*/
#define CONFIG_AUTO_COMPLETE		/* add autocompletion support	*/

#define CONFIG_ZERO_BOOTDELAY_CHECK	/* check for keypress on bootdelay==0 */
#define CONFIG_VERSION_VARIABLE		/* include version env variable */
#define CONFIG_SYS_CONSOLE_INFO_QUIET	/* don't print console @ startup*/

#ifdef CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
#endif

#define CONFIG_LOADS_ECHO		/* echo on for serial download	*/
#define CONFIG_SYS_LOADS_BAUD_CHANGE	/* allow baudrate change	*/

/*-----------------------------------------------------------------------
 * FLASH and environment organization
 */
 
#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT	1

#define CONFIG_SYS_MAX_FLASH_BANKS	1	/* max number of memory banks */
#define CONFIG_SYS_MAX_FLASH_SECT	(140)	/* max number of sectors on one chip */

#define PHYS_FLASH_1			0xB0000000 /* Flash Bank #1 */
#define PHYS_FLASH_2			0xB0800000 /* Flash Bank #2 */

/* The following #defines are needed to get flash environment right */
#define CONFIG_SYS_MONITOR_BASE		TEXT_BASE
#define CONFIG_SYS_MONITOR_LEN		(192 << 10)

#define CONFIG_SYS_INIT_SP_OFFSET	0x400000

#define CONFIG_SYS_FLASH_BASE		PHYS_FLASH_1

#define CONFIG_ENV_OVERWRITE		1
#define CONFIG_ENV_IS_IN_FLASH		1

/* Address and size of Primary Environment Sector	*/
#define CONFIG_ENV_ADDR			0xB0040000
#define CONFIG_ENV_SIZE			0x10000

#ifdef CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_SYS_FLASH_SWAP_ADDR
#define CONFIG_FLASH_SHOW_PROGRESS	45

#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT

#define FLASH_FIXUP_ADDR_8(addr)	((void*)((ulong)(addr)^2))
#define FLASH_FIXUP_ADDR_16(addr)	((void*)((ulong)(addr)^2))

#endif

#define CONFIG_NR_DRAM_BANKS		1

#ifdef CONFIG_SYS_EBU_BOOT
#ifndef INFINEON_EBU_BOOTCFG
#error Please define INFINEON_EBU_BOOTCFG
#endif
#endif

#endif /* __IFX_COMMON_H */