mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-22 20:38:03 +00:00

Include all RCC, clocks and reset headers from stm32mp1_def.h which if exported to the firmware through platform_def.h. The same dependency removal is done in common code as well. Some useless includes are also removed in stm32_sdmmc2 driver. Change-Id: I731ea5775c3fdb7f7b0c388b93923ed5e84b8d3f Signed-off-by: Yann Gautier <yann.gautier@st.com>
40 lines
905 B
C
40 lines
905 B
C
/*
|
|
* Copyright (c) 2018-2019, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <limits.h>
|
|
|
|
#include <platform_def.h>
|
|
|
|
#include <common/bl_common.h>
|
|
#include <common/debug.h>
|
|
#include <drivers/st/stm32mp_reset.h>
|
|
#include <lib/mmio.h>
|
|
#include <lib/utils_def.h>
|
|
|
|
#define RST_CLR_OFFSET 4U
|
|
|
|
void stm32mp_reset_assert(uint32_t id)
|
|
{
|
|
uint32_t offset = (id / (uint32_t)__LONG_BIT) * sizeof(uintptr_t);
|
|
uint32_t bit = id % (uint32_t)__LONG_BIT;
|
|
|
|
mmio_write_32(RCC_BASE + offset, BIT(bit));
|
|
while ((mmio_read_32(RCC_BASE + offset) & BIT(bit)) == 0U) {
|
|
;
|
|
}
|
|
}
|
|
|
|
void stm32mp_reset_deassert(uint32_t id)
|
|
{
|
|
uint32_t offset = ((id / (uint32_t)__LONG_BIT) * sizeof(uintptr_t)) +
|
|
RST_CLR_OFFSET;
|
|
uint32_t bit = id % (uint32_t)__LONG_BIT;
|
|
|
|
mmio_write_32(RCC_BASE + offset, BIT(bit));
|
|
while ((mmio_read_32(RCC_BASE + offset) & BIT(bit)) != 0U) {
|
|
;
|
|
}
|
|
}
|