- node = fdtdec_get_chosen_node(blob, "tick-timer");
- if (node < 0) {
- /* No chosen timer, trying first available timer */
+ node = ofnode_get_chosen_node("tick-timer");
+
+ if (ofnode_valid(node) &&
+ uclass_get_device_by_ofnode(UCLASS_TIMER, node, &dev)) {
+ /*
+ * If the timer is not marked to be bound before
+ * relocation, bind it anyway.
+ */
+ if (!lists_bind_fdt(dm_root(), node, &dev)) {
+ ret = device_probe(dev);
+ if (ret)
+ return ret;
+ }
+ }
+#endif
+
+ if (!dev) {
+ /* Fall back to the first available timer */