1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
From 44c48cf15a3072185ce3541a127a89bfbb2b346f Mon Sep 17 00:00:00 2001
From: Graeme Gregory <gg@gg-desktop.wolfsonmicro.main>
Date: Fri, 6 Apr 2007 15:47:13 +0100
Subject: [PATCH] Enable cs8900A network device for smdk2440 board.
Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com>
---
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 <asm/irq.h>
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 <asm/irq.h>
#include <asm/arch/gpio.h>
@@ -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
|