Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36554 )
Change subject: intel/quark: Switch to TSC_MONOTONIC_TIMER ......................................................................
intel/quark: Switch to TSC_MONOTONIC_TIMER
Change-Id: I5ea899863c5b9ed516a55ba2e7524dd33a6f651d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/quark/Kconfig M src/soc/intel/quark/tsc_freq.c 2 files changed, 1 insertion(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/36554/1
diff --git a/src/soc/intel/quark/Kconfig b/src/soc/intel/quark/Kconfig index 75f1354..461d230 100644 --- a/src/soc/intel/quark/Kconfig +++ b/src/soc/intel/quark/Kconfig @@ -36,6 +36,7 @@ select SPI_FLASH select UART_OVERRIDE_REFCLK select UDELAY_TSC + select TSC_MONOTONIC_TIMER select UNCOMPRESSED_RAMSTAGE select USE_MARCH_586 select NO_SMM diff --git a/src/soc/intel/quark/tsc_freq.c b/src/soc/intel/quark/tsc_freq.c index e6d0369..fa5bd67 100644 --- a/src/soc/intel/quark/tsc_freq.c +++ b/src/soc/intel/quark/tsc_freq.c @@ -14,21 +14,10 @@ * GNU General Public License for more details. */
-#include <stdint.h> -#include <cpu/x86/msr.h> #include <cpu/x86/tsc.h> -#include <timer.h>
unsigned long tsc_freq_mhz(void) { /* CPU freq = 400 MHz */ return 400; } - -void timer_monotonic_get(struct mono_time *mt) -{ - uint64_t tsc_value; - - tsc_value = rdtscll(); - mt->microseconds = tsc_value / tsc_freq_mhz(); -}
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36554 )
Change subject: intel/quark: Switch to TSC_MONOTONIC_TIMER ......................................................................
Patch Set 1: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36554 )
Change subject: intel/quark: Switch to TSC_MONOTONIC_TIMER ......................................................................
Patch Set 2: Code-Review+2
Kyösti Mälkki has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36554 )
Change subject: intel/quark: Switch to TSC_MONOTONIC_TIMER ......................................................................
intel/quark: Switch to TSC_MONOTONIC_TIMER
Change-Id: I5ea899863c5b9ed516a55ba2e7524dd33a6f651d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/36554 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/intel/quark/Kconfig M src/soc/intel/quark/tsc_freq.c 2 files changed, 1 insertion(+), 11 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/quark/Kconfig b/src/soc/intel/quark/Kconfig index 75f1354..461d230 100644 --- a/src/soc/intel/quark/Kconfig +++ b/src/soc/intel/quark/Kconfig @@ -36,6 +36,7 @@ select SPI_FLASH select UART_OVERRIDE_REFCLK select UDELAY_TSC + select TSC_MONOTONIC_TIMER select UNCOMPRESSED_RAMSTAGE select USE_MARCH_586 select NO_SMM diff --git a/src/soc/intel/quark/tsc_freq.c b/src/soc/intel/quark/tsc_freq.c index e6d0369..fa5bd67 100644 --- a/src/soc/intel/quark/tsc_freq.c +++ b/src/soc/intel/quark/tsc_freq.c @@ -14,21 +14,10 @@ * GNU General Public License for more details. */
-#include <stdint.h> -#include <cpu/x86/msr.h> #include <cpu/x86/tsc.h> -#include <timer.h>
unsigned long tsc_freq_mhz(void) { /* CPU freq = 400 MHz */ return 400; } - -void timer_monotonic_get(struct mono_time *mt) -{ - uint64_t tsc_value; - - tsc_value = rdtscll(); - mt->microseconds = tsc_value / tsc_freq_mhz(); -}