Lines Matching refs:pdata

443 	struct stm32_tamp_platdata pdata;  member
685 assert(stm32_tamp_dev && stm32_tamp_dev->pdata.base.pa); in get_base()
687 return io_pa_or_va_secure(&stm32_tamp_dev->pdata.base, 1); in get_base()
692 struct rif_conf_data *rif_conf = stm32_tamp_dev->pdata.conf_data; in apply_rif_config()
700 if (!stm32_tamp_dev->pdata.conf_data) in apply_rif_config()
732 if (stm32_tamp_dev->pdata.is_tdcid) { in apply_rif_config()
757 if (!stm32_tamp_dev->pdata.is_tdcid) in apply_rif_config()
773 &stm32_tamp_dev->pdata.bkpregs_conf; in stm32_tamp_apply_bkpr_rif_conf()
830 &stm32_tamp_dev->pdata.bkpregs_conf; in stm32_tamp_set_secure_bkpregs()
842 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_set_secure_bkpregs()
843 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_REGISTER_SECCFGR)) { in stm32_tamp_set_secure_bkpregs()
872 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_set_secure()
873 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_REGISTER_SECCFGR)) { in stm32_tamp_set_secure()
893 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_set_privilege()
894 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_REGISTER_PRIVCFGR)) in stm32_tamp_set_privilege()
901 struct stm32_tamp_platdata *pdata = &stm32_tamp_dev->pdata; in parse_bkpregs_dt_conf() local
918 if (!(pdata->compat->tags & TAMP_HAS_RIF_SUPPORT)) { in parse_bkpregs_dt_conf()
923 pdata->bkpregs_conf.zone1_end = fdt32_to_cpu(cuint[0]); in parse_bkpregs_dt_conf()
926 pdata->bkpregs_conf.zone2_end = bkpregs_count + in parse_bkpregs_dt_conf()
955 pdata->bkpregs_conf.rif_offsets = calloc(TAMP_RIF_OFFSET_CNT, in parse_bkpregs_dt_conf()
957 if (!pdata->bkpregs_conf.rif_offsets) in parse_bkpregs_dt_conf()
970 pdata->bkpregs_conf.rif_offsets[0] = fdt32_to_cpu(cuint[0]); in parse_bkpregs_dt_conf()
971 pdata->bkpregs_conf.zone1_end = fdt32_to_cpu(cuint[0]) + in parse_bkpregs_dt_conf()
974 bkpregs_count = pdata->bkpregs_conf.zone1_end; in parse_bkpregs_dt_conf()
977 pdata->bkpregs_conf.rif_offsets[1] = bkpregs_count + in parse_bkpregs_dt_conf()
979 pdata->bkpregs_conf.zone2_end = bkpregs_count + in parse_bkpregs_dt_conf()
983 bkpregs_count = pdata->bkpregs_conf.zone2_end; in parse_bkpregs_dt_conf()
986 pdata->bkpregs_conf.rif_offsets[2] = bkpregs_count + in parse_bkpregs_dt_conf()
988 pdata->bkpregs_conf.rif_offsets[3] = bkpregs_count + in parse_bkpregs_dt_conf()
1062 while (int_it && i < stm32_tamp_dev->pdata.compat->int_tamp_size) { in stm32_tamp_it_handler()
1064 stm32_tamp_dev->pdata.compat->int_tamp[i]; in stm32_tamp_it_handler()
1087 while (ext_it && i < stm32_tamp_dev->pdata.compat->ext_tamp_size) { in stm32_tamp_it_handler()
1089 stm32_tamp_dev->pdata.compat->ext_tamp[i]; in stm32_tamp_it_handler()
1329 if (!stm32_tamp_dev->pdata.compat || in stm32_tamp_set_config()
1330 !stm32_tamp_dev->pdata.compat->int_tamp || in stm32_tamp_set_config()
1331 !stm32_tamp_dev->pdata.compat->ext_tamp) in stm32_tamp_set_config()
1335 fltcr = stm32_tamp_dev->pdata.passive_conf; in stm32_tamp_set_config()
1338 atcr1 = stm32_tamp_dev->pdata.active_conf & _TAMP_ATCR1_COMMON_MASK; in stm32_tamp_set_config()
1339 stm32_tamp_set_atper(stm32_tamp_dev->pdata.out_pins, &atcr1); in stm32_tamp_set_config()
1341 for (i = 0; i < stm32_tamp_dev->pdata.compat->int_tamp_size; i++) { in stm32_tamp_set_config()
1342 ret = stm32_tamp_set_int_config(stm32_tamp_dev->pdata.compat, i, in stm32_tamp_set_config()
1348 for (i = 0; i < stm32_tamp_dev->pdata.compat->ext_tamp_size; i++) { in stm32_tamp_set_config()
1349 ret = stm32_tamp_set_ext_config(stm32_tamp_dev->pdata.compat, i, in stm32_tamp_set_config()
1369 if (stm32_tamp_dev->pdata.compat->tags & in stm32_tamp_set_config()
1378 if (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_REGISTER_CR3) in stm32_tamp_set_config()
1382 if (stm32_tamp_dev->pdata.active_conf) { in stm32_tamp_set_config()
1446 if (cnt_idx < 0 || !stm32_tamp_dev->pdata.compat || in stm32_tamp_write_mcounter()
1447 cnt_idx >= stm32_tamp_dev->pdata.compat->nb_monotonic_counter) in stm32_tamp_write_mcounter()
1459 if (cnt_idx < 0 || !stm32_tamp_dev->pdata.compat || in stm32_tamp_read_mcounter()
1460 cnt_idx >= stm32_tamp_dev->pdata.compat->nb_monotonic_counter) in stm32_tamp_read_mcounter()
1541 if (!stm32_tamp_dev->pdata.compat) in stm32_tamp_activate_tamp()
1550 for (i = 0; i < stm32_tamp_dev->pdata.compat->int_tamp_size; i++) { in stm32_tamp_activate_tamp()
1551 if (stm32_tamp_dev->pdata.compat->int_tamp[i].id == id) { in stm32_tamp_activate_tamp()
1552 tamp_conf = &stm32_tamp_dev->pdata.compat->int_tamp[i]; in stm32_tamp_activate_tamp()
1558 for (i = 0; i < stm32_tamp_dev->pdata.compat->ext_tamp_size; i++) { in stm32_tamp_activate_tamp()
1559 if (stm32_tamp_dev->pdata.compat->ext_tamp[i].id == id) { in stm32_tamp_activate_tamp()
1560 tamp_conf = &stm32_tamp_dev->pdata.compat->ext_tamp[i]; in stm32_tamp_activate_tamp()
1572 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_are_secrets_blocked()
1573 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_CR2_SECRET_STATUS)) { in stm32_tamp_are_secrets_blocked()
1587 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_block_secrets()
1588 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_CR2_SECRET_STATUS)) in stm32_tamp_block_secrets()
1596 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_unblock_secrets()
1597 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_CR2_SECRET_STATUS)) in stm32_tamp_unblock_secrets()
1605 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_erase_secrets()
1606 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_CR2_SECRET_STATUS)) in stm32_tamp_erase_secrets()
1614 if (stm32_tamp_dev->pdata.compat && in stm32_tamp_lock_boot_hardware_key()
1615 (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_REGISTER_SECCFGR)) in stm32_tamp_lock_boot_hardware_key()
1620 struct stm32_tamp_platdata *pdata) in stm32_tamp_configure_pin() argument
1622 struct stm32_tamp_compat *compat = pdata->compat; in stm32_tamp_configure_pin()
1636 pdata->pins_conf |= compat->pin_map[i].conf; in stm32_tamp_configure_pin()
1644 struct stm32_tamp_platdata *pdata, in stm32_tamp_configure_pin_from_dt() argument
1670 if (out_tamp_id > pdata->compat->ext_tamp_size) { in stm32_tamp_configure_pin_from_dt()
1675 stm32_tamp_configure_pin(out_id, gpio_out, true, pdata); in stm32_tamp_configure_pin_from_dt()
1688 for (i = 0; i < pdata->compat->ext_tamp_size; i++) { in stm32_tamp_configure_pin_from_dt()
1689 if (pdata->compat->ext_tamp[i].id == id) { in stm32_tamp_configure_pin_from_dt()
1690 tamp_ext = &pdata->compat->ext_tamp[i]; in stm32_tamp_configure_pin_from_dt()
1704 pdata->out_pins |= BIT(tamp_ext->out_id - OUT_TAMP1); in stm32_tamp_configure_pin_from_dt()
1707 pdata->active_conf |= _TAMP_ATCR1_ATOSHARE; in stm32_tamp_configure_pin_from_dt()
1715 stm32_tamp_configure_pin(id, gpio_ext, false, pdata); in stm32_tamp_configure_pin_from_dt()
1722 struct stm32_tamp_platdata *pdata) in stm32_tamp_parse_passive_conf() argument
1834 pdata->passive_conf = conf; in stm32_tamp_parse_passive_conf()
1924 &stm32_tamp_dev->pdata, in stm32_configure_tamp()
1948 struct stm32_tamp_platdata *pdata) in stm32_tamp_parse_active_conf() argument
2002 if (pdata->compat && in stm32_tamp_parse_active_conf()
2003 (pdata->compat->tags & TAMP_SIZE_ATCR1_ATCKSEL_IS_4)) { in stm32_tamp_parse_active_conf()
2017 pdata->active_conf = conf; in stm32_tamp_parse_active_conf()
2025 struct stm32_tamp_platdata *pdata = &stm32_tamp_dev->pdata; in stm32_tamp_parse_fdt() local
2029 pdata->compat = (struct stm32_tamp_compat *)compat; in stm32_tamp_parse_fdt()
2031 if (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_RIF_SUPPORT) { in stm32_tamp_parse_fdt()
2032 res = stm32_rifsc_check_tdcid(&pdata->is_tdcid); in stm32_tamp_parse_fdt()
2037 if (fdt_reg_info(fdt, node, &pdata->base.pa, &reg_size)) in stm32_tamp_parse_fdt()
2040 io_pa_or_va_secure(&pdata->base, reg_size); in stm32_tamp_parse_fdt()
2041 assert(pdata->base.va); in stm32_tamp_parse_fdt()
2043 res = clk_dt_get_by_index(fdt, node, 0, &pdata->clock); in stm32_tamp_parse_fdt()
2047 res = stm32_tamp_parse_passive_conf(fdt, node, pdata); in stm32_tamp_parse_fdt()
2051 res = stm32_tamp_parse_active_conf(fdt, node, pdata); in stm32_tamp_parse_fdt()
2056 pdata->is_wakeup_source = true; in stm32_tamp_parse_fdt()
2060 if (pdata->compat->tags & TAMP_HAS_RIF_SUPPORT) { in stm32_tamp_parse_fdt()
2071 pdata->conf_data = calloc(1, sizeof(*pdata->conf_data)); in stm32_tamp_parse_fdt()
2072 if (!pdata->conf_data) in stm32_tamp_parse_fdt()
2075 pdata->nb_rif_resources = (unsigned int)(lenp / in stm32_tamp_parse_fdt()
2077 assert(pdata->nb_rif_resources <= TAMP_RIF_RESOURCES); in stm32_tamp_parse_fdt()
2079 pdata->conf_data->cid_confs = calloc(TAMP_RIF_RESOURCES, in stm32_tamp_parse_fdt()
2081 pdata->conf_data->sec_conf = calloc(1, sizeof(uint32_t)); in stm32_tamp_parse_fdt()
2082 pdata->conf_data->priv_conf = calloc(1, sizeof(uint32_t)); in stm32_tamp_parse_fdt()
2083 pdata->conf_data->access_mask = calloc(1, sizeof(uint32_t)); in stm32_tamp_parse_fdt()
2084 if (!pdata->conf_data->cid_confs || in stm32_tamp_parse_fdt()
2085 !pdata->conf_data->sec_conf || in stm32_tamp_parse_fdt()
2086 !pdata->conf_data->priv_conf || in stm32_tamp_parse_fdt()
2087 !pdata->conf_data->access_mask) in stm32_tamp_parse_fdt()
2090 for (i = 0; i < pdata->nb_rif_resources; i++) in stm32_tamp_parse_fdt()
2092 pdata->conf_data, in stm32_tamp_parse_fdt()
2130 if (clk_enable(stm32_tamp_dev->pdata.clock)) in stm32_tamp_probe()
2148 if (stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_RIF_SUPPORT) { in stm32_tamp_probe()
2151 if (stm32_tamp_dev->pdata.is_tdcid) { in stm32_tamp_probe()
2172 if (!(stm32_tamp_dev->pdata.compat->tags & TAMP_HAS_RIF_SUPPORT) || in stm32_tamp_probe()
2173 stm32_tamp_dev->pdata.is_tdcid) { in stm32_tamp_probe()
2181 &stm32_tamp_dev->pdata.itr); in stm32_tamp_probe()
2185 if (stm32_tamp_dev->pdata.is_wakeup_source && in stm32_tamp_probe()
2195 stm32_tamp_set_pins(base, stm32_tamp_dev->pdata.pins_conf); in stm32_tamp_probe()
2202 clk_disable(stm32_tamp_dev->pdata.clock); in stm32_tamp_probe()
2204 if (stm32_tamp_dev->pdata.conf_data) { in stm32_tamp_probe()
2205 free(stm32_tamp_dev->pdata.conf_data->cid_confs); in stm32_tamp_probe()
2206 free(stm32_tamp_dev->pdata.conf_data->sec_conf); in stm32_tamp_probe()
2207 free(stm32_tamp_dev->pdata.conf_data->priv_conf); in stm32_tamp_probe()
2208 free(stm32_tamp_dev->pdata.conf_data->access_mask); in stm32_tamp_probe()
2209 free(stm32_tamp_dev->pdata.conf_data); in stm32_tamp_probe()
2212 if (stm32_tamp_dev->pdata.itr) { in stm32_tamp_probe()
2214 interrupt_remove_free_handler(stm32_tamp_dev->pdata.itr); in stm32_tamp_probe()
2217 free(stm32_tamp_dev->pdata.bkpregs_conf.rif_offsets); in stm32_tamp_probe()