u-boot/drivers/timer
Sean Anderson c33efafaf9 riscv: Rework riscv timer driver to only support S-mode
The riscv-timer driver currently serves as a shim for several riscv timer
drivers. This is not too desirable because it bypasses the usual timer
selection via the driver model. There is no easy way to specify an
alternate timing driver, or have the tick rate depend on the cpu's
configured frequency. The timer drivers also do not have device structs,
and so have to rely on storing parameters in gd_t. Lastly, there is no
initialization call, so driver init is done in the same function which
reads the time. This can result in confusing error messages. To a user, it
looks like the driver failed when trying to read the time, whereas it may
have failed while initializing.

This patch removes the shim functionality from the riscv-timer driver, and
has it instead implement the former rdtime.c timer driver. This is because
existing u-boot users who pass in a device tree (e.g. qemu) do not create a
timer device for S-mode u-boot. The existing behavior of creating the
riscv-timer device in the riscv cpu driver must be kept. The actual reading
of the CSRs has been redone in the style of Linux's get_cycles64.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-09-30 08:54:45 +08:00
..
ag101p_timer.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
altera_timer.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
arc_timer.c timer: Remove DM_FLAG_PRE_RELOC flag in various drivers 2018-11-14 09:16:28 -08:00
ast_timer.c treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr() 2020-08-22 08:53:37 -06:00
atcpit100_timer.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
atmel_pit_timer.c treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr() 2020-08-22 08:53:37 -06:00
cadence-ttc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dw-apb-timer.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
Kconfig riscv: Rework riscv timer driver to only support S-mode 2020-09-30 08:54:45 +08:00
Makefile timer: Add driver for Nomadik Multi Timer Unit (MTU) 2020-01-22 17:47:56 -05:00
mpc83xx_timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mtk_timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
nomadik-mtu-timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
omap-timer.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
ostm_timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
riscv_timer.c riscv: Rework riscv timer driver to only support S-mode 2020-09-30 08:54:45 +08:00
rockchip_timer.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
sandbox_timer.c regmap: fix regmap_read_poll_timeout warning about sandbox_timer_add_offset 2019-04-23 11:17:15 +02:00
sti-timer.c timer: sti: use clk API to get timer clock rate 2020-03-24 14:23:35 +01:00
stm32_timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
timer-uclass.c common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
tsc_timer.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00