移植u-boot-2016.01到mini2440开发板

时间:2021-10-25 14:46:25

  待业在家闲着无聊,想把整个嵌入式系统从头复习一下,首先从开源bootloader:u-boot开始。从这里下载u-boot 代码,我下载的是2016年1月份的,这个比较新,没有前人移植的记录(以前也读过u-boot1.1.6 的部分代码那都是史前级的,跟现代的u-boot差别太大了)。

说下移植前的准备:
ubuntu 环境:

$ cat /etc/issue
Ubuntu 14.04.4 LTS \n \l
$ uname -a
Linux ubuntu 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:27 UTC 2016 i686 i686 i686 GNU/Linux
xsc@ubuntu:~/work/openjtag-uboot$

安装交叉编译器,并设置好环境,参考arm-none-linux-gnueabi-gcc下载 一文。

设置 ubuntu 下 openjtag工作环境,有openjtag的可以参考自带的 相关文档。

下载解压u-boot 到工作目录。

首先搜索下整个工程有没有mini2440关键字,找到以前的移植记录:

$ find -name "*" |xargs grep -s mini2440
./arch/arm/include/asm/mach-types.h:# define machine_is_mini2440() (machine_arch_type == MACH_TYPE_MINI2440)
./arch/arm/include/asm/mach-types.h:# define machine_is_mini2440() (0)
./doc/README.scrapyard:mini2440 arm arm920t af5b9b1f 2014-01-13 Gabriel Huau <contact@huau-gabriel.fr>

看到doc下有mini2440字样,一阵窃喜还以为u-boot已经支持mini2440了呢,再仔细看scrapyard 原来是“废品”的意思。 打开文件看下:

Over time, support for more and more boards gets added to U-Boot -
while other board support code dies a silent death caused by
negligence in combination with ordinary bitrot. Sometimes this goes
by unnoticed, but often build errors will result. If nobody cares any
more to resolve such problems, then the code is really dead and will
be removed from the U-Boot source tree. The remainders rest in piece
in the imperishable depths of the git history. This document tries to
maintain a list of such former fellows, so archaeologists can check
easily if there is something they might want to dig for...
The list should be sorted in reverse chronological order.

大意是说 mini2440 没有人来维护,已经与2014年1月13号从u-boot里面移除了。

好吧,那就自己再重新加上吧。

移植过程中参考别人博客:
u-boot-2014.10移植