Yann Gautier | d58a3d2 | 2024-05-21 12:05:43 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2024, STMicroelectronics - All Rights Reserved |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <common/debug.h> |
| 8 | #include <lib/mmio.h> |
| 9 | #include <lib/utils_def.h> |
| 10 | |
| 11 | #include <platform_def.h> |
| 12 | #include <stm32mp2_private.h> |
| 13 | |
| 14 | /* |
| 15 | * SYSCFG register offsets (base relative) |
| 16 | */ |
| 17 | #define SYSCFG_DEVICEID 0x6400U |
| 18 | |
| 19 | /* |
| 20 | * SYSCFG_DEVICEID Register |
| 21 | */ |
| 22 | #define SYSCFG_DEVICEID_DEV_ID_MASK GENMASK_32(11, 0) |
| 23 | |
| 24 | /* |
| 25 | * @brief Get device ID from SYSCFG registers. |
| 26 | * @retval device ID (DEV_ID). |
| 27 | */ |
| 28 | uint32_t stm32mp_syscfg_get_chip_dev_id(void) |
| 29 | { |
| 30 | return mmio_read_32(SYSCFG_BASE + SYSCFG_DEVICEID) & SYSCFG_DEVICEID_DEV_ID_MASK; |
| 31 | } |