1 /*
2 * (C) Copyright 2000
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 "version.h"
25 #include "armboot.h"
26
27 const char version_string[] =
28 ARMBOOT_VERSION " (" __DATE__ " - " __TIME__ ")";
29
30 void display_banner(bd_t *bd)
31 {
32 printf ("\n\n%s\n\n", version_string);
33 printf("You know that ARMboot is the ancestor of U-boot project.\n"); // snallie
34 printf("Rebuilt to accommodate the MINI2440 board, by snallie@tom.com\nFeb 11 2011 ~ %s\n", __DATE__); //snallie
35 printf("gcc version: %s\n\n",__VERSION__); // snallie
/*
* 33~35行显示个性化的启动信息,并显示所用的交叉编译器的版本信息. 本文件只修改该处
*/
36
37 printf("ARMboot code: %08lx -> %08lx\n", _armboot_start, _armboot_end);
38 #ifdef CONFIG_USE_IRQ
39 printf("IRQ Stack: %08lx\n", IRQ_STACK_START);
40 printf("FIQ Stack: %08lx\n", FIQ_STACK_START);
41 #endif
42 }
43
44 static void pretty_print_size(ulong size)
45 {
46 if (size > 0x100000)
47 printf("%ld MB", size / 0x100000);
48 else
49 printf("%ld KB", size / 0x400);
50 }
51
52 void display_dram_config(bd_t *bd)
53 {
54 int i;
55
56 printf("DRAM Configuration:\n");
57
58 for(i=0; i<CONFIG_NR_DRAM_BANKS; i++)
59 {
60 printf("Bank #%d: %08lx ", i, bd->bi_dram[i].start);
61 pretty_print_size(bd->bi_dram[i].size);
62 printf("\n");
63 }
64 }
65
66 void display_flash_config(bd_t *bd, ulong size)
67 {
68 printf("Flash: ");
69 pretty_print_size(size);
70 printf("\n");
71 }
//////////
全部的修改完毕,编译测试:
[root@arm armboot-1.1.0]# make distclean ;make mini2440_config ; make all
生成 armboot.bin,将其烧到NandFlash 上,即可直接从NandFlash 启动,启动后3秒内没有键盘动作,则自动执行nboot 命令,
启动linux内核如下所示:
ARMboot 1.1.0 (May 23 2011 - 21:49:08)
You know that ARMboot is the ancestor of U-boot project.
Rebuilt to accommodate the MINI2440 board, by snallie@tom.com
Feb 11 2011 ~ May 23 2011
gcc version: 2.95.3 20010315 (release)
ARMboot code: 31f00000 -> 31f168b4
DRAM Configuration:
Bank #0: 30000000 64 MB
Flash: 2 MB
*** Using default environment
Hit any key to stop autoboot: 0
Reading kernel...
Ok
Starting Linux kernel...
Uncompressing Linux.............................................................
..................................................................... done, boot
ing the kernel.
Linux version 2.6.29.4-FriendlyARM (root@russell-work-pc) (gcc version 4.3.2 (So
urcery G++ Lite 2008q3-72) ) #2 Tue Jun 9 16:26:18 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: FriendlyARM Mini2440 development board
....
略去较长的输出信息
//////////
移植结束 生成patch:
[root@armdev arms]# diff -urNwB armboot-1.1.0 armboot-1.1.0-gk >armboot-org2mini2440.diff
/////////
小结:上面列出了ARMboot移植时候涉及到的文件及修改的位置,和修改的说明,或许直接粘贴页面上的代码难免出错误,
为方便使用,提供了如下文件包以供使用:
armboot-1.1.0.tgz : 原始的armboot程序包
armboot-1.1.0-gk-20110523_215234.tar.gz : 移植完成后的程序包,解开后直接编译(要有arm-linux-gcc-2.95.3的交叉编译器)
编译方法:make distclean ;make mini2440_config ; make all
armboot-org2mini2440.diff : patch补丁包
补丁方法:将原始的armboot程序包armboot-1.1.0.tgz 解开后,将armboot-org2mini2440.diff文件放到和armboot-1.1.0的同级目录上,不要拷贝到 armboot-1.1.0 目录里面,
进到 armboot-1.1.0 执行如下的patch命令即可
patch -p1 < ../armboot-org2mini2440.diff
ARMBoot-1.1.0 在 mini2440 移植 编译后的二进制程序 可以直接烧写到Flash或下载到0x31f00000地址处运行
/////////
致谢:移植过程中使用到了若干开源代码,对这些开源代码的作者表示衷心的感谢,感谢您们的辛勤劳动和无私奉献精神!!
////////附图:
