Lines Matching refs:cq_host

34 static int cqhci_crypto_program_key(struct cqhci_host *cq_host,  in cqhci_crypto_program_key()  argument
38 u32 slot_offset = cq_host->crypto_cfg_register + slot * sizeof(*cfg); in cqhci_crypto_program_key()
41 if (cq_host->ops->program_key) in cqhci_crypto_program_key()
42 return cq_host->ops->program_key(cq_host, cfg, slot); in cqhci_crypto_program_key()
45 cqhci_writel(cq_host, 0, slot_offset + 16 * sizeof(cfg->reg_val[0])); in cqhci_crypto_program_key()
49 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[i]), in cqhci_crypto_program_key()
53 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[17]), in cqhci_crypto_program_key()
56 cqhci_writel(cq_host, le32_to_cpu(cfg->reg_val[16]), in cqhci_crypto_program_key()
66 struct cqhci_host *cq_host = cqhci_host_from_crypto_profile(profile); in cqhci_crypto_keyslot_program() local
68 cq_host->crypto_cap_array; in cqhci_crypto_keyslot_program()
78 for (i = 0; i < cq_host->crypto_capabilities.num_crypto_cap; i++) { in cqhci_crypto_keyslot_program()
102 err = cqhci_crypto_program_key(cq_host, &cfg, slot); in cqhci_crypto_keyslot_program()
108 static int cqhci_crypto_clear_keyslot(struct cqhci_host *cq_host, int slot) in cqhci_crypto_clear_keyslot() argument
116 return cqhci_crypto_program_key(cq_host, &cfg, slot); in cqhci_crypto_clear_keyslot()
123 struct cqhci_host *cq_host = cqhci_host_from_crypto_profile(profile); in cqhci_crypto_keyslot_evict() local
125 return cqhci_crypto_clear_keyslot(cq_host, slot); in cqhci_crypto_keyslot_evict()
168 int cqhci_crypto_init(struct cqhci_host *cq_host) in cqhci_crypto_init() argument
170 struct mmc_host *mmc = cq_host->mmc; in cqhci_crypto_init()
180 !(cqhci_readl(cq_host, CQHCI_CAP) & CQHCI_CAP_CS)) in cqhci_crypto_init()
183 cq_host->crypto_capabilities.reg_val = in cqhci_crypto_init()
184 cpu_to_le32(cqhci_readl(cq_host, CQHCI_CCAP)); in cqhci_crypto_init()
186 cq_host->crypto_cfg_register = in cqhci_crypto_init()
187 (u32)cq_host->crypto_capabilities.config_array_ptr * 0x100; in cqhci_crypto_init()
189 cq_host->crypto_cap_array = in cqhci_crypto_init()
190 devm_kcalloc(dev, cq_host->crypto_capabilities.num_crypto_cap, in cqhci_crypto_init()
191 sizeof(cq_host->crypto_cap_array[0]), GFP_KERNEL); in cqhci_crypto_init()
192 if (!cq_host->crypto_cap_array) { in cqhci_crypto_init()
201 num_keyslots = cq_host->crypto_capabilities.config_count + 1; in cqhci_crypto_init()
217 for (cap_idx = 0; cap_idx < cq_host->crypto_capabilities.num_crypto_cap; in cqhci_crypto_init()
219 cq_host->crypto_cap_array[cap_idx].reg_val = in cqhci_crypto_init()
220 cpu_to_le32(cqhci_readl(cq_host, in cqhci_crypto_init()
224 cq_host->crypto_cap_array[cap_idx]); in cqhci_crypto_init()
228 cq_host->crypto_cap_array[cap_idx].sdus_mask * 512; in cqhci_crypto_init()
233 cqhci_crypto_clear_keyslot(cq_host, slot); in cqhci_crypto_init()
236 cq_host->caps |= CQHCI_TASK_DESC_SZ_128; in cqhci_crypto_init()