Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183023
b: refs/heads/master
c: 424d6b1
h: refs/heads/master
i:
  183021: fbb9878
  183019: f48e48a
  183015: 7f34346
  183007: 03a2cd1
v: v3
  • Loading branch information
Santosh Shilimkar authored and Russell King committed Feb 15, 2010
1 parent 89455e8 commit f72cc7d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 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: ad187f956108e1c56b444706212bf08d84c0bee0
refs/heads/master: 424d6b145f863d012c540082d0c1afb5bb4dea48
36 changes: 26 additions & 10 deletions trunk/arch/arm/mm/cache-l2x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ static inline void cache_sync(void)
cache_wait(base + L2X0_CACHE_SYNC, 1);
}

static inline void l2x0_clean_line(unsigned long addr)
{
void __iomem *base = l2x0_base;
cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
writel(addr, base + L2X0_CLEAN_LINE_PA);
}

static inline void l2x0_inv_line(unsigned long addr)
{
void __iomem *base = l2x0_base;
cache_wait(base + L2X0_INV_LINE_PA, 1);
writel(addr, base + L2X0_INV_LINE_PA);
}

static inline void l2x0_flush_line(unsigned long addr)
{
void __iomem *base = l2x0_base;
cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
writel(addr, base + L2X0_CLEAN_INV_LINE_PA);
}

static inline void l2x0_inv_all(void)
{
unsigned long flags;
Expand All @@ -62,23 +83,20 @@ static void l2x0_inv_range(unsigned long start, unsigned long end)
spin_lock_irqsave(&l2x0_lock, flags);
if (start & (CACHE_LINE_SIZE - 1)) {
start &= ~(CACHE_LINE_SIZE - 1);
cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
writel(start, base + L2X0_CLEAN_INV_LINE_PA);
l2x0_flush_line(start);
start += CACHE_LINE_SIZE;
}

if (end & (CACHE_LINE_SIZE - 1)) {
end &= ~(CACHE_LINE_SIZE - 1);
cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
writel(end, base + L2X0_CLEAN_INV_LINE_PA);
l2x0_flush_line(end);
}

while (start < end) {
unsigned long blk_end = start + min(end - start, 4096UL);

while (start < blk_end) {
cache_wait(base + L2X0_INV_LINE_PA, 1);
writel(start, base + L2X0_INV_LINE_PA);
l2x0_inv_line(start);
start += CACHE_LINE_SIZE;
}

Expand All @@ -103,8 +121,7 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
unsigned long blk_end = start + min(end - start, 4096UL);

while (start < blk_end) {
cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
writel(start, base + L2X0_CLEAN_LINE_PA);
l2x0_clean_line(start);
start += CACHE_LINE_SIZE;
}

Expand All @@ -129,8 +146,7 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
unsigned long blk_end = start + min(end - start, 4096UL);

while (start < blk_end) {
cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
writel(start, base + L2X0_CLEAN_INV_LINE_PA);
l2x0_flush_line(start);
start += CACHE_LINE_SIZE;
}

Expand Down

0 comments on commit f72cc7d

Please sign in to comment.