1717
1818static inline void __enable_icache_msr (void )
1919{
20- __asm__ __volatile__ (" msrset r0, %0; \
21- nop; " \
20+ __asm__ __volatile__ (" msrset r0, %0;" \
21+ " nop;" \
2222 : : "i" (MSR_ICE ) : "memory" );
2323}
2424
2525static inline void __disable_icache_msr (void )
2626{
27- __asm__ __volatile__ (" msrclr r0, %0; \
28- nop; " \
27+ __asm__ __volatile__ (" msrclr r0, %0;" \
28+ " nop;" \
2929 : : "i" (MSR_ICE ) : "memory" );
3030}
3131
3232static inline void __enable_dcache_msr (void )
3333{
34- __asm__ __volatile__ (" msrset r0, %0; \
35- nop; " \
36- : \
37- : "i" (MSR_DCE ) \
38- : "memory" );
34+ __asm__ __volatile__ (" msrset r0, %0;" \
35+ "nop;" \
36+ : : "i" (MSR_DCE ) : "memory" );
3937}
4038
4139static inline void __disable_dcache_msr (void )
4240{
43- __asm__ __volatile__ (" msrclr r0, %0; \
44- nop; " \
45- : \
46- : "i" (MSR_DCE ) \
47- : "memory" );
41+ __asm__ __volatile__ (" msrclr r0, %0;" \
42+ "nop; " \
43+ : : "i" (MSR_DCE ) : "memory" );
4844}
4945
5046static inline void __enable_icache_nomsr (void )
5147{
52- __asm__ __volatile__ (" mfs r12, rmsr; \
53- nop; \
54- ori r12, r12, %0; \
55- mts rmsr, r12; \
56- nop; " \
57- : \
58- : "i" (MSR_ICE ) \
59- : "memory" , "r12" );
48+ __asm__ __volatile__ (" mfs r12, rmsr;" \
49+ "nop;" \
50+ "ori r12, r12, %0;" \
51+ "mts rmsr, r12;" \
52+ "nop;" \
53+ : : "i" (MSR_ICE ) : "memory" , "r12" );
6054}
6155
6256static inline void __disable_icache_nomsr (void )
6357{
64- __asm__ __volatile__ (" mfs r12, rmsr; \
65- nop; \
66- andi r12, r12, ~%0; \
67- mts rmsr, r12; \
68- nop; " \
69- : \
70- : "i" (MSR_ICE ) \
71- : "memory" , "r12" );
58+ __asm__ __volatile__ (" mfs r12, rmsr;" \
59+ "nop;" \
60+ "andi r12, r12, ~%0;" \
61+ "mts rmsr, r12;" \
62+ "nop;" \
63+ : : "i" (MSR_ICE ) : "memory" , "r12" );
7264}
7365
7466static inline void __enable_dcache_nomsr (void )
7567{
76- __asm__ __volatile__ (" mfs r12, rmsr; \
77- nop; \
78- ori r12, r12, %0; \
79- mts rmsr, r12; \
80- nop; " \
81- : \
82- : "i" (MSR_DCE ) \
83- : "memory" , "r12" );
68+ __asm__ __volatile__ (" mfs r12, rmsr;" \
69+ "nop;" \
70+ "ori r12, r12, %0;" \
71+ "mts rmsr, r12;" \
72+ "nop;" \
73+ : : "i" (MSR_DCE ) : "memory" , "r12" );
8474}
8575
8676static inline void __disable_dcache_nomsr (void )
8777{
88- __asm__ __volatile__ (" mfs r12, rmsr; \
89- nop; \
90- andi r12, r12, ~%0; \
91- mts rmsr, r12; \
92- nop; " \
93- : \
94- : "i" (MSR_DCE ) \
95- : "memory" , "r12" );
78+ __asm__ __volatile__ (" mfs r12, rmsr;" \
79+ "nop;" \
80+ "andi r12, r12, ~%0;" \
81+ "mts rmsr, r12;" \
82+ "nop;" \
83+ : : "i" (MSR_DCE ) : "memory" , "r12" );
9684}
9785
9886
@@ -106,7 +94,7 @@ do { \
10694 int align = ~(cache_line_length - 1); \
10795 end = min(start + cache_size, end); \
10896 start &= align; \
109- } while (0);
97+ } while (0)
11098
11199/*
112100 * Helper macro to loop over the specified cache_size/line_length and
@@ -118,12 +106,12 @@ do { \
118106 int step = -line_length; \
119107 WARN_ON(step >= 0); \
120108 \
121- __asm__ __volatile__ (" 1: " #op " %0, r0; \
122- bgtid %0, 1b; \
123- addk %0, %0, %1; \
124- " : : "r" (len), "r" (step) \
109+ __asm__ __volatile__ (" 1: " #op " %0, r0;" \
110+ " bgtid %0, 1b;" \
111+ " addk %0, %0, %1;" \
112+ : : "r" (len), "r" (step) \
125113 : "memory"); \
126- } while (0);
114+ } while (0)
127115
128116/* Used for wdc.flush/clear which can use rB for offset which is not possible
129117 * to use for simple wdc or wic.
@@ -142,12 +130,12 @@ do { \
142130 count = end - start; \
143131 WARN_ON(count < 0); \
144132 \
145- __asm__ __volatile__ (" 1: " #op " %0, %1; \
146- bgtid %1, 1b; \
147- addk %1, %1, %2; \
148- " : : "r" (start), "r" (count), \
133+ __asm__ __volatile__ (" 1: " #op " %0, %1;" \
134+ " bgtid %1, 1b;" \
135+ " addk %1, %1, %2;" \
136+ : : "r" (start), "r" (count), \
149137 "r" (step) : "memory"); \
150- } while (0);
138+ } while (0)
151139
152140/* It is used only first parameter for OP - for wic, wdc */
153141#define CACHE_RANGE_LOOP_1 (start , end , line_length , op ) \
@@ -157,13 +145,13 @@ do { \
157145 end = ((end & align) == end) ? end - line_length : end & align; \
158146 WARN_ON(end - start < 0); \
159147 \
160- __asm__ __volatile__ (" 1: " #op " %1, r0; \
161- cmpu %0, %1, %2; \
162- bgtid %0, 1b; \
163- addk %1, %1, %3; \
164- " : : "r" (temp), "r" (start), "r" (end),\
148+ __asm__ __volatile__ (" 1: " #op " %1, r0;" \
149+ " cmpu %0, %1, %2;" \
150+ " bgtid %0, 1b;" \
151+ " addk %1, %1, %3;" \
152+ : : "r" (temp), "r" (start), "r" (end), \
165153 "r" (line_length) : "memory"); \
166- } while (0);
154+ } while (0)
167155
168156#define ASM_LOOP
169157
@@ -352,7 +340,7 @@ static void __invalidate_dcache_all_noirq_wt(void)
352340#endif
353341 pr_debug ("%s\n" , __func__ );
354342#ifdef ASM_LOOP
355- CACHE_ALL_LOOP (cpuinfo .dcache_size , cpuinfo .dcache_line_length , wdc )
343+ CACHE_ALL_LOOP (cpuinfo .dcache_size , cpuinfo .dcache_line_length , wdc );
356344#else
357345 for (i = 0 ; i < cpuinfo .dcache_size ;
358346 i += cpuinfo .dcache_line_length )
@@ -361,7 +349,8 @@ static void __invalidate_dcache_all_noirq_wt(void)
361349#endif
362350}
363351
364- /* FIXME It is blindly invalidation as is expected
352+ /*
353+ * FIXME It is blindly invalidation as is expected
365354 * but can't be called on noMMU in microblaze_cache_init below
366355 *
367356 * MS: noMMU kernel won't boot if simple wdc is used
@@ -375,7 +364,7 @@ static void __invalidate_dcache_all_wb(void)
375364 pr_debug ("%s\n" , __func__ );
376365#ifdef ASM_LOOP
377366 CACHE_ALL_LOOP (cpuinfo .dcache_size , cpuinfo .dcache_line_length ,
378- wdc )
367+ wdc );
379368#else
380369 for (i = 0 ; i < cpuinfo .dcache_size ;
381370 i += cpuinfo .dcache_line_length )
@@ -616,49 +605,48 @@ static const struct scache wt_nomsr_noirq = {
616605#define CPUVER_7_20_A 0x0c
617606#define CPUVER_7_20_D 0x0f
618607
619- #define INFO (s ) printk(KERN_INFO "cache: " s "\n");
620-
621608void microblaze_cache_init (void )
622609{
623610 if (cpuinfo .use_instr & PVR2_USE_MSR_INSTR ) {
624611 if (cpuinfo .dcache_wb ) {
625- INFO ("wb_msr" );
612+ pr_info ("wb_msr\n " );
626613 mbc = (struct scache * )& wb_msr ;
627614 if (cpuinfo .ver_code <= CPUVER_7_20_D ) {
628615 /* MS: problem with signal handling - hw bug */
629- INFO ("WB won't work properly" );
616+ pr_info ("WB won't work properly\n " );
630617 }
631618 } else {
632619 if (cpuinfo .ver_code >= CPUVER_7_20_A ) {
633- INFO ("wt_msr_noirq" );
620+ pr_info ("wt_msr_noirq\n " );
634621 mbc = (struct scache * )& wt_msr_noirq ;
635622 } else {
636- INFO ("wt_msr" );
623+ pr_info ("wt_msr\n " );
637624 mbc = (struct scache * )& wt_msr ;
638625 }
639626 }
640627 } else {
641628 if (cpuinfo .dcache_wb ) {
642- INFO ("wb_nomsr" );
629+ pr_info ("wb_nomsr\n " );
643630 mbc = (struct scache * )& wb_nomsr ;
644631 if (cpuinfo .ver_code <= CPUVER_7_20_D ) {
645632 /* MS: problem with signal handling - hw bug */
646- INFO ("WB won't work properly" );
633+ pr_info ("WB won't work properly\n " );
647634 }
648635 } else {
649636 if (cpuinfo .ver_code >= CPUVER_7_20_A ) {
650- INFO ("wt_nomsr_noirq" );
637+ pr_info ("wt_nomsr_noirq\n " );
651638 mbc = (struct scache * )& wt_nomsr_noirq ;
652639 } else {
653- INFO ("wt_nomsr" );
640+ pr_info ("wt_nomsr\n " );
654641 mbc = (struct scache * )& wt_nomsr ;
655642 }
656643 }
657644 }
658- /* FIXME Invalidation is done in U-BOOT
659- * WT cache: Data is already written to main memory
660- * WB cache: Discard data on noMMU which caused that kernel doesn't boot
661- */
645+ /*
646+ * FIXME Invalidation is done in U-BOOT
647+ * WT cache: Data is already written to main memory
648+ * WB cache: Discard data on noMMU which caused that kernel doesn't boot
649+ */
662650 /* invalidate_dcache(); */
663651 enable_dcache ();
664652
0 commit comments