diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2006-01-14 16:21:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 21:27:13 -0500 |
commit | 9c878967d32a10cb604718f7608efa0ea3d8b596 (patch) | |
tree | 08fc64f4390b6d0f9cad984193e54eca99cd2b00 | |
parent | a07f0dbec01fda6d88f5089e21454b8df53d36fc (diff) |
[PATCH] cs89x0: add ixdp2351 support
This patch adds support for the Intel IXDP2351 to the CS89x0 driver.
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/net/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/cs89x0.c | 29 |
2 files changed, 25 insertions, 6 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 5c15f3e9ea07..171999e67eec 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1387,7 +1387,7 @@ config FORCEDETH | |||
1387 | 1387 | ||
1388 | config CS89x0 | 1388 | config CS89x0 |
1389 | tristate "CS89x0 support" | 1389 | tristate "CS89x0 support" |
1390 | depends on NET_PCI && (ISA || ARCH_IXDP2X01 || ARCH_PNX010X) | 1390 | depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X) |
1391 | ---help--- | 1391 | ---help--- |
1392 | Support for CS89x0 chipset based Ethernet cards. If you have a | 1392 | Support for CS89x0 chipset based Ethernet cards. If you have a |
1393 | network (Ethernet) card of this type, say Y and read the | 1393 | network (Ethernet) card of this type, say Y and read the |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 2687b3e0994d..fab6586d87e9 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -90,6 +90,9 @@ | |||
90 | Dmitry Pervushin : dpervushin@ru.mvista.com | 90 | Dmitry Pervushin : dpervushin@ru.mvista.com |
91 | : PNX010X platform support | 91 | : PNX010X platform support |
92 | 92 | ||
93 | Deepak Saxena : dsaxena@plexity.net | ||
94 | : Intel IXDP2351 platform support | ||
95 | |||
93 | */ | 96 | */ |
94 | 97 | ||
95 | /* Always include 'config.h' first in case the user wants to turn on | 98 | /* Always include 'config.h' first in case the user wants to turn on |
@@ -174,6 +177,10 @@ static unsigned int cs8900_irq_map[] = {12,0,0,0}; | |||
174 | static unsigned int netcard_portlist[] __initdata = | 177 | static unsigned int netcard_portlist[] __initdata = |
175 | { 0x0300, 0}; | 178 | { 0x0300, 0}; |
176 | static unsigned int cs8900_irq_map[] = {1,0,0,0}; | 179 | static unsigned int cs8900_irq_map[] = {1,0,0,0}; |
180 | #elif defined(CONFIG_MACH_IXDP2351) | ||
181 | static unsigned int netcard_portlist[] __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; | ||
182 | static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; | ||
183 | #include <asm/irq.h> | ||
177 | #elif defined(CONFIG_ARCH_IXDP2X01) | 184 | #elif defined(CONFIG_ARCH_IXDP2X01) |
178 | #include <asm/irq.h> | 185 | #include <asm/irq.h> |
179 | static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; | 186 | static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; |
@@ -341,7 +348,19 @@ out: | |||
341 | } | 348 | } |
342 | #endif | 349 | #endif |
343 | 350 | ||
344 | #if defined(CONFIG_ARCH_IXDP2X01) | 351 | #if defined(CONFIG_MACH_IXDP2351) |
352 | static u16 | ||
353 | readword(unsigned long base_addr, int portno) | ||
354 | { | ||
355 | return __raw_readw(base_addr + (portno << 1)); | ||
356 | } | ||
357 | |||
358 | static void | ||
359 | writeword(unsigned long base_addr, int portno, u16 value) | ||
360 | { | ||
361 | __raw_writew(value, base_addr + (portno << 1)); | ||
362 | } | ||
363 | #elif defined(CONFIG_ARCH_IXDP2X01) | ||
345 | static u16 | 364 | static u16 |
346 | readword(unsigned long base_addr, int portno) | 365 | readword(unsigned long base_addr, int portno) |
347 | { | 366 | { |
@@ -781,7 +800,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
781 | } else { | 800 | } else { |
782 | i = lp->isa_config & INT_NO_MASK; | 801 | i = lp->isa_config & INT_NO_MASK; |
783 | if (lp->chip_type == CS8900) { | 802 | if (lp->chip_type == CS8900) { |
784 | #if defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) | 803 | #if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) |
785 | i = cs8900_irq_map[0]; | 804 | i = cs8900_irq_map[0]; |
786 | #else | 805 | #else |
787 | /* Translate the IRQ using the IRQ mapping table. */ | 806 | /* Translate the IRQ using the IRQ mapping table. */ |
@@ -1013,7 +1032,7 @@ skip_this_frame: | |||
1013 | 1032 | ||
1014 | void __init reset_chip(struct net_device *dev) | 1033 | void __init reset_chip(struct net_device *dev) |
1015 | { | 1034 | { |
1016 | #ifndef CONFIG_ARCH_IXDP2X01 | 1035 | #if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) |
1017 | struct net_local *lp = netdev_priv(dev); | 1036 | struct net_local *lp = netdev_priv(dev); |
1018 | int ioaddr = dev->base_addr; | 1037 | int ioaddr = dev->base_addr; |
1019 | #endif | 1038 | #endif |
@@ -1024,7 +1043,7 @@ void __init reset_chip(struct net_device *dev) | |||
1024 | /* wait 30 ms */ | 1043 | /* wait 30 ms */ |
1025 | msleep(30); | 1044 | msleep(30); |
1026 | 1045 | ||
1027 | #ifndef CONFIG_ARCH_IXDP2X01 | 1046 | #if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) |
1028 | if (lp->chip_type != CS8900) { | 1047 | if (lp->chip_type != CS8900) { |
1029 | /* Hardware problem requires PNP registers to be reconfigured after a reset */ | 1048 | /* Hardware problem requires PNP registers to be reconfigured after a reset */ |
1030 | writeword(ioaddr, ADD_PORT, PP_CS8920_ISAINT); | 1049 | writeword(ioaddr, ADD_PORT, PP_CS8920_ISAINT); |
@@ -1288,7 +1307,7 @@ net_open(struct net_device *dev) | |||
1288 | else | 1307 | else |
1289 | #endif | 1308 | #endif |
1290 | { | 1309 | { |
1291 | #if !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) | 1310 | #if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) |
1292 | if (((1 << dev->irq) & lp->irq_map) == 0) { | 1311 | if (((1 << dev->irq) & lp->irq_map) == 0) { |
1293 | printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", | 1312 | printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", |
1294 | dev->name, dev->irq, lp->irq_map); | 1313 | dev->name, dev->irq, lp->irq_map); |