Skip to content

Commit

Permalink
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-…
Browse files Browse the repository at this point in the history
…linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Treat R14000 like R10000.
  [MIPS] Remove EXPERIMENTAL from PAGE_SIZE_16KB
  [MIPS] Update/Fix instruction definitions
  [MIPS] DSP and MDMX share the same config flag bit.
  [MIPS] Fix deadlock on MP with cache aliases.
  [MIPS] Use generic STABS_DEBUG macro.
  [MIPS] Create consistency in "system type" selection.
  [MIPS] Use generic DWARF_DEBUG
  [MIPS] Fix kgdb exception handler from user mode.
  [MIPS] Update struct sigcontext member names
  [MIPS] Update/fix futex assembly
  [MIPS] Remove support for sysmips(2) SETNAME and MIPS_RDNVRAM operations.
  [MIPS] Fix detection and handling of the 74K processor.
  [MIPS] Add missing 34K processor IDs
  [MIPS] Fix marking buddy of pte global for MIPS32 w/36-bit physical address
  [MIPS] AU1xxx mips_timer_interrupt() fixes
  [MIPS] Fix typo
  • Loading branch information
Linus Torvalds committed May 31, 2006
2 parents 5cedae9 + 44d921b commit ba8f5ba
Show file tree
Hide file tree
Showing 23 changed files with 328 additions and 206 deletions.
96 changes: 47 additions & 49 deletions arch/mips/Kconfig

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions arch/mips/au1000/common/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

extern void set_debug_traps(void);
extern irq_cpustat_t irq_stat [NR_CPUS];
extern void mips_timer_interrupt(struct pt_regs *regs);

static void setup_local_irq(unsigned int irq, int type, int int_req);
static unsigned int startup_irq(unsigned int irq);
Expand Down
1 change: 1 addition & 0 deletions arch/mips/au1000/common/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void mips_timer_interrupt(struct pt_regs *regs)

null:
ack_r4ktimer(0);
irq_exit();
}

#ifdef CONFIG_PM
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ void output_sc_defines(void)
text("/* Linux sigcontext offsets. */");
offset("#define SC_REGS ", struct sigcontext, sc_regs);
offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs);
offset("#define SC_MDHI ", struct sigcontext, sc_hi);
offset("#define SC_MDLO ", struct sigcontext, sc_lo);
offset("#define SC_MDHI ", struct sigcontext, sc_mdhi);
offset("#define SC_MDLO ", struct sigcontext, sc_mdlo);
offset("#define SC_PC ", struct sigcontext, sc_pc);
offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr);
linefeed;
Expand Down
13 changes: 13 additions & 0 deletions arch/mips/kernel/cpu-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static inline void check_wait(void)
case CPU_24K:
case CPU_25KF:
case CPU_34K:
case CPU_74K:
case CPU_PR4450:
cpu_wait = r4k_wait;
printk(" available.\n");
Expand Down Expand Up @@ -432,6 +433,15 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
MIPS_CPU_LLSC;
c->tlbsize = 64;
break;
case PRID_IMP_R14000:
c->cputype = CPU_R14000;
c->isa_level = MIPS_CPU_ISA_IV;
c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
MIPS_CPU_FPU | MIPS_CPU_32FPR |
MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
MIPS_CPU_LLSC;
c->tlbsize = 64;
break;
}
}

Expand Down Expand Up @@ -593,6 +603,9 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
case PRID_IMP_34K:
c->cputype = CPU_34K;
break;
case PRID_IMP_74K:
c->cputype = CPU_74K;
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ FEXPORT(restore_all) # restore full frame
EMT
1:
mfc0 v1, CP0_TCSTATUS
/* We set IXMT above, XOR should cler it here */
/* We set IXMT above, XOR should clear it here */
xori v1, v1, TCSTATUS_IXMT
or v1, v0, v1
mtc0 v1, CP0_TCSTATUS
Expand Down
8 changes: 5 additions & 3 deletions arch/mips/kernel/gdb-low.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@
*/
mfc0 k0, CP0_CAUSE
andi k0, k0, 0x7c
add k1, k1, k0
PTR_L k0, saved_vectors(k1)
jr k0
#ifdef CONFIG_64BIT
dsll k0, k0, 1
#endif
PTR_L k1, saved_vectors(k0)
jr k1
nop
1:
move k0, sp
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/kernel/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static const char *cpu_name[] = {
[CPU_R8000] = "R8000",
[CPU_R10000] = "R10000",
[CPU_R12000] = "R12000",
[CPU_R14000] = "R14000",
[CPU_R4300] = "R4300",
[CPU_R4650] = "R4650",
[CPU_R4700] = "R4700",
Expand Down Expand Up @@ -74,6 +75,7 @@ static const char *cpu_name[] = {
[CPU_24K] = "MIPS 24K",
[CPU_25KF] = "MIPS 25Kf",
[CPU_34K] = "MIPS 34K",
[CPU_74K] = "MIPS 74K",
[CPU_VR4111] = "NEC VR4111",
[CPU_VR4121] = "NEC VR4121",
[CPU_VR4122] = "NEC VR4122",
Expand Down
30 changes: 0 additions & 30 deletions arch/mips/kernel/signal-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
save_gp_reg(31);
#undef save_gp_reg

#ifdef CONFIG_32BIT
err |= __put_user(regs->hi, &sc->sc_mdhi);
err |= __put_user(regs->lo, &sc->sc_mdlo);
if (cpu_has_dsp) {
Expand All @@ -43,20 +42,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
err |= __put_user(mflo3(), &sc->sc_lo3);
err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
}
#endif
#ifdef CONFIG_64BIT
err |= __put_user(regs->hi, &sc->sc_hi[0]);
err |= __put_user(regs->lo, &sc->sc_lo[0]);
if (cpu_has_dsp) {
err |= __put_user(mfhi1(), &sc->sc_hi[1]);
err |= __put_user(mflo1(), &sc->sc_lo[1]);
err |= __put_user(mfhi2(), &sc->sc_hi[2]);
err |= __put_user(mflo2(), &sc->sc_lo[2]);
err |= __put_user(mfhi3(), &sc->sc_hi[3]);
err |= __put_user(mflo3(), &sc->sc_lo[3]);
err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
}
#endif

err |= __put_user(!!used_math(), &sc->sc_used_math);

Expand Down Expand Up @@ -92,7 +77,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
current_thread_info()->restart_block.fn = do_no_restart_syscall;

err |= __get_user(regs->cp0_epc, &sc->sc_pc);
#ifdef CONFIG_32BIT
err |= __get_user(regs->hi, &sc->sc_mdhi);
err |= __get_user(regs->lo, &sc->sc_mdlo);
if (cpu_has_dsp) {
Expand All @@ -104,20 +88,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
}
#endif
#ifdef CONFIG_64BIT
err |= __get_user(regs->hi, &sc->sc_hi[0]);
err |= __get_user(regs->lo, &sc->sc_lo[0]);
if (cpu_has_dsp) {
err |= __get_user(treg, &sc->sc_hi[1]); mthi1(treg);
err |= __get_user(treg, &sc->sc_lo[1]); mthi1(treg);
err |= __get_user(treg, &sc->sc_hi[2]); mthi2(treg);
err |= __get_user(treg, &sc->sc_lo[2]); mthi2(treg);
err |= __get_user(treg, &sc->sc_hi[3]); mthi3(treg);
err |= __get_user(treg, &sc->sc_lo[3]); mthi3(treg);
err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
}
#endif

#define restore_gp_reg(i) do { \
err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \
Expand Down
24 changes: 0 additions & 24 deletions arch/mips/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,27 +280,6 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
char __user *name;

switch(cmd) {
case SETNAME: {
char nodename[__NEW_UTS_LEN + 1];

if (!capable(CAP_SYS_ADMIN))
return -EPERM;

name = (char __user *) arg1;

len = strncpy_from_user(nodename, name, __NEW_UTS_LEN);
if (len < 0)
return -EFAULT;

down_write(&uts_sem);
strncpy(system_utsname.nodename, nodename, len);
nodename[__NEW_UTS_LEN] = '\0';
strlcpy(system_utsname.nodename, nodename,
sizeof(system_utsname.nodename));
up_write(&uts_sem);
return 0;
}

case MIPS_ATOMIC_SET:
printk(KERN_CRIT "How did I get here?\n");
return -EINVAL;
Expand All @@ -313,9 +292,6 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
case FLUSH_CACHE:
__flush_cache_all();
return 0;

case MIPS_RDNVRAM:
return -EIO;
}

return -EINVAL;
Expand Down
1 change: 1 addition & 0 deletions arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ static inline void parity_protection_init(void)
{
switch (current_cpu_data.cputype) {
case CPU_24K:
case CPU_34K:
case CPU_5KC:
write_c0_ecc(0x80000000);
back_to_back_c0_hazard();
Expand Down
20 changes: 5 additions & 15 deletions arch/mips/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,13 @@ SECTIONS

/* This is the MIPS specific mdebug section. */
.mdebug : { *(.mdebug) }
/* These are needed for ELF backends which have not yet been
converted to the new style linker. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
/* DWARF debug sections.
Symbols in the .debug DWARF section are relative to the beginning of the
section so we begin .debug at 0. It's not clear yet what needs to happen
for the others. */
.debug 0 : { *(.debug) }
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_sfnames 0 : { *(.debug_sfnames) }
.line 0 : { *(.line) }

STABS_DEBUG

DWARF_DEBUG

/* These must appear regardless of . */
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
.comment : { *(.comment) }
.note : { *(.note) }
}
44 changes: 35 additions & 9 deletions arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@
#include <asm/war.h>
#include <asm/cacheflush.h> /* for run_uncached() */


/*
* Special Variant of smp_call_function for use by cache functions:
*
* o No return value
* o collapses to normal function call on UP kernels
* o collapses to normal function call on systems with a single shared
* primary cache.
*/
static inline void r4k_on_each_cpu(void (*func) (void *info), void *info,
int retry, int wait)
{
preempt_disable();

#if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC)
smp_call_function(func, info, retry, wait);
#endif
func(info);
preempt_enable();
}

/*
* Must die.
*/
Expand Down Expand Up @@ -299,7 +320,7 @@ static void r4k_flush_cache_all(void)
if (!cpu_has_dc_aliases)
return;

on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1);
r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1);
}

static inline void local_r4k___flush_cache_all(void * args)
Expand All @@ -314,13 +335,14 @@ static inline void local_r4k___flush_cache_all(void * args)
case CPU_R4400MC:
case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
r4k_blast_scache();
}
}

static void r4k___flush_cache_all(void)
{
on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
}

static inline void local_r4k_flush_cache_range(void * args)
Expand All @@ -341,7 +363,7 @@ static inline void local_r4k_flush_cache_range(void * args)
static void r4k_flush_cache_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
}

static inline void local_r4k_flush_cache_mm(void * args)
Expand Down Expand Up @@ -370,7 +392,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
if (!cpu_has_dc_aliases)
return;

on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1);
r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1);
}

struct flush_cache_page_args {
Expand Down Expand Up @@ -461,7 +483,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
args.addr = addr;
args.pfn = pfn;

on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
r4k_on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
}

static inline void local_r4k_flush_data_cache_page(void * addr)
Expand All @@ -471,7 +493,7 @@ static inline void local_r4k_flush_data_cache_page(void * addr)

static void r4k_flush_data_cache_page(unsigned long addr)
{
on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1);
r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1);
}

struct flush_icache_range_args {
Expand Down Expand Up @@ -514,7 +536,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
args.start = start;
args.end = end;

on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
instruction_hazard();
}

Expand Down Expand Up @@ -590,7 +612,7 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma,
args.vma = vma;
args.page = page;

on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1);
r4k_on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1);
}


Expand Down Expand Up @@ -689,7 +711,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg)

static void r4k_flush_cache_sigtramp(unsigned long addr)
{
on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1);
r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1);
}

static void r4k_flush_icache_all(void)
Expand Down Expand Up @@ -812,6 +834,7 @@ static void __init probe_pcache(void)

case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29));
c->icache.linesz = 64;
c->icache.ways = 2;
Expand Down Expand Up @@ -965,9 +988,11 @@ static void __init probe_pcache(void)
c->dcache.flags |= MIPS_CACHE_PINDEX;
case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
case CPU_SB1:
break;
case CPU_24K:
case CPU_34K:
if (!(read_c0_config7() & (1 << 16)))
default:
if (c->dcache.waysize > PAGE_SIZE)
Expand Down Expand Up @@ -1091,6 +1116,7 @@ static void __init setup_scache(void)

case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16);
c->scache.linesz = 64 << ((config >> 13) & 1);
c->scache.ways = 2;
Expand Down
1 change: 1 addition & 0 deletions arch/mips/mm/pg-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ void __init build_clear_page(void)

case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
pref_src_mode = Pref_LoadStreamed;
pref_dst_mode = Pref_StoreStreamed;
break;
Expand Down
Loading

0 comments on commit ba8f5ba

Please sign in to comment.