一,准备工具:
- 交叉编译工具:[url]http://www.handhelds.org/download/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2[/url]
- linux2.6.24的内核(ubuntu8.04):[url]http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2[/url]
- arm模拟器skyeye:sudo apt-get install skyeye
- skyeye测试实例包:[url]http://sourceforge.net/project/showfiles.php?group_id=85554&package_id=166819[/url]
二,修改89x0网卡的驱动
将一下代码存为到内核根目录下,命名为:2410-cs8900.patch
然后: patch -p1 <2410-cs8900.patch 打补丁
---------------------------------------------------------2410-cs8900.patch---------------------------
Index: linux-2.6.24/drivers/net/Kconfig
===================================================================
--- linux-2.6.24/drivers/net/Kconfig
+++ linux-2.6.24/drivers/net/Kconfig
@@ -1322,7 +1322,7 @@
config NET_PCI
bool "EISA, VLB, PCI and on board controllers"
- depends on ISA || EISA || PCI
+ depends on ISA || EISA || PCI || MACH_QT2410
help
This is another class of network cards which attach directly to the
bus. If you have one of those, say Y and read the Ethernet-HOWTO,
@@ -1496,7 +1496,7 @@
config CS89x0
tristate "CS89x0 support"
- depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X)
+ depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_QT2410)
---help---
Support for CS89x0 chipset based Ethernet cards. If you have a
network (Ethernet) card of this type, say Y and read the
Index: linux-2.6.24/drivers/net/cs89x0.c
===================================================================
--- linux-2.6.24/drivers/net/cs89x0.c
+++ linux-2.6.24/drivers/net/cs89x0.c
@@ -194,6 +194,10 @@
#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */
static unsigned int netcard_portlist[] __initdata = {CIRRUS_DEFAULT_BASE, 0};
static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
+#elif defined(CONFIG_MACH_QT2410)
+#include <asm/arch/irqs.h>
+static unsigned int netcard_portlist [] __initdata = { 0xe0000300, 0 };
+static unsigned int cs8900_irq_map[] = { IRQ_EINT9, 0, 0, 0 };
#else
static unsigned int netcard_portlist[] __initdata =
{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
@@ -829,6 +833,14 @@
printk(" IRQ %d", dev->irq);
+ dev->dev_addr[0] = 0x00;
+ dev->dev_addr[1] = 0x00;
+ dev->dev_addr[2] = 0xc0;
+ dev->dev_addr[3] = 0xff;
+ dev->dev_addr[4] = 0xee;
+ dev->dev_addr[5] = 0x08;
+ set_mac_address(dev, dev->dev_addr);
+
#if ALLOW_DMA
if (lp->use_dma) {
get_dma_channel(dev);
@@ -1308,7 +1320,7 @@
else
#endif
{
-#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X)
+#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) && !defined(CONFIG_MACH_QT2410)
if (((1 << dev->irq) & lp->irq_map) == 0) {
printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
dev->name, dev->irq, lp->irq_map);
---------------------------------------------------------2410-cs8900.patch---------------------------
三,修改配置内核
1.指定交叉编译器。内核顶层 Makefile中:
view plain copy to clipboard print ?
- ARCH?= $(SUBARCH) CROSS_COMPILE ?=
ARCH?= $(SUBARCH) CROSS_COMPILE ?=
修改为:
view plain copy to clipboard print ?
- ARCH :=arm CROSS_COMPILE =/usr/local/arm/3.4.1/bin/arm-linux-<BR>
ARCH :=arm CROSS_COMPILE =/usr/local/arm/3.4.1/bin/arm-linux-
2.设定s3c2410默认设置,修改启动地址和参数:
1)修改include/asm-arm/arch-s3c2410/map.h
#define S3C2410_CS6 (0x30000000)
to
#define S3C2410_CS6 (0xC0000000)
2)修改include/asm-arm/arch-s3c2410/memory.h
#define PHYS_OFFSET UL(0x30000000)
to
#define PHYS_OFFSET UL(0xC0000000)
3)make s3c2410_defconfig
4)make menuconfig
进入 [Device Driver] ->[ Character Driver] -> [Serial Driver]选项,保证“8250/16550 and compatible serial support”选项不被选中
修改启动参数为:
mem=32M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x00800000 ramdisk_size=2048 rw
Device Drivers-> Network device support-> Ethernet (10 or 100Mbit)
选中
[*] EISA, VLB, PCI and on board controllers
后出现
CS89x0 support 选中
四,编译,skyeye模拟
1.在skyeye-testsuite-2.3目录下建个mytest,将skyeye-testsuite-2.3/linux/s3c2410/s3c2410x-2.6.14中的skyeye.conf和initrd.image复制到mytest下
2.将编译好的内核linux-2.6.24/vmlinux拷贝到mytest下
3.启动:skyeye -e vmlinux