Lines Matching refs:ext_csd

127 	if (card->ext_csd.erase_group_def & 1)  in mmc_set_erase_size()
128 card->erase_size = card->ext_csd.hc_erase_size; in mmc_set_erase_size()
138 if (card->ext_csd.erase_group_def & 1) in mmc_set_wp_grp_size()
139 card->wp_grp_size = card->ext_csd.hc_erase_size * in mmc_set_wp_grp_size()
140 card->ext_csd.raw_hc_erase_gap_size; in mmc_set_wp_grp_size()
205 u8 card_type = card->ext_csd.raw_card_type; in mmc_select_card_type()
259 card->ext_csd.strobe_support && in mmc_select_card_type()
263 card->ext_csd.hs_max_dtr = hs_max_dtr; in mmc_select_card_type()
264 card->ext_csd.hs200_max_dtr = hs200_max_dtr; in mmc_select_card_type()
268 static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd) in mmc_manage_enhanced_area() argument
275 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_manage_enhanced_area()
276 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_manage_enhanced_area()
283 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && in mmc_manage_enhanced_area()
284 (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { in mmc_manage_enhanced_area()
285 if (card->ext_csd.partition_setting_completed) { in mmc_manage_enhanced_area()
287 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_enhanced_area()
289 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_enhanced_area()
294 card->ext_csd.enhanced_area_offset = in mmc_manage_enhanced_area()
295 (((unsigned long long)ext_csd[139]) << 24) + in mmc_manage_enhanced_area()
296 (((unsigned long long)ext_csd[138]) << 16) + in mmc_manage_enhanced_area()
297 (((unsigned long long)ext_csd[137]) << 8) + in mmc_manage_enhanced_area()
298 (((unsigned long long)ext_csd[136])); in mmc_manage_enhanced_area()
300 card->ext_csd.enhanced_area_offset <<= 9; in mmc_manage_enhanced_area()
304 card->ext_csd.enhanced_area_size = in mmc_manage_enhanced_area()
305 (ext_csd[142] << 16) + (ext_csd[141] << 8) + in mmc_manage_enhanced_area()
306 ext_csd[140]; in mmc_manage_enhanced_area()
307 card->ext_csd.enhanced_area_size *= in mmc_manage_enhanced_area()
309 card->ext_csd.enhanced_area_size <<= 9; in mmc_manage_enhanced_area()
329 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd) in mmc_manage_gp_partitions() argument
340 if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & in mmc_manage_gp_partitions()
343 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_gp_partitions()
345 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_gp_partitions()
348 if (!ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3] && in mmc_manage_gp_partitions()
349 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] && in mmc_manage_gp_partitions()
350 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2]) in mmc_manage_gp_partitions()
352 if (card->ext_csd.partition_setting_completed == 0) { in mmc_manage_gp_partitions()
358 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2] in mmc_manage_gp_partitions()
360 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] in mmc_manage_gp_partitions()
362 ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3]; in mmc_manage_gp_partitions()
378 static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) in mmc_decode_ext_csd() argument
386 card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; in mmc_decode_ext_csd()
388 if (card->ext_csd.raw_ext_csd_structure > 2) { in mmc_decode_ext_csd()
391 card->ext_csd.raw_ext_csd_structure); in mmc_decode_ext_csd()
407 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; in mmc_decode_ext_csd()
412 card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; in mmc_decode_ext_csd()
413 card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; in mmc_decode_ext_csd()
414 card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; in mmc_decode_ext_csd()
415 card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; in mmc_decode_ext_csd()
416 if (card->ext_csd.rev >= 2) { in mmc_decode_ext_csd()
417 card->ext_csd.sectors = in mmc_decode_ext_csd()
418 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | in mmc_decode_ext_csd()
419 ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | in mmc_decode_ext_csd()
420 ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | in mmc_decode_ext_csd()
421 ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_decode_ext_csd()
424 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) in mmc_decode_ext_csd()
428 card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT]; in mmc_decode_ext_csd()
429 card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_decode_ext_csd()
431 card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
432 card->ext_csd.raw_erase_timeout_mult = in mmc_decode_ext_csd()
433 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
434 card->ext_csd.raw_hc_erase_grp_size = in mmc_decode_ext_csd()
435 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_decode_ext_csd()
436 card->ext_csd.raw_boot_mult = in mmc_decode_ext_csd()
437 ext_csd[EXT_CSD_BOOT_MULT]; in mmc_decode_ext_csd()
438 if (card->ext_csd.rev >= 3) { in mmc_decode_ext_csd()
439 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
440 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; in mmc_decode_ext_csd()
443 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_decode_ext_csd()
447 card->ext_csd.sa_timeout = in mmc_decode_ext_csd()
448 1 << ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
449 card->ext_csd.erase_group_def = in mmc_decode_ext_csd()
450 ext_csd[EXT_CSD_ERASE_GROUP_DEF]; in mmc_decode_ext_csd()
451 card->ext_csd.hc_erase_timeout = 300 * in mmc_decode_ext_csd()
452 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
453 card->ext_csd.hc_erase_size = in mmc_decode_ext_csd()
454 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10; in mmc_decode_ext_csd()
456 card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C]; in mmc_decode_ext_csd()
462 if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_host_can_access_boot(card->host)) { in mmc_decode_ext_csd()
464 part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_decode_ext_csd()
473 card->ext_csd.raw_hc_erase_gap_size = in mmc_decode_ext_csd()
474 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_decode_ext_csd()
475 card->ext_csd.raw_sec_trim_mult = in mmc_decode_ext_csd()
476 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
477 card->ext_csd.raw_sec_erase_mult = in mmc_decode_ext_csd()
478 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
479 card->ext_csd.raw_sec_feature_support = in mmc_decode_ext_csd()
480 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
481 card->ext_csd.raw_trim_mult = in mmc_decode_ext_csd()
482 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
483 card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT]; in mmc_decode_ext_csd()
484 card->ext_csd.raw_driver_strength = ext_csd[EXT_CSD_DRIVER_STRENGTH]; in mmc_decode_ext_csd()
485 if (card->ext_csd.rev >= 4) { in mmc_decode_ext_csd()
486 if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED] & in mmc_decode_ext_csd()
488 card->ext_csd.partition_setting_completed = 1; in mmc_decode_ext_csd()
490 card->ext_csd.partition_setting_completed = 0; in mmc_decode_ext_csd()
492 mmc_manage_enhanced_area(card, ext_csd); in mmc_decode_ext_csd()
494 mmc_manage_gp_partitions(card, ext_csd); in mmc_decode_ext_csd()
496 card->ext_csd.sec_trim_mult = in mmc_decode_ext_csd()
497 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
498 card->ext_csd.sec_erase_mult = in mmc_decode_ext_csd()
499 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
500 card->ext_csd.sec_feature_support = in mmc_decode_ext_csd()
501 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
502 card->ext_csd.trim_timeout = 300 * in mmc_decode_ext_csd()
503 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
510 card->ext_csd.boot_ro_lock = ext_csd[EXT_CSD_BOOT_WP]; in mmc_decode_ext_csd()
511 card->ext_csd.boot_ro_lockable = true; in mmc_decode_ext_csd()
514 card->ext_csd.raw_pwr_cl_52_195 = in mmc_decode_ext_csd()
515 ext_csd[EXT_CSD_PWR_CL_52_195]; in mmc_decode_ext_csd()
516 card->ext_csd.raw_pwr_cl_26_195 = in mmc_decode_ext_csd()
517 ext_csd[EXT_CSD_PWR_CL_26_195]; in mmc_decode_ext_csd()
518 card->ext_csd.raw_pwr_cl_52_360 = in mmc_decode_ext_csd()
519 ext_csd[EXT_CSD_PWR_CL_52_360]; in mmc_decode_ext_csd()
520 card->ext_csd.raw_pwr_cl_26_360 = in mmc_decode_ext_csd()
521 ext_csd[EXT_CSD_PWR_CL_26_360]; in mmc_decode_ext_csd()
522 card->ext_csd.raw_pwr_cl_200_195 = in mmc_decode_ext_csd()
523 ext_csd[EXT_CSD_PWR_CL_200_195]; in mmc_decode_ext_csd()
524 card->ext_csd.raw_pwr_cl_200_360 = in mmc_decode_ext_csd()
525 ext_csd[EXT_CSD_PWR_CL_200_360]; in mmc_decode_ext_csd()
526 card->ext_csd.raw_pwr_cl_ddr_52_195 = in mmc_decode_ext_csd()
527 ext_csd[EXT_CSD_PWR_CL_DDR_52_195]; in mmc_decode_ext_csd()
528 card->ext_csd.raw_pwr_cl_ddr_52_360 = in mmc_decode_ext_csd()
529 ext_csd[EXT_CSD_PWR_CL_DDR_52_360]; in mmc_decode_ext_csd()
530 card->ext_csd.raw_pwr_cl_ddr_200_360 = in mmc_decode_ext_csd()
531 ext_csd[EXT_CSD_PWR_CL_DDR_200_360]; in mmc_decode_ext_csd()
534 if (card->ext_csd.rev >= 5) { in mmc_decode_ext_csd()
540 if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { in mmc_decode_ext_csd()
541 card->ext_csd.bkops = 1; in mmc_decode_ext_csd()
542 card->ext_csd.man_bkops_en = in mmc_decode_ext_csd()
543 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
545 card->ext_csd.raw_bkops_status = in mmc_decode_ext_csd()
546 ext_csd[EXT_CSD_BKOPS_STATUS]; in mmc_decode_ext_csd()
547 if (card->ext_csd.man_bkops_en) in mmc_decode_ext_csd()
550 card->ext_csd.auto_bkops_en = in mmc_decode_ext_csd()
551 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
553 if (card->ext_csd.auto_bkops_en) in mmc_decode_ext_csd()
560 !broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) { in mmc_decode_ext_csd()
561 card->ext_csd.hpi = 1; in mmc_decode_ext_csd()
562 if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2) in mmc_decode_ext_csd()
563 card->ext_csd.hpi_cmd = MMC_STOP_TRANSMISSION; in mmc_decode_ext_csd()
565 card->ext_csd.hpi_cmd = MMC_SEND_STATUS; in mmc_decode_ext_csd()
570 card->ext_csd.out_of_int_time = in mmc_decode_ext_csd()
571 ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10; in mmc_decode_ext_csd()
574 card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; in mmc_decode_ext_csd()
575 card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; in mmc_decode_ext_csd()
580 card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; in mmc_decode_ext_csd()
581 if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_can_cmd23(card->host)) { in mmc_decode_ext_csd()
582 mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, in mmc_decode_ext_csd()
589 card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; in mmc_decode_ext_csd()
590 if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) in mmc_decode_ext_csd()
596 card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; in mmc_decode_ext_csd()
597 if (card->ext_csd.rev >= 6) { in mmc_decode_ext_csd()
598 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; in mmc_decode_ext_csd()
600 card->ext_csd.generic_cmd6_time = 10 * in mmc_decode_ext_csd()
601 ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_decode_ext_csd()
602 card->ext_csd.power_off_longtime = 10 * in mmc_decode_ext_csd()
603 ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; in mmc_decode_ext_csd()
605 card->ext_csd.cache_size = in mmc_decode_ext_csd()
606 ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | in mmc_decode_ext_csd()
607 ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | in mmc_decode_ext_csd()
608 ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | in mmc_decode_ext_csd()
609 ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; in mmc_decode_ext_csd()
611 if (ext_csd[EXT_CSD_DATA_SECTOR_SIZE] == 1) in mmc_decode_ext_csd()
612 card->ext_csd.data_sector_size = 4096; in mmc_decode_ext_csd()
614 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
616 if ((ext_csd[EXT_CSD_DATA_TAG_SUPPORT] & 1) && in mmc_decode_ext_csd()
617 (ext_csd[EXT_CSD_TAG_UNIT_SIZE] <= 8)) { in mmc_decode_ext_csd()
618 card->ext_csd.data_tag_unit_size = in mmc_decode_ext_csd()
619 ((unsigned int) 1 << ext_csd[EXT_CSD_TAG_UNIT_SIZE]) * in mmc_decode_ext_csd()
620 (card->ext_csd.data_sector_size); in mmc_decode_ext_csd()
622 card->ext_csd.data_tag_unit_size = 0; in mmc_decode_ext_csd()
625 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
633 if (!card->ext_csd.part_time) in mmc_decode_ext_csd()
634 card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; in mmc_decode_ext_csd()
636 if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) in mmc_decode_ext_csd()
637 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; in mmc_decode_ext_csd()
640 if (card->ext_csd.rev >= 7) { in mmc_decode_ext_csd()
641 memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], in mmc_decode_ext_csd()
643 card->ext_csd.ffu_capable = in mmc_decode_ext_csd()
644 (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && in mmc_decode_ext_csd()
645 !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); in mmc_decode_ext_csd()
647 card->ext_csd.pre_eol_info = ext_csd[EXT_CSD_PRE_EOL_INFO]; in mmc_decode_ext_csd()
648 card->ext_csd.device_life_time_est_typ_a = in mmc_decode_ext_csd()
649 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]; in mmc_decode_ext_csd()
650 card->ext_csd.device_life_time_est_typ_b = in mmc_decode_ext_csd()
651 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]; in mmc_decode_ext_csd()
655 if (card->ext_csd.rev >= 8) { in mmc_decode_ext_csd()
656 card->ext_csd.cmdq_support = ext_csd[EXT_CSD_CMDQ_SUPPORT] & in mmc_decode_ext_csd()
658 card->ext_csd.cmdq_depth = (ext_csd[EXT_CSD_CMDQ_DEPTH] & in mmc_decode_ext_csd()
661 if (card->ext_csd.cmdq_depth <= 2) { in mmc_decode_ext_csd()
662 card->ext_csd.cmdq_support = false; in mmc_decode_ext_csd()
663 card->ext_csd.cmdq_depth = 0; in mmc_decode_ext_csd()
665 if (card->ext_csd.cmdq_support) { in mmc_decode_ext_csd()
668 card->ext_csd.cmdq_depth); in mmc_decode_ext_csd()
670 card->ext_csd.enhanced_rpmb_supported = in mmc_decode_ext_csd()
671 (card->ext_csd.rel_param & in mmc_decode_ext_csd()
680 u8 *ext_csd; in mmc_read_ext_csd() local
686 err = mmc_get_ext_csd(card, &ext_csd); in mmc_read_ext_csd()
711 err = mmc_decode_ext_csd(card, ext_csd); in mmc_read_ext_csd()
712 kfree(ext_csd); in mmc_read_ext_csd()
729 err = !((card->ext_csd.raw_partition_support == in mmc_compare_ext_csds()
731 (card->ext_csd.raw_erased_mem_count == in mmc_compare_ext_csds()
733 (card->ext_csd.rev == in mmc_compare_ext_csds()
735 (card->ext_csd.raw_ext_csd_structure == in mmc_compare_ext_csds()
737 (card->ext_csd.raw_card_type == in mmc_compare_ext_csds()
739 (card->ext_csd.raw_s_a_timeout == in mmc_compare_ext_csds()
741 (card->ext_csd.raw_hc_erase_gap_size == in mmc_compare_ext_csds()
743 (card->ext_csd.raw_erase_timeout_mult == in mmc_compare_ext_csds()
745 (card->ext_csd.raw_hc_erase_grp_size == in mmc_compare_ext_csds()
747 (card->ext_csd.raw_sec_trim_mult == in mmc_compare_ext_csds()
749 (card->ext_csd.raw_sec_erase_mult == in mmc_compare_ext_csds()
751 (card->ext_csd.raw_sec_feature_support == in mmc_compare_ext_csds()
753 (card->ext_csd.raw_trim_mult == in mmc_compare_ext_csds()
755 (card->ext_csd.raw_sectors[0] == in mmc_compare_ext_csds()
757 (card->ext_csd.raw_sectors[1] == in mmc_compare_ext_csds()
759 (card->ext_csd.raw_sectors[2] == in mmc_compare_ext_csds()
761 (card->ext_csd.raw_sectors[3] == in mmc_compare_ext_csds()
763 (card->ext_csd.raw_pwr_cl_52_195 == in mmc_compare_ext_csds()
765 (card->ext_csd.raw_pwr_cl_26_195 == in mmc_compare_ext_csds()
767 (card->ext_csd.raw_pwr_cl_52_360 == in mmc_compare_ext_csds()
769 (card->ext_csd.raw_pwr_cl_26_360 == in mmc_compare_ext_csds()
771 (card->ext_csd.raw_pwr_cl_200_195 == in mmc_compare_ext_csds()
773 (card->ext_csd.raw_pwr_cl_200_360 == in mmc_compare_ext_csds()
775 (card->ext_csd.raw_pwr_cl_ddr_52_195 == in mmc_compare_ext_csds()
777 (card->ext_csd.raw_pwr_cl_ddr_52_360 == in mmc_compare_ext_csds()
779 (card->ext_csd.raw_pwr_cl_ddr_200_360 == in mmc_compare_ext_csds()
797 MMC_DEV_ATTR(ffu_capable, "%d\n", card->ext_csd.ffu_capable);
803 MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
804 MMC_DEV_ATTR(pre_eol_info, "0x%02x\n", card->ext_csd.pre_eol_info);
806 card->ext_csd.device_life_time_est_typ_a,
807 card->ext_csd.device_life_time_est_typ_b);
810 card->ext_csd.enhanced_area_offset);
811 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
812 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
814 card->ext_csd.enhanced_rpmb_supported);
815 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
818 MMC_DEV_ATTR(cmdq_en, "%d\n", card->ext_csd.cmdq_en);
826 if (card->ext_csd.rev < 7) in mmc_fwrev_show()
830 card->ext_csd.fwrev); in mmc_fwrev_show()
896 struct mmc_ext_csd *ext_csd = &card->ext_csd; in __mmc_select_powerclass() local
903 pwrclass_val = ext_csd->raw_pwr_cl_26_195; in __mmc_select_powerclass()
906 ext_csd->raw_pwr_cl_52_195 : in __mmc_select_powerclass()
907 ext_csd->raw_pwr_cl_ddr_52_195; in __mmc_select_powerclass()
909 pwrclass_val = ext_csd->raw_pwr_cl_200_195; in __mmc_select_powerclass()
921 pwrclass_val = ext_csd->raw_pwr_cl_26_360; in __mmc_select_powerclass()
924 ext_csd->raw_pwr_cl_52_360 : in __mmc_select_powerclass()
925 ext_csd->raw_pwr_cl_ddr_52_360; in __mmc_select_powerclass()
928 ext_csd->raw_pwr_cl_ddr_200_360 : in __mmc_select_powerclass()
929 ext_csd->raw_pwr_cl_200_360; in __mmc_select_powerclass()
949 card->ext_csd.generic_cmd6_time); in __mmc_select_powerclass()
994 max_dtr > card->ext_csd.hs200_max_dtr) in mmc_set_bus_speed()
995 max_dtr = card->ext_csd.hs200_max_dtr; in mmc_set_bus_speed()
996 else if (mmc_card_hs(card) && max_dtr > card->ext_csd.hs_max_dtr) in mmc_set_bus_speed()
997 max_dtr = card->ext_csd.hs_max_dtr; in mmc_set_bus_speed()
1048 card->ext_csd.generic_cmd6_time); in mmc_select_bus_width()
1086 card->ext_csd.generic_cmd6_time, MMC_TIMING_MMC_HS, in mmc_select_hs()
1117 card->ext_csd.generic_cmd6_time, in mmc_select_hs_ddr()
1186 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1202 max_dtr = card->ext_csd.hs_max_dtr; in mmc_select_hs400()
1216 card->ext_csd.generic_cmd6_time); in mmc_select_hs400()
1228 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1276 max_dtr = card->ext_csd.hs_max_dtr; in mmc_hs400_to_hs200()
1282 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1298 EXT_CSD_BUS_WIDTH_8, card->ext_csd.generic_cmd6_time, in mmc_hs400_to_hs200()
1313 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1348 card_drv_type = card->ext_csd.raw_driver_strength | in mmc_select_driver_type()
1356 card->ext_csd.hs200_max_dtr, in mmc_select_driver_type()
1392 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1416 card->ext_csd.generic_cmd6_time); in mmc_select_hs400es()
1430 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1495 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs200()
1509 mmc_set_clock(card->host, card->ext_csd.hs_max_dtr); in mmc_select_hs200()
1748 if (card->ext_csd.rev >= 3) { in mmc_init_card()
1751 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1762 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_init_card()
1763 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_init_card()
1765 card->ext_csd.erase_group_def = 1; in mmc_init_card()
1778 if (card->ext_csd.part_config & EXT_CSD_PART_CONFIG_ACC_MASK) { in mmc_init_card()
1779 card->ext_csd.part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; in mmc_init_card()
1781 card->ext_csd.part_config, in mmc_init_card()
1782 card->ext_csd.part_time); in mmc_init_card()
1790 if (card->ext_csd.rev >= 6) { in mmc_init_card()
1794 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1803 card->ext_csd.power_off_notification = EXT_CSD_POWER_ON; in mmc_init_card()
1856 if (card->ext_csd.hpi) { in mmc_init_card()
1859 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1865 card->ext_csd.hpi_en = 0; in mmc_init_card()
1867 card->ext_csd.hpi_en = 1; in mmc_init_card()
1878 if (card->ext_csd.cache_size > 0) { in mmc_init_card()
1881 timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); in mmc_init_card()
1893 card->ext_csd.cache_ctrl = 0; in mmc_init_card()
1895 card->ext_csd.cache_ctrl = 1; in mmc_init_card()
1903 card->ext_csd.cmdq_en = false; in mmc_init_card()
1904 if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { in mmc_init_card()
1911 card->ext_csd.cmdq_support = false; in mmc_init_card()
1912 card->ext_csd.cmdq_depth = 0; in mmc_init_card()
1920 card->reenable_cmdq = card->ext_csd.cmdq_en; in mmc_init_card()
1927 if (card->ext_csd.cmdq_en) { in mmc_init_card()
1960 return card->ext_csd.rev >= 3; in mmc_card_can_sleep()
1975 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); in mmc_sleep()
2020 (card->ext_csd.power_off_notification == EXT_CSD_POWER_ON); in mmc_card_can_poweroff_notify()
2038 unsigned int timeout = card->ext_csd.generic_cmd6_time; in mmc_poweroff_notify()
2043 timeout = card->ext_csd.power_off_longtime; in mmc_poweroff_notify()
2053 card->ext_csd.power_off_notification = EXT_CSD_NO_POWER_NOTIFICATION; in mmc_poweroff_notify()
2095 return host->card->ext_csd.cache_size > 0 && in _mmc_cache_enabled()
2096 host->card->ext_csd.cache_ctrl & 1; in _mmc_cache_enabled()
2276 rst_n_function = card->ext_csd.rst_n_function; in mmc_card_can_reset()