Chinaunix首页 | 论坛 | 博客
  • 博客访问: 214740
  • 博文数量: 20
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 235
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-14 18:47
文章分类

全部博文(20)

文章存档

2009年(6)

2008年(14)

我的朋友

分类: LINUX

2008-04-01 19:23:33

文件: cs8900-linux2.6.24-kevin.tar.bz2
大小: 4KB
下载: 下载
Linux 2.6.24.4移植到S3C2410(nano2410)之:CS8900移植

 

【平台信息】

目标板(Nano2410)------------------------

CPU:    S3C2410X

SDRAM:  HY57V561620(32MB)

FLASH: K9F1208(64MB)

NET:    CS8900

 

HOST---------------------------------------

Linux Realse Version:     Fecora Cor 8 (FC8)

CrossCompiler:             gcc-4.1.1/glibc-2.3.2

 

 

在之前的内核移植基础上,

【置顶】Linux2.6.24.4移植到S3C2410(nano2410)之:内核移植篇 "

继续进行CS8900网卡驱动移植。

 

【移植步骤】

1.       将准备好的cs8900.c, cs8900.h复制到drivers/net/arm文件夹下。(注意,网上大部分cs8900驱动都是针对2.6.14内核的,2.6.24有很大的变动,可以下载本文开头的附件cs8900-linux2.6.24-kevin.tar.bz2。

 

2.       新建文件smdk2410.h

[kevin@localhost arch-s3c2410]$ pwd

/kevin/linux-2.6.24.4/include/asm-arm/arch-s3c2410

[kevin@localhost arch-s3c2410]$ vim smdk2410.h

 

添加如下代码:

 

#define pSMDK2410_ETH_IO        __phys_to_pfn(0x19000000)

#define vSMDK2410_ETH_IO        0xE0000000

#define SMDK2410_EHT_IRQ        IRQ_EINT9

     这些宏在cs8900.c中要用到。

 

3.    修改mach-smdk2410.c.

[kevin@localhost mach-s3c2410]$ pwd

/kevin/linux-2.6.24.4/arch/arm/mach-s3c2410

      [kevin@localhost mach-s3c2410]$ vim mach-smdk2410.c

 

include建立的刚才建立的头文件smdk2410.h

#include "asm/arch/smdk2410.h

 

map_desc smdk2410_iodesc[]

中添加cs8900的对于的io空间映射

 

static struct map_desc smdk2410_iodesc[] __initdata = {

  /* nothing here yet */

{ vSMDK2410_ETH_IO , pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE },

};

 

4.       /drivers/net/arm/Kconfig中增加menu configCS8900编译选项

[kevin@localhost arm]$ pwd

/kevin/linux-2.6.24.4/drivers/net/arm

[kevin@localhost arm]$ vim Kconfig

 

# +kevin 080327

config  ARM_CS8900

        tristate "CS8900 support"

        depends on NET_ETHERNET && ARM && ARCH_SMDK2410

        help

            Support for CS8900A chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO,available from as well as .To compile this driver as a module, choose M here and read .The module will be called cs8900.o.

 

这样,在编译配置菜单”Menu config”中的Ethernet网络设备中就可以找到”CS8900 support”的选项了。

 

5.  /drivers/net/arm/Makefile中添加

 

obj-$(CONFIG_ARM_CS8900)        += cs8900.o

 

6. 执行menu config Device drivers->network device support->Ethernet中选择(*)CS8900 support.

 

7.  编译内核 make zImage

 

 

8. 将生成的uImage重新download到开办板SDRAM中再来看看启动信息。

 

Uncompressing Linux................................................................................................... done, booting the kernel.

Linux version 2.6.24.4 (kevin@localhost.localdomain) (gcc version 4.1.1) #2 Sat Mar 29 17:32:04 CST 2008

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177

Machine: SMDK2410

Memory policy: ECC disabled, Data cache writeback

CPU S3C2410A (id 0x32410002)

S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz

S3C24XX Clocks, (c) 2004 Simtec Electronics

CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on

CPU0: D VIVT write-back cache

CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets

CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128

Kernel command line: console=ttySAC0,115200 root=/dev/nfs init=/linuxrc nfsroot=192.168.0.104:/nano2410/root ip=192.168.0.69:192.168.0.104:192.168.0.1:255.255.255.0:

irq: clearing pending ext status 00000200

irq: clearing subpending status 00000002

PID hash table entries: 128 (order: 7, 512 bytes)

timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c

Console: colour dummy device 80x30

console [ttySAC0] enabled

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory: 32MB = 32MB total

Memory: 29196KB available (2836K code, 296K data, 116K init)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 64 bytes

NET: Registered protocol family 16

S3C2410 Power Management, (c) 2004 Simtec Electronics

S3C2410: Initialising architecture

S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics

DMA channel 0 at c2800000, irq 33

DMA channel 1 at c2800040, irq 34

DMA channel 2 at c2800080, irq 35

DMA channel 3 at c28000c0, irq 36

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

NetWinder Floating Point Emulator V0.97 (double precision)

JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler deadline registered

io scheduler cfq registered

s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach

s3c2410-lcd: probe of s3c2410-lcd failed with error -22

lp: driver loaded but no devices found

ppdev: user-space parallel port driver

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled

s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410

s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410

s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

loop: module loaded

Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)

eth0: CS8900A rev E at 0xe0000300 irq=53, addr: 00: 0:3E:26:0A: 0

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

s3c2410-nand s3c2410-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns

NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)

Scanning device for bad blocks

Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x00100000 : "U-Boot"

0x00100000-0x00400000 : "Linux Kernel"

0x00400000-0x02c00000 : "Root"

0x02c00000-0x04000000 : "User"

usbmon: debugfs is not available

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

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

mice: PS/2 mouse device common for all mice

S3C24XX RTC, (c) 2004,2006 Simtec Electronics

s3c2410-i2c s3c2410-i2c: slave address 0x10

s3c2410-i2c s3c2410-i2c: bus frequency set to 99 KHz

s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter

S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics

s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled

TCP cubic registered

NET: Registered protocol family 1

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

IP-Config: Complete:

      device=eth0, addr=192.168.0.69, mask=255.255.255.0, gw=192.168.0.1,

     host=www, domain=, nis-domain=kevin.com,

     bootserver=192.168.0.104, rootserver=192.168.0.104, rootpath=

Looking up port of RPC 100003/2 on 192.168.0.104

Root-NFS: Unable to get nfsd port number from server, using default

Looking up port of RPC 100005/1 on 192.168.0.104

Root-NFS: Unable to get mountd port number from server, using default

 

 

Ok, linux host系统日志中/var/log/messages中我们可以看到来自target board的网络连接请求信息:

Mar 29 17:35:38 localhost mountd[12381]: authenticated mount request from 192.168.0.69:736 for /nano2410/root (/nano2410/root)

 

 

网卡驱动移植成功!

下一步工作:制作rootfs

 

 

 

cs8900-linux2.6.24-kevin.tar.bz2 中的cs8900.c是乱码,补发cs8900.rar.

文件: cs8900.rar
大小: 4KB
下载: 下载

 

 

 

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

chinaunix网友2009-04-03 17:07:01

很感谢你的在程序员上传的代码和你的BLOG,在折磨几天后,今天终于解脱了。非常感谢~!

runningman2009-02-04 01:03:33

cs8900.h好像有问题,能不能重新上传一下,多谢!!

chinaunix网友2008-12-15 12:26:42

才开始学嵌入式不久,很多都不懂,楼主能不能把与cs8900.c相关的cs8900.h发到我的邮箱:zhanglian19840126@tom.com 谢谢!!!

chinaunix网友2008-12-14 12:24:48

非常感谢楼主将自己的经验拿来给大家分享! 与cs8900.c相关的头文件cs8900.h希望楼主也能补发,先在这里谢了!

visualj2008-08-17 17:12:53

楼主调试网络了么?