Skip to content

Commit

Permalink
Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/spar…
Browse files Browse the repository at this point in the history
…c-2.6
  • Loading branch information
Linus Torvalds committed May 26, 2005
2 parents 3db602b + 4b463f7 commit bef9c55
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/sparc64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,17 @@ static void __init process_switch(char c)
/* Use PROM debug console. */
register_console(&prom_debug_console);
break;
case 'P':
/* Force UltraSPARC-III P-Cache on. */
if (tlb_type != cheetah) {
printk("BOOT: Ignoring P-Cache force option.\n");
break;
}
cheetah_pcache_forced_on = 1;
add_taint(TAINT_MACHINE_CHECK);
cheetah_enable_pcache();
break;

default:
printk("Unknown boot switch (-%c)\n", c);
break;
Expand Down
3 changes: 3 additions & 0 deletions arch/sparc64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ void __init smp_callin(void)

smp_setup_percpu_timer();

if (cheetah_pcache_forced_on)
cheetah_enable_pcache();

local_irq_enable();

calibrate_delay();
Expand Down
19 changes: 19 additions & 0 deletions arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,25 @@ asmlinkage void cee_log(unsigned long ce_status,
}
}

int cheetah_pcache_forced_on;

void cheetah_enable_pcache(void)
{
unsigned long dcr;

printk("CHEETAH: Enabling P-Cache on cpu %d.\n",
smp_processor_id());

__asm__ __volatile__("ldxa [%%g0] %1, %0"
: "=r" (dcr)
: "i" (ASI_DCU_CONTROL_REG));
dcr |= (DCU_PE | DCU_HPE | DCU_SPE | DCU_SL);
__asm__ __volatile__("stxa %0, [%%g0] %1\n\t"
"membar #Sync"
: /* no outputs */
: "r" (dcr), "i" (ASI_DCU_CONTROL_REG));
}

/* Cheetah error trap handling. */
static unsigned long ecache_flush_physbase;
static unsigned long ecache_flush_linesize;
Expand Down
3 changes: 3 additions & 0 deletions include/asm-sparc64/spitfire.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ enum ultra_tlb_layout {

extern enum ultra_tlb_layout tlb_type;

extern int cheetah_pcache_forced_on;
extern void cheetah_enable_pcache(void);

#define sparc64_highest_locked_tlbent() \
(tlb_type == spitfire ? \
SPITFIRE_HIGHEST_LOCKED_TLBENT : \
Expand Down

0 comments on commit bef9c55

Please sign in to comment.