Lines Matching refs:idx
164 int idx; in risaf_conf_protreg() local
166 for (idx = 0; idx < RISAF_MAX_INSTANCE; idx++) { in risaf_conf_protreg()
169 if (pdata->base[idx] == 0) { in risaf_conf_protreg()
173 if (clk_enable(pdata->clock[idx]) != 0) { in risaf_conf_protreg()
174 ERROR("%s: RISAF@%lx clock failed\n", __func__, pdata->base[idx]); in risaf_conf_protreg()
186 if (pdata->region[n].instance != idx) { in risaf_conf_protreg()
192 assert(valid_protreg_id(idx, id)); in risaf_conf_protreg()
211 if (risaf_configure_region(idx, id, cfg, cid_cfg, in risaf_conf_protreg()
214 __func__, id, pdata->base[idx]); in risaf_conf_protreg()
219 clk_disable(pdata->clock[idx]); in risaf_conf_protreg()
231 unsigned int idx; in risaf_get_instance_from_region() local
234 for (idx = 0U; idx < RISAF_MAX_INSTANCE; idx++) { in risaf_get_instance_from_region()
235 if (pdata->base[idx] == 0U) { in risaf_get_instance_from_region()
239 if (check_region_boundaries(idx, address, length) == 0) { in risaf_get_instance_from_region()
240 instance = idx; in risaf_get_instance_from_region()
337 int idx; in risaf_parse_fdt() local
345 idx = stm32_risaf_get_instance(risaf_info.base); in risaf_parse_fdt()
346 if ((idx < 0) || (risaf_info.clock < 0)) { in risaf_parse_fdt()
350 pdata->base[idx] = risaf_info.base; in risaf_parse_fdt()
351 pdata->clock[idx] = (unsigned long)risaf_info.clock; in risaf_parse_fdt()
354 if (clk_enable(pdata->clock[idx]) != 0) { in risaf_parse_fdt()
359 granularity = mmio_read_32(pdata->base[idx] + _RISAF_HWCFGR); in risaf_parse_fdt()
360 clk_disable(pdata->clock[idx]); in risaf_parse_fdt()
363 pdata->granularity[idx] = granularity; in risaf_parse_fdt()
372 inst_maxregions = stm32_risaf_get_max_region(idx); in risaf_parse_fdt()
379 ERROR("RISAF%d: Too many entries in DT\n", idx + 1); in risaf_parse_fdt()
391 if (risaf_register_region(fdt, pnode, idx) != 0) { in risaf_parse_fdt()
392 ERROR("RISAF%d: Region %d error\n", idx + 1, pdata->nregions); in risaf_parse_fdt()