mini2440移植uboot 2014.04(四)
我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git
参考文章: 《mini2440移植uboot 2011.03(上)》
前几篇博文: 《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(四)的更多相关文章
- mini2440移植uboot 2014.04(五)
代码上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440 前几篇博文: <mini2440移植uboot 2014.04 ...
- mini2440移植uboot 2014.04(二)
我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文章: <u-boot-2011 ...
- mini2440移植uboot 2014.04(七)
上一篇博文:<mini2440移植uboot 2014.04(六)> 代码已经上传到github上: https://github.com/qiaoyuguo/u-boot-2014.04 ...
- mini2440移植uboot 2014.04(六)
上一篇博文:<mini2440移植uboot 2014.04(五)> 代码已经上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04- ...
- mini2440移植uboot 2014.04(三)
我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文档: s3c2440手册(下载地址) ...
- mini2440移植uboot 2014.04(一)
最新版的uboot添加了很多新功能,我决定在最新版代码基础上重新移植一遍加深理解. 我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot- ...
- mini2440移植uboot 2011.03(下)
参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 移植(五)添加nand支持: host@debian:~/soft/mini2440/u-boo ...
- mini2440移植uboot 2011.03(上)
参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 本来我想移植最新版的uboot,但是移植却不太成功,所以先模仿他人的例子重新执行一遍,对uboo ...
- 移植u-boot.2012.04.01
/*************************************************** *u-boot版本:u-boot2012.04.01 *gcc版本:arm-linux-gcc ...
随机推荐
- requests 模块入门玩法和高级玩法
1.安装 pip install requests 2. http://docs.python-requests.org/zh_CN/latest/user/quickstart.html http: ...
- springboot学习(一) spring-boot是什么
1.简介 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程. 2.主要优点 ① 使配置变得简单 ② 使编码变得简单 ③ 使 ...
- Babel中的stage-0,stage-1,stage-2以及stage-3
大家知道,将ES6代码编译为ES5时,我们常用到Babel这个编译工具.大家参考一些网上的文章或者官方文档,里面常会建议大家在.babelrc中输入如下代码: { "presets" ...
- 数据库操作事物的四大特性以及MySQL数据库的四种隔离级别
1 .事物操作数据库的四大特性(ACID) 1.原子性 (Atomicity) 原子性:就是事物的所包含的所有操作,要么全部成功,要么全部失败回滚. 2.一致性 (Consistency) 一致性:简 ...
- oracle如何进行索引监控分析和优化
在生产环境.我们会发现: ① 索引表空间 I/O 非常高 ② "db file sequential read" 等待事件也比较高 这种迹象表明.整个数据库系统.索引的 ...
- Creating External Table - KUP-04020
原因:因为操作系统环境不同,所以换行符也不同,要查看数据文件的换行符 解决方法: 1.如果是苹果系统类的数据文件,则改为:RECORDS DELIMITED BY 0X'0D' 2.如果是window ...
- 机器学习13—PCA学习笔记
主成分分析PCA 机器学习实战之PCA test13.py #-*- coding:utf-8 import sys sys.path.append("pca.py") impo ...
- 13 Memcached 永久数据被踢现象
一:Memcached 永久数据被踢现象(1)网上有人反映"memcached"数据丢失,明明设为永久不失效,却莫名其妙的丢失了. 其实这要从2个方面来找原因. 即使前面介绍的惰性 ...
- 嵌入式开发之字符叠加---gb2313 国标码,utf8 国际码,unicode 无码
(1)国标码简介 (2)编码转换 (3)时间获取 (4)显示切换 最近做了个字符叠加,包括时间叠加,字符中文叠加,位置移动,等功能开启.因为一般的字符叠加的点阵式16位,然后填充着16位的编码是gb2 ...
- 大数据hadoop之zookeeper
一.ZooKeeper 的实现 1.1 ZooKeeper处理单点故障 我们知道可以通过ZooKeeper对分布式系统进行Master选举,来解决分布式系统的单点故障,如图所示. 图 1.1 ZooK ...