Lines Matching refs:cq_host

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