mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-13 00:56:51 +07:00
6bb27d7349
Now that the only field in struct sys_timer is .init, delete the struct, and replace the machine descriptor .timer field with the initialization function itself. This will enable moving timer drivers into drivers/clocksource without having to place a public prototype of each struct sys_timer object into include/linux; the intent is to create a single of_clocksource_init() function that determines which timer driver to initialize by scanning the device dtree, much like the proposed irqchip_init() at: http://www.spinics.net/lists/arm-kernel/msg203686.html Includes mach-omap2 fixes from Igor Grinberg. Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Stephen Warren <swarren@nvidia.com>
58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
/*
|
|
* linux/arch/arm/mach-h720x/cpu-h7201.c
|
|
*
|
|
* Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
|
|
* 2003 Robert Schwebel <r.schwebel@pengutronix.de>
|
|
* 2004 Sascha Hauer <s.hauer@pengutronix.de>
|
|
*
|
|
* processor specific stuff for the Hynix h7201
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/module.h>
|
|
#include <asm/types.h>
|
|
#include <mach/hardware.h>
|
|
#include <asm/irq.h>
|
|
#include <mach/irqs.h>
|
|
#include <asm/mach/irq.h>
|
|
#include <asm/mach/time.h>
|
|
#include "common.h"
|
|
/*
|
|
* Timer interrupt handler
|
|
*/
|
|
static irqreturn_t
|
|
h7201_timer_interrupt(int irq, void *dev_id)
|
|
{
|
|
CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
|
|
timer_tick();
|
|
|
|
return IRQ_HANDLED;
|
|
}
|
|
|
|
static struct irqaction h7201_timer_irq = {
|
|
.name = "h7201 Timer Tick",
|
|
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
|
.handler = h7201_timer_interrupt,
|
|
};
|
|
|
|
/*
|
|
* Setup TIMER0 as system timer
|
|
*/
|
|
void __init h7201_timer_init(void)
|
|
{
|
|
arch_gettimeoffset = h720x_gettimeoffset;
|
|
|
|
CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
|
|
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
|
|
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
|
|
CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
|
|
|
|
setup_irq(IRQ_TIMER0, &h7201_timer_irq);
|
|
}
|