#include <dm.h>
#include <init.h>
#include <log.h>
+#include <asm/global_data.h>
#include <dm/ofnode.h>
#include <mapmem.h>
#include <asm/arch-rockchip/timer.h>
/* The timer is available */
rate = timer_get_rate(gd->timer);
timer_get_count(gd->timer, &ticks);
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
- } else if (ret == -EAGAIN) {
+ } else if (CONFIG_IS_ENABLED(OF_REAL) && ret == -EAGAIN) {
/* We have been called so early that the DM is not ready,... */
ofnode node = offset_to_ofnode(-1);
struct rk_timer *timer = NULL;
debug("%s: could not read clock-frequency\n", __func__);
return 0;
}
-#endif
} else {
return 0;
}
static int rockchip_clk_of_to_plat(struct udevice *dev)
{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
- struct rockchip_timer_priv *priv = dev_get_priv(dev);
+ if (CONFIG_IS_ENABLED(OF_REAL)) {
+ struct rockchip_timer_priv *priv = dev_get_priv(dev);
- priv->timer = dev_read_addr_ptr(dev);
- if (!priv->timer)
- return -ENOENT;
-#endif
+ priv->timer = dev_read_addr_ptr(dev);
+ if (!priv->timer)
+ return -ENOENT;
+ }
return 0;
}