Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 1 | /* |
Pierre Ossman | 70f1048 | 2007-07-11 20:04:50 +0200 | [diff] [blame] | 2 | * linux/drivers/mmc/core/sd.c |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2003-2004 Russell King, All Rights Reserved. |
| 5 | * SD support Copyright (C) 2004 Ian Molton, All Rights Reserved. |
| 6 | * Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/err.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame^] | 14 | #include <linux/slab.h> |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 15 | |
| 16 | #include <linux/mmc/host.h> |
| 17 | #include <linux/mmc/card.h> |
| 18 | #include <linux/mmc/mmc.h> |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 19 | #include <linux/mmc/sd.h> |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 20 | |
| 21 | #include "core.h" |
Pierre Ossman | 4101c16 | 2007-05-19 13:39:01 +0200 | [diff] [blame] | 22 | #include "bus.h" |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 23 | #include "mmc_ops.h" |
| 24 | #include "sd_ops.h" |
| 25 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 26 | static const unsigned int tran_exp[] = { |
| 27 | 10000, 100000, 1000000, 10000000, |
| 28 | 0, 0, 0, 0 |
| 29 | }; |
| 30 | |
| 31 | static const unsigned char tran_mant[] = { |
| 32 | 0, 10, 12, 13, 15, 20, 25, 30, |
| 33 | 35, 40, 45, 50, 55, 60, 70, 80, |
| 34 | }; |
| 35 | |
| 36 | static const unsigned int tacc_exp[] = { |
| 37 | 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, |
| 38 | }; |
| 39 | |
| 40 | static const unsigned int tacc_mant[] = { |
| 41 | 0, 10, 12, 13, 15, 20, 25, 30, |
| 42 | 35, 40, 45, 50, 55, 60, 70, 80, |
| 43 | }; |
| 44 | |
| 45 | #define UNSTUFF_BITS(resp,start,size) \ |
| 46 | ({ \ |
| 47 | const int __size = size; \ |
| 48 | const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \ |
| 49 | const int __off = 3 - ((start) / 32); \ |
| 50 | const int __shft = (start) & 31; \ |
| 51 | u32 __res; \ |
| 52 | \ |
| 53 | __res = resp[__off] >> __shft; \ |
| 54 | if (__size + __shft > 32) \ |
| 55 | __res |= resp[__off-1] << ((32 - __shft) % 32); \ |
| 56 | __res & __mask; \ |
| 57 | }) |
| 58 | |
| 59 | /* |
| 60 | * Given the decoded CSD structure, decode the raw CID to our CID structure. |
| 61 | */ |
| 62 | static void mmc_decode_cid(struct mmc_card *card) |
| 63 | { |
| 64 | u32 *resp = card->raw_cid; |
| 65 | |
| 66 | memset(&card->cid, 0, sizeof(struct mmc_cid)); |
| 67 | |
| 68 | /* |
| 69 | * SD doesn't currently have a version field so we will |
| 70 | * have to assume we can parse this. |
| 71 | */ |
| 72 | card->cid.manfid = UNSTUFF_BITS(resp, 120, 8); |
| 73 | card->cid.oemid = UNSTUFF_BITS(resp, 104, 16); |
| 74 | card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8); |
| 75 | card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8); |
| 76 | card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8); |
| 77 | card->cid.prod_name[3] = UNSTUFF_BITS(resp, 72, 8); |
| 78 | card->cid.prod_name[4] = UNSTUFF_BITS(resp, 64, 8); |
| 79 | card->cid.hwrev = UNSTUFF_BITS(resp, 60, 4); |
| 80 | card->cid.fwrev = UNSTUFF_BITS(resp, 56, 4); |
| 81 | card->cid.serial = UNSTUFF_BITS(resp, 24, 32); |
| 82 | card->cid.year = UNSTUFF_BITS(resp, 12, 8); |
| 83 | card->cid.month = UNSTUFF_BITS(resp, 8, 4); |
| 84 | |
| 85 | card->cid.year += 2000; /* SD cards year offset */ |
| 86 | } |
| 87 | |
| 88 | /* |
| 89 | * Given a 128-bit response, decode to our card CSD structure. |
| 90 | */ |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 91 | static int mmc_decode_csd(struct mmc_card *card) |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 92 | { |
| 93 | struct mmc_csd *csd = &card->csd; |
| 94 | unsigned int e, m, csd_struct; |
| 95 | u32 *resp = card->raw_csd; |
| 96 | |
| 97 | csd_struct = UNSTUFF_BITS(resp, 126, 2); |
| 98 | |
| 99 | switch (csd_struct) { |
| 100 | case 0: |
| 101 | m = UNSTUFF_BITS(resp, 115, 4); |
| 102 | e = UNSTUFF_BITS(resp, 112, 3); |
| 103 | csd->tacc_ns = (tacc_exp[e] * tacc_mant[m] + 9) / 10; |
| 104 | csd->tacc_clks = UNSTUFF_BITS(resp, 104, 8) * 100; |
| 105 | |
| 106 | m = UNSTUFF_BITS(resp, 99, 4); |
| 107 | e = UNSTUFF_BITS(resp, 96, 3); |
| 108 | csd->max_dtr = tran_exp[e] * tran_mant[m]; |
| 109 | csd->cmdclass = UNSTUFF_BITS(resp, 84, 12); |
| 110 | |
| 111 | e = UNSTUFF_BITS(resp, 47, 3); |
| 112 | m = UNSTUFF_BITS(resp, 62, 12); |
| 113 | csd->capacity = (1 + m) << (e + 2); |
| 114 | |
| 115 | csd->read_blkbits = UNSTUFF_BITS(resp, 80, 4); |
| 116 | csd->read_partial = UNSTUFF_BITS(resp, 79, 1); |
| 117 | csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); |
| 118 | csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); |
| 119 | csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3); |
| 120 | csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); |
| 121 | csd->write_partial = UNSTUFF_BITS(resp, 21, 1); |
| 122 | break; |
| 123 | case 1: |
| 124 | /* |
| 125 | * This is a block-addressed SDHC card. Most |
| 126 | * interesting fields are unused and have fixed |
| 127 | * values. To avoid getting tripped by buggy cards, |
| 128 | * we assume those fixed values ourselves. |
| 129 | */ |
| 130 | mmc_card_set_blockaddr(card); |
| 131 | |
| 132 | csd->tacc_ns = 0; /* Unused */ |
| 133 | csd->tacc_clks = 0; /* Unused */ |
| 134 | |
| 135 | m = UNSTUFF_BITS(resp, 99, 4); |
| 136 | e = UNSTUFF_BITS(resp, 96, 3); |
| 137 | csd->max_dtr = tran_exp[e] * tran_mant[m]; |
| 138 | csd->cmdclass = UNSTUFF_BITS(resp, 84, 12); |
| 139 | |
| 140 | m = UNSTUFF_BITS(resp, 48, 22); |
| 141 | csd->capacity = (1 + m) << 10; |
| 142 | |
| 143 | csd->read_blkbits = 9; |
| 144 | csd->read_partial = 0; |
| 145 | csd->write_misalign = 0; |
| 146 | csd->read_misalign = 0; |
| 147 | csd->r2w_factor = 4; /* Unused */ |
| 148 | csd->write_blkbits = 9; |
| 149 | csd->write_partial = 0; |
| 150 | break; |
| 151 | default: |
Pierre Ossman | facba91 | 2007-07-24 21:53:43 +0200 | [diff] [blame] | 152 | printk(KERN_ERR "%s: unrecognised CSD structure version %d\n", |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 153 | mmc_hostname(card->host), csd_struct); |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 154 | return -EINVAL; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 155 | } |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 156 | |
| 157 | return 0; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | /* |
| 161 | * Given a 64-bit response, decode to our card SCR structure. |
| 162 | */ |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 163 | static int mmc_decode_scr(struct mmc_card *card) |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 164 | { |
| 165 | struct sd_scr *scr = &card->scr; |
| 166 | unsigned int scr_struct; |
| 167 | u32 resp[4]; |
| 168 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 169 | resp[3] = card->raw_scr[1]; |
| 170 | resp[2] = card->raw_scr[0]; |
| 171 | |
| 172 | scr_struct = UNSTUFF_BITS(resp, 60, 4); |
| 173 | if (scr_struct != 0) { |
Pierre Ossman | facba91 | 2007-07-24 21:53:43 +0200 | [diff] [blame] | 174 | printk(KERN_ERR "%s: unrecognised SCR structure version %d\n", |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 175 | mmc_hostname(card->host), scr_struct); |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 176 | return -EINVAL; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | scr->sda_vsn = UNSTUFF_BITS(resp, 56, 4); |
| 180 | scr->bus_widths = UNSTUFF_BITS(resp, 48, 4); |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 181 | |
| 182 | return 0; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | /* |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 186 | * Fetches and decodes switch information |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 187 | */ |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 188 | static int mmc_read_switch(struct mmc_card *card) |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 189 | { |
| 190 | int err; |
| 191 | u8 *status; |
| 192 | |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 193 | if (card->scr.sda_vsn < SCR_SPEC_VER_1) |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 194 | return 0; |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 195 | |
| 196 | if (!(card->csd.cmdclass & CCC_SWITCH)) { |
| 197 | printk(KERN_WARNING "%s: card lacks mandatory switch " |
| 198 | "function, performance might suffer.\n", |
| 199 | mmc_hostname(card->host)); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 200 | return 0; |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 201 | } |
| 202 | |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 203 | err = -EIO; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 204 | |
| 205 | status = kmalloc(64, GFP_KERNEL); |
| 206 | if (!status) { |
Pierre Ossman | facba91 | 2007-07-24 21:53:43 +0200 | [diff] [blame] | 207 | printk(KERN_ERR "%s: could not allocate a buffer for " |
| 208 | "switch capabilities.\n", mmc_hostname(card->host)); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 209 | return -ENOMEM; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | err = mmc_sd_switch(card, 0, 0, 1, status); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 213 | if (err) { |
Wolfgang Muees | d08ebed | 2009-09-22 16:45:26 -0700 | [diff] [blame] | 214 | /* If the host or the card can't do the switch, |
| 215 | * fail more gracefully. */ |
| 216 | if ((err != -EINVAL) |
| 217 | && (err != -ENOSYS) |
| 218 | && (err != -EFAULT)) |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 219 | goto out; |
| 220 | |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 221 | printk(KERN_WARNING "%s: problem reading switch " |
| 222 | "capabilities, performance might suffer.\n", |
| 223 | mmc_hostname(card->host)); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 224 | err = 0; |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 225 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 226 | goto out; |
| 227 | } |
| 228 | |
| 229 | if (status[13] & 0x02) |
| 230 | card->sw_caps.hs_max_dtr = 50000000; |
| 231 | |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 232 | out: |
| 233 | kfree(status); |
| 234 | |
| 235 | return err; |
| 236 | } |
| 237 | |
| 238 | /* |
| 239 | * Test if the card supports high-speed mode and, if so, switch to it. |
| 240 | */ |
| 241 | static int mmc_switch_hs(struct mmc_card *card) |
| 242 | { |
| 243 | int err; |
| 244 | u8 *status; |
| 245 | |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 246 | if (card->scr.sda_vsn < SCR_SPEC_VER_1) |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 247 | return 0; |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 248 | |
| 249 | if (!(card->csd.cmdclass & CCC_SWITCH)) |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 250 | return 0; |
Pierre Ossman | 3373c0a | 2007-05-31 22:25:11 +0200 | [diff] [blame] | 251 | |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 252 | if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED)) |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 253 | return 0; |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 254 | |
| 255 | if (card->sw_caps.hs_max_dtr == 0) |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 256 | return 0; |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 257 | |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 258 | err = -EIO; |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 259 | |
| 260 | status = kmalloc(64, GFP_KERNEL); |
| 261 | if (!status) { |
Pierre Ossman | facba91 | 2007-07-24 21:53:43 +0200 | [diff] [blame] | 262 | printk(KERN_ERR "%s: could not allocate a buffer for " |
| 263 | "switch capabilities.\n", mmc_hostname(card->host)); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 264 | return -ENOMEM; |
Pierre Ossman | 1addfcd | 2007-05-01 14:46:08 +0200 | [diff] [blame] | 265 | } |
| 266 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 267 | err = mmc_sd_switch(card, 1, 0, 1, status); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 268 | if (err) |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 269 | goto out; |
| 270 | |
| 271 | if ((status[16] & 0xF) != 1) { |
| 272 | printk(KERN_WARNING "%s: Problem switching card " |
| 273 | "into high-speed mode!\n", |
| 274 | mmc_hostname(card->host)); |
| 275 | } else { |
| 276 | mmc_card_set_highspeed(card); |
| 277 | mmc_set_timing(card->host, MMC_TIMING_SD_HS); |
| 278 | } |
| 279 | |
| 280 | out: |
| 281 | kfree(status); |
| 282 | |
| 283 | return err; |
| 284 | } |
| 285 | |
Pierre Ossman | 51ec92e | 2008-03-21 23:54:50 +0100 | [diff] [blame] | 286 | MMC_DEV_ATTR(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], |
| 287 | card->raw_cid[2], card->raw_cid[3]); |
| 288 | MMC_DEV_ATTR(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], |
| 289 | card->raw_csd[2], card->raw_csd[3]); |
| 290 | MMC_DEV_ATTR(scr, "%08x%08x\n", card->raw_scr[0], card->raw_scr[1]); |
| 291 | MMC_DEV_ATTR(date, "%02d/%04d\n", card->cid.month, card->cid.year); |
| 292 | MMC_DEV_ATTR(fwrev, "0x%x\n", card->cid.fwrev); |
| 293 | MMC_DEV_ATTR(hwrev, "0x%x\n", card->cid.hwrev); |
| 294 | MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid); |
| 295 | MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name); |
| 296 | MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid); |
| 297 | MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial); |
| 298 | |
| 299 | |
| 300 | static struct attribute *sd_std_attrs[] = { |
| 301 | &dev_attr_cid.attr, |
| 302 | &dev_attr_csd.attr, |
| 303 | &dev_attr_scr.attr, |
| 304 | &dev_attr_date.attr, |
| 305 | &dev_attr_fwrev.attr, |
| 306 | &dev_attr_hwrev.attr, |
| 307 | &dev_attr_manfid.attr, |
| 308 | &dev_attr_name.attr, |
| 309 | &dev_attr_oemid.attr, |
| 310 | &dev_attr_serial.attr, |
| 311 | NULL, |
| 312 | }; |
| 313 | |
| 314 | static struct attribute_group sd_std_attr_group = { |
| 315 | .attrs = sd_std_attrs, |
| 316 | }; |
| 317 | |
David Brownell | a4dbd67 | 2009-06-24 10:06:31 -0700 | [diff] [blame] | 318 | static const struct attribute_group *sd_attr_groups[] = { |
Pierre Ossman | 51ec92e | 2008-03-21 23:54:50 +0100 | [diff] [blame] | 319 | &sd_std_attr_group, |
| 320 | NULL, |
| 321 | }; |
| 322 | |
| 323 | static struct device_type sd_type = { |
| 324 | .groups = sd_attr_groups, |
| 325 | }; |
| 326 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 327 | /* |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 328 | * Handle the detection and initialisation of a card. |
| 329 | * |
Deepak Saxena | 8769392 | 2008-06-16 19:20:57 -0700 | [diff] [blame] | 330 | * In the case of a resume, "oldcard" will contain the card |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 331 | * we're trying to reinitialise. |
| 332 | */ |
| 333 | static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, |
| 334 | struct mmc_card *oldcard) |
| 335 | { |
| 336 | struct mmc_card *card; |
| 337 | int err; |
| 338 | u32 cid[4]; |
| 339 | unsigned int max_dtr; |
| 340 | |
| 341 | BUG_ON(!host); |
Pierre Ossman | d84075c8 | 2007-08-09 13:23:56 +0200 | [diff] [blame] | 342 | WARN_ON(!host->claimed); |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 343 | |
| 344 | /* |
| 345 | * Since we're changing the OCR value, we seem to |
| 346 | * need to tell some cards to go back to the idle |
| 347 | * state. We wait 1ms to give cards time to |
| 348 | * respond. |
| 349 | */ |
| 350 | mmc_go_idle(host); |
| 351 | |
| 352 | /* |
| 353 | * If SD_SEND_IF_COND indicates an SD 2.0 |
| 354 | * compliant card and we should set bit 30 |
| 355 | * of the ocr to indicate that we can handle |
| 356 | * block-addressed SDHC cards. |
| 357 | */ |
| 358 | err = mmc_send_if_cond(host, ocr); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 359 | if (!err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 360 | ocr |= 1 << 30; |
| 361 | |
| 362 | err = mmc_send_app_op_cond(host, ocr, NULL); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 363 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 364 | goto err; |
| 365 | |
| 366 | /* |
| 367 | * Fetch CID from card. |
| 368 | */ |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 369 | if (mmc_host_is_spi(host)) |
| 370 | err = mmc_send_cid(host, cid); |
| 371 | else |
| 372 | err = mmc_all_send_cid(host, cid); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 373 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 374 | goto err; |
| 375 | |
| 376 | if (oldcard) { |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 377 | if (memcmp(cid, oldcard->raw_cid, sizeof(cid)) != 0) { |
| 378 | err = -ENOENT; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 379 | goto err; |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 380 | } |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 381 | |
| 382 | card = oldcard; |
| 383 | } else { |
| 384 | /* |
| 385 | * Allocate card structure. |
| 386 | */ |
Pierre Ossman | 51ec92e | 2008-03-21 23:54:50 +0100 | [diff] [blame] | 387 | card = mmc_alloc_card(host, &sd_type); |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 388 | if (IS_ERR(card)) { |
| 389 | err = PTR_ERR(card); |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 390 | goto err; |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 391 | } |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 392 | |
| 393 | card->type = MMC_TYPE_SD; |
| 394 | memcpy(card->raw_cid, cid, sizeof(card->raw_cid)); |
| 395 | } |
| 396 | |
| 397 | /* |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 398 | * For native busses: get card RCA and quit open drain mode. |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 399 | */ |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 400 | if (!mmc_host_is_spi(host)) { |
| 401 | err = mmc_send_relative_addr(host, &card->rca); |
| 402 | if (err) |
| 403 | goto free_card; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 404 | |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 405 | mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); |
| 406 | } |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 407 | |
| 408 | if (!oldcard) { |
| 409 | /* |
| 410 | * Fetch CSD from card. |
| 411 | */ |
| 412 | err = mmc_send_csd(card, card->raw_csd); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 413 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 414 | goto free_card; |
| 415 | |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 416 | err = mmc_decode_csd(card); |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 417 | if (err) |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 418 | goto free_card; |
| 419 | |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 420 | mmc_decode_cid(card); |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | * Select card, as all following commands rely on that. |
| 425 | */ |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 426 | if (!mmc_host_is_spi(host)) { |
| 427 | err = mmc_select_card(card); |
| 428 | if (err) |
| 429 | goto free_card; |
| 430 | } |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 431 | |
| 432 | if (!oldcard) { |
| 433 | /* |
| 434 | * Fetch SCR from card. |
| 435 | */ |
| 436 | err = mmc_app_send_scr(card, card->raw_scr); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 437 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 438 | goto free_card; |
| 439 | |
Pierre Ossman | bd76631 | 2007-05-01 16:11:57 +0200 | [diff] [blame] | 440 | err = mmc_decode_scr(card); |
| 441 | if (err < 0) |
| 442 | goto free_card; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 443 | |
| 444 | /* |
| 445 | * Fetch switch information from card. |
| 446 | */ |
| 447 | err = mmc_read_switch(card); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 448 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 449 | goto free_card; |
| 450 | } |
| 451 | |
| 452 | /* |
Wolfgang Muees | 9d9f25c | 2009-04-07 14:48:16 +0100 | [diff] [blame] | 453 | * For SPI, enable CRC as appropriate. |
| 454 | * This CRC enable is located AFTER the reading of the |
| 455 | * card registers because some SDHC cards are not able |
| 456 | * to provide valid CRCs for non-512-byte blocks. |
| 457 | */ |
| 458 | if (mmc_host_is_spi(host)) { |
| 459 | err = mmc_spi_set_crc(host, use_spi_crc); |
| 460 | if (err) |
| 461 | goto free_card; |
| 462 | } |
| 463 | |
| 464 | /* |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 465 | * Attempt to change to high-speed (if supported) |
| 466 | */ |
| 467 | err = mmc_switch_hs(card); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 468 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 469 | goto free_card; |
| 470 | |
| 471 | /* |
| 472 | * Compute bus speed. |
| 473 | */ |
| 474 | max_dtr = (unsigned int)-1; |
| 475 | |
| 476 | if (mmc_card_highspeed(card)) { |
| 477 | if (max_dtr > card->sw_caps.hs_max_dtr) |
| 478 | max_dtr = card->sw_caps.hs_max_dtr; |
| 479 | } else if (max_dtr > card->csd.max_dtr) { |
| 480 | max_dtr = card->csd.max_dtr; |
| 481 | } |
| 482 | |
| 483 | mmc_set_clock(host, max_dtr); |
| 484 | |
| 485 | /* |
| 486 | * Switch to wider bus (if supported). |
| 487 | */ |
Pierre Ossman | 7165129 | 2007-06-06 20:23:25 +0200 | [diff] [blame] | 488 | if ((host->caps & MMC_CAP_4_BIT_DATA) && |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 489 | (card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) { |
| 490 | err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 491 | if (err) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 492 | goto free_card; |
| 493 | |
| 494 | mmc_set_bus_width(host, MMC_BUS_WIDTH_4); |
| 495 | } |
| 496 | |
Pierre Ossman | c3bff2e | 2007-06-13 19:06:03 +0200 | [diff] [blame] | 497 | /* |
| 498 | * Check if read-only switch is active. |
| 499 | */ |
| 500 | if (!oldcard) { |
Anton Vorontsov | 08f80bb | 2008-06-17 18:17:39 +0400 | [diff] [blame] | 501 | if (!host->ops->get_ro || host->ops->get_ro(host) < 0) { |
Pierre Ossman | c3bff2e | 2007-06-13 19:06:03 +0200 | [diff] [blame] | 502 | printk(KERN_WARNING "%s: host does not " |
| 503 | "support reading read-only " |
| 504 | "switch. assuming write-enable.\n", |
| 505 | mmc_hostname(host)); |
| 506 | } else { |
Anton Vorontsov | 08f80bb | 2008-06-17 18:17:39 +0400 | [diff] [blame] | 507 | if (host->ops->get_ro(host) > 0) |
Pierre Ossman | c3bff2e | 2007-06-13 19:06:03 +0200 | [diff] [blame] | 508 | mmc_card_set_readonly(card); |
| 509 | } |
| 510 | } |
| 511 | |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 512 | if (!oldcard) |
| 513 | host->card = card; |
| 514 | |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 515 | return 0; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 516 | |
| 517 | free_card: |
| 518 | if (!oldcard) |
| 519 | mmc_remove_card(card); |
| 520 | err: |
| 521 | |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 522 | return err; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 523 | } |
| 524 | |
| 525 | /* |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 526 | * Host is being removed. Free up the current card. |
| 527 | */ |
| 528 | static void mmc_sd_remove(struct mmc_host *host) |
| 529 | { |
| 530 | BUG_ON(!host); |
| 531 | BUG_ON(!host->card); |
| 532 | |
| 533 | mmc_remove_card(host->card); |
| 534 | host->card = NULL; |
| 535 | } |
| 536 | |
| 537 | /* |
| 538 | * Card detection callback from host. |
| 539 | */ |
| 540 | static void mmc_sd_detect(struct mmc_host *host) |
| 541 | { |
| 542 | int err; |
| 543 | |
| 544 | BUG_ON(!host); |
| 545 | BUG_ON(!host->card); |
| 546 | |
| 547 | mmc_claim_host(host); |
| 548 | |
| 549 | /* |
| 550 | * Just check if our card has been removed. |
| 551 | */ |
| 552 | err = mmc_send_status(host->card, NULL); |
| 553 | |
| 554 | mmc_release_host(host); |
| 555 | |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 556 | if (err) { |
Pierre Ossman | 4101c16 | 2007-05-19 13:39:01 +0200 | [diff] [blame] | 557 | mmc_sd_remove(host); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 558 | |
| 559 | mmc_claim_host(host); |
| 560 | mmc_detach_bus(host); |
| 561 | mmc_release_host(host); |
| 562 | } |
| 563 | } |
| 564 | |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 565 | /* |
| 566 | * Suspend callback from host. |
| 567 | */ |
Nicolas Pitre | 95cdfb7 | 2009-09-22 16:45:29 -0700 | [diff] [blame] | 568 | static int mmc_sd_suspend(struct mmc_host *host) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 569 | { |
| 570 | BUG_ON(!host); |
| 571 | BUG_ON(!host->card); |
| 572 | |
| 573 | mmc_claim_host(host); |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 574 | if (!mmc_host_is_spi(host)) |
| 575 | mmc_deselect_cards(host); |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 576 | host->card->state &= ~MMC_STATE_HIGHSPEED; |
| 577 | mmc_release_host(host); |
Nicolas Pitre | 95cdfb7 | 2009-09-22 16:45:29 -0700 | [diff] [blame] | 578 | |
| 579 | return 0; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 580 | } |
| 581 | |
| 582 | /* |
| 583 | * Resume callback from host. |
| 584 | * |
| 585 | * This function tries to determine if the same card is still present |
| 586 | * and, if so, restore all state to it. |
| 587 | */ |
Nicolas Pitre | 95cdfb7 | 2009-09-22 16:45:29 -0700 | [diff] [blame] | 588 | static int mmc_sd_resume(struct mmc_host *host) |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 589 | { |
| 590 | int err; |
| 591 | |
| 592 | BUG_ON(!host); |
| 593 | BUG_ON(!host->card); |
| 594 | |
| 595 | mmc_claim_host(host); |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 596 | err = mmc_sd_init_card(host, host->ocr, host->card); |
Pierre Ossman | 2986d0b | 2007-07-22 17:52:06 +0200 | [diff] [blame] | 597 | mmc_release_host(host); |
| 598 | |
Nicolas Pitre | 95cdfb7 | 2009-09-22 16:45:29 -0700 | [diff] [blame] | 599 | return err; |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 600 | } |
| 601 | |
Adrian Hunter | eae1aee | 2009-09-22 16:44:33 -0700 | [diff] [blame] | 602 | static void mmc_sd_power_restore(struct mmc_host *host) |
| 603 | { |
| 604 | host->card->state &= ~MMC_STATE_HIGHSPEED; |
| 605 | mmc_claim_host(host); |
| 606 | mmc_sd_init_card(host, host->ocr, host->card); |
| 607 | mmc_release_host(host); |
| 608 | } |
| 609 | |
Adrian Hunter | 9feae24 | 2009-09-22 16:44:32 -0700 | [diff] [blame] | 610 | static const struct mmc_bus_ops mmc_sd_ops = { |
| 611 | .remove = mmc_sd_remove, |
| 612 | .detect = mmc_sd_detect, |
| 613 | .suspend = NULL, |
| 614 | .resume = NULL, |
Adrian Hunter | eae1aee | 2009-09-22 16:44:33 -0700 | [diff] [blame] | 615 | .power_restore = mmc_sd_power_restore, |
Adrian Hunter | 9feae24 | 2009-09-22 16:44:32 -0700 | [diff] [blame] | 616 | }; |
| 617 | |
| 618 | static const struct mmc_bus_ops mmc_sd_ops_unsafe = { |
| 619 | .remove = mmc_sd_remove, |
| 620 | .detect = mmc_sd_detect, |
| 621 | .suspend = mmc_sd_suspend, |
| 622 | .resume = mmc_sd_resume, |
Adrian Hunter | eae1aee | 2009-09-22 16:44:33 -0700 | [diff] [blame] | 623 | .power_restore = mmc_sd_power_restore, |
Adrian Hunter | 9feae24 | 2009-09-22 16:44:32 -0700 | [diff] [blame] | 624 | }; |
| 625 | |
| 626 | static void mmc_sd_attach_bus_ops(struct mmc_host *host) |
| 627 | { |
| 628 | const struct mmc_bus_ops *bus_ops; |
| 629 | |
Ben Hutchings | bd68e08 | 2009-12-14 18:01:29 -0800 | [diff] [blame] | 630 | if (host->caps & MMC_CAP_NONREMOVABLE || !mmc_assume_removable) |
Adrian Hunter | 9feae24 | 2009-09-22 16:44:32 -0700 | [diff] [blame] | 631 | bus_ops = &mmc_sd_ops_unsafe; |
| 632 | else |
| 633 | bus_ops = &mmc_sd_ops; |
| 634 | mmc_attach_bus(host, bus_ops); |
| 635 | } |
| 636 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 637 | /* |
| 638 | * Starting point for SD card init. |
| 639 | */ |
| 640 | int mmc_attach_sd(struct mmc_host *host, u32 ocr) |
| 641 | { |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 642 | int err; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 643 | |
| 644 | BUG_ON(!host); |
Pierre Ossman | d84075c8 | 2007-08-09 13:23:56 +0200 | [diff] [blame] | 645 | WARN_ON(!host->claimed); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 646 | |
Adrian Hunter | 9feae24 | 2009-09-22 16:44:32 -0700 | [diff] [blame] | 647 | mmc_sd_attach_bus_ops(host); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 648 | |
Philip Langdale | 55556da | 2007-03-16 19:39:00 -0700 | [diff] [blame] | 649 | /* |
David Brownell | af51715 | 2007-08-08 09:11:32 -0700 | [diff] [blame] | 650 | * We need to get OCR a different way for SPI. |
| 651 | */ |
| 652 | if (mmc_host_is_spi(host)) { |
| 653 | mmc_go_idle(host); |
| 654 | |
| 655 | err = mmc_spi_read_ocr(host, 0, &ocr); |
| 656 | if (err) |
| 657 | goto err; |
| 658 | } |
| 659 | |
| 660 | /* |
Philip Langdale | 55556da | 2007-03-16 19:39:00 -0700 | [diff] [blame] | 661 | * Sanity check the voltages that the card claims to |
| 662 | * support. |
| 663 | */ |
| 664 | if (ocr & 0x7F) { |
| 665 | printk(KERN_WARNING "%s: card claims to support voltages " |
| 666 | "below the defined range. These will be ignored.\n", |
| 667 | mmc_hostname(host)); |
| 668 | ocr &= ~0x7F; |
| 669 | } |
| 670 | |
| 671 | if (ocr & MMC_VDD_165_195) { |
| 672 | printk(KERN_WARNING "%s: SD card claims to support the " |
| 673 | "incompletely defined 'low voltage range'. This " |
| 674 | "will be ignored.\n", mmc_hostname(host)); |
| 675 | ocr &= ~MMC_VDD_165_195; |
| 676 | } |
| 677 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 678 | host->ocr = mmc_select_voltage(host, ocr); |
| 679 | |
| 680 | /* |
| 681 | * Can we support the voltage(s) of the card(s)? |
| 682 | */ |
Pierre Ossman | 109b5be | 2007-07-23 00:12:10 +0200 | [diff] [blame] | 683 | if (!host->ocr) { |
| 684 | err = -EINVAL; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 685 | goto err; |
Pierre Ossman | 109b5be | 2007-07-23 00:12:10 +0200 | [diff] [blame] | 686 | } |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 687 | |
| 688 | /* |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 689 | * Detect and init the card. |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 690 | */ |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 691 | err = mmc_sd_init_card(host, host->ocr, NULL); |
Pierre Ossman | 17b0429 | 2007-07-22 22:18:46 +0200 | [diff] [blame] | 692 | if (err) |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 693 | goto err; |
| 694 | |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 695 | mmc_release_host(host); |
| 696 | |
Pierre Ossman | 4101c16 | 2007-05-19 13:39:01 +0200 | [diff] [blame] | 697 | err = mmc_add_card(host->card); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 698 | if (err) |
Pierre Ossman | 2986d0b | 2007-07-22 17:52:06 +0200 | [diff] [blame] | 699 | goto remove_card; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 700 | |
| 701 | return 0; |
| 702 | |
Pierre Ossman | 2986d0b | 2007-07-22 17:52:06 +0200 | [diff] [blame] | 703 | remove_card: |
Pierre Ossman | 6abaa0c | 2007-05-01 16:00:02 +0200 | [diff] [blame] | 704 | mmc_remove_card(host->card); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 705 | host->card = NULL; |
Pierre Ossman | 2986d0b | 2007-07-22 17:52:06 +0200 | [diff] [blame] | 706 | mmc_claim_host(host); |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 707 | err: |
| 708 | mmc_detach_bus(host); |
| 709 | mmc_release_host(host); |
| 710 | |
Pierre Ossman | 109b5be | 2007-07-23 00:12:10 +0200 | [diff] [blame] | 711 | printk(KERN_ERR "%s: error %d whilst initialising SD card\n", |
| 712 | mmc_hostname(host), err); |
| 713 | |
Pierre Ossman | adf66a0 | 2007-07-22 23:08:30 +0200 | [diff] [blame] | 714 | return err; |
Pierre Ossman | 7ea239d | 2006-12-31 00:11:32 +0100 | [diff] [blame] | 715 | } |
| 716 | |