Skip to content
Snippets Groups Projects
Commit 58ba278f authored by Nicolas Le Bayon's avatar Nicolas Le Bayon Committed by Sebastien Pasdeloup
Browse files

dbgmcu: stm32mp1_dgbmcu: add asserts and comments


Add function headers to improve readability.

Change-Id: Ia545293f00167b6276331a986ea7aa08c006e004
Signed-off-by: default avatarNicolas Le Bayon <nicolas.le.bayon@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/142983


Reviewed-by: default avatarCITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: default avatarCIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: default avatarYann GAUTIER <yann.gautier@st.com>
parent 14cce878
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <errno.h>
#include <platform_def.h>
......@@ -53,8 +54,15 @@ static int stm32mp1_dbgmcu_init(void)
return 0;
}
/*
* @brief Get silicon revision from DBGMCU registers.
* @param chip_version: pointer to the read value.
* @retval 0 on success, negative value on failure.
*/
int stm32mp1_dbgmcu_get_chip_version(uint32_t *chip_version)
{
assert(chip_version != NULL);
if (stm32mp1_dbgmcu_init() != 0) {
return -EPERM;
}
......@@ -65,18 +73,29 @@ int stm32mp1_dbgmcu_get_chip_version(uint32_t *chip_version)
return 0;
}
/*
* @brief Get device ID from DBGMCU registers.
* @param chip_dev_id: pointer to the read value.
* @retval 0 on success, negative value on failure.
*/
int stm32mp1_dbgmcu_get_chip_dev_id(uint32_t *chip_dev_id)
{
assert(chip_dev_id != NULL);
if (stm32mp1_dbgmcu_init() != 0) {
return -EPERM;
}
*chip_dev_id = mmio_read_32(DBGMCU_BASE + DBGMCU_IDC) &
DBGMCU_IDC_DEV_ID_MASK;
DBGMCU_IDC_DEV_ID_MASK;
return 0;
}
/*
* @brief Freeze IWDG2 in debug mode.
* @retval None.
*/
int stm32mp1_dbgmcu_freeze_iwdg2(void)
{
uint32_t dbg_conf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment