1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef MOD_PCID_H 9 #define MOD_PCID_H 10 11 #include <fwk_macros.h> 12 13 #include <stdbool.h> 14 #include <stdint.h> 15 16 /*! 17 * \addtogroup GroupModules Modules 18 * \{ 19 */ 20 21 /*! 22 * \defgroup GroupModulePCID PCID 23 * 24 * \brief Module used to check the peripheral and component IDs. 25 * 26 * \{ 27 */ 28 29 /*! 30 * \brief PID and CID registers. 31 */ 32 struct mod_pcid_registers { 33 FWK_R uint32_t PID4; /*!< Peripheral ID 4 */ 34 FWK_R uint32_t PID5; /*!< Peripheral ID 5 */ 35 FWK_R uint32_t PID6; /*!< Peripheral ID 6 */ 36 FWK_R uint32_t PID7; /*!< Peripheral ID 7 */ 37 FWK_R uint32_t PID0; /*!< Peripheral ID 0 */ 38 FWK_R uint32_t PID1; /*!< Peripheral ID 1 */ 39 FWK_R uint32_t PID2; /*!< Peripheral ID 2 */ 40 FWK_R uint32_t PID3; /*!< Peripheral ID 3 */ 41 FWK_R uint32_t CID0; /*!< Component ID 0 */ 42 FWK_R uint32_t CID1; /*!< Component ID 1 */ 43 FWK_R uint32_t CID2; /*!< Component ID 2 */ 44 FWK_R uint32_t CID3; /*!< Component ID 3 */ 45 }; 46 47 /*! 48 * \brief Check peripheral and component id registers against expected values. 49 * 50 * \param registers Pointer to set of PCID registers to check. 51 * \param expected Pointer to set of PCID Registers that denote the expected 52 * values. 53 * 54 * \pre \p registers must not be NULL 55 * \pre \p expected must not be NULL 56 * 57 * \retval true All the registers have the expected values. 58 * \retval false One or more registers do not have the expected values. 59 */ 60 bool mod_pcid_check_registers(const struct mod_pcid_registers *registers, 61 const struct mod_pcid_registers *expected); 62 63 /*! 64 * \} 65 */ 66 67 /*! 68 * \} 69 */ 70 71 #endif /* MOD_PCID_H */ 72