linux/drivers/clocksource/timer-ixp4xx.c

// SPDX-License-Identifier: GPL-2.0
/*
 * IXP4 timer driver
 * Copyright (C) 2019 Linus Walleij <[email protected]>
 *
 * Based on arch/arm/mach-ixp4xx/common.c
 * Copyright 2002 (C) Intel Corporation
 * Copyright 2003-2004 (C) MontaVista, Software, Inc.
 * Copyright (C) Deepak Saxena <[email protected]>
 */
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/clockchips.h>
#include <linux/clocksource.h>
#include <linux/sched_clock.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>

/*
 * Constants to make it easy to access Timer Control/Status registers
 */
#define IXP4XX_OSTS_OFFSET
#define IXP4XX_OST1_OFFSET
#define IXP4XX_OSRT1_OFFSET
#define IXP4XX_OST2_OFFSET
#define IXP4XX_OSRT2_OFFSET
#define IXP4XX_OSST_OFFSET

/*
 * Timer register values and bit definitions
 */
#define IXP4XX_OST_ENABLE
#define IXP4XX_OST_ONE_SHOT
/* Low order bits of reload value ignored */
#define IXP4XX_OST_RELOAD_MASK
#define IXP4XX_OST_DISABLED
#define IXP4XX_OSST_TIMER_1_PEND
#define IXP4XX_OSST_TIMER_2_PEND
#define IXP4XX_OSST_TIMER_TS_PEND
/* Remaining registers are for the watchdog and defined in the watchdog driver */

struct ixp4xx_timer {};

/*
 * A local singleton used by sched_clock and delay timer reads, which are
 * fast and stateless
 */
static struct ixp4xx_timer *local_ixp4xx_timer;

static inline struct ixp4xx_timer *
to_ixp4xx_timer(struct clock_event_device *evt)
{}

static unsigned long ixp4xx_read_timer(void)
{}

static u64 notrace ixp4xx_read_sched_clock(void)
{}

static u64 ixp4xx_clocksource_read(struct clocksource *c)
{}

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

static int ixp4xx_set_next_event(unsigned long cycles,
				 struct clock_event_device *evt)
{}

static int ixp4xx_shutdown(struct clock_event_device *evt)
{}

static int ixp4xx_set_oneshot(struct clock_event_device *evt)
{}

static int ixp4xx_set_periodic(struct clock_event_device *evt)
{}

static int ixp4xx_resume(struct clock_event_device *evt)
{}

/*
 * IXP4xx timer tick
 * We use OS timer1 on the CPU for the timer tick and the timestamp
 * counter as a source of real clock ticks to account for missed jiffies.
 */
static __init int ixp4xx_timer_register(void __iomem *base,
					int timer_irq,
					unsigned int timer_freq)
{}

static struct platform_device ixp4xx_watchdog_device =;

/*
 * This probe gets called after the timer is already up and running. The main
 * function on this platform is to spawn the watchdog device as a child.
 */
static int ixp4xx_timer_probe(struct platform_device *pdev)
{}

static const struct of_device_id ixp4xx_timer_dt_id[] =;

static struct platform_driver ixp4xx_timer_driver =;
builtin_platform_driver();

static __init int ixp4xx_of_timer_init(struct device_node *np)
{}
TIMER_OF_DECLARE(ixp4xx, "intel,ixp4xx-timer", ixp4xx_of_timer_init);