[OpenBIOS] [PATCH v2] arch/ppc/qemu: Clean up and add more cpu infos

BALATON Zoltan balaton at eik.bme.hu
Fri May 9 01:45:14 CEST 2014


On Thu, 8 May 2014, Alexander Graf wrote:
> On 04/17/2014 07:25 PM, BALATON Zoltan wrote:
>> Removed unused clock_frequency member from struct cpudef which is get from
>> FW_CFG and added bus-frequency property to complete the frequency
>> properties. Also added tlb infos to cpudef (with values only for G4
>> currently as I have no data for other CPUs).
>> 
>> Signed-off-by: BALATON Zoltan <balaton at eik.bme.hu>
>> ---
>> 
>> v2: Get bus-frequency from FW_CFG similarly to clock-frequency and
>> tb-frequency (corresponding patch submitted to QEMU)
>> 
>> ---
>> Index: openbios-devel/arch/ppc/qemu/init.c
>> ===================================================================
>> --- openbios-devel/arch/ppc/qemu/init.c	(revision 1286)
>> +++ openbios-devel/arch/ppc/qemu/init.c	(working copy)
>> @@ -44,7 +44,7 @@
>>       int icache_size, dcache_size;
>>       int icache_sets, dcache_sets;
>>       int icache_block_size, dcache_block_size;
>> -    int clock_frequency;
>> +    int tlb_sets, tlb_size;
>>       void (*initfn)(const struct cpudef *cpu);
>>   };
>> 
>> @@ -269,6 +269,18 @@
>>       push_str("i-cache-block-size");
>>       fword("property");
>> 
>> +    if(cpu->tlb_size) {
>> +        PUSH(cpu->tlb_sets);
>> +        fword("encode-int");
>> +        push_str("tlb-sets");
>> +        fword("property");
>> +
>> +        PUSH(cpu->tlb_size);
>> +        fword("encode-int");
>> +        push_str("tlb-size");
>> +        fword("property");
>> +    }
>> +
>>       PUSH(fw_cfg_read_i32(FW_CFG_PPC_TBFREQ));
>>       fword("encode-int");
>>       push_str("timebase-frequency");
>> @@ -279,6 +291,11 @@
>>       push_str("clock-frequency");
>>       fword("property");
>> 
>> +    PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ));
>
> What if we failed to read the bus frequency because we're running on an older 
> QEMU?

What if we don't get CPUFREQ and TBFREQ? They are not handled either. Can 
we run on older QEMU given that OpenBIOS comes with QEMU?

Regards,
BALATON Zoltan



More information about the OpenBIOS mailing list