From 8234fc1bdf4629fc0fec41ebc2e091c407ef8d6a Mon Sep 17 00:00:00 2001 From: Yu Chien Peter Lin Date: Fri, 14 Oct 2022 08:32:47 +0800 Subject: lib: utils/reset: Add Andes fdt reset driver support Add ATCWDT200 as reset device of AE350 platform, this driver requires SMU to program the reset vector registers before triggering WDT software restart signal. dts example: smu@f0100000 { compatible = "andestech,atcsmu"; reg = <0x00000000 0xf0100000 0x00000000 0x00001000>; }; wdt: wdt@f0500000 { compatible = "andestech,atcwdt200"; reg = <0x00000000 0xf0500000 0x00000000 0x00001000>; interrupts = <3 4>; interrupt-parent = <&plic0>; clock-frequency = <15000000>; }; Signed-off-by: Yu Chien Peter Lin Reviewed-by: Leo Yu-Chi Liang Reviewed-by: Anup Patel --- platform/andes/ae350/Kconfig | 2 ++ platform/andes/ae350/platform.c | 3 +++ 2 files changed, 5 insertions(+) (limited to 'platform') diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig index f6f50eb..8486f08 100644 --- a/platform/andes/ae350/Kconfig +++ b/platform/andes/ae350/Kconfig @@ -8,6 +8,8 @@ config PLATFORM_ANDES_AE350 select FDT_SERIAL_UART8250 select FDT_TIMER select FDT_TIMER_PLMT + select FDT_RESET + select FDT_RESET_ATCWDT200 default y if PLATFORM_ANDES_AE350 diff --git a/platform/andes/ae350/platform.c b/platform/andes/ae350/platform.c index 79736c0..c6a8eeb 100644 --- a/platform/andes/ae350/platform.c +++ b/platform/andes/ae350/platform.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include "platform.h" @@ -37,6 +38,8 @@ static int ae350_final_init(bool cold_boot) if (!cold_boot) return 0; + fdt_reset_init(); + fdt = fdt_get_address(); fdt_fixups(fdt); -- cgit v1.2.3