Lines Matching +full:hard +full:- +full:wired

1 // SPDX-License-Identifier: GPL-2.0
3 * J-Core SoC PIT/clocksource driver
5 * Copyright (C) 2015-2016 Smart Energy Instruments, Inc.
64 writel(0, pit->base + REG_PITEN); in jcore_pit_disable()
71 writel(delta, pit->base + REG_THROT); in jcore_pit_set()
72 writel(pit->enable_val, pit->base + REG_PITEN); in jcore_pit_set()
94 return jcore_pit_set(pit->periodic_delta, pit); in jcore_pit_set_state_periodic()
110 pr_info("Local J-Core PIT init on cpu %u\n", cpu); in jcore_pit_local_init()
112 buspd = readl(pit->base + REG_BUSPD); in jcore_pit_local_init()
114 pit->periodic_delta = DIV_ROUND_CLOSEST(NSEC_PER_SEC, HZ * buspd); in jcore_pit_local_init()
116 clockevents_config_and_register(&pit->ced, freq, 1, ULONG_MAX); in jcore_pit_local_init()
125 if (clockevent_state_oneshot(&pit->ced)) in jcore_timer_interrupt()
128 pit->ced.event_handler(&pit->ced); in jcore_timer_interrupt()
142 pr_err("Error: Cannot map base address for J-Core PIT\n"); in jcore_pit_init()
143 return -ENXIO; in jcore_pit_init()
148 pr_err("Error: J-Core PIT has no IRQ\n"); in jcore_pit_init()
149 return -ENXIO; in jcore_pit_init()
152 pr_info("Initializing J-Core PIT at %p IRQ %d\n", in jcore_pit_init()
168 return -ENOMEM; in jcore_pit_init()
180 * The J-Core PIT is not hard-wired to a particular IRQ, but in jcore_pit_init()
189 * p is priority, and i is hard irq number. in jcore_pit_init()
192 * any hard irq (trap number) can be programmed via the 8 in jcore_pit_init()
193 * iiiiiiii bits, and a priority (0-15) is programmable in jcore_pit_init()
199 * traps 64-127 (the ones actually intended to be used for in jcore_pit_init()
208 hwirq = irq_get_irq_data(pit_irq)->hwirq; in jcore_pit_init()
217 pit->base = of_iomap(node, cpu); in jcore_pit_init()
218 if (!pit->base) { in jcore_pit_init()
223 pit->ced.name = "jcore_pit"; in jcore_pit_init()
224 pit->ced.features = CLOCK_EVT_FEAT_PERIODIC in jcore_pit_init()
227 pit->ced.cpumask = cpumask_of(cpu); in jcore_pit_init()
228 pit->ced.rating = 400; in jcore_pit_init()
229 pit->ced.irq = pit_irq; in jcore_pit_init()
230 pit->ced.set_state_shutdown = jcore_pit_set_state_shutdown; in jcore_pit_init()
231 pit->ced.set_state_periodic = jcore_pit_set_state_periodic; in jcore_pit_init()
232 pit->ced.set_state_oneshot = jcore_pit_set_state_oneshot; in jcore_pit_init()
233 pit->ced.set_next_event = jcore_pit_set_next_event; in jcore_pit_init()
235 pit->enable_val = enable_val; in jcore_pit_init()