j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: agraf Date: Mon Feb 22 19:52:25 2010 New Revision: 678 URL: http://tracker.coreboot.org/trac/openbios/changeset/678
Log: 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
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c trunk/openbios-devel/include/openbios/fw_cfg.h
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Mon Feb 22 19:52:23 2010 (r677) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Mon Feb 22 19:52:25 2010 (r678) @@ -194,6 +194,16 @@ 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");
Modified: trunk/openbios-devel/include/openbios/fw_cfg.h ============================================================================== --- trunk/openbios-devel/include/openbios/fw_cfg.h Mon Feb 22 19:52:23 2010 (r677) +++ trunk/openbios-devel/include/openbios/fw_cfg.h Mon Feb 22 19:52:25 2010 (r678) @@ -36,6 +36,12 @@ #define FW_CFG_ARCH_LOCAL 0x8000 #define FW_CFG_ENTRY_MASK ~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL)
+#define FW_CFG_PPC_WIDTH (FW_CFG_ARCH_LOCAL + 0x00) +#define FW_CFG_PPC_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01) +#define FW_CFG_PPC_DEPTH (FW_CFG_ARCH_LOCAL + 0x02) +#define FW_CFG_PPC_TBFREQ (FW_CFG_ARCH_LOCAL + 0x03) +#define FW_CFG_PPC_CPUFREQ (FW_CFG_ARCH_LOCAL + 0x04) + #define FW_CFG_INVALID 0xffff
#ifndef NO_QEMU_PROTOS