Lines Matching refs:ext_csd

128 	if (card->ext_csd.erase_group_def & 1)  in mmc_set_erase_size()
129 card->erase_size = card->ext_csd.hc_erase_size; in mmc_set_erase_size()
139 if (card->ext_csd.erase_group_def & 1) in mmc_set_wp_grp_size()
140 card->wp_grp_size = card->ext_csd.hc_erase_size * in mmc_set_wp_grp_size()
141 card->ext_csd.raw_hc_erase_gap_size; in mmc_set_wp_grp_size()
206 u8 card_type = card->ext_csd.raw_card_type; in mmc_select_card_type()
260 card->ext_csd.strobe_support && in mmc_select_card_type()
264 card->ext_csd.hs_max_dtr = hs_max_dtr; in mmc_select_card_type()
265 card->ext_csd.hs200_max_dtr = hs200_max_dtr; in mmc_select_card_type()
269 static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd) in mmc_manage_enhanced_area() argument
276 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_manage_enhanced_area()
277 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_manage_enhanced_area()
284 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && in mmc_manage_enhanced_area()
285 (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { in mmc_manage_enhanced_area()
286 if (card->ext_csd.partition_setting_completed) { in mmc_manage_enhanced_area()
288 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_enhanced_area()
290 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_enhanced_area()
295 card->ext_csd.enhanced_area_offset = in mmc_manage_enhanced_area()
296 (((unsigned long long)ext_csd[139]) << 24) + in mmc_manage_enhanced_area()
297 (((unsigned long long)ext_csd[138]) << 16) + in mmc_manage_enhanced_area()
298 (((unsigned long long)ext_csd[137]) << 8) + in mmc_manage_enhanced_area()
299 (((unsigned long long)ext_csd[136])); in mmc_manage_enhanced_area()
301 card->ext_csd.enhanced_area_offset <<= 9; in mmc_manage_enhanced_area()
305 card->ext_csd.enhanced_area_size = in mmc_manage_enhanced_area()
306 (ext_csd[142] << 16) + (ext_csd[141] << 8) + in mmc_manage_enhanced_area()
307 ext_csd[140]; in mmc_manage_enhanced_area()
308 card->ext_csd.enhanced_area_size *= in mmc_manage_enhanced_area()
310 card->ext_csd.enhanced_area_size <<= 9; in mmc_manage_enhanced_area()
330 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd) in mmc_manage_gp_partitions() argument
341 if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & in mmc_manage_gp_partitions()
344 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_gp_partitions()
346 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_gp_partitions()
349 if (!ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3] && in mmc_manage_gp_partitions()
350 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] && in mmc_manage_gp_partitions()
351 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2]) in mmc_manage_gp_partitions()
353 if (card->ext_csd.partition_setting_completed == 0) { in mmc_manage_gp_partitions()
359 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2] in mmc_manage_gp_partitions()
361 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] in mmc_manage_gp_partitions()
363 ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3]; in mmc_manage_gp_partitions()
379 static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) in mmc_decode_ext_csd() argument
387 card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; in mmc_decode_ext_csd()
389 if (card->ext_csd.raw_ext_csd_structure > 2) { in mmc_decode_ext_csd()
392 card->ext_csd.raw_ext_csd_structure); in mmc_decode_ext_csd()
408 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; in mmc_decode_ext_csd()
413 card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; in mmc_decode_ext_csd()
414 card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; in mmc_decode_ext_csd()
415 card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; in mmc_decode_ext_csd()
416 card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; in mmc_decode_ext_csd()
417 if (card->ext_csd.rev >= 2) { in mmc_decode_ext_csd()
418 card->ext_csd.sectors = in mmc_decode_ext_csd()
419 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | in mmc_decode_ext_csd()
420 ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | in mmc_decode_ext_csd()
421 ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | in mmc_decode_ext_csd()
422 ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_decode_ext_csd()
425 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) in mmc_decode_ext_csd()
429 card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT]; in mmc_decode_ext_csd()
430 card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_decode_ext_csd()
432 card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
433 card->ext_csd.raw_erase_timeout_mult = in mmc_decode_ext_csd()
434 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
435 card->ext_csd.raw_hc_erase_grp_size = in mmc_decode_ext_csd()
436 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_decode_ext_csd()
437 card->ext_csd.raw_boot_mult = in mmc_decode_ext_csd()
438 ext_csd[EXT_CSD_BOOT_MULT]; in mmc_decode_ext_csd()
439 if (card->ext_csd.rev >= 3) { in mmc_decode_ext_csd()
440 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
441 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; in mmc_decode_ext_csd()
444 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_decode_ext_csd()
448 card->ext_csd.sa_timeout = in mmc_decode_ext_csd()
449 1 << ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
450 card->ext_csd.erase_group_def = in mmc_decode_ext_csd()
451 ext_csd[EXT_CSD_ERASE_GROUP_DEF]; in mmc_decode_ext_csd()
452 card->ext_csd.hc_erase_timeout = 300 * in mmc_decode_ext_csd()
453 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
454 card->ext_csd.hc_erase_size = in mmc_decode_ext_csd()
455 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10; in mmc_decode_ext_csd()
457 card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C]; in mmc_decode_ext_csd()
463 if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_host_can_access_boot(card->host)) { in mmc_decode_ext_csd()
465 part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_decode_ext_csd()
474 card->ext_csd.raw_hc_erase_gap_size = in mmc_decode_ext_csd()
475 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_decode_ext_csd()
476 card->ext_csd.raw_sec_trim_mult = in mmc_decode_ext_csd()
477 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
478 card->ext_csd.raw_sec_erase_mult = in mmc_decode_ext_csd()
479 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
480 card->ext_csd.raw_sec_feature_support = in mmc_decode_ext_csd()
481 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
482 card->ext_csd.raw_trim_mult = in mmc_decode_ext_csd()
483 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
484 card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT]; in mmc_decode_ext_csd()
485 card->ext_csd.raw_driver_strength = ext_csd[EXT_CSD_DRIVER_STRENGTH]; in mmc_decode_ext_csd()
486 if (card->ext_csd.rev >= 4) { in mmc_decode_ext_csd()
487 if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED] & in mmc_decode_ext_csd()
489 card->ext_csd.partition_setting_completed = 1; in mmc_decode_ext_csd()
491 card->ext_csd.partition_setting_completed = 0; in mmc_decode_ext_csd()
493 mmc_manage_enhanced_area(card, ext_csd); in mmc_decode_ext_csd()
495 mmc_manage_gp_partitions(card, ext_csd); in mmc_decode_ext_csd()
497 card->ext_csd.sec_trim_mult = in mmc_decode_ext_csd()
498 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
499 card->ext_csd.sec_erase_mult = in mmc_decode_ext_csd()
500 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
501 card->ext_csd.sec_feature_support = in mmc_decode_ext_csd()
502 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
503 card->ext_csd.trim_timeout = 300 * in mmc_decode_ext_csd()
504 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
511 card->ext_csd.boot_ro_lock = ext_csd[EXT_CSD_BOOT_WP]; in mmc_decode_ext_csd()
512 card->ext_csd.boot_ro_lockable = true; in mmc_decode_ext_csd()
515 card->ext_csd.raw_pwr_cl_52_195 = in mmc_decode_ext_csd()
516 ext_csd[EXT_CSD_PWR_CL_52_195]; in mmc_decode_ext_csd()
517 card->ext_csd.raw_pwr_cl_26_195 = in mmc_decode_ext_csd()
518 ext_csd[EXT_CSD_PWR_CL_26_195]; in mmc_decode_ext_csd()
519 card->ext_csd.raw_pwr_cl_52_360 = in mmc_decode_ext_csd()
520 ext_csd[EXT_CSD_PWR_CL_52_360]; in mmc_decode_ext_csd()
521 card->ext_csd.raw_pwr_cl_26_360 = in mmc_decode_ext_csd()
522 ext_csd[EXT_CSD_PWR_CL_26_360]; in mmc_decode_ext_csd()
523 card->ext_csd.raw_pwr_cl_200_195 = in mmc_decode_ext_csd()
524 ext_csd[EXT_CSD_PWR_CL_200_195]; in mmc_decode_ext_csd()
525 card->ext_csd.raw_pwr_cl_200_360 = in mmc_decode_ext_csd()
526 ext_csd[EXT_CSD_PWR_CL_200_360]; in mmc_decode_ext_csd()
527 card->ext_csd.raw_pwr_cl_ddr_52_195 = in mmc_decode_ext_csd()
528 ext_csd[EXT_CSD_PWR_CL_DDR_52_195]; in mmc_decode_ext_csd()
529 card->ext_csd.raw_pwr_cl_ddr_52_360 = in mmc_decode_ext_csd()
530 ext_csd[EXT_CSD_PWR_CL_DDR_52_360]; in mmc_decode_ext_csd()
531 card->ext_csd.raw_pwr_cl_ddr_200_360 = in mmc_decode_ext_csd()
532 ext_csd[EXT_CSD_PWR_CL_DDR_200_360]; in mmc_decode_ext_csd()
535 if (card->ext_csd.rev >= 5) { in mmc_decode_ext_csd()
541 if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { in mmc_decode_ext_csd()
542 card->ext_csd.bkops = 1; in mmc_decode_ext_csd()
543 card->ext_csd.man_bkops_en = in mmc_decode_ext_csd()
544 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
546 card->ext_csd.raw_bkops_status = in mmc_decode_ext_csd()
547 ext_csd[EXT_CSD_BKOPS_STATUS]; in mmc_decode_ext_csd()
548 if (card->ext_csd.man_bkops_en) in mmc_decode_ext_csd()
551 card->ext_csd.auto_bkops_en = in mmc_decode_ext_csd()
552 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
554 if (card->ext_csd.auto_bkops_en) in mmc_decode_ext_csd()
561 !broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) { in mmc_decode_ext_csd()
562 card->ext_csd.hpi = 1; in mmc_decode_ext_csd()
563 if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2) in mmc_decode_ext_csd()
564 card->ext_csd.hpi_cmd = MMC_STOP_TRANSMISSION; in mmc_decode_ext_csd()
566 card->ext_csd.hpi_cmd = MMC_SEND_STATUS; in mmc_decode_ext_csd()
571 card->ext_csd.out_of_int_time = in mmc_decode_ext_csd()
572 ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10; in mmc_decode_ext_csd()
575 card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; in mmc_decode_ext_csd()
576 card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; in mmc_decode_ext_csd()
581 card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; in mmc_decode_ext_csd()
582 if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_can_cmd23(card->host)) { in mmc_decode_ext_csd()
583 mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, in mmc_decode_ext_csd()
590 card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; in mmc_decode_ext_csd()
591 if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) in mmc_decode_ext_csd()
597 card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; in mmc_decode_ext_csd()
598 if (card->ext_csd.rev >= 6) { in mmc_decode_ext_csd()
599 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; in mmc_decode_ext_csd()
601 card->ext_csd.generic_cmd6_time = 10 * in mmc_decode_ext_csd()
602 ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_decode_ext_csd()
603 card->ext_csd.power_off_longtime = 10 * in mmc_decode_ext_csd()
604 ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; in mmc_decode_ext_csd()
606 card->ext_csd.cache_size = in mmc_decode_ext_csd()
607 ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | in mmc_decode_ext_csd()
608 ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | in mmc_decode_ext_csd()
609 ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | in mmc_decode_ext_csd()
610 ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; in mmc_decode_ext_csd()
612 if (ext_csd[EXT_CSD_DATA_SECTOR_SIZE] == 1) in mmc_decode_ext_csd()
613 card->ext_csd.data_sector_size = 4096; in mmc_decode_ext_csd()
615 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
617 if ((ext_csd[EXT_CSD_DATA_TAG_SUPPORT] & 1) && in mmc_decode_ext_csd()
618 (ext_csd[EXT_CSD_TAG_UNIT_SIZE] <= 8)) { in mmc_decode_ext_csd()
619 card->ext_csd.data_tag_unit_size = in mmc_decode_ext_csd()
620 ((unsigned int) 1 << ext_csd[EXT_CSD_TAG_UNIT_SIZE]) * in mmc_decode_ext_csd()
621 (card->ext_csd.data_sector_size); in mmc_decode_ext_csd()
623 card->ext_csd.data_tag_unit_size = 0; in mmc_decode_ext_csd()
626 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
634 if (!card->ext_csd.part_time) in mmc_decode_ext_csd()
635 card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; in mmc_decode_ext_csd()
637 if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) in mmc_decode_ext_csd()
638 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; in mmc_decode_ext_csd()
641 if (card->ext_csd.rev >= 7) { in mmc_decode_ext_csd()
642 memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], in mmc_decode_ext_csd()
644 card->ext_csd.ffu_capable = in mmc_decode_ext_csd()
645 (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && in mmc_decode_ext_csd()
646 !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); in mmc_decode_ext_csd()
648 card->ext_csd.pre_eol_info = ext_csd[EXT_CSD_PRE_EOL_INFO]; in mmc_decode_ext_csd()
649 card->ext_csd.device_life_time_est_typ_a = in mmc_decode_ext_csd()
650 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]; in mmc_decode_ext_csd()
651 card->ext_csd.device_life_time_est_typ_b = in mmc_decode_ext_csd()
652 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]; in mmc_decode_ext_csd()
656 if (card->ext_csd.rev >= 8) { in mmc_decode_ext_csd()
657 card->ext_csd.cmdq_support = ext_csd[EXT_CSD_CMDQ_SUPPORT] & in mmc_decode_ext_csd()
659 card->ext_csd.cmdq_depth = (ext_csd[EXT_CSD_CMDQ_DEPTH] & in mmc_decode_ext_csd()
662 if (card->ext_csd.cmdq_depth <= 2) { in mmc_decode_ext_csd()
663 card->ext_csd.cmdq_support = false; in mmc_decode_ext_csd()
664 card->ext_csd.cmdq_depth = 0; in mmc_decode_ext_csd()
666 if (card->ext_csd.cmdq_support) { in mmc_decode_ext_csd()
669 card->ext_csd.cmdq_depth); in mmc_decode_ext_csd()
671 card->ext_csd.enhanced_rpmb_supported = in mmc_decode_ext_csd()
672 (card->ext_csd.rel_param & in mmc_decode_ext_csd()
675 if (card->ext_csd.rev >= 9) { in mmc_decode_ext_csd()
693 u8 *ext_csd; in mmc_read_ext_csd() local
699 err = mmc_get_ext_csd(card, &ext_csd); in mmc_read_ext_csd()
724 err = mmc_decode_ext_csd(card, ext_csd); in mmc_read_ext_csd()
725 kfree(ext_csd); in mmc_read_ext_csd()
742 err = !((card->ext_csd.raw_partition_support == in mmc_compare_ext_csds()
744 (card->ext_csd.raw_erased_mem_count == in mmc_compare_ext_csds()
746 (card->ext_csd.rev == in mmc_compare_ext_csds()
748 (card->ext_csd.raw_ext_csd_structure == in mmc_compare_ext_csds()
750 (card->ext_csd.raw_card_type == in mmc_compare_ext_csds()
752 (card->ext_csd.raw_s_a_timeout == in mmc_compare_ext_csds()
754 (card->ext_csd.raw_hc_erase_gap_size == in mmc_compare_ext_csds()
756 (card->ext_csd.raw_erase_timeout_mult == in mmc_compare_ext_csds()
758 (card->ext_csd.raw_hc_erase_grp_size == in mmc_compare_ext_csds()
760 (card->ext_csd.raw_sec_trim_mult == in mmc_compare_ext_csds()
762 (card->ext_csd.raw_sec_erase_mult == in mmc_compare_ext_csds()
764 (card->ext_csd.raw_sec_feature_support == in mmc_compare_ext_csds()
766 (card->ext_csd.raw_trim_mult == in mmc_compare_ext_csds()
768 (card->ext_csd.raw_sectors[0] == in mmc_compare_ext_csds()
770 (card->ext_csd.raw_sectors[1] == in mmc_compare_ext_csds()
772 (card->ext_csd.raw_sectors[2] == in mmc_compare_ext_csds()
774 (card->ext_csd.raw_sectors[3] == in mmc_compare_ext_csds()
776 (card->ext_csd.raw_pwr_cl_52_195 == in mmc_compare_ext_csds()
778 (card->ext_csd.raw_pwr_cl_26_195 == in mmc_compare_ext_csds()
780 (card->ext_csd.raw_pwr_cl_52_360 == in mmc_compare_ext_csds()
782 (card->ext_csd.raw_pwr_cl_26_360 == in mmc_compare_ext_csds()
784 (card->ext_csd.raw_pwr_cl_200_195 == in mmc_compare_ext_csds()
786 (card->ext_csd.raw_pwr_cl_200_360 == in mmc_compare_ext_csds()
788 (card->ext_csd.raw_pwr_cl_ddr_52_195 == in mmc_compare_ext_csds()
790 (card->ext_csd.raw_pwr_cl_ddr_52_360 == in mmc_compare_ext_csds()
792 (card->ext_csd.raw_pwr_cl_ddr_200_360 == in mmc_compare_ext_csds()
810 MMC_DEV_ATTR(ffu_capable, "%d\n", card->ext_csd.ffu_capable);
816 MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
817 MMC_DEV_ATTR(pre_eol_info, "0x%02x\n", card->ext_csd.pre_eol_info);
819 card->ext_csd.device_life_time_est_typ_a,
820 card->ext_csd.device_life_time_est_typ_b);
823 card->ext_csd.enhanced_area_offset);
824 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
825 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
827 card->ext_csd.enhanced_rpmb_supported);
828 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
831 MMC_DEV_ATTR(cmdq_en, "%d\n", card->ext_csd.cmdq_en);
839 if (card->ext_csd.rev < 7) in mmc_fwrev_show()
843 card->ext_csd.fwrev); in mmc_fwrev_show()
909 struct mmc_ext_csd *ext_csd = &card->ext_csd; in __mmc_select_powerclass() local
916 pwrclass_val = ext_csd->raw_pwr_cl_26_195; in __mmc_select_powerclass()
919 ext_csd->raw_pwr_cl_52_195 : in __mmc_select_powerclass()
920 ext_csd->raw_pwr_cl_ddr_52_195; in __mmc_select_powerclass()
922 pwrclass_val = ext_csd->raw_pwr_cl_200_195; in __mmc_select_powerclass()
934 pwrclass_val = ext_csd->raw_pwr_cl_26_360; in __mmc_select_powerclass()
937 ext_csd->raw_pwr_cl_52_360 : in __mmc_select_powerclass()
938 ext_csd->raw_pwr_cl_ddr_52_360; in __mmc_select_powerclass()
941 ext_csd->raw_pwr_cl_ddr_200_360 : in __mmc_select_powerclass()
942 ext_csd->raw_pwr_cl_200_360; in __mmc_select_powerclass()
962 card->ext_csd.generic_cmd6_time); in __mmc_select_powerclass()
1007 max_dtr > card->ext_csd.hs200_max_dtr) in mmc_set_bus_speed()
1008 max_dtr = card->ext_csd.hs200_max_dtr; in mmc_set_bus_speed()
1009 else if (mmc_card_hs(card) && max_dtr > card->ext_csd.hs_max_dtr) in mmc_set_bus_speed()
1010 max_dtr = card->ext_csd.hs_max_dtr; in mmc_set_bus_speed()
1061 card->ext_csd.generic_cmd6_time); in mmc_select_bus_width()
1099 card->ext_csd.generic_cmd6_time, MMC_TIMING_MMC_HS, in mmc_select_hs()
1130 card->ext_csd.generic_cmd6_time, in mmc_select_hs_ddr()
1199 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1215 max_dtr = card->ext_csd.hs_max_dtr; in mmc_select_hs400()
1229 card->ext_csd.generic_cmd6_time); in mmc_select_hs400()
1241 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1289 max_dtr = card->ext_csd.hs_max_dtr; in mmc_hs400_to_hs200()
1295 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1311 EXT_CSD_BUS_WIDTH_8, card->ext_csd.generic_cmd6_time, in mmc_hs400_to_hs200()
1326 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1361 card_drv_type = card->ext_csd.raw_driver_strength | in mmc_select_driver_type()
1369 card->ext_csd.hs200_max_dtr, in mmc_select_driver_type()
1407 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1431 card->ext_csd.generic_cmd6_time); in mmc_select_hs400es()
1445 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1510 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs200()
1524 mmc_set_clock(card->host, card->ext_csd.hs_max_dtr); in mmc_select_hs200()
1763 if (card->ext_csd.rev >= 3) { in mmc_init_card()
1766 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1777 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_init_card()
1778 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_init_card()
1780 card->ext_csd.erase_group_def = 1; in mmc_init_card()
1793 if (card->ext_csd.part_config & EXT_CSD_PART_CONFIG_ACC_MASK) { in mmc_init_card()
1794 card->ext_csd.part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; in mmc_init_card()
1796 card->ext_csd.part_config, in mmc_init_card()
1797 card->ext_csd.part_time); in mmc_init_card()
1805 if (card->ext_csd.rev >= 6) { in mmc_init_card()
1809 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1818 card->ext_csd.power_off_notification = EXT_CSD_POWER_ON; in mmc_init_card()
1871 if (card->ext_csd.hpi) { in mmc_init_card()
1874 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1880 card->ext_csd.hpi_en = 0; in mmc_init_card()
1882 card->ext_csd.hpi_en = 1; in mmc_init_card()
1893 if (card->ext_csd.cache_size > 0) { in mmc_init_card()
1896 timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); in mmc_init_card()
1908 card->ext_csd.cache_ctrl = 0; in mmc_init_card()
1910 card->ext_csd.cache_ctrl = 1; in mmc_init_card()
1918 card->ext_csd.cmdq_en = false; in mmc_init_card()
1919 if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { in mmc_init_card()
1926 card->ext_csd.cmdq_support = false; in mmc_init_card()
1927 card->ext_csd.cmdq_depth = 0; in mmc_init_card()
1935 card->reenable_cmdq = card->ext_csd.cmdq_en; in mmc_init_card()
1942 if (card->ext_csd.cmdq_en) { in mmc_init_card()
1975 return card->ext_csd.rev >= 3; in mmc_card_can_sleep()
1990 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); in mmc_sleep()
2035 (card->ext_csd.power_off_notification == EXT_CSD_POWER_ON); in mmc_card_can_poweroff_notify()
2053 unsigned int timeout = card->ext_csd.generic_cmd6_time; in mmc_poweroff_notify()
2058 timeout = card->ext_csd.power_off_longtime; in mmc_poweroff_notify()
2068 card->ext_csd.power_off_notification = EXT_CSD_NO_POWER_NOTIFICATION; in mmc_poweroff_notify()
2110 return host->card->ext_csd.cache_size > 0 && in _mmc_cache_enabled()
2111 host->card->ext_csd.cache_ctrl & 1; in _mmc_cache_enabled()
2304 rst_n_function = card->ext_csd.rst_n_function; in mmc_card_can_reset()