Tech memo of imx27 pdk(3) -- For network and rootfs mounting problems
来源:互联网 发布:python echarts 编辑:程序博客网 时间:2024/05/21 01:56
At the end of Tech memo of imx27 pdk(2), we saw the kernel hang-up after trying to bring up eth0. I would introduce some hardware knowledge before fixing this issue.
imx27 pdk has two ne2k cark, they are
lan8700, which is soldered to core board, and
lan9217, which is soldered to debug board.
The first one is configure to eth0 while the rest one is configure to eth1. Though they are both from SMSC but they have different dirvers in kernel. The driver of lan8700, so far as i know, is in drivers/net/fec.c, which is somehow created by Motorola while the driver of lan9217 is in drivers/net/smsc911x.c. If you are interested you can study their driver to see how the ne2k chip works.
Ok let's go back to the issue. My finding is, in my redboot booting scripts, i didn't assign MAC address to the net card i want to bring up.
So i changed the script to this:
exec -b 0x100000 -l 0x200000 -c "console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.10.212:/home/hongao_client/ltib/rootfs_fr_jffs2_img init=/linuxrc ip=192.168.10.119:192.168.10.1:192.168.10.1:255.255.255.0 fec_mac=00:04:9F:00:D4:8F"
and If you dun want to use DHCP, you can change the code like below:
(net/ipv4/ipconfig.c)
static int __init ip_auto_config(void)
{
... ...
/*
* If the config information is insufficient (e.g., our IP address or
* IP address of the boot server is missing or we have multiple network
* interfaces and no default was set), use BOOTP or RARP to get the
* missing values.
*/
printk(KERN_INFO "[HONGAO DBG]%s:%d/n", __FUNCTION__, __LINE__);
ic_dev = ic_first_dev->dev;
printk("/n device=%s", ic_dev->name);
printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
printk(",/n host=%s, domain=%s, nis-domain=%s",
utsname()->nodename, ic_domain, utsname()->domainname);
printk(",/n bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
printk(", rootpath=%s", root_server_path);
printk("/n");
if (ic_myaddr == NONE ||
#ifdef CONFIG_ROOT_NFS
(MAJOR(ROOT_DEV) == UNNAMED_MAJOR
&& root_server_addr == NONE
&& ic_servaddr == NONE)// ||
#endif
/**hongao mask temp to force kernel to use staic IP*/
/*ic_first_dev->next*/) {
#ifdef IPCONFIG_DYNAMIC
... ...
}
And we better write a script for building code:
/home/hongao_client/ltib/hongao.sh:
#!/bin/bash
cd /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22/
make ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
cd /home/hongao_client/ltib/
./ltib -p kernel -m scinstall
Ok then reboot, you will see:
[HONGAO DBG]fec_enet_open:2732 config:dev name=eth0
[HONGAO DBG]fec_set_mac_address:MAC=d48f880800049f00
[HONGAO DBG]fec_enet_open:2744, fep->phy=true
[HONGAO DBG] fep->phy->ack_int=0xc02f6774
[HONGAO DBG] fep->phy->config=0xc02f6734
[HONGAO DBG]mii_queue_config:2596 config:dev name=eth0
[HONGAO DBG]mii_display_config:2491
eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
[HONGAO DBG]fec_enet_open:2763
[HONGAO DBG]fec_enet_open:2774
[HONGAO DBG]fec_enet_open:2777
eth1: SMSC911x/921x identified at 0xc885e000, IRQ: 256
eth1: SMSC911x MAC Address: 00:04:9f:00:d2:b0
eth1: link down
[HONGAO DBG]ip_auto_config:1285
device=eth0, addr=192.168.10.119, mask=255.255.255.0, gw=192.168.10.1,
host=(none), domain=, nis-domain=(none),
bootserver=192.168.10.1, rootserver=192.168.10.212, rootpath=
[HONGAO DBG] ip_auto_config:1364
[HONGAO DBG] root_server_path=
IP-Config: Complete:
device=eth0, addr=192.168.10.119, mask=255.255.255.0, gw=192.168.10.1,
host=192.168.10.119, domain=, nis-domain=(none),
bootserver=192.168.10.1, rootserver=192.168.10.212, rootpath=
[HONGAO DBG]do_initcalls end:711
Looking up port of RPC 100003/2 on 192.168.10.212
eth0: status: link up, 100MBit Full Duplex.
[HONGAO DBG]mii_relink:2547:linked already!!!
[HONGAO DBG]fec_set_mac_address:MAC=d48f880800049f00
Looking up port of RPC 100005/1 on 192.168.10.212
VFS: Mounted root (nfs filesystem).
Freeing init memory: 428K
[HONGAO DBG]init_post:770
[HONGAO DBG]init_post:779:exe cmd:/linuxrc
init started: BusyBox v1.6.1 () multi-call binary
starting pid 790, tty '': '/etc/rc.d/rcS'
Setting the hostname to freescale
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
Mounting filesystems
mount: sysfs already mounted or /sys busy
mount: according to mtab, /sys is already mounted on /sys
Starting syslogd and klogd
Let's make a rootfs folder on nfs server. A correct rootfs folder could be extracted from offical rootfs.jffs2 by the following commands:
modprobe mtdblock
rmmod mtdram
modprobe mtdram total_size=65536 erase_size=128
modprobe jffs2
dd if=ImageFile of=/dev/mtdblock0
mount /dev/mtdblock0 /home/hongao_client/ltib/rootfs_fr_jffs2_img -t jffs2
on nfs server, my setting is:
[leocdsc@localhost ltib]$ cat /etc/exports
/home/hongao_client *(rw,sync,no_root_squash)
/home/hongao_client/ltib/rootfs *(rw,sync,no_root_squash)
/home/hongao_client/ltib/rootfs_fr_jffs2_img *(rw,sync,no_root_squash)
#/home/hongao_client/utu/s3c2440_recover *(rw,sync,no_root_squash)
[leocdsc@localhost ltib]$ showmount -e
Export list for localhost.localdomain:
/home/hongao_client *
/home/hongao_client/ltib/rootfs *
/home/hongao_client/ltib/rootfs_fr_jffs2_img *
Ok, Good! we can successfully enter in command line now. But LCD still has some problems. Let's fix it up in the following sessions.
- Tech memo of imx27 pdk(3) -- For network and rootfs mounting problems
- Tech memo of imx27 pdk (1) -- For kernel building on imx27 pdk with ltib
- Tech memo of imx27 pdk (2) -- For hacking linux booting code
- Tech memo of imx27 pdk(4) -- Running linux-2.6.38 on imx27 pdk
- MEMO of Linux and git command lines
- LAMP Configure Memo - For Debian And CentOS
- Computer Vision for Autonomous Vehicles: Problems, Datasets and State-of-the-Art
- Computer Vision for Autonomous Vehicles: Problems, Datasets and State-of-the-Art
- 【翻译】Computer Vision for Autonomous Vehicles:Problems,Datasets and State-of-Art
- Common Problems (and Their Solutions) for java
- the process of rootfs ups for kernel 2.6.13
- Mounting Network Drive Ubuntu 8.04
- [Memo] Tips and Tricks for using C++ I/O.
- Flex 3:Feature Introductions: Performance and Memo
- Twitter.framework Problems building for both iOS4.3 and iOS5.0
- Network problems last Friday
- Ground loop problems and how to get rid of them
- Handbook of Applied Algorithms: Solving Scientific, Engineering, and Practical Problems
- 泡妞高手经典秘技之:日后再说
- Power Shell 学习笔记(二)所谓对象
- Qt Ui 头文件研究
- Warning: Unexpected character in input: '' (ASCII=21) state=1 in /usr/local/php/bin/php-cgi on line 383
- Java编码问题完全解决方案
- Tech memo of imx27 pdk(3) -- For network and rootfs mounting problems
- AutoHotKey变量使用方法
- PHP 获取指定日期星期几
- Android UI学习 - ListView
- 如何快速搜索本博客的文章
- 删除无效软连接
- LiveZilla 详细 配置 设置 (四) 查看成果及总结
- POI通用方法
- 创建完整团队的艺术:敏捷如何改变我们与客户的工作方式