2015-05-20 18:40:39 +02:00
|
|
|
# Kconfig - timer driver configuration options
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
2017-01-24 22:03:19 +01:00
|
|
|
# Copyright (c) 2016 Cadence Design Systems, Inc.
|
2015-05-20 18:40:39 +02:00
|
|
|
#
|
2017-01-19 02:01:01 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2015-05-20 18:40:39 +02:00
|
|
|
#
|
|
|
|
|
2015-06-05 20:01:57 +02:00
|
|
|
|
|
|
|
menu "Timer Drivers"
|
|
|
|
|
2019-01-19 13:36:29 +01:00
|
|
|
menuconfig HPET_TIMER
|
2015-06-05 20:01:57 +02:00
|
|
|
bool "HPET timer"
|
arch/x86_64: New architecture added
This patch adds a x86_64 architecture and qemu_x86_64 board to Zephyr.
Only the basic architecture support needed to run 64 bit code is
added; no drivers are added, though a low-level console exists and is
wired to printk().
The support is built on top of a "X86 underkernel" layer, which can be
built in isolation as a unit test on a Linux host.
Limitations:
+ Right now the SDK lacks an x86_64 toolchain. The build will fall
back to a host toolchain if it finds no cross compiler defined,
which is tested to work on gcc 8.2.1 right now.
+ No x87/SSE/AVX usage is allowed. This is a stronger limitation than
other architectures where the instructions work from one thread even
if the context switch code doesn't support it. We are passing
-no-sse to prevent gcc from automatically generating SSE
instructions for non-floating-point purposes, which has the side
effect of changing the ABI. Future work to handle the FPU registers
will need to be combined with an "application" ABI distinct from the
kernel one (or just to require USERSPACE).
+ Paging is enabled (it has to be in long mode), but is a 1:1 mapping
of all memory. No MMU/USERSPACE support yet.
+ We are building with -mno-red-zone for stack size reasons, but this
is a valuable optimization. Enabling it requires automatic stack
switching, which requires a TSS, which means it has to happen after
MMU support.
+ The OS runs in 64 bit mode, but for compatibility reasons is
compiled to the 32 bit "X32" ABI. So while the full 64 bit
registers and instruction set are available, C pointers are 32 bits
long and Zephyr is constrained to run in the bottom 4G of memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-08-19 21:24:48 +02:00
|
|
|
depends on (X86 || X86_64)
|
|
|
|
select IOAPIC if X86
|
|
|
|
select LOAPIC if X86
|
2015-11-20 22:30:13 +01:00
|
|
|
select TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
|
2018-10-12 19:11:17 +02:00
|
|
|
select TICKLESS_CAPABLE
|
2015-06-05 20:01:57 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option selects High Precision Event Timer (HPET) as a
|
|
|
|
system timer.
|
2015-06-05 20:01:57 +02:00
|
|
|
|
2019-01-19 13:36:29 +01:00
|
|
|
if HPET_TIMER
|
2015-08-06 18:08:56 +02:00
|
|
|
config HPET_TIMER_BASE_ADDRESS
|
|
|
|
hex "HPET Base Address"
|
|
|
|
default 0xFED00000
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This options specifies the base address of the HPET timer device.
|
2015-08-06 18:08:56 +02:00
|
|
|
|
|
|
|
config HPET_TIMER_IRQ
|
|
|
|
int "HPET Timer IRQ"
|
2018-11-28 19:32:06 +01:00
|
|
|
default 2
|
2015-08-06 18:08:56 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the IRQ used by the HPET timer.
|
2015-08-06 18:08:56 +02:00
|
|
|
|
|
|
|
config HPET_TIMER_IRQ_PRIORITY
|
|
|
|
int "HPET Timer IRQ Priority"
|
|
|
|
default 4
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the IRQ priority used by the HPET timer.
|
2015-08-06 18:08:56 +02:00
|
|
|
|
2019-01-19 13:36:29 +01:00
|
|
|
endif #HPET_TIMER
|
|
|
|
|
|
|
|
menuconfig LOAPIC_TIMER
|
2015-06-08 16:54:45 +02:00
|
|
|
bool "LOAPIC timer"
|
2015-10-09 12:20:52 +02:00
|
|
|
depends on (LOAPIC || MVIC) && X86
|
2015-06-08 16:54:45 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option selects LOAPIC timer as a system timer.
|
2015-06-08 16:54:45 +02:00
|
|
|
|
2019-01-19 13:36:29 +01:00
|
|
|
if LOAPIC_TIMER
|
2015-07-27 20:34:25 +02:00
|
|
|
config LOAPIC_TIMER_IRQ
|
|
|
|
int "Local APIC Timer IRQ"
|
|
|
|
default 24
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the IRQ used by the LOAPIC timer.
|
2015-07-27 20:34:25 +02:00
|
|
|
|
|
|
|
config LOAPIC_TIMER_IRQ_PRIORITY
|
|
|
|
int "Local APIC Timer IRQ Priority"
|
|
|
|
default 2
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This options specifies the IRQ priority used by the LOAPIC timer.
|
2015-07-27 20:34:25 +02:00
|
|
|
|
2017-02-15 23:21:28 +01:00
|
|
|
config TSC_CYCLES_PER_SEC
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Frequency of x86 CPU timestamp counter"
|
2017-02-15 23:21:28 +01:00
|
|
|
default 0
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
The x86 implementation of LOAPIC k_cycle_get_32() relies on the x86 TSC.
|
|
|
|
This runs at the CPU speed and not the bus speed. If set to 0, the
|
|
|
|
value of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC will be used instead;
|
|
|
|
many MCUs these values are the same.
|
2017-02-15 23:21:28 +01:00
|
|
|
|
2019-01-19 13:36:29 +01:00
|
|
|
endif #LOAPIC_TIMER
|
|
|
|
|
|
|
|
menuconfig ARCV2_TIMER
|
2015-06-20 15:28:13 +02:00
|
|
|
bool "ARC Timer"
|
|
|
|
default y
|
|
|
|
depends on ARC
|
2018-11-22 10:55:27 +01:00
|
|
|
select TICKLESS_CAPABLE
|
2015-06-20 15:28:13 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This module implements a kernel device driver for the ARCv2 processor timer 0
|
|
|
|
and provides the standard "system clock driver" interfaces.
|
2015-06-20 15:28:13 +02:00
|
|
|
|
2016-08-16 19:58:40 +02:00
|
|
|
config ARCV2_TIMER_IRQ_PRIORITY
|
|
|
|
int "ARC timer interrupt priority"
|
|
|
|
default 0
|
|
|
|
depends on ARCV2_TIMER
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the IRQ priority used by the ARC timer. Lower
|
|
|
|
values have higher priority.
|
2016-08-16 19:58:40 +02:00
|
|
|
|
2015-08-04 15:51:13 +02:00
|
|
|
config CORTEX_M_SYSTICK
|
|
|
|
bool "Cortex-M SYSTICK timer"
|
2019-04-05 12:47:43 +02:00
|
|
|
depends on CPU_CORTEX_M_HAS_SYSTICK
|
2018-10-12 15:58:21 +02:00
|
|
|
select TICKLESS_CAPABLE
|
2015-06-24 17:39:57 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This module implements a kernel device driver for the Cortex-M processor
|
|
|
|
SYSTICK timer and provides the standard "system clock driver" interfaces.
|
2015-06-24 17:39:57 +02:00
|
|
|
|
2016-06-21 19:51:46 +02:00
|
|
|
config ALTERA_AVALON_TIMER
|
|
|
|
bool "Altera Avalon Interval Timer"
|
2016-04-21 23:47:09 +02:00
|
|
|
default y
|
|
|
|
depends on NIOS2
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This module implements a kernel device driver for the Altera Avalon
|
|
|
|
Interval Timer as described in the Embedded IP documentation, for use
|
|
|
|
with Nios II and possibly other Altera soft CPUs. It provides the
|
|
|
|
standard "system clock driver" interfaces.
|
2016-04-21 23:47:09 +02:00
|
|
|
|
2016-11-22 17:03:32 +01:00
|
|
|
config NRF_RTC_TIMER
|
|
|
|
bool "nRF Real Time Counter (NRF_RTC1) Timer"
|
2019-02-21 15:53:29 +01:00
|
|
|
depends on CLOCK_CONTROL
|
|
|
|
depends on SOC_COMPATIBLE_NRF
|
2018-10-15 18:04:21 +02:00
|
|
|
select TICKLESS_CAPABLE
|
2016-11-22 17:03:32 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This module implements a kernel device driver for the nRF Real Time
|
|
|
|
Counter NRF_RTC1 and provides the standard "system clock driver"
|
|
|
|
interfaces.
|
2016-11-22 17:03:32 +01:00
|
|
|
|
2017-01-24 01:03:56 +01:00
|
|
|
config RISCV_MACHINE_TIMER
|
|
|
|
bool "RISCV Machine Timer"
|
2017-03-14 22:14:52 +01:00
|
|
|
depends on SOC_FAMILY_RISCV_PRIVILEGE
|
2018-10-18 19:17:48 +02:00
|
|
|
select TICKLESS_CAPABLE
|
2017-01-11 00:24:31 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This module implements a kernel device driver for the generic RISCV machine
|
|
|
|
timer driver. It provides the standard "system clock driver" interfaces.
|
2017-01-11 00:24:31 +01:00
|
|
|
|
2018-11-25 10:40:57 +01:00
|
|
|
config RV32M1_LPTMR_TIMER
|
|
|
|
bool "RV32M1 LPTMR system timer driver"
|
|
|
|
default y
|
|
|
|
depends on SOC_OPENISA_RV32M1_RISCV32
|
|
|
|
depends on !TICKLESS_IDLE
|
2018-11-25 10:41:38 +01:00
|
|
|
depends on RV32M1_INTMUX
|
2018-11-25 10:40:57 +01:00
|
|
|
help
|
|
|
|
This module implements a kernel device driver for using the LPTMR
|
|
|
|
peripheral as the system clock. It provides the standard "system clock
|
|
|
|
driver" interfaces.
|
|
|
|
|
2017-12-21 14:14:19 +01:00
|
|
|
config NATIVE_POSIX_TIMER
|
|
|
|
bool "(POSIX) native_posix timer driver"
|
|
|
|
default y
|
|
|
|
depends on BOARD_NATIVE_POSIX
|
|
|
|
help
|
2018-01-06 13:41:34 +01:00
|
|
|
This module implements a kernel device driver for the native_posix HW timer
|
|
|
|
model
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2017-01-25 13:00:08 +01:00
|
|
|
config XTENSA_TIMER
|
|
|
|
bool "Xtensa timer support"
|
|
|
|
depends on XTENSA
|
|
|
|
default y
|
2018-10-23 18:08:58 +02:00
|
|
|
select TICKLESS_CAPABLE
|
2017-01-25 13:00:08 +01:00
|
|
|
help
|
2018-10-23 18:08:58 +02:00
|
|
|
Enables a system timer driver for Xtensa based on the CCOUNT
|
|
|
|
and CCOMPARE special registers.
|
2017-01-25 13:00:08 +01:00
|
|
|
|
2018-10-23 18:08:58 +02:00
|
|
|
config XTENSA_TIMER_ID
|
|
|
|
int "System timer CCOMPAREn register index"
|
2017-01-25 13:00:08 +01:00
|
|
|
default 1
|
2018-10-23 18:08:58 +02:00
|
|
|
depends on XTENSA_TIMER
|
2017-01-25 13:00:08 +01:00
|
|
|
help
|
2018-10-23 18:08:58 +02:00
|
|
|
Index of the CCOMPARE register (and associated interrupt)
|
|
|
|
used for the system timer. Xtensa CPUs have hard-configured
|
|
|
|
interrupt priorities associated with each timer, and some of
|
|
|
|
them can be unmaskable (and thus not usable by OS code that
|
|
|
|
need synchronization, like the timer subsystem!). Choose
|
|
|
|
carefully. Generally you want the timer with the highest
|
|
|
|
priority maskable interrupt.
|
2017-01-25 13:00:08 +01:00
|
|
|
|
2018-11-05 10:17:49 +01:00
|
|
|
config SAM0_RTC_TIMER
|
|
|
|
bool "Atmel SAM0 series RTC timer"
|
|
|
|
depends on SOC_FAMILY_SAM0
|
|
|
|
select TICKLESS_CAPABLE
|
|
|
|
help
|
|
|
|
This module implements a kernel device driver for the Atmel SAM0
|
|
|
|
series Real Time Counter and provides the standard "system clock
|
|
|
|
driver" interfaces.
|
|
|
|
|
2015-09-28 20:24:50 +02:00
|
|
|
config SYSTEM_CLOCK_DISABLE
|
|
|
|
bool "API to disable system clock"
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option enables the sys_clock_disable() API in the kernel. It is
|
|
|
|
needed by some subsystems (which will automatically select it), but is
|
|
|
|
rarely needed by applications.
|
2015-09-28 20:24:50 +02:00
|
|
|
|
2015-11-20 22:26:25 +01:00
|
|
|
config TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
|
|
|
|
bool "Timer queries its hardware to find its frequency at runtime"
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
The drivers select this option automatically when needed. Do not modify
|
|
|
|
this unless you have a very good reason for it.
|
2016-01-04 14:48:50 +01:00
|
|
|
|
|
|
|
config SYSTEM_CLOCK_INIT_PRIORITY
|
|
|
|
int "System clock driver initialization priority"
|
|
|
|
default 0
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This options can be used to set a specific initialization priority
|
|
|
|
value for the system clock driver. As driver initialization might need
|
|
|
|
the clock to be running already, you should let the default value as it
|
|
|
|
is (0).
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2018-10-12 15:58:21 +02:00
|
|
|
config TICKLESS_CAPABLE
|
|
|
|
bool "Timer driver supports tickless operation"
|
|
|
|
help
|
|
|
|
Timer drivers should select this flag if they are capable of
|
|
|
|
supporting tickless operation. That is, a call to
|
|
|
|
z_clock_set_timeout() with a number of ticks greater than
|
|
|
|
one should be expected not to produce a call to
|
|
|
|
z_clock_announce() (really, not to produce an interrupt at
|
|
|
|
all) until the specified expiration.
|
|
|
|
|
2018-10-12 00:46:13 +02:00
|
|
|
config QEMU_TICKLESS_WORKAROUND
|
|
|
|
bool "Disable tickless on qemu due to asynchrony bug"
|
|
|
|
depends on QEMU_TARGET && TICKLESS_KERNEL
|
|
|
|
help
|
|
|
|
Qemu (without -icount) has trouble keeping time when the
|
|
|
|
host process needs to timeshare. The host OS will routinely
|
|
|
|
schedule out a process at timescales equivalent to the guest
|
|
|
|
tick rate. With traditional ticks delivered regularly by
|
|
|
|
the hardware, that's mostly OK as it looks like a late
|
|
|
|
interrupt. But in tickless mode, the driver needs some CPU
|
|
|
|
in order to schedule the tick in the first place. If that
|
|
|
|
gets delayed across a tick boundary, time gets wonky. This
|
|
|
|
tunable is a hint to the driver to disable tickless
|
|
|
|
accounting on qemu. Use it only on tests that are known to
|
|
|
|
have problems.
|
|
|
|
|
2015-06-05 20:01:57 +02:00
|
|
|
endmenu
|