linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: macro@linux-mips.org
Date: Fri, 01 Jul 2005 17:11:11 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     macro@ftp.linux-mips.org        05/07/01 17:11:05

Modified files:
        arch/mips/dec  : ecc-berr.c int-handler.S kn01-berr.c kn02-irq.c 
                         kn02xa-berr.c setup.c 
        arch/mips/dec/prom: identify.c 
        drivers/mtd/devices: ms02-nv.c 
        drivers/net    : declance.c 
        drivers/scsi   : dec_esp.c 
        drivers/serial : dz.c 
        drivers/tc     : tc.c zs.c 
        drivers/video  : pmag-aa-fb.c pmag-ba-fb.c pmagb-b-fb.c 
        include/asm-mips/dec: ioasic_addrs.h kn01.h kn02.h kn02xa.h 
                              kn03.h kn05.h tc.h 
        include/asm-mips/mach-dec: mc146818rtc.h 
Added files:
        include/asm-mips/dec: system.h 

Log message:
        Use physical addresses at the interface level, letting drivers remap
        them as appropriate.

diff -urN linux/arch/mips/dec/ecc-berr.c linux/arch/mips/dec/ecc-berr.c
--- linux/arch/mips/dec/ecc-berr.c      2005/06/22 20:56:26     1.7
+++ linux/arch/mips/dec/ecc-berr.c      2005/07/01 16:10:40     1.8
@@ -227,11 +227,11 @@
  */
 static inline void dec_kn02_be_init(void)
 {
-       volatile u32 *csr = (void *)KN02_CSR_BASE;
+       volatile u32 *csr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
        unsigned long flags;
 
-       kn0x_erraddr = (void *)(KN02_SLOT_BASE + KN02_ERRADDR);
-       kn0x_chksyn = (void *)(KN02_SLOT_BASE + KN02_CHKSYN);
+       kn0x_erraddr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_ERRADDR);
+       kn0x_chksyn = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CHKSYN);
 
        spin_lock_irqsave(&kn02_lock, flags);
 
@@ -250,11 +250,11 @@
 
 static inline void dec_kn03_be_init(void)
 {
-       volatile u32 *mcr = (void *)(KN03_SLOT_BASE + IOASIC_MCR);
-       volatile u32 *mbcs = (void *)(KN4K_SLOT_BASE + KN4K_MB_CSR);
+       volatile u32 *mcr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);
+       volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
 
-       kn0x_erraddr = (void *)(KN03_SLOT_BASE + IOASIC_ERRADDR);
-       kn0x_chksyn = (void *)(KN03_SLOT_BASE + IOASIC_CHKSYN);
+       kn0x_erraddr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_ERRADDR);
+       kn0x_chksyn = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_CHKSYN);
                        
        /*
         * Set normal ECC detection and generation, enable ECC correction.
diff -urN linux/arch/mips/dec/int-handler.S linux/arch/mips/dec/int-handler.S
--- linux/arch/mips/dec/int-handler.S   2003/11/18 01:17:46     1.15
+++ linux/arch/mips/dec/int-handler.S   2005/07/01 16:10:40     1.16
@@ -2,9 +2,9 @@
  * arch/mips/dec/int-handler.S
  *
  * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
- * Copyright (C) 2000, 2001, 2002, 2003  Maciej W. Rozycki
+ * Copyright (C) 2000, 2001, 2002, 2003, 2005  Maciej W. Rozycki
  *
- * Written by Ralf Baechle and Andreas Busse, modified for DECStation
+ * Written by Ralf Baechle and Andreas Busse, modified for DECstation
  * support by Paul Antoine and Harald Koerfgen.
  *
  * completly rewritten:
@@ -14,11 +14,12 @@
  * by Maciej W. Rozycki.
  */
 #include <linux/config.h>
+
+#include <asm/addrspace.h>
 #include <asm/asm.h>
-#include <asm/regdef.h>
 #include <asm/mipsregs.h>
+#include <asm/regdef.h>
 #include <asm/stackframe.h>
-#include <asm/addrspace.h>
 
 #include <asm/dec/interrupts.h>
 #include <asm/dec/ioasic_addrs.h>
@@ -28,11 +29,14 @@
 #include <asm/dec/kn02xa.h>
 #include <asm/dec/kn03.h>
 
+#define KN02_CSR_BASE          CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR)
+#define KN02XA_IOASIC_BASE     CKSEG1ADDR(KN02XA_SLOT_BASE + IOASIC_IOCTL)
+#define KN03_IOASIC_BASE       CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_IOCTL)
 
                .text
                .set    noreorder
 /*
- * decstation_handle_int: Interrupt handler for DECStations
+ * decstation_handle_int: Interrupt handler for DECstations
  *
  * We follow the model in the Indy interrupt code by David Miller, where he
  * says: a lot of complication here is taken away because:
@@ -48,7 +52,7 @@
  * 3) Linux only thinks in terms of all IRQs on or all IRQs
  *    off, nothing in between like BSD spl() brain-damage.
  *
- * Furthermore, the IRQs on the DECStations look basically (barring
+ * Furthermore, the IRQs on the DECstations look basically (barring
  * software IRQs which we don't use at all) like...
  *
  * DS2100/3100's, aka kn01, aka Pmax:
@@ -61,7 +65,7 @@
  *             3        Lance Ethernet
  *             4        DZ11 serial
  *             5        RTC
- *             6        Memory Controller
+ *             6        Memory Controller & Video
  *             7        FPU
  *
  * DS5000/200, aka kn02, aka 3max:
diff -urN linux/arch/mips/dec/kn01-berr.c linux/arch/mips/dec/kn01-berr.c
--- linux/arch/mips/dec/kn01-berr.c     2005/06/22 20:58:45     1.1
+++ linux/arch/mips/dec/kn01-berr.c     2005/07/01 16:10:40     1.2
@@ -51,7 +51,7 @@
 
 static inline void dec_kn01_be_ack(void)
 {
-       volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
+       volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
        unsigned long flags;
 
        spin_lock_irqsave(&kn01_lock, flags);
@@ -64,7 +64,8 @@
 
 static int dec_kn01_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
 {
-       volatile u32 *kn01_erraddr = (void *)(KN01_SLOT_BASE + KN01_ERRADDR);
+       volatile u32 *kn01_erraddr = (void *)CKSEG1ADDR(KN01_SLOT_BASE +
+                                                       KN01_ERRADDR);
 
        static const char excstr[] = "exception";
        static const char intstr[] = "interrupt";
@@ -152,7 +153,7 @@
 irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id,
                                    struct pt_regs *regs)
 {
-       volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
+       volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
        int action;
 
        if (!(*csr & KN01_CSR_MEMERR))
@@ -178,7 +179,7 @@
 
 void __init dec_kn01_be_init(void)
 {
-       volatile u16 *csr = (void *)(KN01_SLOT_BASE + KN01_CSR);
+       volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
        unsigned long flags;
 
        spin_lock_irqsave(&kn01_lock, flags);
diff -urN linux/arch/mips/dec/kn02-irq.c linux/arch/mips/dec/kn02-irq.c
--- linux/arch/mips/dec/kn02-irq.c      2005/06/22 20:56:26     1.7
+++ linux/arch/mips/dec/kn02-irq.c      2005/07/01 16:10:40     1.8
@@ -37,7 +37,8 @@
 
 static inline void unmask_kn02_irq(unsigned int irq)
 {
-       volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
+       volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
+                                                      KN02_CSR);
 
        cached_kn02_csr |= (1 << (irq - kn02_irq_base + 16));
        *csr = cached_kn02_csr;
@@ -45,7 +46,8 @@
 
 static inline void mask_kn02_irq(unsigned int irq)
 {
-       volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
+       volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
+                                                      KN02_CSR);
 
        cached_kn02_csr &= ~(1 << (irq - kn02_irq_base + 16));
        *csr = cached_kn02_csr;
@@ -105,7 +107,8 @@
 
 void __init init_kn02_irqs(int base)
 {
-       volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE;
+       volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
+                                                      KN02_CSR);
        unsigned long flags;
        int i;
 
diff -urN linux/arch/mips/dec/kn02xa-berr.c linux/arch/mips/dec/kn02xa-berr.c
--- linux/arch/mips/dec/kn02xa-berr.c   2005/06/22 20:58:45     1.1
+++ linux/arch/mips/dec/kn02xa-berr.c   2005/07/01 16:10:40     1.2
@@ -20,6 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 
+#include <asm/addrspace.h>
 #include <asm/system.h>
 #include <asm/traps.h>
 
@@ -29,8 +30,8 @@
 
 static inline void dec_kn02xa_be_ack(void)
 {
-       volatile u32 *mer = (void *)KN02XA_MER;
-       volatile u32 *mem_intr = (void *)KN02XA_MEM_INTR;
+       volatile u32 *mer = (void *)CKSEG1ADDR(KN02XA_MER);
+       volatile u32 *mem_intr = (void *)CKSEG1ADDR(KN02XA_MEM_INTR);
 
        *mer = KN02CA_MER_INTR;         /* Clear errors; keep the ARC IRQ. */
        *mem_intr = 0;                  /* Any write clears the bus IRQ. */
@@ -40,8 +41,8 @@
 static int dec_kn02xa_be_backend(struct pt_regs *regs, int is_fixup,
                                 int invoker)
 {
-       volatile u32 *kn02xa_mer = (void *)KN02XA_MER;
-       volatile u32 *kn02xa_ear = (void *)KN02XA_EAR;
+       volatile u32 *kn02xa_mer = (void *)CKSEG1ADDR(KN02XA_MER);
+       volatile u32 *kn02xa_ear = (void *)CKSEG1ADDR(KN02XA_EAR);
 
        static const char excstr[] = "exception";
        static const char intstr[] = "interrupt";
@@ -126,7 +127,7 @@
 
 void __init dec_kn02xa_be_init(void)
 {
-       volatile u32 *mbcs = (void *)(KN4K_SLOT_BASE + KN4K_MB_CSR);
+       volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
 
         /* For KN04 we need to make sure EE (?) is enabled in the MB.  */
         if (current_cpu_data.cputype == CPU_R4000SC)
diff -urN linux/arch/mips/dec/setup.c linux/arch/mips/dec/setup.c
--- linux/arch/mips/dec/setup.c 2005/06/22 20:56:26     1.47
+++ linux/arch/mips/dec/setup.c 2005/07/01 16:10:40     1.48
@@ -39,6 +39,7 @@
 #include <asm/dec/kn02ca.h>
 #include <asm/dec/kn03.h>
 #include <asm/dec/kn230.h>
+#include <asm/dec/system.h>
 
 
 extern void dec_machine_restart(char *command);
@@ -48,10 +49,16 @@
 
 extern asmlinkage void decstation_handle_int(void);
 
+unsigned long dec_kn_slot_base, dec_kn_slot_size;
+
+EXPORT_SYMBOL(dec_kn_slot_base);
+EXPORT_SYMBOL(dec_kn_slot_size);
+
 spinlock_t ioasic_ssr_lock;
 
 volatile u32 *ioasic_base;
-unsigned long dec_kn_slot_size;
+
+EXPORT_SYMBOL(ioasic_base);
 
 /*
  * IRQ routing and priority tables.  Priorites are set as follows:
@@ -78,6 +85,9 @@
 int dec_interrupt[DEC_NR_INTS] = {
        [0 ... DEC_NR_INTS - 1] = -1
 };
+
+EXPORT_SYMBOL(dec_interrupt);
+
 int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
        { { .i = ~0 }, { .p = dec_intr_unimplemented } },
 };
@@ -755,7 +765,3 @@
        if (dec_interrupt[DEC_IRQ_HALT] >= 0)
                setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
 }
-
-EXPORT_SYMBOL(ioasic_base);
-EXPORT_SYMBOL(dec_kn_slot_size);
-EXPORT_SYMBOL(dec_interrupt);
diff -urN linux/arch/mips/dec/prom/identify.c 
linux/arch/mips/dec/prom/identify.c
--- linux/arch/mips/dec/prom/identify.c 2004/02/11 15:17:32     1.16
+++ linux/arch/mips/dec/prom/identify.c 2005/07/01 16:10:45     1.17
@@ -2,7 +2,7 @@
  * identify.c: machine identification code.
  *
  * Copyright (C) 1998 Harald Koerfgen and Paul M. Antoine
- * Copyright (C) 2002, 2003, 2004  Maciej W. Rozycki
+ * Copyright (C) 2002, 2003, 2004, 2005  Maciej W. Rozycki
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 
 #include <asm/bootinfo.h>
+
 #include <asm/dec/ioasic.h>
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/kn01.h>
@@ -21,6 +22,7 @@
 #include <asm/dec/kn03.h>
 #include <asm/dec/kn230.h>
 #include <asm/dec/prom.h>
+#include <asm/dec/system.h>
 
 #include "dectypes.h"
 
@@ -68,34 +70,44 @@
 
 static inline void prom_init_kn01(void)
 {
-       dec_rtc_base = (void *)KN01_RTC_BASE;
+       dec_kn_slot_base = KN01_SLOT_BASE;
        dec_kn_slot_size = KN01_SLOT_SIZE;
+
+       dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
 }
 
 static inline void prom_init_kn230(void)
 {
-       dec_rtc_base = (void *)KN01_RTC_BASE;
+       dec_kn_slot_base = KN01_SLOT_BASE;
        dec_kn_slot_size = KN01_SLOT_SIZE;
+
+       dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
 }
 
 static inline void prom_init_kn02(void)
 {
-       dec_rtc_base = (void *)KN02_RTC_BASE;
+       dec_kn_slot_base = KN02_SLOT_BASE;
        dec_kn_slot_size = KN02_SLOT_SIZE;
+
+       dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN02_RTC);
 }
 
 static inline void prom_init_kn02xa(void)
 {
-       ioasic_base = (void *)KN02XA_IOASIC_BASE;
-       dec_rtc_base = (void *)KN02XA_RTC_BASE;
+       dec_kn_slot_base = KN02XA_SLOT_BASE;
        dec_kn_slot_size = IOASIC_SLOT_SIZE;
+
+       ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
+       dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
 }
 
 static inline void prom_init_kn03(void)
 {
-       ioasic_base = (void *)KN03_IOASIC_BASE;
-       dec_rtc_base = (void *)KN03_RTC_BASE;
+       dec_kn_slot_base = KN03_SLOT_BASE;
        dec_kn_slot_size = IOASIC_SLOT_SIZE;
+
+       ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
+       dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
 }
 
 
diff -urN linux/drivers/mtd/devices/ms02-nv.c 
linux/drivers/mtd/devices/ms02-nv.c
--- linux/drivers/mtd/devices/ms02-nv.c 2005/06/16 20:42:07     1.12
+++ linux/drivers/mtd/devices/ms02-nv.c 2005/07/01 16:10:49     1.13
@@ -293,13 +293,13 @@
 
        switch (mips_machtype) {
        case MACH_DS5000_200:
-               csr = (volatile u32 *)KN02_CSR_BASE;
+               csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
                if (*csr & KN02_CSR_BNK32M)
                        stride = 2;
                break;
        case MACH_DS5000_2X0:
        case MACH_DS5900:
-               csr = (volatile u32 *)KN03_MCR_BASE;
+               csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);
                if (*csr & KN03_MCR_BNK32M)
                        stride = 2;
                break;
diff -urN linux/drivers/net/declance.c linux/drivers/net/declance.c
--- linux/drivers/net/declance.c        2005/06/16 20:30:59     1.39
+++ linux/drivers/net/declance.c        2005/07/01 16:10:51     1.40
@@ -5,7 +5,7 @@
  *
  *      adopted from sunlance.c by Richard van den Berg
  *
- *      Copyright (C) 2002, 2003  Maciej W. Rozycki
+ *      Copyright (C) 2002, 2003, 2005  Maciej W. Rozycki
  *
  *      additional sources:
  *      - PMAD-AA TURBOchannel Ethernet Module Functional Specification,
@@ -57,13 +57,15 @@
 #include <linux/string.h>
 
 #include <asm/addrspace.h>
+#include <asm/system.h>
+
 #include <asm/dec/interrupts.h>
 #include <asm/dec/ioasic.h>
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/kn01.h>
 #include <asm/dec/machtype.h>
+#include <asm/dec/system.h>
 #include <asm/dec/tc.h>
-#include <asm/system.h>
 
 static char version[] __devinitdata =
 "declance.c: v0.009 by Linux MIPS DECstation task force\n";
@@ -79,10 +81,6 @@
 #define PMAD_LANCE 2
 #define PMAX_LANCE 3
 
-#ifndef CONFIG_TC
-unsigned long system_base;
-unsigned long dmaptr;
-#endif
 
 #define LE_CSR0 0
 #define LE_CSR1 1
@@ -1027,10 +1025,6 @@
        unsigned long esar_base;
        unsigned char *esar;
 
-#ifndef CONFIG_TC
-       system_base = KN01_LANCE_BASE;
-#endif
-
        if (dec_lance_debug && version_printed++ == 0)
                printk(version);
 
@@ -1063,7 +1057,7 @@
        switch (type) {
 #ifdef CONFIG_TC
        case ASIC_LANCE:
-               dev->base_addr = system_base + IOASIC_LANCE;
+               dev->base_addr = CKSEG1ADDR(dec_kn_slot_base + IOASIC_LANCE);
 
                /* buffer space for the on-board LANCE shared memory */
                /*
@@ -1072,7 +1066,7 @@
                dev->mem_start = CKSEG1ADDR(0x00020000);
                dev->mem_end = dev->mem_start + 0x00020000;
                dev->irq = dec_interrupt[DEC_IRQ_LANCE];
-               esar_base = system_base + IOASIC_ESAR;
+               esar_base = CKSEG1ADDR(dec_kn_slot_base + IOASIC_ESAR);
 
                /* Workaround crash with booting KN04 2.1k from Disk */
                memset((void *)dev->mem_start, 0,
@@ -1109,7 +1103,7 @@
        case PMAD_LANCE:
                claim_tc_card(slot);
 
-               dev->mem_start = get_tc_base_addr(slot);
+               dev->mem_start = CKSEG1ADDR(get_tc_base_addr(slot));
                dev->base_addr = dev->mem_start + 0x100000;
                dev->irq = get_tc_irq_nr(slot);
                esar_base = dev->mem_start + 0x1c0002;
@@ -1138,9 +1132,9 @@
 
        case PMAX_LANCE:
                dev->irq = dec_interrupt[DEC_IRQ_LANCE];
-               dev->base_addr = KN01_LANCE_BASE;
-               dev->mem_start = KN01_LANCE_BASE + 0x01000000;
-               esar_base = KN01_RTC_BASE + 1;
+               dev->base_addr = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE);
+               dev->mem_start = CKSEG1ADDR(KN01_SLOT_BASE + KN01_LANCE_MEM);
+               esar_base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_ESAR + 1);
                lp->dma_irq = -1;
 
                /*
diff -urN linux/drivers/scsi/dec_esp.c linux/drivers/scsi/dec_esp.c
--- linux/drivers/scsi/dec_esp.c        2005/06/16 20:31:01     1.29
+++ linux/drivers/scsi/dec_esp.c        2005/07/01 16:10:53     1.30
@@ -18,7 +18,7 @@
  * 20001005    - Initialization fixes for 2.4.0-test9
  *                       Florian Lohoff <flo@rfc822.org>
  *
- *     Copyright (C) 2002, 2003  Maciej W. Rozycki
+ *     Copyright (C) 2002, 2003, 2005  Maciej W. Rozycki
  */
 
 #include <linux/kernel.h>
@@ -41,6 +41,7 @@
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/ioasic_ints.h>
 #include <asm/dec/machtype.h>
+#include <asm/dec/system.h>
 #include <asm/dec/tc.h>
 
 #define DEC_SCSI_SREG 0
@@ -183,7 +184,8 @@
                esp->dregs = 0;
 
                /* ESP register base */
-               esp->eregs = (struct ESP_regs *) (system_base + IOASIC_SCSI);
+               esp->eregs = (void *)CKSEG1ADDR(dec_kn_slot_base +
+                                               IOASIC_SCSI);
 
                /* Set the command buffer */
                esp->esp_command = (volatile unsigned char *) cmd_buffer;
@@ -228,10 +230,11 @@
                        mem_start = get_tc_base_addr(slot);
 
                        /* Store base addr into esp struct */
-                       esp->slot = CPHYSADDR(mem_start);
+                       esp->slot = mem_start;
 
                        esp->dregs = 0;
-                       esp->eregs = (struct ESP_regs *) (mem_start + 
DEC_SCSI_SREG);
+                       esp->eregs = (void *)CKSEG1ADDR(mem_start +
+                                                       DEC_SCSI_SREG);
                        esp->do_pio_cmds = 1;
 
                        /* Set the command buffer */
diff -urN linux/drivers/serial/dz.c linux/drivers/serial/dz.c
--- linux/drivers/serial/dz.c   2004/11/15 11:49:32     1.4
+++ linux/drivers/serial/dz.c   2005/07/01 16:10:55     1.5
@@ -645,9 +645,9 @@
 
        if (mips_machtype == MACH_DS23100 ||
            mips_machtype == MACH_DS5100)
-               base = (unsigned long) KN01_DZ11_BASE;
+               base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_DZ11);
        else
-               base = (unsigned long) KN02_DZ11_BASE;
+               base = CKSEG1ADDR(KN02_SLOT_BASE + KN02_DZ11);
 
        for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) {
                spin_lock_init(&dport->port.lock);
diff -urN linux/drivers/tc/tc.c linux/drivers/tc/tc.c
--- linux/drivers/tc/tc.c       2005/06/16 20:37:41     1.18
+++ linux/drivers/tc/tc.c       2005/07/01 16:10:57     1.19
@@ -10,31 +10,29 @@
  * Copyright (c) Harald Koerfgen, 1998
  * Copyright (c) 2001, 2003, 2005  Maciej W. Rozycki
  */
-#include <linux/string.h>
 #include <linux/init.h>
-#include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/string.h>
+#include <linux/types.h>
 
 #include <asm/addrspace.h>
+#include <asm/bug.h>
 #include <asm/errno.h>
+#include <asm/io.h>
+#include <asm/paccess.h>
+
 #include <asm/dec/machtype.h>
 #include <asm/dec/prom.h>
 #include <asm/dec/tcinfo.h>
 #include <asm/dec/tcmodule.h>
 #include <asm/dec/interrupts.h>
-#include <asm/paccess.h>
-#include <asm/ptrace.h>
-
-#define TC_DEBUG
 
 MODULE_LICENSE("GPL");
 slot_info tc_bus[MAX_SLOT];
 static int num_tcslots;
 static tcinfo *info;
 
-unsigned long system_base;
-
 /*
  * Interface to the world. Read comment in include/asm-mips/tc.h.
  */
@@ -97,13 +95,16 @@
 static void __init tc_probe(unsigned long startaddr, unsigned long size,
                            int slots)
 {
+       unsigned long slotaddr;
        int i, slot, err;
        long offset;
-       unsigned char pattern[4];
-       unsigned char *module;
+       u8 pattern[4];
+       volatile u8 *module;
 
        for (slot = 0; slot < slots; slot++) {
-               module = (char *)(startaddr + slot * size);
+               slotaddr = startaddr + slot * size;
+               module = ioremap_nocache(slotaddr, size);
+               BUG_ON(!module);
 
                offset = OLDCARD;
 
@@ -112,8 +113,10 @@
                err |= get_dbe(pattern[1], module + OLDCARD + TC_PATTERN1);
                err |= get_dbe(pattern[2], module + OLDCARD + TC_PATTERN2);
                err |= get_dbe(pattern[3], module + OLDCARD + TC_PATTERN3);
-               if (err)
+               if (err) {
+                       iounmap(module);
                        continue;
+               }
 
                if (pattern[0] != 0x55 || pattern[1] != 0x00 ||
                    pattern[2] != 0xaa || pattern[3] != 0xff) {
@@ -124,16 +127,20 @@
                        err |= get_dbe(pattern[1], module + TC_PATTERN1);
                        err |= get_dbe(pattern[2], module + TC_PATTERN2);
                        err |= get_dbe(pattern[3], module + TC_PATTERN3);
-                       if (err)
+                       if (err) {
+                               iounmap(module);
                                continue;
+                       }
                }
 
                if (pattern[0] != 0x55 || pattern[1] != 0x00 ||
-                   pattern[2] != 0xaa || pattern[3] != 0xff)
+                   pattern[2] != 0xaa || pattern[3] != 0xff) {
+                       iounmap(module);
                        continue;
+               }
 
-               tc_bus[slot].base_addr = (unsigned long)module;
-               for(i = 0; i < 8; i++) {
+               tc_bus[slot].base_addr = slotaddr;
+               for (i = 0; i < 8; i++) {
                        tc_bus[slot].firmware[i] =
                                module[TC_FIRM_VER + offset + 4 * i];
                        tc_bus[slot].vendor[i] =
@@ -171,6 +178,8 @@
                        tc_bus[slot].interrupt = -1;
                        break;
                }
+
+               iounmap(module);
        }
 }
 
@@ -196,8 +205,8 @@
                tc_bus[i].flags = FREE;
        }
 
-       info = (tcinfo *) rex_gettcinfo();
-       slot0addr = (unsigned long)CKSEG1ADDR(rex_slot_address(0));
+       info = rex_gettcinfo();
+       slot0addr = CPHYSADDR((long)rex_slot_address(0));
 
        switch (mips_machtype) {
        case MACH_DS5000_200:
@@ -216,35 +225,21 @@
 
        tc_clock = 10000 / info->clk_period;
 
-       if (TURBOCHANNEL && info->slot_size && slot0addr) {
-               printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision,
-                       tc_clock / 10, tc_clock % 10);
-               printk("(with%s parity)\n", info->parity ? "" : "out");
+       if (info->slot_size && slot0addr) {
+               pr_info("TURBOchannel rev. %d at %d.%d MHz (with%s parity)\n",
+                       info->revision, tc_clock / 10, tc_clock % 10,
+                       info->parity ? "" : "out");
 
                slot_size = info->slot_size << 20;
 
                tc_probe(slot0addr, slot_size, num_tcslots);
 
-               /*
-                * All TURBOchannel DECstations have the onboard devices
-                * where the (num_tcslots + 0 or 1 on DS5k/xx) Option Module
-                * would be.
-                */
-               if(mips_machtype == MACH_DS5000_XX)
-                       i = 1;
-               else
-                       i = 0;
-
-               system_base = slot0addr + slot_size * (num_tcslots + i);
-
-#ifdef TC_DEBUG
-               for (i = 0; i < num_tcslots; i++)
-                       if (tc_bus[i].base_addr) {
-                               printk("    slot %d: ", i);
-                               printk("%s %s %s\n", tc_bus[i].vendor,
-                                       tc_bus[i].name, tc_bus[i].firmware);
-                       }
-#endif
+               for (i = 0; i < num_tcslots; i++) {
+                       if (!tc_bus[i].base_addr)
+                               continue;
+                       pr_info("    slot %d: %s %s %s\n", i, tc_bus[i].vendor,
+                               tc_bus[i].name, tc_bus[i].firmware);
+               }
        }
 
        return 0;
@@ -258,4 +253,3 @@
 EXPORT_SYMBOL(get_tc_base_addr);
 EXPORT_SYMBOL(get_tc_irq_nr);
 EXPORT_SYMBOL(get_tc_speed);
-EXPORT_SYMBOL(system_base);
diff -urN linux/drivers/tc/zs.c linux/drivers/tc/zs.c
--- linux/drivers/tc/zs.c       2005/06/16 20:49:03     1.60
+++ linux/drivers/tc/zs.c       2005/07/01 16:10:57     1.61
@@ -65,14 +65,14 @@
 #include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/bootinfo.h>
-#include <asm/dec/serial.h>
 
-#ifdef CONFIG_MACH_DECSTATION
 #include <asm/dec/interrupts.h>
+#include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/machtype.h>
+#include <asm/dec/serial.h>
+#include <asm/dec/system.h>
 #include <asm/dec/tc.h>
-#include <asm/dec/ioasic_addrs.h>
-#endif
+
 #ifdef CONFIG_KGDB
 #include <asm/kgdb.h>
 #endif
@@ -1602,30 +1602,22 @@
                return;
        }
 
-       /*
-        * When serial console is activated, tc_init has not been called yet
-        * and system_base is undefined. Unfortunately we have to hardcode
-        * system_base for this case :-(. HK
-        */
        switch(mips_machtype) {
 #ifdef CONFIG_MACH_DECSTATION
        case MACH_DS5000_2X0:
        case MACH_DS5900:
-               system_base = CKSEG1ADDR(0x1f800000);
                n_chips = 2;
                zs_parms = &ds_parms;
                zs_parms->irq0 = dec_interrupt[DEC_IRQ_SCC0];
                zs_parms->irq1 = dec_interrupt[DEC_IRQ_SCC1];
                break;
        case MACH_DS5000_1XX:
-               system_base = CKSEG1ADDR(0x1c000000);
                n_chips = 2;
                zs_parms = &ds_parms;
                zs_parms->irq0 = dec_interrupt[DEC_IRQ_SCC0];
                zs_parms->irq1 = dec_interrupt[DEC_IRQ_SCC1];
                break;
        case MACH_DS5000_XX:
-               system_base = CKSEG1ADDR(0x1c000000);
                n_chips = 1;
                zs_parms = &ds_parms;
                zs_parms->irq0 = dec_interrupt[DEC_IRQ_SCC0];
@@ -1647,10 +1639,10 @@
                         * The sccs reside on the high byte of the 16 bit IOBUS
                         */
                        zs_channels[n_channels].control =
-                               (volatile unsigned char *)system_base +
+                               (volatile void *)CKSEG1ADDR(dec_kn_slot_base +
                          (0 == chip ? zs_parms->scc0 : zs_parms->scc1) +
                          (0 == channel ? zs_parms->channel_a_offset :
-                                         zs_parms->channel_b_offset);
+                                         zs_parms->channel_b_offset));
                        zs_channels[n_channels].data =
                                zs_channels[n_channels].control + 4;
 
diff -urN linux/drivers/video/pmag-aa-fb.c linux/drivers/video/pmag-aa-fb.c
--- linux/drivers/video/pmag-aa-fb.c    2003/12/11 16:39:55     1.3
+++ linux/drivers/video/pmag-aa-fb.c    2005/07/01 16:10:59     1.4
@@ -413,7 +413,7 @@
 
 static int __init init_one(int slot)
 {
-       unsigned long base_addr = get_tc_base_addr(slot);
+       unsigned long base_addr = CKSEG1ADDR(get_tc_base_addr(slot));
        struct aafb_info *ip = &my_fb_info[slot];
 
        memset(ip, 0, sizeof(struct aafb_info));
diff -urN linux/drivers/video/pmag-ba-fb.c linux/drivers/video/pmag-ba-fb.c
--- linux/drivers/video/pmag-ba-fb.c    2004/10/12 01:45:47     1.19
+++ linux/drivers/video/pmag-ba-fb.c    2005/07/01 16:10:59     1.20
@@ -122,7 +122,7 @@
 
 int __init pmagbafb_init_one(int slot)
 {
-       unsigned long base_addr = get_tc_base_addr(slot);
+       unsigned long base_addr = CKSEG1ADDR(get_tc_base_addr(slot));
        struct fb_info *info = &pmagba_fb_info[slot]; 
        struct display *disp = &pmagba_disp[slot];
 
diff -urN linux/drivers/video/pmagb-b-fb.c linux/drivers/video/pmagb-b-fb.c
--- linux/drivers/video/pmagb-b-fb.c    2004/10/12 01:45:47     1.18
+++ linux/drivers/video/pmagb-b-fb.c    2005/07/01 16:10:59     1.19
@@ -123,7 +123,7 @@
 
 int __init pmagbbfb_init_one(int slot)
 {
-       unsigned long base_addr = get_tc_base_addr(slot);
+       unsigned long base_addr = CKSEG1ADDR(get_tc_base_addr(slot));
        struct fb_info *info = &pmagbb_fb_info[slot];
 
        printk("PMAGB-BA framebuffer in slot %d\n", slot);
diff -urN linux/include/asm-mips/dec/system.h 
linux/include/asm-mips/dec/system.h
--- linux/include/asm-mips/dec/system.h 1970/01/01 00:00:00
+++ linux/include/asm-mips/dec/system.h 2005-07-01 17:11:02.313242000 +0100     
1.1
@@ -0,0 +1,18 @@
+/*
+ *     include/asm-mips/dec/system.h
+ *
+ *     Generic DECstation/DECsystem bits.
+ *
+ *     Copyright (C) 2005  Maciej W. Rozycki
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     as published by the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_DEC_SYSTEM_H
+#define __ASM_DEC_SYSTEM_H
+
+extern unsigned long dec_kn_slot_base, dec_kn_slot_size;
+
+#endif /* __ASM_DEC_SYSTEM_H */
diff -urN linux/include/asm-mips/dec/ioasic_addrs.h 
linux/include/asm-mips/dec/ioasic_addrs.h
--- linux/include/asm-mips/dec/ioasic_addrs.h   2003/04/14 12:31:05     1.7
+++ linux/include/asm-mips/dec/ioasic_addrs.h   2005/07/01 16:11:02     1.8
@@ -45,7 +45,8 @@
 
 
 /*
- * Offsets for I/O ASIC registers (relative to (system_base + IOASIC_IOCTL)).
+ * Offsets for I/O ASIC registers
+ * (relative to (dec_kn_slot_base + IOASIC_IOCTL)).
  */
                                        /* all systems */
 #define IO_REG_SCSI_DMA_P      0x00    /* SCSI DMA Pointer */
diff -urN linux/include/asm-mips/dec/kn01.h linux/include/asm-mips/dec/kn01.h
--- linux/include/asm-mips/dec/kn01.h   2005/06/22 20:56:29     1.7
+++ linux/include/asm-mips/dec/kn01.h   2005/07/01 16:11:02     1.8
@@ -13,9 +13,7 @@
 #ifndef __ASM_MIPS_DEC_KN01_H
 #define __ASM_MIPS_DEC_KN01_H
 
-#include <asm/addrspace.h>
-
-#define KN01_SLOT_BASE CKSEG1ADDR(0x10000000)
+#define KN01_SLOT_BASE 0x10000000
 #define KN01_SLOT_SIZE 0x01000000
 
 /*
@@ -41,17 +39,9 @@
 
 
 /*
- * Some port addresses...
- */
-#define KN01_LANCE_BASE (KN01_SLOT_BASE + KN01_LANCE)  /* 0xB8000000 */
-#define KN01_DZ11_BASE (KN01_SLOT_BASE + KN01_DZ11)    /* 0xBC000000 */
-#define KN01_RTC_BASE  (KN01_SLOT_BASE + KN01_RTC)     /* 0xBD000000 */
-
-
-/*
  * Frame buffer memory address.
  */
-#define KN01_VFB_MEM   CKSEG1ADDR(0x0fc00000)
+#define KN01_VFB_MEM   0x0fc00000
 
 /*
  * CPU interrupt bits.
diff -urN linux/include/asm-mips/dec/kn02.h linux/include/asm-mips/dec/kn02.h
--- linux/include/asm-mips/dec/kn02.h   2005/06/22 20:56:29     1.8
+++ linux/include/asm-mips/dec/kn02.h   2005/07/01 16:11:02     1.9
@@ -13,11 +13,7 @@
 #ifndef __ASM_MIPS_DEC_KN02_H
 #define __ASM_MIPS_DEC_KN02_H
 
-#include <asm/addrspace.h>
-#include <asm/dec/ecc.h>
-
-
-#define KN02_SLOT_BASE CKSEG1ADDR(0x1fc00000)
+#define KN02_SLOT_BASE 0x1fc00000
 #define KN02_SLOT_SIZE 0x00080000
 
 /*
@@ -34,14 +30,6 @@
 
 
 /*
- * Some port addresses...
- */
-#define KN02_DZ11_BASE (KN02_SLOT_BASE + KN02_DZ11)    /* DZ11 */
-#define KN02_RTC_BASE  (KN02_SLOT_BASE + KN02_RTC)     /* RTC */
-#define KN02_CSR_BASE  (KN02_SLOT_BASE + KN02_CSR)     /* CSR */
-
-
-/*
  * System Control & Status Register bits.
  */
 #define KN02_CSR_RES_28                (0xf<<28)       /* unused */
diff -urN linux/include/asm-mips/dec/kn02xa.h 
linux/include/asm-mips/dec/kn02xa.h
--- linux/include/asm-mips/dec/kn02xa.h 2005/06/22 20:56:29     1.9
+++ linux/include/asm-mips/dec/kn02xa.h 2005/07/01 16:11:02     1.10
@@ -17,31 +17,23 @@
 #ifndef __ASM_MIPS_DEC_KN02XA_H
 #define __ASM_MIPS_DEC_KN02XA_H
 
-#include <asm/addrspace.h>
 #include <asm/dec/ioasic_addrs.h>
 
-#define KN02XA_SLOT_BASE       CKSEG1ADDR(0x1c000000)
-
-/*
- * Some port addresses...
- */
-#define KN02XA_IOASIC_BASE    (KN02XA_SLOT_BASE + IOASIC_IOCTL)        /* I/O 
ASIC */
-#define KN02XA_RTC_BASE                (KN02XA_SLOT_BASE + IOASIC_TOY) /* RTC 
*/
-
+#define KN02XA_SLOT_BASE       0x1c000000
 
 /*
  * Memory control ASIC registers.
  */
-#define KN02XA_MER     CKSEG1ADDR(0x0c400000)  /* memory error register */
-#define KN02XA_MSR     CKSEG1ADDR(0x0c800000)  /* memory size register */
+#define KN02XA_MER             0x0c400000      /* memory error register */
+#define KN02XA_MSR             0x0c800000      /* memory size register */
 
 /*
  * CPU control ASIC registers.
  */
-#define KN02XA_MEM_CONF        CKSEG1ADDR(0x0e000000)  /* write timeout config 
*/
-#define KN02XA_EAR     CKSEG1ADDR(0x0e000004)  /* error address register */
-#define KN02XA_BOOT0   CKSEG1ADDR(0x0e000008)  /* boot 0 register */
-#define KN02XA_MEM_INTR        CKSEG1ADDR(0x0e00000c)  /* write err IRQ stat & 
ack */
+#define KN02XA_MEM_CONF                0x0e000000      /* write timeout config 
*/
+#define KN02XA_EAR             0x0e000004      /* error address register */
+#define KN02XA_BOOT0           0x0e000008      /* boot 0 register */
+#define KN02XA_MEM_INTR                0x0e00000c      /* write err IRQ stat & 
ack */
 
 /*
  * Memory Error Register bits, common definitions.
diff -urN linux/include/asm-mips/dec/kn03.h linux/include/asm-mips/dec/kn03.h
--- linux/include/asm-mips/dec/kn03.h   2005/06/16 20:31:04     1.8
+++ linux/include/asm-mips/dec/kn03.h   2005/07/01 16:11:02     1.9
@@ -10,24 +10,15 @@
  *
  * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
  * are by courtesy of Chris Fraser.
- * Copyright (C) 2000, 2002, 2003  Maciej W. Rozycki
+ * Copyright (C) 2000, 2002, 2003, 2005  Maciej W. Rozycki
  */
 #ifndef __ASM_MIPS_DEC_KN03_H
 #define __ASM_MIPS_DEC_KN03_H
 
-#include <asm/addrspace.h>
 #include <asm/dec/ecc.h>
 #include <asm/dec/ioasic_addrs.h>
 
-#define KN03_SLOT_BASE CKSEG1ADDR(0x1f800000)
-
-/*
- * Some port addresses...
- */
-#define KN03_IOASIC_BASE       (KN03_SLOT_BASE + IOASIC_IOCTL) /* I/O ASIC */
-#define KN03_RTC_BASE          (KN03_SLOT_BASE + IOASIC_TOY)   /* RTC */
-#define KN03_MCR_BASE          (KN03_SLOT_BASE + IOASIC_MCR)   /* MCR */
-
+#define KN03_SLOT_BASE         0x1f800000
 
 /*
  * CPU interrupt bits.
diff -urN linux/include/asm-mips/dec/kn05.h linux/include/asm-mips/dec/kn05.h
--- linux/include/asm-mips/dec/kn05.h   2005/06/22 20:56:29     1.6
+++ linux/include/asm-mips/dec/kn05.h   2005/07/01 16:11:02     1.7
@@ -21,7 +21,6 @@
 #ifndef __ASM_MIPS_DEC_KN05_H
 #define __ASM_MIPS_DEC_KN05_H
 
-#include <asm/addrspace.h>
 #include <asm/dec/ioasic_addrs.h>
 
 /*
@@ -30,7 +29,7 @@
  * passed to the I/O ASIC's decoder like with the KN03 or KN02-BA/CA.
  * Others are handled locally.  "Low" slots are always passed.
  */
-#define KN4K_SLOT_BASE KSEG1ADDR(0x1fc00000)
+#define KN4K_SLOT_BASE 0x1fc00000
 
 #define KN4K_MB_ROM    (0*IOASIC_SLOT_SIZE)    /* KN05/KN04 card ROM */
 #define KN4K_IOCTL     (1*IOASIC_SLOT_SIZE)    /* I/O ASIC */
diff -urN linux/include/asm-mips/dec/tc.h linux/include/asm-mips/dec/tc.h
--- linux/include/asm-mips/dec/tc.h     2002/08/06 00:08:59     1.2
+++ linux/include/asm-mips/dec/tc.h     2005/07/01 16:11:02     1.3
@@ -7,10 +7,8 @@
  *
  * Copyright (c) 1998 Harald Koerfgen
  */
-#ifndef ASM_TC_H
-#define ASM_TC_H
-
-extern unsigned long system_base;
+#ifndef __ASM_DEC_TC_H
+#define __ASM_DEC_TC_H
 
 /*
  * Search for a TURBOchannel Option Module
@@ -36,8 +34,8 @@
  */
 extern unsigned long get_tc_irq_nr(int);
 /*
- * Return TURBOchannel clock frequency in hz
+ * Return TURBOchannel clock frequency in Hz
  */
 extern unsigned long get_tc_speed(void);
 
-#endif
+#endif /* __ASM_DEC_TC_H */
diff -urN linux/include/asm-mips/mach-dec/mc146818rtc.h 
linux/include/asm-mips/mach-dec/mc146818rtc.h
--- linux/include/asm-mips/mach-dec/mc146818rtc.h       2004/06/06 02:12:54     
1.3
+++ linux/include/asm-mips/mach-dec/mc146818rtc.h       2005/07/01 16:11:04     
1.4
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1998, 2001 by Ralf Baechle
  * Copyright (C) 1998 by Harald Koerfgen
- * Copyright (C) 2002  Maciej W. Rozycki
+ * Copyright (C) 2002, 2005  Maciej W. Rozycki
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -14,23 +14,18 @@
 #define __ASM_MIPS_DEC_RTC_DEC_H
 
 #include <linux/types.h>
-
 #include <asm/addrspace.h>
+#include <asm/dec/system.h>
 
 extern volatile u8 *dec_rtc_base;
-extern unsigned long dec_kn_slot_size;
 
-#define RTC_PORT(x)    CPHYSADDR(dec_rtc_base)
+#define RTC_PORT(x)    CPHYSADDR((long)dec_rtc_base)
 #define RTC_IO_EXTENT  dec_kn_slot_size
 #define RTC_IOMAPPED   0
 #undef RTC_IRQ
 
 #define RTC_DEC_YEAR   0x3f    /* Where we store the real year on DECs.  */
 
-#include <linux/mc146818rtc.h>
-#include <linux/module.h>
-#include <linux/types.h>
-
 static inline unsigned char CMOS_READ(unsigned long addr)
 {
        return dec_rtc_base[addr * 4];

<Prev in Thread] Current Thread [Next in Thread>