bf8a0081ddb01ee05287232466e4e32ec7f90c1b
[openembedded.git] /
1 From 44c48cf15a3072185ce3541a127a89bfbb2b346f Mon Sep 17 00:00:00 2001
2 From: Graeme Gregory <gg@gg-desktop.wolfsonmicro.main>
3 Date: Fri, 6 Apr 2007 15:47:13 +0100
4 Subject: [PATCH] Enable cs8900A network device for smdk2440 board.
5
6 Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com>
7 ---
8  arch/arm/mach-s3c2440/mach-smdk2440.c |    7 ++++++-
9  drivers/net/cs89x0.c                  |   20 ++++++++++++++++++--
10  2 files changed, 24 insertions(+), 3 deletions(-)
11
12 diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
13 index c17eb5b..fb36665 100644
14 --- a/arch/arm/mach-s3c2440/mach-smdk2440.c
15 +++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
16 @@ -69,7 +69,12 @@ static struct map_desc smdk2440_iodesc[] __initdata = {
17                 .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
18                 .length         = SZ_4M,
19                 .type           = MT_DEVICE,
20 -       }
21 +       }, {
22 +               .virtual        = (u32)S3C2410_ADDR(0x04000000) ,
23 +               .pfn            = __phys_to_pfn(S3C2410_CS3 + (1<<24)),
24 +               .length         = SZ_16M,
25 +               .type           = MT_DEVICE,
26 +        }
27  };
28  
29  #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
30 diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
31 index 4612f71..534653e 100644
32 --- a/drivers/net/cs89x0.c
33 +++ b/drivers/net/cs89x0.c
34 @@ -187,6 +187,10 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0};
35  #include <asm/irq.h>
36  static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0};
37  static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
38 +#elif defined(CONFIG_ARCH_S3C2440)
39 +static unsigned int netcard_portlist[] __initdata = {S3C2410_ADDR(0x04000000) + 0x300 , 0};
40 +static unsigned int cs8900_irq_map[] = {IRQ_EINT9, 0, 0, 0};
41 +static unsigned char cs8900_mac[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02};
42  #elif defined(CONFIG_ARCH_PNX010X)
43  #include <asm/irq.h>
44  #include <asm/arch/gpio.h>
45 @@ -719,6 +723,14 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
46  
47                 printk( "[Cirrus EEPROM] ");
48         }
49 +#if defined(CONFIG_ARCH_S3C2440)
50 +       else
51 +       {
52 +               for (i=0; i < ETH_ALEN; i++) {
53 +                        dev->dev_addr[i] = cs8900_mac[i];
54 +               }
55 +       }
56 +#endif
57  
58          printk("\n");
59  
60 @@ -802,7 +814,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
61         } else {
62                 i = lp->isa_config & INT_NO_MASK;
63                 if (lp->chip_type == CS8900) {
64 -#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X)
65 +#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) || defined(CONFIG_ARCH_S3C2410)
66                         i = cs8900_irq_map[0];
67  #else
68                         /* Translate the IRQ using the IRQ mapping table. */
69 @@ -1309,7 +1321,7 @@ net_open(struct net_device *dev)
70         else
71  #endif
72         {
73 -#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X)
74 +#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) && !defined(CONFIG_ARCH_S3C2410)
75                 if (((1 << dev->irq) & lp->irq_map) == 0) {
76                         printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
77                                 dev->name, dev->irq, lp->irq_map);
78 @@ -1324,7 +1336,11 @@ net_open(struct net_device *dev)
79                 writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
80  #endif
81                 write_irq(dev, lp->chip_type, dev->irq);
82 +#if !defined(CONFIG_ARCH_S3C2440)
83                 ret = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev);
84 +#else
85 +               ret = request_irq(dev->irq, &net_interrupt, IRQF_DISABLED | IRQF_TRIGGER_HIGH, dev->name, dev);
86 +#endif
87                 if (ret) {
88                         if (net_debug)
89                                 printk(KERN_DEBUG "cs89x0: request_irq(%d) failed\n", dev->irq);
90 -- 
91 1.5.1
92