Lines Matching refs:ext_csd
131 if (card->ext_csd.erase_group_def & 1) in mmc_set_erase_size()
132 card->erase_size = card->ext_csd.hc_erase_size; in mmc_set_erase_size()
197 u8 card_type = card->ext_csd.raw_card_type; in mmc_select_card_type()
251 card->ext_csd.strobe_support && in mmc_select_card_type()
255 card->ext_csd.hs_max_dtr = hs_max_dtr; in mmc_select_card_type()
256 card->ext_csd.hs200_max_dtr = hs200_max_dtr; in mmc_select_card_type()
260 static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd) in mmc_manage_enhanced_area() argument
267 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_manage_enhanced_area()
268 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_manage_enhanced_area()
275 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && in mmc_manage_enhanced_area()
276 (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { in mmc_manage_enhanced_area()
277 if (card->ext_csd.partition_setting_completed) { in mmc_manage_enhanced_area()
279 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_enhanced_area()
281 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_enhanced_area()
286 card->ext_csd.enhanced_area_offset = in mmc_manage_enhanced_area()
287 (((unsigned long long)ext_csd[139]) << 24) + in mmc_manage_enhanced_area()
288 (((unsigned long long)ext_csd[138]) << 16) + in mmc_manage_enhanced_area()
289 (((unsigned long long)ext_csd[137]) << 8) + in mmc_manage_enhanced_area()
290 (((unsigned long long)ext_csd[136])); in mmc_manage_enhanced_area()
292 card->ext_csd.enhanced_area_offset <<= 9; in mmc_manage_enhanced_area()
296 card->ext_csd.enhanced_area_size = in mmc_manage_enhanced_area()
297 (ext_csd[142] << 16) + (ext_csd[141] << 8) + in mmc_manage_enhanced_area()
298 ext_csd[140]; in mmc_manage_enhanced_area()
299 card->ext_csd.enhanced_area_size *= in mmc_manage_enhanced_area()
301 card->ext_csd.enhanced_area_size <<= 9; in mmc_manage_enhanced_area()
321 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd) in mmc_manage_gp_partitions() argument
332 if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & in mmc_manage_gp_partitions()
335 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_gp_partitions()
337 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_gp_partitions()
340 if (!ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3] && in mmc_manage_gp_partitions()
341 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] && in mmc_manage_gp_partitions()
342 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2]) in mmc_manage_gp_partitions()
344 if (card->ext_csd.partition_setting_completed == 0) { in mmc_manage_gp_partitions()
350 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2] in mmc_manage_gp_partitions()
352 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] in mmc_manage_gp_partitions()
354 ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3]; in mmc_manage_gp_partitions()
370 static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) in mmc_decode_ext_csd() argument
378 card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; in mmc_decode_ext_csd()
380 if (card->ext_csd.raw_ext_csd_structure > 2) { in mmc_decode_ext_csd()
383 card->ext_csd.raw_ext_csd_structure); in mmc_decode_ext_csd()
399 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; in mmc_decode_ext_csd()
404 card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; in mmc_decode_ext_csd()
405 card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; in mmc_decode_ext_csd()
406 card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; in mmc_decode_ext_csd()
407 card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; in mmc_decode_ext_csd()
408 if (card->ext_csd.rev >= 2) { in mmc_decode_ext_csd()
409 card->ext_csd.sectors = in mmc_decode_ext_csd()
410 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | in mmc_decode_ext_csd()
411 ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | in mmc_decode_ext_csd()
412 ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | in mmc_decode_ext_csd()
413 ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_decode_ext_csd()
416 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) in mmc_decode_ext_csd()
420 card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT]; in mmc_decode_ext_csd()
421 card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_decode_ext_csd()
424 card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
425 card->ext_csd.raw_erase_timeout_mult = in mmc_decode_ext_csd()
426 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
427 card->ext_csd.raw_hc_erase_grp_size = in mmc_decode_ext_csd()
428 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_decode_ext_csd()
429 card->ext_csd.raw_boot_mult = in mmc_decode_ext_csd()
430 ext_csd[EXT_CSD_BOOT_MULT]; in mmc_decode_ext_csd()
431 if (card->ext_csd.rev >= 3) { in mmc_decode_ext_csd()
432 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
433 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; in mmc_decode_ext_csd()
436 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_decode_ext_csd()
440 card->ext_csd.sa_timeout = in mmc_decode_ext_csd()
441 1 << ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
442 card->ext_csd.erase_group_def = in mmc_decode_ext_csd()
443 ext_csd[EXT_CSD_ERASE_GROUP_DEF]; in mmc_decode_ext_csd()
444 card->ext_csd.hc_erase_timeout = 300 * in mmc_decode_ext_csd()
445 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
446 card->ext_csd.hc_erase_size = in mmc_decode_ext_csd()
447 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10; in mmc_decode_ext_csd()
449 card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C]; in mmc_decode_ext_csd()
455 if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) { in mmc_decode_ext_csd()
457 part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_decode_ext_csd()
466 card->ext_csd.raw_hc_erase_gap_size = in mmc_decode_ext_csd()
467 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_decode_ext_csd()
468 card->ext_csd.raw_sec_trim_mult = in mmc_decode_ext_csd()
469 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
470 card->ext_csd.raw_sec_erase_mult = in mmc_decode_ext_csd()
471 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
472 card->ext_csd.raw_sec_feature_support = in mmc_decode_ext_csd()
473 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
474 card->ext_csd.raw_trim_mult = in mmc_decode_ext_csd()
475 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
476 card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT]; in mmc_decode_ext_csd()
477 card->ext_csd.raw_driver_strength = ext_csd[EXT_CSD_DRIVER_STRENGTH]; in mmc_decode_ext_csd()
478 if (card->ext_csd.rev >= 4) { in mmc_decode_ext_csd()
479 if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED] & in mmc_decode_ext_csd()
481 card->ext_csd.partition_setting_completed = 1; in mmc_decode_ext_csd()
483 card->ext_csd.partition_setting_completed = 0; in mmc_decode_ext_csd()
485 mmc_manage_enhanced_area(card, ext_csd); in mmc_decode_ext_csd()
487 mmc_manage_gp_partitions(card, ext_csd); in mmc_decode_ext_csd()
489 card->ext_csd.sec_trim_mult = in mmc_decode_ext_csd()
490 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
491 card->ext_csd.sec_erase_mult = in mmc_decode_ext_csd()
492 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
493 card->ext_csd.sec_feature_support = in mmc_decode_ext_csd()
494 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
495 card->ext_csd.trim_timeout = 300 * in mmc_decode_ext_csd()
496 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
503 card->ext_csd.boot_ro_lock = ext_csd[EXT_CSD_BOOT_WP]; in mmc_decode_ext_csd()
504 card->ext_csd.boot_ro_lockable = true; in mmc_decode_ext_csd()
507 card->ext_csd.raw_pwr_cl_52_195 = in mmc_decode_ext_csd()
508 ext_csd[EXT_CSD_PWR_CL_52_195]; in mmc_decode_ext_csd()
509 card->ext_csd.raw_pwr_cl_26_195 = in mmc_decode_ext_csd()
510 ext_csd[EXT_CSD_PWR_CL_26_195]; in mmc_decode_ext_csd()
511 card->ext_csd.raw_pwr_cl_52_360 = in mmc_decode_ext_csd()
512 ext_csd[EXT_CSD_PWR_CL_52_360]; in mmc_decode_ext_csd()
513 card->ext_csd.raw_pwr_cl_26_360 = in mmc_decode_ext_csd()
514 ext_csd[EXT_CSD_PWR_CL_26_360]; in mmc_decode_ext_csd()
515 card->ext_csd.raw_pwr_cl_200_195 = in mmc_decode_ext_csd()
516 ext_csd[EXT_CSD_PWR_CL_200_195]; in mmc_decode_ext_csd()
517 card->ext_csd.raw_pwr_cl_200_360 = in mmc_decode_ext_csd()
518 ext_csd[EXT_CSD_PWR_CL_200_360]; in mmc_decode_ext_csd()
519 card->ext_csd.raw_pwr_cl_ddr_52_195 = in mmc_decode_ext_csd()
520 ext_csd[EXT_CSD_PWR_CL_DDR_52_195]; in mmc_decode_ext_csd()
521 card->ext_csd.raw_pwr_cl_ddr_52_360 = in mmc_decode_ext_csd()
522 ext_csd[EXT_CSD_PWR_CL_DDR_52_360]; in mmc_decode_ext_csd()
523 card->ext_csd.raw_pwr_cl_ddr_200_360 = in mmc_decode_ext_csd()
524 ext_csd[EXT_CSD_PWR_CL_DDR_200_360]; in mmc_decode_ext_csd()
527 if (card->ext_csd.rev >= 5) { in mmc_decode_ext_csd()
533 if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { in mmc_decode_ext_csd()
534 card->ext_csd.bkops = 1; in mmc_decode_ext_csd()
535 card->ext_csd.man_bkops_en = in mmc_decode_ext_csd()
536 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
538 card->ext_csd.raw_bkops_status = in mmc_decode_ext_csd()
539 ext_csd[EXT_CSD_BKOPS_STATUS]; in mmc_decode_ext_csd()
540 if (card->ext_csd.man_bkops_en) in mmc_decode_ext_csd()
543 card->ext_csd.auto_bkops_en = in mmc_decode_ext_csd()
544 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
546 if (card->ext_csd.auto_bkops_en) in mmc_decode_ext_csd()
553 !broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) { in mmc_decode_ext_csd()
554 card->ext_csd.hpi = 1; in mmc_decode_ext_csd()
555 if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2) in mmc_decode_ext_csd()
556 card->ext_csd.hpi_cmd = MMC_STOP_TRANSMISSION; in mmc_decode_ext_csd()
558 card->ext_csd.hpi_cmd = MMC_SEND_STATUS; in mmc_decode_ext_csd()
563 card->ext_csd.out_of_int_time = in mmc_decode_ext_csd()
564 ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10; in mmc_decode_ext_csd()
567 card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; in mmc_decode_ext_csd()
568 card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; in mmc_decode_ext_csd()
573 card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; in mmc_decode_ext_csd()
574 if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) { in mmc_decode_ext_csd()
575 mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, in mmc_decode_ext_csd()
582 card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; in mmc_decode_ext_csd()
583 if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) in mmc_decode_ext_csd()
589 card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; in mmc_decode_ext_csd()
590 if (card->ext_csd.rev >= 6) { in mmc_decode_ext_csd()
591 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; in mmc_decode_ext_csd()
593 card->ext_csd.generic_cmd6_time = 10 * in mmc_decode_ext_csd()
594 ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_decode_ext_csd()
595 card->ext_csd.power_off_longtime = 10 * in mmc_decode_ext_csd()
596 ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; in mmc_decode_ext_csd()
598 card->ext_csd.cache_size = in mmc_decode_ext_csd()
599 ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | in mmc_decode_ext_csd()
600 ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | in mmc_decode_ext_csd()
601 ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | in mmc_decode_ext_csd()
602 ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; in mmc_decode_ext_csd()
604 if (ext_csd[EXT_CSD_DATA_SECTOR_SIZE] == 1) in mmc_decode_ext_csd()
605 card->ext_csd.data_sector_size = 4096; in mmc_decode_ext_csd()
607 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
609 if ((ext_csd[EXT_CSD_DATA_TAG_SUPPORT] & 1) && in mmc_decode_ext_csd()
610 (ext_csd[EXT_CSD_TAG_UNIT_SIZE] <= 8)) { in mmc_decode_ext_csd()
611 card->ext_csd.data_tag_unit_size = in mmc_decode_ext_csd()
612 ((unsigned int) 1 << ext_csd[EXT_CSD_TAG_UNIT_SIZE]) * in mmc_decode_ext_csd()
613 (card->ext_csd.data_sector_size); in mmc_decode_ext_csd()
615 card->ext_csd.data_tag_unit_size = 0; in mmc_decode_ext_csd()
618 card->ext_csd.max_packed_writes = in mmc_decode_ext_csd()
619 ext_csd[EXT_CSD_MAX_PACKED_WRITES]; in mmc_decode_ext_csd()
620 card->ext_csd.max_packed_reads = in mmc_decode_ext_csd()
621 ext_csd[EXT_CSD_MAX_PACKED_READS]; in mmc_decode_ext_csd()
623 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
631 if (!card->ext_csd.part_time) in mmc_decode_ext_csd()
632 card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; in mmc_decode_ext_csd()
634 if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) in mmc_decode_ext_csd()
635 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; in mmc_decode_ext_csd()
638 if (card->ext_csd.rev >= 7) { in mmc_decode_ext_csd()
639 memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], in mmc_decode_ext_csd()
641 card->ext_csd.ffu_capable = in mmc_decode_ext_csd()
642 (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && in mmc_decode_ext_csd()
643 !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); in mmc_decode_ext_csd()
645 card->ext_csd.pre_eol_info = ext_csd[EXT_CSD_PRE_EOL_INFO]; in mmc_decode_ext_csd()
646 card->ext_csd.device_life_time_est_typ_a = in mmc_decode_ext_csd()
647 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]; in mmc_decode_ext_csd()
648 card->ext_csd.device_life_time_est_typ_b = in mmc_decode_ext_csd()
649 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]; in mmc_decode_ext_csd()
653 if (card->ext_csd.rev >= 8) { in mmc_decode_ext_csd()
654 card->ext_csd.cmdq_support = ext_csd[EXT_CSD_CMDQ_SUPPORT] & in mmc_decode_ext_csd()
656 card->ext_csd.cmdq_depth = (ext_csd[EXT_CSD_CMDQ_DEPTH] & in mmc_decode_ext_csd()
659 if (card->ext_csd.cmdq_depth <= 2) { in mmc_decode_ext_csd()
660 card->ext_csd.cmdq_support = false; in mmc_decode_ext_csd()
661 card->ext_csd.cmdq_depth = 0; in mmc_decode_ext_csd()
663 if (card->ext_csd.cmdq_support) { in mmc_decode_ext_csd()
666 card->ext_csd.cmdq_depth); in mmc_decode_ext_csd()
668 card->ext_csd.enhanced_rpmb_supported = in mmc_decode_ext_csd()
669 (card->ext_csd.rel_param & in mmc_decode_ext_csd()
678 u8 *ext_csd; in mmc_read_ext_csd() local
684 err = mmc_get_ext_csd(card, &ext_csd); in mmc_read_ext_csd()
709 err = mmc_decode_ext_csd(card, ext_csd); in mmc_read_ext_csd()
710 kfree(ext_csd); in mmc_read_ext_csd()
727 err = !((card->ext_csd.raw_partition_support == in mmc_compare_ext_csds()
729 (card->ext_csd.raw_erased_mem_count == in mmc_compare_ext_csds()
731 (card->ext_csd.rev == in mmc_compare_ext_csds()
733 (card->ext_csd.raw_ext_csd_structure == in mmc_compare_ext_csds()
735 (card->ext_csd.raw_card_type == in mmc_compare_ext_csds()
737 (card->ext_csd.raw_s_a_timeout == in mmc_compare_ext_csds()
739 (card->ext_csd.raw_hc_erase_gap_size == in mmc_compare_ext_csds()
741 (card->ext_csd.raw_erase_timeout_mult == in mmc_compare_ext_csds()
743 (card->ext_csd.raw_hc_erase_grp_size == in mmc_compare_ext_csds()
745 (card->ext_csd.raw_sec_trim_mult == in mmc_compare_ext_csds()
747 (card->ext_csd.raw_sec_erase_mult == in mmc_compare_ext_csds()
749 (card->ext_csd.raw_sec_feature_support == in mmc_compare_ext_csds()
751 (card->ext_csd.raw_trim_mult == in mmc_compare_ext_csds()
753 (card->ext_csd.raw_sectors[0] == in mmc_compare_ext_csds()
755 (card->ext_csd.raw_sectors[1] == in mmc_compare_ext_csds()
757 (card->ext_csd.raw_sectors[2] == in mmc_compare_ext_csds()
759 (card->ext_csd.raw_sectors[3] == in mmc_compare_ext_csds()
761 (card->ext_csd.raw_pwr_cl_52_195 == in mmc_compare_ext_csds()
763 (card->ext_csd.raw_pwr_cl_26_195 == in mmc_compare_ext_csds()
765 (card->ext_csd.raw_pwr_cl_52_360 == in mmc_compare_ext_csds()
767 (card->ext_csd.raw_pwr_cl_26_360 == in mmc_compare_ext_csds()
769 (card->ext_csd.raw_pwr_cl_200_195 == in mmc_compare_ext_csds()
771 (card->ext_csd.raw_pwr_cl_200_360 == in mmc_compare_ext_csds()
773 (card->ext_csd.raw_pwr_cl_ddr_52_195 == in mmc_compare_ext_csds()
775 (card->ext_csd.raw_pwr_cl_ddr_52_360 == in mmc_compare_ext_csds()
777 (card->ext_csd.raw_pwr_cl_ddr_200_360 == in mmc_compare_ext_csds()
794 MMC_DEV_ATTR(ffu_capable, "%d\n", card->ext_csd.ffu_capable);
800 MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
801 MMC_DEV_ATTR(pre_eol_info, "0x%02x\n", card->ext_csd.pre_eol_info);
803 card->ext_csd.device_life_time_est_typ_a,
804 card->ext_csd.device_life_time_est_typ_b);
807 card->ext_csd.enhanced_area_offset);
808 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
809 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
811 card->ext_csd.enhanced_rpmb_supported);
812 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
815 MMC_DEV_ATTR(cmdq_en, "%d\n", card->ext_csd.cmdq_en);
823 if (card->ext_csd.rev < 7) in mmc_fwrev_show()
827 card->ext_csd.fwrev); in mmc_fwrev_show()
892 struct mmc_ext_csd *ext_csd = &card->ext_csd; in __mmc_select_powerclass() local
899 pwrclass_val = ext_csd->raw_pwr_cl_26_195; in __mmc_select_powerclass()
902 ext_csd->raw_pwr_cl_52_195 : in __mmc_select_powerclass()
903 ext_csd->raw_pwr_cl_ddr_52_195; in __mmc_select_powerclass()
905 pwrclass_val = ext_csd->raw_pwr_cl_200_195; in __mmc_select_powerclass()
917 pwrclass_val = ext_csd->raw_pwr_cl_26_360; in __mmc_select_powerclass()
920 ext_csd->raw_pwr_cl_52_360 : in __mmc_select_powerclass()
921 ext_csd->raw_pwr_cl_ddr_52_360; in __mmc_select_powerclass()
924 ext_csd->raw_pwr_cl_ddr_200_360 : in __mmc_select_powerclass()
925 ext_csd->raw_pwr_cl_200_360; in __mmc_select_powerclass()
945 card->ext_csd.generic_cmd6_time); in __mmc_select_powerclass()
990 max_dtr > card->ext_csd.hs200_max_dtr) in mmc_set_bus_speed()
991 max_dtr = card->ext_csd.hs200_max_dtr; in mmc_set_bus_speed()
992 else if (mmc_card_hs(card) && max_dtr > card->ext_csd.hs_max_dtr) in mmc_set_bus_speed()
993 max_dtr = card->ext_csd.hs_max_dtr; in mmc_set_bus_speed()
1042 card->ext_csd.generic_cmd6_time); in mmc_select_bus_width()
1080 card->ext_csd.generic_cmd6_time, MMC_TIMING_MMC_HS, in mmc_select_hs()
1111 card->ext_csd.generic_cmd6_time, in mmc_select_hs_ddr()
1180 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1196 max_dtr = card->ext_csd.hs_max_dtr; in mmc_select_hs400()
1210 card->ext_csd.generic_cmd6_time); in mmc_select_hs400()
1222 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1270 max_dtr = card->ext_csd.hs_max_dtr; in mmc_hs400_to_hs200()
1276 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1292 EXT_CSD_BUS_WIDTH_8, card->ext_csd.generic_cmd6_time, in mmc_hs400_to_hs200()
1307 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1342 card_drv_type = card->ext_csd.raw_driver_strength | in mmc_select_driver_type()
1350 card->ext_csd.hs200_max_dtr, in mmc_select_driver_type()
1386 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1410 card->ext_csd.generic_cmd6_time); in mmc_select_hs400es()
1424 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1489 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs200()
1503 mmc_set_clock(card->host, card->ext_csd.hs_max_dtr); in mmc_select_hs200()
1736 if (card->ext_csd.rev >= 3) { in mmc_init_card()
1739 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1750 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_init_card()
1751 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_init_card()
1753 card->ext_csd.erase_group_def = 1; in mmc_init_card()
1766 if (card->ext_csd.part_config & EXT_CSD_PART_CONFIG_ACC_MASK) { in mmc_init_card()
1767 card->ext_csd.part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; in mmc_init_card()
1769 card->ext_csd.part_config, in mmc_init_card()
1770 card->ext_csd.part_time); in mmc_init_card()
1778 if (card->ext_csd.rev >= 6) { in mmc_init_card()
1782 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1791 card->ext_csd.power_off_notification = EXT_CSD_POWER_ON; in mmc_init_card()
1839 if (card->ext_csd.hpi) { in mmc_init_card()
1842 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1848 card->ext_csd.hpi_en = 0; in mmc_init_card()
1850 card->ext_csd.hpi_en = 1; in mmc_init_card()
1861 if (card->ext_csd.cache_size > 0) { in mmc_init_card()
1864 timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); in mmc_init_card()
1876 card->ext_csd.cache_ctrl = 0; in mmc_init_card()
1878 card->ext_csd.cache_ctrl = 1; in mmc_init_card()
1886 card->ext_csd.cmdq_en = false; in mmc_init_card()
1887 if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { in mmc_init_card()
1894 card->ext_csd.cmdq_support = false; in mmc_init_card()
1895 card->ext_csd.cmdq_depth = 0; in mmc_init_card()
1903 card->reenable_cmdq = card->ext_csd.cmdq_en; in mmc_init_card()
1910 if (card->ext_csd.cmdq_en) { in mmc_init_card()
1943 return card->ext_csd.rev >= 3; in mmc_can_sleep()
1958 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); in mmc_sleep()
2003 (card->ext_csd.power_off_notification == EXT_CSD_POWER_ON); in mmc_can_poweroff_notify()
2008 unsigned int timeout = card->ext_csd.generic_cmd6_time; in mmc_poweroff_notify()
2013 timeout = card->ext_csd.power_off_longtime; in mmc_poweroff_notify()
2023 card->ext_csd.power_off_notification = EXT_CSD_NO_POWER_NOTIFICATION; in mmc_poweroff_notify()
2073 return host->card->ext_csd.cache_size > 0 && in _mmc_cache_enabled()
2074 host->card->ext_csd.cache_ctrl & 1; in _mmc_cache_enabled()
2234 rst_n_function = card->ext_csd.rst_n_function; in mmc_can_reset()