Lines Matching refs:ext_csd
122 if (card->ext_csd.erase_group_def & 1) in mmc_set_erase_size()
123 card->erase_size = card->ext_csd.hc_erase_size; in mmc_set_erase_size()
188 u8 card_type = card->ext_csd.raw_card_type; in mmc_select_card_type()
242 card->ext_csd.strobe_support && in mmc_select_card_type()
246 card->ext_csd.hs_max_dtr = hs_max_dtr; in mmc_select_card_type()
247 card->ext_csd.hs200_max_dtr = hs200_max_dtr; in mmc_select_card_type()
251 static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd) in mmc_manage_enhanced_area() argument
258 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_manage_enhanced_area()
259 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_manage_enhanced_area()
266 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && in mmc_manage_enhanced_area()
267 (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { in mmc_manage_enhanced_area()
268 if (card->ext_csd.partition_setting_completed) { in mmc_manage_enhanced_area()
270 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_enhanced_area()
272 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_enhanced_area()
277 card->ext_csd.enhanced_area_offset = in mmc_manage_enhanced_area()
278 (((unsigned long long)ext_csd[139]) << 24) + in mmc_manage_enhanced_area()
279 (((unsigned long long)ext_csd[138]) << 16) + in mmc_manage_enhanced_area()
280 (((unsigned long long)ext_csd[137]) << 8) + in mmc_manage_enhanced_area()
281 (((unsigned long long)ext_csd[136])); in mmc_manage_enhanced_area()
283 card->ext_csd.enhanced_area_offset <<= 9; in mmc_manage_enhanced_area()
287 card->ext_csd.enhanced_area_size = in mmc_manage_enhanced_area()
288 (ext_csd[142] << 16) + (ext_csd[141] << 8) + in mmc_manage_enhanced_area()
289 ext_csd[140]; in mmc_manage_enhanced_area()
290 card->ext_csd.enhanced_area_size *= in mmc_manage_enhanced_area()
292 card->ext_csd.enhanced_area_size <<= 9; in mmc_manage_enhanced_area()
312 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd) in mmc_manage_gp_partitions() argument
323 if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & in mmc_manage_gp_partitions()
326 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_gp_partitions()
328 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_gp_partitions()
331 if (!ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3] && in mmc_manage_gp_partitions()
332 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] && in mmc_manage_gp_partitions()
333 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2]) in mmc_manage_gp_partitions()
335 if (card->ext_csd.partition_setting_completed == 0) { in mmc_manage_gp_partitions()
341 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2] in mmc_manage_gp_partitions()
343 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] in mmc_manage_gp_partitions()
345 ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3]; in mmc_manage_gp_partitions()
361 static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) in mmc_decode_ext_csd() argument
369 card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; in mmc_decode_ext_csd()
371 if (card->ext_csd.raw_ext_csd_structure > 2) { in mmc_decode_ext_csd()
374 card->ext_csd.raw_ext_csd_structure); in mmc_decode_ext_csd()
390 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; in mmc_decode_ext_csd()
395 card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; in mmc_decode_ext_csd()
396 card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; in mmc_decode_ext_csd()
397 card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; in mmc_decode_ext_csd()
398 card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; in mmc_decode_ext_csd()
399 if (card->ext_csd.rev >= 2) { in mmc_decode_ext_csd()
400 card->ext_csd.sectors = in mmc_decode_ext_csd()
401 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | in mmc_decode_ext_csd()
402 ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | in mmc_decode_ext_csd()
403 ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | in mmc_decode_ext_csd()
404 ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_decode_ext_csd()
407 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) in mmc_decode_ext_csd()
411 card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT]; in mmc_decode_ext_csd()
412 card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_decode_ext_csd()
415 card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
416 card->ext_csd.raw_erase_timeout_mult = in mmc_decode_ext_csd()
417 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
418 card->ext_csd.raw_hc_erase_grp_size = in mmc_decode_ext_csd()
419 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_decode_ext_csd()
420 if (card->ext_csd.rev >= 3) { in mmc_decode_ext_csd()
421 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
422 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; in mmc_decode_ext_csd()
425 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_decode_ext_csd()
427 if (card->ext_csd.part_time && in mmc_decode_ext_csd()
428 card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) in mmc_decode_ext_csd()
429 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; in mmc_decode_ext_csd()
433 card->ext_csd.sa_timeout = in mmc_decode_ext_csd()
434 1 << ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
435 card->ext_csd.erase_group_def = in mmc_decode_ext_csd()
436 ext_csd[EXT_CSD_ERASE_GROUP_DEF]; in mmc_decode_ext_csd()
437 card->ext_csd.hc_erase_timeout = 300 * in mmc_decode_ext_csd()
438 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
439 card->ext_csd.hc_erase_size = in mmc_decode_ext_csd()
440 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10; in mmc_decode_ext_csd()
442 card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C]; in mmc_decode_ext_csd()
448 if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) { in mmc_decode_ext_csd()
450 part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_decode_ext_csd()
459 card->ext_csd.raw_hc_erase_gap_size = in mmc_decode_ext_csd()
460 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_decode_ext_csd()
461 card->ext_csd.raw_sec_trim_mult = in mmc_decode_ext_csd()
462 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
463 card->ext_csd.raw_sec_erase_mult = in mmc_decode_ext_csd()
464 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
465 card->ext_csd.raw_sec_feature_support = in mmc_decode_ext_csd()
466 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
467 card->ext_csd.raw_trim_mult = in mmc_decode_ext_csd()
468 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
469 card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT]; in mmc_decode_ext_csd()
470 card->ext_csd.raw_driver_strength = ext_csd[EXT_CSD_DRIVER_STRENGTH]; in mmc_decode_ext_csd()
471 if (card->ext_csd.rev >= 4) { in mmc_decode_ext_csd()
472 if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED] & in mmc_decode_ext_csd()
474 card->ext_csd.partition_setting_completed = 1; in mmc_decode_ext_csd()
476 card->ext_csd.partition_setting_completed = 0; in mmc_decode_ext_csd()
478 mmc_manage_enhanced_area(card, ext_csd); in mmc_decode_ext_csd()
480 mmc_manage_gp_partitions(card, ext_csd); in mmc_decode_ext_csd()
482 card->ext_csd.sec_trim_mult = in mmc_decode_ext_csd()
483 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
484 card->ext_csd.sec_erase_mult = in mmc_decode_ext_csd()
485 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
486 card->ext_csd.sec_feature_support = in mmc_decode_ext_csd()
487 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
488 card->ext_csd.trim_timeout = 300 * in mmc_decode_ext_csd()
489 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
496 card->ext_csd.boot_ro_lock = ext_csd[EXT_CSD_BOOT_WP]; in mmc_decode_ext_csd()
497 card->ext_csd.boot_ro_lockable = true; in mmc_decode_ext_csd()
500 card->ext_csd.raw_pwr_cl_52_195 = in mmc_decode_ext_csd()
501 ext_csd[EXT_CSD_PWR_CL_52_195]; in mmc_decode_ext_csd()
502 card->ext_csd.raw_pwr_cl_26_195 = in mmc_decode_ext_csd()
503 ext_csd[EXT_CSD_PWR_CL_26_195]; in mmc_decode_ext_csd()
504 card->ext_csd.raw_pwr_cl_52_360 = in mmc_decode_ext_csd()
505 ext_csd[EXT_CSD_PWR_CL_52_360]; in mmc_decode_ext_csd()
506 card->ext_csd.raw_pwr_cl_26_360 = in mmc_decode_ext_csd()
507 ext_csd[EXT_CSD_PWR_CL_26_360]; in mmc_decode_ext_csd()
508 card->ext_csd.raw_pwr_cl_200_195 = in mmc_decode_ext_csd()
509 ext_csd[EXT_CSD_PWR_CL_200_195]; in mmc_decode_ext_csd()
510 card->ext_csd.raw_pwr_cl_200_360 = in mmc_decode_ext_csd()
511 ext_csd[EXT_CSD_PWR_CL_200_360]; in mmc_decode_ext_csd()
512 card->ext_csd.raw_pwr_cl_ddr_52_195 = in mmc_decode_ext_csd()
513 ext_csd[EXT_CSD_PWR_CL_DDR_52_195]; in mmc_decode_ext_csd()
514 card->ext_csd.raw_pwr_cl_ddr_52_360 = in mmc_decode_ext_csd()
515 ext_csd[EXT_CSD_PWR_CL_DDR_52_360]; in mmc_decode_ext_csd()
516 card->ext_csd.raw_pwr_cl_ddr_200_360 = in mmc_decode_ext_csd()
517 ext_csd[EXT_CSD_PWR_CL_DDR_200_360]; in mmc_decode_ext_csd()
520 if (card->ext_csd.rev >= 5) { in mmc_decode_ext_csd()
526 if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { in mmc_decode_ext_csd()
527 card->ext_csd.bkops = 1; in mmc_decode_ext_csd()
528 card->ext_csd.man_bkops_en = in mmc_decode_ext_csd()
529 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
531 card->ext_csd.raw_bkops_status = in mmc_decode_ext_csd()
532 ext_csd[EXT_CSD_BKOPS_STATUS]; in mmc_decode_ext_csd()
533 if (card->ext_csd.man_bkops_en) in mmc_decode_ext_csd()
536 card->ext_csd.auto_bkops_en = in mmc_decode_ext_csd()
537 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
539 if (card->ext_csd.auto_bkops_en) in mmc_decode_ext_csd()
546 !broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) { in mmc_decode_ext_csd()
547 card->ext_csd.hpi = 1; in mmc_decode_ext_csd()
548 if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2) in mmc_decode_ext_csd()
549 card->ext_csd.hpi_cmd = MMC_STOP_TRANSMISSION; in mmc_decode_ext_csd()
551 card->ext_csd.hpi_cmd = MMC_SEND_STATUS; in mmc_decode_ext_csd()
556 card->ext_csd.out_of_int_time = in mmc_decode_ext_csd()
557 ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10; in mmc_decode_ext_csd()
560 card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; in mmc_decode_ext_csd()
561 card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; in mmc_decode_ext_csd()
566 card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; in mmc_decode_ext_csd()
567 if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) { in mmc_decode_ext_csd()
568 mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, in mmc_decode_ext_csd()
575 card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; in mmc_decode_ext_csd()
576 if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) in mmc_decode_ext_csd()
582 card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; in mmc_decode_ext_csd()
583 if (card->ext_csd.rev >= 6) { in mmc_decode_ext_csd()
584 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; in mmc_decode_ext_csd()
586 card->ext_csd.generic_cmd6_time = 10 * in mmc_decode_ext_csd()
587 ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_decode_ext_csd()
588 card->ext_csd.power_off_longtime = 10 * in mmc_decode_ext_csd()
589 ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; in mmc_decode_ext_csd()
591 card->ext_csd.cache_size = in mmc_decode_ext_csd()
592 ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | in mmc_decode_ext_csd()
593 ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | in mmc_decode_ext_csd()
594 ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | in mmc_decode_ext_csd()
595 ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; in mmc_decode_ext_csd()
597 if (ext_csd[EXT_CSD_DATA_SECTOR_SIZE] == 1) in mmc_decode_ext_csd()
598 card->ext_csd.data_sector_size = 4096; in mmc_decode_ext_csd()
600 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
602 if ((ext_csd[EXT_CSD_DATA_TAG_SUPPORT] & 1) && in mmc_decode_ext_csd()
603 (ext_csd[EXT_CSD_TAG_UNIT_SIZE] <= 8)) { in mmc_decode_ext_csd()
604 card->ext_csd.data_tag_unit_size = in mmc_decode_ext_csd()
605 ((unsigned int) 1 << ext_csd[EXT_CSD_TAG_UNIT_SIZE]) * in mmc_decode_ext_csd()
606 (card->ext_csd.data_sector_size); in mmc_decode_ext_csd()
608 card->ext_csd.data_tag_unit_size = 0; in mmc_decode_ext_csd()
611 card->ext_csd.max_packed_writes = in mmc_decode_ext_csd()
612 ext_csd[EXT_CSD_MAX_PACKED_WRITES]; in mmc_decode_ext_csd()
613 card->ext_csd.max_packed_reads = in mmc_decode_ext_csd()
614 ext_csd[EXT_CSD_MAX_PACKED_READS]; in mmc_decode_ext_csd()
616 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
620 if (card->ext_csd.rev >= 7) { in mmc_decode_ext_csd()
621 memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], in mmc_decode_ext_csd()
623 card->ext_csd.ffu_capable = in mmc_decode_ext_csd()
624 (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && in mmc_decode_ext_csd()
625 !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); in mmc_decode_ext_csd()
627 card->ext_csd.pre_eol_info = ext_csd[EXT_CSD_PRE_EOL_INFO]; in mmc_decode_ext_csd()
628 card->ext_csd.device_life_time_est_typ_a = in mmc_decode_ext_csd()
629 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]; in mmc_decode_ext_csd()
630 card->ext_csd.device_life_time_est_typ_b = in mmc_decode_ext_csd()
631 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]; in mmc_decode_ext_csd()
635 if (card->ext_csd.rev >= 8) { in mmc_decode_ext_csd()
636 card->ext_csd.cmdq_support = ext_csd[EXT_CSD_CMDQ_SUPPORT] & in mmc_decode_ext_csd()
638 card->ext_csd.cmdq_depth = (ext_csd[EXT_CSD_CMDQ_DEPTH] & in mmc_decode_ext_csd()
641 if (card->ext_csd.cmdq_depth <= 2) { in mmc_decode_ext_csd()
642 card->ext_csd.cmdq_support = false; in mmc_decode_ext_csd()
643 card->ext_csd.cmdq_depth = 0; in mmc_decode_ext_csd()
645 if (card->ext_csd.cmdq_support) { in mmc_decode_ext_csd()
648 card->ext_csd.cmdq_depth); in mmc_decode_ext_csd()
650 card->ext_csd.enhanced_rpmb_supported = in mmc_decode_ext_csd()
651 (card->ext_csd.rel_param & in mmc_decode_ext_csd()
660 u8 *ext_csd; in mmc_read_ext_csd() local
666 err = mmc_get_ext_csd(card, &ext_csd); in mmc_read_ext_csd()
691 err = mmc_decode_ext_csd(card, ext_csd); in mmc_read_ext_csd()
692 kfree(ext_csd); in mmc_read_ext_csd()
709 err = !((card->ext_csd.raw_partition_support == in mmc_compare_ext_csds()
711 (card->ext_csd.raw_erased_mem_count == in mmc_compare_ext_csds()
713 (card->ext_csd.rev == in mmc_compare_ext_csds()
715 (card->ext_csd.raw_ext_csd_structure == in mmc_compare_ext_csds()
717 (card->ext_csd.raw_card_type == in mmc_compare_ext_csds()
719 (card->ext_csd.raw_s_a_timeout == in mmc_compare_ext_csds()
721 (card->ext_csd.raw_hc_erase_gap_size == in mmc_compare_ext_csds()
723 (card->ext_csd.raw_erase_timeout_mult == in mmc_compare_ext_csds()
725 (card->ext_csd.raw_hc_erase_grp_size == in mmc_compare_ext_csds()
727 (card->ext_csd.raw_sec_trim_mult == in mmc_compare_ext_csds()
729 (card->ext_csd.raw_sec_erase_mult == in mmc_compare_ext_csds()
731 (card->ext_csd.raw_sec_feature_support == in mmc_compare_ext_csds()
733 (card->ext_csd.raw_trim_mult == in mmc_compare_ext_csds()
735 (card->ext_csd.raw_sectors[0] == in mmc_compare_ext_csds()
737 (card->ext_csd.raw_sectors[1] == in mmc_compare_ext_csds()
739 (card->ext_csd.raw_sectors[2] == in mmc_compare_ext_csds()
741 (card->ext_csd.raw_sectors[3] == in mmc_compare_ext_csds()
743 (card->ext_csd.raw_pwr_cl_52_195 == in mmc_compare_ext_csds()
745 (card->ext_csd.raw_pwr_cl_26_195 == in mmc_compare_ext_csds()
747 (card->ext_csd.raw_pwr_cl_52_360 == in mmc_compare_ext_csds()
749 (card->ext_csd.raw_pwr_cl_26_360 == in mmc_compare_ext_csds()
751 (card->ext_csd.raw_pwr_cl_200_195 == in mmc_compare_ext_csds()
753 (card->ext_csd.raw_pwr_cl_200_360 == in mmc_compare_ext_csds()
755 (card->ext_csd.raw_pwr_cl_ddr_52_195 == in mmc_compare_ext_csds()
757 (card->ext_csd.raw_pwr_cl_ddr_52_360 == in mmc_compare_ext_csds()
759 (card->ext_csd.raw_pwr_cl_ddr_200_360 == in mmc_compare_ext_csds()
776 MMC_DEV_ATTR(ffu_capable, "%d\n", card->ext_csd.ffu_capable);
782 MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
783 MMC_DEV_ATTR(pre_eol_info, "0x%02x\n", card->ext_csd.pre_eol_info);
785 card->ext_csd.device_life_time_est_typ_a,
786 card->ext_csd.device_life_time_est_typ_b);
789 card->ext_csd.enhanced_area_offset);
790 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
791 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
793 card->ext_csd.enhanced_rpmb_supported);
794 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
797 MMC_DEV_ATTR(cmdq_en, "%d\n", card->ext_csd.cmdq_en);
805 if (card->ext_csd.rev < 7) { in mmc_fwrev_show()
809 card->ext_csd.fwrev); in mmc_fwrev_show()
875 struct mmc_ext_csd *ext_csd = &card->ext_csd; in __mmc_select_powerclass() local
882 pwrclass_val = ext_csd->raw_pwr_cl_26_195; in __mmc_select_powerclass()
885 ext_csd->raw_pwr_cl_52_195 : in __mmc_select_powerclass()
886 ext_csd->raw_pwr_cl_ddr_52_195; in __mmc_select_powerclass()
888 pwrclass_val = ext_csd->raw_pwr_cl_200_195; in __mmc_select_powerclass()
900 pwrclass_val = ext_csd->raw_pwr_cl_26_360; in __mmc_select_powerclass()
903 ext_csd->raw_pwr_cl_52_360 : in __mmc_select_powerclass()
904 ext_csd->raw_pwr_cl_ddr_52_360; in __mmc_select_powerclass()
907 ext_csd->raw_pwr_cl_ddr_200_360 : in __mmc_select_powerclass()
908 ext_csd->raw_pwr_cl_200_360; in __mmc_select_powerclass()
928 card->ext_csd.generic_cmd6_time); in __mmc_select_powerclass()
973 max_dtr > card->ext_csd.hs200_max_dtr) in mmc_set_bus_speed()
974 max_dtr = card->ext_csd.hs200_max_dtr; in mmc_set_bus_speed()
975 else if (mmc_card_hs(card) && max_dtr > card->ext_csd.hs_max_dtr) in mmc_set_bus_speed()
976 max_dtr = card->ext_csd.hs_max_dtr; in mmc_set_bus_speed()
1025 card->ext_csd.generic_cmd6_time); in mmc_select_bus_width()
1063 card->ext_csd.generic_cmd6_time, MMC_TIMING_MMC_HS, in mmc_select_hs()
1094 card->ext_csd.generic_cmd6_time, in mmc_select_hs_ddr()
1163 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1179 max_dtr = card->ext_csd.hs_max_dtr; in mmc_select_hs400()
1193 card->ext_csd.generic_cmd6_time); in mmc_select_hs400()
1205 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1245 max_dtr = card->ext_csd.hs_max_dtr; in mmc_hs400_to_hs200()
1251 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1267 EXT_CSD_BUS_WIDTH_8, card->ext_csd.generic_cmd6_time, in mmc_hs400_to_hs200()
1282 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1317 card_drv_type = card->ext_csd.raw_driver_strength | in mmc_select_driver_type()
1325 card->ext_csd.hs200_max_dtr, in mmc_select_driver_type()
1366 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1379 mmc_set_clock(host, card->ext_csd.hs_max_dtr); in mmc_select_hs400es()
1386 card->ext_csd.generic_cmd6_time); in mmc_select_hs400es()
1400 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1465 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs200()
1691 if (card->ext_csd.rev >= 3) { in mmc_init_card()
1694 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1706 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_init_card()
1707 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_init_card()
1709 card->ext_csd.erase_group_def = 1; in mmc_init_card()
1722 if (card->ext_csd.part_config & EXT_CSD_PART_CONFIG_ACC_MASK) { in mmc_init_card()
1723 card->ext_csd.part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; in mmc_init_card()
1725 card->ext_csd.part_config, in mmc_init_card()
1726 card->ext_csd.part_time); in mmc_init_card()
1734 if (card->ext_csd.rev >= 6) { in mmc_init_card()
1738 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1747 card->ext_csd.power_off_notification = EXT_CSD_POWER_ON; in mmc_init_card()
1795 if (card->ext_csd.hpi) { in mmc_init_card()
1798 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1804 card->ext_csd.hpi_en = 0; in mmc_init_card()
1807 card->ext_csd.hpi_en = 1; in mmc_init_card()
1818 if (card->ext_csd.cache_size > 0) { in mmc_init_card()
1821 timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); in mmc_init_card()
1833 card->ext_csd.cache_ctrl = 0; in mmc_init_card()
1836 card->ext_csd.cache_ctrl = 1; in mmc_init_card()
1844 card->ext_csd.cmdq_en = false; in mmc_init_card()
1845 if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { in mmc_init_card()
1852 card->ext_csd.cmdq_support = false; in mmc_init_card()
1853 card->ext_csd.cmdq_depth = 0; in mmc_init_card()
1862 card->reenable_cmdq = card->ext_csd.cmdq_en; in mmc_init_card()
1869 if (card->ext_csd.cmdq_en) { in mmc_init_card()
1902 return (card && card->ext_csd.rev >= 3); in mmc_can_sleep()
1909 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); in mmc_sleep()
1961 (card->ext_csd.power_off_notification == EXT_CSD_POWER_ON); in mmc_can_poweroff_notify()
1966 unsigned int timeout = card->ext_csd.generic_cmd6_time; in mmc_poweroff_notify()
1971 timeout = card->ext_csd.power_off_longtime; in mmc_poweroff_notify()
1981 card->ext_csd.power_off_notification = EXT_CSD_NO_POWER_NOTIFICATION; in mmc_poweroff_notify()
2167 rst_n_function = card->ext_csd.rst_n_function; in mmc_can_reset()