Skip to content

Commit e48bbb5

Browse files
claudiubezneasre
authored andcommitted
power: reset: at91-reset: handle nrst async for sam9x60
Handle NRST asynchronously for SAM9X60 to avoid problem with fast drop of VDDCORE on shutdown operations in the first 100 us after CPU is shutdown. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 766b016 commit e48bbb5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/power/reset/at91-reset.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#define AT91_RSTC_MR 0x08 /* Reset Controller Mode Register */
3737
#define AT91_RSTC_URSTEN BIT(0) /* User Reset Enable */
38+
#define AT91_RSTC_URSTASYNC BIT(2) /* User Reset Asynchronous Control */
3839
#define AT91_RSTC_URSTIEN BIT(4) /* User Reset Interrupt Enable */
3940
#define AT91_RSTC_ERSTL GENMASK(11, 8) /* External Reset Length */
4041

@@ -228,6 +229,13 @@ static int __init at91_reset_probe(struct platform_device *pdev)
228229

229230
platform_set_drvdata(pdev, reset);
230231

232+
if (of_device_is_compatible(pdev->dev.of_node, "microchip,sam9x60-rstc")) {
233+
u32 val = readl(reset->rstc_base + AT91_RSTC_MR);
234+
235+
writel(AT91_RSTC_KEY | AT91_RSTC_URSTASYNC | val,
236+
reset->rstc_base + AT91_RSTC_MR);
237+
}
238+
231239
ret = register_restart_handler(&reset->nb);
232240
if (ret) {
233241
clk_disable_unprepare(reset->sclk);

0 commit comments

Comments
 (0)