Home | History | Annotate | Download | only in hw

Lines Matching full:capacity

233             uint64_t capacity;
238 capacity = sector_count * 512;
239 if (capacity > 2147483648U) {
243 // CSD bits borrowed from a real SDHC card, with capacity bits zeroed out
249 // stuff in the real capacity
251 m = (uint32_t)(capacity / (512*1024)) - 1;
254 fprintf(stderr, "SD card too big (%lld bytes). Maximum SDHC card size is 128 gigabytes.\n", (long long)capacity);
266 // CSD bits borrowed from a real SD card, with capacity bits zeroed out
272 // stuff in the real capacity
275 // csd->capacity = (1 + m) << (e + 2);
278 capacity = sector_count * 512;
279 if (capacity > 2147483648U) {
280 fprintf(stderr, "SD card too big (%lld bytes). Maximum SD card size is 2 gigabytes.\n", (long long)capacity);
283 capacity >>= 10; // convert to Kbytes
284 while (capacity > 4096) {
285 // (capacity - 1) must fit into 12 bits
287 capacity >>= 1;
289 capacity -= 1;
298 s->resp[2] |= (((uint32_t)capacity >> 2) & 0x3FF); // high 10 bits to bottom of resp[2]
299 s->resp[1] |= (((uint32_t)capacity & 3) << 30); // low 2 bits to top of resp[1]