Tech memo of imx27 pdk(3) -- For network and rootfs mounting problems

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值