[PATCH 1/4] reset: Add reset_reset() and reset_reset_bulk() API
Simon Glass
sjg at chromium.org
Mon May 4 14:44:05 CEST 2026
Hi Michal,
On Mon, 4 May 2026 at 06:39, Michal Simek <michal.simek at amd.com> wrote:
>
>
>
> On 5/4/26 14:17, Simon Glass wrote:
> > Hi Michal,
> >
> > On 2026-04-30T12:20:00, Michal Simek <michal.simek at amd.com> wrote:
> >> reset: Add reset_reset() and reset_reset_bulk() API
> >>
> >> Add reset_reset() and reset_reset_bulk() functions to the reset
> >> controller API. These functions assert and then deassert reset signals
> >> in a single call, providing a convenient way to pulse/toggle a reset
> >> line.
> >>
> >> This mirrors the Linux kernel's reset_control_reset() and
> >> reset_control_bulk_reset() APIs. The new functions are useful for
> >> drivers that need to cycle a reset line during initialization or
> >> error recovery.
> >>
> >> Signed-off-by: Michal Simek <michal.simek at amd.com>
> >>
> >> drivers/reset/reset-uclass.c | 30 ++++++++++++++++++++++++++++++
> >> include/reset-uclass.h | 11 +++++++++++
> >> include/reset.h | 35 +++++++++++++++++++++++++++++++++++
> >> 3 files changed, 76 insertions(+)
> >
> >> diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
> >> @@ -225,6 +225,36 @@ int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
> >> +int reset_reset(struct reset_ctl *reset_ctl)
> >> +{
> >> + struct reset_ops *ops = reset_dev_ops(reset_ctl->dev);
> >> + int ret;
> >> +
> >> + debug('%s(reset_ctl=%p)\n', __func__, reset_ctl);
> >> +
> >> + if (ops->rst_reset)
> >> + return ops->rst_reset(reset_ctl);
> >> +
> >> + ret = reset_assert(reset_ctl);
> >> + if (ret < 0)
> >> + return ret;
> >> +
> >> + return reset_deassert(reset_ctl);
> >> +}
> >
> > Will this provide a long-enough pulse on real hardware?
>
> In our case delays are handled by firmware itself because we are asking firmware
> to do it. It means no issue on our platform.
>
> GPIO based reset can be also handled via gpio delay driver.
> But I can add there one more parameter to also pass waiting delay. What do you
> think?
Seems like a good idea to me.
>
>
> >
> >> diff --git a/include/reset.h b/include/reset.h
> >> @@ -443,6 +468,16 @@ static inline int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
> >> +static inline int reset_reset(struct reset_ctl *reset_ctl)
> >> +{
> >> + return 0;
> >> +}
> >
> > Just to check - this matches the existing assert/deassert stubs,
> > silently succeeding with !CONFIG_DM_RESET: is that intended? Should we
> > return -NOSYS here?
>
> Will look at this one.
>
I meant -ENOSYS of course. We have that in clk.h for example.
Regards,
Simon
More information about the U-Boot
mailing list