mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-08 07:41:39 +00:00
watchdog: dm: Support manual relocation for watchdogs
Relocate watchdog ops as was done by:
"dm: Add support for all targets which requires MANUAL_RELOC"
(sha1: 484fdf5ba0
)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
9713fac1eb
commit
f238b3f0fb
1 changed files with 23 additions and 0 deletions
|
@ -63,8 +63,31 @@ int wdt_expire_now(struct udevice *dev, ulong flags)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int wdt_post_bind(struct udevice *dev)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
|
||||||
|
struct wdt_ops *ops = (struct wdt_ops *)device_get_ops(dev);
|
||||||
|
static int reloc_done;
|
||||||
|
|
||||||
|
if (!reloc_done) {
|
||||||
|
if (ops->start)
|
||||||
|
ops->start += gd->reloc_off;
|
||||||
|
if (ops->stop)
|
||||||
|
ops->stop += gd->reloc_off;
|
||||||
|
if (ops->reset)
|
||||||
|
ops->reset += gd->reloc_off;
|
||||||
|
if (ops->expire_now)
|
||||||
|
ops->expire_now += gd->reloc_off;
|
||||||
|
|
||||||
|
reloc_done++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
UCLASS_DRIVER(wdt) = {
|
UCLASS_DRIVER(wdt) = {
|
||||||
.id = UCLASS_WDT,
|
.id = UCLASS_WDT,
|
||||||
.name = "watchdog",
|
.name = "watchdog",
|
||||||
.flags = DM_UC_FLAG_SEQ_ALIAS,
|
.flags = DM_UC_FLAG_SEQ_ALIAS,
|
||||||
|
.post_bind = wdt_post_bind,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue