@@ -115,16 +115,16 @@ static void print_cpuinfo(void)
115
115
116
116
if (upr & SPR_UPR_DCP )
117
117
printk (KERN_INFO
118
- "-- dcache: %4d bytes total, %2d bytes/line, %d way(s)\n" ,
119
- cpuinfo -> dcache_size , cpuinfo -> dcache_block_size ,
120
- cpuinfo -> dcache_ways );
118
+ "-- dcache: %4d bytes total, %2d bytes/line, %d set(s), %d way(s)\n" ,
119
+ cpuinfo -> dcache . size , cpuinfo -> dcache . block_size ,
120
+ cpuinfo -> dcache . sets , cpuinfo -> dcache . ways );
121
121
else
122
122
printk (KERN_INFO "-- dcache disabled\n" );
123
123
if (upr & SPR_UPR_ICP )
124
124
printk (KERN_INFO
125
- "-- icache: %4d bytes total, %2d bytes/line, %d way(s)\n" ,
126
- cpuinfo -> icache_size , cpuinfo -> icache_block_size ,
127
- cpuinfo -> icache_ways );
125
+ "-- icache: %4d bytes total, %2d bytes/line, %d set(s), %d way(s)\n" ,
126
+ cpuinfo -> icache . size , cpuinfo -> icache . block_size ,
127
+ cpuinfo -> icache . sets , cpuinfo -> icache . ways );
128
128
else
129
129
printk (KERN_INFO "-- icache disabled\n" );
130
130
@@ -156,7 +156,6 @@ void __init setup_cpuinfo(void)
156
156
{
157
157
struct device_node * cpu ;
158
158
unsigned long iccfgr , dccfgr ;
159
- unsigned long cache_set_size ;
160
159
int cpu_id = smp_processor_id ();
161
160
struct cpuinfo_or1k * cpuinfo = & cpuinfo_or1k [cpu_id ];
162
161
@@ -165,18 +164,18 @@ void __init setup_cpuinfo(void)
165
164
panic ("Couldn't find CPU%d in device tree...\n" , cpu_id );
166
165
167
166
iccfgr = mfspr (SPR_ICCFGR );
168
- cpuinfo -> icache_ways = 1 << (iccfgr & SPR_ICCFGR_NCW );
169
- cache_set_size = 1 << ((iccfgr & SPR_ICCFGR_NCS ) >> 3 );
170
- cpuinfo -> icache_block_size = 16 << ((iccfgr & SPR_ICCFGR_CBS ) >> 7 );
171
- cpuinfo -> icache_size =
172
- cache_set_size * cpuinfo -> icache_ways * cpuinfo -> icache_block_size ;
167
+ cpuinfo -> icache . ways = 1 << (iccfgr & SPR_ICCFGR_NCW );
168
+ cpuinfo -> icache . sets = 1 << ((iccfgr & SPR_ICCFGR_NCS ) >> 3 );
169
+ cpuinfo -> icache . block_size = 16 << ((iccfgr & SPR_ICCFGR_CBS ) >> 7 );
170
+ cpuinfo -> icache . size =
171
+ cpuinfo -> icache . sets * cpuinfo -> icache . ways * cpuinfo -> icache . block_size ;
173
172
174
173
dccfgr = mfspr (SPR_DCCFGR );
175
- cpuinfo -> dcache_ways = 1 << (dccfgr & SPR_DCCFGR_NCW );
176
- cache_set_size = 1 << ((dccfgr & SPR_DCCFGR_NCS ) >> 3 );
177
- cpuinfo -> dcache_block_size = 16 << ((dccfgr & SPR_DCCFGR_CBS ) >> 7 );
178
- cpuinfo -> dcache_size =
179
- cache_set_size * cpuinfo -> dcache_ways * cpuinfo -> dcache_block_size ;
174
+ cpuinfo -> dcache . ways = 1 << (dccfgr & SPR_DCCFGR_NCW );
175
+ cpuinfo -> dcache . sets = 1 << ((dccfgr & SPR_DCCFGR_NCS ) >> 3 );
176
+ cpuinfo -> dcache . block_size = 16 << ((dccfgr & SPR_DCCFGR_CBS ) >> 7 );
177
+ cpuinfo -> dcache . size =
178
+ cpuinfo -> dcache . sets * cpuinfo -> dcache . ways * cpuinfo -> dcache . block_size ;
180
179
181
180
if (of_property_read_u32 (cpu , "clock-frequency" ,
182
181
& cpuinfo -> clock_frequency )) {
@@ -320,14 +319,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
320
319
seq_printf (m , "revision\t\t: %d\n" , vr & SPR_VR_REV );
321
320
}
322
321
seq_printf (m , "frequency\t\t: %ld\n" , loops_per_jiffy * HZ );
323
- seq_printf (m , "dcache size\t\t: %d bytes\n" , cpuinfo -> dcache_size );
322
+ seq_printf (m , "dcache size\t\t: %d bytes\n" , cpuinfo -> dcache . size );
324
323
seq_printf (m , "dcache block size\t: %d bytes\n" ,
325
- cpuinfo -> dcache_block_size );
326
- seq_printf (m , "dcache ways\t\t: %d\n" , cpuinfo -> dcache_ways );
327
- seq_printf (m , "icache size\t\t: %d bytes\n" , cpuinfo -> icache_size );
324
+ cpuinfo -> dcache . block_size );
325
+ seq_printf (m , "dcache ways\t\t: %d\n" , cpuinfo -> dcache . ways );
326
+ seq_printf (m , "icache size\t\t: %d bytes\n" , cpuinfo -> icache . size );
328
327
seq_printf (m , "icache block size\t: %d bytes\n" ,
329
- cpuinfo -> icache_block_size );
330
- seq_printf (m , "icache ways\t\t: %d\n" , cpuinfo -> icache_ways );
328
+ cpuinfo -> icache . block_size );
329
+ seq_printf (m , "icache ways\t\t: %d\n" , cpuinfo -> icache . ways );
331
330
seq_printf (m , "immu\t\t\t: %d entries, %lu ways\n" ,
332
331
1 << ((mfspr (SPR_DMMUCFGR ) & SPR_DMMUCFGR_NTS ) >> 2 ),
333
332
1 + (mfspr (SPR_DMMUCFGR ) & SPR_DMMUCFGR_NTW ));
0 commit comments