diff options
Diffstat (limited to 'drivers/net/declance.c')
| -rw-r--r-- | drivers/net/declance.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 521c83137bf6..f130bdab3fd3 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * | 5 | * |
| 6 | * adopted from sunlance.c by Richard van den Berg | 6 | * adopted from sunlance.c by Richard van den Berg |
| 7 | * | 7 | * |
| 8 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | 8 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki |
| 9 | * | 9 | * |
| 10 | * additional sources: | 10 | * additional sources: |
| 11 | * - PMAD-AA TURBOchannel Ethernet Module Functional Specification, | 11 | * - PMAD-AA TURBOchannel Ethernet Module Functional Specification, |
| @@ -57,13 +57,15 @@ | |||
| 57 | #include <linux/string.h> | 57 | #include <linux/string.h> |
| 58 | 58 | ||
| 59 | #include <asm/addrspace.h> | 59 | #include <asm/addrspace.h> |
| 60 | #include <asm/system.h> | ||
| 61 | |||
| 60 | #include <asm/dec/interrupts.h> | 62 | #include <asm/dec/interrupts.h> |
| 61 | #include <asm/dec/ioasic.h> | 63 | #include <asm/dec/ioasic.h> |
| 62 | #include <asm/dec/ioasic_addrs.h> | 64 | #include <asm/dec/ioasic_addrs.h> |
| 63 | #include <asm/dec/kn01.h> | 65 | #include <asm/dec/kn01.h> |
| 64 | #include <asm/dec/machtype.h> | 66 | #include <asm/dec/machtype.h> |
| 67 | #include <asm/dec/system.h> | ||
| 65 | #include <asm/dec/tc.h> | 68 | #include <asm/dec/tc.h> |
| 66 | #include <asm/system.h> | ||
| 67 | 69 | ||
| 68 | static char version[] __devinitdata = | 70 | static char version[] __devinitdata = |
| 69 | "declance.c: v0.009 by Linux MIPS DECstation task force\n"; | 71 | "declance.c: v0.009 by Linux MIPS DECstation task force\n"; |
| @@ -79,10 +81,6 @@ MODULE_LICENSE("GPL"); | |||
| 79 | #define PMAD_LANCE 2 | 81 | #define PMAD_LANCE 2 |
| 80 | #define PMAX_LANCE 3 | 82 | #define PMAX_LANCE 3 |
| 81 | 83 | ||
| 82 | #ifndef CONFIG_TC | ||
| 83 | unsigned long system_base; | ||
| 84 | unsigned long dmaptr; | ||
| 85 | #endif | ||
| 86 | 84 | ||
| 87 | #define LE_CSR0 0 | 85 | #define LE_CSR0 0 |
| 88 | #define LE_CSR1 1 | 86 | #define LE_CSR1 1 |
| @@ -237,7 +235,7 @@ struct lance_init_block { | |||
| 237 | /* | 235 | /* |
| 238 | * This works *only* for the ring descriptors | 236 | * This works *only* for the ring descriptors |
| 239 | */ | 237 | */ |
| 240 | #define LANCE_ADDR(x) (PHYSADDR(x) >> 1) | 238 | #define LANCE_ADDR(x) (CPHYSADDR(x) >> 1) |
| 241 | 239 | ||
| 242 | struct lance_private { | 240 | struct lance_private { |
| 243 | struct net_device *next; | 241 | struct net_device *next; |
| @@ -697,12 +695,13 @@ out: | |||
| 697 | spin_unlock(&lp->lock); | 695 | spin_unlock(&lp->lock); |
| 698 | } | 696 | } |
| 699 | 697 | ||
| 700 | static void lance_dma_merr_int(const int irq, void *dev_id, | 698 | static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id, |
| 701 | struct pt_regs *regs) | 699 | struct pt_regs *regs) |
| 702 | { | 700 | { |
| 703 | struct net_device *dev = (struct net_device *) dev_id; | 701 | struct net_device *dev = (struct net_device *) dev_id; |
| 704 | 702 | ||
| 705 | printk("%s: DMA error\n", dev->name); | 703 | printk("%s: DMA error\n", dev->name); |
| 704 | return IRQ_HANDLED; | ||
| 706 | } | 705 | } |
| 707 | 706 | ||
| 708 | static irqreturn_t | 707 | static irqreturn_t |
| @@ -1026,10 +1025,6 @@ static int __init dec_lance_init(const int type, const int slot) | |||
| 1026 | unsigned long esar_base; | 1025 | unsigned long esar_base; |
| 1027 | unsigned char *esar; | 1026 | unsigned char *esar; |
| 1028 | 1027 | ||
| 1029 | #ifndef CONFIG_TC | ||
| 1030 | system_base = KN01_LANCE_BASE; | ||
| 1031 | #endif | ||
| 1032 | |||
| 1033 | if (dec_lance_debug && version_printed++ == 0) | 1028 | if (dec_lance_debug && version_printed++ == 0) |
| 1034 | printk(version); | 1029 | printk(version); |
| 1035 | 1030 | ||
| @@ -1062,16 +1057,16 @@ static int __init dec_lance_init(const int type, const int slot) | |||
| 1062 | switch (type) { | 1057 | switch (type) { |
| 1063 | #ifdef CONFIG_TC | 1058 | #ifdef CONFIG_TC |
| 1064 | case ASIC_LANCE: | 1059 | case ASIC_LANCE: |
| 1065 | dev->base_addr = system_base + IOASIC_LANCE; | 1060 | dev->base_addr = CKSEG1ADDR(dec_kn_slot_base + IOASIC_LANCE); |
| 1066 | 1061 | ||
| 1067 | /* buffer space for the on-board LANCE shared memory */ | 1062 | /* buffer space for the on-board LANCE shared memory */ |
| 1068 | /* | 1063 | /* |
| 1069 | * FIXME: ugly hack! | 1064 | * FIXME: ugly hack! |
| 1070 | */ | 1065 | */ |
| 1071 | dev->mem_start = KSEG1ADDR(0x00020000); | 1066 | dev->mem_start = CKSEG1ADDR(0x00020000); |
| 1072 | dev->mem_end = dev->mem_start + 0x00020000; | 1067 | dev->mem_end = dev->mem_start + 0x00020000; |
| 1073 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; | 1068 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; |
| 1074 | esar_base = system_base + IOASIC_ESAR; | 1069 | esar_base = CKSEG1ADDR(dec_kn_slot_base + IOASIC_ESAR); |
| 1075 | 1070 | ||
| 1076 | /* Workaround crash with booting KN04 2.1k from Disk */ | 1071 | /* Workaround crash with booting KN04 2.1k from Disk */ |
| 1077 | memset((void *)dev->mem_start, 0, | 1072 | memset((void *)dev->mem_start, 0, |
| @@ -1101,14 +1096,14 @@ static int __init dec_lance_init(const int type, const int slot) | |||
| 1101 | /* Setup I/O ASIC LANCE DMA. */ | 1096 | /* Setup I/O ASIC LANCE DMA. */ |
| 1102 | lp->dma_irq = dec_interrupt[DEC_IRQ_LANCE_MERR]; | 1097 | lp->dma_irq = dec_interrupt[DEC_IRQ_LANCE_MERR]; |
| 1103 | ioasic_write(IO_REG_LANCE_DMA_P, | 1098 | ioasic_write(IO_REG_LANCE_DMA_P, |
| 1104 | PHYSADDR(dev->mem_start) << 3); | 1099 | CPHYSADDR(dev->mem_start) << 3); |
| 1105 | 1100 | ||
| 1106 | break; | 1101 | break; |
| 1107 | 1102 | ||
| 1108 | case PMAD_LANCE: | 1103 | case PMAD_LANCE: |
| 1109 | claim_tc_card(slot); | 1104 | claim_tc_card(slot); |
| 1110 | 1105 | ||
| 1111 | dev->mem_start = get_tc_base_addr(slot); | 1106 | dev->mem_start = CKSEG1ADDR(get_tc_base_addr(slot)); |
| 1112 | dev->base_addr = dev->mem_start + 0x100000; | 1107 | dev->base_addr = dev->mem_start + 0x100000; |
| 1113 | dev->irq = get_tc_irq_nr(slot); | 1108 | dev->irq = get_tc_irq_nr(slot); |
| 1114 | esar_base = dev->mem_start + 0x1c0002; | 1109 | esar_base = dev->mem_start + 0x1c0002; |
| @@ -1137,9 +1132,9 @@ static int __init dec_lance_init(const int type, const int slot) | |||
| 1137 | 1132 | ||
| 1138 | case PMAX_LANCE: | 1133 | case PMAX_LANCE: |
| 1139 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; | 1134 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; |
| 1140 | dev->base_addr = KN01_LANCE_BASE; | 1135 | dev->base_addr = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE); |
| 1141 | dev->mem_start = KN01_LANCE_BASE + 0x01000000; | 1136 | dev->mem_start = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE_MEM); |
| 1142 | esar_base = KN01_RTC_BASE + 1; | 1137 | esar_base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_ESAR + 1); |
| 1143 | lp->dma_irq = -1; | 1138 | lp->dma_irq = -1; |
| 1144 | 1139 | ||
| 1145 | /* | 1140 | /* |
