Commit 36156cdff17a5ab822898d33cd890a6f8287c43c
Committed by
Jeff Garzik
1 parent
4569504a36
Exists in
master
and in
39 other branches
[PATCH] declance: Use physical addresses at the interface level.
Use physical addresses at the interface level, letting drivers remap them as appropriate. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> drivers/net/declance.c | 26 ++++++++++---------------- 1 files changed, 10 insertions(+), 16 deletions(-) Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Showing 1 changed file with 10 additions and 16 deletions Side-by-side Diff
drivers/net/declance.c
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | * |
6 | 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 | 10 | * additional sources: |
11 | 11 | * - PMAD-AA TURBOchannel Ethernet Module Functional Specification, |
12 | 12 | |
13 | 13 | |
... | ... | @@ -57,13 +57,15 @@ |
57 | 57 | #include <linux/string.h> |
58 | 58 | |
59 | 59 | #include <asm/addrspace.h> |
60 | +#include <asm/system.h> | |
61 | + | |
60 | 62 | #include <asm/dec/interrupts.h> |
61 | 63 | #include <asm/dec/ioasic.h> |
62 | 64 | #include <asm/dec/ioasic_addrs.h> |
63 | 65 | #include <asm/dec/kn01.h> |
64 | 66 | #include <asm/dec/machtype.h> |
67 | +#include <asm/dec/system.h> | |
65 | 68 | #include <asm/dec/tc.h> |
66 | -#include <asm/system.h> | |
67 | 69 | |
68 | 70 | static char version[] __devinitdata = |
69 | 71 | "declance.c: v0.009 by Linux MIPS DECstation task force\n"; |
... | ... | @@ -79,10 +81,6 @@ |
79 | 81 | #define PMAD_LANCE 2 |
80 | 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 | 85 | #define LE_CSR0 0 |
88 | 86 | #define LE_CSR1 1 |
... | ... | @@ -1027,10 +1025,6 @@ |
1027 | 1025 | unsigned long esar_base; |
1028 | 1026 | unsigned char *esar; |
1029 | 1027 | |
1030 | -#ifndef CONFIG_TC | |
1031 | - system_base = KN01_LANCE_BASE; | |
1032 | -#endif | |
1033 | - | |
1034 | 1028 | if (dec_lance_debug && version_printed++ == 0) |
1035 | 1029 | printk(version); |
1036 | 1030 | |
... | ... | @@ -1063,7 +1057,7 @@ |
1063 | 1057 | switch (type) { |
1064 | 1058 | #ifdef CONFIG_TC |
1065 | 1059 | case ASIC_LANCE: |
1066 | - dev->base_addr = system_base + IOASIC_LANCE; | |
1060 | + dev->base_addr = CKSEG1ADDR(dec_kn_slot_base + IOASIC_LANCE); | |
1067 | 1061 | |
1068 | 1062 | /* buffer space for the on-board LANCE shared memory */ |
1069 | 1063 | /* |
... | ... | @@ -1072,7 +1066,7 @@ |
1072 | 1066 | dev->mem_start = CKSEG1ADDR(0x00020000); |
1073 | 1067 | dev->mem_end = dev->mem_start + 0x00020000; |
1074 | 1068 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; |
1075 | - esar_base = system_base + IOASIC_ESAR; | |
1069 | + esar_base = CKSEG1ADDR(dec_kn_slot_base + IOASIC_ESAR); | |
1076 | 1070 | |
1077 | 1071 | /* Workaround crash with booting KN04 2.1k from Disk */ |
1078 | 1072 | memset((void *)dev->mem_start, 0, |
... | ... | @@ -1109,7 +1103,7 @@ |
1109 | 1103 | case PMAD_LANCE: |
1110 | 1104 | claim_tc_card(slot); |
1111 | 1105 | |
1112 | - dev->mem_start = get_tc_base_addr(slot); | |
1106 | + dev->mem_start = CKSEG1ADDR(get_tc_base_addr(slot)); | |
1113 | 1107 | dev->base_addr = dev->mem_start + 0x100000; |
1114 | 1108 | dev->irq = get_tc_irq_nr(slot); |
1115 | 1109 | esar_base = dev->mem_start + 0x1c0002; |
... | ... | @@ -1138,9 +1132,9 @@ |
1138 | 1132 | |
1139 | 1133 | case PMAX_LANCE: |
1140 | 1134 | dev->irq = dec_interrupt[DEC_IRQ_LANCE]; |
1141 | - dev->base_addr = KN01_LANCE_BASE; | |
1142 | - dev->mem_start = KN01_LANCE_BASE + 0x01000000; | |
1143 | - esar_base = KN01_RTC_BASE + 1; | |
1135 | + dev->base_addr = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE); | |
1136 | + dev->mem_start = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE_MEM); | |
1137 | + esar_base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_ESAR + 1); | |
1144 | 1138 | lp->dma_irq = -1; |
1145 | 1139 | |
1146 | 1140 | /* |