You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'timers/core' into smp/hotplug to pick up dependencies
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
Oxford Semiconductor OXNAS SoCs Family RPS Timer
|
||||
================================================
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be "oxsemi,ox810se-rps-timer"
|
||||
- reg : Specifies base physical address and size of the registers.
|
||||
- interrupts : The interrupts of the two timers
|
||||
- clocks : The phandle of the timer clock source
|
||||
|
||||
example:
|
||||
|
||||
timer0: timer@200 {
|
||||
compatible = "oxsemi,ox810se-rps-timer";
|
||||
reg = <0x200 0x40>;
|
||||
clocks = <&rpsclk>;
|
||||
interrupts = <4 5>;
|
||||
};
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
Rockchip rk3288 timer
|
||||
Rockchip rk timer
|
||||
|
||||
Required properties:
|
||||
- compatible: shall be "rockchip,rk3288-timer"
|
||||
- compatible: shall be one of:
|
||||
"rockchip,rk3288-timer" - for rk3066, rk3036, rk3188, rk322x, rk3288, rk3368
|
||||
"rockchip,rk3399-timer" - for rk3399
|
||||
- reg: base address of the timer register starting with TIMERS CONTROL register
|
||||
- interrupts: should contain the interrupts for Timer0
|
||||
- clocks : must contain an entry for each entry in clock-names
|
||||
@@ -687,6 +687,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
[SPARC64] tick
|
||||
[X86-64] hpet,tsc
|
||||
|
||||
clocksource.arm_arch_timer.evtstrm=
|
||||
[ARM,ARM64]
|
||||
Format: <bool>
|
||||
Enable/disable the eventstream feature of the ARM
|
||||
architected timer so that code using WFE-based polling
|
||||
loops can be debugged more effectively on production
|
||||
systems.
|
||||
|
||||
clearcpuid=BITNUM [X86]
|
||||
Disable CPUID feature X for the kernel. See
|
||||
arch/x86/include/asm/cpufeatures.h for the valid bit
|
||||
|
||||
+39
-24
@@ -116,19 +116,19 @@ static struct clocksource arc_counter_gfrc = {
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
static void __init arc_cs_setup_gfrc(struct device_node *node)
|
||||
static int __init arc_cs_setup_gfrc(struct device_node *node)
|
||||
{
|
||||
int exists = cpuinfo_arc700[0].extn.gfrc;
|
||||
int ret;
|
||||
|
||||
if (WARN(!exists, "Global-64-bit-Ctr clocksource not detected"))
|
||||
return;
|
||||
return -ENXIO;
|
||||
|
||||
ret = arc_get_timer_clk(node);
|
||||
if (ret)
|
||||
return;
|
||||
return ret;
|
||||
|
||||
clocksource_register_hz(&arc_counter_gfrc, arc_timer_freq);
|
||||
return clocksource_register_hz(&arc_counter_gfrc, arc_timer_freq);
|
||||
}
|
||||
CLOCKSOURCE_OF_DECLARE(arc_gfrc, "snps,archs-timer-gfrc", arc_cs_setup_gfrc);
|
||||
|
||||
@@ -172,25 +172,25 @@ static struct clocksource arc_counter_rtc = {
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
static void __init arc_cs_setup_rtc(struct device_node *node)
|
||||
static int __init arc_cs_setup_rtc(struct device_node *node)
|
||||
{
|
||||
int exists = cpuinfo_arc700[smp_processor_id()].extn.rtc;
|
||||
int ret;
|
||||
|
||||
if (WARN(!exists, "Local-64-bit-Ctr clocksource not detected"))
|
||||
return;
|
||||
return -ENXIO;
|
||||
|
||||
/* Local to CPU hence not usable in SMP */
|
||||
if (WARN(IS_ENABLED(CONFIG_SMP), "Local-64-bit-Ctr not usable in SMP"))
|
||||
return;
|
||||
return -EINVAL;
|
||||
|
||||
ret = arc_get_timer_clk(node);
|
||||
if (ret)
|
||||
return;
|
||||
return ret;
|
||||
|
||||
write_aux_reg(AUX_RTC_CTRL, 1);
|
||||
|
||||
clocksource_register_hz(&arc_counter_rtc, arc_timer_freq);
|
||||
return clocksource_register_hz(&arc_counter_rtc, arc_timer_freq);
|
||||
}
|
||||
CLOCKSOURCE_OF_DECLARE(arc_rtc, "snps,archs-timer-rtc", arc_cs_setup_rtc);
|
||||
|
||||
@@ -213,23 +213,23 @@ static struct clocksource arc_counter_timer1 = {
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
static void __init arc_cs_setup_timer1(struct device_node *node)
|
||||
static int __init arc_cs_setup_timer1(struct device_node *node)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Local to CPU hence not usable in SMP */
|
||||
if (IS_ENABLED(CONFIG_SMP))
|
||||
return;
|
||||
return -EINVAL;
|
||||
|
||||
ret = arc_get_timer_clk(node);
|
||||
if (ret)
|
||||
return;
|
||||
return ret;
|
||||
|
||||
write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMER_MAX);
|
||||
write_aux_reg(ARC_REG_TIMER1_CNT, 0);
|
||||
write_aux_reg(ARC_REG_TIMER1_CTRL, TIMER_CTRL_NH);
|
||||
|
||||
clocksource_register_hz(&arc_counter_timer1, arc_timer_freq);
|
||||
return clocksource_register_hz(&arc_counter_timer1, arc_timer_freq);
|
||||
}
|
||||
|
||||
/********** Clock Event Device *********/
|
||||
@@ -324,20 +324,28 @@ static struct notifier_block arc_timer_cpu_nb = {
|
||||
/*
|
||||
* clockevent setup for boot CPU
|
||||
*/
|
||||
static void __init arc_clockevent_setup(struct device_node *node)
|
||||
static int __init arc_clockevent_setup(struct device_node *node)
|
||||
{
|
||||
struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
|
||||
int ret;
|
||||
|
||||
register_cpu_notifier(&arc_timer_cpu_nb);
|
||||
ret = register_cpu_notifier(&arc_timer_cpu_nb);
|
||||
if (ret) {
|
||||
pr_err("Failed to register cpu notifier");
|
||||
return ret;
|
||||
}
|
||||
|
||||
arc_timer_irq = irq_of_parse_and_map(node, 0);
|
||||
if (arc_timer_irq <= 0)
|
||||
panic("clockevent: missing irq");
|
||||
if (arc_timer_irq <= 0) {
|
||||
pr_err("clockevent: missing irq");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = arc_get_timer_clk(node);
|
||||
if (ret)
|
||||
panic("clockevent: missing clk");
|
||||
if (ret) {
|
||||
pr_err("clockevent: missing clk");
|
||||
return ret;
|
||||
}
|
||||
|
||||
evt->irq = arc_timer_irq;
|
||||
evt->cpumask = cpumask_of(smp_processor_id());
|
||||
@@ -347,22 +355,29 @@ static void __init arc_clockevent_setup(struct device_node *node)
|
||||
/* Needs apriori irq_set_percpu_devid() done in intc map function */
|
||||
ret = request_percpu_irq(arc_timer_irq, timer_irq_handler,
|
||||
"Timer0 (per-cpu-tick)", evt);
|
||||
if (ret)
|
||||
panic("clockevent: unable to request irq\n");
|
||||
if (ret) {
|
||||
pr_err("clockevent: unable to request irq\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
enable_percpu_irq(arc_timer_irq, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init arc_of_timer_init(struct device_node *np)
|
||||
static int __init arc_of_timer_init(struct device_node *np)
|
||||
{
|
||||
static int init_count = 0;
|
||||
int ret;
|
||||
|
||||
if (!init_count) {
|
||||
init_count = 1;
|
||||
arc_clockevent_setup(np);
|
||||
ret = arc_clockevent_setup(np);
|
||||
} else {
|
||||
arc_cs_setup_timer1(np);
|
||||
ret = arc_cs_setup_timer1(np);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer", arc_of_timer_init);
|
||||
|
||||
|
||||
+1
-1
@@ -358,10 +358,10 @@ config ARCH_CLPS711X
|
||||
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select AUTO_ZRELADDR
|
||||
select CLKSRC_MMIO
|
||||
select COMMON_CLK
|
||||
select CPU_ARM720T
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select CLPS711X_TIMER
|
||||
select MFD_SYSCON
|
||||
select SOC_BUS
|
||||
help
|
||||
|
||||
@@ -390,7 +390,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static void __init twd_local_timer_of_register(struct device_node *np)
|
||||
static int __init twd_local_timer_of_register(struct device_node *np)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -410,6 +410,7 @@ static void __init twd_local_timer_of_register(struct device_node *np)
|
||||
|
||||
out:
|
||||
WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
|
||||
return err;
|
||||
}
|
||||
CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
|
||||
CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
|
||||
|
||||
@@ -89,6 +89,7 @@ config ARCH_BCM_MOBILE
|
||||
select HAVE_ARM_ARCH_TIMER
|
||||
select PINCTRL
|
||||
select ARCH_BCM_MOBILE_SMP if SMP
|
||||
select BCM_KONA_TIMER
|
||||
help
|
||||
This enables support for systems based on Broadcom mobile SoCs.
|
||||
|
||||
@@ -143,6 +144,7 @@ config ARCH_BCM2835
|
||||
select ARM_TIMER_SP804
|
||||
select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
|
||||
select CLKSRC_OF
|
||||
select BCM2835_TIMER
|
||||
select PINCTRL
|
||||
select PINCTRL_BCM2835
|
||||
help
|
||||
|
||||
@@ -20,7 +20,7 @@ if ARCH_INTEGRATOR
|
||||
|
||||
config ARCH_INTEGRATOR_AP
|
||||
bool "Support Integrator/AP and Integrator/PP2 platforms"
|
||||
select CLKSRC_MMIO
|
||||
select INTEGRATOR_AP_TIMER
|
||||
select MIGHT_HAVE_PCI
|
||||
select SERIAL_AMBA_PL010 if TTY
|
||||
select SERIAL_AMBA_PL010_CONSOLE if TTY
|
||||
|
||||
@@ -4,7 +4,7 @@ config ARCH_KEYSTONE
|
||||
depends on ARM_PATCH_PHYS_VIRT
|
||||
select ARM_GIC
|
||||
select HAVE_ARM_ARCH_TIMER
|
||||
select CLKSRC_MMIO
|
||||
select KEYSTONE_TIMER
|
||||
select ARM_ERRATA_798181 if SMP
|
||||
select COMMON_CLK_KEYSTONE
|
||||
select ARCH_SUPPORTS_BIG_ENDIAN
|
||||
|
||||
@@ -3,7 +3,7 @@ menuconfig ARCH_MOXART
|
||||
depends on ARCH_MULTI_V4
|
||||
select CPU_FA526
|
||||
select ARM_DMA_MEM_BUFFERABLE
|
||||
select CLKSRC_MMIO
|
||||
select MOXART_TIMER
|
||||
select GENERIC_IRQ_CHIP
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select PHYLIB if NETDEVICES
|
||||
|
||||
@@ -16,7 +16,7 @@ config ARCH_MXS
|
||||
bool "Freescale MXS (i.MX23, i.MX28) support"
|
||||
depends on ARCH_MULTI_V5
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select CLKSRC_MMIO
|
||||
select MXS_TIMER
|
||||
select PINCTRL
|
||||
select SOC_BUS
|
||||
select SOC_IMX23
|
||||
|
||||
@@ -7,5 +7,6 @@ config ARCH_NSPIRE
|
||||
select ARM_AMBA
|
||||
select ARM_VIC
|
||||
select ARM_TIMER_SP804
|
||||
select NSPIRE_TIMER
|
||||
help
|
||||
This enables support for systems using the TI-NSPIRE CPU
|
||||
|
||||
@@ -28,6 +28,7 @@ config ARCH_ATLAS7
|
||||
default y
|
||||
select ARM_GIC
|
||||
select CPU_V7
|
||||
select ATLAS7_TIMER
|
||||
select HAVE_ARM_SCU if SMP
|
||||
select HAVE_SMP
|
||||
help
|
||||
@@ -38,6 +39,7 @@ config ARCH_PRIMA2
|
||||
default y
|
||||
select SIRF_IRQ
|
||||
select ZONE_DMA
|
||||
select PRIMA2_TIMER
|
||||
help
|
||||
Support for CSR SiRFSoC ARM Cortex A9 Platform
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ menuconfig ARCH_U300
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select ARM_AMBA
|
||||
select ARM_VIC
|
||||
select CLKSRC_MMIO
|
||||
select U300_TIMER
|
||||
select CPU_ARM926T
|
||||
select HAVE_TCM
|
||||
select PINCTRL
|
||||
|
||||
@@ -492,6 +492,14 @@
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
|
||||
rktimer: rktimer@ff850000 {
|
||||
compatible = "rockchip,rk3399-timer";
|
||||
reg = <0x0 0xff850000 0x0 0x1000>;
|
||||
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&cru PCLK_TIMER0>, <&cru SCLK_TIMER00>;
|
||||
clock-names = "pclk", "timer";
|
||||
};
|
||||
|
||||
spdif: spdif@ff870000 {
|
||||
compatible = "rockchip,rk3399-spdif";
|
||||
reg = <0x0 0xff870000 0x0 0x1000>;
|
||||
|
||||
@@ -170,7 +170,7 @@ static struct irqaction timer_irqaction = {
|
||||
.dev_id = &clockevent_xilinx_timer,
|
||||
};
|
||||
|
||||
static __init void xilinx_clockevent_init(void)
|
||||
static __init int xilinx_clockevent_init(void)
|
||||
{
|
||||
clockevent_xilinx_timer.mult =
|
||||
div_sc(timer_clock_freq, NSEC_PER_SEC,
|
||||
@@ -181,6 +181,8 @@ static __init void xilinx_clockevent_init(void)
|
||||
clockevent_delta2ns(1, &clockevent_xilinx_timer);
|
||||
clockevent_xilinx_timer.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_xilinx_timer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u64 xilinx_clock_read(void)
|
||||
@@ -229,8 +231,14 @@ static struct clocksource clocksource_microblaze = {
|
||||
|
||||
static int __init xilinx_clocksource_init(void)
|
||||
{
|
||||
if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
|
||||
panic("failed to register clocksource");
|
||||
int ret;
|
||||
|
||||
ret = clocksource_register_hz(&clocksource_microblaze,
|
||||
timer_clock_freq);
|
||||
if (ret) {
|
||||
pr_err("failed to register clocksource");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* stop timer1 */
|
||||
write_fn(read_fn(timer_baseaddr + TCSR1) & ~TCSR_ENT,
|
||||
@@ -239,16 +247,16 @@ static int __init xilinx_clocksource_init(void)
|
||||
write_fn(TCSR_TINT|TCSR_ENT|TCSR_ARHT, timer_baseaddr + TCSR1);
|
||||
|
||||
/* register timecounter - for ftrace support */
|
||||
init_xilinx_timecounter();
|
||||
return 0;
|
||||
return init_xilinx_timecounter();
|
||||
}
|
||||
|
||||
static void __init xilinx_timer_init(struct device_node *timer)
|
||||
static int __init xilinx_timer_init(struct device_node *timer)
|
||||
{
|
||||
struct clk *clk;
|
||||
static int initialized;
|
||||
u32 irq;
|
||||
u32 timer_num = 1;
|
||||
int ret;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
@@ -258,7 +266,7 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
||||
timer_baseaddr = of_iomap(timer, 0);
|
||||
if (!timer_baseaddr) {
|
||||
pr_err("ERROR: invalid timer base address\n");
|
||||
BUG();
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
write_fn = timer_write32;
|
||||
@@ -271,11 +279,15 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
||||
}
|
||||
|
||||
irq = irq_of_parse_and_map(timer, 0);
|
||||
if (irq <= 0) {
|
||||
pr_err("Failed to parse and map irq");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
of_property_read_u32(timer, "xlnx,one-timer-only", &timer_num);
|
||||
if (timer_num) {
|
||||
pr_emerg("Please enable two timers in HW\n");
|
||||
BUG();
|
||||
pr_err("Please enable two timers in HW\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pr_info("%s: irq=%d\n", timer->full_name, irq);
|
||||
@@ -297,14 +309,27 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
||||
|
||||
freq_div_hz = timer_clock_freq / HZ;
|
||||
|
||||
setup_irq(irq, &timer_irqaction);
|
||||
ret = setup_irq(irq, &timer_irqaction);
|
||||
if (ret) {
|
||||
pr_err("Failed to setup IRQ");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HEART_BEAT
|
||||
microblaze_setup_heartbeat();
|
||||
#endif
|
||||
xilinx_clocksource_init();
|
||||
xilinx_clockevent_init();
|
||||
|
||||
ret = xilinx_clocksource_init();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = xilinx_clockevent_init();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sched_clock_register(xilinx_clock_read, 32, timer_clock_freq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CLOCKSOURCE_OF_DECLARE(xilinx_timer, "xlnx,xps-timer-1.00.a",
|
||||
|
||||
@@ -117,11 +117,13 @@ static int systick_set_oneshot(struct clock_event_device *evt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init ralink_systick_init(struct device_node *np)
|
||||
static int __init ralink_systick_init(struct device_node *np)
|
||||
{
|
||||
int ret;
|
||||
|
||||
systick.membase = of_iomap(np, 0);
|
||||
if (!systick.membase)
|
||||
return;
|
||||
return -ENXIO;
|
||||
|
||||
systick_irqaction.name = np->name;
|
||||
systick.dev.name = np->name;
|
||||
@@ -131,16 +133,21 @@ static void __init ralink_systick_init(struct device_node *np)
|
||||
systick.dev.irq = irq_of_parse_and_map(np, 0);
|
||||
if (!systick.dev.irq) {
|
||||
pr_err("%s: request_irq failed", np->name);
|
||||
return;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
clocksource_mmio_init(systick.membase + SYSTICK_COUNT, np->name,
|
||||
SYSTICK_FREQ, 301, 16, clocksource_mmio_readl_up);
|
||||
ret = clocksource_mmio_init(systick.membase + SYSTICK_COUNT, np->name,
|
||||
SYSTICK_FREQ, 301, 16,
|
||||
clocksource_mmio_readl_up);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
clockevents_register_device(&systick.dev);
|
||||
|
||||
pr_info("%s: running - mult: %d, shift: %d\n",
|
||||
np->name, systick.dev.mult, systick.dev.shift);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CLOCKSOURCE_OF_DECLARE(systick, "ralink,cevt-systick", ralink_systick_init);
|
||||
|
||||
+44
-19
@@ -206,15 +206,21 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void __init nios2_timer_get_base_and_freq(struct device_node *np,
|
||||
static int __init nios2_timer_get_base_and_freq(struct device_node *np,
|
||||
void __iomem **base, u32 *freq)
|
||||
{
|
||||
*base = of_iomap(np, 0);
|
||||
if (!*base)
|
||||
panic("Unable to map reg for %s\n", np->name);
|
||||
if (!*base) {
|
||||
pr_crit("Unable to map reg for %s\n", np->name);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
if (of_property_read_u32(np, "clock-frequency", freq))
|
||||
panic("Unable to get %s clock frequency\n", np->name);
|
||||
if (of_property_read_u32(np, "clock-frequency", freq)) {
|
||||
pr_crit("Unable to get %s clock frequency\n", np->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct nios2_clockevent_dev nios2_ce = {
|
||||
@@ -231,17 +237,21 @@ static struct nios2_clockevent_dev nios2_ce = {
|
||||
},
|
||||
};
|
||||
|
||||
static __init void nios2_clockevent_init(struct device_node *timer)
|
||||
static __init int nios2_clockevent_init(struct device_node *timer)
|
||||
{
|
||||
void __iomem *iobase;
|
||||
u32 freq;
|
||||
int irq;
|
||||
int irq, ret;
|
||||
|
||||
nios2_timer_get_base_and_freq(timer, &iobase, &freq);
|
||||
ret = nios2_timer_get_base_and_freq(timer, &iobase, &freq);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
irq = irq_of_parse_and_map(timer, 0);
|
||||
if (!irq)
|
||||
panic("Unable to parse timer irq\n");
|
||||
if (!irq) {
|
||||
pr_crit("Unable to parse timer irq\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nios2_ce.timer.base = iobase;
|
||||
nios2_ce.timer.freq = freq;
|
||||
@@ -253,25 +263,35 @@ static __init void nios2_clockevent_init(struct device_node *timer)
|
||||
/* clear pending interrupt */
|
||||
timer_writew(&nios2_ce.timer, 0, ALTERA_TIMER_STATUS_REG);
|
||||
|
||||
if (request_irq(irq, timer_interrupt, IRQF_TIMER, timer->name,
|
||||
&nios2_ce.ced))
|
||||
panic("Unable to setup timer irq\n");
|
||||
ret = request_irq(irq, timer_interrupt, IRQF_TIMER, timer->name,
|
||||
&nios2_ce.ced);
|
||||
if (ret) {
|
||||
pr_crit("Unable to setup timer irq\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
clockevents_config_and_register(&nios2_ce.ced, freq, 1, ULONG_MAX);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __init void nios2_clocksource_init(struct device_node *timer)
|
||||
static __init int nios2_clocksource_init(struct device_node *timer)
|
||||
{
|
||||
unsigned int ctrl;
|
||||
void __iomem *iobase;
|
||||
u32 freq;
|
||||
int ret;
|
||||
|
||||
nios2_timer_get_base_and_freq(timer, &iobase, &freq);
|
||||
ret = nios2_timer_get_base_and_freq(timer, &iobase, &freq);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
nios2_cs.timer.base = iobase;
|
||||
nios2_cs.timer.freq = freq;
|
||||
|
||||
clocksource_register_hz(&nios2_cs.cs, freq);
|
||||
ret = clocksource_register_hz(&nios2_cs.cs, freq);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
timer_writew(&nios2_cs.timer, USHRT_MAX, ALTERA_TIMER_PERIODL_REG);
|
||||
timer_writew(&nios2_cs.timer, USHRT_MAX, ALTERA_TIMER_PERIODH_REG);
|
||||
@@ -282,6 +302,8 @@ static __init void nios2_clocksource_init(struct device_node *timer)
|
||||
|
||||
/* Calibrate the delay loop directly */
|
||||
lpj_fine = freq / HZ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -289,22 +311,25 @@ static __init void nios2_clocksource_init(struct device_node *timer)
|
||||
* more instances, the second one gets used as clocksource and all
|
||||
* others are unused.
|
||||
*/
|
||||
static void __init nios2_time_init(struct device_node *timer)
|
||||
static int __init nios2_time_init(struct device_node *timer)
|
||||
{
|
||||
static int num_called;
|
||||
int ret;
|
||||
|
||||
switch (num_called) {
|
||||
case 0:
|
||||
nios2_clockevent_init(timer);
|
||||
ret = nios2_clockevent_init(timer);
|
||||
break;
|
||||
case 1:
|
||||
nios2_clocksource_init(timer);
|
||||
ret = nios2_clocksource_init(timer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
num_called++;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void read_persistent_clock(struct timespec *ts)
|
||||
|
||||
@@ -919,7 +919,7 @@ static void uv_heartbeat(unsigned long ignored)
|
||||
uv_set_scir_bits(bits);
|
||||
|
||||
/* enable next timer period */
|
||||
mod_timer_pinned(timer, jiffies + SCIR_CPU_HB_INTERVAL);
|
||||
mod_timer(timer, jiffies + SCIR_CPU_HB_INTERVAL);
|
||||
}
|
||||
|
||||
static void uv_heartbeat_enable(int cpu)
|
||||
@@ -928,7 +928,7 @@ static void uv_heartbeat_enable(int cpu)
|
||||
struct timer_list *timer = &uv_cpu_scir_info(cpu)->timer;
|
||||
|
||||
uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
|
||||
setup_timer(timer, uv_heartbeat, cpu);
|
||||
setup_pinned_timer(timer, uv_heartbeat, cpu);
|
||||
timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
|
||||
add_timer_on(timer, cpu);
|
||||
uv_cpu_scir_info(cpu)->enabled = 1;
|
||||
|
||||
@@ -1309,7 +1309,7 @@ static void __restart_timer(struct timer_list *t, unsigned long interval)
|
||||
|
||||
if (timer_pending(t)) {
|
||||
if (time_before(when, t->expires))
|
||||
mod_timer_pinned(t, when);
|
||||
mod_timer(t, when);
|
||||
} else {
|
||||
t->expires = round_jiffies(when);
|
||||
add_timer_on(t, smp_processor_id());
|
||||
@@ -1735,7 +1735,7 @@ static void __mcheck_cpu_init_timer(void)
|
||||
struct timer_list *t = this_cpu_ptr(&mce_timer);
|
||||
unsigned int cpu = smp_processor_id();
|
||||
|
||||
setup_timer(t, mce_timer_fn, cpu);
|
||||
setup_pinned_timer(t, mce_timer_fn, cpu);
|
||||
mce_start_timer(cpu, t);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user