mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 04:48:14 +00:00

Add a function to get chip ID from SYSCFG peripheral. Signed-off-by: Yann Gautier <yann.gautier@st.com> Change-Id: I32b15fca00e52d31f253e02873ab01b804399658
31 lines
643 B
C
31 lines
643 B
C
/*
|
|
* Copyright (c) 2024, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <common/debug.h>
|
|
#include <lib/mmio.h>
|
|
#include <lib/utils_def.h>
|
|
|
|
#include <platform_def.h>
|
|
#include <stm32mp2_private.h>
|
|
|
|
/*
|
|
* SYSCFG register offsets (base relative)
|
|
*/
|
|
#define SYSCFG_DEVICEID 0x6400U
|
|
|
|
/*
|
|
* SYSCFG_DEVICEID Register
|
|
*/
|
|
#define SYSCFG_DEVICEID_DEV_ID_MASK GENMASK_32(11, 0)
|
|
|
|
/*
|
|
* @brief Get device ID from SYSCFG registers.
|
|
* @retval device ID (DEV_ID).
|
|
*/
|
|
uint32_t stm32mp_syscfg_get_chip_dev_id(void)
|
|
{
|
|
return mmio_read_32(SYSCFG_BASE + SYSCFG_DEVICEID) & SYSCFG_DEVICEID_DEV_ID_MASK;
|
|
}
|