linux/drivers/clocksource/timer-sun4i.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Allwinner A1X SoCs timer handling.
 *
 * Copyright (C) 2012 Maxime Ripard
 *
 * Maxime Ripard <[email protected]>
 *
 * Based on code from
 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
 * Benn Huang <[email protected]>
 */

#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqreturn.h>
#include <linux/sched_clock.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>

#include "timer-of.h"

#define TIMER_IRQ_EN_REG
#define TIMER_IRQ_EN(val)
#define TIMER_IRQ_ST_REG
#define TIMER_IRQ_CLEAR(val)
#define TIMER_CTL_REG(val)
#define TIMER_CTL_ENABLE
#define TIMER_CTL_RELOAD
#define TIMER_CTL_CLK_SRC(val)
#define TIMER_CTL_CLK_SRC_OSC24M
#define TIMER_CTL_CLK_PRES(val)
#define TIMER_CTL_ONESHOT
#define TIMER_INTVAL_REG(val)
#define TIMER_CNTVAL_REG(val)

#define TIMER_SYNC_TICKS

/*
 * When we disable a timer, we need to wait at least for 2 cycles of
 * the timer source clock. We will use for that the clocksource timer
 * that is already setup and runs at the same frequency than the other
 * timers, and we never will be disabled.
 */
static void sun4i_clkevt_sync(void __iomem *base)
{}

static void sun4i_clkevt_time_stop(void __iomem *base, u8 timer)
{}

static void sun4i_clkevt_time_setup(void __iomem *base, u8 timer,
				    unsigned long delay)
{}

static void sun4i_clkevt_time_start(void __iomem *base, u8 timer,
				    bool periodic)
{}

static int sun4i_clkevt_shutdown(struct clock_event_device *evt)
{}

static int sun4i_clkevt_set_oneshot(struct clock_event_device *evt)
{}

static int sun4i_clkevt_set_periodic(struct clock_event_device *evt)
{}

static int sun4i_clkevt_next_event(unsigned long evt,
				   struct clock_event_device *clkevt)
{}

static void sun4i_timer_clear_interrupt(void __iomem *base)
{}

static irqreturn_t sun4i_timer_interrupt(int irq, void *dev_id)
{}

static struct timer_of to =;

static u64 notrace sun4i_timer_sched_read(void)
{}

static int __init sun4i_timer_init(struct device_node *node)
{}
TIMER_OF_DECLARE(sun4i, "allwinner,sun4i-a10-timer",
		       sun4i_timer_init);
TIMER_OF_DECLARE(sun8i_a23, "allwinner,sun8i-a23-timer",
		 sun4i_timer_init);
TIMER_OF_DECLARE(sun8i_v3s, "allwinner,sun8i-v3s-timer",
		 sun4i_timer_init);
TIMER_OF_DECLARE(suniv, "allwinner,suniv-f1c100s-timer",
		       sun4i_timer_init);