2020-11-30 13:13:08 +08:00
|
|
|
/*
|
2021-03-27 17:51:56 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2020-11-30 13:13:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2021-03-27 17:51:56 +08:00
|
|
|
* 2020-03-19 WangHuachen first version
|
2020-11-30 13:13:08 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rthw.h>
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include "zynqmp-r5.h"
|
|
|
|
|
|
|
|
void rt_hw_cpu_reset()
|
|
|
|
{
|
|
|
|
__REG32(ZynqMP_CRL_APB_BASEADDR + ZynqMP_CRL_APB_RESET_CTRL) |= ZynqMP_RESET_MASK;
|
|
|
|
while (1); /* loop forever and wait for reset to happen */
|
|
|
|
/* NEVER REACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* shutdown CPU
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void rt_hw_cpu_shutdown()
|
|
|
|
{
|
2022-04-20 10:56:11 +08:00
|
|
|
rt_base_t level;
|
2020-11-30 13:13:08 +08:00
|
|
|
rt_kprintf("shutdown...\n");
|
|
|
|
|
|
|
|
level = rt_hw_interrupt_disable();
|
|
|
|
while (level)
|
|
|
|
{
|
|
|
|
RT_ASSERT(0);
|
|
|
|
}
|
|
|
|
}
|