struct altera_timer_platdata {
struct altera_timer_regs *regs;
- unsigned long clock_rate;
};
static int altera_timer_get_count(struct udevice *dev, unsigned long *count)
static int altera_timer_probe(struct udevice *dev)
{
- struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct altera_timer_platdata *plat = dev->platdata;
struct altera_timer_regs *const regs = plat->regs;
- uc_priv->clock_rate = plat->clock_rate;
-
writel(0, ®s->status);
writel(0, ®s->control);
writel(ALTERA_TIMER_STOP, ®s->control);
plat->regs = map_physmem(dev_get_addr(dev),
sizeof(struct altera_timer_regs),
MAP_NOCACHE);
- plat->clock_rate = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
- "clock-frequency", 0);
return 0;
}