PPC: Get timebase and clock speed from fw_cfg

When running on Qemu (TCG) time goes by at a constant frequency which
accidently happens to match with Linux's fallback value.

As soon as we go to KVM, the time base suddenly starts going as fast as
the host CPU's time base. So we need to make sure Linux knows about
it, so it can do its timekeeping properly.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@678 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Alexander Graf
2010-02-22 18:52:25 +00:00
parent 63e7a89932
commit 50d1f0e78e
2 changed files with 16 additions and 0 deletions

View File

@@ -194,6 +194,16 @@ cpu_generic_init(const struct cpudef *cpu)
push_str("icache-block-size");
fword("property");
PUSH(fw_cfg_read_i32(FW_CFG_PPC_TBFREQ));
fword("encode-int");
push_str("timebase-frequency");
fword("property");
PUSH(fw_cfg_read_i32(FW_CFG_PPC_CPUFREQ));
fword("encode-int");
push_str("clock-frequency");
fword("property");
push_str("running");
fword("encode-string");
push_str("state");