mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user