Skip to content

Commit a5fc9c0

Browse files
Maciej W. Rozyckiralfbaechle
authored andcommitted
Use physical addresses at the interface level, letting drivers remap
them as appropriate. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 7d7ee22 commit a5fc9c0

18 files changed

Lines changed: 149 additions & 164 deletions

File tree

‎arch/mips/dec/ecc-berr.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs)
227227
*/
228228
static inline void dec_kn02_be_init(void)
229229
{
230-
volatile u32 *csr = (void *)KN02_CSR_BASE;
230+
volatile u32 *csr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
231231
unsigned long flags;
232232

233-
kn0x_erraddr = (void *)(KN02_SLOT_BASE + KN02_ERRADDR);
234-
kn0x_chksyn = (void *)(KN02_SLOT_BASE + KN02_CHKSYN);
233+
kn0x_erraddr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_ERRADDR);
234+
kn0x_chksyn = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CHKSYN);
235235

236236
spin_lock_irqsave(&kn02_lock, flags);
237237

@@ -250,11 +250,11 @@ static inline void dec_kn02_be_init(void)
250250

251251
static inline void dec_kn03_be_init(void)
252252
{
253-
volatile u32 *mcr = (void *)(KN03_SLOT_BASE + IOASIC_MCR);
254-
volatile u32 *mbcs = (void *)(KN4K_SLOT_BASE + KN4K_MB_CSR);
253+
volatile u32 *mcr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);
254+
volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
255255

256-
kn0x_erraddr = (void *)(KN03_SLOT_BASE + IOASIC_ERRADDR);
257-
kn0x_chksyn = (void *)(KN03_SLOT_BASE + IOASIC_CHKSYN);
256+
kn0x_erraddr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_ERRADDR);
257+
kn0x_chksyn = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_CHKSYN);
258258

259259
/*
260260
* Set normal ECC detection and generation, enable ECC correction.

‎arch/mips/dec/int-handler.S‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* arch/mips/dec/int-handler.S
33
*
44
* Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
5-
* Copyright (C) 2000, 2001, 2002, 2003 Maciej W. Rozycki
5+
* Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
66
*
7-
* Written by Ralf Baechle and Andreas Busse, modified for DECStation
7+
* Written by Ralf Baechle and Andreas Busse, modified for DECstation
88
* support by Paul Antoine and Harald Koerfgen.
99
*
1010
* completly rewritten:
@@ -14,11 +14,12 @@
1414
* by Maciej W. Rozycki.
1515
*/
1616
#include <linux/config.h>
17+
18+
#include <asm/addrspace.h>
1719
#include <asm/asm.h>
18-
#include <asm/regdef.h>
1920
#include <asm/mipsregs.h>
21+
#include <asm/regdef.h>
2022
#include <asm/stackframe.h>
21-
#include <asm/addrspace.h>
2223

2324
#include <asm/dec/interrupts.h>
2425
#include <asm/dec/ioasic_addrs.h>
@@ -28,11 +29,14 @@
2829
#include <asm/dec/kn02xa.h>
2930
#include <asm/dec/kn03.h>
3031

32+
#define KN02_CSR_BASE CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR)
33+
#define KN02XA_IOASIC_BASE CKSEG1ADDR(KN02XA_SLOT_BASE + IOASIC_IOCTL)
34+
#define KN03_IOASIC_BASE CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_IOCTL)
3135

3236
.text
3337
.set noreorder
3438
/*
35-
* decstation_handle_int: Interrupt handler for DECStations
39+
* decstation_handle_int: Interrupt handler for DECstations
3640
*
3741
* We follow the model in the Indy interrupt code by David Miller, where he
3842
* says: a lot of complication here is taken away because:
@@ -48,7 +52,7 @@
4852
* 3) Linux only thinks in terms of all IRQs on or all IRQs
4953
* off, nothing in between like BSD spl() brain-damage.
5054
*
51-
* Furthermore, the IRQs on the DECStations look basically (barring
55+
* Furthermore, the IRQs on the DECstations look basically (barring
5256
* software IRQs which we don't use at all) like...
5357
*
5458
* DS2100/3100's, aka kn01, aka Pmax:
@@ -61,7 +65,7 @@
6165
* 3 Lance Ethernet
6266
* 4 DZ11 serial
6367
* 5 RTC
64-
* 6 Memory Controller
68+
* 6 Memory Controller & Video
6569
* 7 FPU
6670
*
6771
* DS5000/200, aka kn02, aka 3max:

‎arch/mips/dec/kn01-berr.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DEFINE_SPINLOCK(kn01_lock);
5151

5252
static inline void dec_kn01_be_ack(void)
5353
{
54-
volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
54+
volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
5555
unsigned long flags;
5656

5757
spin_lock_irqsave(&kn01_lock, flags);
@@ -64,7 +64,8 @@ static inline void dec_kn01_be_ack(void)
6464

6565
static int dec_kn01_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
6666
{
67-
volatile u32 *kn01_erraddr = (void *)(KN01_SLOT_BASE + KN01_ERRADDR);
67+
volatile u32 *kn01_erraddr = (void *)CKSEG1ADDR(KN01_SLOT_BASE +
68+
KN01_ERRADDR);
6869

6970
static const char excstr[] = "exception";
7071
static const char intstr[] = "interrupt";
@@ -152,7 +153,7 @@ int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup)
152153
irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id,
153154
struct pt_regs *regs)
154155
{
155-
volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
156+
volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
156157
int action;
157158

158159
if (!(*csr & KN01_CSR_MEMERR))
@@ -178,7 +179,7 @@ irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id,
178179

179180
void __init dec_kn01_be_init(void)
180181
{
181-
volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
182+
volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
182183
unsigned long flags;
183184

184185
spin_lock_irqsave(&kn01_lock, flags);

‎arch/mips/dec/kn02-irq.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ static int kn02_irq_base;
3737

3838
static inline void unmask_kn02_irq(unsigned int irq)
3939
{
40-
volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
40+
volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
41+
KN02_CSR);
4142

4243
cached_kn02_csr |= (1 << (irq - kn02_irq_base + 16));
4344
*csr = cached_kn02_csr;
4445
}
4546

4647
static inline void mask_kn02_irq(unsigned int irq)
4748
{
48-
volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
49+
volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
50+
KN02_CSR);
4951

5052
cached_kn02_csr &= ~(1 << (irq - kn02_irq_base + 16));
5153
*csr = cached_kn02_csr;
@@ -105,7 +107,8 @@ static struct hw_interrupt_type kn02_irq_type = {
105107

106108
void __init init_kn02_irqs(int base)
107109
{
108-
volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
110+
volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
111+
KN02_CSR);
109112
unsigned long flags;
110113
int i;
111114

‎arch/mips/dec/kn02xa-berr.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/kernel.h>
2121
#include <linux/types.h>
2222

23+
#include <asm/addrspace.h>
2324
#include <asm/system.h>
2425
#include <asm/traps.h>
2526

@@ -29,8 +30,8 @@
2930

3031
static inline void dec_kn02xa_be_ack(void)
3132
{
32-
volatile u32 *mer = (void *)KN02XA_MER;
33-
volatile u32 *mem_intr = (void *)KN02XA_MEM_INTR;
33+
volatile u32 *mer = (void *)CKSEG1ADDR(KN02XA_MER);
34+
volatile u32 *mem_intr = (void *)CKSEG1ADDR(KN02XA_MEM_INTR);
3435

3536
*mer = KN02CA_MER_INTR; /* Clear errors; keep the ARC IRQ. */
3637
*mem_intr = 0; /* Any write clears the bus IRQ. */
@@ -40,8 +41,8 @@ static inline void dec_kn02xa_be_ack(void)
4041
static int dec_kn02xa_be_backend(struct pt_regs *regs, int is_fixup,
4142
int invoker)
4243
{
43-
volatile u32 *kn02xa_mer = (void *)KN02XA_MER;
44-
volatile u32 *kn02xa_ear = (void *)KN02XA_EAR;
44+
volatile u32 *kn02xa_mer = (void *)CKSEG1ADDR(KN02XA_MER);
45+
volatile u32 *kn02xa_ear = (void *)CKSEG1ADDR(KN02XA_EAR);
4546

4647
static const char excstr[] = "exception";
4748
static const char intstr[] = "interrupt";
@@ -126,7 +127,7 @@ irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id,
126127

127128
void __init dec_kn02xa_be_init(void)
128129
{
129-
volatile u32 *mbcs = (void *)(KN4K_SLOT_BASE + KN4K_MB_CSR);
130+
volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
130131

131132
/* For KN04 we need to make sure EE (?) is enabled in the MB. */
132133
if (current_cpu_data.cputype == CPU_R4000SC)

‎arch/mips/dec/prom/identify.c‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* identify.c: machine identification code.
33
*
44
* Copyright (C) 1998 Harald Koerfgen and Paul M. Antoine
5-
* Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki
5+
* Copyright (C) 2002, 2003, 2004, 2005 Maciej W. Rozycki
66
*/
77
#include <linux/init.h>
88
#include <linux/kernel.h>
@@ -12,6 +12,7 @@
1212
#include <linux/types.h>
1313

1414
#include <asm/bootinfo.h>
15+
1516
#include <asm/dec/ioasic.h>
1617
#include <asm/dec/ioasic_addrs.h>
1718
#include <asm/dec/kn01.h>
@@ -21,6 +22,7 @@
2122
#include <asm/dec/kn03.h>
2223
#include <asm/dec/kn230.h>
2324
#include <asm/dec/prom.h>
25+
#include <asm/dec/system.h>
2426

2527
#include "dectypes.h"
2628

@@ -68,34 +70,44 @@ EXPORT_SYMBOL(dec_rtc_base);
6870

6971
static inline void prom_init_kn01(void)
7072
{
71-
dec_rtc_base = (void *)KN01_RTC_BASE;
73+
dec_kn_slot_base = KN01_SLOT_BASE;
7274
dec_kn_slot_size = KN01_SLOT_SIZE;
75+
76+
dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
7377
}
7478

7579
static inline void prom_init_kn230(void)
7680
{
77-
dec_rtc_base = (void *)KN01_RTC_BASE;
81+
dec_kn_slot_base = KN01_SLOT_BASE;
7882
dec_kn_slot_size = KN01_SLOT_SIZE;
83+
84+
dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
7985
}
8086

8187
static inline void prom_init_kn02(void)
8288
{
83-
dec_rtc_base = (void *)KN02_RTC_BASE;
89+
dec_kn_slot_base = KN02_SLOT_BASE;
8490
dec_kn_slot_size = KN02_SLOT_SIZE;
91+
92+
dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN02_RTC);
8593
}
8694

8795
static inline void prom_init_kn02xa(void)
8896
{
89-
ioasic_base = (void *)KN02XA_IOASIC_BASE;
90-
dec_rtc_base = (void *)KN02XA_RTC_BASE;
97+
dec_kn_slot_base = KN02XA_SLOT_BASE;
9198
dec_kn_slot_size = IOASIC_SLOT_SIZE;
99+
100+
ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
101+
dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
92102
}
93103

94104
static inline void prom_init_kn03(void)
95105
{
96-
ioasic_base = (void *)KN03_IOASIC_BASE;
97-
dec_rtc_base = (void *)KN03_RTC_BASE;
106+
dec_kn_slot_base = KN03_SLOT_BASE;
98107
dec_kn_slot_size = IOASIC_SLOT_SIZE;
108+
109+
ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
110+
dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
99111
}
100112

101113

‎arch/mips/dec/setup.c‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <asm/dec/kn02ca.h>
4040
#include <asm/dec/kn03.h>
4141
#include <asm/dec/kn230.h>
42+
#include <asm/dec/system.h>
4243

4344

4445
extern void dec_machine_restart(char *command);
@@ -48,10 +49,16 @@ extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
4849

4950
extern asmlinkage void decstation_handle_int(void);
5051

52+
unsigned long dec_kn_slot_base, dec_kn_slot_size;
53+
54+
EXPORT_SYMBOL(dec_kn_slot_base);
55+
EXPORT_SYMBOL(dec_kn_slot_size);
56+
5157
spinlock_t ioasic_ssr_lock;
5258

5359
volatile u32 *ioasic_base;
54-
unsigned long dec_kn_slot_size;
60+
61+
EXPORT_SYMBOL(ioasic_base);
5562

5663
/*
5764
* IRQ routing and priority tables. Priorites are set as follows:
@@ -78,6 +85,9 @@ unsigned long dec_kn_slot_size;
7885
int dec_interrupt[DEC_NR_INTS] = {
7986
[0 ... DEC_NR_INTS - 1] = -1
8087
};
88+
89+
EXPORT_SYMBOL(dec_interrupt);
90+
8191
int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
8292
{ { .i = ~0 }, { .p = dec_intr_unimplemented } },
8393
};
@@ -755,7 +765,3 @@ void __init arch_init_irq(void)
755765
if (dec_interrupt[DEC_IRQ_HALT] >= 0)
756766
setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
757767
}
758-
759-
EXPORT_SYMBOL(ioasic_base);
760-
EXPORT_SYMBOL(dec_kn_slot_size);
761-
EXPORT_SYMBOL(dec_interrupt);

0 commit comments

Comments
 (0)