4fda9bd0ec
Currently every non-x86 platform supported by libpayload needs to provide its own timer driver. Most of the ones we have accumulated there look almost identical: For the frequency, return a preset constant. For the value, read a 32-bit register, possibly read another 32-bit register and shift+OR it with the previous one, then return that. Let's replace this with a single .c file that can easily handle all of those cases. Menuconfig convenience can still be maintained by providing several presets that select different defaults for the driver's configuration options (register address(es) and frequency). Removes an "enabled" check from Samsung MCT driver since coreboot always unconditionally enables that timer anyway. CQ-DEPEND=CL:344809 BRANCH=None BUG=None TEST=Booted Oak and Veyron, observed how dev-mode delay was still ~30s Change-Id: I61cb7d2ffd4902aa841c57f9afa9cd991f770acd Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Commit-Id: a036af6 Original-Change-Id: I9784e7c6aa5abd6d92478ea7ec1cf42c9a437546 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/347749 Reviewed-on: https://review.coreboot.org/17023 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
128 lines
3.1 KiB
Text
128 lines
3.1 KiB
Text
##
|
|
## This file is part of the coreboot project.
|
|
##
|
|
## This program is free software; you can redistribute it and/or modify
|
|
## it under the terms of the GNU General Public License as published by
|
|
## the Free Software Foundation; version 2 of the License.
|
|
##
|
|
## This program is distributed in the hope that it will be useful,
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
## GNU General Public License for more details.
|
|
|
|
config TIMER_RDTSC
|
|
bool
|
|
default y
|
|
depends on ARCH_X86
|
|
|
|
choice
|
|
prompt "Timer driver"
|
|
default TIMER_NONE
|
|
depends on !ARCH_X86
|
|
|
|
config TIMER_NONE
|
|
bool "None"
|
|
help
|
|
The timer driver is provided by the payload itself.
|
|
|
|
config TIMER_MCT
|
|
bool "Exynos MCT"
|
|
|
|
config TIMER_TEGRA_1US
|
|
bool "Tegra 1us"
|
|
|
|
config TIMER_IPQ806X
|
|
bool "Timer for ipq806x platforms"
|
|
|
|
config TIMER_ARMADA38X
|
|
bool "Timer for armada38x platforms"
|
|
help
|
|
This is the timer driver for marvell armada38x
|
|
platforms.
|
|
|
|
config TIMER_IPQ40XX
|
|
bool "Timer for ipq40xx platforms"
|
|
help
|
|
This is the timer driver for QCA IPQ40xx based
|
|
platforms.
|
|
|
|
config TIMER_RK3288
|
|
bool "Timer for Rockchip RK3288"
|
|
|
|
config TIMER_RK3399
|
|
bool "Timer for Rockchip RK3399"
|
|
|
|
config TIMER_CYGNUS
|
|
bool "Timer for Cygnus"
|
|
|
|
config TIMER_IMG_PISTACHIO
|
|
bool "Timer for IMG Pistachio"
|
|
|
|
config TIMER_MTK
|
|
bool "Timer for MediaTek MT8173"
|
|
|
|
config TIMER_MVMAP2315
|
|
bool "Timer for Marvell MVMAP2315"
|
|
|
|
endchoice
|
|
|
|
config ARMADA38X_TIMER_FREQ
|
|
int "Hardware timer frequency"
|
|
depends on TIMER_ARMADA38X
|
|
default 25000000
|
|
|
|
config ARMADA38X_TIMER_REG
|
|
hex "Timer register address"
|
|
default 0xF1020314
|
|
depends on TIMER_ARMADA38X
|
|
|
|
config MVMAP2315_TIMER_FREQ
|
|
int "Hardware timer frequency"
|
|
depends on TIMER_MVMAP2315
|
|
default 1000000
|
|
|
|
config MVMAP2315_TIMER_REG
|
|
hex "Timer register address"
|
|
depends on TIMER_MVMAP2315
|
|
default 0xE1020004
|
|
|
|
config TIMER_GENERIC_HZ
|
|
int "Generic Timer Frequency"
|
|
default 500000000 if TIMER_CYGNUS
|
|
default 48000000 if TIMER_IPQ40XX
|
|
default 6250000 if TIMER_IPQ806X
|
|
default 24000000 if TIMER_MCT
|
|
default 13000000 if TIMER_MTK
|
|
default 24000000 if TIMER_RK3288
|
|
default 24000000 if TIMER_RK3399
|
|
default 1000000 if TIMER_TEGRA_1US
|
|
default 0
|
|
help
|
|
Clock frequency of generic time counter in Hertz. Leave at 0 to
|
|
disable when using a non-generic timer driver.
|
|
|
|
config TIMER_GENERIC_REG
|
|
hex "Generic Timer Register Address"
|
|
default 0x19020200 if TIMER_CYGNUS
|
|
default 0x004A2000 if TIMER_IPQ40XX
|
|
default 0x0200A028 if TIMER_IPQ806X
|
|
default 0x101C0100 if TIMER_MCT
|
|
default 0x10008048 if TIMER_MTK
|
|
default 0xff810028 if TIMER_RK3288
|
|
default 0xff850008 if TIMER_RK3399
|
|
default 0x60005010 if TIMER_TEGRA_1US
|
|
default 0x0
|
|
help
|
|
Register address to read generic time counter from.
|
|
|
|
config TIMER_GENERIC_HIGH_REG
|
|
hex "Generic Timer High Register Address"
|
|
default 0x19020204 if TIMER_CYGNUS
|
|
default 0x004A2004 if TIMER_IPQ40XX
|
|
default 0x101C0104 if TIMER_MCT
|
|
default 0xff81002C if TIMER_RK3288
|
|
default 0xff85000C if TIMER_RK3399
|
|
default 0x0
|
|
help
|
|
Register address to read high 32 bits of generic time counter from.
|
|
Leave at 0x0 for 32-bit counters.
|