Lines Matching +full:operations +full:- +full:per +full:- +full:run

4  * SPDX-License-Identifier: Apache-2.0
19 #define DEV_CFG(_dev) ((const struct sdhc_cdns_config *)(_dev)->config)
20 #define DEV_DATA(_dev) ((struct sdhc_cdns_data *const)(_dev)->data)
24 /* SDMMC operations FPs are the element of structure*/
34 /* run time device structure */
36 /* type to identify a clock controller sub-system */
64 return -EINVAL; in sdhc_cdns_request()
68 cdns_sdmmc_cmd.cmd_idx = cmd->opcode; in sdhc_cdns_request()
69 cdns_sdmmc_cmd.cmd_arg = cmd->arg; in sdhc_cdns_request()
70 cdns_sdmmc_cmd.resp_type = (cmd->response_type & SDHC_NATIVE_RESPONSE_MASK); in sdhc_cdns_request()
72 /* Sending command as per the data or non data */ in sdhc_cdns_request()
74 ret = cdns_sdmmc_ops->prepare(data->block_addr, (uintptr_t)data->data, in sdhc_cdns_request()
78 return -EINVAL; in sdhc_cdns_request()
82 ret = cdns_sdmmc_ops->send_cmd(&cdns_sdmmc_cmd, data); in sdhc_cdns_request()
85 if (cmd->opcode == SD_READ_SINGLE_BLOCK || cmd->opcode == SD_APP_SEND_SCR || in sdhc_cdns_request()
86 cmd->opcode == SD_READ_MULTIPLE_BLOCK) { in sdhc_cdns_request()
90 return -ENODATA; in sdhc_cdns_request()
92 ret = cdns_sdmmc_ops->cache_invd(data->block_addr, (uintptr_t)data->data, in sdhc_cdns_request()
93 data->block_size); in sdhc_cdns_request()
99 /* copying all responses as per response type */ in sdhc_cdns_request()
101 cmd->response[i] = cdns_sdmmc_cmd.resp_data[i]; in sdhc_cdns_request()
108 return cdns_sdmmc_ops->card_present(); in sdhc_cdns_get_card_present()
113 return cdns_sdmmc_ops->busy(); in sdhc_cdns_card_busy()
122 props->f_min = SDMMC_CLOCK_400KHZ; in sdhc_cdns_get_host_props()
124 * default max speed is 25MHZ, as per SCR register in sdhc_cdns_get_host_props()
127 props->f_max = SD_CLOCK_25MHZ; in sdhc_cdns_get_host_props()
128 props->power_delay = sdhc_config->power_delay_ms; in sdhc_cdns_get_host_props()
129 props->host_caps.vol_330_support = true; in sdhc_cdns_get_host_props()
130 props->is_spi = false; in sdhc_cdns_get_host_props()
136 return cdns_sdmmc_ops->reset(); in sdhc_cdns_reset()
151 if (sdhc_config->clk_rate == 0U) { in sdhc_cdns_init()
152 if (!device_is_ready(sdhc_config->cdns_clk_dev)) { in sdhc_cdns_init()
154 return -EINVAL; in sdhc_cdns_init()
157 ret = clock_control_get_rate(sdhc_config->cdns_clk_dev, in sdhc_cdns_init()
158 sdhc_config->clkid, &data->params.clk_rate); in sdhc_cdns_init()
164 data->params.clk_rate = sdhc_config->clk_rate; in sdhc_cdns_init()
168 data->params.reg_base = DEVICE_MMIO_NAMED_GET(dev, reg_base); in sdhc_cdns_init()
169 data->params.reg_phy = DEVICE_MMIO_NAMED_GET(dev, combo_phy); in sdhc_cdns_init()
170 data->params.combophy = (DEVICE_MMIO_NAMED_ROM_PTR((dev), in sdhc_cdns_init()
171 combo_phy)->phys_addr); in sdhc_cdns_init()
172 data->params.combophy = (data->params.combophy & COMBOPHY_ADDR_MASK); in sdhc_cdns_init()
175 if (sdhc_config->reset_sdmmc.dev != NULL) { in sdhc_cdns_init()
176 if (!device_is_ready(sdhc_config->reset_sdmmc.dev) || in sdhc_cdns_init()
177 !device_is_ready(sdhc_config->reset_sdmmcocp.dev) || in sdhc_cdns_init()
178 !device_is_ready(sdhc_config->reset_softphy.dev)) { in sdhc_cdns_init()
180 return -ENODEV; in sdhc_cdns_init()
183 ret = reset_line_toggle(sdhc_config->reset_softphy.dev, in sdhc_cdns_init()
184 sdhc_config->reset_softphy.id); in sdhc_cdns_init()
190 ret = reset_line_toggle(sdhc_config->reset_sdmmc.dev, in sdhc_cdns_init()
191 sdhc_config->reset_sdmmc.id); in sdhc_cdns_init()
197 ret = reset_line_toggle(sdhc_config->reset_sdmmcocp.dev, in sdhc_cdns_init()
198 sdhc_config->reset_sdmmcocp.id); in sdhc_cdns_init()
206 sdhc_cdns_sdmmc_init(&data->params, &data->info, &cdns_sdmmc_ops); in sdhc_cdns_init()
215 ret = cdns_sdmmc_ops->init(); in sdhc_cdns_init()
226 struct sdhc_cdns_data *data = dev->data; in sdhc_cdns_set_io()
227 struct sdhc_io *host_io = &data->host_io; in sdhc_cdns_set_io()
229 if (host_io->bus_width != ios->bus_width || host_io->clock != in sdhc_cdns_set_io()
230 ios->clock) { in sdhc_cdns_set_io()
231 host_io->bus_width = ios->bus_width; in sdhc_cdns_set_io()
232 host_io->clock = ios->clock; in sdhc_cdns_set_io()
233 return cdns_sdmmc_ops->set_ios(ios->clock, ios->bus_width); in sdhc_cdns_set_io()