#include <linux/of_address.h>
#include <linux/clockchips.h>
#define TIMER_MODE_CONTINOUS 0x1
#define TIMER_DOWNCOUNT_VAL 0xffffffff
#define PRCMU_TIMER_REF 0
#define PRCMU_TIMER_DOWNCOUNT 0x4
#define PRCMU_TIMER_MODE 0x8
static void __iomem *clksrc_dbx500_timer_base;
static u64 notrace clksrc_dbx500_prcmu_read(struct clocksource *cs)
void __iomem *base = clksrc_dbx500_timer_base;
count = readl_relaxed(base + PRCMU_TIMER_DOWNCOUNT);
count2 = readl_relaxed(base + PRCMU_TIMER_DOWNCOUNT);
} while (count2 != count);
static struct clocksource clocksource_dbx500_prcmu = {
.name = "dbx500-prcmu-timer",
.read = clksrc_dbx500_prcmu_read,
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP,
static int __init clksrc_dbx500_prcmu_init(struct device_node *node)
clksrc_dbx500_timer_base = of_iomap(node, 0);
if (readl(clksrc_dbx500_timer_base + PRCMU_TIMER_MODE) !=