Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4471364
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-04-05 19:15:04

1.linux内核的DM9000网卡的移植完全和   [连载]2440+30.4 DM9000-platform(四)  一样,
   从 第一步 到 第六步 都是 和 2440+30.4 DM9000-platform

2. 文件系统的建立 参考TQ10年文件系统移植手册

   1.修改文件系统的 “/etc/init.d/rcS”,添加如下内容
 
  1. ifconfig lo 127.0.0.1   # 设置本地会还设备IP地址,缺省值
  2. net_set&                # 调用网络配置文件
 
   2.在文件系统的 “/sbin”目录下新建可执行文件 “net_set”,内容如下
  1. #!/bin/sh

  2. echo Try to bring eth0 interface up ...>/dev/ywx-serial0

  3. source /etc/nettype.conf
  4. if [ -f /etc/net.conf ] ; then
  5. source /etc/net.conf

  6. if [ $NETTYPE -eq 1 ] ; then
  7. ifconfig eth0 down
  8. ifconfig eth0 hw ether $MAC
  9. echo ifconfig eth0 hw ether $MAC >/dev/ywx-serial0
  10. ifconfig eth0 $IPADDR netmask $NETMASK up
  11. echo ifconfig eth0 $IPADDR netmask $NETMASK up >/dev/ywx-serial0
  12. route add default gw $GATEWAY
  13. echo add default gw $GATEWAY >/dev/ywx-serial0
  14. elif [ $NETTYPE -eq 2 ] ; then
  15. source /etc/wifi.conf
  16. ifconfig eth0 down
  17. ifconfig wlan0 $IPADDR netmask $NETMASK up
  18. echo ifconfig wlan0 $IPADDR netmask $NETMASK up >/dev/ywx-serial0
  19. route add default gw $GATEWAY
  20. echo route add default gw $GATEWAY >/dev/ywx-serial0
  21. iwconfig wlan0 essid "$NETNAME" key "$PASSWORD"
  22. echo iwconfig wlan0 essid "$NETNAME" key "$PASSWORD" >/dev/ywx-serial0
  23. fi
  24. else

  25. ifconfig eth0 hw ether 10:23:45:67:89:ab
  26. ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up
  27. route add default gw 192.168.1.2
  28. echo ifconfig eth0 hw ether 10:23:45:67:89:ab >/dev/ywx-serial0
  29. echo ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up >/dev/ywx-serial0
  30. echo route add default gw 192.168.1.2 >/dev/ywx-serial0
  31. fi

  32. 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  存放网络配置的信息
  1. IPADDR=192.168.1.6
  2. NETMASK=255.255.255.0
  3. GATEWAY=192.168.1.2
  4. MAC=10:23:45:67:89:ab

  当我们需要修改网卡的IP等的时候,只需要修改 “/etc/net.conf”文件的内容执行一下
net_set 命令即可。

到这里,我们设置完文件系统了,mkyaffs2imag root-2.6.33 roo-2.6.33.bin 就可以了下载到板子了


4.下载启动过程中,出现一个错误
  1. /sbin/net_set: source: line 5: can't open '/etc/nettype.conf
  2. Please press Enter to activate this console.
    [root@yuweixian /]# ifconfig
修改如下:
   1.在文件系统新建  /etc/nettype.conf     
  1. CDMAUSE=0
  2. NETTYPE=1
  2.或者 直接复制 tq 文件系统 /etc/nettype.conf  到自己的文件系统下


5. 做完 上面的,开发板连上网线,就可以了
   注意:这里PC主机 和 开发板 要使用相同的网段 如:192.168.1.6  192.168.1.7

   启动,OK!!!!!!!!

  1. ##### EmbedSky BIOS for SKY2440/TQ2440 #####
  2. Press Space key to Download Mode !
  3. Booting Linux ...
  4. Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
  5. Uncompressing Linux... done, booting the kernel.
  6. 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
  7. CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
  8. CPU: VIVT data cache, VIVT instruction cache
  9. Machine: SMDK2440
  10. ATAG_INITRD is deprecated; please update your bootloader.
  11. Memory policy: ECC disabled, Data cache writeback
  12. CPU S3C2440A (id 0x32440001)
  13. S3C24XX Clocks, Copyright 2004 Simtec Electronics
  14. S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
  15. CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
  16. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
  17. Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
  18. PID hash table entries: 256 (order: -2, 1024 bytes)
  19. Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
  20. Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
  21. Memory: 64MB = 64MB total
  22. Memory: 61048KB available (3272K code, 304K data, 120K init, 0K highmem)
  23. Hierarchical RCU implementation.
  24. NR_IRQS:85
  25. irq: clearing pending ext status 00080000
  26. irq: clearing subpending status 00000002
  27. Console: colour dummy device 80x30
  28. console [ttySAC0] enabled
  29. Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
  30. Mount-cache hash table entries: 512
  31. CPU: Testing write buffer coherency: ok
  32. NET: Registered protocol family 16
  33. S3C Power Management, Copyright 2004 Simtec Electronics
  34. S3C2440: Initialising architecture
  35. S3C2440: IRQ Support
  36. S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics
  37. DMA channel 0 at c4808000, irq 33
  38. DMA channel 1 at c4808040, irq 34
  39. DMA channel 2 at c4808080, irq 35
  40. DMA channel 3 at c48080c0, irq 36
  41. S3C244X: Clock Support, DVS off
  42. bio: create slab <bio-0> at 0
  43. SCSI subsystem initialized
  44. usbcore: registered new interface driver usbfs
  45. usbcore: registered new interface driver hub
  46. usbcore: registered new device driver usb
  47. s3c-i2c s3c2440-i2c: slave address 0x10
  48. s3c-i2c s3c2440-i2c: bus frequency set to 97 KHz
  49. s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
  50. Advanced Linux Sound Architecture Driver Version 1.0.21.
  51. NET: Registered protocol family 2
  52. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  53. TCP established hash table entries: 2048 (order: 2, 16384 bytes)
  54. TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
  55. TCP: Hash tables configured (established 2048 bind 2048)
  56. TCP reno registered
  57. UDP hash table entries: 256 (order: 0, 4096 bytes)
  58. UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  59. NET: Registered protocol family 1
  60. RPC: Registered udp transport module.
  61. RPC: Registered tcp transport module.
  62. RPC: Registered tcp NFSv4.1 backchannel transport module.
  63. NetWinder Floating Point Emulator V0.97 (extended precision)
  64. ROMFS MTD (C) 2007 Red Hat, Inc.
  65. yaffs Apr 5 2011 12:09:55 Installing.
  66. msgmni has been set to 119
  67. io scheduler noop registered
  68. io scheduler deadline registered
  69. io scheduler cfq registered (default)
  70. Console: switching to colour frame buffer device 30x40
  71. fb0: s3c2410fb frame buffer device
  72. lp: driver loaded but no devices found
  73. ppdev: user-space parallel port driver
  74. Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
  75. s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
  76. s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
  77. s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
  78. brd: module loaded
  79. loop: module loaded
  80. Uniform Multi-Platform E-IDE driver
  81. ide-gd driver 1.18
  82. ide-cd driver 5.00
  83. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  84. s3c24xx-nand s3c2440-nand: Tacls=2, 20ns Twrph0=6 60ns, Twrph1=2 20ns
  85. s3c24xx-nand s3c2440-nand: NAND hardware ECC
  86. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  87. Scanning device for bad blocks
  88. Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  89. 0x000000000000-0x000000040000 : "ywx-boot"
  90. 0x000000200000-0x000000400000 : "ywx-kernel"
  91. 0x000000400000-0x00000ff80000 : "ywx-yaffs2"
  92. dm9000 Ethernet Driver, V1.31
  93. Now use the default MAC address: 10:23:45:67:89:ab
  94. eth0: dm9000e at c481c000,c4820004 IRQ 51 MAC: 10:23:45:67:89:ab (yuweixian-MAC)
  95. usbmon: debugfs is not available
  96. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  97. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  98. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  99. s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
  100. hub 1-0:1.0: USB hub found
  101. hub 1-0:1.0: 2 ports detected
  102. usbcore: registered new interface driver libusual
  103. usbcore: registered new interface driver usbserial
  104. USB Serial support registered for generic
  105. usbcore: registered new interface driver usbserial_generic
  106. usbserial: USB Serial Driver core
  107. USB Serial support registered for FTDI USB Serial Device
  108. usbcore: registered new interface driver ftdi_sio
  109. ftdi_sio: v1.5.0:USB FTDI Serial Converters Driver
  110. USB Serial support registered for pl2303
  111. usbcore: registered new interface driver pl2303
  112. pl2303: Prolific PL2303 USB to serial adaptor driver
  113. mice: PS/2 mouse device common for all mice
  114. S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
  115. s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
  116. ALSA device list:
  117.   No soundcards found.
  118. TCP cubic registered
  119. NET: Registered protocol family 17
  120. yaffs: dev is 32505858 name is "mtdblock2"
  121. yaffs: passed flags ""
  122. yaffs: Attempting MTD mount on 31.2, "mtdblock2"
  123. yaffs: auto selecting yaffs2
  124. yaffs: restored from checkpoint
  125. yaffs_read_super: isCheckpointed 1
  126. VFS: Mounted root (yaffs filesystem) on device 31:2.
  127. Freeing init memory: 120K

  128. Please press Enter to activate this console. eth0: link down

  129. [root@yuweixian /]# ls
  130. bin home lost+found proc sys var
  131. dev lib mnt root tmp web
  132. etc linuxrc opt sbin usr
  133. [root@yuweixian /]# ifconfig
  134. eth0 Link encap:Ethernet HWaddr 10:23:45:67:89:AB
  135.           inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
  136.           UP BROADCAST MULTICAST MTU:1500 Metric:1
  137.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  138.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  139.           collisions:0 txqueuelen:1000
  140.           RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
  141.           Interrupt:51 Base address:0xc000

  142. lo Link encap:Local Loopback
  143.           inet addr:127.0.0.1 Mask:255.0.0.0
  144.           UP LOOPBACK RUNNING MTU:16436 Metric:1
  145.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  146.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  147.           collisions:0 txqueuelen:0
  148.           RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

  149. [root@yuweixian /]#


 




阅读(1026) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~