# Re: \[RFC PATCH net-next 07/12\] power: reset: Add lan966x power reset driver

- From: Andrew Lunn \<andrew@lunn.ch\>
- Date: 2021-09-20 12:15:49 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/09/1514558
- Thread: https://ratatoskr.run/netdev/2021/09/1514433/t.md

```text
> +struct lan966x_reset_context {
> +	struct regmap *gcb_ctrl;
> +	struct regmap *cpu_ctrl;
> +	struct notifier_block restart_handler;
> +};
> +
> +#define PROTECT_REG    0x88
> +#define PROTECT_BIT    BIT(5)
> +#define SOFT_RESET_REG 0x00
> +#define SOFT_RESET_BIT BIT(1)
> +
> +static int lan966x_restart_handle(struct notifier_block *this,
> +				  unsigned long mode, void *cmd)
> +{
> +	struct lan966x_reset_context *ctx = container_of(this, struct lan966x_reset_context,
> +							restart_handler);
> +
> +	/* Make sure the core is not protected from reset */
> +	regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, 0);

This all looks familiar...

Maybe yet another compatible added to reset-microchip-sparx5.c ?

      Andrew
```
