Lines Matching defs:id

69 static const char __unused *shres2str_id(enum stm32mp_shres id)
71 assert(id < ARRAY_SIZE(shres2str_id_tbl));
73 return shres2str_id_tbl[id];
95 static bool periph_is_non_secure(enum stm32mp_shres id)
99 return (shres_state[id] == SHRES_NON_SECURE) ||
100 (shres_state[id] == SHRES_UNREGISTERED);
103 static bool periph_is_secure(enum stm32mp_shres id)
105 return !periph_is_non_secure(id);
137 static void register_periph(enum stm32mp_shres id, unsigned int state)
139 assert((id < STM32MP1_SHRES_COUNT) &&
143 if (shres_state[id] == state) {
149 if ((shres_state[id] != SHRES_UNREGISTERED) &&
150 (shres_state[id] != state)) {
152 shres2str_id(id),
153 shres2str_state(shres_state[id]),
158 if (shres_state[id] == SHRES_UNREGISTERED) {
160 shres2str_id(id), shres2str_state(state));
163 if ((id >= STM32MP1_SHRES_GPIOZ(0)) &&
164 (id <= STM32MP1_SHRES_GPIOZ(7)) &&
165 ((unsigned int)(id - STM32MP1_SHRES_GPIOZ(0)) >= get_gpioz_nbpin())) {
167 (int)(id - STM32MP1_SHRES_GPIOZ(0)), get_gpioz_nbpin());
171 shres_state[id] = (uint8_t)state;
177 switch (id) {
225 void stm32mp_register_secure_periph(enum stm32mp_shres id)
227 register_periph(id, SHRES_SECURE);
230 void stm32mp_register_non_secure_periph(enum stm32mp_shres id)
232 register_periph(id, SHRES_NON_SECURE);
237 enum stm32mp_shres id;
241 id = STM32MP1_SHRES_CRYP1;
244 id = STM32MP1_SHRES_HASH1;
247 id = STM32MP1_SHRES_I2C4;
250 id = STM32MP1_SHRES_I2C6;
253 id = STM32MP1_SHRES_IWDG1;
256 id = STM32MP1_SHRES_RNG1;
259 id = STM32MP1_SHRES_RTC;
262 id = STM32MP1_SHRES_SPI6;
265 id = STM32MP1_SHRES_USART1;
300 register_periph(id, state);
477 static bool mckprot_protects_periph(enum stm32mp_shres id)
479 switch (id) {
489 static enum etzpc_decprot_attributes shres2decprot_attr(enum stm32mp_shres id)
491 assert((id < STM32MP1_SHRES_GPIOZ(0)) ||
492 (id > STM32MP1_SHRES_GPIOZ(7)));
494 if (periph_is_non_secure(id)) {
569 unsigned int id;
571 for (id = 0U; id < STM32MP1_SHRES_COUNT; id++) {
572 switch (shres_state[id]) {
574 INFO("stm32mp1 %s is secure\n", shres2str_id(id));
578 VERBOSE("stm32mp %s is non-secure\n", shres2str_id(id));
581 VERBOSE("stm32mp %s is invalid\n", shres2str_id(id));