mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

Add the system reset management into the stm32mp reset driver. Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Change-Id: I748f10de2398e1323160f479f99e92abd2f65dca
55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2018-2024, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef STM32MP_RESET_H
|
|
#define STM32MP_RESET_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/*
|
|
* Assert target reset, if @to_us non null, wait until reset is asserted
|
|
*
|
|
* @reset_id: Reset controller ID
|
|
* @to_us: Timeout in microsecond, or 0 if not waiting
|
|
* Return 0 on success and -ETIMEDOUT if waiting and timeout expired
|
|
*/
|
|
int stm32mp_reset_assert(uint32_t reset_id, unsigned int to_us);
|
|
|
|
/*
|
|
* Enable reset control for target resource
|
|
*
|
|
* @reset_id: Reset controller ID
|
|
*/
|
|
static inline void stm32mp_reset_set(uint32_t reset_id)
|
|
{
|
|
(void)stm32mp_reset_assert(reset_id, 0U);
|
|
}
|
|
|
|
/*
|
|
* Deassert target reset, if @to_us non null, wait until reset is deasserted
|
|
*
|
|
* @reset_id: Reset controller ID
|
|
* @to_us: Timeout in microsecond, or 0 if not waiting
|
|
* Return 0 on success and -ETIMEDOUT if waiting and timeout expired
|
|
*/
|
|
int stm32mp_reset_deassert(uint32_t reset_id, unsigned int to_us);
|
|
|
|
/*
|
|
* Release reset control for target resource
|
|
*
|
|
* @reset_id: Reset controller ID
|
|
*/
|
|
static inline void stm32mp_reset_release(uint32_t reset_id)
|
|
{
|
|
(void)stm32mp_reset_deassert(reset_id, 0U);
|
|
}
|
|
|
|
/*
|
|
* Manage system reset control
|
|
*/
|
|
void __dead2 stm32mp_system_reset(void);
|
|
|
|
#endif /* STM32MP_RESET_H */
|