Lines Matching refs:ext_csd
123 if (card->ext_csd.erase_group_def & 1) in mmc_set_erase_size()
124 card->erase_size = card->ext_csd.hc_erase_size; in mmc_set_erase_size()
189 u8 card_type = card->ext_csd.raw_card_type; in mmc_select_card_type()
243 card->ext_csd.strobe_support && in mmc_select_card_type()
247 card->ext_csd.hs_max_dtr = hs_max_dtr; in mmc_select_card_type()
248 card->ext_csd.hs200_max_dtr = hs200_max_dtr; in mmc_select_card_type()
252 static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd) in mmc_manage_enhanced_area() argument
259 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_manage_enhanced_area()
260 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_manage_enhanced_area()
267 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && in mmc_manage_enhanced_area()
268 (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { in mmc_manage_enhanced_area()
269 if (card->ext_csd.partition_setting_completed) { in mmc_manage_enhanced_area()
271 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_enhanced_area()
273 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_enhanced_area()
278 card->ext_csd.enhanced_area_offset = in mmc_manage_enhanced_area()
279 (((unsigned long long)ext_csd[139]) << 24) + in mmc_manage_enhanced_area()
280 (((unsigned long long)ext_csd[138]) << 16) + in mmc_manage_enhanced_area()
281 (((unsigned long long)ext_csd[137]) << 8) + in mmc_manage_enhanced_area()
282 (((unsigned long long)ext_csd[136])); in mmc_manage_enhanced_area()
284 card->ext_csd.enhanced_area_offset <<= 9; in mmc_manage_enhanced_area()
288 card->ext_csd.enhanced_area_size = in mmc_manage_enhanced_area()
289 (ext_csd[142] << 16) + (ext_csd[141] << 8) + in mmc_manage_enhanced_area()
290 ext_csd[140]; in mmc_manage_enhanced_area()
291 card->ext_csd.enhanced_area_size *= in mmc_manage_enhanced_area()
293 card->ext_csd.enhanced_area_size <<= 9; in mmc_manage_enhanced_area()
313 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd) in mmc_manage_gp_partitions() argument
324 if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & in mmc_manage_gp_partitions()
327 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_manage_gp_partitions()
329 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_manage_gp_partitions()
332 if (!ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3] && in mmc_manage_gp_partitions()
333 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] && in mmc_manage_gp_partitions()
334 !ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2]) in mmc_manage_gp_partitions()
336 if (card->ext_csd.partition_setting_completed == 0) { in mmc_manage_gp_partitions()
342 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 2] in mmc_manage_gp_partitions()
344 (ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3 + 1] in mmc_manage_gp_partitions()
346 ext_csd[EXT_CSD_GP_SIZE_MULT + idx * 3]; in mmc_manage_gp_partitions()
362 static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) in mmc_decode_ext_csd() argument
370 card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; in mmc_decode_ext_csd()
372 if (card->ext_csd.raw_ext_csd_structure > 2) { in mmc_decode_ext_csd()
375 card->ext_csd.raw_ext_csd_structure); in mmc_decode_ext_csd()
391 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; in mmc_decode_ext_csd()
396 card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; in mmc_decode_ext_csd()
397 card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; in mmc_decode_ext_csd()
398 card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; in mmc_decode_ext_csd()
399 card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; in mmc_decode_ext_csd()
400 if (card->ext_csd.rev >= 2) { in mmc_decode_ext_csd()
401 card->ext_csd.sectors = in mmc_decode_ext_csd()
402 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | in mmc_decode_ext_csd()
403 ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | in mmc_decode_ext_csd()
404 ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | in mmc_decode_ext_csd()
405 ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_decode_ext_csd()
408 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) in mmc_decode_ext_csd()
412 card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT]; in mmc_decode_ext_csd()
413 card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_decode_ext_csd()
416 card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
417 card->ext_csd.raw_erase_timeout_mult = in mmc_decode_ext_csd()
418 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
419 card->ext_csd.raw_hc_erase_grp_size = in mmc_decode_ext_csd()
420 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_decode_ext_csd()
421 card->ext_csd.raw_boot_mult = in mmc_decode_ext_csd()
422 ext_csd[EXT_CSD_BOOT_MULT]; in mmc_decode_ext_csd()
423 if (card->ext_csd.rev >= 3) { in mmc_decode_ext_csd()
424 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
425 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; in mmc_decode_ext_csd()
428 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_decode_ext_csd()
432 card->ext_csd.sa_timeout = in mmc_decode_ext_csd()
433 1 << ext_csd[EXT_CSD_S_A_TIMEOUT]; in mmc_decode_ext_csd()
434 card->ext_csd.erase_group_def = in mmc_decode_ext_csd()
435 ext_csd[EXT_CSD_ERASE_GROUP_DEF]; in mmc_decode_ext_csd()
436 card->ext_csd.hc_erase_timeout = 300 * in mmc_decode_ext_csd()
437 ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; in mmc_decode_ext_csd()
438 card->ext_csd.hc_erase_size = in mmc_decode_ext_csd()
439 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10; in mmc_decode_ext_csd()
441 card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C]; in mmc_decode_ext_csd()
447 if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) { in mmc_decode_ext_csd()
449 part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_decode_ext_csd()
458 card->ext_csd.raw_hc_erase_gap_size = in mmc_decode_ext_csd()
459 ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_decode_ext_csd()
460 card->ext_csd.raw_sec_trim_mult = in mmc_decode_ext_csd()
461 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
462 card->ext_csd.raw_sec_erase_mult = in mmc_decode_ext_csd()
463 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
464 card->ext_csd.raw_sec_feature_support = in mmc_decode_ext_csd()
465 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
466 card->ext_csd.raw_trim_mult = in mmc_decode_ext_csd()
467 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
468 card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT]; in mmc_decode_ext_csd()
469 card->ext_csd.raw_driver_strength = ext_csd[EXT_CSD_DRIVER_STRENGTH]; in mmc_decode_ext_csd()
470 if (card->ext_csd.rev >= 4) { in mmc_decode_ext_csd()
471 if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED] & in mmc_decode_ext_csd()
473 card->ext_csd.partition_setting_completed = 1; in mmc_decode_ext_csd()
475 card->ext_csd.partition_setting_completed = 0; in mmc_decode_ext_csd()
477 mmc_manage_enhanced_area(card, ext_csd); in mmc_decode_ext_csd()
479 mmc_manage_gp_partitions(card, ext_csd); in mmc_decode_ext_csd()
481 card->ext_csd.sec_trim_mult = in mmc_decode_ext_csd()
482 ext_csd[EXT_CSD_SEC_TRIM_MULT]; in mmc_decode_ext_csd()
483 card->ext_csd.sec_erase_mult = in mmc_decode_ext_csd()
484 ext_csd[EXT_CSD_SEC_ERASE_MULT]; in mmc_decode_ext_csd()
485 card->ext_csd.sec_feature_support = in mmc_decode_ext_csd()
486 ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; in mmc_decode_ext_csd()
487 card->ext_csd.trim_timeout = 300 * in mmc_decode_ext_csd()
488 ext_csd[EXT_CSD_TRIM_MULT]; in mmc_decode_ext_csd()
495 card->ext_csd.boot_ro_lock = ext_csd[EXT_CSD_BOOT_WP]; in mmc_decode_ext_csd()
496 card->ext_csd.boot_ro_lockable = true; in mmc_decode_ext_csd()
499 card->ext_csd.raw_pwr_cl_52_195 = in mmc_decode_ext_csd()
500 ext_csd[EXT_CSD_PWR_CL_52_195]; in mmc_decode_ext_csd()
501 card->ext_csd.raw_pwr_cl_26_195 = in mmc_decode_ext_csd()
502 ext_csd[EXT_CSD_PWR_CL_26_195]; in mmc_decode_ext_csd()
503 card->ext_csd.raw_pwr_cl_52_360 = in mmc_decode_ext_csd()
504 ext_csd[EXT_CSD_PWR_CL_52_360]; in mmc_decode_ext_csd()
505 card->ext_csd.raw_pwr_cl_26_360 = in mmc_decode_ext_csd()
506 ext_csd[EXT_CSD_PWR_CL_26_360]; in mmc_decode_ext_csd()
507 card->ext_csd.raw_pwr_cl_200_195 = in mmc_decode_ext_csd()
508 ext_csd[EXT_CSD_PWR_CL_200_195]; in mmc_decode_ext_csd()
509 card->ext_csd.raw_pwr_cl_200_360 = in mmc_decode_ext_csd()
510 ext_csd[EXT_CSD_PWR_CL_200_360]; in mmc_decode_ext_csd()
511 card->ext_csd.raw_pwr_cl_ddr_52_195 = in mmc_decode_ext_csd()
512 ext_csd[EXT_CSD_PWR_CL_DDR_52_195]; in mmc_decode_ext_csd()
513 card->ext_csd.raw_pwr_cl_ddr_52_360 = in mmc_decode_ext_csd()
514 ext_csd[EXT_CSD_PWR_CL_DDR_52_360]; in mmc_decode_ext_csd()
515 card->ext_csd.raw_pwr_cl_ddr_200_360 = in mmc_decode_ext_csd()
516 ext_csd[EXT_CSD_PWR_CL_DDR_200_360]; in mmc_decode_ext_csd()
519 if (card->ext_csd.rev >= 5) { in mmc_decode_ext_csd()
525 if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { in mmc_decode_ext_csd()
526 card->ext_csd.bkops = 1; in mmc_decode_ext_csd()
527 card->ext_csd.man_bkops_en = in mmc_decode_ext_csd()
528 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
530 card->ext_csd.raw_bkops_status = in mmc_decode_ext_csd()
531 ext_csd[EXT_CSD_BKOPS_STATUS]; in mmc_decode_ext_csd()
532 if (card->ext_csd.man_bkops_en) in mmc_decode_ext_csd()
535 card->ext_csd.auto_bkops_en = in mmc_decode_ext_csd()
536 (ext_csd[EXT_CSD_BKOPS_EN] & in mmc_decode_ext_csd()
538 if (card->ext_csd.auto_bkops_en) in mmc_decode_ext_csd()
545 !broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) { in mmc_decode_ext_csd()
546 card->ext_csd.hpi = 1; in mmc_decode_ext_csd()
547 if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2) in mmc_decode_ext_csd()
548 card->ext_csd.hpi_cmd = MMC_STOP_TRANSMISSION; in mmc_decode_ext_csd()
550 card->ext_csd.hpi_cmd = MMC_SEND_STATUS; in mmc_decode_ext_csd()
555 card->ext_csd.out_of_int_time = in mmc_decode_ext_csd()
556 ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10; in mmc_decode_ext_csd()
559 card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; in mmc_decode_ext_csd()
560 card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; in mmc_decode_ext_csd()
565 card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; in mmc_decode_ext_csd()
566 if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) { in mmc_decode_ext_csd()
567 mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, in mmc_decode_ext_csd()
574 card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; in mmc_decode_ext_csd()
575 if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) in mmc_decode_ext_csd()
581 card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; in mmc_decode_ext_csd()
582 if (card->ext_csd.rev >= 6) { in mmc_decode_ext_csd()
583 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; in mmc_decode_ext_csd()
585 card->ext_csd.generic_cmd6_time = 10 * in mmc_decode_ext_csd()
586 ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_decode_ext_csd()
587 card->ext_csd.power_off_longtime = 10 * in mmc_decode_ext_csd()
588 ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; in mmc_decode_ext_csd()
590 card->ext_csd.cache_size = in mmc_decode_ext_csd()
591 ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | in mmc_decode_ext_csd()
592 ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | in mmc_decode_ext_csd()
593 ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | in mmc_decode_ext_csd()
594 ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; in mmc_decode_ext_csd()
596 if (ext_csd[EXT_CSD_DATA_SECTOR_SIZE] == 1) in mmc_decode_ext_csd()
597 card->ext_csd.data_sector_size = 4096; in mmc_decode_ext_csd()
599 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
601 if ((ext_csd[EXT_CSD_DATA_TAG_SUPPORT] & 1) && in mmc_decode_ext_csd()
602 (ext_csd[EXT_CSD_TAG_UNIT_SIZE] <= 8)) { in mmc_decode_ext_csd()
603 card->ext_csd.data_tag_unit_size = in mmc_decode_ext_csd()
604 ((unsigned int) 1 << ext_csd[EXT_CSD_TAG_UNIT_SIZE]) * in mmc_decode_ext_csd()
605 (card->ext_csd.data_sector_size); in mmc_decode_ext_csd()
607 card->ext_csd.data_tag_unit_size = 0; in mmc_decode_ext_csd()
610 card->ext_csd.max_packed_writes = in mmc_decode_ext_csd()
611 ext_csd[EXT_CSD_MAX_PACKED_WRITES]; in mmc_decode_ext_csd()
612 card->ext_csd.max_packed_reads = in mmc_decode_ext_csd()
613 ext_csd[EXT_CSD_MAX_PACKED_READS]; in mmc_decode_ext_csd()
615 card->ext_csd.data_sector_size = 512; in mmc_decode_ext_csd()
623 if (!card->ext_csd.part_time) in mmc_decode_ext_csd()
624 card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; in mmc_decode_ext_csd()
626 if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) in mmc_decode_ext_csd()
627 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; in mmc_decode_ext_csd()
630 if (card->ext_csd.rev >= 7) { in mmc_decode_ext_csd()
631 memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], in mmc_decode_ext_csd()
633 card->ext_csd.ffu_capable = in mmc_decode_ext_csd()
634 (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && in mmc_decode_ext_csd()
635 !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); in mmc_decode_ext_csd()
637 card->ext_csd.pre_eol_info = ext_csd[EXT_CSD_PRE_EOL_INFO]; in mmc_decode_ext_csd()
638 card->ext_csd.device_life_time_est_typ_a = in mmc_decode_ext_csd()
639 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]; in mmc_decode_ext_csd()
640 card->ext_csd.device_life_time_est_typ_b = in mmc_decode_ext_csd()
641 ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]; in mmc_decode_ext_csd()
645 if (card->ext_csd.rev >= 8) { in mmc_decode_ext_csd()
646 card->ext_csd.cmdq_support = ext_csd[EXT_CSD_CMDQ_SUPPORT] & in mmc_decode_ext_csd()
648 card->ext_csd.cmdq_depth = (ext_csd[EXT_CSD_CMDQ_DEPTH] & in mmc_decode_ext_csd()
651 if (card->ext_csd.cmdq_depth <= 2) { in mmc_decode_ext_csd()
652 card->ext_csd.cmdq_support = false; in mmc_decode_ext_csd()
653 card->ext_csd.cmdq_depth = 0; in mmc_decode_ext_csd()
655 if (card->ext_csd.cmdq_support) { in mmc_decode_ext_csd()
658 card->ext_csd.cmdq_depth); in mmc_decode_ext_csd()
660 card->ext_csd.enhanced_rpmb_supported = in mmc_decode_ext_csd()
661 (card->ext_csd.rel_param & in mmc_decode_ext_csd()
670 u8 *ext_csd; in mmc_read_ext_csd() local
676 err = mmc_get_ext_csd(card, &ext_csd); in mmc_read_ext_csd()
701 err = mmc_decode_ext_csd(card, ext_csd); in mmc_read_ext_csd()
702 kfree(ext_csd); in mmc_read_ext_csd()
719 err = !((card->ext_csd.raw_partition_support == in mmc_compare_ext_csds()
721 (card->ext_csd.raw_erased_mem_count == in mmc_compare_ext_csds()
723 (card->ext_csd.rev == in mmc_compare_ext_csds()
725 (card->ext_csd.raw_ext_csd_structure == in mmc_compare_ext_csds()
727 (card->ext_csd.raw_card_type == in mmc_compare_ext_csds()
729 (card->ext_csd.raw_s_a_timeout == in mmc_compare_ext_csds()
731 (card->ext_csd.raw_hc_erase_gap_size == in mmc_compare_ext_csds()
733 (card->ext_csd.raw_erase_timeout_mult == in mmc_compare_ext_csds()
735 (card->ext_csd.raw_hc_erase_grp_size == in mmc_compare_ext_csds()
737 (card->ext_csd.raw_sec_trim_mult == in mmc_compare_ext_csds()
739 (card->ext_csd.raw_sec_erase_mult == in mmc_compare_ext_csds()
741 (card->ext_csd.raw_sec_feature_support == in mmc_compare_ext_csds()
743 (card->ext_csd.raw_trim_mult == in mmc_compare_ext_csds()
745 (card->ext_csd.raw_sectors[0] == in mmc_compare_ext_csds()
747 (card->ext_csd.raw_sectors[1] == in mmc_compare_ext_csds()
749 (card->ext_csd.raw_sectors[2] == in mmc_compare_ext_csds()
751 (card->ext_csd.raw_sectors[3] == in mmc_compare_ext_csds()
753 (card->ext_csd.raw_pwr_cl_52_195 == in mmc_compare_ext_csds()
755 (card->ext_csd.raw_pwr_cl_26_195 == in mmc_compare_ext_csds()
757 (card->ext_csd.raw_pwr_cl_52_360 == in mmc_compare_ext_csds()
759 (card->ext_csd.raw_pwr_cl_26_360 == in mmc_compare_ext_csds()
761 (card->ext_csd.raw_pwr_cl_200_195 == in mmc_compare_ext_csds()
763 (card->ext_csd.raw_pwr_cl_200_360 == in mmc_compare_ext_csds()
765 (card->ext_csd.raw_pwr_cl_ddr_52_195 == in mmc_compare_ext_csds()
767 (card->ext_csd.raw_pwr_cl_ddr_52_360 == in mmc_compare_ext_csds()
769 (card->ext_csd.raw_pwr_cl_ddr_200_360 == in mmc_compare_ext_csds()
786 MMC_DEV_ATTR(ffu_capable, "%d\n", card->ext_csd.ffu_capable);
792 MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
793 MMC_DEV_ATTR(pre_eol_info, "0x%02x\n", card->ext_csd.pre_eol_info);
795 card->ext_csd.device_life_time_est_typ_a,
796 card->ext_csd.device_life_time_est_typ_b);
799 card->ext_csd.enhanced_area_offset);
800 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
801 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
803 card->ext_csd.enhanced_rpmb_supported);
804 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
807 MMC_DEV_ATTR(cmdq_en, "%d\n", card->ext_csd.cmdq_en);
815 if (card->ext_csd.rev < 7) { in mmc_fwrev_show()
819 card->ext_csd.fwrev); in mmc_fwrev_show()
885 struct mmc_ext_csd *ext_csd = &card->ext_csd; in __mmc_select_powerclass() local
892 pwrclass_val = ext_csd->raw_pwr_cl_26_195; in __mmc_select_powerclass()
895 ext_csd->raw_pwr_cl_52_195 : in __mmc_select_powerclass()
896 ext_csd->raw_pwr_cl_ddr_52_195; in __mmc_select_powerclass()
898 pwrclass_val = ext_csd->raw_pwr_cl_200_195; in __mmc_select_powerclass()
910 pwrclass_val = ext_csd->raw_pwr_cl_26_360; in __mmc_select_powerclass()
913 ext_csd->raw_pwr_cl_52_360 : in __mmc_select_powerclass()
914 ext_csd->raw_pwr_cl_ddr_52_360; in __mmc_select_powerclass()
917 ext_csd->raw_pwr_cl_ddr_200_360 : in __mmc_select_powerclass()
918 ext_csd->raw_pwr_cl_200_360; in __mmc_select_powerclass()
938 card->ext_csd.generic_cmd6_time); in __mmc_select_powerclass()
983 max_dtr > card->ext_csd.hs200_max_dtr) in mmc_set_bus_speed()
984 max_dtr = card->ext_csd.hs200_max_dtr; in mmc_set_bus_speed()
985 else if (mmc_card_hs(card) && max_dtr > card->ext_csd.hs_max_dtr) in mmc_set_bus_speed()
986 max_dtr = card->ext_csd.hs_max_dtr; in mmc_set_bus_speed()
1035 card->ext_csd.generic_cmd6_time); in mmc_select_bus_width()
1073 card->ext_csd.generic_cmd6_time, MMC_TIMING_MMC_HS, in mmc_select_hs()
1104 card->ext_csd.generic_cmd6_time, in mmc_select_hs_ddr()
1173 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1189 max_dtr = card->ext_csd.hs_max_dtr; in mmc_select_hs400()
1203 card->ext_csd.generic_cmd6_time); in mmc_select_hs400()
1215 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400()
1263 max_dtr = card->ext_csd.hs_max_dtr; in mmc_hs400_to_hs200()
1269 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1285 EXT_CSD_BUS_WIDTH_8, card->ext_csd.generic_cmd6_time, in mmc_hs400_to_hs200()
1300 val, card->ext_csd.generic_cmd6_time, 0, in mmc_hs400_to_hs200()
1335 card_drv_type = card->ext_csd.raw_driver_strength | in mmc_select_driver_type()
1343 card->ext_csd.hs200_max_dtr, in mmc_select_driver_type()
1384 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1397 mmc_set_clock(host, card->ext_csd.hs_max_dtr); in mmc_select_hs400es()
1404 card->ext_csd.generic_cmd6_time); in mmc_select_hs400es()
1418 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs400es()
1483 card->ext_csd.generic_cmd6_time, 0, in mmc_select_hs200()
1709 if (card->ext_csd.rev >= 3) { in mmc_init_card()
1712 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1723 card->ext_csd.enhanced_area_offset = -EINVAL; in mmc_init_card()
1724 card->ext_csd.enhanced_area_size = -EINVAL; in mmc_init_card()
1726 card->ext_csd.erase_group_def = 1; in mmc_init_card()
1739 if (card->ext_csd.part_config & EXT_CSD_PART_CONFIG_ACC_MASK) { in mmc_init_card()
1740 card->ext_csd.part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; in mmc_init_card()
1742 card->ext_csd.part_config, in mmc_init_card()
1743 card->ext_csd.part_time); in mmc_init_card()
1751 if (card->ext_csd.rev >= 6) { in mmc_init_card()
1755 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1764 card->ext_csd.power_off_notification = EXT_CSD_POWER_ON; in mmc_init_card()
1812 if (card->ext_csd.hpi) { in mmc_init_card()
1815 card->ext_csd.generic_cmd6_time); in mmc_init_card()
1821 card->ext_csd.hpi_en = 0; in mmc_init_card()
1823 card->ext_csd.hpi_en = 1; in mmc_init_card()
1834 if (card->ext_csd.cache_size > 0) { in mmc_init_card()
1837 timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); in mmc_init_card()
1849 card->ext_csd.cache_ctrl = 0; in mmc_init_card()
1851 card->ext_csd.cache_ctrl = 1; in mmc_init_card()
1859 card->ext_csd.cmdq_en = false; in mmc_init_card()
1860 if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { in mmc_init_card()
1867 card->ext_csd.cmdq_support = false; in mmc_init_card()
1868 card->ext_csd.cmdq_depth = 0; in mmc_init_card()
1876 card->reenable_cmdq = card->ext_csd.cmdq_en; in mmc_init_card()
1883 if (card->ext_csd.cmdq_en) { in mmc_init_card()
1916 return card->ext_csd.rev >= 3; in mmc_can_sleep()
1931 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); in mmc_sleep()
1976 (card->ext_csd.power_off_notification == EXT_CSD_POWER_ON); in mmc_can_poweroff_notify()
1981 unsigned int timeout = card->ext_csd.generic_cmd6_time; in mmc_poweroff_notify()
1986 timeout = card->ext_csd.power_off_longtime; in mmc_poweroff_notify()
1996 card->ext_csd.power_off_notification = EXT_CSD_NO_POWER_NOTIFICATION; in mmc_poweroff_notify()
2046 return host->card->ext_csd.cache_size > 0 && in _mmc_cache_enabled()
2047 host->card->ext_csd.cache_ctrl & 1; in _mmc_cache_enabled()
2207 rst_n_function = card->ext_csd.rst_n_function; in mmc_can_reset()