Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189382
b: refs/heads/master
c: be97d75
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Apr 2, 2010
1 parent d0e6b1e commit f940e45
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5dd6ef5050c5012267e2b84f3d82ba85cdb5ca32
refs/heads/master: be97d758e5728099e95fe229866d5c6c900d3092
28 changes: 28 additions & 0 deletions trunk/arch/sh/mm/tlb-pteaex.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
__raw_writel(asid, MMU_ITLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT);
back_to_cached();
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
19 changes: 19 additions & 0 deletions trunk/arch/sh/mm/tlb-sh3.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,22 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
for (i = 0; i < ways; i++)
__raw_writel(data, addr + (i << 8));
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;

/*
* Flush all the TLB.
*
* Write to the MMU control register's bit:
* TF-bit for SH-3, TI-bit for SH-4.
* It's same position, bit #2.
*/
local_irq_save(flags);
status = __raw_readl(MMUCR);
status |= 0x04;
__raw_writel(status, MMUCR);
ctrl_barrier();
local_irq_restore(flags);
}
28 changes: 28 additions & 0 deletions trunk/arch/sh/mm/tlb-sh4.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
__raw_writel(data, addr);
back_to_cached();
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
28 changes: 0 additions & 28 deletions trunk/arch/sh/mm/tlbflush_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,3 @@ void local_flush_tlb_mm(struct mm_struct *mm)
local_irq_restore(flags);
}
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}

0 comments on commit f940e45

Please sign in to comment.