将CONFIG_S3C2410,CONFIG_SMDK2410注释掉,加入CONFIG_S3C2440和CONFIG_MINI2440的宏定义以及其他一些宏定义和条件编译指令,如下:
1 /*
2 * (C) Copyright 2002
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
5 * Gary Jennejohn <gj@denx.de>
6 * David Mueller <d.mueller@elsoft.ch>
7 *
8 * Configuation settings for the SAMSUNG SMDK2410 board.
9 *
10 * See file CREDITS for list of people who contributed to this
11 * project.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of
16 * the License, or (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 * MA 02111-1307 USA
27 */
28
29 #ifndef __CONFIG_H
30 #define __CONFIG_H
31
32 /*
33 * If we are developing, we might want to start armboot from ram
34 * so we MUST NOT initialize critical regs like mem-timing ...
35 */
36 #define CONFIG_INIT_CRITICAL /* undef for developing */
37
38 /*
39 * High Level Configuration Options
40 * (easy to change)
41 */
42 #define CONFIG_ARM920T 1 /* This is an ARM920T Core */
43 //#define CONFIG_S3C2410 1 /* in a SAMSUNG S3C2410 SoC */ // snallie
44 //#define CONFIG_SMDK2410 1 /* on an SAMSUNG SMDK2410 Board */ // snallie
45
46 #define CONFIG_S3C2440 1 /* in a SAMSUNG S3C2440 SoC */ // snallie
47 #define CONFIG_MINI2440 1 /* on an FriendlyARM MINI2440 Board */ // snallie
/*
* 43~47 将CONFIG_S3C2410,CONFIG_SMDK2410的宏定义取消,定义新的宏CONFIG_S3C2440,CONFIG_MINI2440
*/
48 #define CONFIG_MINI2440_LED 1 /* snallie */
49 #define CONFIG_MACH_MINI2440 782 // snallie
/*
* 49行定义了MINI2440 的machine_id
*/
50
51 #define USE_920T_MMU 1
52 #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
53
54 /*
55 * Size of malloc() pool
56 */
57 #define CONFIG_MALLOC_SIZE (CFG_ENV_SIZE + 128*1024)
58
59 /*
60 * Hardware drivers
61 */
62 #if defined(CONFIG_SMDK2410) // snallie
63 #define CONFIG_DRIVER_CS8900 1 /* we have a CS8900 on-board */
64 #define CS8900_BASE 0x19000300
65 #define CS8900_BUS16 1 /* the Linux driver does accesses as shorts */
66 #endif // snallie
67
68 #if defined(CONFIG_MINI2440) // snallie
69 #define CONFIG_DRIVER_DM9000 1 // snallie
70 #define CONFIG_DM9000_USE_16BIT 1
71 //#define CONFIG_DM9000_BUS16 1 /* the Linux driver does accesses as shorts */
72 #define CONFIG_DM9000_BASE 0x20000000
73 #define DM9000_IO 0x20000000
74 #define DM9000_DATA 0x20000004
75 //#define CONFIG_DM9000_DEBUG
76 #endif // snallie
/*
* 62~66行在条件编译下相当于空,68~76定义了DM9000网络芯片的参数,移植DM9000网络芯片驱动时候会用到
*/
77
78 /*
79 * select serial console configuration
80 */
81 #define CONFIG_SERIAL1 1 /* we use SERIAL 1 on SMDK2410 */
82
83 /* allow to overwrite serial and ethaddr */
84 #define CONFIG_ENV_OVERWRITE
85
86 #define CONFIG_BAUDRATE 115200
87
88 #ifndef USE_920T_MMU
89 #define CONFIG_COMMANDS (CONFIG_CMD_DFL & ~CFG_CMD_CACHE)
90 #else
91 #define CONFIG_COMMANDS (CONFIG_CMD_DFL)
92 #endif
93
94 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
95 #include <cmd_confdefs.h>
96
97 #define CONFIG_BOOTDELAY 3
98 //#define CONFIG_BOOTARGS "root=ramfs devfs=mount console=ttySA0,9600"
99 #define CONFIG_BOOTARGS "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200n8" /* snallie */
100 #define CONFIG_ETHADDR 08:00:3e:26:0a:5b
101 #define CONFIG_NETMASK 255.255.255.0
102 //#define CONFIG_IPADDR 10.0.0.110
103 //#define CONFIG_SERVERIP 10.0.0.1
104 #define CONFIG_IPADDR 192.168.2.2
105 #define CONFIG_SERVERIP 192.168.2.1
106 //#define CONFIG_BOOTFILE "elinos-lart"
107 #define CONFIG_BOOTFILE "uImage110_2440"
108 //#define CONFIG_BOOTCOMMAND "tftp; bootm" // snlalie
109 #define CONFIG_BOOTCOMMAND "nboot" // snallie
/*
* 99行定义了ARMBoot 给Linux kernel 传递的启动参数,100~105定义了网络芯片的物理地址和IP地址信息,107行定义了下载的Linux kernel的文件名
* 格式为uImage格式的。109行定义了默认的内核的启动命令。
*/
110
111 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
112 #define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
113 /* what's this ? it's not used anywhere */
114 #define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
115 #endif
116
117 /*
118 * Miscellaneous configurable options
119 */
120 #define CFG_LONGHELP /* undef to save memory */
121
122 #if defined(CONFIG_SMDK2410) // snallie
123 #define CFG_PROMPT "SMDK2410 # " /* Monitor Command Prompt */ // snallie
124 #endif // snallie
125
126 #if defined(CONFIG_MINI2440) // snallie
127 #define CFG_PROMPT "ARMboot@MINI2440 # " /* Monitor Command Prompt */ // snallie
128 #endif // snallie
/*
* 126~128行定义了ARMboot的命令提示符。
*/
129
130 #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
131 #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
132 #define CFG_MAXARGS 16 /* max number of command args */
133 #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
134
135 #define CFG_MEMTEST_START 0x30000000 /* memtest works on */
136 #define CFG_MEMTEST_END 0x31F00000 /* 31 MB in DRAM */
137
138 #undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
139
140 //#define CFG_LOAD_ADDR 0x31000000 /* default load address */
141 #define CFG_LOAD_ADDR 0x30008000/* default load address*/ // snallie
142 #define CONFIG_LOADADDR CFG_LOAD_ADDR // snallie
/*
* 141~142行定义了Linux内核的默认下载地址(串口的文件默认下载地址也是这个地址)
*/
143
144 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
145 /* it to wrap 100 times (total 1562500) to get 1 sec. */
146 #define CFG_HZ 1562500
147
148 /* valid baudrates */
149 #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
150
151 #ifndef __ASSEMBLY__
152 /*-----------------------------------------------------------------------
153 * Board specific extension for bd_info
154 *
155 * This structure is embedded in the global bd_info (bd_t) structure
156 * and can be used by the board specific code (eg board/...)
157 */
158
159 struct bd_info_ext
160 {
161 /* helper variable for board environment handling
162 *
163 * env_crc_valid == 0 => uninitialised
164 * env_crc_valid > 0 => environment crc in flash is valid
165 * env_crc_valid < 0 => environment crc in flash is invalid
166 */
167 int env_crc_valid;
168 };
169 #endif
170
171 /*-----------------------------------------------------------------------
172 * Stack sizes
173 *
174 * The stack sizes are set up in start.S using the settings below
175 */
176 #define CONFIG_STACKSIZE (128*1024) /* regular stack */
177 #ifdef CONFIG_USE_IRQ
178 #define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
179 #define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
180 #endif
181
182 /*-----------------------------------------------------------------------
183 * Physical Memory Map
184 */
185 #if defined(CONFIG_SMDK2410) // snallie
186 #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
187 #define PHYS_SDRAM_1 0x30000000 /* SDRAM Bank #1 */
188 #define PHYS_SDRAM_1_SIZE 0x02000000 /* 32 MB */
189
190 #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
191 #define PHYS_FLASH_SIZE 0x00100000 /* 1 MB */
192
193 #define CFG_FLASH_BASE PHYS_FLASH_1
194 #endif // snallie
195
196 #if defined(CONFIG_MINI2440) // snallie
197 #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
198 #define PHYS_SDRAM_1 0x30000000 /* SDRAM Bank #1 */
199 #define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
200
201 #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
202 #define PHYS_FLASH_SIZE 0x00200000 /* 2 MB */
203
204 #define CFG_FLASH_BASE PHYS_FLASH_1
205 #endif // snallie
/*
* 196~205行定义了RAM的起始地址及RAM的大小以及FLASH的起始地址及FLASH的大小。
*/
206 /*-----------------------------------------------------------------------
207 * FLASH and environment organization
208 */
209 #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
210 #define CFG_MAX_FLASH_SECT (19) /* max number of sectors on one chip */
211
212 /* timeout values are in ticks */
213 #define CFG_FLASH_ERASE_TOUT (5*CFG_HZ) /* Timeout for Flash Erase */
214 #define CFG_FLASH_WRITE_TOUT (5*CFG_HZ) /* Timeout for Flash Write */
215
216 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* Addr of Environment Sector */
217 #define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
218
219 // snallie
220 /*-----------------------------------------------------------------------
221 * KERNEL configs
222 */
223 #define CONFIG_KERNEL_OFFSET_ON_NAND 0x50000
224 #define CONFIG_KERNEL_SIZE 0x200000
225 // snallie
/*
* 223~224行定义了Linux内核文件在NANDFLASH上的起始地址以及内核文件的大小。
*/
226 #endif /* __CONFIG_H */
///////////
修改board/mini2440/Makefile,将 boot_init.c 编译到映像模块中,如下:
1 #
2 # (C) Copyright 2000, 2001, 2002
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # See file CREDITS for list of people who contributed to this
6 # project.
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 # MA 02111-1307 USA
22 #
23
24 include $(TOPDIR)/config.mk
25
26 LIB = lib$(BOARD).a
27
28 # OBJS := smdk2410.o flash.o env.o # snallie, 2011-05-24_193056_Tue
29 OBJS := mini2440.o flash.o env.o boot_init.o # snallie, 2011-05-24_193056_Tue
# 第29行追加boot_init.o ,使得boot_init.c被编译到映像模块中
30 SOBJS := memsetup.o
31
32 $(LIB): $(OBJS) $(SOBJS)
33 $(AR) crv $@ $^
34
35 clean:
36 rm -f $(SOBJS) $(OBJS)
37
38 distclean: clean
39 rm -f $(LIB) core *.bak .depend
40
41 #########################################################################
42
43 .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
44 $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
45
46 -include .depend
47
48 #########################################################################
/////////////
