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@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)); + fword("encode-int"); + push_str("bus-frequency"); + fword("property"); + push_str("running"); fword("encode-string"); push_str("state"); @@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -403,7 +421,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -415,7 +434,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -427,7 +447,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { @@ -439,7 +460,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -451,7 +473,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -463,7 +486,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -475,7 +499,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -487,7 +512,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { @@ -499,7 +525,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_g4_init, }, { @@ -511,7 +538,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x5f5e1000, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, { // XXX find out real values @@ -523,7 +551,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, { @@ -535,7 +564,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x629b4940, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, };
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@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?
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Please expose at least reasonable defaults. Zero is a bad choice because it may cause to division by 0 errors inside the guest.
Alex
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@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
Am 09.05.2014 um 01:45 schrieb BALATON Zoltan balaton@eik.bme.hu:
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@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?
Yes, probably because I was sloppy :)
They are not handled either. Can we run on older QEMU given that OpenBIOS comes with QEMU?
They are separate projects. If you do OpenBIOS development, why should we force you to run a recent git snapshot of QEMU when it's really not necessary?
Alex
Regards, BALATON Zoltan
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@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));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Oh, I was too quick to comment here. The if() check above means we won't add those properties for these CPUs then.
No need to add the fields in this case. C by default zero initializes unset fields.
Alex
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@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));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Oh, I was too quick to comment here. The if() check above means we won't add those properties for these CPUs then.
No need to add the fields in this case. C by default zero initializes unset fields.
Do you prefer if I remove them? I though having them there does not hurt and shows they could be set.
Regards, BALATON Zoltan
Am 09.05.2014 um 01:46 schrieb BALATON Zoltan balaton@eik.bme.hu:
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@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));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
- push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Oh, I was too quick to comment here. The if() check above means we won't add those properties for these CPUs then.
No need to add the fields in this case. C by default zero initializes unset fields.
Do you prefer if I remove them? I though having them there does not hurt and shows they could be set.
Hrm, I don't have strong feelings either way :)
Alex
Regards, BALATON Zoltan
On Fri, 9 May 2014, Alexander Graf wrote:
Am 09.05.2014 um 01:46 schrieb BALATON Zoltan balaton@eik.bme.hu:
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@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));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
- push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Oh, I was too quick to comment here. The if() check above means we won't add those properties for these CPUs then.
No need to add the fields in this case. C by default zero initializes unset fields.
Do you prefer if I remove them? I though having them there does not hurt and shows they could be set.
Hrm, I don't have strong feelings either way :)
So can this be applied as is or are there any modifications needed?
Regards, BALATON Zoltan
On Fri, 9 May 2014, BALATON Zoltan wrote:
On Fri, 9 May 2014, Alexander Graf wrote:
Am 09.05.2014 um 01:46 schrieb BALATON Zoltan balaton@eik.bme.hu:
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@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));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
- push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x00,
.tlb_size = 0x00,
Oh, I was too quick to comment here. The if() check above means we won't add those properties for these CPUs then.
No need to add the fields in this case. C by default zero initializes unset fields.
Do you prefer if I remove them? I though having them there does not hurt and shows they could be set.
Hrm, I don't have strong feelings either way :)
So can this be applied as is or are there any modifications needed?
Who decides about this patch? (I'd like to clean my tree a little and get things that can be taken upstream merged, so I can see what changes need still more work.)
Regards, BALATON Zoltan
On 18/05/14 00:22, BALATON Zoltan wrote:
Hrm, I don't have strong feelings either way :)
So can this be applied as is or are there any modifications needed?
Who decides about this patch? (I'd like to clean my tree a little and get things that can be taken upstream merged, so I can see what changes need still more work.)
Alex/Andreas are the PPC maintainers; I'm a little nervous about making changes in this area without someone to double-check what I'm doing, although I could apply a patch with a Reviewed-by if explicit consent was given.
FWIW what you really should do is create yourself a couple of forks on github or similar, one for OpenBIOS and one for QEMU. Then you have a record of your patches publically available that you can rebase as they get reviewed/applied.
ATB,
Mark.
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@eik.bme.hu ---
v2: Get bus-frequency from FW_CFG similarly to clock-frequency and tb-frequency (corresponding patch submitted to QEMU, already applied to ppc-next) v3: added definition of FW_CFG_PPC_BUSFREQ that was missed from v2
--- Index: openbios-devel/arch/ppc/qemu/init.c =================================================================== --- openbios-devel/arch/ppc/qemu/init.c (revision 1298) +++ 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)); + fword("encode-int"); + push_str("bus-frequency"); + fword("property"); + push_str("running"); fword("encode-string"); push_str("state"); @@ -391,7 +408,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -403,7 +421,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -415,7 +434,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_604_init, }, { // XXX find out real values @@ -427,7 +447,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { @@ -439,7 +460,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -451,7 +473,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -463,7 +486,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -475,7 +499,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { // XXX find out real values @@ -487,7 +512,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_750_init, }, { @@ -499,7 +525,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_g4_init, }, { @@ -511,7 +538,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x5f5e1000, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, { // XXX find out real values @@ -523,7 +551,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, { @@ -535,7 +564,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x629b4940, + .tlb_sets = 0x00, + .tlb_size = 0x00, .initfn = cpu_970_init, }, }; Index: openbios-devel/include/arch/common/fw_cfg.h =================================================================== --- openbios-devel/include/arch/common/fw_cfg.h (revision 1298) +++ openbios-devel/include/arch/common/fw_cfg.h (working copy) @@ -45,6 +45,7 @@ #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) +#define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09)
#define FW_CFG_INVALID 0xffff
On 23/05/14 00:30, 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).
This looks fairly close; AIUI Alex's main objection at the moment is the missing tlb information for the remaining CPUs.
The CPUs for which the information is missing are the 604, 750 and 970. It looks as if you can find the 604/750 values direct from the device trees here:
http://web.archive.org/web/20081120133742/http://penguinppc.org/historical/d...
This would then leave just the 970 which I'm sure you'll be able to find easily from the datasheet. Is there any reason not to spend a little time finding these missing values? Then we can go ahead and get the patch applied to SVN trunk.
ATB,
Mark.
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 CPU properties.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu ---
v2: Get bus-frequency from FW_CFG similarly to clock-frequency and tb-frequency (corresponding patch submitted to QEMU, already applied to ppc-next) v3: added definition of FW_CFG_PPC_BUSFREQ that was missed from v2 v4: tlb infos for all CPUs from device tree dumps found on the net
--- Index: openbios-devel/arch/ppc/qemu/init.c =================================================================== --- openbios-devel/arch/ppc/qemu/init.c (revision 1303) +++ 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,16 @@ push_str("i-cache-block-size"); fword("property");
+ 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 +289,11 @@ push_str("clock-frequency"); fword("property");
+ PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ)); + fword("encode-int"); + push_str("bus-frequency"); + fword("property"); + push_str("running"); fword("encode-string"); push_str("state"); @@ -391,7 +406,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values @@ -403,7 +419,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values @@ -415,7 +432,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x07de2900, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values @@ -427,7 +445,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { @@ -439,7 +458,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values @@ -451,7 +471,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values @@ -463,7 +484,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values @@ -475,7 +497,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values @@ -487,7 +510,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x14dc9380, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_750_init, }, { @@ -499,7 +523,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x40, + .tlb_size = 0x80, .initfn = cpu_g4_init, }, { @@ -511,7 +536,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x5f5e1000, + .tlb_sets = 0x100, + .tlb_size = 0x1000, .initfn = cpu_970_init, }, { // XXX find out real values @@ -523,7 +549,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x1dcd6500, + .tlb_sets = 0x100, + .tlb_size = 0x1000, .initfn = cpu_970_init, }, { @@ -535,7 +562,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80, - .clock_frequency = 0x629b4940, + .tlb_sets = 0x100, + .tlb_size = 0x1000, .initfn = cpu_970_init, }, }; Index: openbios-devel/include/arch/common/fw_cfg.h =================================================================== --- openbios-devel/include/arch/common/fw_cfg.h (revision 1303) +++ openbios-devel/include/arch/common/fw_cfg.h (working copy) @@ -45,6 +45,7 @@ #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) +#define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09)
#define FW_CFG_INVALID 0xffff
On 23/05/14 19:57, 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 CPU properties.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu
v2: Get bus-frequency from FW_CFG similarly to clock-frequency and tb-frequency (corresponding patch submitted to QEMU, already applied to ppc-next) v3: added definition of FW_CFG_PPC_BUSFREQ that was missed from v2 v4: tlb infos for all CPUs from device tree dumps found on the net
Index: openbios-devel/arch/ppc/qemu/init.c
--- openbios-devel/arch/ppc/qemu/init.c (revision 1303) +++ 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,16 @@ push_str("i-cache-block-size"); fword("property");
- 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 +289,11 @@ push_str("clock-frequency"); fword("property");
- PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +406,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -403,7 +419,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -415,7 +432,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -427,7 +445,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -439,7 +458,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -451,7 +471,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -463,7 +484,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -475,7 +497,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -487,7 +510,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -499,7 +523,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_g4_init, }, {
@@ -511,7 +536,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x5f5e1000,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, { // XXX find out real values
@@ -523,7 +549,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, {
@@ -535,7 +562,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x629b4940,
.tlb_sets = 0x100,
};.tlb_size = 0x1000, .initfn = cpu_970_init, },
Index: openbios-devel/include/arch/common/fw_cfg.h
--- openbios-devel/include/arch/common/fw_cfg.h (revision 1303) +++ openbios-devel/include/arch/common/fw_cfg.h (working copy) @@ -45,6 +45,7 @@ #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) +#define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09)
#define FW_CFG_INVALID 0xffff
Looks good to me. Alex/Andreas, let me know if you'd prefer me to commit this.
ATB,
Mark.
Am 24.05.2014 11:21, schrieb Mark Cave-Ayland:
On 23/05/14 19:57, 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 CPU properties.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu
v2: Get bus-frequency from FW_CFG similarly to clock-frequency and tb-frequency (corresponding patch submitted to QEMU, already applied to ppc-next) v3: added definition of FW_CFG_PPC_BUSFREQ that was missed from v2 v4: tlb infos for all CPUs from device tree dumps found on the net
Index: openbios-devel/arch/ppc/qemu/init.c
--- openbios-devel/arch/ppc/qemu/init.c (revision 1303) +++ 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,16 @@ push_str("i-cache-block-size"); fword("property");
- 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 +289,11 @@ push_str("clock-frequency"); fword("property");
- PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +406,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -403,7 +419,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -415,7 +432,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -427,7 +445,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -439,7 +458,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -451,7 +471,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -463,7 +484,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -475,7 +497,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -487,7 +510,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -499,7 +523,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_g4_init, }, {
@@ -511,7 +536,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x5f5e1000,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, { // XXX find out real values
@@ -523,7 +549,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, {
@@ -535,7 +562,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x629b4940,
.tlb_sets = 0x100,
};.tlb_size = 0x1000, .initfn = cpu_970_init, },
Index: openbios-devel/include/arch/common/fw_cfg.h
--- openbios-devel/include/arch/common/fw_cfg.h (revision 1303) +++ openbios-devel/include/arch/common/fw_cfg.h (working copy) @@ -45,6 +45,7 @@ #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) +#define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09)
#define FW_CFG_INVALID 0xffff
Looks good to me. Alex/Andreas, let me know if you'd prefer me to commit this.
No objections from my side.
Andreas
On 24.05.14 11:21, Mark Cave-Ayland wrote:
On 23/05/14 19:57, 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 CPU properties.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu
v2: Get bus-frequency from FW_CFG similarly to clock-frequency and tb-frequency (corresponding patch submitted to QEMU, already applied to ppc-next) v3: added definition of FW_CFG_PPC_BUSFREQ that was missed from v2 v4: tlb infos for all CPUs from device tree dumps found on the net
Index: openbios-devel/arch/ppc/qemu/init.c
--- openbios-devel/arch/ppc/qemu/init.c (revision 1303) +++ 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,16 @@ push_str("i-cache-block-size"); fword("property");
- 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 +289,11 @@ push_str("clock-frequency"); fword("property");
- PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ));
- fword("encode-int");
- push_str("bus-frequency");
- fword("property");
push_str("running"); fword("encode-string"); push_str("state");
@@ -391,7 +406,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -403,7 +419,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -415,7 +432,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x07de2900,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_604_init, }, { // XXX find out real values
@@ -427,7 +445,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -439,7 +458,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -451,7 +471,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -463,7 +484,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -475,7 +497,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, { // XXX find out real values
@@ -487,7 +510,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x14dc9380,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_750_init, }, {
@@ -499,7 +523,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x20, .dcache_block_size = 0x20,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x40,
.tlb_size = 0x80, .initfn = cpu_g4_init, }, {
@@ -511,7 +536,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x5f5e1000,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, { // XXX find out real values
@@ -523,7 +549,8 @@ .dcache_sets = 0x80, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x1dcd6500,
.tlb_sets = 0x100,
.tlb_size = 0x1000, .initfn = cpu_970_init, }, {
@@ -535,7 +562,8 @@ .dcache_sets = 0x40, .icache_block_size = 0x80, .dcache_block_size = 0x80,
.clock_frequency = 0x629b4940,
.tlb_sets = 0x100,
};.tlb_size = 0x1000, .initfn = cpu_970_init, },
Index: openbios-devel/include/arch/common/fw_cfg.h
--- openbios-devel/include/arch/common/fw_cfg.h (revision 1303) +++ openbios-devel/include/arch/common/fw_cfg.h (working copy) @@ -45,6 +45,7 @@ #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) +#define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09)
#define FW_CFG_INVALID 0xffff
Looks good to me. Alex/Andreas, let me know if you'd prefer me to commit this.
I think the patch is fine by now (though I would personally split it into 3 patches for easy bisectability). I've applied it to the tree.
However, Zoltan, something is broken with your patch workflow. I was only able to apply the patch after stripping superfluous spaces from every line that starts with a space using the following regex:
%s/^ / /g
Please check whether you followed the instructions at
https://www.kernel.org/doc/Documentation/email-clients.txt
or if something else is broken in the workflow you're using to submit patches.
Thanks,
Alex
On Sun, 25 May 2014, Alexander Graf wrote:
patches for easy bisectability). I've applied it to the tree.
Thanks.
However, Zoltan, something is broken with your patch workflow. I was only
It was my mistake when sending this patch. Normally I don't make this mistake so other and future patches should be OK. Sorry about that.
Regards, BALATON Zoltan