和CONFIG_SMDK2410相关的:
[root@www.linuxidc.com armboot-1.1.0]# grep -rHn CONFIG_SMDK2410 *
cpu/arm920t/serial.c:45:#elif defined(CONFIG_SMDK2410)
include/configs/config_smdk2410.h:44:#define CONFIG_SMDK2410 1 /* on an SAMSUNG SMDK2410 Board */
看程序的连接脚本: 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 *************************************************************************
65 *
66 * Startup Code (reset vector)
67 *
68 * do important init only if we don't start from memory!
69 * relocate armboot to ram
70 * setup stack
71 * jump to second stage
72 *
73 *************************************************************************
74 */
75
76 /*
77 * CFG_MEM_END is in the board dependent config-file (configs/config_BOARD.h)
78 */
79 _TEXT_BASE:
80 .word TEXT_BASE
81
82 .globl _armboot_start
83 _armboot_start:
84 .word _start
85
86 /*
87 * Note: armboot_end is defined by the (board-dependent) linker script
88 */
89 .globl _armboot_end
90 _armboot_end:
91 .word armboot_end
92
93 // start of snallie
94 .globl _bss_start
95 _bss_start:
96 .word __bss_start
97
98 .globl _bss_end
99 _bss_end:
100 .word armboot_end
101 // end of snallie
/*
* 94~100行 为新加入的代码,定义了2个全局变量,_bss_start和_bss_end,记录未初始化段的起止地址,其中的
* __bss_start和armboot_end 是在连接脚本 board/mini2440/armboot.lds 中定义的,后面309~317行用_bss_start
* 和_bss_end来进行未初始化段数据的初始清零工作。
*/
102
103 /*
104 * _armboot_real_end is the first usable RAM address behind armboot
105 * and the various stacks
106 */
107 .globl _armboot_real_end
108 _armboot_real_end:
109 .word 0x0badc0de
110
111 #ifdef CONFIG_USE_IRQ
112 /* IRQ stack memory (calculated at run-time) */
113 .globl IRQ_STACK_START
114 IRQ_STACK_START:
115 .word 0x0badc0de
116
117 /* IRQ stack memory (calculated at run-time) */
118 .globl FIQ_STACK_START
119 FIQ_STACK_START:
120 .word 0x0badc0de
121 #endif
122
123
124 /*
125 * the actual reset code
126 */
127
128 reset:
129 /*
130 * set the cpu to SVC32 mode
131 */
132 mrs r0,cpsr
133 bic r0,r0,#0x1f
134 orr r0,r0,#0xd3
135 msr cpsr,r0
136
137 /* turn off the watchdog */
138 #if defined(CONFIG_S3C2400)
139 #define pWTCON 0x15300000
140 /* Interupt-Controller base addresses */
141 #define INTMSK 0x14400008
142 /* clock divisor register */
143 #define CLKDIVN 0x14800014
144 #elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) // snallie
/* 144行 S3C2410和S3C2440的Watchdog以及中断屏蔽寄存器的地址相同,所以加入 || defined(CONFIG_S3C2440) 的判断 */
上一篇:解决mini2440声卡全双工问题 实现同时录音及播放
下一篇:mini2440上移植sqlite3.7.6.2
推荐阅读最新更新时间:2024-11-14 01:19
设计资源 培训 开发板 精华推荐
- LTC6946 的典型应用 - 具有集成 VCO 的超低噪声和杂散 0.37GHz 至 6.39GHz 整数 N 合成器
- 原神9cm小尺
- DSL 线卡的 3.3V DC 到 DC 单路输出电源
- EVAL-AD7780EBZ,用于仪表的 AD7780、24 位、16.7SPS ADC 的评估板
- MB3771 5V和12V电源监控器典型应用电路(2种电源监控器VCC1=5V,VCC2=12V)
- LT1172HVCQ、5V/1.25A 升压转换器的典型应用
- FSB50450T智能功率模块(SPM)典型应用电路
- LT3755IMSE 50W 白光 LED 头灯驱动器的典型应用电路
- 三相电机正反转模拟电路
- 8266名片_usbA 修改版
- CGD和Qorvo将共同革新电机控制解决方案
- 是德科技 FieldFox 手持式分析仪配合 VDI 扩频模块,实现毫米波分析功能
- 贸泽开售可精确测量CO2水平的 英飞凌PASCO2V15 XENSIV PAS CO2 5V传感器
- 玩法进阶,浩亭让您的PCB板端连接达到新高度!
- 长城汽车研发新篇章:固态电池技术引领未来
- 纳芯微提供全场景GaN驱动IC解决方案
- 解读华为固态电池新专利,2030 叫板宁德时代?
- 让纯电/插混车抓狂?中企推全球首款-40℃可放电增混电池,不怕冷
- 智驾域控知多少:中低端车型加速上车,行泊一体方案占主体
- Foresight推出六款先进立体传感器套件 彻底改变工业和汽车3D感知