1.linux内核的DM9000网卡的移植完全和
[连载]2440+30.4 DM9000-platform(四) 一样, 从 第一步 到 第六步 都是 和 2440+30.4 DM9000-platform
2. 文件系统的建立 参考TQ10年文件系统移植手册
1.修改文件系统的 “/etc/init.d/rcS”,添加如下内容
- ifconfig lo 127.0.0.1 # 设置本地会还设备IP地址,缺省值
-
net_set& # 调用网络配置文件
2.在文件系统的 “/sbin”目录下新建可执行文件 “net_set”,内容如下
- #!/bin/sh
-
-
echo Try to bring eth0 interface up ...>/dev/ywx-serial0
-
-
source /etc/nettype.conf
-
if [ -f /etc/net.conf ] ; then
-
source /etc/net.conf
-
-
if [ $NETTYPE -eq 1 ] ; then
-
ifconfig eth0 down
-
ifconfig eth0 hw ether $MAC
-
echo ifconfig eth0 hw ether $MAC >/dev/ywx-serial0
-
ifconfig eth0 $IPADDR netmask $NETMASK up
-
echo ifconfig eth0 $IPADDR netmask $NETMASK up >/dev/ywx-serial0
-
route add default gw $GATEWAY
-
echo add default gw $GATEWAY >/dev/ywx-serial0
-
elif [ $NETTYPE -eq 2 ] ; then
-
source /etc/wifi.conf
-
ifconfig eth0 down
-
ifconfig wlan0 $IPADDR netmask $NETMASK up
-
echo ifconfig wlan0 $IPADDR netmask $NETMASK up >/dev/ywx-serial0
-
route add default gw $GATEWAY
-
echo route add default gw $GATEWAY >/dev/ywx-serial0
-
iwconfig wlan0 essid "$NETNAME" key "$PASSWORD"
-
echo iwconfig wlan0 essid "$NETNAME" key "$PASSWORD" >/dev/ywx-serial0
-
fi
-
else
-
-
ifconfig eth0 hw ether 10:23:45:67:89:ab
-
ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up
-
route add default gw 192.168.1.2
-
echo ifconfig eth0 hw ether 10:23:45:67:89:ab >/dev/ywx-serial0
-
echo ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up >/dev/ywx-serial0
-
echo route add default gw 192.168.1.2 >/dev/ywx-serial0
-
fi
-
-
echo Done > /dev/ywx-serial0
注意: 我这里 都是
ywx-serial0 这里使用第一个串口原因如下:
2.1.在tq自己制作好的文件系统下 ,sbin/net_set
>/dev/tq2440_serial0
drivers/serial/samsung.c
第888 行 .devname=tq2440_serial
2.2.所以,仿照tq的做法, sbin/net_set
>/dev/ywx-serial0
drivers/serial/samsungd.
第888行,.devname=ywx-serial
3.在文件系统 “/etc/”目录下新建 net.conf 存放网络配置的信息
- IPADDR=192.168.1.6
-
NETMASK=255.255.255.0
-
GATEWAY=192.168.1.2
-
MAC=10:23:45:67:89:ab
当我们需要修改网卡的IP等的时候,只需要修改 “/etc/net.conf”文件的内容执行一下
net_set 命令即可。
到这里,我们设置完文件系统了,mkyaffs2imag root-2.6.33 roo-2.6.33.bin 就可以了下载到板子了
4.下载启动过程中,出现一个错误
- /sbin/net_set: source: line 5: can't open '/etc/nettype.conf
- Please press Enter to activate this console.
[root@yuweixian /]# ifconfig
修改如下:
1.在文件系统新建 /etc/nettype.conf
2.或者 直接复制 tq 文件系统 /etc/nettype.conf 到自己的文件系统下
5. 做完 上面的,开发板连上网线,就可以了
注意:这里PC主机 和 开发板 要使用相同的网段 如:192.168.1.6 192.168.1.7
启动,OK!!!!!!!!
- ##### EmbedSky BIOS for SKY2440/TQ2440 #####
-
Press Space key to Download Mode !
-
Booting Linux ...
-
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
-
Uncompressing Linux... done, booting the kernel.
-
Linux version 2.6.33-yuweixian (root@yuweixian) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #7 Tue Apr 5 18:19:05 CST 2011
-
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
-
CPU: VIVT data cache, VIVT instruction cache
-
Machine: SMDK2440
-
ATAG_INITRD is deprecated; please update your bootloader.
-
Memory policy: ECC disabled, Data cache writeback
-
CPU S3C2440A (id 0x32440001)
-
S3C24XX Clocks, Copyright 2004 Simtec Electronics
-
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
-
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
-
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
-
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
-
PID hash table entries: 256 (order: -2, 1024 bytes)
-
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
-
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
-
Memory: 64MB = 64MB total
-
Memory: 61048KB available (3272K code, 304K data, 120K init, 0K highmem)
-
Hierarchical RCU implementation.
-
NR_IRQS:85
-
irq: clearing pending ext status 00080000
-
irq: clearing subpending status 00000002
-
Console: colour dummy device 80x30
-
console [ttySAC0] enabled
-
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
-
Mount-cache hash table entries: 512
-
CPU: Testing write buffer coherency: ok
-
NET: Registered protocol family 16
-
S3C Power Management, Copyright 2004 Simtec Electronics
-
S3C2440: Initialising architecture
-
S3C2440: IRQ Support
-
S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics
-
DMA channel 0 at c4808000, irq 33
-
DMA channel 1 at c4808040, irq 34
-
DMA channel 2 at c4808080, irq 35
-
DMA channel 3 at c48080c0, irq 36
-
S3C244X: Clock Support, DVS off
-
bio: create slab <bio-0> at 0
-
SCSI subsystem initialized
-
usbcore: registered new interface driver usbfs
-
usbcore: registered new interface driver hub
-
usbcore: registered new device driver usb
-
s3c-i2c s3c2440-i2c: slave address 0x10
-
s3c-i2c s3c2440-i2c: bus frequency set to 97 KHz
-
s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
-
Advanced Linux Sound Architecture Driver Version 1.0.21.
-
NET: Registered protocol family 2
-
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
-
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
-
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
-
TCP: Hash tables configured (established 2048 bind 2048)
-
TCP reno registered
-
UDP hash table entries: 256 (order: 0, 4096 bytes)
-
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
-
NET: Registered protocol family 1
-
RPC: Registered udp transport module.
-
RPC: Registered tcp transport module.
-
RPC: Registered tcp NFSv4.1 backchannel transport module.
-
NetWinder Floating Point Emulator V0.97 (extended precision)
-
ROMFS MTD (C) 2007 Red Hat, Inc.
-
yaffs Apr 5 2011 12:09:55 Installing.
-
msgmni has been set to 119
-
io scheduler noop registered
-
io scheduler deadline registered
-
io scheduler cfq registered (default)
-
Console: switching to colour frame buffer device 30x40
-
fb0: s3c2410fb frame buffer device
-
lp: driver loaded but no devices found
-
ppdev: user-space parallel port driver
-
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
-
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
-
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
-
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
-
brd: module loaded
-
loop: module loaded
-
Uniform Multi-Platform E-IDE driver
-
ide-gd driver 1.18
-
ide-cd driver 5.00
-
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
-
s3c24xx-nand s3c2440-nand: Tacls=2, 20ns Twrph0=6 60ns, Twrph1=2 20ns
-
s3c24xx-nand s3c2440-nand: NAND hardware ECC
-
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
-
Scanning device for bad blocks
-
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
-
0x000000000000-0x000000040000 : "ywx-boot"
-
0x000000200000-0x000000400000 : "ywx-kernel"
-
0x000000400000-0x00000ff80000 : "ywx-yaffs2"
-
dm9000 Ethernet Driver, V1.31
-
Now use the default MAC address: 10:23:45:67:89:ab
-
eth0: dm9000e at c481c000,c4820004 IRQ 51 MAC: 10:23:45:67:89:ab (yuweixian-MAC)
-
usbmon: debugfs is not available
-
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
-
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
-
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
-
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
-
hub 1-0:1.0: USB hub found
-
hub 1-0:1.0: 2 ports detected
-
usbcore: registered new interface driver libusual
-
usbcore: registered new interface driver usbserial
-
USB Serial support registered for generic
-
usbcore: registered new interface driver usbserial_generic
-
usbserial: USB Serial Driver core
-
USB Serial support registered for FTDI USB Serial Device
-
usbcore: registered new interface driver ftdi_sio
-
ftdi_sio: v1.5.0:USB FTDI Serial Converters Driver
-
USB Serial support registered for pl2303
-
usbcore: registered new interface driver pl2303
-
pl2303: Prolific PL2303 USB to serial adaptor driver
-
mice: PS/2 mouse device common for all mice
-
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
-
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
-
ALSA device list:
-
No soundcards found.
-
TCP cubic registered
-
NET: Registered protocol family 17
-
yaffs: dev is 32505858 name is "mtdblock2"
-
yaffs: passed flags ""
-
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
-
yaffs: auto selecting yaffs2
-
yaffs: restored from checkpoint
-
yaffs_read_super: isCheckpointed 1
-
VFS: Mounted root (yaffs filesystem) on device 31:2.
-
Freeing init memory: 120K
-
-
Please press Enter to activate this console. eth0: link down
-
-
[root@yuweixian /]# ls
-
bin home lost+found proc sys var
-
dev lib mnt root tmp web
-
etc linuxrc opt sbin usr
-
[root@yuweixian /]# ifconfig
-
eth0 Link encap:Ethernet HWaddr 10:23:45:67:89:AB
-
inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
-
UP BROADCAST MULTICAST MTU:1500 Metric:1
-
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
-
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
-
collisions:0 txqueuelen:1000
-
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
-
Interrupt:51 Base address:0xc000
-
-
lo Link encap:Local Loopback
-
inet addr:127.0.0.1 Mask:255.0.0.0
-
UP LOOPBACK RUNNING MTU:16436 Metric:1
-
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
-
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
-
collisions:0 txqueuelen:0
-
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
-
-
[root@yuweixian /]#
阅读(1057) | 评论(0) | 转发(0) |