Lines Matching refs:rproc

72 	struct stm32_rproc_instance *rproc = NULL;  in stm32_rproc_get()  local
74 SLIST_FOREACH(rproc, &rproc_list, link) in stm32_rproc_get()
75 if (rproc->cdata->rproc_id == rproc_id) in stm32_rproc_get()
78 return rproc; in stm32_rproc_get()
83 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_is_secure() local
85 if (rproc) in stm32_rproc_is_secure()
86 return !rproc->cdata->ns_loading; in stm32_rproc_is_secure()
93 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_start() local
96 if (!rproc || !rproc->hold_boot) in stm32_rproc_start()
105 res = rstctrl_deassert_to(rproc->hold_boot, TIMEOUT_US_1MS); in stm32_rproc_start()
107 res = rstctrl_assert_to(rproc->hold_boot, TIMEOUT_US_1MS); in stm32_rproc_start()
112 static TEE_Result rproc_stop(struct stm32_rproc_instance *rproc) in rproc_stop() argument
116 if (!rproc->hold_boot || !rproc->mcu_rst) in rproc_stop()
119 res = rstctrl_assert_to(rproc->hold_boot, TIMEOUT_US_1MS); in rproc_stop()
121 res = rstctrl_assert_to(rproc->mcu_rst, TIMEOUT_US_1MS); in rproc_stop()
128 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_stop() local
130 if (!rproc) in stm32_rproc_stop()
133 return rproc_stop(rproc); in stm32_rproc_stop()
139 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_da_to_pa() local
143 if (!rproc) in stm32_rproc_da_to_pa()
146 mems = rproc->regions; in stm32_rproc_da_to_pa()
148 for (i = 0; i < rproc->n_regions; i++) { in stm32_rproc_da_to_pa()
168 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_map() local
172 if (!rproc) in stm32_rproc_map()
175 mems = rproc->regions; in stm32_rproc_map()
177 for (i = 0; i < rproc->n_regions; i++) { in stm32_rproc_map()
195 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_unmap() local
200 if (!rproc || !pa) in stm32_rproc_unmap()
203 mems = rproc->regions; in stm32_rproc_unmap()
205 for (i = 0; i < rproc->n_regions; i++) { in stm32_rproc_unmap()
271 static TEE_Result stm32_rproc_parse_mems(struct stm32_rproc_instance *rproc, in stm32_rproc_parse_mems() argument
331 rproc->n_regions = n_regions; in stm32_rproc_parse_mems()
332 rproc->regions = regions; in stm32_rproc_parse_mems()
344 struct stm32_rproc_instance *rproc = stm32_rproc_get(rproc_id); in stm32_rproc_clean_up_memories() local
352 if (!rproc) in stm32_rproc_clean_up_memories()
355 mems = rproc->regions; in stm32_rproc_clean_up_memories()
356 for (i = 0; i < rproc->n_regions; i++) { in stm32_rproc_clean_up_memories()
371 static void stm32_rproc_cleanup(struct stm32_rproc_instance *rproc) in stm32_rproc_cleanup() argument
373 free(rproc->regions); in stm32_rproc_cleanup()
374 free(rproc); in stm32_rproc_cleanup()
380 struct stm32_rproc_instance *rproc = NULL; in stm32_rproc_probe() local
383 rproc = calloc(1, sizeof(*rproc)); in stm32_rproc_probe()
384 if (!rproc) in stm32_rproc_probe()
387 rproc->cdata = comp_data; in stm32_rproc_probe()
389 res = stm32_rproc_parse_mems(rproc, fdt, node); in stm32_rproc_probe()
393 res = rstctrl_dt_get_by_name(fdt, node, "mcu_rst", &rproc->mcu_rst); in stm32_rproc_probe()
397 res = rstctrl_dt_get_by_name(fdt, node, "hold_boot", &rproc->hold_boot); in stm32_rproc_probe()
402 if (rproc->mcu_rst) { in stm32_rproc_probe()
403 res = rproc_stop(rproc); in stm32_rproc_probe()
424 SLIST_INSERT_HEAD(&rproc_list, rproc, link); in stm32_rproc_probe()
429 stm32_rproc_cleanup(rproc); in stm32_rproc_probe()