stm32mp2_syscfg.c 643 B

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