ARMBoot-1.1.0 在 mini2440 开发板上的移植(二)

2014-11-24 09:02:05 ? 作者: ? 浏览: 5
*/
#define CONFIG_SMDK2410 1 /* on an SAMSUNG SMDK2410 Board */


顺着这个线索,我们看看在原有的SMDK2410的代码有那些和CONFIG_S3C2410和CONFIG_SMDK2410的代码,以及它们分布在那些文件中:


看程序的连接脚本: board/mini2440/armboot.lds
33 .text :
34 {
35 cpu/arm920t/start.o (.text)
36 *(.text)
37 }

知道程序的入口在cpu/arm920t/start.S上(现在U-boot中的该文件还保持着原有的风格)
查看该文件,知道整个程序的主要调用顺序为:
cpu_init_crit-> memsetup(在board/mini2440/memsetup.S中)
->start_armboot (在common/board.c中)
void start_armboot(void)进行了一系列的初始化工作,最后就进入
for (;;) {
main_loop(&bd);
}
主要是接受串口命令,分析并执行命令的循环中。


*************************************************************************************************************************************************
** 各个相关文件的修改 (为了便于说明,代码加了行号(所有新修改的代码均有snallie字样的注释,以示区别,并在代码段的下方对应中文注释说明)
*************************************************************************************************************************************************


////////////////////////
cpu/arm920t/start.S的修改


1 /*
2 * armboot - Startup Code for ARM920 CPU-core
3 *
4 * Copyright (c) 2001 Marius Gr鰃er
5 * Copyright (c) 2002 Alex Z黳ke
6 * Copyright (c) 2002 Gary Jennejohn
7 *
8 * See file CREDITS for list of people who contributed to this
9 * project.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 * MA 02111-1307 USA
25 */
26
27
28
29 #include "config.h"
30 #include "version.h"
31
32
33 /*
34 *************************************************************************
35 *
36 * Jump vector table as in table 3.1 in [1]
37 *
38 *************************************************************************
39 */
40
41
42 .globl _start
43 _start: b reset
44 ldr pc, _undefined_instruction
45 ldr pc, _software_interrupt
46 ldr pc, _prefetch_abort
47 ldr pc, _data_abort
48 ldr pc, _not_used
49 ldr pc, _irq
50 ldr pc, _fiq
51
52 _undefined_instruction: .word undefined_instruction
53 _software_interrupt: .word software_interrupt
54 _prefetch_abort: .word prefetch_abort
55 _data_abort: .word data_abort
56 _not_used: .word not_used
57 _irq: .word irq
58 _fiq: .word fiq
59
60 .balignl 16,0xdeadbeef
61
62
63 /*
64 **********

-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: