sh: Mass ctrl_in/outX to __raw_read/writeX conversion.
The old ctrl in/out routines are non-portable and unsuitable for cross-platform use. While drivers/sh has already been sanitized, there is still quite a lot of code that is not. This converts the arch/sh/ bits over, which permits us to flag the routines as deprecated whilst still building with -Werror for the architecture code, and to ensure that future users are not added. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
@@ -32,10 +32,10 @@ static void sh2a__flush_wback_region(void *start, int size)
|
||||
unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0);
|
||||
int way;
|
||||
for (way = 0; way < 4; way++) {
|
||||
unsigned long data = ctrl_inl(addr | (way << 11));
|
||||
unsigned long data = __raw_readl(addr | (way << 11));
|
||||
if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
|
||||
data &= ~SH_CACHE_UPDATED;
|
||||
ctrl_outl(data, addr | (way << 11));
|
||||
__raw_writel(data, addr | (way << 11));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ static void sh2a__flush_purge_region(void *start, int size)
|
||||
jump_to_uncached();
|
||||
|
||||
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
||||
ctrl_outl((v & CACHE_PHYSADDR_MASK),
|
||||
__raw_writel((v & CACHE_PHYSADDR_MASK),
|
||||
CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
|
||||
}
|
||||
back_to_cached();
|
||||
@@ -78,17 +78,17 @@ static void sh2a__flush_invalidate_region(void *start, int size)
|
||||
jump_to_uncached();
|
||||
|
||||
#ifdef CONFIG_CACHE_WRITEBACK
|
||||
ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
|
||||
__raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
|
||||
/* I-cache invalidate */
|
||||
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
||||
ctrl_outl((v & CACHE_PHYSADDR_MASK),
|
||||
__raw_writel((v & CACHE_PHYSADDR_MASK),
|
||||
CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
|
||||
}
|
||||
#else
|
||||
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
||||
ctrl_outl((v & CACHE_PHYSADDR_MASK),
|
||||
__raw_writel((v & CACHE_PHYSADDR_MASK),
|
||||
CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
|
||||
ctrl_outl((v & CACHE_PHYSADDR_MASK),
|
||||
__raw_writel((v & CACHE_PHYSADDR_MASK),
|
||||
CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
|
||||
}
|
||||
#endif
|
||||
@@ -115,14 +115,14 @@ static void sh2a_flush_icache_range(void *args)
|
||||
int way;
|
||||
/* O-Cache writeback */
|
||||
for (way = 0; way < 4; way++) {
|
||||
unsigned long data = ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
|
||||
unsigned long data = __raw_readl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
|
||||
if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
|
||||
data &= ~SH_CACHE_UPDATED;
|
||||
ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
|
||||
__raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
|
||||
}
|
||||
}
|
||||
/* I-Cache invalidate */
|
||||
ctrl_outl(addr,
|
||||
__raw_writel(addr,
|
||||
CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user