- 论坛徽章:
- 0
|
2.6.27内核加强了对S3C24xx的支持,但内核所带的CS89x0驱动不支持2410,所以对drives/net/cs89x0做了移植使它支持2410 移植过程参考了2.6.25的移植
**************************************************************
1 。在include/asm-arm/plat-s3c24xx/common-smdk.h文件中添加映射信息其中使用宏__phys_to_pfn 即将物理地址右移12位
#define pSMDK2410_ETH_IO __phys_to_pfn(0x19000000)
#define vSMDK2410_ETH_IO S3C2410_ADDR(0x04000000)
#define SMDK2410_ETH_IRQ IRQ_EINT9
***********************************************************************************
2.arch/arm/mach-s3c2410/mach-smdk2410.c 添加地址映射
static struct map_desc smdk2410_iodesc[] __initdata={
+ {vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE} //添加
};
*****************************************************************************
3.修改 drivers/net/cs89x0.c,diff
--- cs89x0.c 2008-12-03 17:14:20.578125000 +0800
+++ cs8900.c 2008-12-03 17:14:11.828125000 +0800
@@ -194,6 +194,29 @@
#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */
static unsigned int netcard_portlist[] __used __initdata = {CIRRUS_DEFAULT_BASE, 0};
static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
+
+#elif defined(CONFIG_ARCH_S3C2410)
+#include
+#include
+#include
+#include
+#include
+#include
+
+static unsigned int netcard_portlist[] __initdata = {vSMDK2410_ETH_IO + DEFAULTIOBASE, 0};
+static unsigned int cs8900_irq_map[] = {SMDK2410_ETH_IRQ , 0, 0, 0};
+
+#ifdef request_region
+#undef request_region
+#endif
+
+#ifdef release_region
+#undef release_region
+#endif
+
+#define request_region(a,s,n) request_mem_region(a,s,n)
+#define release_region(a,s) release_mem_region(a,s)
+
#else
static unsigned int netcard_portlist[] __used __initdata =
{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
@@ -203,7 +226,7 @@
#if DEBUGGING
static unsigned int net_debug = DEBUGGING;
#else
-#define net_debug 0 /* gcc will remove all the debug code for us */
+#define net_debug 1 /* gcc will remove all the debug code for us */
#endif
/* The number of low I/O ports used by the ethercard. */
@@ -324,6 +347,13 @@
io = dev->base_addr;
irq = dev->irq;
+#ifdef CONFIG_ARCH_S3C2410
+ __raw_writel((__raw_readl(S3C2410_GPGCON)&~(0x3force=FORCE_RJ45;
+ lp->auto_neg_cnf=IMM_BIT;
+
+ dev->dev_addr[0]=0x00; /*setMACaddress*/
+ dev->dev_addr[1]=0xE0;
+ dev->dev_addr[2]=0x4C;
+ dev->dev_addr[3]=0x4D;
+ dev->dev_addr[4]=0x10;
+ dev->dev_addr[5]=0x30;
+
+
+#elif defined CONFIG_SH_HICOSH4
if (1) {
/* For the HiCO.SH4 board, things are different: we don't
have EEPROM, but there is some data in flash, so we go
@@ -1273,7 +1327,7 @@
int i;
int ret;
-#if !defined(CONFIG_SH_HICOSH4) && !defined(CONFIG_ARCH_PNX010X) /* uses irq#1, so this won't work */
+#if !defined(CONFIG_SH_HICOSH4) && !defined(CONFIG_ARCH_PNX010X) && !defined(CONFIG_ARCH_S3C2410) /* uses irq#1, so this won't work */
if (dev->irq 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);
@@ -1319,6 +1373,9 @@
writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
#endif
write_irq(dev, lp->chip_type, dev->irq);
+#if defined(CONFIG_ARCH_S3C2410)
+ set_irq_type(dev->irq,IRQ_TYPE_EDGE_RISING);
+#endif
ret = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev);
if (ret) {
if (net_debug)
@@ -1389,7 +1446,7 @@
case A_CNF_MEDIA_10B_2: result = lp->adapter_cnf & A_CNF_10B_2; break;
default: result = lp->adapter_cnf & (A_CNF_10B_T | A_CNF_AUI | A_CNF_10B_2);
}
-#ifdef CONFIG_ARCH_PNX010X
+#if defined(CONFIG_ARCH_PNX0105) || defined(CONFIG_ARCH_S3C2410)
result = A_CNF_10B_T;
#endif
if (!result) {
************************************************************************
2.6.25的IRQT_RISING在2.6.27中变成了IRQ_TYPE_EDGE_RISING,注意
************************************************************************
最后,由于cs8900依赖于NET_PCI所以应该
+ select NET_PCI
+ select ISA
ISA要不要?不懂...
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/86923/showart_1678141.html |
|