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>
This commit is contained in:
@@ -36,6 +36,7 @@ config CPU_SPECIFIC_OPTIONS
|
|||||||
select SPI_FLASH
|
select SPI_FLASH
|
||||||
select UART_OVERRIDE_REFCLK
|
select UART_OVERRIDE_REFCLK
|
||||||
select UDELAY_TSC
|
select UDELAY_TSC
|
||||||
|
select TSC_MONOTONIC_TIMER
|
||||||
select UNCOMPRESSED_RAMSTAGE
|
select UNCOMPRESSED_RAMSTAGE
|
||||||
select USE_MARCH_586
|
select USE_MARCH_586
|
||||||
select NO_SMM
|
select NO_SMM
|
||||||
|
@@ -14,21 +14,10 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <cpu/x86/msr.h>
|
|
||||||
#include <cpu/x86/tsc.h>
|
#include <cpu/x86/tsc.h>
|
||||||
#include <timer.h>
|
|
||||||
|
|
||||||
unsigned long tsc_freq_mhz(void)
|
unsigned long tsc_freq_mhz(void)
|
||||||
{
|
{
|
||||||
/* CPU freq = 400 MHz */
|
/* CPU freq = 400 MHz */
|
||||||
return 400;
|
return 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_monotonic_get(struct mono_time *mt)
|
|
||||||
{
|
|
||||||
uint64_t tsc_value;
|
|
||||||
|
|
||||||
tsc_value = rdtscll();
|
|
||||||
mt->microseconds = tsc_value / tsc_freq_mhz();
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user