我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git

参考文章: 《mini2440移植uboot 2011.03(上)

前几篇博文: 《mini2440移植uboot 2014.04(一)

mini2440移植uboot 2014.04(二)

mini2440移植uboot 2014.04(三)

后一篇博文: 《mini2440移植uboot 2014.04(五)

(六)添加dm9000网卡

host@debian:~/soft/mini2440/u-boot-2014.04$ vim include/configs/mini2440.h 
删除下面代码: #define CONFIG_CS8900 /* we have a CS8900 on-board */
#define CONFIG_CS8900_BASE 0x19000300
#define CONFIG_CS8900_BUS16 /* the Linux driver does accesses as shorts */
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 10.0.0.110
#define CONFIG_SERVERIP 10.0.0.1 添加新代码: #define CONFIG_CMD_NET
#define CONFIG_DRIVER_DM9000 1
#define CONFIG_DM9000_NO_SROM 1
#define CONFIG_DM9000_BASE 0x20000300
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE + 4)
#define CONFIG_CMD_PING
#define CONFIG_ETHADDR 08:00:3e:26:0a:5b
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.211.25
#define CONFIG_SERVERIP 192.168.211.2 host@debian:~/soft/mini2440/u-boot-2011.03$ vim board/friendlyarm/mini2440/mini2440.c 在board_eth_init函数中返回语句前添加代码:
#ifdef CONFIG_DRIVER_DM9000
rc = dm9000_initialize(bis);
#endif 修改drivers/net/dm9000.c
#ifndef CONFIG_MINI2440
     i = 0;
     while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */
         udelay(1000);
         i++;
         if (i == 10000) {
             printf("could not establish link\n");
             return 0;
         }
     }
#endif

重新编译加载到mini2440,执行ping命令,得到输出信息:

SMDK2410 # ping 192.168.211.2
Trying dm9000
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in bit mode
MAC: ::3e::0a:5b
operating at 100M full duplex mode
Using dm9000 device
host 192.168.211.2 is alive

但是,当执行tftp命令时会一直超时重发:

SMDK2410 # tftp  uImage
Trying dm9000
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in bit mode
MAC: ::3e::0a:5b
operating at 100M full duplex mode
TFTP blocksize = , timeout = ms
Using dm9000 device
TFTP from server 192.168.211.2; our IP address is 192.168.211.25
Filename 'uImage'.
Load address: 0x30008000
Loading: send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5"
T send option "timeout 5" Retry count exceeded; starting again
Trying dm9000
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in bit mode
MAC: ::3e::0a:5b
operating at 100M full duplex mode
。。。。。

用wireshark抓包,才知道是udp unreachable错误,猜测tftp服务没启动好,执行/etc/init.d/tftp-hpa restart后就好了。

(七)添加对内核启动的支持:

host@debian:~/soft/mini2440/u-boot-2014.04$ vim include/configs/mini2440.h 
添加一行代码:
#define CONFIG_BOOTARGS "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0"

启动linux内核还需要有三行定义(这几行定义已经存在于include/configs/mini2440.h中,不需要重新定义):

#define CONFIG_SETUP_MEMORY_TAGS 
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG

重新编译uboot,并按照上面的步骤加载到mini2440内存并启动。

然后执行命令,按照参考文章中的说明,执行下面命令:

SMDK2410 # tftp 30007fc0 uImage
Trying dm9000
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in bit mode
MAC: ::3e::0a:5b
operating at 100M full duplex mode
TFTP blocksize = , timeout = ms
Using dm9000 device
TFTP from server 192.168.211.2; our IP address is 192.168.211.25
Filename 'uImage'.
Load address: 0x30007fc0
Loading: send option "timeout 5"
T send option "timeout 5"
Got OACK: timeout
Blocksize ack: ,
#################################################################
#################################################################
#########################
378.9 KiB/s
done
Bytes transferred = (22b2c4 hex)
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
SMDK2410 # bootm
## Current stack ends at 0x33b16d98 * kernel: default image load address = 0x30007fc0
## Booting kernel from Legacy Image at 30007fc0 ...
Image Name: Linux-2.6.32.2-FriendlyARM
Created: -- :: UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: Bytes = 2.2 MiB
Load Address:
Entry Point:
Verifying Checksum ... OK
kernel data at 0x30008000, len = 0x0022b284 ()
## No init Ramdisk
ramdisk start = 0x00000000, ramdisk end = 0x00000000
XIP Kernel Image ... OK
kernel loaded at 0x30008000, end = 0x30233284
using: ATAGS
## Transferring control to Linux (at address )... Starting kernel ... Uncompressing Linux................................................................................................................................................... .
Linux version 2.6.32.2-FriendlyARM (host@debian) (gcc version 4.4. (ctng-1.6.) ) # Wed Jun :: CST
CPU: ARM920T [] revision (ARMv4T), cr=c0007177
。。。。。。。
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
Backtrace:
[<c00341d0>] (dump_backtrace+0x0/0x10c) from [<c032bb98>] (dump_stack+0x18/0x1c)
r7: r6: r5:c001f5a4 r4:c0483e30
[<c032bb80>] (dump_stack+0x0/0x1c) from [<c032bbe8>] (panic+0x4c/0x11c)
[<c032bb9c>] (panic+0x0/0x11c) from [<c002f598>] (init_post+0xa8/0x10c)
r3: r2:c38fe000 r1:c38fe100 r0:c03dd7dc
[<c002f4f0>] (init_post+0x0/0x10c) from [<c0008634>] (kernel_init+0xe4/0x114)
r5:c001f5a4 r4:c04835c0
[<c0008550>] (kernel_init+0x0/0x114) from [<c004d914>] (do_exit+0x0/0x620)
r5: r4:
将uImage加载0x30007fc0是因为多了个0x40的文件头,代码实际入口仍然是0x30007fc0+0x40=0x30008000.
最后出现的错误是因为我的nand flash被全部擦除了,没有/linuxrc这个文件,导致内核崩溃,如果是原版的nand flash就会直接进入根文件系统
另外,nfs命令也是直接可用的,将内核文件拷贝到nfs系统文件夹下,启动nfs(nfs和tftp的配置可以参看我的博文《debian7配置》),
然后在uboot下用"nfs 30007fc0 /home/host/nfs/mini2440/uImage"命令可以下载uImage,使用bootm可以执行,执行效果和tftp一样。
(八)修改uboot系统提示符
当前uboot提示符仍然是"SMDK2410 #",需要将其改成"MINI2440 #",只需要修改include/configs/mini2440.h中的CONFIG_SYS_PROMPT宏定义,将SMDK2410替换成MINI2440。
然后重新编译加载uboot到mini2440,可以看到命令行已经被修改了:
MINI2440 # 

  

mini2440移植uboot 2014.04(四)的更多相关文章

  1. mini2440移植uboot 2014.04(五)

    代码上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440 前几篇博文: <mini2440移植uboot 2014.04 ...

  2. mini2440移植uboot 2014.04(二)

    我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文章: <u-boot-2011 ...

  3. mini2440移植uboot 2014.04(七)

    上一篇博文:<mini2440移植uboot 2014.04(六)> 代码已经上传到github上: https://github.com/qiaoyuguo/u-boot-2014.04 ...

  4. mini2440移植uboot 2014.04(六)

    上一篇博文:<mini2440移植uboot 2014.04(五)> 代码已经上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04- ...

  5. mini2440移植uboot 2014.04(三)

    我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文档: s3c2440手册(下载地址) ...

  6. mini2440移植uboot 2014.04(一)

    最新版的uboot添加了很多新功能,我决定在最新版代码基础上重新移植一遍加深理解. 我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot- ...

  7. mini2440移植uboot 2011.03(下)

    参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 移植(五)添加nand支持: host@debian:~/soft/mini2440/u-boo ...

  8. mini2440移植uboot 2011.03(上)

    参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 本来我想移植最新版的uboot,但是移植却不太成功,所以先模仿他人的例子重新执行一遍,对uboo ...

  9. 移植u-boot.2012.04.01

    /*************************************************** *u-boot版本:u-boot2012.04.01 *gcc版本:arm-linux-gcc ...

随机推荐

  1. IBM Security App Scan 资料整理

    转自:http://blog.csdn.net/u013147600/article/details/50002089 这是学习和使用IBM AppScan过程中总结整理的一些资料.   扫描系统操作 ...

  2. MySQL 查询 数据库有多少表 表名是哪些

    1.查询sjcenter数据库里开头为sj_demo和sj_onlyinv的所有表的总条数 select sum(table_rows) from (select table_name,table_r ...

  3. AngularJS路由 $state服务、路由事件、获取路由参数

    1 ui-sref.$state.go 的区别 ui-sref 一般使用在 <a>...</a>: <a ui-sref="message-list" ...

  4. AjaxPro.2.dll AjaxPro.AjaxMethod 前后台交互

    我们需要下载 AjaxPro.2.zip.然后把下载到的 AjaxPro.2.dll 的文件引入到项目. 1.接着,在 Web.config 的 <system.web> 标签下写入以下内 ...

  5. 07 在Windows下编译Memcached

    一:windows下编译Memcached (1)下载地址dll:http://down.51cto.com/data/442606 (2)在php下输出 echo phpinfo():查看php的版 ...

  6. java代码实现目录结构

    今天用java代码来实现.像我们电脑盘符那样的目录结构.在代码开始之前首先.介绍一下.用.java代码实现目录的思想. 第一步:完成基础的.大家想.我们是如何获取文件的.是不是用File类,直接就获取 ...

  7. php党 强烈推荐TIPI:深入理解PHP内核

    深入理解PHP内核(Thinking In PHP Internals) TIPI项目是一个自发项目, 项目主要关注PHP的内部实现, 以及PHP相关的方方面面, 该项目包括<深入理解PHP内核 ...

  8. 大数据hadoop之zookeeper

    一.ZooKeeper 的实现 1.1 ZooKeeper处理单点故障 我们知道可以通过ZooKeeper对分布式系统进行Master选举,来解决分布式系统的单点故障,如图所示. 图 1.1 ZooK ...

  9. iOS-Core-Animation-Advanced-Techniques(二)

    本文转载至 http://www.cocoachina.com/ios/20150104/10816.html 视觉效果和变换 (四)视觉效果 嗯,园和椭圆还不错,但如果是带圆角的矩形呢? 我们现在能 ...

  10. EasyDSS+EasyNVR实现幼儿园直播/工地直播等分权限观看直播视频的功能

    在EasyNVR互联网直播服务器使用说明书中有关于EasyNVR分组的介绍: "EasyNVR的功能定位就是为视频应用层输出视频设备接入/标准视频输出的能力平台层,只做基础的视频通道接入.视 ...