aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/Kbuild1
-rw-r--r--include/asm-mips/a.out.h1
-rw-r--r--include/asm-mips/addrspace.h37
-rw-r--r--include/asm-mips/apm.h64
-rw-r--r--include/asm-mips/arc/types.h1
-rw-r--r--include/asm-mips/asm.h1
-rw-r--r--include/asm-mips/asmmacro-32.h4
-rw-r--r--include/asm-mips/asmmacro-64.h19
-rw-r--r--include/asm-mips/asmmacro.h5
-rw-r--r--include/asm-mips/atomic.h3
-rw-r--r--include/asm-mips/bcache.h1
-rw-r--r--include/asm-mips/bitops.h3
-rw-r--r--include/asm-mips/bootinfo.h13
-rw-r--r--include/asm-mips/bug.h1
-rw-r--r--include/asm-mips/bugs.h1
-rw-r--r--include/asm-mips/byteorder.h1
-rw-r--r--include/asm-mips/cache.h1
-rw-r--r--include/asm-mips/checksum.h1
-rw-r--r--include/asm-mips/compat.h3
-rw-r--r--include/asm-mips/cpu-features.h31
-rw-r--r--include/asm-mips/cpu-info.h1
-rw-r--r--include/asm-mips/cpu.h2
-rw-r--r--include/asm-mips/ddb5074.h11
-rw-r--r--include/asm-mips/ddb5xxx/ddb5074.h38
-rw-r--r--include/asm-mips/ddb5xxx/ddb5476.h157
-rw-r--r--include/asm-mips/ddb5xxx/ddb5477.h1
-rw-r--r--include/asm-mips/ddb5xxx/ddb5xxx.h12
-rw-r--r--include/asm-mips/debug.h1
-rw-r--r--include/asm-mips/dec/prom.h1
-rw-r--r--include/asm-mips/delay.h23
-rw-r--r--include/asm-mips/dma.h1
-rw-r--r--include/asm-mips/elf.h1
-rw-r--r--include/asm-mips/emma2rh/emma2rh.h330
-rw-r--r--include/asm-mips/emma2rh/markeins.h76
-rw-r--r--include/asm-mips/fcntl.h1
-rw-r--r--include/asm-mips/fixmap.h5
-rw-r--r--include/asm-mips/fpu.h4
-rw-r--r--include/asm-mips/fpu_emulator.h4
-rw-r--r--include/asm-mips/futex.h33
-rw-r--r--include/asm-mips/hazards.h5
-rw-r--r--include/asm-mips/highmem.h1
-rw-r--r--include/asm-mips/hw_irq.h8
-rw-r--r--include/asm-mips/inst.h2
-rw-r--r--include/asm-mips/io.h1
-rw-r--r--include/asm-mips/ip32/machine.h1
-rw-r--r--include/asm-mips/irq.h5
-rw-r--r--include/asm-mips/irqflags.h (renamed from include/asm-mips/interrupt.h)71
-rw-r--r--include/asm-mips/isadep.h1
-rw-r--r--include/asm-mips/jmr3927/irq.h1
-rw-r--r--include/asm-mips/kmap_types.h1
-rw-r--r--include/asm-mips/local.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_dbdma.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_psc.h12
-rw-r--r--include/asm-mips/mach-au1x00/ioremap.h1
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-db1x00/db1x00.h13
-rw-r--r--include/asm-mips/mach-ddb5074/mc146818rtc.h31
-rw-r--r--include/asm-mips/mach-dec/mc146818rtc.h2
-rw-r--r--include/asm-mips/mach-dec/param.h18
-rw-r--r--include/asm-mips/mach-emma2rh/irq.h (renamed from include/asm-mips/mach-mips/param.h)8
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h40
-rw-r--r--include/asm-mips/mach-excite/excite.h154
-rw-r--r--include/asm-mips/mach-excite/excite_nandflash.h7
-rw-r--r--include/asm-mips/mach-excite/rm9k_eth.h23
-rw-r--r--include/asm-mips/mach-excite/rm9k_wdt.h12
-rw-r--r--include/asm-mips/mach-excite/rm9k_xicap.h16
-rw-r--r--include/asm-mips/mach-generic/floppy.h2
-rw-r--r--include/asm-mips/mach-generic/ide.h1
-rw-r--r--include/asm-mips/mach-generic/kmalloc.h1
-rw-r--r--include/asm-mips/mach-generic/param.h13
-rw-r--r--include/asm-mips/mach-generic/spaces.h1
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-ip22/spaces.h1
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h5
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-ip32/kmalloc.h1
-rw-r--r--include/asm-mips/mach-ja/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-jazz/floppy.h2
-rw-r--r--include/asm-mips/mach-jazz/param.h16
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h9
-rw-r--r--include/asm-mips/mach-mips/irq.h7
-rw-r--r--include/asm-mips/mach-ocelot3/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-pb1x00/pb1550.h1
-rw-r--r--include/asm-mips/mach-qemu/param.h13
-rw-r--r--include/asm-mips/mach-rm200/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h9
-rw-r--r--include/asm-mips/mach-wrppmc/mach-gt64120.h84
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mips-boards/generic.h1
-rw-r--r--include/asm-mips/mipsregs.h12
-rw-r--r--include/asm-mips/mmu_context.h1
-rw-r--r--include/asm-mips/mmzone.h13
-rw-r--r--include/asm-mips/module.h1
-rw-r--r--include/asm-mips/msgbuf.h1
-rw-r--r--include/asm-mips/paccess.h1
-rw-r--r--include/asm-mips/page.h28
-rw-r--r--include/asm-mips/param.h2
-rw-r--r--include/asm-mips/pci.h1
-rw-r--r--include/asm-mips/pci/bridge.h3
-rw-r--r--include/asm-mips/pgalloc.h1
-rw-r--r--include/asm-mips/pgtable-32.h62
-rw-r--r--include/asm-mips/pgtable-64.h14
-rw-r--r--include/asm-mips/pgtable-bits.h1
-rw-r--r--include/asm-mips/pgtable.h8
-rw-r--r--include/asm-mips/prefetch.h1
-rw-r--r--include/asm-mips/processor.h17
-rw-r--r--include/asm-mips/ptrace.h1
-rw-r--r--include/asm-mips/qemu.h6
-rw-r--r--include/asm-mips/reg.h1
-rw-r--r--include/asm-mips/resource.h1
-rw-r--r--include/asm-mips/rm9k-ocd.h56
-rw-r--r--include/asm-mips/serial.h1
-rw-r--r--include/asm-mips/sgiarcs.h1
-rw-r--r--include/asm-mips/sibyte/board.h1
-rw-r--r--include/asm-mips/sibyte/carmel.h1
-rw-r--r--include/asm-mips/sibyte/sentosa.h1
-rw-r--r--include/asm-mips/sibyte/swarm.h1
-rw-r--r--include/asm-mips/siginfo.h1
-rw-r--r--include/asm-mips/signal.h12
-rw-r--r--include/asm-mips/sim.h1
-rw-r--r--include/asm-mips/smp.h6
-rw-r--r--include/asm-mips/sn/addrs.h28
-rw-r--r--include/asm-mips/sn/agent.h1
-rw-r--r--include/asm-mips/sn/arch.h1
-rw-r--r--include/asm-mips/sn/fru.h (renamed from include/asm-mips/sn/sn0/sn0_fru.h)8
-rw-r--r--include/asm-mips/sn/io.h1
-rw-r--r--include/asm-mips/sn/ioc3.h2
-rw-r--r--include/asm-mips/sn/klconfig.h100
-rw-r--r--include/asm-mips/sn/kldir.h35
-rw-r--r--include/asm-mips/sn/launch.h1
-rw-r--r--include/asm-mips/sn/mapped_kernel.h1
-rw-r--r--include/asm-mips/sn/sn0/addrs.h88
-rw-r--r--include/asm-mips/sn/sn0/arch.h18
-rw-r--r--include/asm-mips/sn/sn0/hub.h4
-rw-r--r--include/asm-mips/sn/sn0/hubio.h16
-rw-r--r--include/asm-mips/sn/sn0/hubmd.h3
-rw-r--r--include/asm-mips/sn/sn0/hubpi.h18
-rw-r--r--include/asm-mips/sn/sn0/ip27.h9
-rw-r--r--include/asm-mips/sni.h7
-rw-r--r--include/asm-mips/socket.h1
-rw-r--r--include/asm-mips/sparsemem.h14
-rw-r--r--include/asm-mips/stackframe.h17
-rw-r--r--include/asm-mips/string.h1
-rw-r--r--include/asm-mips/system.h6
-rw-r--r--include/asm-mips/thread_info.h1
-rw-r--r--include/asm-mips/time.h4
-rw-r--r--include/asm-mips/tlbflush.h1
-rw-r--r--include/asm-mips/tx4927/toshiba_rbtx4927.h1
-rw-r--r--include/asm-mips/types.h1
-rw-r--r--include/asm-mips/uaccess.h1
-rw-r--r--include/asm-mips/unistd.h28
-rw-r--r--include/asm-mips/vga.h2
-rw-r--r--include/asm-mips/vr41xx/capcella.h2
-rw-r--r--include/asm-mips/vr41xx/cmbvr4133.h6
-rw-r--r--include/asm-mips/vr41xx/e55.h43
-rw-r--r--include/asm-mips/vr41xx/irq.h101
-rw-r--r--include/asm-mips/vr41xx/mpc30x.h2
-rw-r--r--include/asm-mips/vr41xx/tb0219.h2
-rw-r--r--include/asm-mips/vr41xx/tb0226.h2
-rw-r--r--include/asm-mips/vr41xx/tb0287.h2
-rw-r--r--include/asm-mips/vr41xx/vr41xx.h53
-rw-r--r--include/asm-mips/vr41xx/vrc4173.h222
-rw-r--r--include/asm-mips/vr41xx/workpad.h43
-rw-r--r--include/asm-mips/war.h6
-rw-r--r--include/asm-mips/wbflush.h1
169 files changed, 1312 insertions, 1370 deletions
diff --git a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild
new file mode 100644
index 00000000000..c68e1680da0
--- /dev/null
+++ b/include/asm-mips/Kbuild
@@ -0,0 +1 @@
include include/asm-generic/Kbuild.asm
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index 2b3dc3bed4d..ef33c3f1348 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14 13
15#endif 14#endif
16 15
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 42520cc84b0..45c706e34df 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_ADDRSPACE_H 10#ifndef _ASM_ADDRSPACE_H
11#define _ASM_ADDRSPACE_H 11#define _ASM_ADDRSPACE_H
12 12
13#include <linux/config.h>
14#include <spaces.h> 13#include <spaces.h>
15 14
16/* 15/*
@@ -129,60 +128,26 @@
129#if defined (CONFIG_CPU_R4300) \ 128#if defined (CONFIG_CPU_R4300) \
130 || defined (CONFIG_CPU_R4X00) \ 129 || defined (CONFIG_CPU_R4X00) \
131 || defined (CONFIG_CPU_R5000) \ 130 || defined (CONFIG_CPU_R5000) \
131 || defined (CONFIG_CPU_RM7000) \
132 || defined (CONFIG_CPU_NEVADA) \ 132 || defined (CONFIG_CPU_NEVADA) \
133 || defined (CONFIG_CPU_TX49XX) \ 133 || defined (CONFIG_CPU_TX49XX) \
134 || defined (CONFIG_CPU_MIPS64) 134 || defined (CONFIG_CPU_MIPS64)
135#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
136#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
137#define K0SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
138#define K1SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
139#define K2SIZE _LLCONST_(0x000000ff80000000)
140#define KSEGSIZE _LLCONST_(0x000000ff80000000) /* max syssegsz */
141#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */ 135#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */
142#endif 136#endif
143 137
144#if defined (CONFIG_CPU_R8000) 138#if defined (CONFIG_CPU_R8000)
145/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ 139/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
146#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
147#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
148#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
149#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
150#define K2SIZE _LLCONST_(0x0001000000000000)
151#define KSEGSIZE _LLCONST_(0x0000010000000000) /* max syssegsz */
152#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ 140#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
153#endif 141#endif
154 142
155#if defined (CONFIG_CPU_R10000) 143#if defined (CONFIG_CPU_R10000)
156#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
157#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
158#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
159#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
160#define K2SIZE _LLCONST_(0x00000fff80000000)
161#define KSEGSIZE _LLCONST_(0x00000fff80000000) /* max syssegsz */
162#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ 144#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
163#endif 145#endif
164 146
165#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) 147#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A)
166#define KUSIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
167#define KUSIZE_64 _LLCONST_(0x0000100000000000) /* 2^^44 */
168#define K0SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
169#define K1SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
170#define K2SIZE _LLCONST_(0x0000ffff80000000)
171#define KSEGSIZE _LLCONST_(0x0000ffff80000000) /* max syssegsz */
172#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */ 148#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */
173#endif 149#endif
174 150
175/*
176 * Further names for SGI source compatibility. These are stolen from
177 * IRIX's <sys/mips_addrspace.h>.
178 */
179#define KUBASE _LLCONST_(0)
180#define KUSIZE_32 _LLCONST_(0x0000000080000000) /* KUSIZE
181 for a 32 bit proc */
182#define K0BASE_EXL_WR _LLCONST_(0xa800000000000000) /* exclusive on write */
183#define K0BASE_NONCOH _LLCONST_(0x9800000000000000) /* noncoherent */
184#define K0BASE_EXL _LLCONST_(0xa000000000000000) /* exclusive */
185
186#ifndef CONFIG_CPU_R8000 151#ifndef CONFIG_CPU_R8000
187 152
188/* 153/*
diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h
new file mode 100644
index 00000000000..4b99ffc1152
--- /dev/null
+++ b/include/asm-mips/apm.h
@@ -0,0 +1,64 @@
1/* -*- linux-c -*-
2 *
3 * (C) 2003 zecke@handhelds.org
4 *
5 * GPL version 2
6 *
7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide
9 * apm status
10 *
11 *
12 */
13#ifndef MIPS_ASM_SA1100_APM_H
14#define MIPS_ASM_SA1100_APM_H
15
16#include <linux/apm_bios.h>
17
18/*
19 * This structure gets filled in by the machine specific 'get_power_status'
20 * implementation. Any fields which are not set default to a safe value.
21 */
22struct apm_power_info {
23 unsigned char ac_line_status;
24#define APM_AC_OFFLINE 0
25#define APM_AC_ONLINE 1
26#define APM_AC_BACKUP 2
27#define APM_AC_UNKNOWN 0xff
28
29 unsigned char battery_status;
30#define APM_BATTERY_STATUS_HIGH 0
31#define APM_BATTERY_STATUS_LOW 1
32#define APM_BATTERY_STATUS_CRITICAL 2
33#define APM_BATTERY_STATUS_CHARGING 3
34#define APM_BATTERY_STATUS_NOT_PRESENT 4
35#define APM_BATTERY_STATUS_UNKNOWN 0xff
36
37 unsigned char battery_flag;
38#define APM_BATTERY_FLAG_HIGH (1 << 0)
39#define APM_BATTERY_FLAG_LOW (1 << 1)
40#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
41#define APM_BATTERY_FLAG_CHARGING (1 << 3)
42#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
43#define APM_BATTERY_FLAG_UNKNOWN 0xff
44
45 int battery_life;
46 int time;
47 int units;
48#define APM_UNITS_MINS 0
49#define APM_UNITS_SECS 1
50#define APM_UNITS_UNKNOWN -1
51
52};
53
54/*
55 * This allows machines to provide their own "apm get power status" function.
56 */
57extern void (*apm_get_power_status)(struct apm_power_info *);
58
59/*
60 * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
61 */
62void apm_queue_event(apm_event_t event);
63
64#endif
diff --git a/include/asm-mips/arc/types.h b/include/asm-mips/arc/types.h
index bbb725c366f..b9adcd6f086 100644
--- a/include/asm-mips/arc/types.h
+++ b/include/asm-mips/arc/types.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_ARC_TYPES_H 9#ifndef _ASM_ARC_TYPES_H
10#define _ASM_ARC_TYPES_H 10#define _ASM_ARC_TYPES_H
11 11
12#include <linux/config.h>
13 12
14#ifdef CONFIG_ARC32 13#ifdef CONFIG_ARC32
15 14
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
index 4b090f3142e..e3038a4599e 100644
--- a/include/asm-mips/asm.h
+++ b/include/asm-mips/asm.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_ASM_H 17#ifndef __ASM_ASM_H
18#define __ASM_ASM_H 18#define __ASM_ASM_H
19 19
20#include <linux/config.h>
21#include <asm/sgidefs.h> 20#include <asm/sgidefs.h>
22 21
23#ifndef CAT 22#ifndef CAT
diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h
index 11daf5ceb7b..5de3963f511 100644
--- a/include/asm-mips/asmmacro-32.h
+++ b/include/asm-mips/asmmacro-32.h
@@ -12,7 +12,7 @@
12#include <asm/fpregdef.h> 12#include <asm/fpregdef.h>
13#include <asm/mipsregs.h> 13#include <asm/mipsregs.h>
14 14
15 .macro fpu_save_double thread status tmp1=t0 tmp2 15 .macro fpu_save_double thread status tmp1=t0
16 cfc1 \tmp1, fcr31 16 cfc1 \tmp1, fcr31
17 sdc1 $f0, THREAD_FPR0(\thread) 17 sdc1 $f0, THREAD_FPR0(\thread)
18 sdc1 $f2, THREAD_FPR2(\thread) 18 sdc1 $f2, THREAD_FPR2(\thread)
@@ -70,7 +70,7 @@
70 sw \tmp, THREAD_FCR31(\thread) 70 sw \tmp, THREAD_FCR31(\thread)
71 .endm 71 .endm
72 72
73 .macro fpu_restore_double thread tmp=t0 73 .macro fpu_restore_double thread status tmp=t0
74 lw \tmp, THREAD_FCR31(\thread) 74 lw \tmp, THREAD_FCR31(\thread)
75 ldc1 $f0, THREAD_FPR0(\thread) 75 ldc1 $f0, THREAD_FPR0(\thread)
76 ldc1 $f2, THREAD_FPR2(\thread) 76 ldc1 $f2, THREAD_FPR2(\thread)
diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h
index 559c355b9b8..225feefcb25 100644
--- a/include/asm-mips/asmmacro-64.h
+++ b/include/asm-mips/asmmacro-64.h
@@ -53,12 +53,12 @@
53 sdc1 $f31, THREAD_FPR31(\thread) 53 sdc1 $f31, THREAD_FPR31(\thread)
54 .endm 54 .endm
55 55
56 .macro fpu_save_double thread status tmp1 tmp2 56 .macro fpu_save_double thread status tmp
57 sll \tmp2, \tmp1, 5 57 sll \tmp, \status, 5
58 bgez \tmp2, 2f 58 bgez \tmp, 2f
59 fpu_save_16odd \thread 59 fpu_save_16odd \thread
602: 602:
61 fpu_save_16even \thread \tmp1 # clobbers t1 61 fpu_save_16even \thread \tmp
62 .endm 62 .endm
63 63
64 .macro fpu_restore_16even thread tmp=t0 64 .macro fpu_restore_16even thread tmp=t0
@@ -101,13 +101,12 @@
101 ldc1 $f31, THREAD_FPR31(\thread) 101 ldc1 $f31, THREAD_FPR31(\thread)
102 .endm 102 .endm
103 103
104 .macro fpu_restore_double thread tmp 104 .macro fpu_restore_double thread status tmp
105 mfc0 t0, CP0_STATUS 105 sll \tmp, \status, 5
106 sll t1, t0, 5 106 bgez \tmp, 1f # 16 register mode?
107 bgez t1, 1f # 16 register mode?
108 107
109 fpu_restore_16odd a0 108 fpu_restore_16odd \thread
1101: fpu_restore_16even a0, t0 # clobbers t0 1091: fpu_restore_16even \thread \tmp
111 .endm 110 .endm
112 111
113 .macro cpu_save_nonscratch thread 112 .macro cpu_save_nonscratch thread
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index f54aa147ec1..92e62ef711e 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_ASMMACRO_H 8#ifndef _ASM_ASMMACRO_H
9#define _ASM_ASMMACRO_H 9#define _ASM_ASMMACRO_H
10 10
11#include <linux/config.h>
12#include <asm/hazards.h> 11#include <asm/hazards.h>
13 12
14#ifdef CONFIG_32BIT 13#ifdef CONFIG_32BIT
@@ -27,14 +26,14 @@
27 ori \reg, \reg, TCSTATUS_IXMT 26 ori \reg, \reg, TCSTATUS_IXMT
28 xori \reg, \reg, TCSTATUS_IXMT 27 xori \reg, \reg, TCSTATUS_IXMT
29 mtc0 \reg, CP0_TCSTATUS 28 mtc0 \reg, CP0_TCSTATUS
30 ehb 29 _ehb
31 .endm 30 .endm
32 31
33 .macro local_irq_disable reg=t0 32 .macro local_irq_disable reg=t0
34 mfc0 \reg, CP0_TCSTATUS 33 mfc0 \reg, CP0_TCSTATUS
35 ori \reg, \reg, TCSTATUS_IXMT 34 ori \reg, \reg, TCSTATUS_IXMT
36 mtc0 \reg, CP0_TCSTATUS 35 mtc0 \reg, CP0_TCSTATUS
37 ehb 36 _ehb
38 .endm 37 .endm
39#else 38#else
40 .macro local_irq_enable reg=t0 39 .macro local_irq_enable reg=t0
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 2c8b853376c..e64abc0d822 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -17,14 +17,13 @@
17 * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the 17 * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the
18 * main big wrapper ... 18 * main big wrapper ...
19 */ 19 */
20#include <linux/config.h>
21#include <linux/spinlock.h> 20#include <linux/spinlock.h>
22 21
23#ifndef _ASM_ATOMIC_H 22#ifndef _ASM_ATOMIC_H
24#define _ASM_ATOMIC_H 23#define _ASM_ATOMIC_H
25 24
25#include <linux/irqflags.h>
26#include <asm/cpu-features.h> 26#include <asm/cpu-features.h>
27#include <asm/interrupt.h>
28#include <asm/war.h> 27#include <asm/war.h>
29 28
30typedef struct { volatile int counter; } atomic_t; 29typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-mips/bcache.h b/include/asm-mips/bcache.h
index 446102b34f4..3646a3f2ed3 100644
--- a/include/asm-mips/bcache.h
+++ b/include/asm-mips/bcache.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_BCACHE_H 9#ifndef _ASM_BCACHE_H
10#define _ASM_BCACHE_H 10#define _ASM_BCACHE_H
11 11
12#include <linux/config.h>
13 12
14/* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent, 13/* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent,
15 chipset implemented caches. On machines with other CPUs the CPU does the 14 chipset implemented caches. On machines with other CPUs the CPU does the
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index d2f444537e4..1bb89c5a10e 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_BITOPS_H 9#ifndef _ASM_BITOPS_H
10#define _ASM_BITOPS_H 10#define _ASM_BITOPS_H
11 11
12#include <linux/config.h>
13#include <linux/compiler.h> 12#include <linux/compiler.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <asm/bug.h> 14#include <asm/bug.h>
@@ -32,7 +31,7 @@
32 31
33#ifdef __KERNEL__ 32#ifdef __KERNEL__
34 33
35#include <asm/interrupt.h> 34#include <linux/irqflags.h>
36#include <asm/sgidefs.h> 35#include <asm/sgidefs.h>
37#include <asm/war.h> 36#include <asm/war.h>
38 37
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 14fc88f2722..3b745e76f42 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -217,6 +217,13 @@
217 */ 217 */
218#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ 218#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
219#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */ 219#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
220#define MACH_TITAN_EXCITE 2 /* Basler eXcite */
221
222/*
223 * Valid machtype for group NEC EMMA2RH
224 */
225#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
226#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
220 227
221#define CL_SIZE COMMAND_LINE_SIZE 228#define CL_SIZE COMMAND_LINE_SIZE
222 229
@@ -258,4 +265,10 @@ extern char arcs_cmdline[CL_SIZE];
258 * Registers a0, a1, a3 and a4 as passed to the kenrel entry by firmware 265 * Registers a0, a1, a3 and a4 as passed to the kenrel entry by firmware
259 */ 266 */
260extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; 267extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
268
269/*
270 * Platform memory detection hook called by setup_arch
271 */
272extern void plat_mem_setup(void);
273
261#endif /* _ASM_BOOTINFO_H */ 274#endif /* _ASM_BOOTINFO_H */
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
index 87d49a5bdc6..7b4739dc8f3 100644
--- a/include/asm-mips/bug.h
+++ b/include/asm-mips/bug.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_BUG_H 1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H 2#define __ASM_BUG_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
7 6
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
index cb2ea7c15c7..0d7f9c1f554 100644
--- a/include/asm-mips/bugs.h
+++ b/include/asm-mips/bugs.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_BUGS_H 7#ifndef _ASM_BUGS_H
8#define _ASM_BUGS_H 8#define _ASM_BUGS_H
9 9
10#include <linux/config.h>
11#include <linux/delay.h> 10#include <linux/delay.h>
12#include <asm/cpu.h> 11#include <asm/cpu.h>
13#include <asm/cpu-info.h> 12#include <asm/cpu-info.h>
diff --git a/include/asm-mips/byteorder.h b/include/asm-mips/byteorder.h
index aefc02f16fd..eee83cbdf2b 100644
--- a/include/asm-mips/byteorder.h
+++ b/include/asm-mips/byteorder.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_BYTEORDER_H 8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H 9#define _ASM_BYTEORDER_H
10 10
11#include <linux/config.h>
12#include <linux/compiler.h> 11#include <linux/compiler.h>
13#include <asm/types.h> 12#include <asm/types.h>
14 13
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h
index 55e19f2ff0e..37f175c42bb 100644
--- a/include/asm-mips/cache.h
+++ b/include/asm-mips/cache.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_CACHE_H 9#ifndef _ASM_CACHE_H
10#define _ASM_CACHE_H 10#define _ASM_CACHE_H
11 11
12#include <linux/config.h>
13#include <kmalloc.h> 12#include <kmalloc.h>
14 13
15#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT 14#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index b09f8971e95..a5e6050ec0f 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_CHECKSUM_H 11#ifndef _ASM_CHECKSUM_H
12#define _ASM_CHECKSUM_H 12#define _ASM_CHECKSUM_H
13 13
14#include <linux/config.h>
15#include <linux/in6.h> 14#include <linux/in6.h>
16 15
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 986511db54a..900f472fdd2 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -145,8 +145,5 @@ static inline void __user *compat_alloc_user_space(long len)
145 145
146 return (void __user *) (regs->regs[29] - len); 146 return (void __user *) (regs->regs[29] - len);
147} 147}
148#if defined (__MIPSEL__)
149#define __COMPAT_ENDIAN_SWAP__ 1
150#endif
151 148
152#endif /* _ASM_COMPAT_H */ 149#endif /* _ASM_COMPAT_H */
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 254e11ed247..eadca266f15 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_CPU_FEATURES_H 9#ifndef __ASM_CPU_FEATURES_H
10#define __ASM_CPU_FEATURES_H 10#define __ASM_CPU_FEATURES_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/cpu.h> 13#include <asm/cpu.h>
15#include <asm/cpu-info.h> 14#include <asm/cpu-info.h>
@@ -144,12 +143,8 @@
144#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) 143#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
145#endif 144#endif
146 145
147#ifdef CONFIG_MIPS_MT
148#ifndef cpu_has_mipsmt 146#ifndef cpu_has_mipsmt
149# define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) 147#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
150#endif
151#else
152# define cpu_has_mipsmt 0
153#endif 148#endif
154 149
155#ifdef CONFIG_32BIT 150#ifdef CONFIG_32BIT
@@ -188,24 +183,20 @@
188# endif 183# endif
189#endif 184#endif
190 185
191#ifdef CONFIG_CPU_MIPSR2 186#if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint)
192# if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) 187# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT)
193# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) 188#elif !defined(cpu_has_vint)
194# else
195# define cpu_has_vint 0
196# endif
197# if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
198# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
199# else
200# define cpu_has_veic 0
201# endif
202#else
203# define cpu_has_vint 0 189# define cpu_has_vint 0
190#endif
191
192#if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
193# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
194#elif !defined(cpu_has_veic)
204# define cpu_has_veic 0 195# define cpu_has_veic 0
205#endif 196#endif
206 197
207#ifndef cpu_has_subset_pcaches 198#ifndef cpu_has_inclusive_pcaches
208#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) 199#define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES)
209#endif 200#endif
210 201
211#ifndef cpu_dcache_line_size 202#ifndef cpu_dcache_line_size
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 6572ac70366..a2f0c8ea916 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_CPU_INFO_H 12#ifndef __ASM_CPU_INFO_H
13#define __ASM_CPU_INFO_H 13#define __ASM_CPU_INFO_H
14 14
15#include <linux/config.h>
16#include <asm/cache.h> 15#include <asm/cache.h>
17 16
18#ifdef CONFIG_SGI_IP27 17#ifdef CONFIG_SGI_IP27
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index dff2a0a52f8..d38fdbf845b 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -242,7 +242,7 @@
242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */ 242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */
243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */ 243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */
244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */ 244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */
245#define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */ 245#define MIPS_CPU_INCLUSIVE_CACHES 0x00040000 /* P-cache subset enforced */
246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ 246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */
247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ 247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */
248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ 248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */
diff --git a/include/asm-mips/ddb5074.h b/include/asm-mips/ddb5074.h
deleted file mode 100644
index 0d09ac27f9a..00000000000
--- a/include/asm-mips/ddb5074.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 */
7
8extern void ddb5074_led_hex(int hex);
9extern void ddb5074_led_d2(int on);
10extern void ddb5074_led_d3(int on);
11
diff --git a/include/asm-mips/ddb5xxx/ddb5074.h b/include/asm-mips/ddb5xxx/ddb5074.h
deleted file mode 100644
index 58d88306af6..00000000000
--- a/include/asm-mips/ddb5xxx/ddb5074.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 */
7
8#ifndef _ASM_DDB5XXX_DDB5074_H
9#define _ASM_DDB5XXX_DDB5074_H
10
11#include <asm/nile4.h>
12
13#define DDB_SDRAM_SIZE 0x04000000 /* 64MB */
14
15#define DDB_PCI_IO_BASE 0x06000000
16#define DDB_PCI_IO_SIZE 0x02000000 /* 32 MB */
17
18#define DDB_PCI_MEM_BASE 0x08000000
19#define DDB_PCI_MEM_SIZE 0x08000000 /* 128 MB */
20
21#define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE
22#define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE
23
24#define NILE4_PCI_IO_BASE 0xa6000000
25#define NILE4_PCI_MEM_BASE 0xa8000000
26#define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE
27#define DDB_PCI_IACK_BASE NILE4_PCI_IO_BASE
28
29#define NILE4_IRQ_BASE NUM_I8259_INTERRUPTS
30#define CPU_IRQ_BASE (NUM_NILE4_INTERRUPTS + NILE4_IRQ_BASE)
31#define CPU_NILE4_CASCADE 2
32
33extern void ddb5074_led_hex(int hex);
34extern void ddb5074_led_d2(int on);
35extern void ddb5074_led_d3(int on);
36
37extern void nile4_irq_setup(u32 base);
38#endif
diff --git a/include/asm-mips/ddb5xxx/ddb5476.h b/include/asm-mips/ddb5xxx/ddb5476.h
deleted file mode 100644
index 4c23390d935..00000000000
--- a/include/asm-mips/ddb5xxx/ddb5476.h
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 * header file specific for ddb5476
3 *
4 * Copyright (C) 2001 MontaVista Software Inc.
5 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14/*
15 * Memory map (physical address)
16 *
17 * Note most of the following address must be properly aligned by the
18 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
19 * PCI_IO_BASE must be aligned along 16MB boundary.
20 */
21#define DDB_SDRAM_BASE 0x00000000
22#define DDB_SDRAM_SIZE 0x04000000 /* 64MB */
23
24#define DDB_DCS3_BASE 0x04000000 /* flash 1 */
25#define DDB_DCS3_SIZE 0x01000000 /* 16MB */
26
27#define DDB_DCS2_BASE 0x05000000 /* flash 2 */
28#define DDB_DCS2_SIZE 0x01000000 /* 16MB */
29
30#define DDB_PCI_IO_BASE 0x06000000
31#define DDB_PCI_IO_SIZE 0x02000000 /* 32 MB */
32
33#define DDB_PCI_MEM_BASE 0x08000000
34#define DDB_PCI_MEM_SIZE 0x08000000 /* 128 MB */
35
36#define DDB_DCS5_BASE 0x13000000 /* DDB status regs */
37#define DDB_DCS5_SIZE 0x00200000 /* 2MB, 8-bit */
38
39#define DDB_DCS4_BASE 0x14000000 /* DDB control regs */
40#define DDB_DCS4_SIZE 0x00200000 /* 2MB, 8-bit */
41
42#define DDB_INTCS_BASE 0x1fa00000 /* VRC5476 control regs */
43#define DDB_INTCS_SIZE 0x00200000 /* 2MB */
44
45#define DDB_BOOTCS_BASE 0x1fc00000 /* Boot ROM / EPROM /Flash */
46#define DDB_BOOTCS_SIZE 0x00200000 /* 2 MB - doc says 4MB */
47
48
49/* aliases */
50#define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE
51#define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE
52
53/* PCI intr ack share PCIW0 with PCI IO */
54#define DDB_PCI_IACK_BASE DDB_PCI_IO_BASE
55
56/*
57 * Interrupt mapping
58 *
59 * We have three interrupt controllers:
60 *
61 * . CPU itself - 8 sources
62 * . i8259 - 16 sources
63 * . vrc5476 - 16 sources
64 *
65 * They connected as follows:
66 * all vrc5476 interrupts are routed to cpu IP2 (by software setting)
67 * all i2869 are routed to INTC in vrc5476 (by hardware connection)
68 *
69 * All VRC5476 PCI interrupts are level-triggered (no ack needed).
70 * All PCI irq but INTC are active low.
71 */
72
73/*
74 * irq number block assignment
75 */
76
77#define NUM_CPU_IRQ 8
78#define NUM_I8259_IRQ 16
79#define NUM_VRC5476_IRQ 16
80
81#define DDB_IRQ_BASE 0
82
83#define I8259_IRQ_BASE DDB_IRQ_BASE
84#define VRC5476_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
85#define CPU_IRQ_BASE (VRC5476_IRQ_BASE + NUM_VRC5476_IRQ)
86
87/*
88 * vrc5476 irq defs, see page 52-64 of Vrc5074 system controller manual
89 */
90
91#define VRC5476_IRQ_CPCE 0 /* cpu parity error */
92#define VRC5476_IRQ_CNTD 1 /* cpu no target */
93#define VRC5476_IRQ_MCE 2 /* memory check error */
94#define VRC5476_IRQ_DMA 3 /* DMA */
95#define VRC5476_IRQ_UART 4 /* vrc5476 builtin UART, not used */
96#define VRC5476_IRQ_WDOG 5 /* watchdog timer */
97#define VRC5476_IRQ_GPT 6 /* general purpose timer */
98#define VRC5476_IRQ_LBRT 7 /* local bus read timeout */
99#define VRC5476_IRQ_INTA 8 /* PCI INT #A */
100#define VRC5476_IRQ_INTB 9 /* PCI INT #B */
101#define VRC5476_IRQ_INTC 10 /* PCI INT #C */
102#define VRC5476_IRQ_INTD 11 /* PCI INT #D */
103#define VRC5476_IRQ_INTE 12 /* PCI INT #E */
104#define VRC5476_IRQ_RESERVED_13 13 /* reserved */
105#define VRC5476_IRQ_PCIS 14 /* PCI SERR # */
106#define VRC5476_IRQ_PCI 15 /* PCI internal error */
107
108/*
109 * i2859 irq assignment
110 */
111#define I8259_IRQ_RESERVED_0 0
112#define I8259_IRQ_KEYBOARD 1 /* M1543 default */
113#define I8259_IRQ_CASCADE 2
114#define I8259_IRQ_UART_B 3 /* M1543 default, may conflict with RTC according to schematic diagram */
115#define I8259_IRQ_UART_A 4 /* M1543 default */
116#define I8259_IRQ_PARALLEL 5 /* M1543 default */
117#define I8259_IRQ_RESERVED_6 6
118#define I8259_IRQ_RESERVED_7 7
119#define I8259_IRQ_RTC 8 /* who set this? */
120#define I8259_IRQ_USB 9 /* ddb_setup */
121#define I8259_IRQ_PMU 10 /* ddb_setup */
122#define I8259_IRQ_RESERVED_11 11
123#define I8259_IRQ_RESERVED_12 12 /* m1543_irq_setup */
124#define I8259_IRQ_RESERVED_13 13
125#define I8259_IRQ_HDC1 14 /* default and ddb_setup */
126#define I8259_IRQ_HDC2 15 /* default */
127
128
129/*
130 * misc
131 */
132#define VRC5476_I8259_CASCADE VRC5476_IRQ_INTC
133#define CPU_VRC5476_CASCADE 2
134
135#define is_i8259_irq(irq) ((irq) < NUM_I8259_IRQ)
136#define nile4_to_irq(n) ((n)+NUM_I8259_IRQ)
137#define irq_to_nile4(n) ((n)-NUM_I8259_IRQ)
138
139/*
140 * low-level irq functions
141 */
142#ifndef __ASSEMBLY__
143extern void nile4_map_irq(int nile4_irq, int cpu_irq);
144extern void nile4_map_irq_all(int cpu_irq);
145extern void nile4_enable_irq(int nile4_irq);
146extern void nile4_disable_irq(int nile4_irq);
147extern void nile4_disable_irq_all(void);
148extern u16 nile4_get_irq_stat(int cpu_irq);
149extern void nile4_enable_irq_output(int cpu_irq);
150extern void nile4_disable_irq_output(int cpu_irq);
151extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
152extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
153extern void nile4_clear_irq(int nile4_irq);
154extern void nile4_clear_irq_mask(u32 mask);
155extern u8 nile4_i8259_iack(void);
156extern void nile4_dump_irq_status(void); /* Debug */
157#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h
index a438548e6ef..c5af4b73fdd 100644
--- a/include/asm-mips/ddb5xxx/ddb5477.h
+++ b/include/asm-mips/ddb5xxx/ddb5477.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_DDB5XXX_DDB5477_H 17#ifndef __ASM_DDB5XXX_DDB5477_H
18#define __ASM_DDB5XXX_DDB5477_H 18#define __ASM_DDB5XXX_DDB5477_H
19 19
20#include <linux/config.h>
21 20
22/* 21/*
23 * This contains macros that are specific to DDB5477 or renamed from 22 * This contains macros that are specific to DDB5477 or renamed from
diff --git a/include/asm-mips/ddb5xxx/ddb5xxx.h b/include/asm-mips/ddb5xxx/ddb5xxx.h
index 873c03f2c5f..e97fcc8d548 100644
--- a/include/asm-mips/ddb5xxx/ddb5xxx.h
+++ b/include/asm-mips/ddb5xxx/ddb5xxx.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_DDB5XXX_DDB5XXX_H 18#ifndef __ASM_DDB5XXX_DDB5XXX_H
19#define __ASM_DDB5XXX_DDB5XXX_H 19#define __ASM_DDB5XXX_DDB5XXX_H
20 20
21#include <linux/config.h>
22#include <linux/types.h> 21#include <linux/types.h>
23 22
24/* 23/*
@@ -174,13 +173,8 @@
174 173
175static inline void ddb_sync(void) 174static inline void ddb_sync(void)
176{ 175{
177/* The DDB5074 doesn't seem to like these accesses. They kill the board on
178 * interrupt load
179 */
180#ifndef CONFIG_DDB5074
181 volatile u32 *p = (volatile u32 *)0xbfc00000; 176 volatile u32 *p = (volatile u32 *)0xbfc00000;
182 (void)(*p); 177 (void)(*p);
183#endif
184} 178}
185 179
186static inline void ddb_out32(u32 offset, u32 val) 180static inline void ddb_out32(u32 offset, u32 val)
@@ -260,11 +254,7 @@ extern void ddb_pci_reset_bus(void);
260/* 254/*
261 * include the board dependent part 255 * include the board dependent part
262 */ 256 */
263#if defined(CONFIG_DDB5074) 257#if defined(CONFIG_DDB5477)
264#include <asm/ddb5xxx/ddb5074.h>
265#elif defined(CONFIG_DDB5476)
266#include <asm/ddb5xxx/ddb5476.h>
267#elif defined(CONFIG_DDB5477)
268#include <asm/ddb5xxx/ddb5477.h> 258#include <asm/ddb5xxx/ddb5477.h>
269#else 259#else
270#error "Unknown DDB board!" 260#error "Unknown DDB board!"
diff --git a/include/asm-mips/debug.h b/include/asm-mips/debug.h
index 930f2b75e76..1fd5a2b3944 100644
--- a/include/asm-mips/debug.h
+++ b/include/asm-mips/debug.h
@@ -15,7 +15,6 @@
15#ifndef _ASM_DEBUG_H 15#ifndef _ASM_DEBUG_H
16#define _ASM_DEBUG_H 16#define _ASM_DEBUG_H
17 17
18#include <linux/config.h>
19 18
20/* 19/*
21 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in 20 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h
index 1384dd0964b..b9c8203688d 100644
--- a/include/asm-mips/dec/prom.h
+++ b/include/asm-mips/dec/prom.h
@@ -15,7 +15,6 @@
15#ifndef _ASM_DEC_PROM_H 15#ifndef _ASM_DEC_PROM_H
16#define _ASM_DEC_PROM_H 16#define _ASM_DEC_PROM_H
17 17
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20 19
21#include <asm/addrspace.h> 20#include <asm/addrspace.h>
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index 64dd45150f6..ea77050f8e3 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_DELAY_H 10#ifndef _ASM_DELAY_H
11#define _ASM_DELAY_H 11#define _ASM_DELAY_H
12 12
13#include <linux/config.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/smp.h> 14#include <linux/smp.h>
16#include <asm/compiler.h> 15#include <asm/compiler.h>
@@ -19,20 +18,22 @@ static inline void __delay(unsigned long loops)
19{ 18{
20 if (sizeof(long) == 4) 19 if (sizeof(long) == 4)
21 __asm__ __volatile__ ( 20 __asm__ __volatile__ (
22 ".set\tnoreorder\n" 21 " .set noreorder \n"
23 "1:\tbnez\t%0,1b\n\t" 22 " .align 3 \n"
24 "subu\t%0,1\n\t" 23 "1: bnez %0, 1b \n"
25 ".set\treorder" 24 " subu %0, 1 \n"
25 " .set reorder \n"
26 : "=r" (loops) 26 : "=r" (loops)
27 : "0" (loops)); 27 : "0" (loops));
28 else if (sizeof(long) == 8) 28 else if (sizeof(long) == 8)
29 __asm__ __volatile__ ( 29 __asm__ __volatile__ (
30 ".set\tnoreorder\n" 30 " .set noreorder \n"
31 "1:\tbnez\t%0,1b\n\t" 31 " .align 3 \n"
32 "dsubu\t%0,1\n\t" 32 "1: bnez %0, 1b \n"
33 ".set\treorder" 33 " dsubu %0, 1 \n"
34 :"=r" (loops) 34 " .set reorder \n"
35 :"0" (loops)); 35 : "=r" (loops)
36 : "0" (loops));
36} 37}
37 38
38 39
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h
index 6aaf9939a71..e85849ac165 100644
--- a/include/asm-mips/dma.h
+++ b/include/asm-mips/dma.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_DMA_H 12#ifndef _ASM_DMA_H
13#define _ASM_DMA_H 13#define _ASM_DMA_H
14 14
15#include <linux/config.h>
16#include <asm/io.h> /* need byte IO */ 15#include <asm/io.h> /* need byte IO */
17#include <linux/spinlock.h> /* And spinlocks */ 16#include <linux/spinlock.h> /* And spinlocks */
18#include <linux/delay.h> 17#include <linux/delay.h>
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index bdc9de2df1e..ebd6bfb19d6 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_ELF_H 8#ifndef _ASM_ELF_H
9#define _ASM_ELF_H 9#define _ASM_ELF_H
10 10
11#include <linux/config.h>
12 11
13/* ELF header e_flags defines. */ 12/* ELF header e_flags defines. */
14/* MIPS architecture level. */ 13/* MIPS architecture level. */
diff --git a/include/asm-mips/emma2rh/emma2rh.h b/include/asm-mips/emma2rh/emma2rh.h
new file mode 100644
index 00000000000..4fb8df71caa
--- /dev/null
+++ b/include/asm-mips/emma2rh/emma2rh.h
@@ -0,0 +1,330 @@
1/*
2 * include/asm-mips/emma2rh/emma2rh.h
3 * This file is EMMA2RH common header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __ASM_EMMA2RH_EMMA2RH_H
25#define __ASM_EMMA2RH_EMMA2RH_H
26
27/*
28 * EMMA2RH registers
29 */
30#define REGBASE 0x10000000
31
32#define EMMA2RH_BHIF_STRAP_0 (0x000010+REGBASE)
33#define EMMA2RH_BHIF_INT_ST_0 (0x000030+REGBASE)
34#define EMMA2RH_BHIF_INT_ST_1 (0x000034+REGBASE)
35#define EMMA2RH_BHIF_INT_ST_2 (0x000038+REGBASE)
36#define EMMA2RH_BHIF_INT_EN_0 (0x000040+REGBASE)
37#define EMMA2RH_BHIF_INT_EN_1 (0x000044+REGBASE)
38#define EMMA2RH_BHIF_INT_EN_2 (0x000048+REGBASE)
39#define EMMA2RH_BHIF_INT1_EN_0 (0x000050+REGBASE)
40#define EMMA2RH_BHIF_INT1_EN_1 (0x000054+REGBASE)
41#define EMMA2RH_BHIF_INT1_EN_2 (0x000058+REGBASE)
42#define EMMA2RH_BHIF_SW_INT (0x000070+REGBASE)
43#define EMMA2RH_BHIF_SW_INT_EN (0x000080+REGBASE)
44#define EMMA2RH_BHIF_SW_INT_CLR (0x000090+REGBASE)
45#define EMMA2RH_BHIF_MAIN_CTRL (0x0000b4+REGBASE)
46#define EMMA2RH_BHIF_EXCEPT_VECT_BASE_ADDRESS (0x0000c0+REGBASE)
47#define EMMA2RH_GPIO_DIR (0x110d20+REGBASE)
48#define EMMA2RH_GPIO_INT_ST (0x110d30+REGBASE)
49#define EMMA2RH_GPIO_INT_MASK (0x110d3c+REGBASE)
50#define EMMA2RH_GPIO_INT_MODE (0x110d48+REGBASE)
51#define EMMA2RH_GPIO_INT_CND_A (0x110d54+REGBASE)
52#define EMMA2RH_GPIO_INT_CND_B (0x110d60+REGBASE)
53#define EMMA2RH_PBRD_INT_EN (0x100010+REGBASE)
54#define EMMA2RH_PBRD_CLKSEL (0x100028+REGBASE)
55#define EMMA2RH_PFUR0_BASE (0x101000+REGBASE)
56#define EMMA2RH_PFUR1_BASE (0x102000+REGBASE)
57#define EMMA2RH_PFUR2_BASE (0x103000+REGBASE)
58#define EMMA2RH_PIIC0_BASE (0x107000+REGBASE)
59#define EMMA2RH_PIIC1_BASE (0x108000+REGBASE)
60#define EMMA2RH_PIIC2_BASE (0x109000+REGBASE)
61#define EMMA2RH_PCI_CONTROL (0x200000+REGBASE)
62#define EMMA2RH_PCI_ARBIT_CTR (0x200004+REGBASE)
63#define EMMA2RH_PCI_IWIN0_CTR (0x200010+REGBASE)
64#define EMMA2RH_PCI_IWIN1_CTR (0x200014+REGBASE)
65#define EMMA2RH_PCI_INIT_ESWP (0x200018+REGBASE)
66#define EMMA2RH_PCI_INT (0x200020+REGBASE)
67#define EMMA2RH_PCI_INT_EN (0x200024+REGBASE)
68#define EMMA2RH_PCI_TWIN_CTR (0x200030+REGBASE)
69#define EMMA2RH_PCI_TWIN_BADR (0x200034+REGBASE)
70#define EMMA2RH_PCI_TWIN0_DADR (0x200038+REGBASE)
71#define EMMA2RH_PCI_TWIN1_DADR (0x20003c+REGBASE)
72
73/*
74 * Memory map (physical address)
75 *
76 * Note most of the following address must be properly aligned by the
77 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
78 * PCI_IO_BASE must be aligned along 16MB boundary.
79 */
80
81/* the actual ram size is detected at run-time */
82#define EMMA2RH_RAM_BASE 0x00000000
83#define EMMA2RH_RAM_SIZE 0x10000000 /* less than 256MB */
84
85#define EMMA2RH_IO_BASE 0x10000000
86#define EMMA2RH_IO_SIZE 0x01000000 /* 16 MB */
87
88#define EMMA2RH_GENERALIO_BASE 0x11000000
89#define EMMA2RH_GENERALIO_SIZE 0x01000000 /* 16 MB */
90
91#define EMMA2RH_PCI_IO_BASE 0x12000000
92#define EMMA2RH_PCI_IO_SIZE 0x02000000 /* 32 MB */
93
94#define EMMA2RH_PCI_MEM_BASE 0x14000000
95#define EMMA2RH_PCI_MEM_SIZE 0x08000000 /* 128 MB */
96
97#define EMMA2RH_ROM_BASE 0x1c000000
98#define EMMA2RH_ROM_SIZE 0x04000000 /* 64 MB */
99
100#define EMMA2RH_PCI_CONFIG_BASE EMMA2RH_PCI_IO_BASE
101#define EMMA2RH_PCI_CONFIG_SIZE EMMA2RH_PCI_IO_SIZE
102
103#define NUM_CPU_IRQ 8
104#define NUM_EMMA2RH_IRQ 96
105
106#define CPU_EMMA2RH_CASCADE 2
107#define EMMA2RH_IRQ_BASE 0
108
109/*
110 * emma2rh irq defs
111 */
112
113#define EMMA2RH_IRQ_INT0 (0 + EMMA2RH_IRQ_BASE)
114#define EMMA2RH_IRQ_INT1 (1 + EMMA2RH_IRQ_BASE)
115#define EMMA2RH_IRQ_INT2 (2 + EMMA2RH_IRQ_BASE)
116#define EMMA2RH_IRQ_INT3 (3 + EMMA2RH_IRQ_BASE)
117#define EMMA2RH_IRQ_INT4 (4 + EMMA2RH_IRQ_BASE)
118#define EMMA2RH_IRQ_INT5 (5 + EMMA2RH_IRQ_BASE)
119#define EMMA2RH_IRQ_INT6 (6 + EMMA2RH_IRQ_BASE)
120#define EMMA2RH_IRQ_INT7 (7 + EMMA2RH_IRQ_BASE)
121#define EMMA2RH_IRQ_INT8 (8 + EMMA2RH_IRQ_BASE)
122#define EMMA2RH_IRQ_INT9 (9 + EMMA2RH_IRQ_BASE)
123#define EMMA2RH_IRQ_INT10 (10 + EMMA2RH_IRQ_BASE)
124#define EMMA2RH_IRQ_INT11 (11 + EMMA2RH_IRQ_BASE)
125#define EMMA2RH_IRQ_INT12 (12 + EMMA2RH_IRQ_BASE)
126#define EMMA2RH_IRQ_INT13 (13 + EMMA2RH_IRQ_BASE)
127#define EMMA2RH_IRQ_INT14 (14 + EMMA2RH_IRQ_BASE)
128#define EMMA2RH_IRQ_INT15 (15 + EMMA2RH_IRQ_BASE)
129#define EMMA2RH_IRQ_INT16 (16 + EMMA2RH_IRQ_BASE)
130#define EMMA2RH_IRQ_INT17 (17 + EMMA2RH_IRQ_BASE)
131#define EMMA2RH_IRQ_INT18 (18 + EMMA2RH_IRQ_BASE)
132#define EMMA2RH_IRQ_INT19 (19 + EMMA2RH_IRQ_BASE)
133#define EMMA2RH_IRQ_INT20 (20 + EMMA2RH_IRQ_BASE)
134#define EMMA2RH_IRQ_INT21 (21 + EMMA2RH_IRQ_BASE)
135#define EMMA2RH_IRQ_INT22 (22 + EMMA2RH_IRQ_BASE)
136#define EMMA2RH_IRQ_INT23 (23 + EMMA2RH_IRQ_BASE)
137#define EMMA2RH_IRQ_INT24 (24 + EMMA2RH_IRQ_BASE)
138#define EMMA2RH_IRQ_INT25 (25 + EMMA2RH_IRQ_BASE)
139#define EMMA2RH_IRQ_INT26 (26 + EMMA2RH_IRQ_BASE)
140#define EMMA2RH_IRQ_INT27 (27 + EMMA2RH_IRQ_BASE)
141#define EMMA2RH_IRQ_INT28 (28 + EMMA2RH_IRQ_BASE)
142#define EMMA2RH_IRQ_INT29 (29 + EMMA2RH_IRQ_BASE)
143#define EMMA2RH_IRQ_INT30 (30 + EMMA2RH_IRQ_BASE)
144#define EMMA2RH_IRQ_INT31 (31 + EMMA2RH_IRQ_BASE)
145#define EMMA2RH_IRQ_INT32 (32 + EMMA2RH_IRQ_BASE)
146#define EMMA2RH_IRQ_INT33 (33 + EMMA2RH_IRQ_BASE)
147#define EMMA2RH_IRQ_INT34 (34 + EMMA2RH_IRQ_BASE)
148#define EMMA2RH_IRQ_INT35 (35 + EMMA2RH_IRQ_BASE)
149#define EMMA2RH_IRQ_INT36 (36 + EMMA2RH_IRQ_BASE)
150#define EMMA2RH_IRQ_INT37 (37 + EMMA2RH_IRQ_BASE)
151#define EMMA2RH_IRQ_INT38 (38 + EMMA2RH_IRQ_BASE)
152#define EMMA2RH_IRQ_INT39 (39 + EMMA2RH_IRQ_BASE)
153#define EMMA2RH_IRQ_INT40 (40 + EMMA2RH_IRQ_BASE)
154#define EMMA2RH_IRQ_INT41 (41 + EMMA2RH_IRQ_BASE)
155#define EMMA2RH_IRQ_INT42 (42 + EMMA2RH_IRQ_BASE)
156#define EMMA2RH_IRQ_INT43 (43 + EMMA2RH_IRQ_BASE)
157#define EMMA2RH_IRQ_INT44 (44 + EMMA2RH_IRQ_BASE)
158#define EMMA2RH_IRQ_INT45 (45 + EMMA2RH_IRQ_BASE)
159#define EMMA2RH_IRQ_INT46 (46 + EMMA2RH_IRQ_BASE)
160#define EMMA2RH_IRQ_INT47 (47 + EMMA2RH_IRQ_BASE)
161#define EMMA2RH_IRQ_INT48 (48 + EMMA2RH_IRQ_BASE)
162#define EMMA2RH_IRQ_INT49 (49 + EMMA2RH_IRQ_BASE)
163#define EMMA2RH_IRQ_INT50 (50 + EMMA2RH_IRQ_BASE)
164#define EMMA2RH_IRQ_INT51 (51 + EMMA2RH_IRQ_BASE)
165#define EMMA2RH_IRQ_INT52 (52 + EMMA2RH_IRQ_BASE)
166#define EMMA2RH_IRQ_INT53 (53 + EMMA2RH_IRQ_BASE)
167#define EMMA2RH_IRQ_INT54 (54 + EMMA2RH_IRQ_BASE)
168#define EMMA2RH_IRQ_INT55 (55 + EMMA2RH_IRQ_BASE)
169#define EMMA2RH_IRQ_INT56 (56 + EMMA2RH_IRQ_BASE)
170#define EMMA2RH_IRQ_INT57 (57 + EMMA2RH_IRQ_BASE)
171#define EMMA2RH_IRQ_INT58 (58 + EMMA2RH_IRQ_BASE)
172#define EMMA2RH_IRQ_INT59 (59 + EMMA2RH_IRQ_BASE)
173#define EMMA2RH_IRQ_INT60 (60 + EMMA2RH_IRQ_BASE)
174#define EMMA2RH_IRQ_INT61 (61 + EMMA2RH_IRQ_BASE)
175#define EMMA2RH_IRQ_INT62 (62 + EMMA2RH_IRQ_BASE)
176#define EMMA2RH_IRQ_INT63 (63 + EMMA2RH_IRQ_BASE)
177
178#define EMMA2RH_IRQ_PFUR0 EMMA2RH_IRQ_INT49
179#define EMMA2RH_IRQ_PFUR1 EMMA2RH_IRQ_INT50
180#define EMMA2RH_IRQ_PFUR2 EMMA2RH_IRQ_INT51
181#define EMMA2RH_IRQ_PIIC0 EMMA2RH_IRQ_INT56
182#define EMMA2RH_IRQ_PIIC1 EMMA2RH_IRQ_INT57
183#define EMMA2RH_IRQ_PIIC2 EMMA2RH_IRQ_INT58
184
185/*
186 * EMMA2RH Register Access
187 */
188
189#define EMMA2RH_BASE (0xa0000000)
190
191static inline void emma2rh_sync(void)
192{
193 volatile u32 *p = (volatile u32 *)0xbfc00000;
194 (void)(*p);
195}
196
197static inline void emma2rh_out32(u32 offset, u32 val)
198{
199 *(volatile u32 *)(EMMA2RH_BASE | offset) = val;
200 emma2rh_sync();
201}
202
203static inline u32 emma2rh_in32(u32 offset)
204{
205 u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset);
206 emma2rh_sync();
207 return val;
208}
209
210static inline void emma2rh_out16(u32 offset, u16 val)
211{
212 *(volatile u16 *)(EMMA2RH_BASE | offset) = val;
213 emma2rh_sync();
214}
215
216static inline u16 emma2rh_in16(u32 offset)
217{
218 u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset);
219 emma2rh_sync();
220 return val;
221}
222
223static inline void emma2rh_out8(u32 offset, u8 val)
224{
225 *(volatile u8 *)(EMMA2RH_BASE | offset) = val;
226 emma2rh_sync();
227}
228
229static inline u8 emma2rh_in8(u32 offset)
230{
231 u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset);
232 emma2rh_sync();
233 return val;
234}
235
236/**
237 * IIC registers map
238 **/
239
240/*---------------------------------------------------------------------------*/
241/* CNT - Control register (00H R/W) */
242/*---------------------------------------------------------------------------*/
243#define SPT 0x00000001
244#define STT 0x00000002
245#define ACKE 0x00000004
246#define WTIM 0x00000008
247#define SPIE 0x00000010
248#define WREL 0x00000020
249#define LREL 0x00000040
250#define IICE 0x00000080
251#define CNT_RESERVED 0x000000ff /* reserved bit 0 */
252
253#define I2C_EMMA_START (IICE | STT)
254#define I2C_EMMA_STOP (IICE | SPT)
255#define I2C_EMMA_REPSTART I2C_EMMA_START
256
257/*---------------------------------------------------------------------------*/
258/* STA - Status register (10H Read) */
259/*---------------------------------------------------------------------------*/
260#define MSTS 0x00000080
261#define ALD 0x00000040
262#define EXC 0x00000020
263#define COI 0x00000010
264#define TRC 0x00000008
265#define ACKD 0x00000004
266#define STD 0x00000002
267#define SPD 0x00000001
268
269/*---------------------------------------------------------------------------*/
270/* CSEL - Clock select register (20H R/W) */
271/*---------------------------------------------------------------------------*/
272#define FCL 0x00000080
273#define ND50 0x00000040
274#define CLD 0x00000020
275#define DAD 0x00000010
276#define SMC 0x00000008
277#define DFC 0x00000004
278#define CL 0x00000003
279#define CSEL_RESERVED 0x000000ff /* reserved bit 0 */
280
281#define FAST397 0x0000008b
282#define FAST297 0x0000008a
283#define FAST347 0x0000000b
284#define FAST260 0x0000000a
285#define FAST130 0x00000008
286#define STANDARD108 0x00000083
287#define STANDARD83 0x00000082
288#define STANDARD95 0x00000003
289#define STANDARD73 0x00000002
290#define STANDARD36 0x00000001
291#define STANDARD71 0x00000000
292
293/*---------------------------------------------------------------------------*/
294/* SVA - Slave address register (30H R/W) */
295/*---------------------------------------------------------------------------*/
296#define SVA 0x000000fe
297
298/*---------------------------------------------------------------------------*/
299/* SHR - Shift register (40H R/W) */
300/*---------------------------------------------------------------------------*/
301#define SR 0x000000ff
302
303/*---------------------------------------------------------------------------*/
304/* INT - Interrupt register (50H R/W) */
305/* INTM - Interrupt mask register (60H R/W) */
306/*---------------------------------------------------------------------------*/
307#define INTE0 0x00000001
308
309/***********************************************************************
310 * I2C registers
311 ***********************************************************************
312 */
313#define I2C_EMMA_CNT 0x00
314#define I2C_EMMA_STA 0x10
315#define I2C_EMMA_CSEL 0x20
316#define I2C_EMMA_SVA 0x30
317#define I2C_EMMA_SHR 0x40
318#define I2C_EMMA_INT 0x50
319#define I2C_EMMA_INTM 0x60
320
321/*
322 * include the board dependent part
323 */
324#if defined(CONFIG_MARKEINS)
325#include <asm/emma2rh/markeins.h>
326#else
327#error "Unknown EMMA2RH board!"
328#endif
329
330#endif /* __ASM_EMMA2RH_EMMA2RH_H */
diff --git a/include/asm-mips/emma2rh/markeins.h b/include/asm-mips/emma2rh/markeins.h
new file mode 100644
index 00000000000..8fa76679507
--- /dev/null
+++ b/include/asm-mips/emma2rh/markeins.h
@@ -0,0 +1,76 @@
1/*
2 * include/asm-mips/emma2rh/markeins.h
3 * This file is EMMA2RH board depended header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef MARKEINS_H
26#define MARKEINS_H
27
28#define NUM_EMMA2RH_IRQ_SW 32
29#define NUM_EMMA2RH_IRQ_GPIO 32
30
31#define EMMA2RH_SW_CASCADE (EMMA2RH_IRQ_INT7 - EMMA2RH_IRQ_INT0)
32#define EMMA2RH_GPIO_CASCADE (EMMA2RH_IRQ_INT46 - EMMA2RH_IRQ_INT0)
33
34#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
35#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
36#define CPU_IRQ_BASE (EMMA2RH_GPIO_IRQ_BASE + NUM_EMMA2RH_IRQ_GPIO)
37
38#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
39#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)
40#define EMMA2RH_SW_IRQ_INT2 (2+EMMA2RH_SW_IRQ_BASE)
41#define EMMA2RH_SW_IRQ_INT3 (3+EMMA2RH_SW_IRQ_BASE)
42#define EMMA2RH_SW_IRQ_INT4 (4+EMMA2RH_SW_IRQ_BASE)
43#define EMMA2RH_SW_IRQ_INT5 (5+EMMA2RH_SW_IRQ_BASE)
44#define EMMA2RH_SW_IRQ_INT6 (6+EMMA2RH_SW_IRQ_BASE)
45#define EMMA2RH_SW_IRQ_INT7 (7+EMMA2RH_SW_IRQ_BASE)
46#define EMMA2RH_SW_IRQ_INT8 (8+EMMA2RH_SW_IRQ_BASE)
47#define EMMA2RH_SW_IRQ_INT9 (9+EMMA2RH_SW_IRQ_BASE)
48#define EMMA2RH_SW_IRQ_INT10 (10+EMMA2RH_SW_IRQ_BASE)
49#define EMMA2RH_SW_IRQ_INT11 (11+EMMA2RH_SW_IRQ_BASE)
50#define EMMA2RH_SW_IRQ_INT12 (12+EMMA2RH_SW_IRQ_BASE)
51#define EMMA2RH_SW_IRQ_INT13 (13+EMMA2RH_SW_IRQ_BASE)
52#define EMMA2RH_SW_IRQ_INT14 (14+EMMA2RH_SW_IRQ_BASE)
53#define EMMA2RH_SW_IRQ_INT15 (15+EMMA2RH_SW_IRQ_BASE)
54#define EMMA2RH_SW_IRQ_INT16 (16+EMMA2RH_SW_IRQ_BASE)
55#define EMMA2RH_SW_IRQ_INT17 (17+EMMA2RH_SW_IRQ_BASE)
56#define EMMA2RH_SW_IRQ_INT18 (18+EMMA2RH_SW_IRQ_BASE)
57#define EMMA2RH_SW_IRQ_INT19 (19+EMMA2RH_SW_IRQ_BASE)
58#define EMMA2RH_SW_IRQ_INT20 (20+EMMA2RH_SW_IRQ_BASE)
59#define EMMA2RH_SW_IRQ_INT21 (21+EMMA2RH_SW_IRQ_BASE)
60#define EMMA2RH_SW_IRQ_INT22 (22+EMMA2RH_SW_IRQ_BASE)
61#define EMMA2RH_SW_IRQ_INT23 (23+EMMA2RH_SW_IRQ_BASE)
62#define EMMA2RH_SW_IRQ_INT24 (24+EMMA2RH_SW_IRQ_BASE)
63#define EMMA2RH_SW_IRQ_INT25 (25+EMMA2RH_SW_IRQ_BASE)
64#define EMMA2RH_SW_IRQ_INT26 (26+EMMA2RH_SW_IRQ_BASE)
65#define EMMA2RH_SW_IRQ_INT27 (27+EMMA2RH_SW_IRQ_BASE)
66#define EMMA2RH_SW_IRQ_INT28 (28+EMMA2RH_SW_IRQ_BASE)
67#define EMMA2RH_SW_IRQ_INT29 (29+EMMA2RH_SW_IRQ_BASE)
68#define EMMA2RH_SW_IRQ_INT30 (30+EMMA2RH_SW_IRQ_BASE)
69#define EMMA2RH_SW_IRQ_INT31 (31+EMMA2RH_SW_IRQ_BASE)
70
71#define MARKEINS_PCI_IRQ_INTA EMMA2RH_GPIO_IRQ_BASE+15
72#define MARKEINS_PCI_IRQ_INTB EMMA2RH_GPIO_IRQ_BASE+16
73#define MARKEINS_PCI_IRQ_INTC EMMA2RH_GPIO_IRQ_BASE+17
74#define MARKEINS_PCI_IRQ_INTD EMMA2RH_GPIO_IRQ_BASE+18
75
76#endif /* CONFIG_MARKEINS */
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 43d047a9a6a..787220e6c1f 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_FCNTL_H 8#ifndef _ASM_FCNTL_H
9#define _ASM_FCNTL_H 9#define _ASM_FCNTL_H
10 10
11#include <linux/config.h>
12 11
13#define O_APPEND 0x0008 12#define O_APPEND 0x0008
14#define O_SYNC 0x0010 13#define O_SYNC 0x0010
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
index 73a3028dd9f..6959bdb5931 100644
--- a/include/asm-mips/fixmap.h
+++ b/include/asm-mips/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17#include <asm/page.h> 16#include <asm/page.h>
18#ifdef CONFIG_HIGHMEM 17#ifdef CONFIG_HIGHMEM
19#include <linux/threads.h> 18#include <linux/threads.h>
@@ -70,7 +69,11 @@ extern void __set_fixmap (enum fixed_addresses idx,
70 * the start of the fixmap, and leave one page empty 69 * the start of the fixmap, and leave one page empty
71 * at the top of mem.. 70 * at the top of mem..
72 */ 71 */
72#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
73#define FIXADDR_TOP (0xff000000UL - 0x2000)
74#else
73#define FIXADDR_TOP (0xffffe000UL) 75#define FIXADDR_TOP (0xffffe000UL)
76#endif
74#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 77#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
75#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 78#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
76 79
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index b0f50015e25..58c561a9ec6 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_FPU_H 10#ifndef _ASM_FPU_H
11#define _ASM_FPU_H 11#define _ASM_FPU_H
12 12
13#include <linux/config.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
15#include <linux/thread_info.h> 14#include <linux/thread_info.h>
16 15
@@ -138,10 +137,9 @@ static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
138 if (cpu_has_fpu) { 137 if (cpu_has_fpu) {
139 if ((tsk == current) && __is_fpu_owner()) 138 if ((tsk == current) && __is_fpu_owner())
140 _save_fp(current); 139 _save_fp(current);
141 return tsk->thread.fpu.hard.fpr;
142 } 140 }
143 141
144 return tsk->thread.fpu.soft.fpr; 142 return tsk->thread.fpu.fpr;
145} 143}
146 144
147#endif /* _ASM_FPU_H */ 145#endif /* _ASM_FPU_H */
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h
index 16cb4d11dd0..2731c38bd7a 100644
--- a/include/asm-mips/fpu_emulator.h
+++ b/include/asm-mips/fpu_emulator.h
@@ -12,8 +12,8 @@
12 * with this program; if not, write to the Free Software Foundation, Inc., 12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 * 14 *
15 * Further private data for which no space exists in mips_fpu_soft_struct. 15 * Further private data for which no space exists in mips_fpu_struct.
16 * This should be subsumed into the mips_fpu_soft_struct structure as 16 * This should be subsumed into the mips_fpu_struct structure as
17 * defined in processor.h as soon as the absurd wired absolute assembler 17 * defined in processor.h as soon as the absurd wired absolute assembler
18 * offsets become dynamic at compile time. 18 * offsets become dynamic at compile time.
19 * 19 *
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 12d118f1bc9..ed023eae067 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <linux/futex.h> 6#include <linux/futex.h>
8#include <asm/errno.h> 7#include <asm/errno.h>
9#include <asm/uaccess.h> 8#include <asm/uaccess.h>
@@ -22,51 +21,53 @@
22 " .set push \n" \ 21 " .set push \n" \
23 " .set noat \n" \ 22 " .set noat \n" \
24 " .set mips3 \n" \ 23 " .set mips3 \n" \
25 "1: ll %1, (%3) # __futex_atomic_op \n" \ 24 "1: ll %1, %4 # __futex_atomic_op \n" \
26 " .set mips0 \n" \ 25 " .set mips0 \n" \
27 " " insn " \n" \ 26 " " insn " \n" \
28 " .set mips3 \n" \ 27 " .set mips3 \n" \
29 "2: sc $1, (%3) \n" \ 28 "2: sc $1, %2 \n" \
30 " beqzl $1, 1b \n" \ 29 " beqzl $1, 1b \n" \
31 __FUTEX_SMP_SYNC \ 30 __FUTEX_SMP_SYNC \
32 "3: \n" \ 31 "3: \n" \
33 " .set pop \n" \ 32 " .set pop \n" \
34 " .set mips0 \n" \ 33 " .set mips0 \n" \
35 " .section .fixup,\"ax\" \n" \ 34 " .section .fixup,\"ax\" \n" \
36 "4: li %0, %5 \n" \ 35 "4: li %0, %6 \n" \
37 " j 2b \n" \ 36 " j 2b \n" \
38 " .previous \n" \ 37 " .previous \n" \
39 " .section __ex_table,\"a\" \n" \ 38 " .section __ex_table,\"a\" \n" \
40 " "__UA_ADDR "\t1b, 4b \n" \ 39 " "__UA_ADDR "\t1b, 4b \n" \
41 " "__UA_ADDR "\t2b, 4b \n" \ 40 " "__UA_ADDR "\t2b, 4b \n" \
42 " .previous \n" \ 41 " .previous \n" \
43 : "=r" (ret), "=r" (oldval) \ 42 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
44 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 43 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
44 : "memory"); \
45 } else if (cpu_has_llsc) { \ 45 } else if (cpu_has_llsc) { \
46 __asm__ __volatile__( \ 46 __asm__ __volatile__( \
47 " .set push \n" \ 47 " .set push \n" \
48 " .set noat \n" \ 48 " .set noat \n" \
49 " .set mips3 \n" \ 49 " .set mips3 \n" \
50 "1: ll %1, (%3) # __futex_atomic_op \n" \ 50 "1: ll %1, %4 # __futex_atomic_op \n" \
51 " .set mips0 \n" \ 51 " .set mips0 \n" \
52 " " insn " \n" \ 52 " " insn " \n" \
53 " .set mips3 \n" \ 53 " .set mips3 \n" \
54 "2: sc $1, (%3) \n" \ 54 "2: sc $1, %2 \n" \
55 " beqz $1, 1b \n" \ 55 " beqz $1, 1b \n" \
56 __FUTEX_SMP_SYNC \ 56 __FUTEX_SMP_SYNC \
57 "3: \n" \ 57 "3: \n" \
58 " .set pop \n" \ 58 " .set pop \n" \
59 " .set mips0 \n" \ 59 " .set mips0 \n" \
60 " .section .fixup,\"ax\" \n" \ 60 " .section .fixup,\"ax\" \n" \
61 "4: li %0, %5 \n" \ 61 "4: li %0, %6 \n" \
62 " j 2b \n" \ 62 " j 2b \n" \
63 " .previous \n" \ 63 " .previous \n" \
64 " .section __ex_table,\"a\" \n" \ 64 " .section __ex_table,\"a\" \n" \
65 " "__UA_ADDR "\t1b, 4b \n" \ 65 " "__UA_ADDR "\t1b, 4b \n" \
66 " "__UA_ADDR "\t2b, 4b \n" \ 66 " "__UA_ADDR "\t2b, 4b \n" \
67 " .previous \n" \ 67 " .previous \n" \
68 : "=r" (ret), "=r" (oldval) \ 68 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
69 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 69 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
70 : "memory"); \
70 } else \ 71 } else \
71 ret = -ENOSYS; \ 72 ret = -ENOSYS; \
72} 73}
@@ -89,23 +90,23 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
89 90
90 switch (op) { 91 switch (op) {
91 case FUTEX_OP_SET: 92 case FUTEX_OP_SET:
92 __futex_atomic_op("move $1, %z4", ret, oldval, uaddr, oparg); 93 __futex_atomic_op("move $1, %z5", ret, oldval, uaddr, oparg);
93 break; 94 break;
94 95
95 case FUTEX_OP_ADD: 96 case FUTEX_OP_ADD:
96 __futex_atomic_op("addu $1, %1, %z4", 97 __futex_atomic_op("addu $1, %1, %z5",
97 ret, oldval, uaddr, oparg); 98 ret, oldval, uaddr, oparg);
98 break; 99 break;
99 case FUTEX_OP_OR: 100 case FUTEX_OP_OR:
100 __futex_atomic_op("or $1, %1, %z4", 101 __futex_atomic_op("or $1, %1, %z5",
101 ret, oldval, uaddr, oparg); 102 ret, oldval, uaddr, oparg);
102 break; 103 break;
103 case FUTEX_OP_ANDN: 104 case FUTEX_OP_ANDN:
104 __futex_atomic_op("and $1, %1, %z4", 105 __futex_atomic_op("and $1, %1, %z5",
105 ret, oldval, uaddr, ~oparg); 106 ret, oldval, uaddr, ~oparg);
106 break; 107 break;
107 case FUTEX_OP_XOR: 108 case FUTEX_OP_XOR:
108 __futex_atomic_op("xor $1, %1, %z4", 109 __futex_atomic_op("xor $1, %1, %z5",
109 ret, oldval, uaddr, oparg); 110 ret, oldval, uaddr, oparg);
110 break; 111 break;
111 default: 112 default:
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index dadc05188db..25f5e8a4177 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_HAZARDS_H 10#ifndef _ASM_HAZARDS_H
11#define _ASM_HAZARDS_H 11#define _ASM_HAZARDS_H
12 12
13#include <linux/config.h>
14 13
15#ifdef __ASSEMBLY__ 14#ifdef __ASSEMBLY__
16 15
@@ -70,10 +69,10 @@
70 * Use a macro for ehb unless explicit support for MIPSR2 is enabled 69 * Use a macro for ehb unless explicit support for MIPSR2 is enabled
71 */ 70 */
72 71
73#define irq_enable_hazard 72#define irq_enable_hazard \
74 _ehb 73 _ehb
75 74
76#define irq_disable_hazard 75#define irq_disable_hazard \
77 _ehb 76 _ehb
78 77
79#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) 78#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
index 8cf59840249..c976bfaaba8 100644
--- a/include/asm-mips/highmem.h
+++ b/include/asm-mips/highmem.h
@@ -19,7 +19,6 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/config.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <asm/kmap_types.h> 24#include <asm/kmap_types.h>
diff --git a/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h
index c854d017c0e..458d9fdc76b 100644
--- a/include/asm-mips/hw_irq.h
+++ b/include/asm-mips/hw_irq.h
@@ -19,9 +19,9 @@ extern void init_8259A(int aeoi);
19 19
20extern atomic_t irq_err_count; 20extern atomic_t irq_err_count;
21 21
22/* This may not be apropriate for all machines, we'll see ... */ 22/*
23static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) 23 * interrupt-retrigger: NOP for now. This may not be apropriate for all
24{ 24 * machines, we'll see ...
25} 25 */
26 26
27#endif /* __ASM_HW_IRQ_H */ 27#endif /* __ASM_HW_IRQ_H */
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index 1ed8d0f6257..6489f00731c 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -74,7 +74,7 @@ enum spec3_op {
74 ins_op, dinsm_op, dinsu_op, dins_op, 74 ins_op, dinsm_op, dinsu_op, dins_op,
75 bshfl_op = 0x20, 75 bshfl_op = 0x20,
76 dbshfl_op = 0x24, 76 dbshfl_op = 0x24,
77 rdhwr_op = 0x3f 77 rdhwr_op = 0x3b
78}; 78};
79 79
80/* 80/*
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 6b17eb9d79a..df624e1ee6e 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_IO_H 12#ifndef _ASM_IO_H
13#define _ASM_IO_H 13#define _ASM_IO_H
14 14
15#include <linux/config.h>
16#include <linux/compiler.h> 15#include <linux/compiler.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/include/asm-mips/ip32/machine.h b/include/asm-mips/ip32/machine.h
index e440fdf4b23..1b631b8da6f 100644
--- a/include/asm-mips/ip32/machine.h
+++ b/include/asm-mips/ip32/machine.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_IP32_MACHINE_H 10#ifndef _ASM_IP32_MACHINE_H
11#define _ASM_IP32_MACHINE_H 11#define _ASM_IP32_MACHINE_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_SGI_IP32 14#ifdef CONFIG_SGI_IP32
16 15
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index dde677f02bc..896550bad32 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_IRQ_H 9#ifndef _ASM_IRQ_H
10#define _ASM_IRQ_H 10#define _ASM_IRQ_H
11 11
12#include <linux/config.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14 13
15#include <asm/mipsmtregs.h> 14#include <asm/mipsmtregs.h>
@@ -77,4 +76,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
77 unsigned long hwmask); 76 unsigned long hwmask);
78#endif /* CONFIG_MIPS_MT_SMTC */ 77#endif /* CONFIG_MIPS_MT_SMTC */
79 78
79#ifdef CONFIG_SMP
80#define ARCH_HAS_IRQ_PER_CPU
81#endif
82
80#endif /* _ASM_IRQ_H */ 83#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/irqflags.h
index 4bb9c06f441..43ca09a3a3d 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/irqflags.h
@@ -8,14 +8,15 @@
8 * Copyright (C) 1999 Silicon Graphics 8 * Copyright (C) 1999 Silicon Graphics
9 * Copyright (C) 2000 MIPS Technologies, Inc. 9 * Copyright (C) 2000 MIPS Technologies, Inc.
10 */ 10 */
11#ifndef _ASM_INTERRUPT_H 11#ifndef _ASM_IRQFLAGS_H
12#define _ASM_INTERRUPT_H 12#define _ASM_IRQFLAGS_H
13
14#ifndef __ASSEMBLY__
13 15
14#include <linux/config.h>
15#include <asm/hazards.h> 16#include <asm/hazards.h>
16 17
17__asm__ ( 18__asm__ (
18 " .macro local_irq_enable \n" 19 " .macro raw_local_irq_enable \n"
19 " .set push \n" 20 " .set push \n"
20 " .set reorder \n" 21 " .set reorder \n"
21 " .set noat \n" 22 " .set noat \n"
@@ -36,10 +37,10 @@ __asm__ (
36 " .set pop \n" 37 " .set pop \n"
37 " .endm"); 38 " .endm");
38 39
39static inline void local_irq_enable(void) 40static inline void raw_local_irq_enable(void)
40{ 41{
41 __asm__ __volatile__( 42 __asm__ __volatile__(
42 "local_irq_enable" 43 "raw_local_irq_enable"
43 : /* no outputs */ 44 : /* no outputs */
44 : /* no inputs */ 45 : /* no inputs */
45 : "memory"); 46 : "memory");
@@ -64,7 +65,7 @@ static inline void local_irq_enable(void)
64 * Workaround: mask EXL bit of the result or place a nop before mfc0. 65 * Workaround: mask EXL bit of the result or place a nop before mfc0.
65 */ 66 */
66__asm__ ( 67__asm__ (
67 " .macro local_irq_disable\n" 68 " .macro raw_local_irq_disable\n"
68 " .set push \n" 69 " .set push \n"
69 " .set noat \n" 70 " .set noat \n"
70#ifdef CONFIG_MIPS_MT_SMTC 71#ifdef CONFIG_MIPS_MT_SMTC
@@ -85,17 +86,17 @@ __asm__ (
85 " .set pop \n" 86 " .set pop \n"
86 " .endm \n"); 87 " .endm \n");
87 88
88static inline void local_irq_disable(void) 89static inline void raw_local_irq_disable(void)
89{ 90{
90 __asm__ __volatile__( 91 __asm__ __volatile__(
91 "local_irq_disable" 92 "raw_local_irq_disable"
92 : /* no outputs */ 93 : /* no outputs */
93 : /* no inputs */ 94 : /* no inputs */
94 : "memory"); 95 : "memory");
95} 96}
96 97
97__asm__ ( 98__asm__ (
98 " .macro local_save_flags flags \n" 99 " .macro raw_local_save_flags flags \n"
99 " .set push \n" 100 " .set push \n"
100 " .set reorder \n" 101 " .set reorder \n"
101#ifdef CONFIG_MIPS_MT_SMTC 102#ifdef CONFIG_MIPS_MT_SMTC
@@ -106,13 +107,13 @@ __asm__ (
106 " .set pop \n" 107 " .set pop \n"
107 " .endm \n"); 108 " .endm \n");
108 109
109#define local_save_flags(x) \ 110#define raw_local_save_flags(x) \
110__asm__ __volatile__( \ 111__asm__ __volatile__( \
111 "local_save_flags %0" \ 112 "raw_local_save_flags %0" \
112 : "=r" (x)) 113 : "=r" (x))
113 114
114__asm__ ( 115__asm__ (
115 " .macro local_irq_save result \n" 116 " .macro raw_local_irq_save result \n"
116 " .set push \n" 117 " .set push \n"
117 " .set reorder \n" 118 " .set reorder \n"
118 " .set noat \n" 119 " .set noat \n"
@@ -136,15 +137,15 @@ __asm__ (
136 " .set pop \n" 137 " .set pop \n"
137 " .endm \n"); 138 " .endm \n");
138 139
139#define local_irq_save(x) \ 140#define raw_local_irq_save(x) \
140__asm__ __volatile__( \ 141__asm__ __volatile__( \
141 "local_irq_save\t%0" \ 142 "raw_local_irq_save\t%0" \
142 : "=r" (x) \ 143 : "=r" (x) \
143 : /* no inputs */ \ 144 : /* no inputs */ \
144 : "memory") 145 : "memory")
145 146
146__asm__ ( 147__asm__ (
147 " .macro local_irq_restore flags \n" 148 " .macro raw_local_irq_restore flags \n"
148 " .set push \n" 149 " .set push \n"
149 " .set noreorder \n" 150 " .set noreorder \n"
150 " .set noat \n" 151 " .set noat \n"
@@ -183,40 +184,42 @@ __asm__ (
183 " .set pop \n" 184 " .set pop \n"
184 " .endm \n"); 185 " .endm \n");
185 186
186#define local_irq_restore(flags) \ 187#define raw_local_irq_restore(flags) \
187do { \ 188do { \
188 unsigned long __tmp1; \ 189 unsigned long __tmp1; \
189 \ 190 \
190 __asm__ __volatile__( \ 191 __asm__ __volatile__( \
191 "local_irq_restore\t%0" \ 192 "raw_local_irq_restore\t%0" \
192 : "=r" (__tmp1) \ 193 : "=r" (__tmp1) \
193 : "0" (flags) \ 194 : "0" (flags) \
194 : "memory"); \ 195 : "memory"); \
195} while(0) 196} while(0)
196 197
197static inline int irqs_disabled(void) 198static inline int raw_irqs_disabled_flags(unsigned long flags)
198{ 199{
199#ifdef CONFIG_MIPS_MT_SMTC 200#ifdef CONFIG_MIPS_MT_SMTC
200 /* 201 /*
201 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU 202 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU
202 */ 203 */
203 unsigned long __result; 204 return flags & 0x400;
204
205 __asm__ __volatile__(
206 " .set noreorder \n"
207 " mfc0 %0, $2, 1 \n"
208 " andi %0, 0x400 \n"
209 " slt %0, $0, %0 \n"
210 " .set reorder \n"
211 : "=r" (__result));
212
213 return __result;
214#else 205#else
215 unsigned long flags;
216 local_save_flags(flags);
217
218 return !(flags & 1); 206 return !(flags & 1);
219#endif 207#endif
220} 208}
221 209
222#endif /* _ASM_INTERRUPT_H */ 210#endif
211
212/*
213 * Do the CPU's IRQ-state tracing from assembly code.
214 */
215#ifdef CONFIG_TRACE_IRQFLAGS
216# define TRACE_IRQS_ON \
217 jal trace_hardirqs_on
218# define TRACE_IRQS_OFF \
219 jal trace_hardirqs_off
220#else
221# define TRACE_IRQS_ON
222# define TRACE_IRQS_OFF
223#endif
224
225#endif /* _ASM_IRQFLAGS_H */
diff --git a/include/asm-mips/isadep.h b/include/asm-mips/isadep.h
index 7bb003511d9..24c6cda7937 100644
--- a/include/asm-mips/isadep.h
+++ b/include/asm-mips/isadep.h
@@ -5,7 +5,6 @@
5 * 5 *
6 * Copyright (c) 1998 Harald Koerfgen 6 * Copyright (c) 1998 Harald Koerfgen
7 */ 7 */
8#include <linux/config.h>
9 8
10#ifndef __ASM_ISADEP_H 9#ifndef __ASM_ISADEP_H
11#define __ASM_ISADEP_H 10#define __ASM_ISADEP_H
diff --git a/include/asm-mips/jmr3927/irq.h b/include/asm-mips/jmr3927/irq.h
index b0c325a2234..fe551f33a74 100644
--- a/include/asm-mips/jmr3927/irq.h
+++ b/include/asm-mips/jmr3927/irq.h
@@ -12,7 +12,6 @@
12 12
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#include <linux/config.h>
16#include <asm/irq.h> 15#include <asm/irq.h>
17 16
18struct tb_irq_space { 17struct tb_irq_space {
diff --git a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h
index 6886a0c3fed..806aae3c533 100644
--- a/include/asm-mips/kmap_types.h
+++ b/include/asm-mips/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
index c38844f615f..9e2d43bae38 100644
--- a/include/asm-mips/local.h
+++ b/include/asm-mips/local.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_LOCAL_H 1#ifndef _ASM_LOCAL_H
2#define _ASM_LOCAL_H 2#define _ASM_LOCAL_H
3 3
4#include <linux/config.h>
5#include <linux/percpu.h> 4#include <linux/percpu.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7 6
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 4686e17c206..582acd8adb8 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -35,7 +35,6 @@
35#ifndef _AU1000_H_ 35#ifndef _AU1000_H_
36#define _AU1000_H_ 36#define _AU1000_H_
37 37
38#include <linux/config.h>
39 38
40#ifndef _LANGUAGE_ASSEMBLY 39#ifndef _LANGUAGE_ASSEMBLY
41 40
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h
index b7b46dd9b92..94713594103 100644
--- a/include/asm-mips/mach-au1x00/au1xxx.h
+++ b/include/asm-mips/mach-au1x00/au1xxx.h
@@ -23,7 +23,6 @@
23#ifndef _AU1XXX_H_ 23#ifndef _AU1XXX_H_
24#define _AU1XXX_H_ 24#define _AU1XXX_H_
25 25
26#include <linux/config.h>
27 26
28#include <asm/mach-au1x00/au1000.h> 27#include <asm/mach-au1x00/au1000.h>
29 28
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
index b327bcd3fee..d5b38a247e5 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
@@ -34,7 +34,6 @@
34#ifndef _AU1000_DBDMA_H_ 34#ifndef _AU1000_DBDMA_H_
35#define _AU1000_DBDMA_H_ 35#define _AU1000_DBDMA_H_
36 36
37#include <linux/config.h>
38 37
39#ifndef _LANGUAGE_ASSEMBLY 38#ifndef _LANGUAGE_ASSEMBLY
40 39
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index e867b4ef96d..301e7130077 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -29,7 +29,6 @@
29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
30 * Interface and Linux Device Driver" Application Note. 30 * Interface and Linux Device Driver" Application Note.
31 */ 31 */
32#include <linux/config.h>
33 32
34#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 33#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
35 #define DMA_WAIT_TIMEOUT 100 34 #define DMA_WAIT_TIMEOUT 100
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h
index 8e5fb3c7da4..1bd4e27caf6 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_psc.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h
@@ -33,14 +33,18 @@
33#ifndef _AU1000_PSC_H_ 33#ifndef _AU1000_PSC_H_
34#define _AU1000_PSC_H_ 34#define _AU1000_PSC_H_
35 35
36#include <linux/config.h>
37 36
38/* The PSC base addresses. */ 37/* The PSC base addresses. */
39#ifdef CONFIG_SOC_AU1550 38#ifdef CONFIG_SOC_AU1550
40#define PSC0_BASE_ADDR 0xb1a00000 39#define PSC0_BASE_ADDR 0xb1a00000
41#define PSC1_BASE_ADDR 0xb1b00000 40#define PSC1_BASE_ADDR 0xb1b00000
42#define PSC2_BASE_ADDR 0xb0a00000 41#define PSC2_BASE_ADDR 0xb0a00000
43#define PSC3_BASE_ADDR 0xb0d00000 42#define PSC3_BASE_ADDR 0xb0b00000
43#endif
44
45#ifdef CONFIG_SOC_AU1200
46#define PSC0_BASE_ADDR 0xb1a00000
47#define PSC1_BASE_ADDR 0xb1b00000
44#endif 48#endif
45 49
46/* The PSC select and control registers are common to 50/* The PSC select and control registers are common to
@@ -228,6 +232,8 @@ typedef struct psc_i2s {
228#define PSC_I2SCFG_DD_DISABLE (1 << 27) 232#define PSC_I2SCFG_DD_DISABLE (1 << 27)
229#define PSC_I2SCFG_DE_ENABLE (1 << 26) 233#define PSC_I2SCFG_DE_ENABLE (1 << 26)
230#define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16) 234#define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
235#define PSC_I2SCFG_WS(n) ((n & 0xFF) << 16)
236#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
231#define PSC_I2SCFG_WI (1 << 15) 237#define PSC_I2SCFG_WI (1 << 15)
232 238
233#define PSC_I2SCFG_DIV_MASK (3 << 13) 239#define PSC_I2SCFG_DIV_MASK (3 << 13)
@@ -506,7 +512,7 @@ typedef struct psc_smb {
506 512
507/* Transmit register control. 513/* Transmit register control.
508*/ 514*/
509#define PSC_SMBTXRX_RSR (1 << 30) 515#define PSC_SMBTXRX_RSR (1 << 28)
510#define PSC_SMBTXRX_STP (1 << 29) 516#define PSC_SMBTXRX_STP (1 << 29)
511#define PSC_SMBTXRX_DATAMASK (0xff) 517#define PSC_SMBTXRX_DATAMASK (0xff)
512 518
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h
index d3ec6274575..098fca4289b 100644
--- a/include/asm-mips/mach-au1x00/ioremap.h
+++ b/include/asm-mips/mach-au1x00/ioremap.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_AU1X00_IOREMAP_H 9#ifndef __ASM_MACH_AU1X00_IOREMAP_H
10#define __ASM_MACH_AU1X00_IOREMAP_H 10#define __ASM_MACH_AU1X00_IOREMAP_H
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14 13
15#ifdef CONFIG_64BIT_PHYS_ADDR 14#ifdef CONFIG_64BIT_PHYS_ADDR
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index ace8c5ef970..c6dfa59d198 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
10 10
11#include <linux/config.h>
12 11
13#define cpu_has_tlb 1 12#define cpu_has_tlb 1
14#define cpu_has_4kex 1 13#define cpu_has_4kex 1
@@ -28,7 +27,7 @@
28#define cpu_has_mcheck 0 27#define cpu_has_mcheck 0
29#define cpu_has_ejtag 0 28#define cpu_has_ejtag 0
30 29
31#define cpu_has_subset_pcaches 0 30#define cpu_has_inclusive_pcaches 0
32#define cpu_dcache_line_size() 32 31#define cpu_dcache_line_size() 32
33#define cpu_icache_line_size() 32 32#define cpu_icache_line_size() 32
34#define cpu_scache_line_size() 0 33#define cpu_scache_line_size() 0
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
index 7b28b23f91c..0f5f4c29f4e 100644
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ b/include/asm-mips/mach-db1x00/db1x00.h
@@ -28,11 +28,22 @@
28#ifndef __ASM_DB1X00_H 28#ifndef __ASM_DB1X00_H
29#define __ASM_DB1X00_H 29#define __ASM_DB1X00_H
30 30
31#include <linux/config.h>
32 31
33#ifdef CONFIG_MIPS_DB1550 32#ifdef CONFIG_MIPS_DB1550
33
34#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
35#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
36#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
37#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
38
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define AC97_PSC_BASE PSC1_BASE_ADDR
41#define SMBUS_PSC_BASE PSC2_BASE_ADDR
42#define I2S_PSC_BASE PSC3_BASE_ADDR
43
34#define BCSR_KSEG1_ADDR 0xAF000000 44#define BCSR_KSEG1_ADDR 0xAF000000
35#define NAND_PHYS_ADDR 0x20000000 45#define NAND_PHYS_ADDR 0x20000000
46
36#else 47#else
37#define BCSR_KSEG1_ADDR 0xAE000000 48#define BCSR_KSEG1_ADDR 0xAE000000
38#endif 49#endif
diff --git a/include/asm-mips/mach-ddb5074/mc146818rtc.h b/include/asm-mips/mach-ddb5074/mc146818rtc.h
deleted file mode 100644
index 2eb9acb10a5..00000000000
--- a/include/asm-mips/mach-ddb5074/mc146818rtc.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_DDB5074_MC146818RTC_H
11#define __ASM_MACH_DDB5074_MC146818RTC_H
12
13#include <asm/ddb5xxx/ddb5074.h>
14#include <asm/ddb5xxx/ddb5xxx.h>
15
16#define RTC_PORT(x) (0x70 + (x))
17#define RTC_IRQ 8
18
19static inline unsigned char CMOS_READ(unsigned long addr)
20{
21 return *(volatile unsigned char *)(KSEG1ADDR(DDB_PCI_MEM_BASE)+addr);
22}
23
24static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
25{
26 *(volatile unsigned char *)(KSEG1ADDR(DDB_PCI_MEM_BASE)+addr) = data;
27}
28
29#define RTC_ALWAYS_BCD 1
30
31#endif /* __ASM_MACH_DDB5074_MC146818RTC_H */
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
index 6d37a567580..6724e99e43e 100644
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ b/include/asm-mips/mach-dec/mc146818rtc.h
@@ -19,6 +19,8 @@
19 19
20extern volatile u8 *dec_rtc_base; 20extern volatile u8 *dec_rtc_base;
21 21
22#define ARCH_RTC_LOCATION
23
22#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) 24#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
23#define RTC_IO_EXTENT dec_kn_slot_size 25#define RTC_IO_EXTENT dec_kn_slot_size
24#define RTC_IOMAPPED 0 26#define RTC_IOMAPPED 0
diff --git a/include/asm-mips/mach-dec/param.h b/include/asm-mips/mach-dec/param.h
deleted file mode 100644
index 3e4f0e39084..00000000000
--- a/include/asm-mips/mach-dec/param.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_DEC_PARAM_H
9#define __ASM_MACH_DEC_PARAM_H
10
11/*
12 * log2(HZ), change this here if you want another HZ value. This is also
13 * used in dec_time_init. Minimum is 1, Maximum is 15.
14 */
15#define LOG_2_HZ 7
16#define HZ (1 << LOG_2_HZ)
17
18#endif /* __ASM_MACH_DEC_PARAM_H */
diff --git a/include/asm-mips/mach-mips/param.h b/include/asm-mips/mach-emma2rh/irq.h
index 805ef6d27d3..bce64244b80 100644
--- a/include/asm-mips/mach-mips/param.h
+++ b/include/asm-mips/mach-emma2rh/irq.h
@@ -5,9 +5,9 @@
5 * 5 *
6 * Copyright (C) 2003 by Ralf Baechle 6 * Copyright (C) 2003 by Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_MIPS_PARAM_H 8#ifndef __ASM_MACH_EMMA2RH_IRQ_H
9#define __ASM_MACH_MIPS_PARAM_H 9#define __ASM_MACH_EMMA2RH_IRQ_H
10 10
11#define HZ 100 /* Internal kernel timer frequency */ 11#define NR_IRQS 256
12 12
13#endif /* __ASM_MACH_MIPS_PARAM_H */ 13#endif /* __ASM_MACH_EMMA2RH_IRQ_H */
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
new file mode 100644
index 00000000000..0d31854222f
--- /dev/null
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -0,0 +1,40 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 */
8#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * Basler eXcite has an RM9122 processor.
13 */
14#define cpu_has_watch 1
15#define cpu_has_mips16 0
16#define cpu_has_divec 0
17#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0
19#define cpu_has_cache_cdex_s 0
20#define cpu_has_prefetch 1
21#define cpu_has_mcheck 0
22#define cpu_has_ejtag 0
23
24#define cpu_has_llsc 1
25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 0
30
31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1
33
34#define cpu_has_inclusive_pcaches 0
35
36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32
38#define cpu_scache_line_size() 32
39
40#endif /* __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h
new file mode 100644
index 00000000000..130bd4b8edc
--- /dev/null
+++ b/include/asm-mips/mach-excite/excite.h
@@ -0,0 +1,154 @@
1#ifndef __EXCITE_H__
2#define __EXCITE_H__
3
4#include <linux/init.h>
5#include <asm/addrspace.h>
6#include <asm/types.h>
7
8#define EXCITE_CPU_EXT_CLOCK 100000000
9
10#if !defined(__ASSEMBLER__)
11void __init excite_kgdb_init(void);
12void excite_procfs_init(void);
13extern unsigned long memsize;
14extern char modetty[];
15extern u32 unit_id;
16#endif
17
18/* Base name for XICAP devices */
19#define XICAP_NAME "xicap_gpi"
20
21/* OCD register offsets */
22#define LKB0 0x0038
23#define LKB5 0x0128
24#define LKM5 0x012C
25#define LKB7 0x0138
26#define LKM7 0x013c
27#define LKB8 0x0140
28#define LKM8 0x0144
29#define LKB9 0x0148
30#define LKM9 0x014c
31#define LKB10 0x0150
32#define LKM10 0x0154
33#define LKB11 0x0158
34#define LKM11 0x015c
35#define LKB12 0x0160
36#define LKM12 0x0164
37#define LKB13 0x0168
38#define LKM13 0x016c
39#define LDP0 0x0200
40#define LDP1 0x0210
41#define LDP2 0x0220
42#define LDP3 0x0230
43#define INTPIN0 0x0A40
44#define INTPIN1 0x0A44
45#define INTPIN2 0x0A48
46#define INTPIN3 0x0A4C
47#define INTPIN4 0x0A50
48#define INTPIN5 0x0A54
49#define INTPIN6 0x0A58
50#define INTPIN7 0x0A5C
51
52
53
54
55/* TITAN register offsets */
56#define CPRR 0x0004
57#define CPDSR 0x0008
58#define CPTC0R 0x000c
59#define CPTC1R 0x0010
60#define CPCFG0 0x0020
61#define CPCFG1 0x0024
62#define CPDST0A 0x0028
63#define CPDST0B 0x002c
64#define CPDST1A 0x0030
65#define CPDST1B 0x0034
66#define CPXDSTA 0x0038
67#define CPXDSTB 0x003c
68#define CPXCISRA 0x0048
69#define CPXCISRB 0x004c
70#define CPGIG0ER 0x0050
71#define CPGIG1ER 0x0054
72#define CPGRWL 0x0068
73#define CPURSLMT 0x00f8
74#define UACFG 0x0200
75#define UAINTS 0x0204
76#define SDRXFCIE 0x4828
77#define SDTXFCIE 0x4928
78#define INTP0Status0 0x1B00
79#define INTP0Mask0 0x1B04
80#define INTP0Set0 0x1B08
81#define INTP0Clear0 0x1B0C
82#define GXCFG 0x5000
83#define GXDMADRPFX 0x5018
84#define GXDMA_DESCADR 0x501c
85#define GXCH0TDESSTRT 0x5054
86
87/* IRQ definitions */
88#define NMICONFIG 0xac0
89#define TITAN_MSGINT 0xc4
90#define TITAN_IRQ ((TITAN_MSGINT / 0x20) + 2)
91#define FPGA0_MSGINT 0x5a
92#define FPGA0_IRQ ((FPGA0_MSGINT / 0x20) + 2)
93#define FPGA1_MSGINT 0x7b
94#define FPGA1_IRQ ((FPGA1_MSGINT / 0x20) + 2)
95#define PHY_MSGINT 0x9c
96#define PHY_IRQ ((PHY_MSGINT / 0x20) + 2)
97
98#if defined(CONFIG_BASLER_EXCITE_PROTOTYPE)
99/* Pre-release units used interrupt pin #9 */
100#define USB_IRQ 11
101#else
102/* Re-designed units use interrupt pin #1 */
103#define USB_MSGINT 0x39
104#define USB_IRQ ((USB_MSGINT / 0x20) + 2)
105#endif
106#define TIMER_IRQ 12
107
108
109/* Device address ranges */
110#define EXCITE_OFFS_OCD 0x1fffc000
111#define EXCITE_SIZE_OCD (16 * 1024)
112#define EXCITE_PHYS_OCD CPHYSADDR(EXCITE_OFFS_OCD)
113#define EXCITE_ADDR_OCD CKSEG1ADDR(EXCITE_OFFS_OCD)
114
115#define EXCITE_OFFS_SCRAM 0x1fffa000
116#define EXCITE_SIZE_SCRAM (8 << 10)
117#define EXCITE_PHYS_SCRAM CPHYSADDR(EXCITE_OFFS_SCRAM)
118#define EXCITE_ADDR_SCRAM CKSEG1ADDR(EXCITE_OFFS_SCRAM)
119
120#define EXCITE_OFFS_PCI_IO 0x1fff8000
121#define EXCITE_SIZE_PCI_IO (8 << 10)
122#define EXCITE_PHYS_PCI_IO CPHYSADDR(EXCITE_OFFS_PCI_IO)
123#define EXCITE_ADDR_PCI_IO CKSEG1ADDR(EXCITE_OFFS_PCI_IO)
124
125#define EXCITE_OFFS_TITAN 0x1fff0000
126#define EXCITE_SIZE_TITAN (32 << 10)
127#define EXCITE_PHYS_TITAN CPHYSADDR(EXCITE_OFFS_TITAN)
128#define EXCITE_ADDR_TITAN CKSEG1ADDR(EXCITE_OFFS_TITAN)
129
130#define EXCITE_OFFS_PCI_MEM 0x1ffe0000
131#define EXCITE_SIZE_PCI_MEM (64 << 10)
132#define EXCITE_PHYS_PCI_MEM CPHYSADDR(EXCITE_OFFS_PCI_MEM)
133#define EXCITE_ADDR_PCI_MEM CKSEG1ADDR(EXCITE_OFFS_PCI_MEM)
134
135#define EXCITE_OFFS_FPGA 0x1ffdc000
136#define EXCITE_SIZE_FPGA (16 << 10)
137#define EXCITE_PHYS_FPGA CPHYSADDR(EXCITE_OFFS_FPGA)
138#define EXCITE_ADDR_FPGA CKSEG1ADDR(EXCITE_OFFS_FPGA)
139
140#define EXCITE_OFFS_NAND 0x1ffd8000
141#define EXCITE_SIZE_NAND (16 << 10)
142#define EXCITE_PHYS_NAND CPHYSADDR(EXCITE_OFFS_NAND)
143#define EXCITE_ADDR_NAND CKSEG1ADDR(EXCITE_OFFS_NAND)
144
145#define EXCITE_OFFS_BOOTROM 0x1f000000
146#define EXCITE_SIZE_BOOTROM (8 << 20)
147#define EXCITE_PHYS_BOOTROM CPHYSADDR(EXCITE_OFFS_BOOTROM)
148#define EXCITE_ADDR_BOOTROM CKSEG1ADDR(EXCITE_OFFS_BOOTROM)
149
150/* FPGA address offsets */
151#define EXCITE_FPGA_DPR 0x0104 /* dual-ported ram */
152#define EXCITE_FPGA_SYSCTL 0x0200 /* system control register block */
153
154#endif /* __EXCITE_H__ */
diff --git a/include/asm-mips/mach-excite/excite_nandflash.h b/include/asm-mips/mach-excite/excite_nandflash.h
new file mode 100644
index 00000000000..c4cf6140622
--- /dev/null
+++ b/include/asm-mips/mach-excite/excite_nandflash.h
@@ -0,0 +1,7 @@
1#ifndef __EXCITE_NANDFLASH_H__
2#define __EXCITE_NANDFLASH_H__
3
4/* Resource names */
5#define EXCITE_NANDFLASH_RESOURCE_REGS "excite_nandflash_regs"
6
7#endif /* __EXCITE_NANDFLASH_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_eth.h b/include/asm-mips/mach-excite/rm9k_eth.h
new file mode 100644
index 00000000000..94705a46f72
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_eth.h
@@ -0,0 +1,23 @@
1#if !defined(__RM9K_ETH_H__)
2#define __RM9K_ETH_H__
3
4#define RM9K_GE_NAME "rm9k_ge"
5
6/* Resource names */
7#define RM9K_GE_RESOURCE_MAC "rm9k_ge_mac"
8#define RM9K_GE_RESOURCE_MSTAT "rm9k_ge_mstat"
9#define RM9K_GE_RESOURCE_PKTPROC "rm9k_ge_pktproc"
10#define RM9K_GE_RESOURCE_XDMA "rm9k_ge_xdma"
11#define RM9K_GE_RESOURCE_FIFO_RX "rm9k_ge_fifo_rx"
12#define RM9K_GE_RESOURCE_FIFO_TX "rm9k_ge_fifo_tx"
13#define RM9K_GE_RESOURCE_FIFOMEM_RX "rm9k_ge_fifo_memory_rx"
14#define RM9K_GE_RESOURCE_FIFOMEM_TX "rm9k_ge_fifo_memory_tx"
15#define RM9K_GE_RESOURCE_PHY "rm9k_ge_phy"
16#define RM9K_GE_RESOURCE_DMADESC_RX "rm9k_ge_dmadesc_rx"
17#define RM9K_GE_RESOURCE_DMADESC_TX "rm9k_ge_dmadesc_tx"
18#define RM9K_GE_RESOURCE_IRQ_MAIN "rm9k_ge_irq_main"
19#define RM9K_GE_RESOURCE_IRQ_PHY "rm9k_ge_irq_phy"
20#define RM9K_GE_RESOURCE_GPI_SLICE "rm9k_ge_gpi_slice"
21#define RM9K_GE_RESOURCE_MDIO_CHANNEL "rm9k_ge_mdio_channel"
22
23#endif /* !defined(__RM9K_ETH_H__) */
diff --git a/include/asm-mips/mach-excite/rm9k_wdt.h b/include/asm-mips/mach-excite/rm9k_wdt.h
new file mode 100644
index 00000000000..3fa3c08d2da
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_wdt.h
@@ -0,0 +1,12 @@
1#ifndef __RM9K_WDT_H__
2#define __RM9K_WDT_H__
3
4/* Device name */
5#define WDT_NAME "wdt_gpi"
6
7/* Resource names */
8#define WDT_RESOURCE_REGS "excite_watchdog_regs"
9#define WDT_RESOURCE_IRQ "excite_watchdog_irq"
10#define WDT_RESOURCE_COUNTER "excite_watchdog_counter"
11
12#endif /* __RM9K_WDT_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_xicap.h b/include/asm-mips/mach-excite/rm9k_xicap.h
new file mode 100644
index 00000000000..009577734a8
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_xicap.h
@@ -0,0 +1,16 @@
1#ifndef __EXCITE_XICAP_H__
2#define __EXCITE_XICAP_H__
3
4
5/* Resource names */
6#define XICAP_RESOURCE_FIFO_RX "xicap_fifo_rx"
7#define XICAP_RESOURCE_FIFO_TX "xicap_fifo_tx"
8#define XICAP_RESOURCE_XDMA "xicap_xdma"
9#define XICAP_RESOURCE_DMADESC "xicap_dmadesc"
10#define XICAP_RESOURCE_PKTPROC "xicap_pktproc"
11#define XICAP_RESOURCE_IRQ "xicap_irq"
12#define XICAP_RESOURCE_GPI_SLICE "xicap_gpi_slice"
13#define XICAP_RESOURCE_FIFO_BLK "xicap_fifo_blocks"
14#define XICAP_RESOURCE_PKT_STREAM "xicap_pkt_stream"
15
16#endif /* __EXCITE_XICAP_H__ */
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h
index 682a5858f8d..001a8ce17c1 100644
--- a/include/asm-mips/mach-generic/floppy.h
+++ b/include/asm-mips/mach-generic/floppy.h
@@ -98,7 +98,7 @@ static inline void fd_disable_irq(void)
98static inline int fd_request_irq(void) 98static inline int fd_request_irq(void)
99{ 99{
100 return request_irq(FLOPPY_IRQ, floppy_interrupt, 100 return request_irq(FLOPPY_IRQ, floppy_interrupt,
101 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); 101 IRQF_DISABLED, "floppy", NULL);
102} 102}
103 103
104static inline void fd_free_irq(void) 104static inline void fd_free_irq(void)
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index e3315359500..6eba2e576aa 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -15,7 +15,6 @@
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19#include <linux/pci.h> 18#include <linux/pci.h>
20#include <linux/stddef.h> 19#include <linux/stddef.h>
21#include <asm/processor.h> 20#include <asm/processor.h>
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h
index 373d66dee9d..410ab5f6c56 100644
--- a/include/asm-mips/mach-generic/kmalloc.h
+++ b/include/asm-mips/mach-generic/kmalloc.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_GENERIC_KMALLOC_H 1#ifndef __ASM_MACH_GENERIC_KMALLOC_H
2#define __ASM_MACH_GENERIC_KMALLOC_H 2#define __ASM_MACH_GENERIC_KMALLOC_H
3 3
4#include <linux/config.h>
5 4
6#ifndef CONFIG_DMA_COHERENT 5#ifndef CONFIG_DMA_COHERENT
7/* 6/*
diff --git a/include/asm-mips/mach-generic/param.h b/include/asm-mips/mach-generic/param.h
deleted file mode 100644
index a0d12f964e4..00000000000
--- a/include/asm-mips/mach-generic/param.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_PARAM_H
9#define __ASM_MACH_GENERIC_PARAM_H
10
11#define HZ 1000 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_GENERIC_PARAM_H */
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index b849d8dd7e7..0ae9997bc9a 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_MACH_GENERIC_SPACES_H 10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H 11#define _ASM_MACH_GENERIC_SPACES_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_32BIT 14#ifdef CONFIG_32BIT
16 15
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index 2a37bedb405..f7c5dc8a533 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
@@ -13,7 +13,7 @@
13 */ 13 */
14#define cpu_has_tlb 1 14#define cpu_has_tlb 1
15#define cpu_has_4kex 1 15#define cpu_has_4kex 1
16#define cpu_has_4kcache 1 16#define cpu_has_4k_cache 1
17#define cpu_has_fpu 1 17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1 18#define cpu_has_32fpr 1
19#define cpu_has_counter 1 19#define cpu_has_counter 1
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
index 8385f716798..ab20c026fd1 100644
--- a/include/asm-mips/mach-ip22/spaces.h
+++ b/include/asm-mips/mach-ip22/spaces.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_MACH_IP22_SPACES_H 10#ifndef _ASM_MACH_IP22_SPACES_H
11#define _ASM_MACH_IP22_SPACES_H 11#define _ASM_MACH_IP22_SPACES_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_32BIT 14#ifdef CONFIG_32BIT
16 15
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index 2d2f5b91e47..a071974b67b 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -31,7 +31,10 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 1 34#define cpu_has_4kex 1
35#define cpu_has_4k_cache 1
36
37#define cpu_has_inclusive_pcaches 1
35 38
36#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 64 40#define cpu_icache_line_size() 64
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 36070b5654a..2a3de092bf1 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * R5000 has an interesting "restriction": ll(d)/sc(d) 14 * R5000 has an interesting "restriction": ll(d)/sc(d)
@@ -38,6 +37,8 @@
38#define cpu_has_vtag_icache 0 37#define cpu_has_vtag_icache 0
39#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
40#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_4k_cache 1
41
41 42
42#define cpu_has_mips32r1 0 43#define cpu_has_mips32r1 0
43#define cpu_has_mips32r2 0 44#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h
index 9d2d4d9ac03..f6198a21fba 100644
--- a/include/asm-mips/mach-ip32/kmalloc.h
+++ b/include/asm-mips/mach-ip32/kmalloc.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_IP32_KMALLOC_H 1#ifndef __ASM_MACH_IP32_KMALLOC_H
2#define __ASM_MACH_IP32_KMALLOC_H 2#define __ASM_MACH_IP32_KMALLOC_H
3 3
4#include <linux/config.h>
5 4
6#if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000) 5#if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000)
7#define ARCH_KMALLOC_MINALIGN 32 6#define ARCH_KMALLOC_MINALIGN 32
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h
index 90ff087083b..84b6dead0e8 100644
--- a/include/asm-mips/mach-ja/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h
index c9dad99b123..56e9ca6ae42 100644
--- a/include/asm-mips/mach-jazz/floppy.h
+++ b/include/asm-mips/mach-jazz/floppy.h
@@ -90,7 +90,7 @@ static inline void fd_disable_irq(void)
90static inline int fd_request_irq(void) 90static inline int fd_request_irq(void)
91{ 91{
92 return request_irq(FLOPPY_IRQ, floppy_interrupt, 92 return request_irq(FLOPPY_IRQ, floppy_interrupt,
93 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); 93 IRQF_DISABLED, "floppy", NULL);
94} 94}
95 95
96static inline void fd_free_irq(void) 96static inline void fd_free_irq(void)
diff --git a/include/asm-mips/mach-jazz/param.h b/include/asm-mips/mach-jazz/param.h
deleted file mode 100644
index 639763a517b..00000000000
--- a/include/asm-mips/mach-jazz/param.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_JAZZ_PARAM_H
9#define __ASM_MACH_JAZZ_PARAM_H
10
11/*
12 * Jazz is currently using the internal 100Hz timer of the R4030
13 */
14#define HZ 100 /* Internal kernel timer frequency */
15
16#endif /* __ASM_MACH_JAZZ_PARAM_H */
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index e06af6c86f8..7f3e3f9bd23 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * CPU feature overrides for MIPS boards 14 * CPU feature overrides for MIPS boards
@@ -17,7 +16,7 @@
17#ifdef CONFIG_CPU_MIPS32 16#ifdef CONFIG_CPU_MIPS32
18#define cpu_has_tlb 1 17#define cpu_has_tlb 1
19#define cpu_has_4kex 1 18#define cpu_has_4kex 1
20#define cpu_has_4kcache 1 19#define cpu_has_4k_cache 1
21/* #define cpu_has_fpu ? */ 20/* #define cpu_has_fpu ? */
22/* #define cpu_has_32fpr ? */ 21/* #define cpu_has_32fpr ? */
23#define cpu_has_counter 1 22#define cpu_has_counter 1
@@ -40,14 +39,14 @@
40#define cpu_has_nofpuex 0 39#define cpu_has_nofpuex 0
41/* #define cpu_has_64bits ? */ 40/* #define cpu_has_64bits ? */
42/* #define cpu_has_64bit_zero_reg ? */ 41/* #define cpu_has_64bit_zero_reg ? */
43/* #define cpu_has_subset_pcaches ? */ 42/* #define cpu_has_inclusive_pcaches ? */
44#define cpu_icache_snoops_remote_store 1 43#define cpu_icache_snoops_remote_store 1
45#endif 44#endif
46 45
47#ifdef CONFIG_CPU_MIPS64 46#ifdef CONFIG_CPU_MIPS64
48#define cpu_has_tlb 1 47#define cpu_has_tlb 1
49#define cpu_has_4kex 1 48#define cpu_has_4kex 1
50#define cpu_has_4kcache 1 49#define cpu_has_4k_cache 1
51/* #define cpu_has_fpu ? */ 50/* #define cpu_has_fpu ? */
52/* #define cpu_has_32fpr ? */ 51/* #define cpu_has_32fpr ? */
53#define cpu_has_counter 1 52#define cpu_has_counter 1
@@ -66,7 +65,7 @@
66#define cpu_has_nofpuex 0 65#define cpu_has_nofpuex 0
67/* #define cpu_has_64bits ? */ 66/* #define cpu_has_64bits ? */
68/* #define cpu_has_64bit_zero_reg ? */ 67/* #define cpu_has_64bit_zero_reg ? */
69/* #define cpu_has_subset_pcaches ? */ 68/* #define cpu_has_inclusive_pcaches ? */
70#define cpu_icache_snoops_remote_store 1 69#define cpu_icache_snoops_remote_store 1
71#endif 70#endif
72 71
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h
index f8579696ca5..e994b0c0122 100644
--- a/include/asm-mips/mach-mips/irq.h
+++ b/include/asm-mips/mach-mips/irq.h
@@ -1,14 +1,7 @@
1#ifndef __ASM_MACH_MIPS_IRQ_H 1#ifndef __ASM_MACH_MIPS_IRQ_H
2#define __ASM_MACH_MIPS_IRQ_H 2#define __ASM_MACH_MIPS_IRQ_H
3 3
4#include <linux/config.h>
5 4
6#define NR_IRQS 256 5#define NR_IRQS 256
7 6
8#ifdef CONFIG_SMP
9
10#define ARCH_HAS_IRQ_PER_CPU
11
12#endif
13
14#endif /* __ASM_MACH_MIPS_IRQ_H */ 7#endif /* __ASM_MACH_MIPS_IRQ_H */
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
index 782b986241d..57a12ded061 100644
--- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 35#define cpu_has_64bits 1
36 36
37#define cpu_has_subset_pcaches 0 37#define cpu_has_inclusive_pcaches 0
38 38
39#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32 40#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-pb1x00/pb1550.h b/include/asm-mips/mach-pb1x00/pb1550.h
index 9578ead11e8..9a4955ce3b4 100644
--- a/include/asm-mips/mach-pb1x00/pb1550.h
+++ b/include/asm-mips/mach-pb1x00/pb1550.h
@@ -27,7 +27,6 @@
27#ifndef __ASM_PB1550_H 27#ifndef __ASM_PB1550_H
28#define __ASM_PB1550_H 28#define __ASM_PB1550_H
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32 31
33#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 32#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
diff --git a/include/asm-mips/mach-qemu/param.h b/include/asm-mips/mach-qemu/param.h
deleted file mode 100644
index cb30ee490ae..00000000000
--- a/include/asm-mips/mach-qemu/param.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_QEMU_PARAM_H
9#define __ASM_MACH_QEMU_PARAM_H
10
11#define HZ 100 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_QEMU_PARAM_H */
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
index 91e7cf5f2bf..11410ae10d3 100644
--- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
@@ -14,7 +14,7 @@
14 14
15#define cpu_has_tlb 1 15#define cpu_has_tlb 1
16#define cpu_has_4kex 1 16#define cpu_has_4kex 1
17#define cpu_has_4kcache 1 17#define cpu_has_4k_cache 1
18#define cpu_has_fpu 1 18#define cpu_has_fpu 1
19#define cpu_has_32fpr 1 19#define cpu_has_32fpr 1
20#define cpu_has_counter 1 20#define cpu_has_counter 1
@@ -35,10 +35,8 @@
35#define cpu_has_nofpuex 0 35#define cpu_has_nofpuex 0
36#define cpu_has_64bits 1 36#define cpu_has_64bits 1
37 37
38#define cpu_has_subset_pcaches 0 /* No S-cache on R5000 I think ... */
39#define cpu_dcache_line_size() 32 38#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32 39#define cpu_icache_line_size() 32
41#define cpu_scache_line_size() 0 /* No S-cache on R5000 I think ... */
42 40
43#define cpu_has_mips32r1 0 41#define cpu_has_mips32r1 0
44#define cpu_has_mips32r2 0 42#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index 193a666cd13..a25968f277a 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
index cadbe8eda79..779b0220573 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * CPU feature overrides for MIPS boards 13 * CPU feature overrides for MIPS boards
@@ -16,7 +15,7 @@
16#ifdef CONFIG_CPU_MIPS32 15#ifdef CONFIG_CPU_MIPS32
17#define cpu_has_tlb 1 16#define cpu_has_tlb 1
18#define cpu_has_4kex 1 17#define cpu_has_4kex 1
19#define cpu_has_4kcache 1 18#define cpu_has_4k_cache 1
20#define cpu_has_fpu 0 19#define cpu_has_fpu 0
21/* #define cpu_has_32fpr ? */ 20/* #define cpu_has_32fpr ? */
22#define cpu_has_counter 1 21#define cpu_has_counter 1
@@ -35,13 +34,13 @@
35#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
36/* #define cpu_has_64bits ? */ 35/* #define cpu_has_64bits ? */
37/* #define cpu_has_64bit_zero_reg ? */ 36/* #define cpu_has_64bit_zero_reg ? */
38/* #define cpu_has_subset_pcaches ? */ 37/* #define cpu_has_inclusive_pcaches ? */
39#endif 38#endif
40 39
41#ifdef CONFIG_CPU_MIPS64 40#ifdef CONFIG_CPU_MIPS64
42#define cpu_has_tlb 1 41#define cpu_has_tlb 1
43#define cpu_has_4kex 1 42#define cpu_has_4kex 1
44#define cpu_has_4kcache 1 43#define cpu_has_4k_cache 1
45/* #define cpu_has_fpu ? */ 44/* #define cpu_has_fpu ? */
46/* #define cpu_has_32fpr ? */ 45/* #define cpu_has_32fpr ? */
47#define cpu_has_counter 1 46#define cpu_has_counter 1
@@ -60,7 +59,7 @@
60#define cpu_has_nofpuex 0 59#define cpu_has_nofpuex 0
61/* #define cpu_has_64bits ? */ 60/* #define cpu_has_64bits ? */
62/* #define cpu_has_64bit_zero_reg ? */ 61/* #define cpu_has_64bit_zero_reg ? */
63/* #define cpu_has_subset_pcaches ? */ 62/* #define cpu_has_inclusive_pcaches ? */
64#endif 63#endif
65 64
66#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ 65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-wrppmc/mach-gt64120.h b/include/asm-mips/mach-wrppmc/mach-gt64120.h
new file mode 100644
index 00000000000..ba9205a0458
--- /dev/null
+++ b/include/asm-mips/mach-wrppmc/mach-gt64120.h
@@ -0,0 +1,84 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef __ASM_MIPS_GT64120_H
9#define __ASM_MIPS_GT64120_H
10
11/*
12 * This is the CPU physical memory map of PPMC Board:
13 *
14 * 0x00000000-0x03FFFFFF - 64MB SDRAM (SCS[0]#)
15 * 0x1C000000-0x1C000000 - LED (CS0)
16 * 0x1C800000-0x1C800007 - UART 16550 port (CS1)
17 * 0x1F000000-0x1F000000 - MailBox (CS3)
18 * 0x1FC00000-0x20000000 - 4MB Flash (BOOT CS)
19 */
20
21#define WRPPMC_SDRAM_SCS0_BASE 0x00000000
22#define WRPPMC_SDRAM_SCS0_SIZE 0x04000000
23
24#define WRPPMC_UART16550_BASE 0x1C800000
25#define WRPPMC_UART16550_CLOCK 3686400 /* 3.68MHZ */
26
27#define WRPPMC_LED_BASE 0x1C000000
28#define WRPPMC_MBOX_BASE 0x1F000000
29
30#define WRPPMC_BOOTROM_BASE 0x1FC00000
31#define WRPPMC_BOOTROM_SIZE 0x00400000 /* 4M Flash */
32
33#define WRPPMC_MIPS_TIMER_IRQ 7 /* MIPS compare/count timer interrupt */
34#define WRPPMC_UART16550_IRQ 6
35#define WRPPMC_PCI_INTA_IRQ 3
36
37/*
38 * PCI Bus I/O and Memory resources allocation
39 *
40 * NOTE: We only have PCI_0 hose interface
41 */
42#define GT_PCI_MEM_BASE 0x13000000UL
43#define GT_PCI_MEM_SIZE 0x02000000UL
44#define GT_PCI_IO_BASE 0x11000000UL
45#define GT_PCI_IO_SIZE 0x02000000UL
46#define GT_ISA_IO_BASE PCI_IO_BASE
47
48/*
49 * PCI interrupts will come in on either the INTA or INTD interrups lines,
50 * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our
51 * boards, they all either come in on IntD or they all come in on IntA, they
52 * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the
53 * "requested" interrupt numbers and go through the list whenever we get an
54 * IntA/D.
55 *
56 * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and
57 * INTD is 11.
58 */
59#define GT_TIMER 4
60#define GT_INTA 2
61#define GT_INTD 5
62
63#ifndef __ASSEMBLY__
64
65/*
66 * GT64120 internal register space base address
67 */
68extern unsigned long gt64120_base;
69
70#define GT64120_BASE (gt64120_base)
71
72/* define WRPPMC_EARLY_DEBUG to enable early output something to UART */
73#undef WRPPMC_EARLY_DEBUG
74
75#ifdef WRPPMC_EARLY_DEBUG
76extern void wrppmc_led_on(int mask);
77extern void wrppmc_led_off(int mask);
78extern void wrppmc_early_printk(const char *fmt, ...);
79#else
80#define wrppmc_early_printk(fmt, ...) do {} while (0)
81#endif /* WRPPMC_EARLY_DEBUG */
82
83#endif /* __ASSEMBLY__ */
84#endif /* __ASM_MIPS_GT64120_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 3073542c93c..42cebb7ce7a 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index fa8b913cc3e..b98f1658cfd 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_MIPS_BOARDS_GENERIC_H 20#ifndef __ASM_MIPS_BOARDS_GENERIC_H
21#define __ASM_MIPS_BOARDS_GENERIC_H 21#define __ASM_MIPS_BOARDS_GENERIC_H
22 22
23#include <linux/config.h>
24#include <asm/addrspace.h> 23#include <asm/addrspace.h>
25#include <asm/byteorder.h> 24#include <asm/byteorder.h>
26#include <asm/mips-boards/bonito64.h> 25#include <asm/mips-boards/bonito64.h>
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 5af7517fce8..1f318d70799 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_MIPSREGS_H 13#ifndef _ASM_MIPSREGS_H
14#define _ASM_MIPSREGS_H 14#define _ASM_MIPSREGS_H
15 15
16#include <linux/config.h>
17#include <linux/linkage.h> 16#include <linux/linkage.h>
18#include <asm/hazards.h> 17#include <asm/hazards.h>
19 18
@@ -471,6 +470,8 @@
471 470
472/* Bits specific to the VR41xx. */ 471/* Bits specific to the VR41xx. */
473#define VR41_CONF_CS (_ULCAST_(1) << 12) 472#define VR41_CONF_CS (_ULCAST_(1) << 12)
473#define VR41_CONF_P4K (_ULCAST_(1) << 13)
474#define VR41_CONF_BP (_ULCAST_(1) << 16)
474#define VR41_CONF_M16 (_ULCAST_(1) << 20) 475#define VR41_CONF_M16 (_ULCAST_(1) << 20)
475#define VR41_CONF_AD (_ULCAST_(1) << 23) 476#define VR41_CONF_AD (_ULCAST_(1) << 23)
476 477
@@ -1417,7 +1418,7 @@ change_c0_##name(unsigned int change, unsigned int new) \
1417 1418
1418#else /* SMTC versions that manage MT scheduling */ 1419#else /* SMTC versions that manage MT scheduling */
1419 1420
1420#include <asm/interrupt.h> 1421#include <linux/irqflags.h>
1421 1422
1422/* 1423/*
1423 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with 1424 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
@@ -1451,18 +1452,17 @@ static inline void __emt(unsigned int previous)
1451{ 1452{
1452 if ((previous & __EMT_ENABLE)) 1453 if ((previous & __EMT_ENABLE))
1453 __asm__ __volatile__( 1454 __asm__ __volatile__(
1454 " .set noreorder \n"
1455 " .set mips32r2 \n" 1455 " .set mips32r2 \n"
1456 " .word 0x41600be1 # emt \n" 1456 " .word 0x41600be1 # emt \n"
1457 " ehb \n" 1457 " ehb \n"
1458 " .set mips0 \n" 1458 " .set mips0 \n");
1459 " .set reorder \n");
1460} 1459}
1461 1460
1462static inline void __ehb(void) 1461static inline void __ehb(void)
1463{ 1462{
1464 __asm__ __volatile__( 1463 __asm__ __volatile__(
1465 " ehb \n"); 1464 " .set mips32r2 \n"
1465 " ehb \n" " .set mips0 \n");
1466} 1466}
1467 1467
1468/* 1468/*
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 6e09f4c8721..18b69de87da 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_MMU_CONTEXT_H 11#ifndef _ASM_MMU_CONTEXT_H
12#define _ASM_MMU_CONTEXT_H 12#define _ASM_MMU_CONTEXT_H
13 13
14#include <linux/config.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/slab.h> 16#include <linux/slab.h>
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index 7bde4432092..f53ec54c92f 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -5,26 +5,13 @@
5#ifndef _ASM_MMZONE_H_ 5#ifndef _ASM_MMZONE_H_
6#define _ASM_MMZONE_H_ 6#define _ASM_MMZONE_H_
7 7
8#include <linux/config.h>
9#include <asm/page.h> 8#include <asm/page.h>
10#include <mmzone.h> 9#include <mmzone.h>
11 10
12#ifdef CONFIG_DISCONTIGMEM 11#ifdef CONFIG_DISCONTIGMEM
13 12
14#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr))
15#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) 13#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
16 14
17#define pfn_valid(pfn) \
18({ \
19 unsigned long __pfn = (pfn); \
20 int __n = pfn_to_nid(__pfn); \
21 ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \
22 NODE_DATA(__n)->node_spanned_pages) : 0);\
23})
24
25/* XXX: FIXME -- wli */
26#define kern_addr_valid(addr) (0)
27
28#endif /* CONFIG_DISCONTIGMEM */ 15#endif /* CONFIG_DISCONTIGMEM */
29 16
30#endif /* _ASM_MMZONE_H_ */ 17#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 2af496c78c1..399d03f1c4f 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_MODULE_H 1#ifndef _ASM_MODULE_H
2#define _ASM_MODULE_H 2#define _ASM_MODULE_H
3 3
4#include <linux/config.h>
5#include <linux/list.h> 4#include <linux/list.h>
6#include <asm/uaccess.h> 5#include <asm/uaccess.h>
7 6
diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h
index a1533959742..0d6c7f14de3 100644
--- a/include/asm-mips/msgbuf.h
+++ b/include/asm-mips/msgbuf.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_MSGBUF_H 1#ifndef _ASM_MSGBUF_H
2#define _ASM_MSGBUF_H 2#define _ASM_MSGBUF_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The msqid64_ds structure for the MIPS architecture. 6 * The msqid64_ds structure for the MIPS architecture.
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
index 46f2d23d269..147844ef103 100644
--- a/include/asm-mips/paccess.h
+++ b/include/asm-mips/paccess.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_PACCESS_H 13#ifndef _ASM_PACCESS_H
14#define _ASM_PACCESS_H 14#define _ASM_PACCESS_H
15 15
16#include <linux/config.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18 17
19#ifdef CONFIG_32BIT 18#ifdef CONFIG_32BIT
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index a1eab136ff6..219d359861f 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -9,14 +9,11 @@
9#ifndef _ASM_PAGE_H 9#ifndef _ASM_PAGE_H
10#define _ASM_PAGE_H 10#define _ASM_PAGE_H
11 11
12#include <linux/config.h>
13 12
14#ifdef __KERNEL__ 13#ifdef __KERNEL__
15 14
16#include <spaces.h> 15#include <spaces.h>
17 16
18#endif
19
20/* 17/*
21 * PAGE_SHIFT determines the page size 18 * PAGE_SHIFT determines the page size
22 */ 19 */
@@ -35,8 +32,6 @@
35#define PAGE_SIZE (1UL << PAGE_SHIFT) 32#define PAGE_SIZE (1UL << PAGE_SHIFT)
36#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
37 34
38
39#ifdef __KERNEL__
40#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
41 36
42extern void clear_page(void * page); 37extern void clear_page(void * page);
@@ -139,8 +134,25 @@ typedef struct { unsigned long pgprot; } pgprot_t;
139 134
140#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 135#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
141 136
142#ifndef CONFIG_NEED_MULTIPLE_NODES 137#ifdef CONFIG_FLATMEM
138
143#define pfn_valid(pfn) ((pfn) < max_mapnr) 139#define pfn_valid(pfn) ((pfn) < max_mapnr)
140
141#elif defined(CONFIG_SPARSEMEM)
142
143/* pfn_valid is defined in linux/mmzone.h */
144
145#elif defined(CONFIG_NEED_MULTIPLE_NODES)
146
147#define pfn_valid(pfn) \
148({ \
149 unsigned long __pfn = (pfn); \
150 int __n = pfn_to_nid(__pfn); \
151 ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \
152 NODE_DATA(__n)->node_spanned_pages) \
153 : 0); \
154})
155
144#endif 156#endif
145 157
146#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 158#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
@@ -152,8 +164,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
152#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) 164#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
153#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) 165#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
154 166
155#endif /* defined (__KERNEL__) */
156
157#ifdef CONFIG_LIMITED_DMA 167#ifdef CONFIG_LIMITED_DMA
158#define WANT_PAGE_VIRTUAL 168#define WANT_PAGE_VIRTUAL
159#endif 169#endif
@@ -161,4 +171,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
161#include <asm-generic/memory_model.h> 171#include <asm-generic/memory_model.h>
162#include <asm-generic/page.h> 172#include <asm-generic/page.h>
163 173
174#endif /* defined (__KERNEL__) */
175
164#endif /* _ASM_PAGE_H */ 176#endif /* _ASM_PAGE_H */
diff --git a/include/asm-mips/param.h b/include/asm-mips/param.h
index 2bead8273ce..1d9bb8c5ab2 100644
--- a/include/asm-mips/param.h
+++ b/include/asm-mips/param.h
@@ -11,7 +11,7 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14# include <param.h> /* Internal kernel timer frequency */ 14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif 17#endif
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 6c9ad8171a7..c4d68bebdca 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -6,7 +6,6 @@
6#ifndef _ASM_PCI_H 6#ifndef _ASM_PCI_H
7#define _ASM_PCI_H 7#define _ASM_PCI_H
8 8
9#include <linux/config.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
diff --git a/include/asm-mips/pci/bridge.h b/include/asm-mips/pci/bridge.h
index b4ee995c56e..0c45e7598f3 100644
--- a/include/asm-mips/pci/bridge.h
+++ b/include/asm-mips/pci/bridge.h
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <asm/xtalk/xwidget.h> /* generic widget header */ 17#include <asm/xtalk/xwidget.h> /* generic widget header */
18#include <asm/sn/types.h>
18 19
19/* I/O page size */ 20/* I/O page size */
20 21
@@ -848,4 +849,6 @@ struct bridge_controller {
848extern void register_bridge_irq(unsigned int irq); 849extern void register_bridge_irq(unsigned int irq);
849extern int request_bridge_irq(struct bridge_controller *bc); 850extern int request_bridge_irq(struct bridge_controller *bc);
850 851
852extern struct pci_ops bridge_pci_ops;
853
851#endif /* _ASM_PCI_BRIDGE_H */ 854#endif /* _ASM_PCI_BRIDGE_H */
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index fe1df572318..582c1fe6cc4 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGALLOC_H 9#ifndef _ASM_PGALLOC_H
10#define _ASM_PGALLOC_H 10#define _ASM_PGALLOC_H
11 11
12#include <linux/config.h>
13#include <linux/highmem.h> 12#include <linux/highmem.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
15 14
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 4d6bc45df59..4b26d852813 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGTABLE_32_H 9#ifndef _ASM_PGTABLE_32_H
10#define _ASM_PGTABLE_32_H 10#define _ASM_PGTABLE_32_H
11 11
12#include <linux/config.h>
13#include <asm/addrspace.h> 12#include <asm/addrspace.h>
14#include <asm/page.h> 13#include <asm/page.h>
15 14
@@ -177,48 +176,67 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
177 ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) 176 ((swp_entry_t) { ((type) << 10) | ((offset) << 15) })
178 177
179/* 178/*
180 * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset 179 * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range:
181 * into this range:
182 */ 180 */
183#define PTE_FILE_MAX_BITS 27 181#define PTE_FILE_MAX_BITS 28
184 182
185#define pte_to_pgoff(_pte) \ 183#define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \
186 ((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 )) 184 (((_pte).pte >> 2 ) & 0x38) | \
185 (((_pte).pte >> 10) << 6 ))
187 186
188#define pgoff_to_pte(off) \ 187#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \
189 ((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE }) 188 (((off) & 0x38) << 2 ) | \
189 (((off) >> 6 ) << 10) | \
190 _PAGE_FILE })
190 191
191#else 192#else
192 193
193/* Swap entries must have VALID and GLOBAL bits cleared. */ 194/* Swap entries must have VALID and GLOBAL bits cleared. */
195#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
196#define __swp_type(x) (((x).val >> 2) & 0x1f)
197#define __swp_offset(x) ((x).val >> 7)
198#define __swp_entry(type,offset) \
199 ((swp_entry_t) { ((type) << 2) | ((offset) << 7) })
200#else
194#define __swp_type(x) (((x).val >> 8) & 0x1f) 201#define __swp_type(x) (((x).val >> 8) & 0x1f)
195#define __swp_offset(x) ((x).val >> 13) 202#define __swp_offset(x) ((x).val >> 13)
196#define __swp_entry(type,offset) \ 203#define __swp_entry(type,offset) \
197 ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) 204 ((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
205#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */
198 206
207#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
199/* 208/*
200 * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset 209 * Bits 0 and 1 of pte_high are taken, use the rest for the page offset...
201 * into this range:
202 */ 210 */
203#define PTE_FILE_MAX_BITS 27 211#define PTE_FILE_MAX_BITS 30
204 212
205#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 213#define pte_to_pgoff(_pte) ((_pte).pte_high >> 2)
206 /* fixme */ 214#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 })
207#define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f))
208#define pgoff_to_pte(off) \
209 ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)})
210 215
211#else 216#else
212#define pte_to_pgoff(_pte) \ 217/*
213 ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) 218 * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range:
219 */
220#define PTE_FILE_MAX_BITS 28
221
222#define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \
223 (((_pte).pte >> 2) & 0x8) | \
224 (((_pte).pte >> 8) << 4))
214 225
215#define pgoff_to_pte(off) \ 226#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \
216 ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) 227 (((off) & 0x8) << 2) | \
228 (((off) >> 4) << 8) | \
229 _PAGE_FILE })
217#endif 230#endif
218 231
219#endif 232#endif
220 233
234#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
235#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high })
236#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val })
237#else
221#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 238#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
222#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 239#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
240#endif
223 241
224#endif /* _ASM_PGTABLE_32_H */ 242#endif /* _ASM_PGTABLE_32_H */
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index 82166b254b2..e3db93212ea 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGTABLE_64_H 9#ifndef _ASM_PGTABLE_64_H
10#define _ASM_PGTABLE_64_H 10#define _ASM_PGTABLE_64_H
11 11
12#include <linux/config.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14 13
15#include <asm/addrspace.h> 14#include <asm/addrspace.h>
@@ -224,15 +223,12 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
224#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 223#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
225 224
226/* 225/*
227 * Bits 0, 1, 2, 7 and 8 are taken, split up the 32 bits of offset 226 * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to
228 * into this range: 227 * make things easier, and only use the upper 56 bits for the page offset...
229 */ 228 */
230#define PTE_FILE_MAX_BITS 32 229#define PTE_FILE_MAX_BITS 56
231 230
232#define pte_to_pgoff(_pte) \ 231#define pte_to_pgoff(_pte) ((_pte).pte >> 8)
233 ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) 232#define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE })
234
235#define pgoff_to_pte(off) \
236 ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
237 233
238#endif /* _ASM_PGTABLE_64_H */ 234#endif /* _ASM_PGTABLE_64_H */
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h
index 01e76e932e3..7494ba91112 100644
--- a/include/asm-mips/pgtable-bits.h
+++ b/include/asm-mips/pgtable-bits.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_PGTABLE_BITS_H 10#ifndef _ASM_PGTABLE_BITS_H
11#define _ASM_PGTABLE_BITS_H 11#define _ASM_PGTABLE_BITS_H
12 12
13#include <linux/config.h>
14 13
15/* 14/*
16 * Note that we shift the lower 32bits of each EntryLo[01] entry 15 * Note that we shift the lower 32bits of each EntryLo[01] entry
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index f80fe75c780..a36ca1be17f 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_PGTABLE_H 8#ifndef _ASM_PGTABLE_H
9#define _ASM_PGTABLE_H 9#define _ASM_PGTABLE_H
10 10
11#include <linux/config.h>
12#ifdef CONFIG_32BIT 11#ifdef CONFIG_32BIT
13#include <asm/pgtable-32.h> 12#include <asm/pgtable-32.h>
14#endif 13#endif
@@ -353,8 +352,9 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
353#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 352#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
354static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 353static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
355{ 354{
356 pte.pte_low &= _PAGE_CHG_MASK; 355 pte.pte_low &= _PAGE_CHG_MASK;
357 pte.pte_low |= pgprot_val(newprot); 356 pte.pte_high &= ~0x3f;
357 pte.pte_low |= pgprot_val(newprot);
358 pte.pte_high |= pgprot_val(newprot) & 0x3f; 358 pte.pte_high |= pgprot_val(newprot) & 0x3f;
359 return pte; 359 return pte;
360} 360}
@@ -378,9 +378,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
378 __update_cache(vma, address, pte); 378 __update_cache(vma, address, pte);
379} 379}
380 380
381#ifndef CONFIG_NEED_MULTIPLE_NODES
382#define kern_addr_valid(addr) (1) 381#define kern_addr_valid(addr) (1)
383#endif
384 382
385#ifdef CONFIG_64BIT_PHYS_ADDR 383#ifdef CONFIG_64BIT_PHYS_ADDR
386extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); 384extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot);
diff --git a/include/asm-mips/prefetch.h b/include/asm-mips/prefetch.h
index 71293ec1657..17850834ccb 100644
--- a/include/asm-mips/prefetch.h
+++ b/include/asm-mips/prefetch.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_PREFETCH_H 8#ifndef __ASM_PREFETCH_H
9#define __ASM_PREFETCH_H 9#define __ASM_PREFETCH_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so 13 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 0fb75f0762e..5f80ba71ab9 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_PROCESSOR_H 11#ifndef _ASM_PROCESSOR_H
12#define _ASM_PROCESSOR_H 12#define _ASM_PROCESSOR_H
13 13
14#include <linux/config.h>
15#include <linux/cpumask.h> 14#include <linux/cpumask.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
17 16
@@ -71,11 +70,6 @@ extern unsigned int vced_count, vcei_count;
71 70
72typedef __u64 fpureg_t; 71typedef __u64 fpureg_t;
73 72
74struct mips_fpu_hard_struct {
75 fpureg_t fpr[NUM_FPU_REGS];
76 unsigned int fcr31;
77};
78
79/* 73/*
80 * It would be nice to add some more fields for emulator statistics, but there 74 * It would be nice to add some more fields for emulator statistics, but there
81 * are a number of fixed offsets in offset.h and elsewhere that would have to 75 * are a number of fixed offsets in offset.h and elsewhere that would have to
@@ -83,18 +77,13 @@ struct mips_fpu_hard_struct {
83 * the FPU emulator for now. See asm-mips/fpu_emulator.h. 77 * the FPU emulator for now. See asm-mips/fpu_emulator.h.
84 */ 78 */
85 79
86struct mips_fpu_soft_struct { 80struct mips_fpu_struct {
87 fpureg_t fpr[NUM_FPU_REGS]; 81 fpureg_t fpr[NUM_FPU_REGS];
88 unsigned int fcr31; 82 unsigned int fcr31;
89}; 83};
90 84
91union mips_fpu_union {
92 struct mips_fpu_hard_struct hard;
93 struct mips_fpu_soft_struct soft;
94};
95
96#define INIT_FPU { \ 85#define INIT_FPU { \
97 {{0,},} \ 86 {0,} \
98} 87}
99 88
100#define NUM_DSP_REGS 6 89#define NUM_DSP_REGS 6
@@ -133,7 +122,7 @@ struct thread_struct {
133 unsigned long cp0_status; 122 unsigned long cp0_status;
134 123
135 /* Saved fpu/fpu emulator stuff. */ 124 /* Saved fpu/fpu emulator stuff. */
136 union mips_fpu_union fpu; 125 struct mips_fpu_struct fpu;
137#ifdef CONFIG_MIPS_MT_FPAFF 126#ifdef CONFIG_MIPS_MT_FPAFF
138 /* Emulated instruction count */ 127 /* Emulated instruction count */
139 unsigned long emulated_fp; 128 unsigned long emulated_fp;
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index fa9d8713c12..4113316ee0d 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PTRACE_H 9#ifndef _ASM_PTRACE_H
10#define _ASM_PTRACE_H 10#define _ASM_PTRACE_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/isadep.h> 13#include <asm/isadep.h>
15 14
diff --git a/include/asm-mips/qemu.h b/include/asm-mips/qemu.h
index 905c3958590..531caf44560 100644
--- a/include/asm-mips/qemu.h
+++ b/include/asm-mips/qemu.h
@@ -21,4 +21,10 @@
21 */ 21 */
22#define QEMU_C0_COUNTER_CLOCK 100000000 22#define QEMU_C0_COUNTER_CLOCK 100000000
23 23
24/*
25 * Magic qemu system control location.
26 */
27#define QEMU_RESTART_REG 0xBFBF0000
28#define QEMU_HALT_REG 0xBFBF0004
29
24#endif /* __ASM_QEMU_H */ 30#endif /* __ASM_QEMU_H */
diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h
index 6173004cc88..634b55d7e7f 100644
--- a/include/asm-mips/reg.h
+++ b/include/asm-mips/reg.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_MIPS_REG_H 12#ifndef __ASM_MIPS_REG_H
13#define __ASM_MIPS_REG_H 13#define __ASM_MIPS_REG_H
14 14
15#include <linux/config.h>
16 15
17#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H) 16#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H)
18 17
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
index 1fba00c2207..87cb3085269 100644
--- a/include/asm-mips/resource.h
+++ b/include/asm-mips/resource.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_RESOURCE_H 9#ifndef _ASM_RESOURCE_H
10#define _ASM_RESOURCE_H 10#define _ASM_RESOURCE_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * These five resource limit IDs have a MIPS/Linux-specific ordering, 14 * These five resource limit IDs have a MIPS/Linux-specific ordering,
diff --git a/include/asm-mips/rm9k-ocd.h b/include/asm-mips/rm9k-ocd.h
new file mode 100644
index 00000000000..b0b80d9ecf9
--- /dev/null
+++ b/include/asm-mips/rm9k-ocd.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2004 by Basler Vision Technologies AG
3 * Author: Thomas Koeller <thomas.koeller@baslerweb.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#if !defined(_ASM_RM9K_OCD_H)
21#define _ASM_RM9K_OCD_H
22
23#include <linux/types.h>
24#include <linux/spinlock.h>
25#include <asm/io.h>
26
27extern volatile void __iomem * const ocd_base;
28extern volatile void __iomem * const titan_base;
29
30#define ocd_addr(__x__) (ocd_base + (__x__))
31#define titan_addr(__x__) (titan_base + (__x__))
32#define scram_addr(__x__) (scram_base + (__x__))
33
34/* OCD register access */
35#define ocd_readl(__offs__) __raw_readl(ocd_addr(__offs__))
36#define ocd_readw(__offs__) __raw_readw(ocd_addr(__offs__))
37#define ocd_readb(__offs__) __raw_readb(ocd_addr(__offs__))
38#define ocd_writel(__val__, __offs__) \
39 __raw_writel((__val__), ocd_addr(__offs__))
40#define ocd_writew(__val__, __offs__) \
41 __raw_writew((__val__), ocd_addr(__offs__))
42#define ocd_writeb(__val__, __offs__) \
43 __raw_writeb((__val__), ocd_addr(__offs__))
44
45/* TITAN register access - 32 bit-wide only */
46#define titan_readl(__offs__) __raw_readl(titan_addr(__offs__))
47#define titan_writel(__val__, __offs__) \
48 __raw_writel((__val__), titan_addr(__offs__))
49
50/* Protect access to shared TITAN registers */
51extern spinlock_t titan_lock;
52extern int titan_irqflags;
53#define lock_titan_regs() spin_lock_irqsave(&titan_lock, titan_irqflags)
54#define unlock_titan_regs() spin_unlock_irqrestore(&titan_lock, titan_irqflags)
55
56#endif /* !defined(_ASM_RM9K_OCD_H) */
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 7196ceb0e94..584bd9c0ab2 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SERIAL_H 9#ifndef _ASM_SERIAL_H
10#define _ASM_SERIAL_H 10#define _ASM_SERIAL_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * This assumes you have a 1.8432 MHz clock for your UART. 14 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h
index 722b77a8c5e..ddb859d0525 100644
--- a/include/asm-mips/sgiarcs.h
+++ b/include/asm-mips/sgiarcs.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_SGIARCS_H 12#ifndef _ASM_SGIARCS_H
13#define _ASM_SGIARCS_H 13#define _ASM_SGIARCS_H
14 14
15#include <linux/config.h>
16#include <asm/types.h> 15#include <asm/types.h>
17#include <asm/arc/types.h> 16#include <asm/arc/types.h>
18 17
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h
index 900edcbeec3..3dfe29ed42a 100644
--- a/include/asm-mips/sibyte/board.h
+++ b/include/asm-mips/sibyte/board.h
@@ -19,7 +19,6 @@
19#ifndef _SIBYTE_BOARD_H 19#ifndef _SIBYTE_BOARD_H
20#define _SIBYTE_BOARD_H 20#define _SIBYTE_BOARD_H
21 21
22#include <linux/config.h>
23 22
24#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \ 23#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \
25 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \ 24 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \
diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h
index b5e7dae19f0..57c53e62a37 100644
--- a/include/asm-mips/sibyte/carmel.h
+++ b/include/asm-mips/sibyte/carmel.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_CARMEL_H 18#ifndef __ASM_SIBYTE_CARMEL_H
19#define __ASM_SIBYTE_CARMEL_H 19#define __ASM_SIBYTE_CARMEL_H
20 20
21#include <linux/config.h>
22 21
23#include <asm/sibyte/sb1250.h> 22#include <asm/sibyte/sb1250.h>
24#include <asm/sibyte/sb1250_int.h> 23#include <asm/sibyte/sb1250_int.h>
diff --git a/include/asm-mips/sibyte/sentosa.h b/include/asm-mips/sibyte/sentosa.h
index 824605847af..64c47874f32 100644
--- a/include/asm-mips/sibyte/sentosa.h
+++ b/include/asm-mips/sibyte/sentosa.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_SENTOSA_H 18#ifndef __ASM_SIBYTE_SENTOSA_H
19#define __ASM_SIBYTE_SENTOSA_H 19#define __ASM_SIBYTE_SENTOSA_H
20 20
21#include <linux/config.h>
22#include <asm/sibyte/sb1250.h> 21#include <asm/sibyte/sb1250.h>
23#include <asm/sibyte/sb1250_int.h> 22#include <asm/sibyte/sb1250_int.h>
24 23
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h
index 06e1d528e03..86db37e5ad8 100644
--- a/include/asm-mips/sibyte/swarm.h
+++ b/include/asm-mips/sibyte/swarm.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_SWARM_H 18#ifndef __ASM_SIBYTE_SWARM_H
19#define __ASM_SIBYTE_SWARM_H 19#define __ASM_SIBYTE_SWARM_H
20 20
21#include <linux/config.h>
22#include <asm/sibyte/sb1250.h> 21#include <asm/sibyte/sb1250.h>
23#include <asm/sibyte/sb1250_int.h> 22#include <asm/sibyte/sb1250_int.h>
24 23
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
index 2ba313d94a7..2e32949bd67 100644
--- a/include/asm-mips/siginfo.h
+++ b/include/asm-mips/siginfo.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIGINFO_H 9#ifndef _ASM_SIGINFO_H
10#define _ASM_SIGINFO_H 10#define _ASM_SIGINFO_H
11 11
12#include <linux/config.h>
13 12
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int)) 13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ 14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index d8349e4b55e..87a1dff9519 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIGNAL_H 9#ifndef _ASM_SIGNAL_H
10#define _ASM_SIGNAL_H 10#define _ASM_SIGNAL_H
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14 13
15#define _NSIG 128 14#define _NSIG 128
@@ -65,7 +64,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
65 * SA_FLAGS values: 64 * SA_FLAGS values:
66 * 65 *
67 * SA_ONSTACK indicates that a registered stack_t will be used. 66 * SA_ONSTACK indicates that a registered stack_t will be used.
68 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
69 * SA_RESTART flag to get restarting signals (which were the default long ago) 67 * SA_RESTART flag to get restarting signals (which were the default long ago)
70 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
71 * SA_RESETHAND clears the handler when the signal is delivered. 69 * SA_RESETHAND clears the handler when the signal is delivered.
@@ -85,7 +83,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
85 83
86#define SA_NOMASK SA_NODEFER 84#define SA_NOMASK SA_NODEFER
87#define SA_ONESHOT SA_RESETHAND 85#define SA_ONESHOT SA_RESETHAND
88#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
89 86
90#define SA_RESTORER 0x04000000 /* Only for o32 */ 87#define SA_RESTORER 0x04000000 /* Only for o32 */
91 88
@@ -100,15 +97,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
100 97
101#ifdef __KERNEL__ 98#ifdef __KERNEL__
102 99
103/*
104 * These values of sa_flags are used only by the kernel as part of the
105 * irq handling routines.
106 *
107 * SA_INTERRUPT is also used by the irq handling routines.
108 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
109 */
110#define SA_SAMPLE_RANDOM SA_RESTART
111
112#ifdef CONFIG_TRAD_SIGNALS 100#ifdef CONFIG_TRAD_SIGNALS
113#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) 101#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO)
114#else 102#else
diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h
index 9c2af1b00e1..67c4fe52bb4 100644
--- a/include/asm-mips/sim.h
+++ b/include/asm-mips/sim.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIM_H 9#ifndef _ASM_SIM_H
10#define _ASM_SIM_H 10#define _ASM_SIM_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/asm-offsets.h> 13#include <asm/asm-offsets.h>
15 14
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index 75c6fe7c212..1608fd71d6f 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_SMP_H 11#ifndef __ASM_SMP_H
12#define __ASM_SMP_H 12#define __ASM_SMP_H
13 13
14#include <linux/config.h>
15 14
16#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
17 16
@@ -48,7 +47,6 @@ extern struct call_data_struct *call_data;
48#define SMP_CALL_FUNCTION 0x2 47#define SMP_CALL_FUNCTION 0x2
49 48
50extern cpumask_t phys_cpu_present_map; 49extern cpumask_t phys_cpu_present_map;
51extern cpumask_t cpu_online_map;
52#define cpu_possible_map phys_cpu_present_map 50#define cpu_possible_map phys_cpu_present_map
53 51
54extern cpumask_t cpu_callout_map; 52extern cpumask_t cpu_callout_map;
@@ -86,9 +84,9 @@ extern void prom_init_secondary(void);
86extern void plat_smp_setup(void); 84extern void plat_smp_setup(void);
87 85
88/* 86/*
89 * Called after init_IRQ but before __cpu_up. 87 * Called in smp_prepare_cpus.
90 */ 88 */
91extern void prom_prepare_cpus(unsigned int max_cpus); 89extern void plat_prepare_cpus(unsigned int max_cpus);
92 90
93/* 91/*
94 * Last chance for the board code to finish SMP initialization before 92 * Last chance for the board code to finish SMP initialization before
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h
index 2b5cef1ba37..8fa0af6b68d 100644
--- a/include/asm-mips/sn/addrs.h
+++ b/include/asm-mips/sn/addrs.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_ADDRS_H 9#ifndef _ASM_SN_ADDRS_H
10#define _ASM_SN_ADDRS_H 10#define _ASM_SN_ADDRS_H
11 11
12#include <linux/config.h>
13 12
14#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
15#include <linux/types.h> 14#include <linux/types.h>
@@ -27,13 +26,8 @@
27 26
28#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
29 28
30#if defined(CONFIG_SGI_IO) /* FIXME */
31#define PS_UINT_CAST (__psunsigned_t)
32#define UINT64_CAST (__uint64_t)
33#else /* CONFIG_SGI_IO */
34#define PS_UINT_CAST (unsigned long) 29#define PS_UINT_CAST (unsigned long)
35#define UINT64_CAST (unsigned long) 30#define UINT64_CAST (unsigned long)
36#endif /* CONFIG_SGI_IO */
37 31
38#define HUBREG_CAST (volatile hubreg_t *) 32#define HUBREG_CAST (volatile hubreg_t *)
39 33
@@ -253,14 +247,6 @@
253 * for _x. 247 * for _x.
254 */ 248 */
255 249
256#ifdef _STANDALONE
257
258/* DO NOT USE THESE DIRECTLY IN THE KERNEL. SEE BELOW. */
259#define LOCAL_HUB(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
260#define REMOTE_HUB(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
261 0x800000 + (_x)))
262#endif /* _STANDALONE */
263
264/* 250/*
265 * WARNING: 251 * WARNING:
266 * When certain Hub chip workaround are defined, it's not sufficient 252 * When certain Hub chip workaround are defined, it's not sufficient
@@ -327,20 +313,6 @@
327 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET) 313 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET)
328#define ARCS_SPB_SIZE 0x0400 314#define ARCS_SPB_SIZE 0x0400
329 315
330#ifdef _STANDALONE
331
332#define ARCS_TVECTOR_OFFSET 0x2800
333#define ARCS_PVECTOR_OFFSET 0x2c00
334
335/*
336 * These addresses are used by the master CPU to install the transfer
337 * and private vectors. All others use the SPB to find them.
338 */
339#define TVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_TVECTOR_OFFSET)
340#define PVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_PVECTOR_OFFSET)
341
342#endif /* _STANDALONE */
343
344#define KLDIR_OFFSET 0x2000 316#define KLDIR_OFFSET 0x2000
345#define KLDIR_ADDR(nasid) \ 317#define KLDIR_ADDR(nasid) \
346 TO_NODE_UNCAC((nasid), KLDIR_OFFSET) 318 TO_NODE_UNCAC((nasid), KLDIR_OFFSET)
diff --git a/include/asm-mips/sn/agent.h b/include/asm-mips/sn/agent.h
index d6df13aaed4..ac4ea85c3a5 100644
--- a/include/asm-mips/sn/agent.h
+++ b/include/asm-mips/sn/agent.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SGI_SN_AGENT_H 11#ifndef _ASM_SGI_SN_AGENT_H
12#define _ASM_SGI_SN_AGENT_H 12#define _ASM_SGI_SN_AGENT_H
13 13
14#include <linux/config.h>
15#include <linux/topology.h> 14#include <linux/topology.h>
16#include <asm/sn/addrs.h> 15#include <asm/sn/addrs.h>
17#include <asm/sn/arch.h> 16#include <asm/sn/arch.h>
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h
index d247a819de7..51174af6ac5 100644
--- a/include/asm-mips/sn/arch.h
+++ b/include/asm-mips/sn/arch.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_ARCH_H 11#ifndef _ASM_SN_ARCH_H
12#define _ASM_SN_ARCH_H 12#define _ASM_SN_ARCH_H
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <asm/sn/types.h> 15#include <asm/sn/types.h>
17#ifdef CONFIG_SGI_IP27 16#ifdef CONFIG_SGI_IP27
diff --git a/include/asm-mips/sn/sn0/sn0_fru.h b/include/asm-mips/sn/fru.h
index 82c6377c275..b3e3606723b 100644
--- a/include/asm-mips/sn/sn0/sn0_fru.h
+++ b/include/asm-mips/sn/fru.h
@@ -6,10 +6,10 @@
6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h> 6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h>
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999, 2006 Ralf Baechle (ralf@linux-mips)
10 */ 10 */
11#ifndef _ASM_SN_SN0_SN0_FRU_H 11#ifndef __ASM_SN_FRU_H
12#define _ASM_SN_SN0_SN0_FRU_H 12#define __ASM_SN_FRU_H
13 13
14#define MAX_DIMMS 8 /* max # of dimm banks */ 14#define MAX_DIMMS 8 /* max # of dimm banks */
15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */ 15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */
@@ -41,4 +41,4 @@ typedef struct kf_pci_bus_s {
41 /* confidence level that the pci dev is bad */ 41 /* confidence level that the pci dev is bad */
42} kf_pci_bus_t; 42} kf_pci_bus_t;
43 43
44#endif /* _ASM_SN_SN0_SN0_FRU_H */ 44#endif /* __ASM_SN_FRU_H */
diff --git a/include/asm-mips/sn/io.h b/include/asm-mips/sn/io.h
index 13326453efc..ab2fa8cd262 100644
--- a/include/asm-mips/sn/io.h
+++ b/include/asm-mips/sn/io.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_IO_H 9#ifndef _ASM_SN_IO_H
10#define _ASM_SN_IO_H 10#define _ASM_SN_IO_H
11 11
12#include <linux/config.h>
13#if defined (CONFIG_SGI_IP27) 12#if defined (CONFIG_SGI_IP27)
14#include <asm/sn/sn0/hubio.h> 13#include <asm/sn/sn0/hubio.h>
15#endif 14#endif
diff --git a/include/asm-mips/sn/ioc3.h b/include/asm-mips/sn/ioc3.h
index f7d530f306f..099677774d7 100644
--- a/include/asm-mips/sn/ioc3.h
+++ b/include/asm-mips/sn/ioc3.h
@@ -5,6 +5,8 @@
5#ifndef _IOC3_H 5#ifndef _IOC3_H
6#define _IOC3_H 6#define _IOC3_H
7 7
8#include <linux/types.h>
9
8/* SUPERIO uart register map */ 10/* SUPERIO uart register map */
9typedef volatile struct ioc3_uartregs { 11typedef volatile struct ioc3_uartregs {
10 union { 12 union {
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index 9709ff701d9..b63cd0655b3 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -27,7 +27,6 @@
27 * that offsets of existing fields do not change. 27 * that offsets of existing fields do not change.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <asm/sn/types.h> 31#include <asm/sn/types.h>
33 32
@@ -37,7 +36,7 @@
37//#include <sys/SN/router.h> 36//#include <sys/SN/router.h>
38// XXX Stolen from <sys/SN/router.h>: 37// XXX Stolen from <sys/SN/router.h>:
39#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */ 38#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
40#include <asm/sn/sn0/sn0_fru.h> 39#include <asm/sn/fru.h>
41//#include <sys/graph.h> 40//#include <sys/graph.h>
42//#include <sys/xtalk/xbow.h> 41//#include <sys/xtalk/xbow.h>
43 42
@@ -54,32 +53,21 @@
54#include <asm/sn/agent.h> 53#include <asm/sn/agent.h>
55#include <asm/arc/types.h> 54#include <asm/arc/types.h>
56#include <asm/arc/hinv.h> 55#include <asm/arc/hinv.h>
57#if defined(CONFIG_SGI_IO) || defined(CONFIG_SGI_IP35) 56#if defined(CONFIG_SGI_IP35)
58// The hack file has to be before vector and after sn0_fru.... 57// The hack file has to be before vector and after sn0_fru....
59#include <asm/hack.h> 58#include <asm/hack.h>
60#include <asm/sn/vector.h> 59#include <asm/sn/vector.h>
61#include <asm/xtalk/xtalk.h> 60#include <asm/xtalk/xtalk.h>
62#endif /* CONFIG_SGI_IO || CONFIG_SGI_IP35 */ 61#endif /* CONFIG_SGI_IP35 */
63#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ 62#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
64 63
65#define KLCFGINFO_MAGIC 0xbeedbabe 64#define KLCFGINFO_MAGIC 0xbeedbabe
66 65
67#ifdef FRUTEST
68typedef u64 klconf_off_t;
69#else
70typedef s32 klconf_off_t; 66typedef s32 klconf_off_t;
71#endif
72 67
73/* 68/*
74 * Some IMPORTANT OFFSETS. These are the offsets on all NODES. 69 * Some IMPORTANT OFFSETS. These are the offsets on all NODES.
75 */ 70 */
76#if 0
77#define RAMBASE 0
78#define ARCSSPB_OFF 0x1000 /* shift it to sys/arcs/spb.h */
79
80#define OFF_HWGRAPH 0
81#endif
82
83#define MAX_MODULE_ID 255 71#define MAX_MODULE_ID 255
84#define SIZE_PAD 4096 /* 4k padding for structures */ 72#define SIZE_PAD 4096 /* 4k padding for structures */
85/* 73/*
@@ -134,15 +122,9 @@ typedef s32 klconf_off_t;
134 122
135 123
136typedef struct console_s { 124typedef struct console_s {
137#if defined(CONFIG_SGI_IO) /* FIXME */
138 __psunsigned_t uart_base;
139 __psunsigned_t config_base;
140 __psunsigned_t memory_base;
141#else
142 unsigned long uart_base; 125 unsigned long uart_base;
143 unsigned long config_base; 126 unsigned long config_base;
144 unsigned long memory_base; 127 unsigned long memory_base;
145#endif
146 short baud; 128 short baud;
147 short flag; 129 short flag;
148 int type; 130 int type;
@@ -174,10 +156,6 @@ typedef struct kl_config_hdr {
174 156
175 157
176#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid))) 158#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
177#if 0
178#define KL_CONFIG_MALLOC_HDR(_nasid) \
179 (KL_CONFIG_HDR(_nasid)->ch_malloc_hdr)
180#endif
181#define KL_CONFIG_INFO_OFFSET(_nasid) \ 159#define KL_CONFIG_INFO_OFFSET(_nasid) \
182 (KL_CONFIG_HDR(_nasid)->ch_board_info) 160 (KL_CONFIG_HDR(_nasid)->ch_board_info)
183#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \ 161#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \
@@ -197,23 +175,13 @@ typedef struct kl_config_hdr {
197 175
198/* --- New Macros for the changed kl_config_hdr_t structure --- */ 176/* --- New Macros for the changed kl_config_hdr_t structure --- */
199 177
200#if defined(CONFIG_SGI_IO)
201#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
202 ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
203#else
204#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\ 178#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
205 (unsigned long)_k + (_k->ch_malloc_hdr_off))) 179 (unsigned long)_k + (_k->ch_malloc_hdr_off)))
206#endif
207 180
208#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n)) 181#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
209 182
210#if defined(CONFIG_SGI_IO)
211#define PTR_CH_CONS_INFO(_k) ((console_t *)\
212 ((__psunsigned_t)_k + (_k->ch_cons_off)))
213#else
214#define PTR_CH_CONS_INFO(_k) ((console_t *)\ 183#define PTR_CH_CONS_INFO(_k) ((console_t *)\
215 ((unsigned long)_k + (_k->ch_cons_off))) 184 ((unsigned long)_k + (_k->ch_cons_off)))
216#endif
217 185
218#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n)) 186#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
219 187
@@ -490,14 +458,6 @@ typedef struct lboard_s {
490#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) 458#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
491#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module) 459#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
492 460
493#ifdef FRUTEST
494
495#define KLCF_NEXT(_brd) ((_brd)->brd_next ? (lboard_t *)((_brd)->brd_next): NULL)
496#define KLCF_COMP(_brd, _ndx) (klinfo_t *)((_brd)->brd_compts[(_ndx)])
497#define KLCF_COMP_ERROR(_brd, _comp) (_brd = _brd , (_comp)->errinfo)
498
499#else
500
501#define KLCF_NEXT(_brd) \ 461#define KLCF_NEXT(_brd) \
502 ((_brd)->brd_next ? \ 462 ((_brd)->brd_next ? \
503 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\ 463 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\
@@ -509,8 +469,6 @@ typedef struct lboard_s {
509#define KLCF_COMP_ERROR(_brd, _comp) \ 469#define KLCF_COMP_ERROR(_brd, _comp) \
510 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo)) 470 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo))
511 471
512#endif
513
514#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) 472#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
515#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */ 473#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
516 474
@@ -631,18 +589,6 @@ typedef struct klport_s {
631 klconf_off_t port_offset; 589 klconf_off_t port_offset;
632} klport_t; 590} klport_t;
633 591
634#if 0
635/*
636 * This is very similar to the klport_s but instead of having a componant
637 * offset it has a board offset.
638 */
639typedef struct klxbow_port_s {
640 nasid_t port_nasid;
641 unsigned char port_flag;
642 klconf_off_t board_offset;
643} klxbow_port_t;
644#endif
645
646typedef struct klcpu_s { /* CPU */ 592typedef struct klcpu_s { /* CPU */
647 klinfo_t cpu_info; 593 klinfo_t cpu_info;
648 unsigned short cpu_prid; /* Processor PRID value */ 594 unsigned short cpu_prid; /* Processor PRID value */
@@ -656,7 +602,7 @@ typedef struct klcpu_s { /* CPU */
656 602
657typedef struct klhub_s { /* HUB */ 603typedef struct klhub_s { /* HUB */
658 klinfo_t hub_info; 604 klinfo_t hub_info;
659 uint hub_flags; /* PCFG_HUB_xxx flags */ 605 unsigned int hub_flags; /* PCFG_HUB_xxx flags */
660 klport_t hub_port; /* hub is connected to this */ 606 klport_t hub_port; /* hub is connected to this */
661 nic_t hub_box_nic; /* nic of containing box */ 607 nic_t hub_box_nic; /* nic of containing box */
662 klconf_off_t hub_mfg_nic; /* MFG NIC string */ 608 klconf_off_t hub_mfg_nic; /* MFG NIC string */
@@ -665,7 +611,7 @@ typedef struct klhub_s { /* HUB */
665 611
666typedef struct klhub_uart_s { /* HUB */ 612typedef struct klhub_uart_s { /* HUB */
667 klinfo_t hubuart_info; 613 klinfo_t hubuart_info;
668 uint hubuart_flags; /* PCFG_HUB_xxx flags */ 614 unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */
669 nic_t hubuart_box_nic; /* nic of containing box */ 615 nic_t hubuart_box_nic; /* nic of containing box */
670} klhub_uart_t ; 616} klhub_uart_t ;
671 617
@@ -764,7 +710,7 @@ typedef struct klvmed_s { /* VME DEVICE - VME BOARD */
764/* XXX - Don't we need the number of ports here?!? */ 710/* XXX - Don't we need the number of ports here?!? */
765typedef struct klrou_s { /* ROUTER */ 711typedef struct klrou_s { /* ROUTER */
766 klinfo_t rou_info ; 712 klinfo_t rou_info ;
767 uint rou_flags ; /* PCFG_ROUTER_xxx flags */ 713 unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */
768 nic_t rou_box_nic ; /* nic of the containing module */ 714 nic_t rou_box_nic ; /* nic of the containing module */
769 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ 715 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
770 klconf_off_t rou_mfg_nic ; /* MFG NIC string */ 716 klconf_off_t rou_mfg_nic ; /* MFG NIC string */
@@ -787,8 +733,8 @@ typedef struct klgfx_s { /* GRAPHICS Device */
787 klinfo_t gfx_info; 733 klinfo_t gfx_info;
788 klconf_off_t old_gndevs; /* for compatibility with older proms */ 734 klconf_off_t old_gndevs; /* for compatibility with older proms */
789 klconf_off_t old_gdoff0; /* for compatibility with older proms */ 735 klconf_off_t old_gdoff0; /* for compatibility with older proms */
790 uint cookie; /* for compatibility with older proms */ 736 unsigned int cookie; /* for compatibility with older proms */
791 uint moduleslot; 737 unsigned int moduleslot;
792 struct klgfx_s *gfx_next_pipe; 738 struct klgfx_s *gfx_next_pipe;
793 graphics_t gfx_specific; 739 graphics_t gfx_specific;
794 klconf_off_t pad0; /* for compatibility with older proms */ 740 klconf_off_t pad0; /* for compatibility with older proms */
@@ -945,36 +891,6 @@ extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
945extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class); 891extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
946 892
947 893
948#if defined(CONFIG_SGI_IO)
949extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
950extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
951extern lboard_t *find_gfxpipe(int pipenum);
952extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
953extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
954 unsigned char brd_class);
955extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
956extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
957extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
958extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
959extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
960extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
961extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
962extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
963extern klcpu_t *get_cpuinfo(cpuid_t cpu);
964extern int update_klcfg_cpuinfo(nasid_t, int);
965extern void board_to_path(lboard_t *brd, char *path);
966extern moduleid_t get_module_id(nasid_t nasid);
967extern void nic_name_convert(char *old_name, char *new_name);
968extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
969extern lboard_t *brd_from_key(ulong_t key);
970extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
971 char *);
972extern int board_serial_number_get(lboard_t *,char *);
973extern int is_master_baseio(nasid_t,moduleid_t,slotid_t);
974extern nasid_t get_actual_nasid(lboard_t *brd) ;
975extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
976#else /* CONFIG_SGI_IO */
977extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu); 894extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
978#endif /* CONFIG_SGI_IO */
979 895
980#endif /* _ASM_SN_KLCONFIG_H */ 896#endif /* _ASM_SN_KLCONFIG_H */
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h
index f0efab1672e..0573cbffc10 100644
--- a/include/asm-mips/sn/kldir.h
+++ b/include/asm-mips/sn/kldir.h
@@ -11,11 +11,6 @@
11#ifndef _ASM_SN_KLDIR_H 11#ifndef _ASM_SN_KLDIR_H
12#define _ASM_SN_KLDIR_H 12#define _ASM_SN_KLDIR_H
13 13
14#include <linux/config.h>
15
16#if defined(CONFIG_SGI_IO)
17#include <asm/hack.h>
18#endif
19 14
20/* 15/*
21 * The kldir memory area resides at a fixed place in each node's memory and 16 * The kldir memory area resides at a fixed place in each node's memory and
@@ -136,8 +131,6 @@
136#define KLDIR_OFF_STRIDE 0x28 131#define KLDIR_OFF_STRIDE 0x28
137#endif /* __ASSEMBLY__ */ 132#endif /* __ASSEMBLY__ */
138 133
139#if !defined(CONFIG_SGI_IO)
140
141/* 134/*
142 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what 135 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
143 * we define here. Since it's set up in the prom. We can't redefine it later 136 * we define here. Since it's set up in the prom. We can't redefine it later
@@ -147,7 +140,7 @@
147 */ 140 */
148#define SYMMON_STACK_SIZE 0x8000 141#define SYMMON_STACK_SIZE 0x8000
149 142
150#if defined (PROM) || defined (SABLE) 143#if defined (PROM)
151 144
152/* 145/*
153 * These defines are prom version dependent. No code other than the IP27 146 * These defines are prom version dependent. No code other than the IP27
@@ -184,7 +177,7 @@
184#define IP27_FREEMEM_COUNT 1 177#define IP27_FREEMEM_COUNT 1
185#define IP27_FREEMEM_STRIDE 0 178#define IP27_FREEMEM_STRIDE 0
186 179
187#endif /* PROM || SABLE*/ 180#endif /* PROM */
188/* 181/*
189 * There will be only one of these in a partition so the IO6 must set it up. 182 * There will be only one of these in a partition so the IO6 must set it up.
190 */ 183 */
@@ -207,17 +200,11 @@
207#define KLDIR_ENT_SIZE 0x40 200#define KLDIR_ENT_SIZE 0x40
208#define KLDIR_MAX_ENTRIES (0x400 / 0x40) 201#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
209 202
210#endif /* !CONFIG_SGI_IO */
211
212#ifndef __ASSEMBLY__ 203#ifndef __ASSEMBLY__
213typedef struct kldir_ent_s { 204typedef struct kldir_ent_s {
214 u64 magic; /* Indicates validity of entry */ 205 u64 magic; /* Indicates validity of entry */
215 off_t offset; /* Offset from start of node space */ 206 off_t offset; /* Offset from start of node space */
216#if defined(CONFIG_SGI_IO) /* FIXME */
217 __psunsigned_t pointer; /* Pointer to area in some cases */
218#else
219 unsigned long pointer; /* Pointer to area in some cases */ 207 unsigned long pointer; /* Pointer to area in some cases */
220#endif
221 size_t size; /* Size in bytes */ 208 size_t size; /* Size in bytes */
222 u64 count; /* Repeat count if array, 1 if not */ 209 u64 count; /* Repeat count if array, 1 if not */
223 size_t stride; /* Stride if array, 0 if not */ 210 size_t stride; /* Stride if array, 0 if not */
@@ -227,22 +214,4 @@ typedef struct kldir_ent_s {
227} kldir_ent_t; 214} kldir_ent_t;
228#endif /* !__ASSEMBLY__ */ 215#endif /* !__ASSEMBLY__ */
229 216
230#if defined(CONFIG_SGI_IO)
231
232#define KLDIR_ENT_SIZE 0x40
233#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
234
235/*
236 * The actual offsets of each memory area are machine-dependent
237 */
238#ifdef CONFIG_SGI_IP27
239// Not yet #include <asm/sn/sn0/kldir.h>
240#elif defined(CONFIG_SGI_IP35)
241#include <asm/sn/sn1/kldir.h>
242#else
243#error "kldir.h is currently defined for IP27 and IP35 platforms only"
244#endif
245
246#endif /* CONFIG_SGI_IO */
247
248#endif /* _ASM_SN_KLDIR_H */ 217#endif /* _ASM_SN_KLDIR_H */
diff --git a/include/asm-mips/sn/launch.h b/include/asm-mips/sn/launch.h
index b67699c0c47..b7c2226312c 100644
--- a/include/asm-mips/sn/launch.h
+++ b/include/asm-mips/sn/launch.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_LAUNCH_H 9#ifndef _ASM_SN_LAUNCH_H
10#define _ASM_SN_LAUNCH_H 10#define _ASM_SN_LAUNCH_H
11 11
12#include <linux/config.h>
13#include <asm/sn/types.h> 12#include <asm/sn/types.h>
14#include <asm/sn/addrs.h> 13#include <asm/sn/addrs.h>
15 14
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h
index 59edb20f8ec..c3dd5d0d525 100644
--- a/include/asm-mips/sn/mapped_kernel.h
+++ b/include/asm-mips/sn/mapped_kernel.h
@@ -20,7 +20,6 @@
20 * code. So no jumps can be done before we have switched to using 20 * code. So no jumps can be done before we have switched to using
21 * cksseg addresses. 21 * cksseg addresses.
22 */ 22 */
23#include <linux/config.h>
24#include <asm/addrspace.h> 23#include <asm/addrspace.h>
25 24
26#define REP_BASE CAC_BASE 25#define REP_BASE CAC_BASE
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h
index 398815639fb..9e8cc52910f 100644
--- a/include/asm-mips/sn/sn0/addrs.h
+++ b/include/asm-mips/sn/sn0/addrs.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_SN0_ADDRS_H 11#ifndef _ASM_SN_SN0_ADDRS_H
12#define _ASM_SN_SN0_ADDRS_H 12#define _ASM_SN_SN0_ADDRS_H
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * SN0 (on a T5) Address map 16 * SN0 (on a T5) Address map
@@ -49,7 +48,7 @@
49 * so for now we just use defines bracketed by an ifdef. 48 * so for now we just use defines bracketed by an ifdef.
50 */ 49 */
51 50
52#ifdef CONFIG_SGI_SN0_N_MODE 51#ifdef CONFIG_SGI_SN_N_MODE
53 52
54#define NODE_SIZE_BITS 31 53#define NODE_SIZE_BITS 31
55#define BWIN_SIZE_BITS 28 54#define BWIN_SIZE_BITS 28
@@ -63,7 +62,7 @@
63#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10) 62#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10)
64#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3) 63#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3)
65 64
66#else /* !defined(CONFIG_SGI_SN0_N_MODE), assume that M-mode is desired */ 65#else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */
67 66
68#define NODE_SIZE_BITS 32 67#define NODE_SIZE_BITS 32
69#define BWIN_SIZE_BITS 29 68#define BWIN_SIZE_BITS 29
@@ -77,7 +76,7 @@
77#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10) 76#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10)
78#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3) 77#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3)
79 78
80#endif /* !defined(CONFIG_SGI_SN0_N_MODE) */ 79#endif /* !defined(CONFIG_SGI_SN_N_MODE) */
81 80
82#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS) 81#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS)
83 82
@@ -85,15 +84,15 @@
85#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ 84#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \
86 NASID_SHFT) & NASID_BITMASK) 85 NASID_SHFT) & NASID_BITMASK)
87 86
88#if !defined(__ASSEMBLY__) && !defined(_STANDALONE) 87#if !defined(__ASSEMBLY__)
89 88
90#define NODE_SWIN_BASE(nasid, widget) \ 89#define NODE_SWIN_BASE(nasid, widget) \
91 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ 90 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \
92 : RAW_NODE_SWIN_BASE(nasid, widget)) 91 : RAW_NODE_SWIN_BASE(nasid, widget))
93#else /* __ASSEMBLY__ || _STANDALONE */ 92#else /* __ASSEMBLY__ */
94#define NODE_SWIN_BASE(nasid, widget) \ 93#define NODE_SWIN_BASE(nasid, widget) \
95 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS)) 94 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
96#endif /* __ASSEMBLY__ || _STANDALONE */ 95#endif /* __ASSEMBLY__ */
97 96
98/* 97/*
99 * The following definitions pertain to the IO special address 98 * The following definitions pertain to the IO special address
@@ -143,12 +142,7 @@
143#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid))) 142#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid)))
144 143
145/* Turn on sable logging for the processors whose bits are set. */ 144/* Turn on sable logging for the processors whose bits are set. */
146#ifdef SABLE
147#define SABLE_LOG_TRIGGER(_map) \
148 *((volatile hubreg_t *)(IO_BASE + 0x17ffff0)) = (_map)
149#else
150#define SABLE_LOG_TRIGGER(_map) 145#define SABLE_LOG_TRIGGER(_map)
151#endif /* SABLE */
152 146
153#ifndef __ASSEMBLY__ 147#ifndef __ASSEMBLY__
154#define KERN_NMI_ADDR(nasid, slice) \ 148#define KERN_NMI_ADDR(nasid, slice) \
@@ -281,76 +275,6 @@
281 275
282#define _ARCSPROM 276#define _ARCSPROM
283 277
284#ifdef _STANDALONE
285
286/*
287 * The PROM needs to pass the device base address and the
288 * device pci cfg space address to the device drivers during
289 * install. The COMPONENT->Key field is used for this purpose.
290 * Macros needed by SN0 device drivers to convert the
291 * COMPONENT->Key field to the respective base address.
292 * Key field looks as follows:
293 *
294 * +----------------------------------------------------+
295 * |devnasid | widget |pciid |hubwidid|hstnasid | adap |
296 * | 2 | 1 | 1 | 1 | 2 | 1 |
297 * +----------------------------------------------------+
298 * | | | | | | |
299 * 64 48 40 32 24 8 0
300 *
301 * These are used by standalone drivers till the io infrastructure
302 * is in place.
303 */
304
305#ifndef __ASSEMBLY__
306
307#define uchar unsigned char
308
309#define KEY_DEVNASID_SHFT 48
310#define KEY_WIDID_SHFT 40
311#define KEY_PCIID_SHFT 32
312#define KEY_HUBWID_SHFT 24
313#define KEY_HSTNASID_SHFT 8
314
315#define MK_SN0_KEY(nasid, widid, pciid) \
316 ((((__psunsigned_t)nasid)<< KEY_DEVNASID_SHFT |\
317 ((__psunsigned_t)widid) << KEY_WIDID_SHFT) |\
318 ((__psunsigned_t)pciid) << KEY_PCIID_SHFT)
319
320#define ADD_HUBWID_KEY(key,hubwid)\
321 (key|=((__psunsigned_t)hubwid << KEY_HUBWID_SHFT))
322
323#define ADD_HSTNASID_KEY(key,hstnasid)\
324 (key|=((__psunsigned_t)hstnasid << KEY_HSTNASID_SHFT))
325
326#define GET_DEVNASID_FROM_KEY(key) ((short)(key >> KEY_DEVNASID_SHFT))
327#define GET_WIDID_FROM_KEY(key) ((uchar)(key >> KEY_WIDID_SHFT))
328#define GET_PCIID_FROM_KEY(key) ((uchar)(key >> KEY_PCIID_SHFT))
329#define GET_HUBWID_FROM_KEY(key) ((uchar)(key >> KEY_HUBWID_SHFT))
330#define GET_HSTNASID_FROM_KEY(key) ((short)(key >> KEY_HSTNASID_SHFT))
331
332#define PCI_64_TARGID_SHFT 60
333
334#define GET_PCIBASE_FROM_KEY(key) (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
335 GET_WIDID_FROM_KEY(key))\
336 | BRIDGE_DEVIO(GET_PCIID_FROM_KEY(key)))
337
338#define GET_PCICFGBASE_FROM_KEY(key) \
339 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
340 GET_WIDID_FROM_KEY(key))\
341 | BRIDGE_TYPE0_CFG_DEV(GET_PCIID_FROM_KEY(key)))
342
343#define GET_WIDBASE_FROM_KEY(key) \
344 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
345 GET_WIDID_FROM_KEY(key)))
346
347#define PUT_INSTALL_STATUS(c,s) c->Revision = s
348#define GET_INSTALL_STATUS(c) c->Revision
349
350#endif /* !__ASSEMBLY__ */
351
352#endif /* _STANDALONE */
353
354#if defined (HUB_ERR_STS_WAR) 278#if defined (HUB_ERR_STS_WAR)
355 279
356#define ERR_STS_WAR_REGISTER IIO_IIBUSERR 280#define ERR_STS_WAR_REGISTER IIO_IIBUSERR
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
index fb78773a5ef..f734f2007f2 100644
--- a/include/asm-mips/sn/sn0/arch.h
+++ b/include/asm-mips/sn/sn0/arch.h
@@ -11,9 +11,6 @@
11#ifndef _ASM_SN_SN0_ARCH_H 11#ifndef _ASM_SN_SN0_ARCH_H
12#define _ASM_SN_SN0_ARCH_H 12#define _ASM_SN_SN0_ARCH_H
13 13
14#include <linux/config.h>
15
16#ifndef SABLE
17 14
18#ifndef SN0XXL /* 128 cpu SMP max */ 15#ifndef SN0XXL /* 128 cpu SMP max */
19/* 16/*
@@ -54,25 +51,16 @@
54 */ 51 */
55#define MAX_PARTITIONS MAX_REGIONS 52#define MAX_PARTITIONS MAX_REGIONS
56 53
57
58#else
59
60#define MAX_COMPACT_NODES 4
61#define MAX_NASIDS 4
62#define MAXCPUS 8
63
64#endif
65
66#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) 54#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8)
67 55
68/* 56/*
69 * Slot constants for SN0 57 * Slot constants for SN0
70 */ 58 */
71#ifdef CONFIG_SGI_SN0_N_MODE 59#ifdef CONFIG_SGI_SN_N_MODE
72#define MAX_MEM_SLOTS 16 /* max slots per node */ 60#define MAX_MEM_SLOTS 16 /* max slots per node */
73#else /* !CONFIG_SGI_SN0_N_MODE, assume M_MODE */ 61#else /* !CONFIG_SGI_SN_N_MODE, assume CONFIG_SGI_SN_M_MODE */
74#define MAX_MEM_SLOTS 32 /* max slots per node */ 62#define MAX_MEM_SLOTS 32 /* max slots per node */
75#endif /* defined(N_MODE) */ 63#endif /* CONFIG_SGI_SN_M_MODE */
76 64
77#define SLOT_SHIFT (27) 65#define SLOT_SHIFT (27)
78#define SLOT_MIN_MEM_SIZE (32*1024*1024) 66#define SLOT_MIN_MEM_SIZE (32*1024*1024)
diff --git a/include/asm-mips/sn/sn0/hub.h b/include/asm-mips/sn/sn0/hub.h
index f5dbba6f461..3e228f8e796 100644
--- a/include/asm-mips/sn/sn0/hub.h
+++ b/include/asm-mips/sn/sn0/hub.h
@@ -31,10 +31,6 @@
31#include <asm/sn/sn0/hubni.h> 31#include <asm/sn/sn0/hubni.h>
32//#include <asm/sn/sn0/hubcore.h> 32//#include <asm/sn/sn0/hubcore.h>
33 33
34#ifdef SABLE
35#define IP27_NO_HUBUART_INT 1
36#endif
37
38/* Translation of uncached attributes */ 34/* Translation of uncached attributes */
39#define UATTR_HSPEC 0 35#define UATTR_HSPEC 0
40#define UATTR_IO 1 36#define UATTR_IO 1
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h
index f314da21b97..ef91b336355 100644
--- a/include/asm-mips/sn/sn0/hubio.h
+++ b/include/asm-mips/sn/sn0/hubio.h
@@ -486,22 +486,6 @@ typedef union h1_icrba_u {
486#define ICRBN_A_CERR_SHFT 54 486#define ICRBN_A_CERR_SHFT 54
487#define ICRBN_A_ERR_MASK 0x3ff 487#define ICRBN_A_ERR_MASK 0x3ff
488 488
489#if 0 /* Disabled, this causes namespace polution and break allmodconfig */
490/*
491 * Easy access macros.
492 */
493#define a_error icrba_fields_s.error
494#define a_ecode icrba_fields_s.ecode
495#define a_lnetuce icrba_fields_s.lnetuce
496#define a_mark icrba_fields_s.mark
497#define a_xerr icrba_fields_s.xerr
498#define a_sidn icrba_fields_s.sidn
499#define a_tnum icrba_fields_s.tnum
500#define a_addr icrba_fields_s.addr
501#define a_valid icrba_fields_s.valid
502#define a_iow icrba_fields_s.iow
503#endif
504
505#endif /* !__ASSEMBLY__ */ 489#endif /* !__ASSEMBLY__ */
506 490
507#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ 491#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h
index a66def4e0ba..14c225d8066 100644
--- a/include/asm-mips/sn/sn0/hubmd.h
+++ b/include/asm-mips/sn/sn0/hubmd.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_SN0_HUBMD_H 11#ifndef _ASM_SN_SN0_HUBMD_H
12#define _ASM_SN_SN0_HUBMD_H 12#define _ASM_SN_SN0_HUBMD_H
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Hub Memory/Directory interface registers 16 * Hub Memory/Directory interface registers
@@ -92,7 +91,7 @@
92#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */ 91#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */
93#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */ 92#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */
94 93
95#ifdef CONFIG_SGI_SN0_N_MODE 94#ifdef CONFIG_SGI_SN_N_MODE
96#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */ 95#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */
97#else 96#else
98#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */ 97#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */
diff --git a/include/asm-mips/sn/sn0/hubpi.h b/include/asm-mips/sn/sn0/hubpi.h
index 355bba8552e..e39f5f9da04 100644
--- a/include/asm-mips/sn/sn0/hubpi.h
+++ b/include/asm-mips/sn/sn0/hubpi.h
@@ -398,24 +398,6 @@ typedef u64 rtc_time_t;
398 398
399/* PI_RT_FILTER_CTRL mask and shift definitions */ 399/* PI_RT_FILTER_CTRL mask and shift definitions */
400 400
401#if 0
402/*
403 * XXX - This register's definition has changed, but it's only implemented
404 * in Hub 2.
405 */
406#define PRFC_DROP_COUNT_SHFT 27
407#define PRFC_DROP_COUNT_MASK (UINT64_CAST 0x3ff << 27)
408#define PRFC_DROP_CTR_SHFT 18
409#define PRFC_DROP_CTR_MASK (UINT64_CAST 0x1ff << 18)
410#define PRFC_MASK_ENABLE_SHFT 10
411#define PRFC_MASK_ENABLE_MASK (UINT64_CAST 0x7f << 10)
412#define PRFC_MASK_CTR_SHFT 2
413#define PRFC_MASK_CTR_MASK (UINT64_CAST 0xff << 2)
414#define PRFC_OFFSET_SHFT 0
415#define PRFC_OFFSET_MASK (UINT64_CAST 3)
416#endif /* 0 */
417
418
419/* 401/*
420 * Bits for NACK_CNT_A/B and NACK_CMP 402 * Bits for NACK_CNT_A/B and NACK_CMP
421 */ 403 */
diff --git a/include/asm-mips/sn/sn0/ip27.h b/include/asm-mips/sn/sn0/ip27.h
index ade0e974dd7..3c97e0855c8 100644
--- a/include/asm-mips/sn/sn0/ip27.h
+++ b/include/asm-mips/sn/sn0/ip27.h
@@ -6,7 +6,7 @@
6 * Derived from IRIX <sys/SN/SN0/IP27.h>. 6 * Derived from IRIX <sys/SN/SN0/IP27.h>.
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle 9 * Copyright (C) 1999, 2006 by Ralf Baechle
10 */ 10 */
11#ifndef _ASM_SN_SN0_IP27_H 11#ifndef _ASM_SN_SN0_IP27_H
12#define _ASM_SN_SN0_IP27_H 12#define _ASM_SN_SN0_IP27_H
@@ -82,11 +82,4 @@
82#define SEND_NMI(_nasid, _slice) \ 82#define SEND_NMI(_nasid, _slice) \
83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1) 83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1)
84 84
85/* Sanity hazzard ... Below all the Origin hacks are following. */
86
87#define SN00_BRIDGE 0x9200000008000000
88#define SN00I_BRIDGE0 0x920000000b000000
89#define SN00I_BRIDGE1 0x920000000e000000
90#define SN00I_BRIDGE2 0x920000000f000000
91
92#endif /* _ASM_SN_SN0_IP27_H */ 85#endif /* _ASM_SN_SN0_IP27_H */
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h
index b3bc698dfde..b9ba54d0dd3 100644
--- a/include/asm-mips/sni.h
+++ b/include/asm-mips/sni.h
@@ -15,9 +15,6 @@
15/* 15/*
16 * ASIC PCI registers for little endian configuration. 16 * ASIC PCI registers for little endian configuration.
17 */ 17 */
18#ifndef __MIPSEL__
19#error "Fix me for big endian"
20#endif
21#define PCIMT_UCONF 0xbfff0000 18#define PCIMT_UCONF 0xbfff0000
22#define PCIMT_IOADTIMEOUT2 0xbfff0008 19#define PCIMT_IOADTIMEOUT2 0xbfff0008
23#define PCIMT_IOMEMCONF 0xbfff0010 20#define PCIMT_IOMEMCONF 0xbfff0010
@@ -51,9 +48,9 @@
51#define PCIMT_PCI_CONF 0xbfff0100 48#define PCIMT_PCI_CONF 0xbfff0100
52 49
53/* 50/*
54 * Data port for the PCI bus. 51 * Data port for the PCI bus in IO space
55 */ 52 */
56#define PCIMT_CONFIG_DATA 0xb4000cfc 53#define PCIMT_CONFIG_DATA 0x0cfc
57 54
58/* 55/*
59 * Board specific registers 56 * Board specific registers
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index 0bb31e5aaca..36ebe4e186a 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -69,6 +69,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
69#define SO_PEERSEC 30 69#define SO_PEERSEC 30
70#define SO_SNDBUFFORCE 31 70#define SO_SNDBUFFORCE 31
71#define SO_RCVBUFFORCE 33 71#define SO_RCVBUFFORCE 33
72#define SO_PASSSEC 34
72 73
73#ifdef __KERNEL__ 74#ifdef __KERNEL__
74 75
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h
new file mode 100644
index 00000000000..795ac6c2320
--- /dev/null
+++ b/include/asm-mips/sparsemem.h
@@ -0,0 +1,14 @@
1#ifndef _MIPS_SPARSEMEM_H
2#define _MIPS_SPARSEMEM_H
3#ifdef CONFIG_SPARSEMEM
4
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
8 */
9#define SECTION_SIZE_BITS 28
10#define MAX_PHYSMEM_BITS 35
11
12#endif /* CONFIG_SPARSEMEM */
13#endif /* _MIPS_SPARSEMEM_H */
14
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index c4856a87496..158a4cd12e4 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_STACKFRAME_H 10#ifndef _ASM_STACKFRAME_H
11#define _ASM_STACKFRAME_H 11#define _ASM_STACKFRAME_H
12 12
13#include <linux/config.h>
14#include <linux/threads.h> 13#include <linux/threads.h>
15 14
16#include <asm/asm.h> 15#include <asm/asm.h>
@@ -305,7 +304,7 @@
305 mfc0 v0, CP0_TCSTATUS 304 mfc0 v0, CP0_TCSTATUS
306 ori v0, TCSTATUS_IXMT 305 ori v0, TCSTATUS_IXMT
307 mtc0 v0, CP0_TCSTATUS 306 mtc0 v0, CP0_TCSTATUS
308 ehb 307 _ehb
309 DMT 5 # dmt a1 308 DMT 5 # dmt a1
310 jal mips_ihb 309 jal mips_ihb
311#endif /* CONFIG_MIPS_MT_SMTC */ 310#endif /* CONFIG_MIPS_MT_SMTC */
@@ -326,14 +325,14 @@
326 * restore TCStatus.IXMT. 325 * restore TCStatus.IXMT.
327 */ 326 */
328 LONG_L v1, PT_TCSTATUS(sp) 327 LONG_L v1, PT_TCSTATUS(sp)
329 ehb 328 _ehb
330 mfc0 v0, CP0_TCSTATUS 329 mfc0 v0, CP0_TCSTATUS
331 andi v1, TCSTATUS_IXMT 330 andi v1, TCSTATUS_IXMT
332 /* We know that TCStatua.IXMT should be set from above */ 331 /* We know that TCStatua.IXMT should be set from above */
333 xori v0, v0, TCSTATUS_IXMT 332 xori v0, v0, TCSTATUS_IXMT
334 or v0, v0, v1 333 or v0, v0, v1
335 mtc0 v0, CP0_TCSTATUS 334 mtc0 v0, CP0_TCSTATUS
336 ehb 335 _ehb
337 andi a1, a1, VPECONTROL_TE 336 andi a1, a1, VPECONTROL_TE
338 beqz a1, 1f 337 beqz a1, 1f
339 emt 338 emt
@@ -412,7 +411,7 @@
412 /* Clear TKSU, leave IXMT */ 411 /* Clear TKSU, leave IXMT */
413 xori t0, 0x00001800 412 xori t0, 0x00001800
414 mtc0 t0, CP0_TCSTATUS 413 mtc0 t0, CP0_TCSTATUS
415 ehb 414 _ehb
416 /* We need to leave the global IE bit set, but clear EXL...*/ 415 /* We need to leave the global IE bit set, but clear EXL...*/
417 mfc0 t0, CP0_STATUS 416 mfc0 t0, CP0_STATUS
418 ori t0, ST0_EXL | ST0_ERL 417 ori t0, ST0_EXL | ST0_ERL
@@ -439,7 +438,7 @@
439 * and enable interrupts only for the 438 * and enable interrupts only for the
440 * current TC, using the TCStatus register. 439 * current TC, using the TCStatus register.
441 */ 440 */
442 ehb 441 _ehb
443 mfc0 t0,CP0_TCSTATUS 442 mfc0 t0,CP0_TCSTATUS
444 /* Fortunately CU 0 is in the same place in both registers */ 443 /* Fortunately CU 0 is in the same place in both registers */
445 /* Set TCU0, TKSU (for later inversion) and IXMT */ 444 /* Set TCU0, TKSU (for later inversion) and IXMT */
@@ -448,7 +447,7 @@
448 /* Clear TKSU *and* IXMT */ 447 /* Clear TKSU *and* IXMT */
449 xori t0, 0x00001c00 448 xori t0, 0x00001c00
450 mtc0 t0, CP0_TCSTATUS 449 mtc0 t0, CP0_TCSTATUS
451 ehb 450 _ehb
452 /* We need to leave the global IE bit set, but clear EXL...*/ 451 /* We need to leave the global IE bit set, but clear EXL...*/
453 mfc0 t0, CP0_STATUS 452 mfc0 t0, CP0_STATUS
454 ori t0, ST0_EXL 453 ori t0, ST0_EXL
@@ -480,7 +479,7 @@
480 andi v1, v0, TCSTATUS_IXMT 479 andi v1, v0, TCSTATUS_IXMT
481 ori v0, TCSTATUS_IXMT 480 ori v0, TCSTATUS_IXMT
482 mtc0 v0, CP0_TCSTATUS 481 mtc0 v0, CP0_TCSTATUS
483 ehb 482 _ehb
484 DMT 2 # dmt v0 483 DMT 2 # dmt v0
485 /* 484 /*
486 * We don't know a priori if ra is "live" 485 * We don't know a priori if ra is "live"
@@ -496,7 +495,7 @@
496 xori t0, 0x1e 495 xori t0, 0x1e
497 mtc0 t0, CP0_STATUS 496 mtc0 t0, CP0_STATUS
498#ifdef CONFIG_MIPS_MT_SMTC 497#ifdef CONFIG_MIPS_MT_SMTC
499 ehb 498 _ehb
500 andi v0, v0, VPECONTROL_TE 499 andi v0, v0, VPECONTROL_TE
501 beqz v0, 2f 500 beqz v0, 2f
502 nop /* delay slot */ 501 nop /* delay slot */
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
index 907da600fdd..436e3ad352d 100644
--- a/include/asm-mips/string.h
+++ b/include/asm-mips/string.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_STRING_H 10#ifndef _ASM_STRING_H
11#define _ASM_STRING_H 11#define _ASM_STRING_H
12 12
13#include <linux/config.h>
14 13
15/* 14/*
16 * Most of the inline functions are rather naive implementations so I just 15 * Most of the inline functions are rather naive implementations so I just
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 261f71d16a0..dcb4701d572 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -12,15 +12,14 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/config.h>
16#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/irqflags.h>
17 17
18#include <asm/addrspace.h> 18#include <asm/addrspace.h>
19#include <asm/cpu-features.h> 19#include <asm/cpu-features.h>
20#include <asm/dsp.h> 20#include <asm/dsp.h>
21#include <asm/ptrace.h> 21#include <asm/ptrace.h>
22#include <asm/war.h> 22#include <asm/war.h>
23#include <asm/interrupt.h>
24 23
25/* 24/*
26 * read_barrier_depends - Flush all pending reads that subsequents reads 25 * read_barrier_depends - Flush all pending reads that subsequents reads
@@ -144,9 +143,6 @@
144#define set_mb(var, value) \ 143#define set_mb(var, value) \
145do { var = value; mb(); } while (0) 144do { var = value; mb(); } while (0)
146 145
147#define set_wmb(var, value) \
148do { var = value; wmb(); } while (0)
149
150/* 146/*
151 * switch_to(n) should switch tasks to task nr n, first 147 * switch_to(n) should switch tasks to task nr n, first
152 * checking that n isn't the current task, in which case it does nothing. 148 * checking that n isn't the current task, in which case it does nothing.
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index f8d97dafd2f..ae8ada5b42a 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -9,7 +9,6 @@
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/config.h>
13 12
14#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
15 14
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index d897c8bb554..2d543735668 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -83,11 +83,11 @@ extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
83/* 83/*
84 * board specific routines required by time_init(). 84 * board specific routines required by time_init().
85 * board_time_init is defaulted to NULL and can remain so. 85 * board_time_init is defaulted to NULL and can remain so.
86 * board_timer_setup must be setup properly in machine setup routine. 86 * plat_timer_setup must be setup properly in machine setup routine.
87 */ 87 */
88struct irqaction; 88struct irqaction;
89extern void (*board_time_init)(void); 89extern void (*board_time_init)(void);
90extern void (*board_timer_setup)(struct irqaction *irq); 90extern void plat_timer_setup(struct irqaction *irq);
91 91
92/* 92/*
93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible 93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
diff --git a/include/asm-mips/tlbflush.h b/include/asm-mips/tlbflush.h
index bb4ae3cdcbf..276be77c3e8 100644
--- a/include/asm-mips/tlbflush.h
+++ b/include/asm-mips/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_TLBFLUSH_H 1#ifndef __ASM_TLBFLUSH_H
2#define __ASM_TLBFLUSH_H 2#define __ASM_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
7/* 6/*
diff --git a/include/asm-mips/tx4927/toshiba_rbtx4927.h b/include/asm-mips/tx4927/toshiba_rbtx4927.h
index 6ce1e9475f9..94bef03d963 100644
--- a/include/asm-mips/tx4927/toshiba_rbtx4927.h
+++ b/include/asm-mips/tx4927/toshiba_rbtx4927.h
@@ -27,7 +27,6 @@
27#ifndef __ASM_TX4927_TOSHIBA_RBTX4927_H 27#ifndef __ASM_TX4927_TOSHIBA_RBTX4927_H
28#define __ASM_TX4927_TOSHIBA_RBTX4927_H 28#define __ASM_TX4927_TOSHIBA_RBTX4927_H
29 29
30#include <linux/config.h>
31#include <asm/tx4927/tx4927.h> 30#include <asm/tx4927/tx4927.h>
32#include <asm/tx4927/tx4927_mips.h> 31#include <asm/tx4927/tx4927_mips.h>
33#ifdef CONFIG_PCI 32#ifdef CONFIG_PCI
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index cd2813d8e13..2b52e180c6f 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -52,7 +52,6 @@ typedef unsigned long long __u64;
52 52
53#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
54 54
55#include <linux/config.h>
56 55
57typedef __signed char s8; 56typedef __signed char s8;
58typedef unsigned char u8; 57typedef unsigned char u8;
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index b96f3e0f393..1cdd4eeb2f7 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_UACCESS_H 9#ifndef _ASM_UACCESS_H
10#define _ASM_UACCESS_H 10#define _ASM_UACCESS_H
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/thread_info.h> 14#include <linux/thread_info.h>
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 1068fe9a0a5..610ccb8a50b 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -326,16 +326,19 @@
326#define __NR_unshare (__NR_Linux + 303) 326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304) 327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305) 328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
329 332
330/* 333/*
331 * Offset of the last Linux o32 flavoured syscall 334 * Offset of the last Linux o32 flavoured syscall
332 */ 335 */
333#define __NR_Linux_syscalls 305 336#define __NR_Linux_syscalls 308
334 337
335#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 338#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
336 339
337#define __NR_O32_Linux 4000 340#define __NR_O32_Linux 4000
338#define __NR_O32_Linux_syscalls 305 341#define __NR_O32_Linux_syscalls 308
339 342
340#if _MIPS_SIM == _MIPS_SIM_ABI64 343#if _MIPS_SIM == _MIPS_SIM_ABI64
341 344
@@ -608,16 +611,19 @@
608#define __NR_unshare (__NR_Linux + 262) 611#define __NR_unshare (__NR_Linux + 262)
609#define __NR_splice (__NR_Linux + 263) 612#define __NR_splice (__NR_Linux + 263)
610#define __NR_sync_file_range (__NR_Linux + 264) 613#define __NR_sync_file_range (__NR_Linux + 264)
614#define __NR_tee (__NR_Linux + 265)
615#define __NR_vmsplice (__NR_Linux + 266)
616#define __NR_move_pages (__NR_Linux + 267)
611 617
612/* 618/*
613 * Offset of the last Linux 64-bit flavoured syscall 619 * Offset of the last Linux 64-bit flavoured syscall
614 */ 620 */
615#define __NR_Linux_syscalls 264 621#define __NR_Linux_syscalls 267
616 622
617#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 623#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
618 624
619#define __NR_64_Linux 5000 625#define __NR_64_Linux 5000
620#define __NR_64_Linux_syscalls 264 626#define __NR_64_Linux_syscalls 267
621 627
622#if _MIPS_SIM == _MIPS_SIM_NABI32 628#if _MIPS_SIM == _MIPS_SIM_NABI32
623 629
@@ -894,16 +900,21 @@
894#define __NR_unshare (__NR_Linux + 266) 900#define __NR_unshare (__NR_Linux + 266)
895#define __NR_splice (__NR_Linux + 267) 901#define __NR_splice (__NR_Linux + 267)
896#define __NR_sync_file_range (__NR_Linux + 268) 902#define __NR_sync_file_range (__NR_Linux + 268)
903#define __NR_tee (__NR_Linux + 269)
904#define __NR_vmsplice (__NR_Linux + 270)
905#define __NR_move_pages (__NR_Linux + 271)
897 906
898/* 907/*
899 * Offset of the last N32 flavoured syscall 908 * Offset of the last N32 flavoured syscall
900 */ 909 */
901#define __NR_Linux_syscalls 268 910#define __NR_Linux_syscalls 271
902 911
903#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 912#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
904 913
905#define __NR_N32_Linux 6000 914#define __NR_N32_Linux 6000
906#define __NR_N32_Linux_syscalls 268 915#define __NR_N32_Linux_syscalls 271
916
917#ifdef __KERNEL__
907 918
908#ifndef __ASSEMBLY__ 919#ifndef __ASSEMBLY__
909 920
@@ -1168,9 +1179,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1168 1179
1169#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ 1180#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
1170 1181
1171#ifdef __KERNEL__
1172
1173#include <linux/config.h>
1174 1182
1175#define __ARCH_WANT_IPC_PARSE_VERSION 1183#define __ARCH_WANT_IPC_PARSE_VERSION
1176#define __ARCH_WANT_OLD_READDIR 1184#define __ARCH_WANT_OLD_READDIR
@@ -1197,7 +1205,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1197# ifdef CONFIG_MIPS32_O32 1205# ifdef CONFIG_MIPS32_O32
1198# define __ARCH_WANT_COMPAT_SYS_TIME 1206# define __ARCH_WANT_COMPAT_SYS_TIME
1199# endif 1207# endif
1200#endif
1201 1208
1202#ifdef __KERNEL_SYSCALLS__ 1209#ifdef __KERNEL_SYSCALLS__
1203 1210
@@ -1248,4 +1255,5 @@ asmlinkage long sys_rt_sigaction(int sig,
1248 */ 1255 */
1249#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") 1256#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
1250 1257
1258#endif /* __KERNEL__ */
1251#endif /* _ASM_UNISTD_H */ 1259#endif /* _ASM_UNISTD_H */
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index 34755c0a639..c1dd0b10bc2 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -13,7 +13,7 @@
13 * access the videoram directly without any black magic. 13 * access the videoram directly without any black magic.
14 */ 14 */
15 15
16#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) 16#define VGA_MAP_MEM(x,s) (0xb0000000L + (unsigned long)(x))
17 17
18#define vga_readb(x) (*(x)) 18#define vga_readb(x) (*(x))
19#define vga_writeb(x,y) (*(y) = (x)) 19#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h
index d10ffda50de..e0ee05a3dfc 100644
--- a/include/asm-mips/vr41xx/capcella.h
+++ b/include/asm-mips/vr41xx/capcella.h
@@ -20,7 +20,7 @@
20#ifndef __ZAO_CAPCELLA_H 20#ifndef __ZAO_CAPCELLA_H
21#define __ZAO_CAPCELLA_H 21#define __ZAO_CAPCELLA_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h
index 42af389019e..9490ade58b4 100644
--- a/include/asm-mips/vr41xx/cmbvr4133.h
+++ b/include/asm-mips/vr41xx/cmbvr4133.h
@@ -15,8 +15,7 @@
15#ifndef __NEC_CMBVR4133_H 15#ifndef __NEC_CMBVR4133_H
16#define __NEC_CMBVR4133_H 16#define __NEC_CMBVR4133_H
17 17
18#include <asm/addrspace.h> 18#include <asm/vr41xx/irq.h>
19#include <asm/vr41xx/vr41xx.h>
20 19
21/* 20/*
22 * General-Purpose I/O Pin Number 21 * General-Purpose I/O Pin Number
@@ -55,7 +54,4 @@
55#define IDE_SECONDARY_IRQ I8259_IRQ(15) 54#define IDE_SECONDARY_IRQ I8259_IRQ(15)
56#define I8259_IRQ_LAST IDE_SECONDARY_IRQ 55#define I8259_IRQ_LAST IDE_SECONDARY_IRQ
57 56
58#define RTC_PORT(x) (0xaf000100 + (x))
59#define RTC_IO_EXTENT 0x140
60
61#endif /* __NEC_CMBVR4133_H */ 57#endif /* __NEC_CMBVR4133_H */
diff --git a/include/asm-mips/vr41xx/e55.h b/include/asm-mips/vr41xx/e55.h
deleted file mode 100644
index 558f2269bf3..00000000000
--- a/include/asm-mips/vr41xx/e55.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __CASIO_E55_H
21#define __CASIO_E55_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x1400c000
34#define VR41XX_ISA_IO_SIZE 0x03ff4000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __CASIO_E55_H */
diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h
new file mode 100644
index 00000000000..d315dfbc08f
--- /dev/null
+++ b/include/asm-mips/vr41xx/irq.h
@@ -0,0 +1,101 @@
1/*
2 * include/asm-mips/vr41xx/irq.h
3 *
4 * Interrupt numbers for NEC VR4100 series.
5 *
6 * Copyright (C) 1999 Michael Klar
7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17#ifndef __NEC_VR41XX_IRQ_H
18#define __NEC_VR41XX_IRQ_H
19
20/*
21 * CPU core Interrupt Numbers
22 */
23#define MIPS_CPU_IRQ_BASE 0
24#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
25#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
26#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
27#define INT0_IRQ MIPS_CPU_IRQ(2)
28#define INT1_IRQ MIPS_CPU_IRQ(3)
29#define INT2_IRQ MIPS_CPU_IRQ(4)
30#define INT3_IRQ MIPS_CPU_IRQ(5)
31#define INT4_IRQ MIPS_CPU_IRQ(6)
32#define TIMER_IRQ MIPS_CPU_IRQ(7)
33
34/*
35 * SYINT1 Interrupt Numbers
36 */
37#define SYSINT1_IRQ_BASE 8
38#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
39#define BATTRY_IRQ SYSINT1_IRQ(0)
40#define POWER_IRQ SYSINT1_IRQ(1)
41#define RTCLONG1_IRQ SYSINT1_IRQ(2)
42#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
43/* RFU */
44#define PIU_IRQ SYSINT1_IRQ(5)
45#define AIU_IRQ SYSINT1_IRQ(6)
46#define KIU_IRQ SYSINT1_IRQ(7)
47#define GIUINT_IRQ SYSINT1_IRQ(8)
48#define SIU_IRQ SYSINT1_IRQ(9)
49#define BUSERR_IRQ SYSINT1_IRQ(10)
50#define SOFTINT_IRQ SYSINT1_IRQ(11)
51#define CLKRUN_IRQ SYSINT1_IRQ(12)
52#define DOZEPIU_IRQ SYSINT1_IRQ(13)
53#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
54
55/*
56 * SYSINT2 Interrupt Numbers
57 */
58#define SYSINT2_IRQ_BASE 24
59#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
60#define RTCLONG2_IRQ SYSINT2_IRQ(0)
61#define LED_IRQ SYSINT2_IRQ(1)
62#define HSP_IRQ SYSINT2_IRQ(2)
63#define TCLOCK_IRQ SYSINT2_IRQ(3)
64#define FIR_IRQ SYSINT2_IRQ(4)
65#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
66#define DSIU_IRQ SYSINT2_IRQ(5)
67#define PCI_IRQ SYSINT2_IRQ(6)
68#define SCU_IRQ SYSINT2_IRQ(7)
69#define CSI_IRQ SYSINT2_IRQ(8)
70#define BCU_IRQ SYSINT2_IRQ(9)
71#define ETHERNET_IRQ SYSINT2_IRQ(10)
72#define SYSINT2_IRQ_LAST ETHERNET_IRQ
73
74/*
75 * GIU Interrupt Numbers
76 */
77#define GIU_IRQ_BASE 40
78#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
79#define GIU_IRQ_LAST GIU_IRQ(31)
80
81/*
82 * VRC4173 Interrupt Numbers
83 */
84#define VRC4173_IRQ_BASE 72
85#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
86#define VRC4173_USB_IRQ VRC4173_IRQ(0)
87#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
88#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
89#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
90#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
91#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
92#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
93#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
94#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
95#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
96#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
97/* RFU */
98#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
99#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
100
101#endif /* __NEC_VR41XX_IRQ_H */
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h
index a6cbe4da666..1d67df843dc 100644
--- a/include/asm-mips/vr41xx/mpc30x.h
+++ b/include/asm-mips/vr41xx/mpc30x.h
@@ -20,7 +20,7 @@
20#ifndef __VICTOR_MPC30X_H 20#ifndef __VICTOR_MPC30X_H
21#define __VICTOR_MPC30X_H 21#define __VICTOR_MPC30X_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h
index b318b9612a8..dc981b4be0a 100644
--- a/include/asm-mips/vr41xx/tb0219.h
+++ b/include/asm-mips/vr41xx/tb0219.h
@@ -23,7 +23,7 @@
23#ifndef __TANBAC_TB0219_H 23#ifndef __TANBAC_TB0219_H
24#define __TANBAC_TB0219_H 24#define __TANBAC_TB0219_H
25 25
26#include <asm/vr41xx/vr41xx.h> 26#include <asm/vr41xx/irq.h>
27 27
28/* 28/*
29 * General-Purpose I/O Pin Number 29 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h
index 2513f450e2d..de527dcfa5f 100644
--- a/include/asm-mips/vr41xx/tb0226.h
+++ b/include/asm-mips/vr41xx/tb0226.h
@@ -20,7 +20,7 @@
20#ifndef __TANBAC_TB0226_H 20#ifndef __TANBAC_TB0226_H
21#define __TANBAC_TB0226_H 21#define __TANBAC_TB0226_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h
index dd9832313af..61bead68abf 100644
--- a/include/asm-mips/vr41xx/tb0287.h
+++ b/include/asm-mips/vr41xx/tb0287.h
@@ -22,7 +22,7 @@
22#ifndef __TANBAC_TB0287_H 22#ifndef __TANBAC_TB0287_H
23#define __TANBAC_TB0287_H 23#define __TANBAC_TB0287_H
24 24
25#include <asm/vr41xx/vr41xx.h> 25#include <asm/vr41xx/irq.h>
26 26
27/* 27/*
28 * General-Purpose I/O Pin Number 28 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 70828d5fae9..dd3eb3dc588 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -74,59 +74,6 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
74/* 74/*
75 * Interrupt Control Unit 75 * Interrupt Control Unit
76 */ 76 */
77/* CPU core Interrupt Numbers */
78#define MIPS_CPU_IRQ_BASE 0
79#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
80#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
81#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
82#define INT0_IRQ MIPS_CPU_IRQ(2)
83#define INT1_IRQ MIPS_CPU_IRQ(3)
84#define INT2_IRQ MIPS_CPU_IRQ(4)
85#define INT3_IRQ MIPS_CPU_IRQ(5)
86#define INT4_IRQ MIPS_CPU_IRQ(6)
87#define TIMER_IRQ MIPS_CPU_IRQ(7)
88
89/* SYINT1 Interrupt Numbers */
90#define SYSINT1_IRQ_BASE 8
91#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
92#define BATTRY_IRQ SYSINT1_IRQ(0)
93#define POWER_IRQ SYSINT1_IRQ(1)
94#define RTCLONG1_IRQ SYSINT1_IRQ(2)
95#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
96/* RFU */
97#define PIU_IRQ SYSINT1_IRQ(5)
98#define AIU_IRQ SYSINT1_IRQ(6)
99#define KIU_IRQ SYSINT1_IRQ(7)
100#define GIUINT_IRQ SYSINT1_IRQ(8)
101#define SIU_IRQ SYSINT1_IRQ(9)
102#define BUSERR_IRQ SYSINT1_IRQ(10)
103#define SOFTINT_IRQ SYSINT1_IRQ(11)
104#define CLKRUN_IRQ SYSINT1_IRQ(12)
105#define DOZEPIU_IRQ SYSINT1_IRQ(13)
106#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
107
108/* SYSINT2 Interrupt Numbers */
109#define SYSINT2_IRQ_BASE 24
110#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
111#define RTCLONG2_IRQ SYSINT2_IRQ(0)
112#define LED_IRQ SYSINT2_IRQ(1)
113#define HSP_IRQ SYSINT2_IRQ(2)
114#define TCLOCK_IRQ SYSINT2_IRQ(3)
115#define FIR_IRQ SYSINT2_IRQ(4)
116#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
117#define DSIU_IRQ SYSINT2_IRQ(5)
118#define PCI_IRQ SYSINT2_IRQ(6)
119#define SCU_IRQ SYSINT2_IRQ(7)
120#define CSI_IRQ SYSINT2_IRQ(8)
121#define BCU_IRQ SYSINT2_IRQ(9)
122#define ETHERNET_IRQ SYSINT2_IRQ(10)
123#define SYSINT2_IRQ_LAST ETHERNET_IRQ
124
125/* GIU Interrupt Numbers */
126#define GIU_IRQ_BASE 40
127#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
128#define GIU_IRQ_LAST GIU_IRQ(31)
129
130extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); 77extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
131extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); 78extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
132 79
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
deleted file mode 100644
index 4d41a9c091d..00000000000
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ /dev/null
@@ -1,222 +0,0 @@
1/*
2 * vrc4173.h, Include file for NEC VRC4173.
3 *
4 * Copyright (C) 2000 Michael R. McDonald
5 * Copyright (C) 2001-2003 Montavista Software Inc.
6 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7 * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
8 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __NEC_VRC4173_H
25#define __NEC_VRC4173_H
26
27#include <linux/config.h>
28#include <asm/io.h>
29
30/*
31 * Interrupt Number
32 */
33#define VRC4173_IRQ_BASE 72
34#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
35#define VRC4173_USB_IRQ VRC4173_IRQ(0)
36#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
37#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
38#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
39#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
40#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
41#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
42#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
43#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
44#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
45#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
46/* RFU */
47#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
48#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
49
50/*
51 * PCI I/O accesses
52 */
53#ifdef CONFIG_VRC4173
54
55extern unsigned long vrc4173_io_offset;
56
57#define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0)
58
59#define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port))
60#define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port))
61#define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port))
62#define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port))
63#define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port))
64#define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port))
65
66#define vrc4173_inb(port) inb(vrc4173_io_offset+(port))
67#define vrc4173_inw(port) inw(vrc4173_io_offset+(port))
68#define vrc4173_inl(port) inl(vrc4173_io_offset+(port))
69#define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port))
70#define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port))
71#define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port))
72
73#define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count))
74#define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count))
75#define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count))
76
77#define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count))
78#define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count))
79#define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count))
80
81#else
82
83#define set_vrc4173_io_offset(offset) do {} while (0)
84
85#define vrc4173_outb(val,port) do {} while (0)
86#define vrc4173_outw(val,port) do {} while (0)
87#define vrc4173_outl(val,port) do {} while (0)
88#define vrc4173_outb_p(val,port) do {} while (0)
89#define vrc4173_outw_p(val,port) do {} while (0)
90#define vrc4173_outl_p(val,port) do {} while (0)
91
92#define vrc4173_inb(port) 0
93#define vrc4173_inw(port) 0
94#define vrc4173_inl(port) 0
95#define vrc4173_inb_p(port) 0
96#define vrc4173_inw_p(port) 0
97#define vrc4173_inl_p(port) 0
98
99#define vrc4173_outsb(port,addr,count) do {} while (0)
100#define vrc4173_outsw(port,addr,count) do {} while (0)
101#define vrc4173_outsl(port,addr,count) do {} while (0)
102
103#define vrc4173_insb(port,addr,count) do {} while (0)
104#define vrc4173_insw(port,addr,count) do {} while (0)
105#define vrc4173_insl(port,addr,count) do {} while (0)
106
107#endif
108
109/*
110 * Clock Mask Unit
111 */
112typedef enum vrc4173_clock {
113 VRC4173_PIU_CLOCK,
114 VRC4173_KIU_CLOCK,
115 VRC4173_AIU_CLOCK,
116 VRC4173_PS2_CH1_CLOCK,
117 VRC4173_PS2_CH2_CLOCK,
118 VRC4173_USBU_PCI_CLOCK,
119 VRC4173_CARDU1_PCI_CLOCK,
120 VRC4173_CARDU2_PCI_CLOCK,
121 VRC4173_AC97U_PCI_CLOCK,
122 VRC4173_USBU_48MHz_CLOCK,
123 VRC4173_EXT_48MHz_CLOCK,
124 VRC4173_48MHz_CLOCK,
125} vrc4173_clock_t;
126
127#ifdef CONFIG_VRC4173
128
129extern void vrc4173_supply_clock(vrc4173_clock_t clock);
130extern void vrc4173_mask_clock(vrc4173_clock_t clock);
131
132#else
133
134static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {}
135static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {}
136
137#endif
138
139/*
140 * Interupt Control Unit
141 */
142
143#define VRC4173_PIUINT_COMMAND 0x0040
144#define VRC4173_PIUINT_DATA 0x0020
145#define VRC4173_PIUINT_PAGE1 0x0010
146#define VRC4173_PIUINT_PAGE0 0x0008
147#define VRC4173_PIUINT_DATALOST 0x0004
148#define VRC4173_PIUINT_STATUSCHANGE 0x0001
149
150#ifdef CONFIG_VRC4173
151
152extern void vrc4173_enable_piuint(uint16_t mask);
153extern void vrc4173_disable_piuint(uint16_t mask);
154
155#else
156
157static inline void vrc4173_enable_piuint(uint16_t mask) {}
158static inline void vrc4173_disable_piuint(uint16_t mask) {}
159
160#endif
161
162#define VRC4173_AIUINT_INPUT_DMAEND 0x0800
163#define VRC4173_AIUINT_INPUT_DMAHALT 0x0400
164#define VRC4173_AIUINT_INPUT_DATALOST 0x0200
165#define VRC4173_AIUINT_INPUT_DATA 0x0100
166#define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008
167#define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004
168#define VRC4173_AIUINT_OUTPUT_NODATA 0x0002
169
170#ifdef CONFIG_VRC4173
171
172extern void vrc4173_enable_aiuint(uint16_t mask);
173extern void vrc4173_disable_aiuint(uint16_t mask);
174
175#else
176
177static inline void vrc4173_enable_aiuint(uint16_t mask) {}
178static inline void vrc4173_disable_aiuint(uint16_t mask) {}
179
180#endif
181
182#define VRC4173_KIUINT_DATALOST 0x0004
183#define VRC4173_KIUINT_DATAREADY 0x0002
184#define VRC4173_KIUINT_SCAN 0x0001
185
186#ifdef CONFIG_VRC4173
187
188extern void vrc4173_enable_kiuint(uint16_t mask);
189extern void vrc4173_disable_kiuint(uint16_t mask);
190
191#else
192
193static inline void vrc4173_enable_kiuint(uint16_t mask) {}
194static inline void vrc4173_disable_kiuint(uint16_t mask) {}
195
196#endif
197
198/*
199 * General-Purpose I/O Unit
200 */
201typedef enum vrc4173_function {
202 PS2_CHANNEL1,
203 PS2_CHANNEL2,
204 TOUCHPANEL,
205 KEYBOARD_8SCANLINES,
206 KEYBOARD_10SCANLINES,
207 KEYBOARD_12SCANLINES,
208 GPIO_0_15PINS,
209 GPIO_16_20PINS,
210} vrc4173_function_t;
211
212#ifdef CONFIG_VRC4173
213
214extern void vrc4173_select_function(vrc4173_function_t function);
215
216#else
217
218static inline void vrc4173_select_function(vrc4173_function_t function) {}
219
220#endif
221
222#endif /* __NEC_VRC4173_H */
diff --git a/include/asm-mips/vr41xx/workpad.h b/include/asm-mips/vr41xx/workpad.h
deleted file mode 100644
index 6bfa9c009a9..00000000000
--- a/include/asm-mips/vr41xx/workpad.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * workpad.h, Include file for IBM WorkPad z50.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __IBM_WORKPAD_H
21#define __IBM_WORKPAD_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x15000000
34#define VR41XX_ISA_IO_SIZE 0x03000000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __IBM_WORKPAD_H */
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index ad374bd3f13..3ac146c019c 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_WAR_H 8#ifndef _ASM_WAR_H
9#define _ASM_WAR_H 9#define _ASM_WAR_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * Another R4600 erratum. Due to the lack of errata information the exact 13 * Another R4600 erratum. Due to the lack of errata information the exact
@@ -172,7 +171,8 @@
172 * On the RM9000 there is a problem which makes the CreateDirtyExclusive 171 * On the RM9000 there is a problem which makes the CreateDirtyExclusive
173 * cache operation unusable on SMP systems. 172 * cache operation unusable on SMP systems.
174 */ 173 */
175#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) 174#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) || \
175 defined(CONFIG_BASLER_EXCITE)
176#define RM9000_CDEX_SMP_WAR 1 176#define RM9000_CDEX_SMP_WAR 1
177#endif 177#endif
178 178
@@ -182,7 +182,7 @@
182 * being fetched may case spurious exceptions. 182 * being fetched may case spurious exceptions.
183 */ 183 */
184#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \ 184#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \
185 defined(CONFIG_PMC_YOSEMITE) 185 defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE)
186#define ICACHE_REFILLS_WORKAROUND_WAR 1 186#define ICACHE_REFILLS_WORKAROUND_WAR 1
187#endif 187#endif
188 188
diff --git a/include/asm-mips/wbflush.h b/include/asm-mips/wbflush.h
index c3bef50f37a..eadc0ac47e2 100644
--- a/include/asm-mips/wbflush.h
+++ b/include/asm-mips/wbflush.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_WBFLUSH_H 11#ifndef _ASM_WBFLUSH_H
12#define _ASM_WBFLUSH_H 12#define _ASM_WBFLUSH_H
13 13
14#include <linux/config.h>
15 14
16#ifdef CONFIG_CPU_HAS_WB 15#ifdef CONFIG_CPU_HAS_WB
17 16