Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Qualcomm SDHCI driver - SD/eMMC controller |
| 4 | * |
| 5 | * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com> |
| 6 | * |
| 7 | * Based on Linux driver |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 8 | */ |
| 9 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 10 | #include <clk.h> |
| 11 | #include <dm.h> |
Simon Glass | 9bc1564 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 12 | #include <malloc.h> |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 13 | #include <sdhci.h> |
| 14 | #include <wait_bit.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 15 | #include <asm/global_data.h> |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 16 | #include <asm/io.h> |
| 17 | #include <linux/bitops.h> |
| 18 | |
| 19 | /* Non-standard registers needed for SDHCI startup */ |
| 20 | #define SDCC_MCI_POWER 0x0 |
| 21 | #define SDCC_MCI_POWER_SW_RST BIT(7) |
| 22 | |
| 23 | /* This is undocumented register */ |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 24 | #define SDCC_MCI_VERSION 0x50 |
| 25 | #define SDCC_V5_VERSION 0x318 |
| 26 | |
| 27 | #define SDCC_VERSION_MAJOR_SHIFT 28 |
| 28 | #define SDCC_VERSION_MAJOR_MASK (0xf << SDCC_VERSION_MAJOR_SHIFT) |
| 29 | #define SDCC_VERSION_MINOR_MASK 0xff |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 30 | |
| 31 | #define SDCC_MCI_STATUS2 0x6C |
| 32 | #define SDCC_MCI_STATUS2_MCI_ACT 0x1 |
| 33 | #define SDCC_MCI_HC_MODE 0x78 |
| 34 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 35 | #define CORE_VENDOR_SPEC_POR_VAL 0xa9c |
| 36 | |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 37 | struct msm_sdhc_plat { |
| 38 | struct mmc_config cfg; |
| 39 | struct mmc mmc; |
| 40 | }; |
| 41 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 42 | struct msm_sdhc { |
| 43 | struct sdhci_host host; |
| 44 | void *base; |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 45 | struct clk_bulk clks; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 46 | }; |
| 47 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 48 | struct msm_sdhc_variant_info { |
| 49 | bool mci_removed; |
Caleb Connolly | c1f71d2 | 2024-04-09 20:03:00 +0200 | [diff] [blame] | 50 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 51 | u32 core_vendor_spec; |
Caleb Connolly | c1f71d2 | 2024-04-09 20:03:00 +0200 | [diff] [blame] | 52 | u32 core_vendor_spec_capabilities0; |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 53 | }; |
| 54 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 55 | DECLARE_GLOBAL_DATA_PTR; |
| 56 | |
| 57 | static int msm_sdc_clk_init(struct udevice *dev) |
| 58 | { |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 59 | struct msm_sdhc *prv = dev_get_priv(dev); |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 60 | const struct msm_sdhc_variant_info *var_info; |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 61 | ofnode node = dev_ofnode(dev); |
| 62 | ulong clk_rate; |
| 63 | int ret, i = 0, n_clks; |
| 64 | const char *clk_name; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 65 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 66 | var_info = (void *)dev_get_driver_data(dev); |
| 67 | |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 68 | ret = ofnode_read_u32(node, "clock-frequency", (uint *)(&clk_rate)); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 69 | if (ret) |
Caleb Connolly | 66dfa56 | 2024-04-09 20:03:03 +0200 | [diff] [blame] | 70 | clk_rate = 201500000; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 71 | |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 72 | ret = clk_get_bulk(dev, &prv->clks); |
| 73 | if (ret) { |
| 74 | log_warning("Couldn't get mmc clocks: %d\n", ret); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 75 | return ret; |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 76 | } |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 77 | |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 78 | ret = clk_enable_bulk(&prv->clks); |
| 79 | if (ret) { |
| 80 | log_warning("Couldn't enable mmc clocks: %d\n", ret); |
Stephen Warren | a962243 | 2016-06-17 09:44:00 -0600 | [diff] [blame] | 81 | return ret; |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 82 | } |
Stephen Warren | a962243 | 2016-06-17 09:44:00 -0600 | [diff] [blame] | 83 | |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 84 | /* If clock-names is unspecified, then the first clock is the core clock */ |
| 85 | if (!ofnode_get_property(node, "clock-names", &n_clks)) { |
| 86 | if (!clk_set_rate(&prv->clks.clks[0], clk_rate)) { |
| 87 | log_warning("Couldn't set core clock rate: %d\n", ret); |
| 88 | return -EINVAL; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /* Find the index of the "core" clock */ |
| 93 | while (i < n_clks) { |
| 94 | ofnode_read_string_index(node, "clock-names", i, &clk_name); |
| 95 | if (!strcmp(clk_name, "core")) |
| 96 | break; |
| 97 | i++; |
| 98 | } |
| 99 | |
| 100 | if (i >= prv->clks.count) { |
| 101 | log_warning("Couldn't find core clock (index %d but only have %d clocks)\n", i, |
| 102 | prv->clks.count); |
| 103 | return -EINVAL; |
| 104 | } |
| 105 | |
| 106 | /* The clock is already enabled by the clk_bulk above */ |
| 107 | clk_rate = clk_set_rate(&prv->clks.clks[i], clk_rate); |
| 108 | /* If we get a rate of 0 then something has probably gone wrong. */ |
| 109 | if (clk_rate == 0 || IS_ERR((void *)clk_rate)) { |
| 110 | log_warning("Couldn't set MMC core clock rate: %dE\n", clk_rate ? (int)PTR_ERR((void *)clk_rate) : 0); |
| 111 | return -EINVAL; |
| 112 | } |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 113 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 114 | writel_relaxed(CORE_VENDOR_SPEC_POR_VAL, |
| 115 | prv->host.ioaddr + var_info->core_vendor_spec); |
| 116 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 117 | return 0; |
| 118 | } |
| 119 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 120 | static int msm_sdc_mci_init(struct msm_sdhc *prv) |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 121 | { |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 122 | /* Reset the core and Enable SDHC mode */ |
| 123 | writel(readl(prv->base + SDCC_MCI_POWER) | SDCC_MCI_POWER_SW_RST, |
| 124 | prv->base + SDCC_MCI_POWER); |
| 125 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 126 | /* Wait for reset to be written to register */ |
Álvaro Fernández Rojas | 918de03 | 2018-01-23 17:14:55 +0100 | [diff] [blame] | 127 | if (wait_for_bit_le32(prv->base + SDCC_MCI_STATUS2, |
| 128 | SDCC_MCI_STATUS2_MCI_ACT, false, 10, false)) { |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 129 | printf("msm_sdhci: reset request failed\n"); |
| 130 | return -EIO; |
| 131 | } |
| 132 | |
| 133 | /* SW reset can take upto 10HCLK + 15MCLK cycles. (min 40us) */ |
Álvaro Fernández Rojas | 918de03 | 2018-01-23 17:14:55 +0100 | [diff] [blame] | 134 | if (wait_for_bit_le32(prv->base + SDCC_MCI_POWER, |
| 135 | SDCC_MCI_POWER_SW_RST, false, 2, false)) { |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 136 | printf("msm_sdhci: stuck in reset\n"); |
| 137 | return -ETIMEDOUT; |
| 138 | } |
| 139 | |
| 140 | /* Enable host-controller mode */ |
| 141 | writel(1, prv->base + SDCC_MCI_HC_MODE); |
| 142 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 143 | return 0; |
| 144 | } |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 145 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 146 | static int msm_sdc_probe(struct udevice *dev) |
| 147 | { |
| 148 | struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); |
| 149 | struct msm_sdhc_plat *plat = dev_get_plat(dev); |
| 150 | struct msm_sdhc *prv = dev_get_priv(dev); |
| 151 | const struct msm_sdhc_variant_info *var_info; |
| 152 | struct sdhci_host *host = &prv->host; |
| 153 | u32 core_version, core_minor, core_major; |
| 154 | u32 caps; |
| 155 | int ret; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 156 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 157 | host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_BROKEN_R1B; |
| 158 | |
| 159 | host->max_clk = 0; |
| 160 | |
| 161 | /* Init clocks */ |
| 162 | ret = msm_sdc_clk_init(dev); |
| 163 | if (ret) |
| 164 | return ret; |
| 165 | |
| 166 | var_info = (void *)dev_get_driver_data(dev); |
| 167 | if (!var_info->mci_removed) { |
| 168 | ret = msm_sdc_mci_init(prv); |
| 169 | if (ret) |
| 170 | return ret; |
| 171 | } |
| 172 | |
| 173 | if (!var_info->mci_removed) |
| 174 | core_version = readl(prv->base + SDCC_MCI_VERSION); |
| 175 | else |
| 176 | core_version = readl(host->ioaddr + SDCC_V5_VERSION); |
| 177 | |
| 178 | core_major = (core_version & SDCC_VERSION_MAJOR_MASK); |
| 179 | core_major >>= SDCC_VERSION_MAJOR_SHIFT; |
| 180 | |
| 181 | core_minor = core_version & SDCC_VERSION_MINOR_MASK; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 182 | |
Caleb Connolly | 790d412 | 2024-04-09 20:03:02 +0200 | [diff] [blame] | 183 | log_debug("SDCC version %d.%d\n", core_major, core_minor); |
| 184 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 185 | /* |
| 186 | * Support for some capabilities is not advertised by newer |
| 187 | * controller versions and must be explicitly enabled. |
| 188 | */ |
| 189 | if (core_major >= 1 && core_minor != 0x11 && core_minor != 0x12) { |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 190 | caps = readl(host->ioaddr + SDHCI_CAPABILITIES); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 191 | caps |= SDHCI_CAN_VDD_300 | SDHCI_CAN_DO_8BIT; |
Caleb Connolly | c1f71d2 | 2024-04-09 20:03:00 +0200 | [diff] [blame] | 192 | writel(caps, host->ioaddr + var_info->core_vendor_spec_capabilities0); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 193 | } |
| 194 | |
Manivannan Sadhasivam | 6b36ab5 | 2020-07-16 14:37:26 +0530 | [diff] [blame] | 195 | ret = mmc_of_parse(dev, &plat->cfg); |
| 196 | if (ret) |
| 197 | return ret; |
| 198 | |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 199 | host->mmc = &plat->mmc; |
Peng Fan | f92f7b6 | 2019-08-06 02:47:53 +0000 | [diff] [blame] | 200 | host->mmc->dev = dev; |
| 201 | ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0); |
Mateusz Kulikowski | c012e57 | 2016-06-26 22:43:55 +0200 | [diff] [blame] | 202 | if (ret) |
| 203 | return ret; |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 204 | host->mmc->priv = &prv->host; |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 205 | upriv->mmc = host->mmc; |
Mateusz Kulikowski | c012e57 | 2016-06-26 22:43:55 +0200 | [diff] [blame] | 206 | |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 207 | return sdhci_probe(dev); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | static int msm_sdc_remove(struct udevice *dev) |
| 211 | { |
| 212 | struct msm_sdhc *priv = dev_get_priv(dev); |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 213 | const struct msm_sdhc_variant_info *var_info; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 214 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 215 | var_info = (void *)dev_get_driver_data(dev); |
| 216 | |
| 217 | /* Disable host-controller mode */ |
Caleb Connolly | 6d32da3 | 2024-04-09 20:03:01 +0200 | [diff] [blame] | 218 | if (!var_info->mci_removed && priv->base) |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 219 | writel(0, priv->base + SDCC_MCI_HC_MODE); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 220 | |
Caleb Connolly | fb782f5 | 2024-02-26 17:26:07 +0000 | [diff] [blame] | 221 | clk_release_bulk(&priv->clks); |
| 222 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 223 | return 0; |
| 224 | } |
| 225 | |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 226 | static int msm_of_to_plat(struct udevice *dev) |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 227 | { |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 228 | struct msm_sdhc *priv = dev_get_priv(dev); |
Caleb Connolly | 6d32da3 | 2024-04-09 20:03:01 +0200 | [diff] [blame] | 229 | const struct msm_sdhc_variant_info *var_info; |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 230 | struct sdhci_host *host = &priv->host; |
Caleb Connolly | 6d32da3 | 2024-04-09 20:03:01 +0200 | [diff] [blame] | 231 | int ret; |
| 232 | |
| 233 | var_info = (void*)dev_get_driver_data(dev); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 234 | |
| 235 | host->name = strdup(dev->name); |
Masahiro Yamada | 1096ae1 | 2020-07-17 14:36:46 +0900 | [diff] [blame] | 236 | host->ioaddr = dev_read_addr_ptr(dev); |
Caleb Connolly | 6d32da3 | 2024-04-09 20:03:01 +0200 | [diff] [blame] | 237 | ret = dev_read_u32(dev, "bus-width", &host->bus_width); |
| 238 | if (ret) |
| 239 | host->bus_width = 4; |
| 240 | ret = dev_read_u32(dev, "index", &host->index); |
| 241 | if (ret) |
| 242 | host->index = 0; |
| 243 | priv->base = dev_read_addr_index_ptr(dev, 1); |
| 244 | |
| 245 | if (!host->ioaddr) |
| 246 | return -EINVAL; |
| 247 | |
| 248 | if (!var_info->mci_removed && !priv->base) { |
| 249 | printf("msm_sdhci: MCI base address not found\n"); |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 250 | return -EINVAL; |
Caleb Connolly | 6d32da3 | 2024-04-09 20:03:01 +0200 | [diff] [blame] | 251 | } |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 252 | |
| 253 | return 0; |
| 254 | } |
| 255 | |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 256 | static int msm_sdc_bind(struct udevice *dev) |
| 257 | { |
Simon Glass | fa20e93 | 2020-12-03 16:55:20 -0700 | [diff] [blame] | 258 | struct msm_sdhc_plat *plat = dev_get_plat(dev); |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 259 | |
Masahiro Yamada | cdb67f3 | 2016-09-06 22:17:32 +0900 | [diff] [blame] | 260 | return sdhci_bind(dev, &plat->mmc, &plat->cfg); |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 261 | } |
| 262 | |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 263 | static const struct msm_sdhc_variant_info msm_sdhc_mci_var = { |
| 264 | .mci_removed = false, |
Caleb Connolly | c1f71d2 | 2024-04-09 20:03:00 +0200 | [diff] [blame] | 265 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 266 | .core_vendor_spec = 0x10c, |
Caleb Connolly | 5d8b575 | 2024-04-12 20:10:21 +0200 | [diff] [blame] | 267 | .core_vendor_spec_capabilities0 = 0x11c, |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 268 | }; |
| 269 | |
| 270 | static const struct msm_sdhc_variant_info msm_sdhc_v5_var = { |
| 271 | .mci_removed = true, |
Caleb Connolly | c1f71d2 | 2024-04-09 20:03:00 +0200 | [diff] [blame] | 272 | |
Caleb Connolly | 3459a45 | 2024-06-21 03:53:09 +0200 | [diff] [blame] | 273 | .core_vendor_spec = 0x20c, |
Caleb Connolly | 5d8b575 | 2024-04-12 20:10:21 +0200 | [diff] [blame] | 274 | .core_vendor_spec_capabilities0 = 0x21c, |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 275 | }; |
| 276 | |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 277 | static const struct udevice_id msm_mmc_ids[] = { |
Sumit Garg | 1e2dc03 | 2022-07-12 12:42:09 +0530 | [diff] [blame] | 278 | { .compatible = "qcom,sdhci-msm-v4", .data = (ulong)&msm_sdhc_mci_var }, |
| 279 | { .compatible = "qcom,sdhci-msm-v5", .data = (ulong)&msm_sdhc_v5_var }, |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 280 | { } |
| 281 | }; |
| 282 | |
| 283 | U_BOOT_DRIVER(msm_sdc_drv) = { |
| 284 | .name = "msm_sdc", |
| 285 | .id = UCLASS_MMC, |
| 286 | .of_match = msm_mmc_ids, |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 287 | .of_to_plat = msm_of_to_plat, |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 288 | .ops = &sdhci_ops, |
Simon Glass | 8ef0765 | 2016-06-12 23:30:29 -0600 | [diff] [blame] | 289 | .bind = msm_sdc_bind, |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 290 | .probe = msm_sdc_probe, |
| 291 | .remove = msm_sdc_remove, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 292 | .priv_auto = sizeof(struct msm_sdhc), |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 293 | .plat_auto = sizeof(struct msm_sdhc_plat), |
Mateusz Kulikowski | a00b0c0 | 2016-03-31 23:12:16 +0200 | [diff] [blame] | 294 | }; |