本文共 29693 字,大约阅读时间需要 98 分钟。
|
(0)修改寄存器地址定义
|
(1)修改中断禁止部分
|
(2)修改时钟设置(2440的主频为405MHz。)
|
红色部分是我添加的,利用vivi的代码。
(3)将从Flash启动改成从NAND Flash启动。在以下U-Boot的重定向语句段:
|
的后面添加上:
|
|
修改目的:如果看到只有LED1亮了,说明U-Boot的第一阶段已完成!(针对友善之臂SBC2440V4,不是这块开发板的,必须修改或不添加)
在 “ _start_armboot: .word start_armboot ” 后加入:
|
2 在board/tekkaman/tekkaman2440加入NAND Flash读函数文件,拷贝vivi中的nand_read.c文件到此文件夹即可:
|
3 修改board/tekkaman/tekkaman2440/Makefile文件
|
4 修改include/configs/tekkaman2440.h文件,添加如下内容:
|
5 修改board/tekkaman/tekkaman2440/lowlevel_init.S文件 依照开发板的内存区的配置情况, 修改board/tekkaman/tekkaman2440/lowlevel_init.S文件,我利用友善之臂提供的vivi源码里的信息做了如下更改:
|
|
7 为了实现NAND Flash的读写,再次修改/include/configs/tekkaman2440.h
(请格外注意:如果编译时报错,在Linux下用KWrite等有高亮显示的文本编辑器看看文件的注释是不是为注释应有的颜色(KWrite中为灰色),如果不是,则将注释删除。因为#define后面的注释被认为是程序的一部分。建议注释和#define分行写)
|
8、在个文件中添加“CONFIG_S3C2440”,使得原来s3c2410的代码可以编译进来。
(1)/include/common.h文件的第474行:
|
(2)/include/s3c24x0.h文件的第85、95、99、110、148、404行:将“#ifdef CONFIG_S3C2410”改为
|
顺便在其中加入2440 的NAND FLASH 寄存器定义(第160行附近)和CAMDIVN定义(第128行附近):
|
(3)/cpu/arm920t/s3c24x0/interrupts.c文件的第33行:
|
第38行:
|
在个文件中添加“defined(CONFIG_tekkaman2440)”,使得原来SBC2410X的代码可以编译进来。第181行:
|
(4)/cpu/arm920t/s3c24x0/serial.c文件的第22行:
|
第26行:
|
(5)/cpu/arm920t/s3c24x0/speed.c文件的第33行:
|
第37行:
|
顺便修改源代码,以匹配s3c2440:
|
(6)/cpu/arm920t/s3c24x0/usb_ohci.c文件的第45行:
|
(7)drivers/rtc/s3c24x0_rtc.c文件的第35行:
|
|
|
|
(10)drivers/usb/usb_ohci.c文件的第68行附近:
|
9、在 include/linux/mtd/nand_ids.h的结构体nand_flash_ids加入
|
修改include/linux/mtd/nand.h
|
10、修改/lib_arm中的board.c。
|
11、 修改common/env_nand.c
|
|
三、交叉编译U-Boot。
在U-Boot的根目录下$make一阵English飘过~~~~~~~~~~~~~~~~~~~~~~~ 这篇文章的移植使用CS8900网卡。tftp功能是可用的.转载地址:http://ejsqi.baihongyu.com/