2023-08-30 16:21:18 +08:00
|
|
|
/*
|
2024-09-30 17:06:01 +08:00
|
|
|
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
|
2023-08-30 16:21:18 +08:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
|
|
|
|
* Wu Dehuang <dehuang.wu@artinchip.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <console.h>
|
|
|
|
|
#include <aic_core.h>
|
|
|
|
|
#include <aic_common.h>
|
|
|
|
|
#include <aic_errno.h>
|
|
|
|
|
#include <wdt.h>
|
|
|
|
|
|
|
|
|
|
static int do_reset_boot(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
wdt_init();
|
|
|
|
|
printf("Going to reboot ...\n");
|
|
|
|
|
aic_set_reboot_reason(REBOOT_REASON_CMD_REBOOT);
|
|
|
|
|
wdt_expire_now();
|
2024-04-03 16:40:57 +08:00
|
|
|
while(1) {};
|
2023-08-30 16:21:18 +08:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CONSOLE_CMD(reset, do_reset_boot, "Reboot device.");
|
|
|
|
|
CONSOLE_CMD(reboot, do_reset_boot, "Reboot device.");
|