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 ...
随机推荐
- ios 从url字符串中获取图片名字
NSString *str = @"http://pic92.nipic.com/file/20160323/22486259_160209631000_2.jpg"; NSLog ...
- DASH简介及使用方法(FFmpeg, MP4Box)
DASH 为什么选择DASH YouTube采用DASH!其网页端及移动端APP都使用了DASH.DASH的其他采用者包括:Netflix, Hulu, … 什么是DASH 一种服务端.客户端的流媒体 ...
- Oracle database datafile header中记录的datafile的大小
本文的环境:Oracle Databae 12.1.0.2, rhel5.9 x86-64bit [oracle@rhel59 orcl]$ pwd /u01/app/oracle/oradata/o ...
- 走进windows编程的世界-----消息处理函数(3)
二 定时器消息 1 定时器消息 WM_TIMER 依照定时器设置时间段,自己主动向窗体发送一个定时器消息WM_TIMER. 优先级比較低. 定时器精度比較低,毫秒级别.消息产生时间也精度比較低 ...
- CNN 防止过拟合的方法
CNN 防止过拟合的方法 因为数据量的限制以及训练参数的增多,几乎所有大型卷积神经网络都面临着过拟合的问题,目前常用的防止过拟合的方法有下面几种: 1. data augmentation: ...
- mysql更改表结构:添加、删除、修改字段、调整字段顺序
添加字段: alter table `user_movement_log` Add column GatewayId int not null default 0 AFTER `Regionid` ( ...
- python socket编程(socket)
代码如下: server端: import sockets=socket.socket(socket.AF_INET,socket.SOCK_STREAM)host=socket.gethostnam ...
- js 正则匹配 域名【host】
如果直接在js中是可以直接取到hostname的,以下方式是通过正则匹配: var url = "http://www.cnblogs.com/cench" var reg = / ...
- 《Python基础教程》第20章学习笔记
python实现:https://github.com/captainwong/instant_markup c++实现:https://github.com/captainwong/instant_ ...
- Java反射获取对象成员属性,getFields()与getDeclaredFields()方法的区别
Java反射获取对象成员属性,getFields()与getDeclaredFields()方法的区别 在工作中遇到一个问题,就是你需要去判断某个字符串是不是对象的某个成员属性名,然后根据判断结果 ...