Skip to content

Commit a5f6ea2

Browse files
geertutorvalds
authored andcommitted
sh: prefix sh-specific "CCR" and "CCR2" by "SH_"
Commit bcf24e1 ("mmc: omap_hsmmc: use the generic config for omap2plus devices"), enabled the build for other platforms for compile testing. sh-allmodconfig now fails with: include/linux/omap-dma.h:171:8: error: expected identifier before numeric constant make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1 This happens because SuperH #defines "CCR", which is one of the enum values in include/linux/omap-dma.h. There's a similar issue with "CCR2" on sh2a. As "CCR" and "CCR2" are too generic names for global #defines, prefix them with "SH_" to fix this. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 15c34a7 commit a5f6ea2

11 files changed

Lines changed: 20 additions & 18 deletions

File tree

‎arch/sh/include/cpu-sh2/cpu/cache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define SH_CACHE_ASSOC 8
1919

2020
#if defined(CONFIG_CPU_SUBTYPE_SH7619)
21-
#define CCR 0xffffffec
21+
#define SH_CCR 0xffffffec
2222

2323
#define CCR_CACHE_CE 0x01 /* Cache enable */
2424
#define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */

‎arch/sh/include/cpu-sh2a/cpu/cache.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#define SH_CACHE_COMBINED 4
1818
#define SH_CACHE_ASSOC 8
1919

20-
#define CCR 0xfffc1000 /* CCR1 */
21-
#define CCR2 0xfffc1004
20+
#define SH_CCR 0xfffc1000 /* CCR1 */
21+
#define SH_CCR2 0xfffc1004
2222

2323
/*
2424
* Most of the SH-2A CCR1 definitions resemble the SH-4 ones. All others not

‎arch/sh/include/cpu-sh3/cpu/cache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define SH_CACHE_COMBINED 4
1818
#define SH_CACHE_ASSOC 8
1919

20-
#define CCR 0xffffffec /* Address of Cache Control Register */
20+
#define SH_CCR 0xffffffec /* Address of Cache Control Register */
2121

2222
#define CCR_CACHE_CE 0x01 /* Cache Enable */
2323
#define CCR_CACHE_WT 0x02 /* Write-Through (for P0,U0,P3) (else writeback) */

‎arch/sh/include/cpu-sh4/cpu/cache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define SH_CACHE_COMBINED 4
1818
#define SH_CACHE_ASSOC 8
1919

20-
#define CCR 0xff00001c /* Address of Cache Control Register */
20+
#define SH_CCR 0xff00001c /* Address of Cache Control Register */
2121
#define CCR_CACHE_OCE 0x0001 /* Operand Cache Enable */
2222
#define CCR_CACHE_WT 0x0002 /* Write-Through (for P0,U0,P3) (else writeback)*/
2323
#define CCR_CACHE_CB 0x0004 /* Copy-Back (for P1) (else writethrough) */

‎arch/sh/kernel/cpu/init.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void cache_init(void)
112112
unsigned long ccr, flags;
113113

114114
jump_to_uncached();
115-
ccr = __raw_readl(CCR);
115+
ccr = __raw_readl(SH_CCR);
116116

117117
/*
118118
* At this point we don't know whether the cache is enabled or not - a
@@ -189,7 +189,7 @@ static void cache_init(void)
189189

190190
l2_cache_init();
191191

192-
__raw_writel(flags, CCR);
192+
__raw_writel(flags, SH_CCR);
193193
back_to_cached();
194194
}
195195
#else

‎arch/sh/mm/cache-debugfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int cache_seq_show(struct seq_file *file, void *iter)
3636
*/
3737
jump_to_uncached();
3838

39-
ccr = __raw_readl(CCR);
39+
ccr = __raw_readl(SH_CCR);
4040
if ((ccr & CCR_CACHE_ENABLE) == 0) {
4141
back_to_cached();
4242

‎arch/sh/mm/cache-sh2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ static void sh2__flush_invalidate_region(void *start, int size)
6363
local_irq_save(flags);
6464
jump_to_uncached();
6565

66-
ccr = __raw_readl(CCR);
66+
ccr = __raw_readl(SH_CCR);
6767
ccr |= CCR_CACHE_INVALIDATE;
68-
__raw_writel(ccr, CCR);
68+
__raw_writel(ccr, SH_CCR);
6969

7070
back_to_cached();
7171
local_irq_restore(flags);

‎arch/sh/mm/cache-sh2a.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ static void sh2a__flush_invalidate_region(void *start, int size)
134134

135135
/* If there are too many pages then just blow the cache */
136136
if (((end - begin) >> PAGE_SHIFT) >= MAX_OCACHE_PAGES) {
137-
__raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
137+
__raw_writel(__raw_readl(SH_CCR) | CCR_OCACHE_INVALIDATE,
138+
SH_CCR);
138139
} else {
139140
for (v = begin; v < end; v += L1_CACHE_BYTES)
140141
sh2a_invalidate_line(CACHE_OC_ADDRESS_ARRAY, v);
@@ -167,7 +168,8 @@ static void sh2a_flush_icache_range(void *args)
167168
/* I-Cache invalidate */
168169
/* If there are too many pages then just blow the cache */
169170
if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) {
170-
__raw_writel(__raw_readl(CCR) | CCR_ICACHE_INVALIDATE, CCR);
171+
__raw_writel(__raw_readl(SH_CCR) | CCR_ICACHE_INVALIDATE,
172+
SH_CCR);
171173
} else {
172174
for (v = start; v < end; v += L1_CACHE_BYTES)
173175
sh2a_invalidate_line(CACHE_IC_ADDRESS_ARRAY, v);

‎arch/sh/mm/cache-sh4.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ static void flush_icache_all(void)
133133
jump_to_uncached();
134134

135135
/* Flush I-cache */
136-
ccr = __raw_readl(CCR);
136+
ccr = __raw_readl(SH_CCR);
137137
ccr |= CCR_CACHE_ICI;
138-
__raw_writel(ccr, CCR);
138+
__raw_writel(ccr, SH_CCR);
139139

140140
/*
141141
* back_to_cached() will take care of the barrier for us, don't add

‎arch/sh/mm/cache-shx3.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void __init shx3_cache_init(void)
1919
{
2020
unsigned int ccr;
2121

22-
ccr = __raw_readl(CCR);
22+
ccr = __raw_readl(SH_CCR);
2323

2424
/*
2525
* If we've got cache aliases, resolve them in hardware.
@@ -40,5 +40,5 @@ void __init shx3_cache_init(void)
4040
ccr |= CCR_CACHE_IBE;
4141
#endif
4242

43-
writel_uncached(ccr, CCR);
43+
writel_uncached(ccr, SH_CCR);
4444
}

0 commit comments

Comments
 (0)