[PATCH v4] drivers/soc/litex: Add restart handler

Stafford Horne shorne at gmail.com
Tue Jan 19 16:34:44 EST 2021


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 at 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;
> +}
> +




More information about the linux-riscv mailing list