@@ -115,16 +115,16 @@ static void print_cpuinfo(void)
115115
116116 if (upr & SPR_UPR_DCP )
117117 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 );
121121 else
122122 printk (KERN_INFO "-- dcache disabled\n" );
123123 if (upr & SPR_UPR_ICP )
124124 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 );
128128 else
129129 printk (KERN_INFO "-- icache disabled\n" );
130130
@@ -156,7 +156,6 @@ void __init setup_cpuinfo(void)
156156{
157157 struct device_node * cpu ;
158158 unsigned long iccfgr , dccfgr ;
159- unsigned long cache_set_size ;
160159 int cpu_id = smp_processor_id ();
161160 struct cpuinfo_or1k * cpuinfo = & cpuinfo_or1k [cpu_id ];
162161
@@ -165,18 +164,18 @@ void __init setup_cpuinfo(void)
165164 panic ("Couldn't find CPU%d in device tree...\n" , cpu_id );
166165
167166 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 ;
173172
174173 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 ;
180179
181180 if (of_property_read_u32 (cpu , "clock-frequency" ,
182181 & cpuinfo -> clock_frequency )) {
@@ -320,14 +319,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
320319 seq_printf (m , "revision\t\t: %d\n" , vr & SPR_VR_REV );
321320 }
322321 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 );
324323 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 );
328327 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 );
331330 seq_printf (m , "immu\t\t\t: %d entries, %lu ways\n" ,
332331 1 << ((mfspr (SPR_DMMUCFGR ) & SPR_DMMUCFGR_NTS ) >> 2 ),
333332 1 + (mfspr (SPR_DMMUCFGR ) & SPR_DMMUCFGR_NTW ));
0 commit comments