我修改的代码已经上传到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. Write operations are not allowed in read-only mode (FlushMode.MANUAL)

    © 版权声明:本文为博主原创文章,转载请注明出处 1.问题描述 搭建SSH框架后,为测试事务配置是否生效,因此在事务配置中取消了保存方法,然后再保存方法中手动抛出异常(已测试配置事务后没有保存成功), ...

  2. PriorityBlockingQueue优先队列的二叉堆实现

    转载请注明原创地址http://www.cnblogs.com/dongxiao-yang/p/6293807.html java.util.concurrent.PriorityBlockingQu ...

  3. TransactionScope的用法

    using (TransactionScope ts = new TransactionScope()) { Model.user_login_log model = new Model.user_l ...

  4. Junit内部解密之三: 单元测试用例运行的全过程

    转自:http://blog.sina.com.cn/s/blog_6cf812be0100x8sb.html 我们以一个非常简单的TestCalculator类为例,只有一个测试方法: Public ...

  5. Rserve方式连接别的服务器

    Rserve Rserve的方式,这是一个基于TCP/IP的服务器,通过二进制协议传输数据,可以提供远程连接,使得客户端语言能够调用R 既然是TCP/IP 就可以在不同的机器上运行了 事实上官网给出了 ...

  6. 第1章列表处理——1.1 Lisp列表

    Lisp是啥? Lots of Isolated Silly Parentheses (大量分离的愚蠢的括号) Lisp指的是"LISt Processing"(列表处理),通过把 ...

  7. php使用imagick模块实现图片缩放、裁剪、压缩示例

    PHP 使用Imagick模块 缩放,裁剪,压缩图片 包括gif图片 缩放 裁剪 复制代码代码如下: /**  * 图片裁剪  * 裁剪规则:  *   1. 高度为空或为零   按宽度缩放 高度自适 ...

  8. css3 jQuery实现3d搜索框+为空推断

    <!DOCTYPE html> <html> <head> <title>css3实现3d搜索框</title> <style> ...

  9. PL/0编译程序

    Pl/0语言文法的BNF表示: 〈程序〉→〈分程序>. 〈分程序〉→ [<常量说明部分>][<变量说明部分>][<过程说明部分>]〈语句〉 <常量说明部 ...

  10. java学习笔记之String.Split方法

    hello 大家好,好久不见,今天 我们要讨论的是java的split方法,或许你很早就知道了,但你真的知道吗? 我们来看看吧. 首先我们来看看我们最常用的split()方法也就是单个参数的方法 pu ...