linux/drivers/clocksource/timer-meson6.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Amlogic Meson6 SoCs timer handling.
 *
 * Copyright (C) 2014 Carlo Caione <[email protected]>
 *
 * Based on code from Amlogic, Inc
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#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>

#ifdef CONFIG_ARM
#include <linux/delay.h>
#endif

#define MESON_ISA_TIMER_MUX
#define MESON_ISA_TIMER_MUX_TIMERD_EN
#define MESON_ISA_TIMER_MUX_TIMERC_EN
#define MESON_ISA_TIMER_MUX_TIMERB_EN
#define MESON_ISA_TIMER_MUX_TIMERA_EN
#define MESON_ISA_TIMER_MUX_TIMERD_MODE
#define MESON_ISA_TIMER_MUX_TIMERC_MODE
#define MESON_ISA_TIMER_MUX_TIMERB_MODE
#define MESON_ISA_TIMER_MUX_TIMERA_MODE
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_MASK
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_SYSTEM_CLOCK
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_1US
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_10US
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_100US
#define MESON_ISA_TIMER_MUX_TIMERE_INPUT_CLOCK_1MS
#define MESON_ISA_TIMER_MUX_TIMERD_INPUT_CLOCK_MASK
#define MESON_ISA_TIMER_MUX_TIMERC_INPUT_CLOCK_MASK
#define MESON_ISA_TIMER_MUX_TIMERB_INPUT_CLOCK_MASK
#define MESON_ISA_TIMER_MUX_TIMERA_INPUT_CLOCK_MASK
#define MESON_ISA_TIMER_MUX_TIMERABCD_INPUT_CLOCK_1US
#define MESON_ISA_TIMER_MUX_TIMERABCD_INPUT_CLOCK_10US
#define MESON_ISA_TIMER_MUX_TIMERABCD_INPUT_CLOCK_100US
#define MESON_ISA_TIMER_MUX_TIMERABCD_INPUT_CLOCK_1MS

#define MESON_ISA_TIMERA
#define MESON_ISA_TIMERB
#define MESON_ISA_TIMERC
#define MESON_ISA_TIMERD
#define MESON_ISA_TIMERE

static void __iomem *timer_base;

#ifdef CONFIG_ARM
static unsigned long meson6_read_current_timer(void)
{
	return readl_relaxed(timer_base + MESON_ISA_TIMERE);
}

static struct delay_timer meson6_delay_timer = {
	.read_current_timer = meson6_read_current_timer,
	.freq = 1000 * 1000,
};
#endif

static u64 notrace meson6_timer_sched_read(void)
{}

static void meson6_clkevt_time_stop(void)
{}

static void meson6_clkevt_time_setup(unsigned long delay)
{}

static void meson6_clkevt_time_start(bool periodic)
{}

static int meson6_shutdown(struct clock_event_device *evt)
{}

static int meson6_set_oneshot(struct clock_event_device *evt)
{}

static int meson6_set_periodic(struct clock_event_device *evt)
{}

static int meson6_clkevt_next_event(unsigned long evt,
				    struct clock_event_device *unused)
{}

static struct clock_event_device meson6_clockevent =;

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

static int __init meson6_timer_init(struct device_node *node)
{}
TIMER_OF_DECLARE(meson6, "amlogic,meson6-timer",
		       meson6_timer_init);