Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101438
b: refs/heads/master
c: 7a2852e
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Bogendoerfer authored and Ralf Baechle committed Jul 15, 2008
1 parent 6c3558e commit 618e34d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3dd3de789630b9b1ac8f5175f1c21bbf1cca939
refs/heads/master: 7a2852e49fe2d19296812c0f0f833b0ee3043bbb
26 changes: 26 additions & 0 deletions trunk/arch/mips/sgi-ip22/ip22-mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,30 @@ void __init sgimc_init(void)
void __init prom_meminit(void) {}
void __init prom_free_prom_memory(void)
{
#ifdef CONFIG_SGI_IP28
u32 mconfig1;
unsigned long flags;
spinlock_t lock;

/*
* because ARCS accesses memory uncached we wait until ARCS
* isn't needed any longer, before we switch from slow to
* normal mode
*/
spin_lock_irqsave(&lock, flags);
mconfig1 = sgimc->mconfig1;
/* map ECC register */
sgimc->mconfig1 = (mconfig1 & 0xffff0000) | 0x2060;
iob();
/* switch to normal mode */
*(unsigned long *)PHYS_TO_XKSEG_UNCACHED(0x60000000) = 0;
iob();
/* reduce WR_COL */
sgimc->cmacc = (sgimc->cmacc & ~0xf) | 4;
iob();
/* restore old config */
sgimc->mconfig1 = mconfig1;
iob();
spin_unlock_irqrestore(&lock, flags);
#endif
}
14 changes: 14 additions & 0 deletions trunk/include/asm-mips/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,25 @@
#define fast_wmb() __sync()
#define fast_rmb() __sync()
#define fast_mb() __sync()
#ifdef CONFIG_SGI_IP28
#define fast_iob() \
__asm__ __volatile__( \
".set push\n\t" \
".set noreorder\n\t" \
"lw $0,%0\n\t" \
"sync\n\t" \
"lw $0,%0\n\t" \
".set pop" \
: /* no output */ \
: "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \
: "memory")
#else
#define fast_iob() \
do { \
__sync(); \
__fast_iob(); \
} while (0)
#endif

#ifdef CONFIG_CPU_HAS_WB

Expand Down

0 comments on commit 618e34d

Please sign in to comment.