Lines Matching refs:cq_host

33 static int cqhci_crypto_program_key(struct cqhci_host *cq_host,  in cqhci_crypto_program_key()  argument
37 u32 slot_offset = cq_host->crypto_cfg_register + slot * sizeof(*cfg); in cqhci_crypto_program_key()
40 if (cq_host->ops->program_key) in cqhci_crypto_program_key()
41 return cq_host->ops->program_key(cq_host, cfg, slot); in cqhci_crypto_program_key()
44 cqhci_writel(cq_host, 0, slot_offset + 16 * sizeof(cfg->reg_val[0])); in cqhci_crypto_program_key()
48 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[i]), in cqhci_crypto_program_key()
52 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[17]), in cqhci_crypto_program_key()
55 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[16]), in cqhci_crypto_program_key()
65 struct cqhci_host *cq_host = cqhci_host_from_ksm(ksm); in cqhci_crypto_keyslot_program() local
67 cq_host->crypto_cap_array; in cqhci_crypto_keyslot_program()
77 for (i = 0; i < cq_host->crypto_capabilities.num_crypto_cap; i++) { in cqhci_crypto_keyslot_program()
101 err = cqhci_crypto_program_key(cq_host, &cfg, slot); in cqhci_crypto_keyslot_program()
107 static int cqhci_crypto_clear_keyslot(struct cqhci_host *cq_host, int slot) in cqhci_crypto_clear_keyslot() argument
115 return cqhci_crypto_program_key(cq_host, &cfg, slot); in cqhci_crypto_clear_keyslot()
122 struct cqhci_host *cq_host = cqhci_host_from_ksm(ksm); in cqhci_crypto_keyslot_evict() local
124 return cqhci_crypto_clear_keyslot(cq_host, slot); in cqhci_crypto_keyslot_evict()
167 int cqhci_crypto_init(struct cqhci_host *cq_host) in cqhci_crypto_init() argument
169 struct mmc_host *mmc = cq_host->mmc; in cqhci_crypto_init()
179 !(cqhci_readl(cq_host, CQHCI_CAP) & CQHCI_CAP_CS)) in cqhci_crypto_init()
182 cq_host->crypto_capabilities.reg_val = in cqhci_crypto_init()
183 cpu_to_le32(cqhci_readl(cq_host, CQHCI_CCAP)); in cqhci_crypto_init()
185 cq_host->crypto_cfg_register = in cqhci_crypto_init()
186 (u32)cq_host->crypto_capabilities.config_array_ptr * 0x100; in cqhci_crypto_init()
188 cq_host->crypto_cap_array = in cqhci_crypto_init()
189 devm_kcalloc(dev, cq_host->crypto_capabilities.num_crypto_cap, in cqhci_crypto_init()
190 sizeof(cq_host->crypto_cap_array[0]), GFP_KERNEL); in cqhci_crypto_init()
191 if (!cq_host->crypto_cap_array) { in cqhci_crypto_init()
200 num_keyslots = cq_host->crypto_capabilities.config_count + 1; in cqhci_crypto_init()
218 for (cap_idx = 0; cap_idx < cq_host->crypto_capabilities.num_crypto_cap; in cqhci_crypto_init()
220 cq_host->crypto_cap_array[cap_idx].reg_val = in cqhci_crypto_init()
221 cpu_to_le32(cqhci_readl(cq_host, in cqhci_crypto_init()
225 cq_host->crypto_cap_array[cap_idx]); in cqhci_crypto_init()
229 cq_host->crypto_cap_array[cap_idx].sdus_mask * 512; in cqhci_crypto_init()
234 cqhci_crypto_clear_keyslot(cq_host, slot); in cqhci_crypto_init()
237 cq_host->caps |= CQHCI_TASK_DESC_SZ_128; in cqhci_crypto_init()