Commit 0fafab9a authored by Raptor Engineering Development Team's avatar Raptor Engineering Development Team
Browse files

Add Kestrel SoC reboot support

parent eba63d4b
# SPDX-License-Identifier: Apache-2.0
#if(SOC_FAMILY)
#add_subdirectory(${SOC_FAMILY})
#else()
#add_subdirectory(${SOC_NAME})
#endif()
if(SOC_FAMILY)
add_subdirectory(${SOC_FAMILY})
else()
add_subdirectory(${SOC_NAME})
endif()
#
# Copyright (c) 2021 Raptor Engineering, LLC <sales@raptorengineering.com>
#
# SPDX-License-Identifier: Apache-2.0
#
zephyr_sources(
soc.c
)
/*
* Copyright (c) 2021 Raptor Engineering, LLC <sales@raptorengineering.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <init.h>
#include <device.h>
#include <logging/log.h>
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
LOG_MODULE_REGISTER(soc);
#ifdef CONFIG_OPENPOWER_LITEX_IRQ
extern void microwatt_irq_set_base(void *ivt_base);
#endif
// SoC base controller information
#define SOC_CTL_BASE DT_REG_ADDR(DT_INST(0, litex_soc_controller))
// Overrides the weak PowerPC implementation
// Reboot SoC
void sys_arch_reboot(int type)
{
// Shut down interrupts
irq_lock();
// Reset IRQ vector table base address
#ifdef CONFIG_OPENPOWER_LITEX_IRQ
microwatt_irq_set_base(0x0);
#endif
// Hard reboot
*((uint8_t*)(SOC_CTL_BASE)) = 1;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment