lkml.org 
[lkml]   [2021]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] drivers/soc/litex: Add restart handler
On Tue, Jan 19, 2021 at 09:09:38AM +0100, Geert Uytterhoeven wrote:
> Let the LiteX SoC Controller register a restart handler, which resets
> the LiteX SoC by writing 1 to CSR_CTRL_RESET_ADDR.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Thanks, this looks good to me, queued to my linux-next branch.

-Stafford

> @@ -66,8 +71,19 @@ static int litex_check_csr_access(void __iomem *reg_addr)
>
> struct litex_soc_ctrl_device {
> void __iomem *base;
> + struct notifier_block reset_nb;
> };
>
> +static int litex_reset_handler(struct notifier_block *this, unsigned long mode,
> + void *cmd)
> +{
> + struct litex_soc_ctrl_device *soc_ctrl_dev =
> + container_of(this, struct litex_soc_ctrl_device, reset_nb);

Nice.

> + litex_write32(soc_ctrl_dev->base + RESET_REG_OFF, RESET_REG_VALUE);
> + return NOTIFY_DONE;
> +}
> +

\
 
 \ /
  Last update: 2021-01-19 22:41    [W:0.178 / U:5.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site