Lines Matching +full:fast +full:- +full:clk
1 // SPDX-License-Identifier: GPL-2.0
3 * Pistachio clocksource based on general-purpose timers
10 #include <linux/clk.h>
80 raw_spin_lock_irqsave(&pcs->lock, flags); in pistachio_clocksource_read_cycles()
81 overflow = gpt_readl(pcs->base, TIMER_CURRENT_OVERFLOW_VALUE, 0); in pistachio_clocksource_read_cycles()
82 counter = gpt_readl(pcs->base, TIMER_CURRENT_VALUE, 0); in pistachio_clocksource_read_cycles()
83 raw_spin_unlock_irqrestore(&pcs->lock, flags); in pistachio_clocksource_read_cycles()
99 val = gpt_readl(pcs->base, TIMER_CFG, timeridx); in pistachio_clksrc_set_mode()
105 gpt_writel(pcs->base, val, TIMER_CFG, timeridx); in pistachio_clksrc_set_mode()
114 gpt_writel(pcs->base, RELOAD_VALUE, TIMER_RELOAD_VALUE, timeridx); in pistachio_clksrc_enable()
151 struct clk *sys_clk, *fast_clk; in pistachio_clksrc_of_init()
159 return -ENXIO; in pistachio_clksrc_of_init()
162 periph_regs = syscon_regmap_lookup_by_phandle(node, "img,cr-periph"); in pistachio_clksrc_of_init()
169 /* Switch to using the fast counter clock */ in pistachio_clksrc_of_init()
181 fast_clk = of_clk_get_by_name(node, "fast"); in pistachio_clksrc_of_init()
215 TIMER_OF_DECLARE(pistachio_gptimer, "img,pistachio-gptimer",