From 44c48cf15a3072185ce3541a127a89bfbb2b346f Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Fri, 6 Apr 2007 15:47:13 +0100 Subject: [PATCH] Enable cs8900A network device for smdk2440 board. Signed-off-by: Graeme Gregory --- arch/arm/mach-s3c2440/mach-smdk2440.c | 7 ++++++- drivers/net/cs89x0.c | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c index c17eb5b..fb36665 100644 --- a/arch/arm/mach-s3c2440/mach-smdk2440.c +++ b/arch/arm/mach-s3c2440/mach-smdk2440.c @@ -69,7 +69,12 @@ static struct map_desc smdk2440_iodesc[] __initdata = { .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)), .length = SZ_4M, .type = MT_DEVICE, - } + }, { + .virtual = (u32)S3C2410_ADDR(0x04000000) , + .pfn = __phys_to_pfn(S3C2410_CS3 + (1<<24)), + .length = SZ_16M, + .type = MT_DEVICE, + } }; #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 4612f71..534653e 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -187,6 +187,10 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; #include static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; +#elif defined(CONFIG_ARCH_S3C2440) +static unsigned int netcard_portlist[] __initdata = {S3C2410_ADDR(0x04000000) + 0x300 , 0}; +static unsigned int cs8900_irq_map[] = {IRQ_EINT9, 0, 0, 0}; +static unsigned char cs8900_mac[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02}; #elif defined(CONFIG_ARCH_PNX010X) #include #include @@ -719,6 +723,14 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) printk( "[Cirrus EEPROM] "); } +#if defined(CONFIG_ARCH_S3C2440) + else + { + for (i=0; i < ETH_ALEN; i++) { + dev->dev_addr[i] = cs8900_mac[i]; + } + } +#endif printk("\n"); @@ -802,7 +814,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) } else { i = lp->isa_config & INT_NO_MASK; if (lp->chip_type == CS8900) { -#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_ARCH_S3C2410) i = cs8900_irq_map[0]; #else /* Translate the IRQ using the IRQ mapping table. */ @@ -1309,7 +1321,7 @@ net_open(struct net_device *dev) 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_ARCH_S3C2410) 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); @@ -1324,7 +1336,11 @@ net_open(struct net_device *dev) writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON); #endif write_irq(dev, lp->chip_type, dev->irq); +#if !defined(CONFIG_ARCH_S3C2440) ret = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev); +#else + ret = request_irq(dev->irq, &net_interrupt, IRQF_DISABLED | IRQF_TRIGGER_HIGH, dev->name, dev); +#endif if (ret) { if (net_debug) printk(KERN_DEBUG "cs89x0: request_irq(%d) failed\n", dev->irq); -- 1.5.1