summaryrefslogtreecommitdiff
path: root/drivers/timer
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/timer')
-rw-r--r--drivers/timer/Kconfig40
-rw-r--r--drivers/timer/Makefile1
-rw-r--r--drivers/timer/fttmr010_timer.c91
3 files changed, 13 insertions, 119 deletions
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index cb6fc0e7fda..f9511503b02 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -96,8 +96,8 @@ config ARM_TWD_TIMER
config AST_TIMER
bool "Aspeed ast2400/ast2500 timer support"
- depends on TIMER
- default y if ARCH_ASPEED
+ depends on TIMER && ARCH_ASPEED
+ default y
help
Select this to enable timer for Aspeed ast2400/ast2500 devices.
This is a simple sys timer driver, it is compatible with lib/time.c,
@@ -108,17 +108,10 @@ config AST_TIMER
config AST_IBEX_TIMER
bool "Aspeed ast2700 Ibex timer"
- depends on TIMER
+ depends on TIMER && RISCV
help
Select this to enable a timer support for the Ibex RV32-based MCUs in AST2700.
-config ATCPIT100_TIMER
- bool "ATCPIT100 timer support"
- depends on TIMER
- help
- Select this to enable a ATCPIT100 timer which will be embedded
- in AE3XX, AE250 boards.
-
config ATMEL_PIT_TIMER
bool "Atmel periodic interval timer support"
depends on TIMER
@@ -154,25 +147,18 @@ config SPL_ATMEL_TCB_TIMER
config CADENCE_TTC_TIMER
bool "Cadence TTC (Triple Timer Counter)"
- depends on TIMER
+ depends on TIMER && ARCH_ZYNQMP_R5
help
Enables support for the cadence ttc driver. This driver is present
on Xilinx Zynq and ZynqMP SoCs.
config DESIGNWARE_APB_TIMER
bool "Designware APB Timer"
- depends on TIMER
+ depends on TIMER && (ARCH_SOCFPGA || ARCH_ROCKCHIP)
help
Enables support for the Designware APB Timer driver. This timer is
present on Altera SoCFPGA SoCs.
-config FTTMR010_TIMER
- bool "Faraday Technology timer support"
- depends on TIMER
- help
- Select this to enable support for the timer found on
- devices using Faraday Technology's IP.
-
config GXP_TIMER
bool "HPE GXP Timer"
depends on TIMER
@@ -182,7 +168,7 @@ config GXP_TIMER
config MPC83XX_TIMER
bool "MPC83xx timer support"
- depends on TIMER
+ depends on TIMER && PPC
help
Select this to enable support for the timer found on
devices based on the MPC83xx family of SoCs.
@@ -224,14 +210,14 @@ config NPCM_TIMER
config OMAP_TIMER
bool "Omap timer support"
- depends on TIMER
+ depends on TIMER && (ARCH_OMAP2PLUS || ARCH_K3)
help
Select this to enable an timer for Omap devices.
config ORION_TIMER
bool "Orion timer support"
- depends on TIMER
- default y if ARCH_KIRKWOOD || (ARCH_MVEBU && ARMADA_32BIT)
+ depends on TIMER && (ARCH_KIRKWOOD || (ARCH_MVEBU && ARMADA_32BIT))
+ default y
select TIMER_EARLY if ARCH_MVEBU
help
Select this to enable an timer for Orion and Armada devices
@@ -246,7 +232,7 @@ config RISCV_TIMER
config ROCKCHIP_TIMER
bool "Rockchip timer support"
- depends on TIMER
+ depends on TIMER && ARCH_ROCKCHIP
help
Select this to enable support for the timer found on
Rockchip devices.
@@ -275,14 +261,14 @@ config SP804_TIMER
config STM32_TIMER
bool "STM32 timer support"
- depends on TIMER
+ depends on TIMER && ARCH_STM32
help
Select this to enable support for the timer found on
STM32 devices.
config TEGRA_TIMER
bool "Tegra timer support"
- depends on TIMER
+ depends on TIMER && ARCH_TEGRA
select TIMER_EARLY
help
Select this to enable support for the timer found on
@@ -326,7 +312,7 @@ config MTK_TIMER
config MCHP_PIT64B_TIMER
bool "Microchip 64-bit periodic interval timer support"
- depends on TIMER
+ depends on TIMER && ARCH_AT91
help
Select this to enable support for Microchip 64-bit periodic
interval timer.
diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
index 21db0d317fe..a72e411fb2f 100644
--- a/drivers/timer/Makefile
+++ b/drivers/timer/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_$(PHASE_)ATMEL_PIT_TIMER) += atmel_pit_timer.o
obj-$(CONFIG_$(PHASE_)ATMEL_TCB_TIMER) += atmel_tcb_timer.o
obj-$(CONFIG_CADENCE_TTC_TIMER) += cadence-ttc.o
obj-$(CONFIG_DESIGNWARE_APB_TIMER) += dw-apb-timer.o
-obj-$(CONFIG_FTTMR010_TIMER) += fttmr010_timer.o
obj-$(CONFIG_GXP_TIMER) += gxp-timer.o
obj-$(CONFIG_MPC83XX_TIMER) += mpc83xx_timer.o
obj-$(CONFIG_NOMADIK_MTU_TIMER) += nomadik-mtu-timer.o
diff --git a/drivers/timer/fttmr010_timer.c b/drivers/timer/fttmr010_timer.c
deleted file mode 100644
index c41bbfc1d57..00000000000
--- a/drivers/timer/fttmr010_timer.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang <ratbert@faraday-tech.com>
- *
- * 23/08/2022 Port to DM
- */
-#include <dm.h>
-#include <log.h>
-#include <timer.h>
-#include <asm/io.h>
-#include <dm/ofnode.h>
-#include <faraday/fttmr010.h>
-#include <asm/global_data.h>
-
-#define TIMER_LOAD_VAL 0xffffffff
-
-struct fttmr010_timer_priv {
- struct fttmr010 __iomem *regs;
-};
-
-static u64 fttmr010_timer_get_count(struct udevice *dev)
-{
- struct fttmr010_timer_priv *priv = dev_get_priv(dev);
- struct fttmr010 *tmr = priv->regs;
- u32 now = TIMER_LOAD_VAL - readl(&tmr->timer3_counter);
-
- /* increment tbu if tbl has rolled over */
- if (now < gd->arch.tbl)
- gd->arch.tbu++;
- gd->arch.tbl = now;
-
- return ((u64)gd->arch.tbu << 32) | gd->arch.tbl;
-}
-
-static int fttmr010_timer_probe(struct udevice *dev)
-{
- struct fttmr010_timer_priv *priv = dev_get_priv(dev);
- struct fttmr010 *tmr;
- unsigned int cr;
-
- priv->regs = dev_read_addr_ptr(dev);
- if (!priv->regs)
- return -EINVAL;
- tmr = priv->regs;
-
- debug("Faraday FTTMR010 timer revision 0x%08X\n", readl(&tmr->revision));
-
- /* disable timers */
- writel(0, &tmr->cr);
-
- /* setup timer */
- writel(TIMER_LOAD_VAL, &tmr->timer3_load);
- writel(TIMER_LOAD_VAL, &tmr->timer3_counter);
- writel(0, &tmr->timer3_match1);
- writel(0, &tmr->timer3_match2);
-
- /* we don't want timer to issue interrupts */
- writel(FTTMR010_TM3_MATCH1 |
- FTTMR010_TM3_MATCH2 |
- FTTMR010_TM3_OVERFLOW,
- &tmr->interrupt_mask);
-
- cr = readl(&tmr->cr);
- cr |= FTTMR010_TM3_CLOCK; /* use external clock */
- cr |= FTTMR010_TM3_ENABLE;
- writel(cr, &tmr->cr);
-
- gd->arch.tbl = 0;
- gd->arch.tbu = 0;
-
- return 0;
-}
-
-static const struct timer_ops fttmr010_timer_ops = {
- .get_count = fttmr010_timer_get_count,
-};
-
-static const struct udevice_id fttmr010_timer_ids[] = {
- { .compatible = "faraday,fttmr010-timer" },
- {}
-};
-
-U_BOOT_DRIVER(fttmr010_timer) = {
- .name = "fttmr010_timer",
- .id = UCLASS_TIMER,
- .of_match = fttmr010_timer_ids,
- .priv_auto = sizeof(struct fttmr010_timer_priv),
- .probe = fttmr010_timer_probe,
- .ops = &fttmr010_timer_ops,
-};